Frame 2
ifFrameLoaded (53) {
gotoAndPlay (45);
}
Frame 4
if (_root.gamezhero == undefined) {
System.security.allowDomain("gamezhero.com", "www.gamezhero.com", "files.gamezhero.com");
_root.createEmptyMovieClip("gamezhero", 100000);
_root.gamezhero.loadMovie("http://files.gamezhero.com/flash/gamezhero2.swf?x=-100&y=-100&from=bobobo&scale=100&t=1131695977671");
}
function checkLoaded() {
percentBytes = (_root.getBytesLoaded() * 100) / _root.getBytesTotal();
displayPercent = Math.round(percentBytes) + "%";
return(percentBytes);
}
Frame 6
amountLoaded = checkLoaded();
LoadingBar._xscale = amountLoaded;
if (amountLoaded < 100) {
gotoAndPlay ("Loading");
}
Frame 8
gotoAndPlay (45);
Frame 47
stop();
Frame 50
stop();
Frame 51
MusicMap.gotoAndPlay("Play");
Frame 52
function BeginCombat(whichLocation) {
fightLocation = whichLocation;
inCombat = 1;
EnemyPower = 0;
PlayerHealth = 100;
playerState = "idle";
boboboPower = 0;
BoboBar._visible = 1;
EnemyBar._visible = 1;
NoseHairAnimations._visible = 1;
loadEnemy();
MusicFightPlay();
MusicMapStop();
}
function checkAutoWindup() {
if (wantstoWindUp == 1) {
BeginWindUp();
}
}
function BeginWindUp() {
if ((inCombat == 1) and (playerState == "idle")) {
wantstoWindUp = 0;
windUpAmount = 0;
readyToAttack = 0;
playerState = "windingUp";
PowerUpFX.gotoAndPlay("Power1");
}
}
function BeginAttack() {
if ((inCombat == 1) and (playerState == "windingUp")) {
readyToAttack = 1;
hitLocation = getCurrentSector();
}
}
function playerAttack() {
if ((inCombat == 1) and (playerState == "windingUp")) {
addAttackTime();
trace("attackTimes: " + attackTimes);
recoverAmount = windUpAmount / 4;
playerState = "attacking";
NoseHairAnimations.gotoAndPlay("Attack" + hitLocation);
}
}
function attackTimeKeep() {
currentTime = getTimer();
newList = [];
var _local1 = 0;
while (_local1 < attackTimes.length) {
if ((currentTime - attackTimes[_local1]) < 5000) {
newList.push(attackTimes[_local1]);
}
_local1++;
}
attackTimes = newList;
}
function addAttackTime() {
currentTime = getTimer();
attackTimes.push(currentTime);
}
function BlockAttack() {
playerState = "blocking";
whichSector = getCurrentSector();
Enemy.pauseLength = Enemy.pauseLength + 30;
NoseHairAnimations.gotoAndPlay("Block" + whichSector);
}
function Stunned(stunnedLength) {
playerState = "stunned";
recoverAmount = 0;
stunnedAmount = 13;
NoseHairAnimations.gotoAndPlay("Hit");
}
function checkEnemyAttack(EnemySector) {
playerSector = getCurrentSector();
trace((("Player sector: " + playerSector) + " -- Enemy sector: ") + EnemySector);
if (((playerSector == EnemySector) and (playerState != "stunned")) and (playerState != "recovering")) {
trace("Player blocked");
BlockAttack();
} else {
EnemyWindup = Enemy.attackState;
damageDone = (5 + (40 * (Enemy.Strength / 100))) + (65 * (EnemyWindup / 100));
trace("Player hit for: " + damageDone);
changePlayerHealth(-damageDone);
Stunned(attackState);
if (Enemy.lastHits.length < 10) {
Enemy.lastHits.shift();
}
Enemy.lastHits.push(EnemyWindup);
}
}
function getCurrentSector() {
if (hitLocation == null) {
return(coordinateToSector(this._xmouse, this._ymouse));
}
return(hitLocation);
}
function coordinateToSector(xCoordinate, yCoordinate) {
if (xCoordinate < 200) {
xHit = "1";
} else if (xCoordinate < 400) {
xHit = "2";
} else {
xHit = "3";
}
if (yCoordinate < 133) {
yHit = "A";
} else if (yCoordinate < 266) {
yHit = "B";
} else {
yHit = "C";
}
whichSector = yHit + xHit;
return(whichSector);
}
function sectorToCoordinate(whichSector) {
ySector = whichSector.slice(0, 1);
xSector = whichSector.slice(1, 2);
if (xSector == "1") {
xCoordinate = 100;
} else if (xSector == "2") {
xCoordinate = 300;
} else if (xSector == "3") {
xCoordinate = 500;
}
if (ySector == "A") {
yCoordinate = 67;
} else if (ySector == "B") {
yCoordinate = 200;
} else if (ySector == "C") {
yCoordinate = 333;
}
newCoordinates = [xCoordinate, yCoordinate];
return(newCoordinates);
}
function CheckHit() {
if (Enemy.getCurrentSector() == hitLocation) {
Enemy.blockAttack(hitLocation);
} else {
NoseHairAnimations.Hit.gotoAndPlay("Play");
damageDone = 5 + (75 * (boboboPower / 100));
changeEnemyHealth(-damageDone);
Enemy.hitByPlayer(hitLocation);
}
hitLocation = null;
boboboPower = 0;
}
function changePlayerHealth(healthAmount) {
if (cheatInvincibility == 0) {
PlayerHealth = PlayerHealth + healthAmount;
if (PlayerHealth <= 0) {
PlayerHealth = 0;
inCombat = 0;
}
} else {
trace("Cheat active -- Player is INVINCIBLE!");
}
}
function changeEnemyHealth(healthAmount) {
Enemy.hitPoints = Enemy.hitPoints + healthAmount;
if (Enemy.hitPoints <= 0) {
Enemy.hitPoints = 0;
Enemy.Die();
inCombat = 0;
}
}
function EndCombat() {
inCombat = 0;
NoseHair.clear();
NoseHairAnimations._visible = 0;
Enemy.removeMovieClip();
}
function AreaCleared() {
EndCombat();
if (fightLocation == "Castle") {
BoboBar.removeMovieClip();
EnemyBar.removeMovieClip();
NoseHairAnimations.removeMovieClip();
gotoAndPlay (53);
} else {
Map.setCleared(fightLocation);
Map.setLocation(fightLocation);
CutScene.gotoAndPlay("Win");
CutScene._visible = 1;
Map._visible = 1;
BoboBar._visible = 0;
EnemyBar._visible = 0;
}
}
function AreaLost() {
EndCombat();
Map._visible = 1;
BoboBar._visible = 0;
EnemyBar._visible = 0;
}
function loadEnemy() {
EnemyAggression = 50;
EnemyPerception = 10;
EnemyIntelligence = 80;
EnemySpeed = 40;
EnemyStrength = 50;
if (fightLocation == "Castle") {
EnemyName = "Enemy_Boss";
EnemyHealth = 500;
EnemyAggression = 40;
EnemyPerception = 100;
EnemyIntelligence = 100;
EnemySpeed = 80;
EnemyStrength = 80;
} else if (fightLocation == "Market") {
EnemyName = "Enemy_C";
EnemyHealth = 160;
EnemyAggression = 50;
EnemyPerception = 10;
EnemyIntelligence = 20;
EnemySpeed = 20;
EnemyStrength = 20;
} else if (fightLocation == "Dojo") {
EnemyName = "Enemy_F";
EnemyHealth = 140;
EnemyAggression = 50;
EnemyPerception = 30;
EnemyIntelligence = 10;
EnemySpeed = 60;
EnemyStrength = 0;
} else if (fightLocation == "Bank") {
EnemyName = "Enemy_D";
EnemyHealth = 220;
EnemyAggression = 30;
EnemyPerception = 0;
EnemyIntelligence = 10;
EnemySpeed = 0;
EnemyStrength = 60;
} else if (fightLocation == "Library") {
EnemyName = "Enemy_G";
EnemyHealth = 200;
EnemyAggression = 20;
EnemyPerception = 40;
EnemyIntelligence = 60;
EnemySpeed = 0;
EnemyStrength = 10;
} else if (fightLocation == "TownSquare") {
EnemyName = "Enemy_B";
EnemyHealth = 300;
EnemyAggression = 70;
EnemyPerception = 10;
EnemyIntelligence = 0;
EnemySpeed = 0;
EnemyStrength = 40;
} else if (fightLocation == "Warehouse") {
EnemyName = "Enemy_C";
EnemyHealth = 260;
EnemyAggression = 60;
EnemyPerception = 70;
EnemyIntelligence = 40;
EnemySpeed = 0;
EnemyStrength = 10;
} else if (fightLocation == "Mill") {
EnemyName = "Enemy_E";
EnemyHealth = 350;
EnemyAggression = 30;
EnemyPerception = 10;
EnemyIntelligence = 40;
EnemySpeed = 20;
EnemyStrength = 60;
} else if (fightLocation == "Bridge") {
EnemyName = "Enemy_A";
EnemyHealth = 350;
EnemyAggression = 60;
EnemyPerception = 75;
EnemyIntelligence = 30;
EnemySpeed = 90;
EnemyStrength = 60;
}
Enemy = this.attachMovie(EnemyName, "Enemy", 105);
Enemy._x = 310;
Enemy._y = 214.3;
Enemy.currentlyAlive = 1;
Enemy.hitPoints = EnemyHealth;
Enemy.Aggression = EnemyAggression;
Enemy.Perception = EnemyPerception;
Enemy.Intelligence = EnemyIntelligence;
Enemy.Speed = EnemySpeed;
Enemy.Strength = EnemyStrength;
Enemy.gotoAndPlay("IdleLoop");
EnemyBar.Faces.gotoAndPlay(EnemyName);
}
function setDepth(depth) {
swapDepths.call(this, depth);
}
Map._x = 300;
Map._y = 200;
CutScene._x = 300;
CutScene._y = 200;
CutScene._visible = 0;
BoboBar._visible = 0;
EnemyBar._visible = 0;
inCombat = 0;
fightLocation = null;
stunnedAmount = 0;
recoverAmount = 0;
windUpAmount = 0;
playerState = "idle";
attackTimes = [];
readyToAttack = 0;
hitLocation = null;
wantstoWindUp = 0;
cheatInvincibility = 0;
mouseState = 0;
stop();
Object.prototype.addProperty("_depth", getDepth, this.setDepth);
function checkPlayerDeath() {
if (PlayerHealth == 0) {
deathCounter++;
if (deathCounter > 50) {
PlayerHealth = 100;
EndCombat();
CutScene._visible = 1;
Map._visible = 1;
BoboBar._visible = 0;
EnemyBar._visible = 0;
CutScene.gotoAndPlay("Lose");
}
} else {
deathCounter = 0;
}
}
function trackMouseVelocity() {
xDistance = xMouseLast - this._xmouse;
yDistance = yMouseLast - this._ymouse;
totalDistance = Math.sqrt((xDistance * xDistance) + (yDistance * yDistance));
if (totalDistance > 80) {
SoundFX.PlayerSwish();
}
xMouseLast = this._xmouse;
yMouseLast = this._ymouse;
}
function codeNoseHair() {
xWindUp = 300;
yWindUp = 300;
if (playerState == "windingUp") {
windUpAmount++;
boboboPower = (windUpAmount / 60) * 100;
if (boboboPower > 100) {
boboboPower = 100;
}
if (windUpAmount <= 6) {
xPosition = xWindUp + ((this._xmouse - xWindUp) * (0.75 - (windUpAmount / 12)));
yPosition = yWindUp + ((this._ymouse - yWindUp) * (0.75 - (windUpAmount / 12)));
addLength = windUpAmount * 20;
drawHair(xPosition, yPosition, addLength);
} else {
xPosition = xWindUp + ((this._xmouse - xWindUp) * 0.25);
yPosition = yWindUp + ((this._ymouse - yWindUp) * 0.25);
addLength = windUpAmount * 20;
if (addLength > 300) {
addLength = 300;
}
drawHair(xPosition, yPosition, 200);
}
} else {
windUpAmount = 0;
xPosition = xWindUp + ((this._xmouse - xWindUp) * 0.75);
yPosition = yWindUp + ((this._ymouse - yWindUp) * 0.75);
drawHair(xPosition, yPosition, 0);
}
}
function drawHair(xPosition, yPosition, LengthModifier) {
if (NoseHair == undefined) {
NoseHair = createEmptyMovieClip("NoseHair", 108);
}
if (LeftHairLengthOffset > 0) {
LeftHairLengthVelocity = LeftHairLengthVelocity - (random(5) / 50);
} else {
LeftHairLengthVelocity = LeftHairLengthVelocity + (random(5) / 50);
}
LeftHairLengthOffset = LeftHairLengthOffset + LeftHairLengthVelocity;
if (RightHairLengthOffset > 0) {
RightHairLengthVelocity = RightHairLengthVelocity - (random(5) / 50);
} else {
RightHairLengthVelocity = RightHairLengthVelocity + (random(5) / 50);
}
RightHairLengthOffset = RightHairLengthOffset + RightHairLengthVelocity;
if (LeftHairLengthOffset < -50) {
LeftHairLengthVelocity = 0;
}
if (RightHairLengthOffset < -50) {
RightHairLengthVelocity = 0;
}
fractionBase = 8;
if (xLeftOffset > 0) {
xLeftOffsetVelocity = xLeftOffsetVelocity - (random(4) / fractionBase);
} else {
xLeftOffsetVelocity = xLeftOffsetVelocity + (random(4) / fractionBase);
}
if (yLeftOffset > 0) {
yLeftOffsetVelocity = yLeftOffsetVelocity - (random(4) / fractionBase);
} else {
yLeftOffsetVelocity = yLeftOffsetVelocity + (random(4) / fractionBase);
}
if (xRightOffset > 0) {
xRightOffsetVelocity = xRightOffsetVelocity - (random(4) / fractionBase);
} else {
xRightOffsetVelocity = xRightOffsetVelocity + (random(4) / fractionBase);
}
if (yRightOffset > 0) {
yRightOffsetVelocity = yRightOffsetVelocity - (random(4) / fractionBase);
} else {
yRightOffsetVelocity = yRightOffsetVelocity + (random(4) / fractionBase);
}
xLeftOffset = xLeftOffset + xLeftOffsetVelocity;
yLeftOffset = yLeftOffset + yLeftOffsetVelocity;
if (Math.abs(xLeftOffset) > 100) {
xLeftOffsetVelocity = 0;
} else if (Math.abs(yLeftOffset) > 100) {
yLeftOffsetVelocity = 0;
}
xRightOffset = xRightOffset + xRightOffsetVelocity;
yRightOffset = yRightOffset + yRightOffsetVelocity;
if (Math.abs(xRightOffset) > 100) {
xRightOffsetVelocity = 0;
} else if (Math.abs(yRightOffset) > 100) {
yRightOffsetVelocity = 0;
}
HairLength = 600 + LengthModifier;
if (LengthModifier > 0) {
RightHairLengthOffset = RightHairLengthOffset * 0.2;
LeftHairLengthOffset = LeftHairLengthOffset * 0.2;
}
NoseHair.clear();
NoseHair.lineStyle(1, 0, 100);
LeftHairLength = HairLength + LeftHairLengthOffset;
xLeftPosition = (xPosition + xLeftOffset) - 20;
yLeftPosition = yPosition + yLeftOffset;
xStart = 250;
yStart = 420;
xDistance = xLeftPosition - xStart;
yDistance = yLeftPosition - yStart;
xPoint1 = xStart;
yPoint1 = yStart;
xPoint2 = xStart + (xDistance * 0.545454545454545);
yPoint2 = yStart + (yDistance * 0.545454545454545);
xPoint3 = xStart + (xDistance * 0.818181818181818);
yPoint3 = yStart + (yDistance * 0.818181818181818);
xPoint4 = xStart + (xDistance * 1);
yPoint4 = yStart + (yDistance * 1);
HairCurve(xPoint1, yPoint1, xPoint2, yPoint2, (LeftHairLength * 6) / 11, -1, 10, 5.45);
HairCurve(xPoint2, yPoint2, xPoint3, yPoint3, (LeftHairLength * 3) / 11, 1, 5.45, 2.72);
HairCurve(xPoint3, yPoint3, xPoint4, yPoint4, (LeftHairLength * 2) / 11, -1, 2.72, 0);
RightHairLength = HairLength + RightHairLengthOffset;
xRightPosition = (xPosition + xRightOffset) + 20;
yRightPosition = yPosition + yRightOffset;
xStart = 350;
yStart = 420;
xDistance = xRightPosition - xStart;
yDistance = yRightPosition - yStart;
xPoint1 = xStart;
yPoint1 = yStart;
xPoint2 = xStart + (xDistance * 0.545454545454545);
yPoint2 = yStart + (yDistance * 0.545454545454545);
xPoint3 = xStart + (xDistance * 0.818181818181818);
yPoint3 = yStart + (yDistance * 0.818181818181818);
xPoint4 = xStart + (xDistance * 1);
yPoint4 = yStart + (yDistance * 1);
HairCurve(xPoint1, yPoint1, xPoint2, yPoint2, (RightHairLength * 6) / 11, 1, 10, 5.45);
HairCurve(xPoint2, yPoint2, xPoint3, yPoint3, (RightHairLength * 3) / 11, -1, 5.45, 2.72);
HairCurve(xPoint3, yPoint3, xPoint4, yPoint4, (RightHairLength * 2) / 11, 1, 2.72, 0);
}
function HairCurve(xStart, yStart, xEnd, yEnd, segmentLength, curveDirection, StartWidth, EndWidth) {
xDistance = xEnd - xStart;
yDistance = yEnd - yStart;
distanceOffset = Math.sqrt((xDistance * xDistance) + (yDistance * yDistance));
controlOffset = segmentLength - distanceOffset;
if (controlOffset < Math.abs(xDistance / 2)) {
controlOffset = Math.abs(xDistance / 2);
}
xControl = (xStart + (xDistance / 2)) + (curveDirection * controlOffset);
yControl = yStart + (yDistance / 2);
xLineOffset = Math.abs(xDistance) / (Math.abs(xDistance) + Math.abs(yDistance));
yLineOffset = Math.abs(yDistance) / (Math.abs(xDistance) + Math.abs(yDistance));
xStart1 = xStart + (yLineOffset * StartWidth);
xStart2 = xStart - (yLineOffset * StartWidth);
yStart1 = yStart;
yStart2 = yStart;
xControl1 = xControl + ((yLineOffset * (StartWidth + EndWidth)) / 2);
xControl2 = xControl - ((yLineOffset * (StartWidth + EndWidth)) / 2);
yControl1 = yControl;
yControl2 = yControl;
xEnd1 = xEnd + (yLineOffset * EndWidth);
xEnd2 = xEnd - (yLineOffset * EndWidth);
yEnd1 = yEnd;
yEnd2 = yEnd;
NoseHair.beginFill(0, 100);
NoseHair.moveTo(xStart1, yStart1);
NoseHair.curveTo(xControl1, yControl1, xEnd1, yEnd2);
NoseHair.lineTo(xEnd2, yEnd2);
NoseHair.curveTo(xControl2, yControl2, xStart2, yStart2);
NoseHair.endFill();
}
xLeftOffset = 0;
xLeftOffsetVelocity = 3;
yLeftOffset = 0;
yLeftOffsetVelocity = 3;
xRightOffset = 0;
xRightOffsetVelocity = -3;
yRightOffset = 0;
yRightOffsetVelocity = 3;
LeftHairLengthOffset = 0;
LeftHairLengthVelocity = 5;
RightHairLengthOffset = 0;
RightHairLengthVelocity = 5;
xHitLocation = 0;
yHitLocation = 0;
deathCounter = 0;
xMouseLast = 0;
yMouseLast = 0;
BoboBar._depth = 110;
EnemyBar._depth = 111;
NoseHairAnimations._depth = 109;
debugEnemy._depth = 200;
debugEnemy.removeMovieClip();
this.onEnterFrame = function () {
keyboardListen.update();
attackTimeKeep();
checkPlayerDeath();
if (inCombat == 1) {
if (playerState == "idle") {
boboboPower = 0;
trackMouseVelocity();
codeNoseHair();
} else if (playerState == "windingUp") {
codeNoseHair();
if ((readyToAttack == 1) and (windUpAmount > 10)) {
playerAttack();
}
} else {
NoseHair.clear();
if (stunnedAmount > 0) {
stunnedAmount--;
}
if (recoverAmount > 0) {
recoverAmount--;
}
}
} else {
NoseHair.clear();
}
checkAutoWindup();
};
function checkCheats() {
if ((((keyList[72] > 0) and (keyList[65] > 0)) and (keyList[73] > 0)) and (keyList[82] > 0)) {
if (cheatInvincibility == 0) {
cheatInvincibility = 1;
trace("invincibility on");
}
}
if (((((keyList[87] > 0) and (keyList[65] > 0)) and (keyList[88] > 0)) and (keyList[73] > 0)) and (keyList[84] > 0)) {
Map.mapCheat();
}
if (((keyList[69] < 0) or (keyList[74] > 0)) or (keyList[86] > 0)) {
var _local1 = 0;
while (_local1 < 255) {
keyList[_local1] = 0;
_local1++;
}
}
if (keyList[48] > 0) {
cheatInvincibility = 0;
}
}
keyList = [];
var i = 0;
while (i < 255) {
keyList.push(0);
i++;
}
var keyboardListen = new Object();
keyboardListen.onKeyDown = function () {
keyList[Key.getCode()]++;
};
keyboardListen.onKeyUp = function () {
};
keyboardListen.update = function () {
var _local1 = 0;
while (_local1 < keyList.length) {
if (keyList[_local1] == 1) {
keyList[_local1]++;
}
_local1++;
}
checkCheats();
};
Key.addListener(keyboardListen);
function MusicFightPlay() {
MusicFight.gotoAndPlay("Play");
}
function MusicFightStop() {
MusicFight.gotoAndPlay("Stop");
}
function MusicMapPlay() {
MusicMap.gotoAndPlay("Play");
}
function MusicMapStop() {
MusicMap.gotoAndPlay("Stop");
}
Frame 53
stopAllSounds();
Frame 109
stop();
Symbol 62 MovieClip Frame 33
stop();
Symbol 102 MovieClip Frame 8
stop();
Symbol 148 MovieClip [Enemy_A] Frame 1
function changeIdle() {
if (currentlyAlive == 1) {
if (currentlyIdle == 1) {
enemyState = "idle";
newIdle = "Idle" + currentSector;
if (newIdle != idleSector) {
_parent.SoundFX.EnemyIdle();
}
idleSector = newIdle;
gotoAndPlay(newIdle);
}
}
}
function returnIdle() {
currentlyIdle = 1;
changeIdle();
}
function stepCycle() {
if ((currentlyIdle == 1) and (currentlyAlive == 1)) {
aggressionModifier = 0.1;
boboboWindup = _parent.boboboPower;
RecentAttacks = _parent.attackTimes.length;
if (RecentAttacks > 2) {
aggressionModifier = 0;
} else if (boboboWindup > 10) {
modifiedPerception = Perception + (boboboWindup * 0.5);
perceptionRoll = percentileCheck(Perception);
intelligenceRoll = percentileCheck(Intelligence);
if (perceptionRoll >= 0) {
if (intelligenceRoll >= 0) {
aggressionModifier = 100;
windupPreset = 1;
} else {
aggressionModifier = 0;
}
}
}
modifiedAggression = Aggression * aggressionModifier;
if (percentileCheck(modifiedAggression) >= 0) {
trace("Attacking at " + (getTimer() / 1000));
playerSector = guessPlayerSector();
attackSector = pickTargetLocation(playerSector);
beginAttack(attackSector);
} else {
currentSector = guessPlayerSector();
}
}
}
function getCurrentSector() {
return(currentSector);
}
function getPower() {
currentPower = attackState;
return(currentPower);
}
function blockAttack(whichSector) {
if (currentlyAlive == 1) {
currentlyIdle = 0;
gotoAndPlay("Block" + currentSector);
enemyState = "blocking";
}
}
function beginAttack(whichSector) {
currentSector = whichSector;
currentlyIdle = 0;
attackState = 1;
if (windupPreset > 0) {
windupFull = windupPreset;
windupPreset = 0;
} else if ((percentileCheck(Intelligence) >= 0) and (lastHits.length == 10)) {
lastHitCount = 0;
var _local1 = 0;
while (_local1 < lastHits.length) {
lastHitCount = lastHitCount + lastHits[_local1];
_local1++;
}
lastHitAverage = lastHitCount / lastHits.length;
trace(((("Average hitting windup is " + lastHitAverage) + " -- (") + lastHits) + ")");
windupFull = (lastHitAverage + random(11)) - 5;
if (windupFull > 100) {
windupFull = 100;
}
} else {
windupFull = random(100);
}
pauseLength = windupFull / 5;
gotoAndPlay("Attack" + whichSector);
enemyState = "windingUp";
}
function windupCheck() {
if (attackState > 0) {
if (attackState < windupFull) {
boboboWindup = _parent.boboboPower;
if (boboboWindup > 0) {
modifiedPerception = Perception + (boboboWindup * 0.5);
perceptionRoll = percentileCheck(Perception);
intelligenceRoll = percentileCheck(Intelligence);
if (perceptionRoll >= 0) {
if (intelligenceRoll >= 0) {
currentSector = guessPlayerSector();
}
}
}
attackState = (attackState + 1) + (Speed / 25);
gotoAndPlay("WindupCheck" + currentSector);
} else {
enemyState = "attacking";
}
}
}
function attackPause() {
if (pauseLength > 0) {
pauseLength--;
gotoAndPlay("AttackPause" + currentSector);
}
}
function hitByPlayer(whichSector) {
if (currentlyAlive == 1) {
currentSector = whichSector;
currentlyIdle = 0;
pauseLength = 0;
attackState = 0;
gotoAndPlay("Hit" + currentSector);
enemyState = "stunned";
}
}
function attackHit() {
_parent.checkEnemyAttack(currentSector);
attackState = 0;
}
function Die() {
if (currentlyAlive == 1) {
currentlyAlive = 0;
currentlyIdle = 0;
gotoAndPlay ("Die");
}
}
function percentileCheck(percentChance) {
randomNumber = random(100) + 1;
percentDifference = percentChance - randomNumber;
return(percentDifference);
}
function guessPlayerSector() {
actualPlayerSector = _parent.getCurrentSector();
boboboWindup = _parent.boboboPower;
modifiedPerception = Perception + (boboboWindup * 0.25);
RecentAttacks = _parent.attackTimes.length;
if (RecentAttacks > 2) {
modifiedPerception = 100;
}
perceptionRoll = percentileCheck(modifiedPerception);
if (perceptionRoll >= 0) {
return(actualPlayerSector);
}
xCurrent = _parent._xmouse;
yCurrent = _parent._ymouse;
xMiss = xCurrent + (random(perceptionRoll * -12) / 2);
if (xMiss > 600) {
xMiss = 600 - (xMiss - 600);
} else if (xMiss < 0) {
xMiss = -xMiss;
}
yMiss = yCurrent + (random(perceptionRoll * -8) / 2);
if (yMiss > 400) {
yMiss = 400 - (yMiss - 400);
} else if (yMiss < 0) {
yMiss = -yMiss;
}
guessedSector = _parent.coordinateToSector(xMiss, yMiss);
return(guessedSector);
}
function pickTargetLocation(playerSector) {
if (playerSector == "A1") {
possibleSectors = ["A3", "B2", "B3", "C1", "C2", "C3"];
} else if (playerSector == "A2") {
possibleSectors = ["B1", "B3", "C1", "C2", "C3"];
} else if (playerSector == "A3") {
possibleSectors = ["A1", "B1", "B2", "C1", "C2", "C3"];
} else if (playerSector == "B1") {
possibleSectors = ["A2", "A3", "B3", "C2", "C3"];
} else if (playerSector == "B2") {
possibleSectors = ["A1", "A3", "C1", "C3"];
} else if (playerSector == "B3") {
possibleSectors = ["A1", "A2", "B1", "C1", "C2"];
} else if (playerSector == "C1") {
possibleSectors = ["A1", "A2", "A3", "B2", "B3", "C3"];
} else if (playerSector == "C2") {
possibleSectors = ["A1", "A2", "A3", "B1", "B3"];
} else if (playerSector == "C3") {
possibleSectors = ["A1", "A2", "A3", "B1", "B2", "C1"];
}
trace("DEBUG -- possiblesectors is " + possibleSectors);
whichSector = possibleSectors[random(possibleSectors.length)];
trace("DEBUG -- sector chosen: " + whichSector);
return(whichSector);
}
currentlyIdle = 1;
currentSector = "B2";
lastUpdate = getTimer();
changeIdle();
enemyState = "idle";
attackState = 0;
windupFull = 0;
pauseLength = 0;
idleSector = null;
windupPreset = 0;
lastHits = [];
this.onEnterFrame = function () {
if ((currentlyAlive == 1) and (_parent.inCombat == 1)) {
RecentAttacks = _parent.attackTimes.length;
if (RecentAttacks > 2) {
changeIdle();
}
currentTime = getTimer();
if ((currentTime - lastUpdate) > 100) {
lastUpdate = currentTime;
stepCycle();
}
}
};
Symbol 148 MovieClip [Enemy_A] Frame 2
currentlyIdle = 1;
Symbol 148 MovieClip [Enemy_A] Frame 22
if (continueIdle == 1) {
gotoAndPlay ("IdleLoop");
}
Symbol 148 MovieClip [Enemy_A] Frame 43
changeIdle();
Symbol 148 MovieClip [Enemy_A] Frame 64
changeIdle();
Symbol 148 MovieClip [Enemy_A] Frame 85
changeIdle();
Symbol 148 MovieClip [Enemy_A] Frame 106
changeIdle();
Symbol 148 MovieClip [Enemy_A] Frame 127
changeIdle();
Symbol 148 MovieClip [Enemy_A] Frame 148
changeIdle();
Symbol 148 MovieClip [Enemy_A] Frame 169
changeIdle();
Symbol 148 MovieClip [Enemy_A] Frame 190
changeIdle();
Symbol 148 MovieClip [Enemy_A] Frame 211
changeIdle();
Symbol 148 MovieClip [Enemy_A] Frame 221
Symbol 148 MovieClip [Enemy_A] Frame 222
windupCheck();
Symbol 148 MovieClip [Enemy_A] Frame 224
attackHit();
Symbol 148 MovieClip [Enemy_A] Frame 229
attackPause();
Symbol 148 MovieClip [Enemy_A] Frame 234
returnIdle();
Symbol 148 MovieClip [Enemy_A] Frame 244
Symbol 148 MovieClip [Enemy_A] Frame 245
windupCheck();
Symbol 148 MovieClip [Enemy_A] Frame 247
attackHit();
Symbol 148 MovieClip [Enemy_A] Frame 252
attackPause();
Symbol 148 MovieClip [Enemy_A] Frame 257
returnIdle();
Symbol 148 MovieClip [Enemy_A] Frame 267
Symbol 148 MovieClip [Enemy_A] Frame 268
windupCheck();
Symbol 148 MovieClip [Enemy_A] Frame 270
attackHit();
Symbol 148 MovieClip [Enemy_A] Frame 275
attackPause();
Symbol 148 MovieClip [Enemy_A] Frame 280
returnIdle();
Symbol 148 MovieClip [Enemy_A] Frame 290
Symbol 148 MovieClip [Enemy_A] Frame 291
windupCheck();
Symbol 148 MovieClip [Enemy_A] Frame 293
attackHit();
Symbol 148 MovieClip [Enemy_A] Frame 298
attackPause();
Symbol 148 MovieClip [Enemy_A] Frame 303
returnIdle();
Symbol 148 MovieClip [Enemy_A] Frame 313
Symbol 148 MovieClip [Enemy_A] Frame 314
windupCheck();
Symbol 148 MovieClip [Enemy_A] Frame 316
attackHit();
Symbol 148 MovieClip [Enemy_A] Frame 321
attackPause();
Symbol 148 MovieClip [Enemy_A] Frame 326
returnIdle();
Symbol 148 MovieClip [Enemy_A] Frame 336
Symbol 148 MovieClip [Enemy_A] Frame 337
windupCheck();
Symbol 148 MovieClip [Enemy_A] Frame 339
attackHit();
Symbol 148 MovieClip [Enemy_A] Frame 344
attackPause();
Symbol 148 MovieClip [Enemy_A] Frame 349
returnIdle();
Symbol 148 MovieClip [Enemy_A] Frame 359
Symbol 148 MovieClip [Enemy_A] Frame 360
windupCheck();
Symbol 148 MovieClip [Enemy_A] Frame 362
attackHit();
Symbol 148 MovieClip [Enemy_A] Frame 367
attackPause();
Symbol 148 MovieClip [Enemy_A] Frame 372
returnIdle();
Symbol 148 MovieClip [Enemy_A] Frame 382
Symbol 148 MovieClip [Enemy_A] Frame 383
windupCheck();
Symbol 148 MovieClip [Enemy_A] Frame 385
attackHit();
Symbol 148 MovieClip [Enemy_A] Frame 390
attackPause();
Symbol 148 MovieClip [Enemy_A] Frame 395
returnIdle();
Symbol 148 MovieClip [Enemy_A] Frame 405
Symbol 148 MovieClip [Enemy_A] Frame 406
windupCheck();
Symbol 148 MovieClip [Enemy_A] Frame 408
attackHit();
Symbol 148 MovieClip [Enemy_A] Frame 413
attackPause();
Symbol 148 MovieClip [Enemy_A] Frame 418
returnIdle();
Symbol 148 MovieClip [Enemy_A] Frame 431
returnIdle();
Symbol 148 MovieClip [Enemy_A] Frame 444
returnIdle();
Symbol 148 MovieClip [Enemy_A] Frame 457
returnIdle();
Symbol 148 MovieClip [Enemy_A] Frame 470
returnIdle();
Symbol 148 MovieClip [Enemy_A] Frame 483
returnIdle();
Symbol 148 MovieClip [Enemy_A] Frame 496
returnIdle();
Symbol 148 MovieClip [Enemy_A] Frame 509
returnIdle();
Symbol 148 MovieClip [Enemy_A] Frame 522
returnIdle();
Symbol 148 MovieClip [Enemy_A] Frame 535
returnIdle();
Symbol 148 MovieClip [Enemy_A] Frame 548
returnIdle();
Symbol 148 MovieClip [Enemy_A] Frame 561
returnIdle();
Symbol 148 MovieClip [Enemy_A] Frame 574
returnIdle();
Symbol 148 MovieClip [Enemy_A] Frame 587
returnIdle();
Symbol 148 MovieClip [Enemy_A] Frame 600
returnIdle();
Symbol 148 MovieClip [Enemy_A] Frame 613
returnIdle();
Symbol 148 MovieClip [Enemy_A] Frame 626
returnIdle();
Symbol 148 MovieClip [Enemy_A] Frame 639
returnIdle();
Symbol 148 MovieClip [Enemy_A] Frame 652
returnIdle();
Symbol 148 MovieClip [Enemy_A] Frame 713
_parent.AreaCleared();
stop();
Symbol 163 MovieClip [Enemy_B] Frame 1
function changeIdle() {
if (currentlyAlive == 1) {
if (currentlyIdle == 1) {
enemyState = "idle";
newIdle = "Idle" + currentSector;
if (newIdle != idleSector) {
_parent.SoundFX.EnemyIdle();
}
idleSector = newIdle;
gotoAndPlay(newIdle);
}
}
}
function returnIdle() {
currentlyIdle = 1;
changeIdle();
}
function stepCycle() {
if ((currentlyIdle == 1) and (currentlyAlive == 1)) {
aggressionModifier = 0.1;
boboboWindup = _parent.boboboPower;
RecentAttacks = _parent.attackTimes.length;
if (RecentAttacks > 2) {
aggressionModifier = 0;
} else if (boboboWindup > 10) {
modifiedPerception = Perception + (boboboWindup * 0.5);
perceptionRoll = percentileCheck(Perception);
intelligenceRoll = percentileCheck(Intelligence);
if (perceptionRoll >= 0) {
if (intelligenceRoll >= 0) {
aggressionModifier = 100;
windupPreset = 1;
} else {
aggressionModifier = 0;
}
}
}
modifiedAggression = Aggression * aggressionModifier;
if (percentileCheck(modifiedAggression) >= 0) {
trace("Attacking at " + (getTimer() / 1000));
playerSector = guessPlayerSector();
attackSector = pickTargetLocation(playerSector);
beginAttack(attackSector);
} else {
currentSector = guessPlayerSector();
}
}
}
function getCurrentSector() {
return(currentSector);
}
function getPower() {
currentPower = attackState;
return(currentPower);
}
function blockAttack(whichSector) {
if (currentlyAlive == 1) {
currentlyIdle = 0;
gotoAndPlay("Block" + currentSector);
enemyState = "blocking";
}
}
function beginAttack(whichSector) {
currentSector = whichSector;
currentlyIdle = 0;
attackState = 1;
if (windupPreset > 0) {
windupFull = windupPreset;
windupPreset = 0;
} else if ((percentileCheck(Intelligence) >= 0) and (lastHits.length == 10)) {
lastHitCount = 0;
var _local1 = 0;
while (_local1 < lastHits.length) {
lastHitCount = lastHitCount + lastHits[_local1];
_local1++;
}
lastHitAverage = lastHitCount / lastHits.length;
trace(((("Average hitting windup is " + lastHitAverage) + " -- (") + lastHits) + ")");
windupFull = (lastHitAverage + random(11)) - 5;
if (windupFull > 100) {
windupFull = 100;
}
} else {
windupFull = random(100);
}
pauseLength = windupFull / 5;
gotoAndPlay("Attack" + whichSector);
enemyState = "windingUp";
}
function windupCheck() {
if (attackState > 0) {
if (attackState < windupFull) {
boboboWindup = _parent.boboboPower;
if (boboboWindup > 0) {
modifiedPerception = Perception + (boboboWindup * 0.5);
perceptionRoll = percentileCheck(Perception);
intelligenceRoll = percentileCheck(Intelligence);
if (perceptionRoll >= 0) {
if (intelligenceRoll >= 0) {
currentSector = guessPlayerSector();
}
}
}
attackState = (attackState + 1) + (Speed / 25);
gotoAndPlay("WindupCheck" + currentSector);
} else {
enemyState = "attacking";
}
}
}
function attackPause() {
if (pauseLength > 0) {
pauseLength--;
gotoAndPlay("AttackPause" + currentSector);
}
}
function hitByPlayer(whichSector) {
if (currentlyAlive == 1) {
currentSector = whichSector;
currentlyIdle = 0;
pauseLength = 0;
attackState = 0;
gotoAndPlay("Hit" + currentSector);
enemyState = "stunned";
}
}
function attackHit() {
_parent.checkEnemyAttack(currentSector);
attackState = 0;
}
function Die() {
if (currentlyAlive == 1) {
currentlyAlive = 0;
currentlyIdle = 0;
gotoAndPlay ("Die");
}
}
function percentileCheck(percentChance) {
randomNumber = random(100) + 1;
percentDifference = percentChance - randomNumber;
return(percentDifference);
}
function guessPlayerSector() {
actualPlayerSector = _parent.getCurrentSector();
boboboWindup = _parent.boboboPower;
modifiedPerception = Perception + (boboboWindup * 0.25);
RecentAttacks = _parent.attackTimes.length;
if (RecentAttacks > 2) {
modifiedPerception = 100;
}
perceptionRoll = percentileCheck(modifiedPerception);
if (perceptionRoll >= 0) {
return(actualPlayerSector);
}
xCurrent = _parent._xmouse;
yCurrent = _parent._ymouse;
xMiss = xCurrent + (random(perceptionRoll * -12) / 2);
if (xMiss > 600) {
xMiss = 600 - (xMiss - 600);
} else if (xMiss < 0) {
xMiss = -xMiss;
}
yMiss = yCurrent + (random(perceptionRoll * -8) / 2);
if (yMiss > 400) {
yMiss = 400 - (yMiss - 400);
} else if (yMiss < 0) {
yMiss = -yMiss;
}
guessedSector = _parent.coordinateToSector(xMiss, yMiss);
return(guessedSector);
}
function pickTargetLocation(playerSector) {
if (playerSector == "A1") {
possibleSectors = ["A3", "B2", "B3", "C1", "C2", "C3"];
} else if (playerSector == "A2") {
possibleSectors = ["B1", "B3", "C1", "C2", "C3"];
} else if (playerSector == "A3") {
possibleSectors = ["A1", "B1", "B2", "C1", "C2", "C3"];
} else if (playerSector == "B1") {
possibleSectors = ["A2", "A3", "B3", "C2", "C3"];
} else if (playerSector == "B2") {
possibleSectors = ["A1", "A3", "C1", "C3"];
} else if (playerSector == "B3") {
possibleSectors = ["A1", "A2", "B1", "C1", "C2"];
} else if (playerSector == "C1") {
possibleSectors = ["A1", "A2", "A3", "B2", "B3", "C3"];
} else if (playerSector == "C2") {
possibleSectors = ["A1", "A2", "A3", "B1", "B3"];
} else if (playerSector == "C3") {
possibleSectors = ["A1", "A2", "A3", "B1", "B2", "C1"];
}
trace("DEBUG -- possiblesectors is " + possibleSectors);
whichSector = possibleSectors[random(possibleSectors.length)];
trace("DEBUG -- sector chosen: " + whichSector);
return(whichSector);
}
currentlyIdle = 1;
currentSector = "B2";
lastUpdate = getTimer();
changeIdle();
enemyState = "idle";
attackState = 0;
windupFull = 0;
pauseLength = 0;
idleSector = null;
windupPreset = 0;
lastHits = [];
this.onEnterFrame = function () {
if ((currentlyAlive == 1) and (_parent.inCombat == 1)) {
RecentAttacks = _parent.attackTimes.length;
if (RecentAttacks > 2) {
changeIdle();
}
currentTime = getTimer();
if ((currentTime - lastUpdate) > 100) {
lastUpdate = currentTime;
stepCycle();
}
}
};
Symbol 163 MovieClip [Enemy_B] Frame 2
currentlyIdle = 1;
Symbol 163 MovieClip [Enemy_B] Frame 22
if (continueIdle == 1) {
gotoAndPlay ("IdleLoop");
}
Symbol 163 MovieClip [Enemy_B] Frame 43
changeIdle();
Symbol 163 MovieClip [Enemy_B] Frame 64
changeIdle();
Symbol 163 MovieClip [Enemy_B] Frame 85
changeIdle();
Symbol 163 MovieClip [Enemy_B] Frame 106
changeIdle();
Symbol 163 MovieClip [Enemy_B] Frame 127
changeIdle();
Symbol 163 MovieClip [Enemy_B] Frame 148
changeIdle();
Symbol 163 MovieClip [Enemy_B] Frame 169
changeIdle();
Symbol 163 MovieClip [Enemy_B] Frame 190
changeIdle();
Symbol 163 MovieClip [Enemy_B] Frame 211
changeIdle();
Symbol 163 MovieClip [Enemy_B] Frame 221
Symbol 163 MovieClip [Enemy_B] Frame 222
windupCheck();
Symbol 163 MovieClip [Enemy_B] Frame 224
attackHit();
Symbol 163 MovieClip [Enemy_B] Frame 229
attackPause();
Symbol 163 MovieClip [Enemy_B] Frame 234
returnIdle();
Symbol 163 MovieClip [Enemy_B] Frame 244
Symbol 163 MovieClip [Enemy_B] Frame 245
windupCheck();
Symbol 163 MovieClip [Enemy_B] Frame 247
attackHit();
Symbol 163 MovieClip [Enemy_B] Frame 252
attackPause();
Symbol 163 MovieClip [Enemy_B] Frame 257
returnIdle();
Symbol 163 MovieClip [Enemy_B] Frame 267
Symbol 163 MovieClip [Enemy_B] Frame 268
windupCheck();
Symbol 163 MovieClip [Enemy_B] Frame 270
attackHit();
Symbol 163 MovieClip [Enemy_B] Frame 275
attackPause();
Symbol 163 MovieClip [Enemy_B] Frame 280
returnIdle();
Symbol 163 MovieClip [Enemy_B] Frame 290
Symbol 163 MovieClip [Enemy_B] Frame 291
windupCheck();
Symbol 163 MovieClip [Enemy_B] Frame 293
attackHit();
Symbol 163 MovieClip [Enemy_B] Frame 298
attackPause();
Symbol 163 MovieClip [Enemy_B] Frame 303
returnIdle();
Symbol 163 MovieClip [Enemy_B] Frame 313
Symbol 163 MovieClip [Enemy_B] Frame 314
windupCheck();
Symbol 163 MovieClip [Enemy_B] Frame 316
attackHit();
Symbol 163 MovieClip [Enemy_B] Frame 321
attackPause();
Symbol 163 MovieClip [Enemy_B] Frame 326
returnIdle();
Symbol 163 MovieClip [Enemy_B] Frame 336
Symbol 163 MovieClip [Enemy_B] Frame 337
windupCheck();
Symbol 163 MovieClip [Enemy_B] Frame 339
attackHit();
Symbol 163 MovieClip [Enemy_B] Frame 344
attackPause();
Symbol 163 MovieClip [Enemy_B] Frame 349
returnIdle();
Symbol 163 MovieClip [Enemy_B] Frame 359
Symbol 163 MovieClip [Enemy_B] Frame 360
windupCheck();
Symbol 163 MovieClip [Enemy_B] Frame 362
attackHit();
Symbol 163 MovieClip [Enemy_B] Frame 367
attackPause();
Symbol 163 MovieClip [Enemy_B] Frame 372
returnIdle();
Symbol 163 MovieClip [Enemy_B] Frame 382
Symbol 163 MovieClip [Enemy_B] Frame 383
windupCheck();
Symbol 163 MovieClip [Enemy_B] Frame 385
attackHit();
Symbol 163 MovieClip [Enemy_B] Frame 390
attackPause();
Symbol 163 MovieClip [Enemy_B] Frame 395
returnIdle();
Symbol 163 MovieClip [Enemy_B] Frame 405
Symbol 163 MovieClip [Enemy_B] Frame 406
windupCheck();
Symbol 163 MovieClip [Enemy_B] Frame 408
attackHit();
Symbol 163 MovieClip [Enemy_B] Frame 413
attackPause();
Symbol 163 MovieClip [Enemy_B] Frame 418
returnIdle();
Symbol 163 MovieClip [Enemy_B] Frame 431
returnIdle();
Symbol 163 MovieClip [Enemy_B] Frame 444
returnIdle();
Symbol 163 MovieClip [Enemy_B] Frame 457
returnIdle();
Symbol 163 MovieClip [Enemy_B] Frame 470
returnIdle();
Symbol 163 MovieClip [Enemy_B] Frame 483
returnIdle();
Symbol 163 MovieClip [Enemy_B] Frame 496
returnIdle();
Symbol 163 MovieClip [Enemy_B] Frame 509
returnIdle();
Symbol 163 MovieClip [Enemy_B] Frame 522
returnIdle();
Symbol 163 MovieClip [Enemy_B] Frame 535
returnIdle();
Symbol 163 MovieClip [Enemy_B] Frame 548
returnIdle();
Symbol 163 MovieClip [Enemy_B] Frame 561
returnIdle();
Symbol 163 MovieClip [Enemy_B] Frame 574
returnIdle();
Symbol 163 MovieClip [Enemy_B] Frame 587
returnIdle();
Symbol 163 MovieClip [Enemy_B] Frame 600
returnIdle();
Symbol 163 MovieClip [Enemy_B] Frame 613
returnIdle();
Symbol 163 MovieClip [Enemy_B] Frame 626
returnIdle();
Symbol 163 MovieClip [Enemy_B] Frame 639
returnIdle();
Symbol 163 MovieClip [Enemy_B] Frame 652
returnIdle();
Symbol 163 MovieClip [Enemy_B] Frame 713
_parent.AreaCleared();
stop();
Symbol 288 MovieClip [Enemy_Boss] Frame 1
function changeIdle() {
if (currentlyAlive == 1) {
if (currentlyIdle == 1) {
enemyState = "idle";
newIdle = "Idle" + currentSector;
if (newIdle != idleSector) {
_parent.SoundFX.EnemyIdle();
}
idleSector = newIdle;
gotoAndPlay(newIdle);
}
}
}
function returnIdle() {
currentlyIdle = 1;
changeIdle();
}
function stepCycle() {
if ((currentlyIdle == 1) and (currentlyAlive == 1)) {
aggressionModifier = 0.1;
boboboWindup = _parent.boboboPower;
RecentAttacks = _parent.attackTimes.length;
if (RecentAttacks > 2) {
aggressionModifier = 0;
} else if (boboboWindup > 10) {
modifiedPerception = Perception + (boboboWindup * 0.5);
perceptionRoll = percentileCheck(Perception);
intelligenceRoll = percentileCheck(Intelligence);
if (perceptionRoll >= 0) {
if (intelligenceRoll >= 0) {
aggressionModifier = 100;
windupPreset = 1;
} else {
aggressionModifier = 0;
}
}
}
modifiedAggression = Aggression * aggressionModifier;
if (percentileCheck(modifiedAggression) >= 0) {
trace("Attacking at " + (getTimer() / 1000));
playerSector = guessPlayerSector();
attackSector = pickTargetLocation(playerSector);
beginAttack(attackSector);
} else {
currentSector = guessPlayerSector();
}
}
}
function getCurrentSector() {
return(currentSector);
}
function getPower() {
currentPower = attackState;
return(currentPower);
}
function blockAttack(whichSector) {
if (currentlyAlive == 1) {
currentlyIdle = 0;
gotoAndPlay("Block" + currentSector);
enemyState = "blocking";
}
}
function beginAttack(whichSector) {
currentSector = whichSector;
currentlyIdle = 0;
attackState = 1;
if (windupPreset > 0) {
windupFull = windupPreset;
windupPreset = 0;
} else if ((percentileCheck(Intelligence) >= 0) and (lastHits.length == 10)) {
lastHitCount = 0;
var _local1 = 0;
while (_local1 < lastHits.length) {
lastHitCount = lastHitCount + lastHits[_local1];
_local1++;
}
lastHitAverage = lastHitCount / lastHits.length;
trace(((("Average hitting windup is " + lastHitAverage) + " -- (") + lastHits) + ")");
windupFull = (lastHitAverage + random(11)) - 5;
if (windupFull > 100) {
windupFull = 100;
}
} else {
windupFull = random(100);
}
pauseLength = windupFull / 5;
gotoAndPlay("Attack" + whichSector);
enemyState = "windingUp";
}
function windupCheck() {
if (attackState > 0) {
if (attackState < windupFull) {
boboboWindup = _parent.boboboPower;
if (boboboWindup > 0) {
modifiedPerception = Perception + (boboboWindup * 0.5);
perceptionRoll = percentileCheck(Perception);
intelligenceRoll = percentileCheck(Intelligence);
if (perceptionRoll >= 0) {
if (intelligenceRoll >= 0) {
currentSector = guessPlayerSector();
}
}
}
attackState = (attackState + 1) + (Speed / 25);
gotoAndPlay("WindupCheck" + currentSector);
} else {
enemyState = "attacking";
}
}
}
function attackPause() {
if (pauseLength > 0) {
pauseLength--;
gotoAndPlay("AttackPause" + currentSector);
}
}
function hitByPlayer(whichSector) {
if (currentlyAlive == 1) {
currentSector = whichSector;
currentlyIdle = 0;
pauseLength = 0;
attackState = 0;
gotoAndPlay("Hit" + currentSector);
enemyState = "stunned";
}
}
function attackHit() {
_parent.checkEnemyAttack(currentSector);
attackState = 0;
}
function Die() {
if (currentlyAlive == 1) {
currentlyAlive = 0;
currentlyIdle = 0;
gotoAndPlay ("Die");
}
}
function percentileCheck(percentChance) {
randomNumber = random(100) + 1;
percentDifference = percentChance - randomNumber;
return(percentDifference);
}
function guessPlayerSector() {
actualPlayerSector = _parent.getCurrentSector();
boboboWindup = _parent.boboboPower;
modifiedPerception = Perception + (boboboWindup * 0.25);
RecentAttacks = _parent.attackTimes.length;
if (RecentAttacks > 2) {
modifiedPerception = 100;
}
perceptionRoll = percentileCheck(modifiedPerception);
if (perceptionRoll >= 0) {
return(actualPlayerSector);
}
xCurrent = _parent._xmouse;
yCurrent = _parent._ymouse;
xMiss = xCurrent + (random(perceptionRoll * -12) / 2);
if (xMiss > 600) {
xMiss = 600 - (xMiss - 600);
} else if (xMiss < 0) {
xMiss = -xMiss;
}
yMiss = yCurrent + (random(perceptionRoll * -8) / 2);
if (yMiss > 400) {
yMiss = 400 - (yMiss - 400);
} else if (yMiss < 0) {
yMiss = -yMiss;
}
guessedSector = _parent.coordinateToSector(xMiss, yMiss);
return(guessedSector);
}
function pickTargetLocation(playerSector) {
if (playerSector == "A1") {
possibleSectors = ["A3", "B2", "B3", "C1", "C2", "C3"];
} else if (playerSector == "A2") {
possibleSectors = ["B1", "B3", "C1", "C2", "C3"];
} else if (playerSector == "A3") {
possibleSectors = ["A1", "B1", "B2", "C1", "C2", "C3"];
} else if (playerSector == "B1") {
possibleSectors = ["A2", "A3", "B3", "C2", "C3"];
} else if (playerSector == "B2") {
possibleSectors = ["A1", "A3", "C1", "C3"];
} else if (playerSector == "B3") {
possibleSectors = ["A1", "A2", "B1", "C1", "C2"];
} else if (playerSector == "C1") {
possibleSectors = ["A1", "A2", "A3", "B2", "B3", "C3"];
} else if (playerSector == "C2") {
possibleSectors = ["A1", "A2", "A3", "B1", "B3"];
} else if (playerSector == "C3") {
possibleSectors = ["A1", "A2", "A3", "B1", "B2", "C1"];
}
trace("DEBUG -- possiblesectors is " + possibleSectors);
whichSector = possibleSectors[random(possibleSectors.length)];
trace("DEBUG -- sector chosen: " + whichSector);
return(whichSector);
}
currentlyIdle = 1;
currentSector = "B2";
lastUpdate = getTimer();
changeIdle();
enemyState = "idle";
attackState = 0;
windupFull = 0;
pauseLength = 0;
idleSector = null;
windupPreset = 0;
lastHits = [];
this.onEnterFrame = function () {
if ((currentlyAlive == 1) and (_parent.inCombat == 1)) {
RecentAttacks = _parent.attackTimes.length;
if (RecentAttacks > 2) {
changeIdle();
}
currentTime = getTimer();
if ((currentTime - lastUpdate) > 100) {
lastUpdate = currentTime;
stepCycle();
}
}
};
Symbol 288 MovieClip [Enemy_Boss] Frame 2
currentlyIdle = 1;
Symbol 288 MovieClip [Enemy_Boss] Frame 18
if (continueIdle == 1) {
gotoAndPlay ("IdleLoop");
}
Symbol 288 MovieClip [Enemy_Boss] Frame 35
changeIdle();
Symbol 288 MovieClip [Enemy_Boss] Frame 52
changeIdle();
Symbol 288 MovieClip [Enemy_Boss] Frame 69
changeIdle();
Symbol 288 MovieClip [Enemy_Boss] Frame 86
changeIdle();
Symbol 288 MovieClip [Enemy_Boss] Frame 103
changeIdle();
Symbol 288 MovieClip [Enemy_Boss] Frame 120
changeIdle();
Symbol 288 MovieClip [Enemy_Boss] Frame 137
changeIdle();
Symbol 288 MovieClip [Enemy_Boss] Frame 154
changeIdle();
Symbol 288 MovieClip [Enemy_Boss] Frame 171
changeIdle();
Symbol 288 MovieClip [Enemy_Boss] Frame 181
Symbol 288 MovieClip [Enemy_Boss] Frame 182
windupCheck();
Symbol 288 MovieClip [Enemy_Boss] Frame 184
attackHit();
Symbol 288 MovieClip [Enemy_Boss] Frame 189
attackPause();
Symbol 288 MovieClip [Enemy_Boss] Frame 194
returnIdle();
Symbol 288 MovieClip [Enemy_Boss] Frame 204
Symbol 288 MovieClip [Enemy_Boss] Frame 205
windupCheck();
Symbol 288 MovieClip [Enemy_Boss] Frame 207
attackHit();
Symbol 288 MovieClip [Enemy_Boss] Frame 212
attackPause();
Symbol 288 MovieClip [Enemy_Boss] Frame 217
returnIdle();
Symbol 288 MovieClip [Enemy_Boss] Frame 227
Symbol 288 MovieClip [Enemy_Boss] Frame 228
windupCheck();
Symbol 288 MovieClip [Enemy_Boss] Frame 230
attackHit();
Symbol 288 MovieClip [Enemy_Boss] Frame 235
attackPause();
Symbol 288 MovieClip [Enemy_Boss] Frame 240
returnIdle();
Symbol 288 MovieClip [Enemy_Boss] Frame 250
Symbol 288 MovieClip [Enemy_Boss] Frame 251
windupCheck();
Symbol 288 MovieClip [Enemy_Boss] Frame 253
attackHit();
Symbol 288 MovieClip [Enemy_Boss] Frame 258
attackPause();
Symbol 288 MovieClip [Enemy_Boss] Frame 263
returnIdle();
Symbol 288 MovieClip [Enemy_Boss] Frame 273
Symbol 288 MovieClip [Enemy_Boss] Frame 274
windupCheck();
Symbol 288 MovieClip [Enemy_Boss] Frame 276
attackHit();
Symbol 288 MovieClip [Enemy_Boss] Frame 281
attackPause();
Symbol 288 MovieClip [Enemy_Boss] Frame 286
returnIdle();
Symbol 288 MovieClip [Enemy_Boss] Frame 296
Symbol 288 MovieClip [Enemy_Boss] Frame 297
windupCheck();
Symbol 288 MovieClip [Enemy_Boss] Frame 299
attackHit();
Symbol 288 MovieClip [Enemy_Boss] Frame 304
attackPause();
Symbol 288 MovieClip [Enemy_Boss] Frame 309
returnIdle();
Symbol 288 MovieClip [Enemy_Boss] Frame 319
Symbol 288 MovieClip [Enemy_Boss] Frame 320
windupCheck();
Symbol 288 MovieClip [Enemy_Boss] Frame 322
attackHit();
Symbol 288 MovieClip [Enemy_Boss] Frame 327
attackPause();
Symbol 288 MovieClip [Enemy_Boss] Frame 332
returnIdle();
Symbol 288 MovieClip [Enemy_Boss] Frame 342
Symbol 288 MovieClip [Enemy_Boss] Frame 343
windupCheck();
Symbol 288 MovieClip [Enemy_Boss] Frame 345
attackHit();
Symbol 288 MovieClip [Enemy_Boss] Frame 350
attackPause();
Symbol 288 MovieClip [Enemy_Boss] Frame 355
returnIdle();
Symbol 288 MovieClip [Enemy_Boss] Frame 365
Symbol 288 MovieClip [Enemy_Boss] Frame 366
windupCheck();
Symbol 288 MovieClip [Enemy_Boss] Frame 368
attackHit();
Symbol 288 MovieClip [Enemy_Boss] Frame 373
attackPause();
Symbol 288 MovieClip [Enemy_Boss] Frame 378
returnIdle();
Symbol 288 MovieClip [Enemy_Boss] Frame 391
returnIdle();
Symbol 288 MovieClip [Enemy_Boss] Frame 404
returnIdle();
Symbol 288 MovieClip [Enemy_Boss] Frame 417
returnIdle();
Symbol 288 MovieClip [Enemy_Boss] Frame 430
returnIdle();
Symbol 288 MovieClip [Enemy_Boss] Frame 443
returnIdle();
Symbol 288 MovieClip [Enemy_Boss] Frame 456
returnIdle();
Symbol 288 MovieClip [Enemy_Boss] Frame 469
returnIdle();
Symbol 288 MovieClip [Enemy_Boss] Frame 482
returnIdle();
Symbol 288 MovieClip [Enemy_Boss] Frame 495
returnIdle();
Symbol 288 MovieClip [Enemy_Boss] Frame 508
returnIdle();
Symbol 288 MovieClip [Enemy_Boss] Frame 521
returnIdle();
Symbol 288 MovieClip [Enemy_Boss] Frame 534
returnIdle();
Symbol 288 MovieClip [Enemy_Boss] Frame 547
returnIdle();
Symbol 288 MovieClip [Enemy_Boss] Frame 560
returnIdle();
Symbol 288 MovieClip [Enemy_Boss] Frame 573
returnIdle();
Symbol 288 MovieClip [Enemy_Boss] Frame 586
returnIdle();
Symbol 288 MovieClip [Enemy_Boss] Frame 599
returnIdle();
Symbol 288 MovieClip [Enemy_Boss] Frame 612
returnIdle();
Symbol 288 MovieClip [Enemy_Boss] Frame 673
_parent.AreaCleared();
stop();
Symbol 306 MovieClip [Enemy_C] Frame 1
function changeIdle() {
if (currentlyAlive == 1) {
if (currentlyIdle == 1) {
enemyState = "idle";
newIdle = "Idle" + currentSector;
if (newIdle != idleSector) {
_parent.SoundFX.EnemyIdle();
}
idleSector = newIdle;
gotoAndPlay(newIdle);
}
}
}
function returnIdle() {
currentlyIdle = 1;
changeIdle();
}
function stepCycle() {
if ((currentlyIdle == 1) and (currentlyAlive == 1)) {
aggressionModifier = 0.1;
boboboWindup = _parent.boboboPower;
RecentAttacks = _parent.attackTimes.length;
if (RecentAttacks > 2) {
aggressionModifier = 0;
} else if (boboboWindup > 10) {
modifiedPerception = Perception + (boboboWindup * 0.5);
perceptionRoll = percentileCheck(Perception);
intelligenceRoll = percentileCheck(Intelligence);
if (perceptionRoll >= 0) {
if (intelligenceRoll >= 0) {
aggressionModifier = 100;
windupPreset = 1;
} else {
aggressionModifier = 0;
}
}
}
modifiedAggression = Aggression * aggressionModifier;
if (percentileCheck(modifiedAggression) >= 0) {
trace("Attacking at " + (getTimer() / 1000));
playerSector = guessPlayerSector();
attackSector = pickTargetLocation(playerSector);
beginAttack(attackSector);
} else {
currentSector = guessPlayerSector();
}
}
}
function getCurrentSector() {
return(currentSector);
}
function getPower() {
currentPower = attackState;
return(currentPower);
}
function blockAttack(whichSector) {
if (currentlyAlive == 1) {
currentlyIdle = 0;
gotoAndPlay("Block" + currentSector);
enemyState = "blocking";
}
}
function beginAttack(whichSector) {
currentSector = whichSector;
currentlyIdle = 0;
attackState = 1;
if (windupPreset > 0) {
windupFull = windupPreset;
windupPreset = 0;
} else if ((percentileCheck(Intelligence) >= 0) and (lastHits.length == 10)) {
lastHitCount = 0;
var _local1 = 0;
while (_local1 < lastHits.length) {
lastHitCount = lastHitCount + lastHits[_local1];
_local1++;
}
lastHitAverage = lastHitCount / lastHits.length;
trace(((("Average hitting windup is " + lastHitAverage) + " -- (") + lastHits) + ")");
windupFull = (lastHitAverage + random(11)) - 5;
if (windupFull > 100) {
windupFull = 100;
}
} else {
windupFull = random(100);
}
pauseLength = windupFull / 5;
gotoAndPlay("Attack" + whichSector);
enemyState = "windingUp";
}
function windupCheck() {
if (attackState > 0) {
if (attackState < windupFull) {
boboboWindup = _parent.boboboPower;
if (boboboWindup > 0) {
modifiedPerception = Perception + (boboboWindup * 0.5);
perceptionRoll = percentileCheck(Perception);
intelligenceRoll = percentileCheck(Intelligence);
if (perceptionRoll >= 0) {
if (intelligenceRoll >= 0) {
currentSector = guessPlayerSector();
}
}
}
attackState = (attackState + 1) + (Speed / 25);
gotoAndPlay("WindupCheck" + currentSector);
} else {
enemyState = "attacking";
}
}
}
function attackPause() {
if (pauseLength > 0) {
pauseLength--;
gotoAndPlay("AttackPause" + currentSector);
}
}
function hitByPlayer(whichSector) {
if (currentlyAlive == 1) {
currentSector = whichSector;
currentlyIdle = 0;
pauseLength = 0;
attackState = 0;
gotoAndPlay("Hit" + currentSector);
enemyState = "stunned";
}
}
function attackHit() {
_parent.checkEnemyAttack(currentSector);
attackState = 0;
}
function Die() {
if (currentlyAlive == 1) {
currentlyAlive = 0;
currentlyIdle = 0;
gotoAndPlay ("Die");
}
}
function percentileCheck(percentChance) {
randomNumber = random(100) + 1;
percentDifference = percentChance - randomNumber;
return(percentDifference);
}
function guessPlayerSector() {
actualPlayerSector = _parent.getCurrentSector();
boboboWindup = _parent.boboboPower;
modifiedPerception = Perception + (boboboWindup * 0.25);
RecentAttacks = _parent.attackTimes.length;
if (RecentAttacks > 2) {
modifiedPerception = 100;
}
perceptionRoll = percentileCheck(modifiedPerception);
if (perceptionRoll >= 0) {
return(actualPlayerSector);
}
xCurrent = _parent._xmouse;
yCurrent = _parent._ymouse;
xMiss = xCurrent + (random(perceptionRoll * -12) / 2);
if (xMiss > 600) {
xMiss = 600 - (xMiss - 600);
} else if (xMiss < 0) {
xMiss = -xMiss;
}
yMiss = yCurrent + (random(perceptionRoll * -8) / 2);
if (yMiss > 400) {
yMiss = 400 - (yMiss - 400);
} else if (yMiss < 0) {
yMiss = -yMiss;
}
guessedSector = _parent.coordinateToSector(xMiss, yMiss);
return(guessedSector);
}
function pickTargetLocation(playerSector) {
if (playerSector == "A1") {
possibleSectors = ["A3", "B2", "B3", "C1", "C2", "C3"];
} else if (playerSector == "A2") {
possibleSectors = ["B1", "B3", "C1", "C2", "C3"];
} else if (playerSector == "A3") {
possibleSectors = ["A1", "B1", "B2", "C1", "C2", "C3"];
} else if (playerSector == "B1") {
possibleSectors = ["A2", "A3", "B3", "C2", "C3"];
} else if (playerSector == "B2") {
possibleSectors = ["A1", "A3", "C1", "C3"];
} else if (playerSector == "B3") {
possibleSectors = ["A1", "A2", "B1", "C1", "C2"];
} else if (playerSector == "C1") {
possibleSectors = ["A1", "A2", "A3", "B2", "B3", "C3"];
} else if (playerSector == "C2") {
possibleSectors = ["A1", "A2", "A3", "B1", "B3"];
} else if (playerSector == "C3") {
possibleSectors = ["A1", "A2", "A3", "B1", "B2", "C1"];
}
trace("DEBUG -- possiblesectors is " + possibleSectors);
whichSector = possibleSectors[random(possibleSectors.length)];
trace("DEBUG -- sector chosen: " + whichSector);
return(whichSector);
}
currentlyIdle = 1;
currentSector = "B2";
lastUpdate = getTimer();
changeIdle();
enemyState = "idle";
attackState = 0;
windupFull = 0;
pauseLength = 0;
idleSector = null;
windupPreset = 0;
lastHits = [];
this.onEnterFrame = function () {
if ((currentlyAlive == 1) and (_parent.inCombat == 1)) {
RecentAttacks = _parent.attackTimes.length;
if (RecentAttacks > 2) {
changeIdle();
}
currentTime = getTimer();
if ((currentTime - lastUpdate) > 100) {
lastUpdate = currentTime;
stepCycle();
}
}
};
Symbol 306 MovieClip [Enemy_C] Frame 2
currentlyIdle = 1;
Symbol 306 MovieClip [Enemy_C] Frame 22
if (continueIdle == 1) {
gotoAndPlay ("IdleLoop");
}
Symbol 306 MovieClip [Enemy_C] Frame 43
changeIdle();
Symbol 306 MovieClip [Enemy_C] Frame 64
changeIdle();
Symbol 306 MovieClip [Enemy_C] Frame 85
changeIdle();
Symbol 306 MovieClip [Enemy_C] Frame 106
changeIdle();
Symbol 306 MovieClip [Enemy_C] Frame 127
changeIdle();
Symbol 306 MovieClip [Enemy_C] Frame 148
changeIdle();
Symbol 306 MovieClip [Enemy_C] Frame 169
changeIdle();
Symbol 306 MovieClip [Enemy_C] Frame 190
changeIdle();
Symbol 306 MovieClip [Enemy_C] Frame 211
changeIdle();
Symbol 306 MovieClip [Enemy_C] Frame 221
Symbol 306 MovieClip [Enemy_C] Frame 222
windupCheck();
Symbol 306 MovieClip [Enemy_C] Frame 224
attackHit();
Symbol 306 MovieClip [Enemy_C] Frame 229
attackPause();
Symbol 306 MovieClip [Enemy_C] Frame 234
returnIdle();
Symbol 306 MovieClip [Enemy_C] Frame 244
Symbol 306 MovieClip [Enemy_C] Frame 245
windupCheck();
Symbol 306 MovieClip [Enemy_C] Frame 247
attackHit();
Symbol 306 MovieClip [Enemy_C] Frame 252
attackPause();
Symbol 306 MovieClip [Enemy_C] Frame 257
returnIdle();
Symbol 306 MovieClip [Enemy_C] Frame 267
Symbol 306 MovieClip [Enemy_C] Frame 268
windupCheck();
Symbol 306 MovieClip [Enemy_C] Frame 270
attackHit();
Symbol 306 MovieClip [Enemy_C] Frame 275
attackPause();
Symbol 306 MovieClip [Enemy_C] Frame 280
returnIdle();
Symbol 306 MovieClip [Enemy_C] Frame 290
Symbol 306 MovieClip [Enemy_C] Frame 291
windupCheck();
Symbol 306 MovieClip [Enemy_C] Frame 293
attackHit();
Symbol 306 MovieClip [Enemy_C] Frame 298
attackPause();
Symbol 306 MovieClip [Enemy_C] Frame 303
returnIdle();
Symbol 306 MovieClip [Enemy_C] Frame 313
Symbol 306 MovieClip [Enemy_C] Frame 314
windupCheck();
Symbol 306 MovieClip [Enemy_C] Frame 316
attackHit();
Symbol 306 MovieClip [Enemy_C] Frame 321
attackPause();
Symbol 306 MovieClip [Enemy_C] Frame 326
returnIdle();
Symbol 306 MovieClip [Enemy_C] Frame 336
Symbol 306 MovieClip [Enemy_C] Frame 337
windupCheck();
Symbol 306 MovieClip [Enemy_C] Frame 339
attackHit();
Symbol 306 MovieClip [Enemy_C] Frame 344
attackPause();
Symbol 306 MovieClip [Enemy_C] Frame 349
returnIdle();
Symbol 306 MovieClip [Enemy_C] Frame 359
Symbol 306 MovieClip [Enemy_C] Frame 360
windupCheck();
Symbol 306 MovieClip [Enemy_C] Frame 362
attackHit();
Symbol 306 MovieClip [Enemy_C] Frame 367
attackPause();
Symbol 306 MovieClip [Enemy_C] Frame 372
returnIdle();
Symbol 306 MovieClip [Enemy_C] Frame 382
Symbol 306 MovieClip [Enemy_C] Frame 383
windupCheck();
Symbol 306 MovieClip [Enemy_C] Frame 385
attackHit();
Symbol 306 MovieClip [Enemy_C] Frame 390
attackPause();
Symbol 306 MovieClip [Enemy_C] Frame 395
returnIdle();
Symbol 306 MovieClip [Enemy_C] Frame 405
Symbol 306 MovieClip [Enemy_C] Frame 406
windupCheck();
Symbol 306 MovieClip [Enemy_C] Frame 408
attackHit();
Symbol 306 MovieClip [Enemy_C] Frame 413
attackPause();
Symbol 306 MovieClip [Enemy_C] Frame 418
returnIdle();
Symbol 306 MovieClip [Enemy_C] Frame 431
returnIdle();
Symbol 306 MovieClip [Enemy_C] Frame 444
returnIdle();
Symbol 306 MovieClip [Enemy_C] Frame 457
returnIdle();
Symbol 306 MovieClip [Enemy_C] Frame 470
returnIdle();
Symbol 306 MovieClip [Enemy_C] Frame 483
returnIdle();
Symbol 306 MovieClip [Enemy_C] Frame 496
returnIdle();
Symbol 306 MovieClip [Enemy_C] Frame 509
returnIdle();
Symbol 306 MovieClip [Enemy_C] Frame 522
returnIdle();
Symbol 306 MovieClip [Enemy_C] Frame 535
returnIdle();
Symbol 306 MovieClip [Enemy_C] Frame 548
returnIdle();
Symbol 306 MovieClip [Enemy_C] Frame 561
returnIdle();
Symbol 306 MovieClip [Enemy_C] Frame 574
returnIdle();
Symbol 306 MovieClip [Enemy_C] Frame 587
returnIdle();
Symbol 306 MovieClip [Enemy_C] Frame 600
returnIdle();
Symbol 306 MovieClip [Enemy_C] Frame 613
returnIdle();
Symbol 306 MovieClip [Enemy_C] Frame 626
returnIdle();
Symbol 306 MovieClip [Enemy_C] Frame 639
returnIdle();
Symbol 306 MovieClip [Enemy_C] Frame 652
returnIdle();
Symbol 306 MovieClip [Enemy_C] Frame 713
_parent.AreaCleared();
stop();
Symbol 352 MovieClip [Enemy_D] Frame 1
function changeIdle() {
if (currentlyAlive == 1) {
if (currentlyIdle == 1) {
enemyState = "idle";
newIdle = "Idle" + currentSector;
if (newIdle != idleSector) {
_parent.SoundFX.EnemyIdle();
}
idleSector = newIdle;
gotoAndPlay(newIdle);
}
}
}
function returnIdle() {
currentlyIdle = 1;
changeIdle();
}
function stepCycle() {
if ((currentlyIdle == 1) and (currentlyAlive == 1)) {
aggressionModifier = 0.1;
boboboWindup = _parent.boboboPower;
RecentAttacks = _parent.attackTimes.length;
if (RecentAttacks > 2) {
aggressionModifier = 0;
} else if (boboboWindup > 10) {
modifiedPerception = Perception + (boboboWindup * 0.5);
perceptionRoll = percentileCheck(Perception);
intelligenceRoll = percentileCheck(Intelligence);
if (perceptionRoll >= 0) {
if (intelligenceRoll >= 0) {
aggressionModifier = 100;
windupPreset = 1;
} else {
aggressionModifier = 0;
}
}
}
modifiedAggression = Aggression * aggressionModifier;
if (percentileCheck(modifiedAggression) >= 0) {
trace("Attacking at " + (getTimer() / 1000));
playerSector = guessPlayerSector();
attackSector = pickTargetLocation(playerSector);
beginAttack(attackSector);
} else {
currentSector = guessPlayerSector();
}
}
}
function getCurrentSector() {
return(currentSector);
}
function getPower() {
currentPower = attackState;
return(currentPower);
}
function blockAttack(whichSector) {
if (currentlyAlive == 1) {
currentlyIdle = 0;
gotoAndPlay("Block" + currentSector);
enemyState = "blocking";
}
}
function beginAttack(whichSector) {
currentSector = whichSector;
currentlyIdle = 0;
attackState = 1;
if (windupPreset > 0) {
windupFull = windupPreset;
windupPreset = 0;
} else if ((percentileCheck(Intelligence) >= 0) and (lastHits.length == 10)) {
lastHitCount = 0;
var _local1 = 0;
while (_local1 < lastHits.length) {
lastHitCount = lastHitCount + lastHits[_local1];
_local1++;
}
lastHitAverage = lastHitCount / lastHits.length;
trace(((("Average hitting windup is " + lastHitAverage) + " -- (") + lastHits) + ")");
windupFull = (lastHitAverage + random(11)) - 5;
if (windupFull > 100) {
windupFull = 100;
}
} else {
windupFull = random(100);
}
pauseLength = windupFull / 5;
gotoAndPlay("Attack" + whichSector);
enemyState = "windingUp";
}
function windupCheck() {
if (attackState > 0) {
if (attackState < windupFull) {
boboboWindup = _parent.boboboPower;
if (boboboWindup > 0) {
modifiedPerception = Perception + (boboboWindup * 0.5);
perceptionRoll = percentileCheck(Perception);
intelligenceRoll = percentileCheck(Intelligence);
if (perceptionRoll >= 0) {
if (intelligenceRoll >= 0) {
currentSector = guessPlayerSector();
}
}
}
attackState = (attackState + 1) + (Speed / 25);
gotoAndPlay("WindupCheck" + currentSector);
} else {
enemyState = "attacking";
}
}
}
function attackPause() {
if (pauseLength > 0) {
pauseLength--;
gotoAndPlay("AttackPause" + currentSector);
}
}
function hitByPlayer(whichSector) {
if (currentlyAlive == 1) {
currentSector = whichSector;
currentlyIdle = 0;
pauseLength = 0;
attackState = 0;
gotoAndPlay("Hit" + currentSector);
enemyState = "stunned";
}
}
function attackHit() {
_parent.checkEnemyAttack(currentSector);
attackState = 0;
}
function Die() {
if (currentlyAlive == 1) {
currentlyAlive = 0;
currentlyIdle = 0;
gotoAndPlay ("Die");
}
}
function percentileCheck(percentChance) {
randomNumber = random(100) + 1;
percentDifference = percentChance - randomNumber;
return(percentDifference);
}
function guessPlayerSector() {
actualPlayerSector = _parent.getCurrentSector();
boboboWindup = _parent.boboboPower;
modifiedPerception = Perception + (boboboWindup * 0.25);
RecentAttacks = _parent.attackTimes.length;
if (RecentAttacks > 2) {
modifiedPerception = 100;
}
perceptionRoll = percentileCheck(modifiedPerception);
if (perceptionRoll >= 0) {
return(actualPlayerSector);
}
xCurrent = _parent._xmouse;
yCurrent = _parent._ymouse;
xMiss = xCurrent + (random(perceptionRoll * -12) / 2);
if (xMiss > 600) {
xMiss = 600 - (xMiss - 600);
} else if (xMiss < 0) {
xMiss = -xMiss;
}
yMiss = yCurrent + (random(perceptionRoll * -8) / 2);
if (yMiss > 400) {
yMiss = 400 - (yMiss - 400);
} else if (yMiss < 0) {
yMiss = -yMiss;
}
guessedSector = _parent.coordinateToSector(xMiss, yMiss);
return(guessedSector);
}
function pickTargetLocation(playerSector) {
if (playerSector == "A1") {
possibleSectors = ["A3", "B2", "B3", "C1", "C2", "C3"];
} else if (playerSector == "A2") {
possibleSectors = ["B1", "B3", "C1", "C2", "C3"];
} else if (playerSector == "A3") {
possibleSectors = ["A1", "B1", "B2", "C1", "C2", "C3"];
} else if (playerSector == "B1") {
possibleSectors = ["A2", "A3", "B3", "C2", "C3"];
} else if (playerSector == "B2") {
possibleSectors = ["A1", "A3", "C1", "C3"];
} else if (playerSector == "B3") {
possibleSectors = ["A1", "A2", "B1", "C1", "C2"];
} else if (playerSector == "C1") {
possibleSectors = ["A1", "A2", "A3", "B2", "B3", "C3"];
} else if (playerSector == "C2") {
possibleSectors = ["A1", "A2", "A3", "B1", "B3"];
} else if (playerSector == "C3") {
possibleSectors = ["A1", "A2", "A3", "B1", "B2", "C1"];
}
trace("DEBUG -- possiblesectors is " + possibleSectors);
whichSector = possibleSectors[random(possibleSectors.length)];
trace("DEBUG -- sector chosen: " + whichSector);
return(whichSector);
}
currentlyIdle = 1;
currentSector = "B2";
lastUpdate = getTimer();
changeIdle();
enemyState = "idle";
attackState = 0;
windupFull = 0;
pauseLength = 0;
idleSector = null;
windupPreset = 0;
lastHits = [];
this.onEnterFrame = function () {
if ((currentlyAlive == 1) and (_parent.inCombat == 1)) {
RecentAttacks = _parent.attackTimes.length;
if (RecentAttacks > 2) {
changeIdle();
}
currentTime = getTimer();
if ((currentTime - lastUpdate) > 100) {
lastUpdate = currentTime;
stepCycle();
}
}
};
Symbol 352 MovieClip [Enemy_D] Frame 2
currentlyIdle = 1;
Symbol 352 MovieClip [Enemy_D] Frame 22
if (continueIdle == 1) {
gotoAndPlay ("IdleLoop");
}
Symbol 352 MovieClip [Enemy_D] Frame 43
changeIdle();
Symbol 352 MovieClip [Enemy_D] Frame 64
changeIdle();
Symbol 352 MovieClip [Enemy_D] Frame 85
changeIdle();
Symbol 352 MovieClip [Enemy_D] Frame 106
changeIdle();
Symbol 352 MovieClip [Enemy_D] Frame 127
changeIdle();
Symbol 352 MovieClip [Enemy_D] Frame 148
changeIdle();
Symbol 352 MovieClip [Enemy_D] Frame 169
changeIdle();
Symbol 352 MovieClip [Enemy_D] Frame 190
changeIdle();
Symbol 352 MovieClip [Enemy_D] Frame 211
changeIdle();
Symbol 352 MovieClip [Enemy_D] Frame 221
Symbol 352 MovieClip [Enemy_D] Frame 222
windupCheck();
Symbol 352 MovieClip [Enemy_D] Frame 224
attackHit();
Symbol 352 MovieClip [Enemy_D] Frame 229
attackPause();
Symbol 352 MovieClip [Enemy_D] Frame 234
returnIdle();
Symbol 352 MovieClip [Enemy_D] Frame 244
Symbol 352 MovieClip [Enemy_D] Frame 245
windupCheck();
Symbol 352 MovieClip [Enemy_D] Frame 247
attackHit();
Symbol 352 MovieClip [Enemy_D] Frame 252
attackPause();
Symbol 352 MovieClip [Enemy_D] Frame 257
returnIdle();
Symbol 352 MovieClip [Enemy_D] Frame 267
Symbol 352 MovieClip [Enemy_D] Frame 268
windupCheck();
Symbol 352 MovieClip [Enemy_D] Frame 270
attackHit();
Symbol 352 MovieClip [Enemy_D] Frame 275
attackPause();
Symbol 352 MovieClip [Enemy_D] Frame 280
returnIdle();
Symbol 352 MovieClip [Enemy_D] Frame 290
Symbol 352 MovieClip [Enemy_D] Frame 291
windupCheck();
Symbol 352 MovieClip [Enemy_D] Frame 293
attackHit();
Symbol 352 MovieClip [Enemy_D] Frame 298
attackPause();
Symbol 352 MovieClip [Enemy_D] Frame 303
returnIdle();
Symbol 352 MovieClip [Enemy_D] Frame 313
Symbol 352 MovieClip [Enemy_D] Frame 314
windupCheck();
Symbol 352 MovieClip [Enemy_D] Frame 316
attackHit();
Symbol 352 MovieClip [Enemy_D] Frame 321
attackPause();
Symbol 352 MovieClip [Enemy_D] Frame 326
returnIdle();
Symbol 352 MovieClip [Enemy_D] Frame 336
Symbol 352 MovieClip [Enemy_D] Frame 337
windupCheck();
Symbol 352 MovieClip [Enemy_D] Frame 339
attackHit();
Symbol 352 MovieClip [Enemy_D] Frame 344
attackPause();
Symbol 352 MovieClip [Enemy_D] Frame 349
returnIdle();
Symbol 352 MovieClip [Enemy_D] Frame 359
Symbol 352 MovieClip [Enemy_D] Frame 360
windupCheck();
Symbol 352 MovieClip [Enemy_D] Frame 362
attackHit();
Symbol 352 MovieClip [Enemy_D] Frame 367
attackPause();
Symbol 352 MovieClip [Enemy_D] Frame 372
returnIdle();
Symbol 352 MovieClip [Enemy_D] Frame 382
Symbol 352 MovieClip [Enemy_D] Frame 383
windupCheck();
Symbol 352 MovieClip [Enemy_D] Frame 385
attackHit();
Symbol 352 MovieClip [Enemy_D] Frame 390
attackPause();
Symbol 352 MovieClip [Enemy_D] Frame 395
returnIdle();
Symbol 352 MovieClip [Enemy_D] Frame 405
Symbol 352 MovieClip [Enemy_D] Frame 406
windupCheck();
Symbol 352 MovieClip [Enemy_D] Frame 408
attackHit();
Symbol 352 MovieClip [Enemy_D] Frame 413
attackPause();
Symbol 352 MovieClip [Enemy_D] Frame 418
returnIdle();
Symbol 352 MovieClip [Enemy_D] Frame 431
returnIdle();
Symbol 352 MovieClip [Enemy_D] Frame 444
returnIdle();
Symbol 352 MovieClip [Enemy_D] Frame 457
returnIdle();
Symbol 352 MovieClip [Enemy_D] Frame 470
returnIdle();
Symbol 352 MovieClip [Enemy_D] Frame 483
returnIdle();
Symbol 352 MovieClip [Enemy_D] Frame 496
returnIdle();
Symbol 352 MovieClip [Enemy_D] Frame 509
returnIdle();
Symbol 352 MovieClip [Enemy_D] Frame 522
returnIdle();
Symbol 352 MovieClip [Enemy_D] Frame 535
returnIdle();
Symbol 352 MovieClip [Enemy_D] Frame 548
returnIdle();
Symbol 352 MovieClip [Enemy_D] Frame 561
returnIdle();
Symbol 352 MovieClip [Enemy_D] Frame 574
returnIdle();
Symbol 352 MovieClip [Enemy_D] Frame 587
returnIdle();
Symbol 352 MovieClip [Enemy_D] Frame 600
returnIdle();
Symbol 352 MovieClip [Enemy_D] Frame 613
returnIdle();
Symbol 352 MovieClip [Enemy_D] Frame 626
returnIdle();
Symbol 352 MovieClip [Enemy_D] Frame 639
returnIdle();
Symbol 352 MovieClip [Enemy_D] Frame 652
returnIdle();
Symbol 352 MovieClip [Enemy_D] Frame 713
_parent.AreaCleared();
stop();
Symbol 366 MovieClip [Enemy_E] Frame 1
function changeIdle() {
if (currentlyAlive == 1) {
if (currentlyIdle == 1) {
enemyState = "idle";
newIdle = "Idle" + currentSector;
if (newIdle != idleSector) {
_parent.SoundFX.EnemyIdle();
}
idleSector = newIdle;
gotoAndPlay(newIdle);
}
}
}
function returnIdle() {
currentlyIdle = 1;
changeIdle();
}
function stepCycle() {
if ((currentlyIdle == 1) and (currentlyAlive == 1)) {
aggressionModifier = 0.1;
boboboWindup = _parent.boboboPower;
RecentAttacks = _parent.attackTimes.length;
if (RecentAttacks > 2) {
aggressionModifier = 0;
} else if (boboboWindup > 10) {
modifiedPerception = Perception + (boboboWindup * 0.5);
perceptionRoll = percentileCheck(Perception);
intelligenceRoll = percentileCheck(Intelligence);
if (perceptionRoll >= 0) {
if (intelligenceRoll >= 0) {
aggressionModifier = 100;
windupPreset = 1;
} else {
aggressionModifier = 0;
}
}
}
modifiedAggression = Aggression * aggressionModifier;
if (percentileCheck(modifiedAggression) >= 0) {
trace("Attacking at " + (getTimer() / 1000));
playerSector = guessPlayerSector();
attackSector = pickTargetLocation(playerSector);
beginAttack(attackSector);
} else {
currentSector = guessPlayerSector();
}
}
}
function getCurrentSector() {
return(currentSector);
}
function getPower() {
currentPower = attackState;
return(currentPower);
}
function blockAttack(whichSector) {
if (currentlyAlive == 1) {
currentlyIdle = 0;
gotoAndPlay("Block" + currentSector);
enemyState = "blocking";
}
}
function beginAttack(whichSector) {
currentSector = whichSector;
currentlyIdle = 0;
attackState = 1;
if (windupPreset > 0) {
windupFull = windupPreset;
windupPreset = 0;
} else if ((percentileCheck(Intelligence) >= 0) and (lastHits.length == 10)) {
lastHitCount = 0;
var _local1 = 0;
while (_local1 < lastHits.length) {
lastHitCount = lastHitCount + lastHits[_local1];
_local1++;
}
lastHitAverage = lastHitCount / lastHits.length;
trace(((("Average hitting windup is " + lastHitAverage) + " -- (") + lastHits) + ")");
windupFull = (lastHitAverage + random(11)) - 5;
if (windupFull > 100) {
windupFull = 100;
}
} else {
windupFull = random(100);
}
pauseLength = windupFull / 5;
gotoAndPlay("Attack" + whichSector);
enemyState = "windingUp";
}
function windupCheck() {
if (attackState > 0) {
if (attackState < windupFull) {
boboboWindup = _parent.boboboPower;
if (boboboWindup > 0) {
modifiedPerception = Perception + (boboboWindup * 0.5);
perceptionRoll = percentileCheck(Perception);
intelligenceRoll = percentileCheck(Intelligence);
if (perceptionRoll >= 0) {
if (intelligenceRoll >= 0) {
currentSector = guessPlayerSector();
}
}
}
attackState = (attackState + 1) + (Speed / 25);
gotoAndPlay("WindupCheck" + currentSector);
} else {
enemyState = "attacking";
}
}
}
function attackPause() {
if (pauseLength > 0) {
pauseLength--;
gotoAndPlay("AttackPause" + currentSector);
}
}
function hitByPlayer(whichSector) {
if (currentlyAlive == 1) {
currentSector = whichSector;
currentlyIdle = 0;
pauseLength = 0;
attackState = 0;
gotoAndPlay("Hit" + currentSector);
enemyState = "stunned";
}
}
function attackHit() {
_parent.checkEnemyAttack(currentSector);
attackState = 0;
}
function Die() {
if (currentlyAlive == 1) {
currentlyAlive = 0;
currentlyIdle = 0;
gotoAndPlay ("Die");
}
}
function percentileCheck(percentChance) {
randomNumber = random(100) + 1;
percentDifference = percentChance - randomNumber;
return(percentDifference);
}
function guessPlayerSector() {
actualPlayerSector = _parent.getCurrentSector();
boboboWindup = _parent.boboboPower;
modifiedPerception = Perception + (boboboWindup * 0.25);
RecentAttacks = _parent.attackTimes.length;
if (RecentAttacks > 2) {
modifiedPerception = 100;
}
perceptionRoll = percentileCheck(modifiedPerception);
if (perceptionRoll >= 0) {
return(actualPlayerSector);
}
xCurrent = _parent._xmouse;
yCurrent = _parent._ymouse;
xMiss = xCurrent + (random(perceptionRoll * -12) / 2);
if (xMiss > 600) {
xMiss = 600 - (xMiss - 600);
} else if (xMiss < 0) {
xMiss = -xMiss;
}
yMiss = yCurrent + (random(perceptionRoll * -8) / 2);
if (yMiss > 400) {
yMiss = 400 - (yMiss - 400);
} else if (yMiss < 0) {
yMiss = -yMiss;
}
guessedSector = _parent.coordinateToSector(xMiss, yMiss);
return(guessedSector);
}
function pickTargetLocation(playerSector) {
if (playerSector == "A1") {
possibleSectors = ["A3", "B2", "B3", "C1", "C2", "C3"];
} else if (playerSector == "A2") {
possibleSectors = ["B1", "B3", "C1", "C2", "C3"];
} else if (playerSector == "A3") {
possibleSectors = ["A1", "B1", "B2", "C1", "C2", "C3"];
} else if (playerSector == "B1") {
possibleSectors = ["A2", "A3", "B3", "C2", "C3"];
} else if (playerSector == "B2") {
possibleSectors = ["A1", "A3", "C1", "C3"];
} else if (playerSector == "B3") {
possibleSectors = ["A1", "A2", "B1", "C1", "C2"];
} else if (playerSector == "C1") {
possibleSectors = ["A1", "A2", "A3", "B2", "B3", "C3"];
} else if (playerSector == "C2") {
possibleSectors = ["A1", "A2", "A3", "B1", "B3"];
} else if (playerSector == "C3") {
possibleSectors = ["A1", "A2", "A3", "B1", "B2", "C1"];
}
trace("DEBUG -- possiblesectors is " + possibleSectors);
whichSector = possibleSectors[random(possibleSectors.length)];
trace("DEBUG -- sector chosen: " + whichSector);
return(whichSector);
}
currentlyIdle = 1;
currentSector = "B2";
lastUpdate = getTimer();
changeIdle();
enemyState = "idle";
attackState = 0;
windupFull = 0;
pauseLength = 0;
idleSector = null;
windupPreset = 0;
lastHits = [];
this.onEnterFrame = function () {
if ((currentlyAlive == 1) and (_parent.inCombat == 1)) {
RecentAttacks = _parent.attackTimes.length;
if (RecentAttacks > 2) {
changeIdle();
}
currentTime = getTimer();
if ((currentTime - lastUpdate) > 100) {
lastUpdate = currentTime;
stepCycle();
}
}
};
Symbol 366 MovieClip [Enemy_E] Frame 2
currentlyIdle = 1;
Symbol 366 MovieClip [Enemy_E] Frame 22
if (continueIdle == 1) {
gotoAndPlay ("IdleLoop");
}
Symbol 366 MovieClip [Enemy_E] Frame 43
changeIdle();
Symbol 366 MovieClip [Enemy_E] Frame 64
changeIdle();
Symbol 366 MovieClip [Enemy_E] Frame 85
changeIdle();
Symbol 366 MovieClip [Enemy_E] Frame 106
changeIdle();
Symbol 366 MovieClip [Enemy_E] Frame 127
changeIdle();
Symbol 366 MovieClip [Enemy_E] Frame 148
changeIdle();
Symbol 366 MovieClip [Enemy_E] Frame 169
changeIdle();
Symbol 366 MovieClip [Enemy_E] Frame 190
changeIdle();
Symbol 366 MovieClip [Enemy_E] Frame 211
changeIdle();
Symbol 366 MovieClip [Enemy_E] Frame 221
Symbol 366 MovieClip [Enemy_E] Frame 222
windupCheck();
Symbol 366 MovieClip [Enemy_E] Frame 224
attackHit();
Symbol 366 MovieClip [Enemy_E] Frame 229
attackPause();
Symbol 366 MovieClip [Enemy_E] Frame 234
returnIdle();
Symbol 366 MovieClip [Enemy_E] Frame 244
Symbol 366 MovieClip [Enemy_E] Frame 245
windupCheck();
Symbol 366 MovieClip [Enemy_E] Frame 247
attackHit();
Symbol 366 MovieClip [Enemy_E] Frame 252
attackPause();
Symbol 366 MovieClip [Enemy_E] Frame 257
returnIdle();
Symbol 366 MovieClip [Enemy_E] Frame 267
Symbol 366 MovieClip [Enemy_E] Frame 268
windupCheck();
Symbol 366 MovieClip [Enemy_E] Frame 270
attackHit();
Symbol 366 MovieClip [Enemy_E] Frame 275
attackPause();
Symbol 366 MovieClip [Enemy_E] Frame 280
returnIdle();
Symbol 366 MovieClip [Enemy_E] Frame 290
Symbol 366 MovieClip [Enemy_E] Frame 291
windupCheck();
Symbol 366 MovieClip [Enemy_E] Frame 293
attackHit();
Symbol 366 MovieClip [Enemy_E] Frame 298
attackPause();
Symbol 366 MovieClip [Enemy_E] Frame 303
returnIdle();
Symbol 366 MovieClip [Enemy_E] Frame 313
Symbol 366 MovieClip [Enemy_E] Frame 314
windupCheck();
Symbol 366 MovieClip [Enemy_E] Frame 316
attackHit();
Symbol 366 MovieClip [Enemy_E] Frame 321
attackPause();
Symbol 366 MovieClip [Enemy_E] Frame 326
returnIdle();
Symbol 366 MovieClip [Enemy_E] Frame 336
Symbol 366 MovieClip [Enemy_E] Frame 337
windupCheck();
Symbol 366 MovieClip [Enemy_E] Frame 339
attackHit();
Symbol 366 MovieClip [Enemy_E] Frame 344
attackPause();
Symbol 366 MovieClip [Enemy_E] Frame 349
returnIdle();
Symbol 366 MovieClip [Enemy_E] Frame 359
Symbol 366 MovieClip [Enemy_E] Frame 360
windupCheck();
Symbol 366 MovieClip [Enemy_E] Frame 362
attackHit();
Symbol 366 MovieClip [Enemy_E] Frame 367
attackPause();
Symbol 366 MovieClip [Enemy_E] Frame 372
returnIdle();
Symbol 366 MovieClip [Enemy_E] Frame 382
Symbol 366 MovieClip [Enemy_E] Frame 383
windupCheck();
Symbol 366 MovieClip [Enemy_E] Frame 385
attackHit();
Symbol 366 MovieClip [Enemy_E] Frame 390
attackPause();
Symbol 366 MovieClip [Enemy_E] Frame 395
returnIdle();
Symbol 366 MovieClip [Enemy_E] Frame 405
Symbol 366 MovieClip [Enemy_E] Frame 406
windupCheck();
Symbol 366 MovieClip [Enemy_E] Frame 408
attackHit();
Symbol 366 MovieClip [Enemy_E] Frame 413
attackPause();
Symbol 366 MovieClip [Enemy_E] Frame 418
returnIdle();
Symbol 366 MovieClip [Enemy_E] Frame 431
returnIdle();
Symbol 366 MovieClip [Enemy_E] Frame 444
returnIdle();
Symbol 366 MovieClip [Enemy_E] Frame 457
returnIdle();
Symbol 366 MovieClip [Enemy_E] Frame 470
returnIdle();
Symbol 366 MovieClip [Enemy_E] Frame 483
returnIdle();
Symbol 366 MovieClip [Enemy_E] Frame 496
returnIdle();
Symbol 366 MovieClip [Enemy_E] Frame 509
returnIdle();
Symbol 366 MovieClip [Enemy_E] Frame 522
returnIdle();
Symbol 366 MovieClip [Enemy_E] Frame 535
returnIdle();
Symbol 366 MovieClip [Enemy_E] Frame 548
returnIdle();
Symbol 366 MovieClip [Enemy_E] Frame 561
returnIdle();
Symbol 366 MovieClip [Enemy_E] Frame 574
returnIdle();
Symbol 366 MovieClip [Enemy_E] Frame 587
returnIdle();
Symbol 366 MovieClip [Enemy_E] Frame 600
returnIdle();
Symbol 366 MovieClip [Enemy_E] Frame 613
returnIdle();
Symbol 366 MovieClip [Enemy_E] Frame 626
returnIdle();
Symbol 366 MovieClip [Enemy_E] Frame 639
returnIdle();
Symbol 366 MovieClip [Enemy_E] Frame 652
returnIdle();
Symbol 366 MovieClip [Enemy_E] Frame 713
_parent.AreaCleared();
stop();
Symbol 383 MovieClip [Enemy_F] Frame 1
function changeIdle() {
if (currentlyAlive == 1) {
if (currentlyIdle == 1) {
enemyState = "idle";
newIdle = "Idle" + currentSector;
if (newIdle != idleSector) {
_parent.SoundFX.EnemyIdle();
}
idleSector = newIdle;
gotoAndPlay(newIdle);
}
}
}
function returnIdle() {
currentlyIdle = 1;
changeIdle();
}
function stepCycle() {
if ((currentlyIdle == 1) and (currentlyAlive == 1)) {
aggressionModifier = 0.1;
boboboWindup = _parent.boboboPower;
RecentAttacks = _parent.attackTimes.length;
if (RecentAttacks > 2) {
aggressionModifier = 0;
} else if (boboboWindup > 10) {
modifiedPerception = Perception + (boboboWindup * 0.5);
perceptionRoll = percentileCheck(Perception);
intelligenceRoll = percentileCheck(Intelligence);
if (perceptionRoll >= 0) {
if (intelligenceRoll >= 0) {
aggressionModifier = 100;
windupPreset = 1;
} else {
aggressionModifier = 0;
}
}
}
modifiedAggression = Aggression * aggressionModifier;
if (percentileCheck(modifiedAggression) >= 0) {
trace("Attacking at " + (getTimer() / 1000));
playerSector = guessPlayerSector();
attackSector = pickTargetLocation(playerSector);
beginAttack(attackSector);
} else {
currentSector = guessPlayerSector();
}
}
}
function getCurrentSector() {
return(currentSector);
}
function getPower() {
currentPower = attackState;
return(currentPower);
}
function blockAttack(whichSector) {
if (currentlyAlive == 1) {
currentlyIdle = 0;
gotoAndPlay("Block" + currentSector);
enemyState = "blocking";
}
}
function beginAttack(whichSector) {
currentSector = whichSector;
currentlyIdle = 0;
attackState = 1;
if (windupPreset > 0) {
windupFull = windupPreset;
windupPreset = 0;
} else if ((percentileCheck(Intelligence) >= 0) and (lastHits.length == 10)) {
lastHitCount = 0;
var _local1 = 0;
while (_local1 < lastHits.length) {
lastHitCount = lastHitCount + lastHits[_local1];
_local1++;
}
lastHitAverage = lastHitCount / lastHits.length;
trace(((("Average hitting windup is " + lastHitAverage) + " -- (") + lastHits) + ")");
windupFull = (lastHitAverage + random(11)) - 5;
if (windupFull > 100) {
windupFull = 100;
}
} else {
windupFull = random(100);
}
pauseLength = windupFull / 5;
gotoAndPlay("Attack" + whichSector);
enemyState = "windingUp";
}
function windupCheck() {
if (attackState > 0) {
if (attackState < windupFull) {
boboboWindup = _parent.boboboPower;
if (boboboWindup > 0) {
modifiedPerception = Perception + (boboboWindup * 0.5);
perceptionRoll = percentileCheck(Perception);
intelligenceRoll = percentileCheck(Intelligence);
if (perceptionRoll >= 0) {
if (intelligenceRoll >= 0) {
currentSector = guessPlayerSector();
}
}
}
attackState = (attackState + 1) + (Speed / 25);
gotoAndPlay("WindupCheck" + currentSector);
} else {
enemyState = "attacking";
}
}
}
function attackPause() {
if (pauseLength > 0) {
pauseLength--;
gotoAndPlay("AttackPause" + currentSector);
}
}
function hitByPlayer(whichSector) {
if (currentlyAlive == 1) {
currentSector = whichSector;
currentlyIdle = 0;
pauseLength = 0;
attackState = 0;
gotoAndPlay("Hit" + currentSector);
enemyState = "stunned";
}
}
function attackHit() {
_parent.checkEnemyAttack(currentSector);
attackState = 0;
}
function Die() {
if (currentlyAlive == 1) {
currentlyAlive = 0;
currentlyIdle = 0;
gotoAndPlay ("Die");
}
}
function percentileCheck(percentChance) {
randomNumber = random(100) + 1;
percentDifference = percentChance - randomNumber;
return(percentDifference);
}
function guessPlayerSector() {
actualPlayerSector = _parent.getCurrentSector();
boboboWindup = _parent.boboboPower;
modifiedPerception = Perception + (boboboWindup * 0.25);
RecentAttacks = _parent.attackTimes.length;
if (RecentAttacks > 2) {
modifiedPerception = 100;
}
perceptionRoll = percentileCheck(modifiedPerception);
if (perceptionRoll >= 0) {
return(actualPlayerSector);
}
xCurrent = _parent._xmouse;
yCurrent = _parent._ymouse;
xMiss = xCurrent + (random(perceptionRoll * -12) / 2);
if (xMiss > 600) {
xMiss = 600 - (xMiss - 600);
} else if (xMiss < 0) {
xMiss = -xMiss;
}
yMiss = yCurrent + (random(perceptionRoll * -8) / 2);
if (yMiss > 400) {
yMiss = 400 - (yMiss - 400);
} else if (yMiss < 0) {
yMiss = -yMiss;
}
guessedSector = _parent.coordinateToSector(xMiss, yMiss);
return(guessedSector);
}
function pickTargetLocation(playerSector) {
if (playerSector == "A1") {
possibleSectors = ["A3", "B2", "B3", "C1", "C2", "C3"];
} else if (playerSector == "A2") {
possibleSectors = ["B1", "B3", "C1", "C2", "C3"];
} else if (playerSector == "A3") {
possibleSectors = ["A1", "B1", "B2", "C1", "C2", "C3"];
} else if (playerSector == "B1") {
possibleSectors = ["A2", "A3", "B3", "C2", "C3"];
} else if (playerSector == "B2") {
possibleSectors = ["A1", "A3", "C1", "C3"];
} else if (playerSector == "B3") {
possibleSectors = ["A1", "A2", "B1", "C1", "C2"];
} else if (playerSector == "C1") {
possibleSectors = ["A1", "A2", "A3", "B2", "B3", "C3"];
} else if (playerSector == "C2") {
possibleSectors = ["A1", "A2", "A3", "B1", "B3"];
} else if (playerSector == "C3") {
possibleSectors = ["A1", "A2", "A3", "B1", "B2", "C1"];
}
trace("DEBUG -- possiblesectors is " + possibleSectors);
whichSector = possibleSectors[random(possibleSectors.length)];
trace("DEBUG -- sector chosen: " + whichSector);
return(whichSector);
}
currentlyIdle = 1;
currentSector = "B2";
lastUpdate = getTimer();
changeIdle();
enemyState = "idle";
attackState = 0;
windupFull = 0;
pauseLength = 0;
idleSector = null;
windupPreset = 0;
lastHits = [];
this.onEnterFrame = function () {
if ((currentlyAlive == 1) and (_parent.inCombat == 1)) {
RecentAttacks = _parent.attackTimes.length;
if (RecentAttacks > 2) {
changeIdle();
}
currentTime = getTimer();
if ((currentTime - lastUpdate) > 100) {
lastUpdate = currentTime;
stepCycle();
}
}
};
Symbol 383 MovieClip [Enemy_F] Frame 2
currentlyIdle = 1;
Symbol 383 MovieClip [Enemy_F] Frame 22
if (continueIdle == 1) {
gotoAndPlay ("IdleLoop");
}
Symbol 383 MovieClip [Enemy_F] Frame 43
changeIdle();
Symbol 383 MovieClip [Enemy_F] Frame 64
changeIdle();
Symbol 383 MovieClip [Enemy_F] Frame 85
changeIdle();
Symbol 383 MovieClip [Enemy_F] Frame 106
changeIdle();
Symbol 383 MovieClip [Enemy_F] Frame 127
changeIdle();
Symbol 383 MovieClip [Enemy_F] Frame 148
changeIdle();
Symbol 383 MovieClip [Enemy_F] Frame 169
changeIdle();
Symbol 383 MovieClip [Enemy_F] Frame 190
changeIdle();
Symbol 383 MovieClip [Enemy_F] Frame 211
changeIdle();
Symbol 383 MovieClip [Enemy_F] Frame 221
Symbol 383 MovieClip [Enemy_F] Frame 222
windupCheck();
Symbol 383 MovieClip [Enemy_F] Frame 224
attackHit();
Symbol 383 MovieClip [Enemy_F] Frame 229
attackPause();
Symbol 383 MovieClip [Enemy_F] Frame 234
returnIdle();
Symbol 383 MovieClip [Enemy_F] Frame 244
Symbol 383 MovieClip [Enemy_F] Frame 245
windupCheck();
Symbol 383 MovieClip [Enemy_F] Frame 247
attackHit();
Symbol 383 MovieClip [Enemy_F] Frame 252
attackPause();
Symbol 383 MovieClip [Enemy_F] Frame 257
returnIdle();
Symbol 383 MovieClip [Enemy_F] Frame 267
Symbol 383 MovieClip [Enemy_F] Frame 268
windupCheck();
Symbol 383 MovieClip [Enemy_F] Frame 270
attackHit();
Symbol 383 MovieClip [Enemy_F] Frame 275
attackPause();
Symbol 383 MovieClip [Enemy_F] Frame 280
returnIdle();
Symbol 383 MovieClip [Enemy_F] Frame 290
Symbol 383 MovieClip [Enemy_F] Frame 291
windupCheck();
Symbol 383 MovieClip [Enemy_F] Frame 293
attackHit();
Symbol 383 MovieClip [Enemy_F] Frame 298
attackPause();
Symbol 383 MovieClip [Enemy_F] Frame 303
returnIdle();
Symbol 383 MovieClip [Enemy_F] Frame 313
Symbol 383 MovieClip [Enemy_F] Frame 314
windupCheck();
Symbol 383 MovieClip [Enemy_F] Frame 316
attackHit();
Symbol 383 MovieClip [Enemy_F] Frame 321
attackPause();
Symbol 383 MovieClip [Enemy_F] Frame 326
returnIdle();
Symbol 383 MovieClip [Enemy_F] Frame 336
Symbol 383 MovieClip [Enemy_F] Frame 337
windupCheck();
Symbol 383 MovieClip [Enemy_F] Frame 339
attackHit();
Symbol 383 MovieClip [Enemy_F] Frame 344
attackPause();
Symbol 383 MovieClip [Enemy_F] Frame 349
returnIdle();
Symbol 383 MovieClip [Enemy_F] Frame 359
Symbol 383 MovieClip [Enemy_F] Frame 360
windupCheck();
Symbol 383 MovieClip [Enemy_F] Frame 362
attackHit();
Symbol 383 MovieClip [Enemy_F] Frame 367
attackPause();
Symbol 383 MovieClip [Enemy_F] Frame 372
returnIdle();
Symbol 383 MovieClip [Enemy_F] Frame 382
Symbol 383 MovieClip [Enemy_F] Frame 383
windupCheck();
Symbol 383 MovieClip [Enemy_F] Frame 385
attackHit();
Symbol 383 MovieClip [Enemy_F] Frame 390
attackPause();
Symbol 383 MovieClip [Enemy_F] Frame 395
returnIdle();
Symbol 383 MovieClip [Enemy_F] Frame 405
Symbol 383 MovieClip [Enemy_F] Frame 406
windupCheck();
Symbol 383 MovieClip [Enemy_F] Frame 408
attackHit();
Symbol 383 MovieClip [Enemy_F] Frame 413
attackPause();
Symbol 383 MovieClip [Enemy_F] Frame 418
returnIdle();
Symbol 383 MovieClip [Enemy_F] Frame 431
returnIdle();
Symbol 383 MovieClip [Enemy_F] Frame 444
returnIdle();
Symbol 383 MovieClip [Enemy_F] Frame 457
returnIdle();
Symbol 383 MovieClip [Enemy_F] Frame 470
returnIdle();
Symbol 383 MovieClip [Enemy_F] Frame 483
returnIdle();
Symbol 383 MovieClip [Enemy_F] Frame 496
returnIdle();
Symbol 383 MovieClip [Enemy_F] Frame 509
returnIdle();
Symbol 383 MovieClip [Enemy_F] Frame 522
returnIdle();
Symbol 383 MovieClip [Enemy_F] Frame 535
returnIdle();
Symbol 383 MovieClip [Enemy_F] Frame 548
returnIdle();
Symbol 383 MovieClip [Enemy_F] Frame 561
returnIdle();
Symbol 383 MovieClip [Enemy_F] Frame 574
returnIdle();
Symbol 383 MovieClip [Enemy_F] Frame 587
returnIdle();
Symbol 383 MovieClip [Enemy_F] Frame 600
returnIdle();
Symbol 383 MovieClip [Enemy_F] Frame 613
returnIdle();
Symbol 383 MovieClip [Enemy_F] Frame 626
returnIdle();
Symbol 383 MovieClip [Enemy_F] Frame 639
returnIdle();
Symbol 383 MovieClip [Enemy_F] Frame 652
returnIdle();
Symbol 383 MovieClip [Enemy_F] Frame 713
_parent.AreaCleared();
stop();
Symbol 397 MovieClip [Enemy_G] Frame 1
function changeIdle() {
if (currentlyAlive == 1) {
if (currentlyIdle == 1) {
enemyState = "idle";
newIdle = "Idle" + currentSector;
if (newIdle != idleSector) {
_parent.SoundFX.EnemyIdle();
}
idleSector = newIdle;
gotoAndPlay(newIdle);
}
}
}
function returnIdle() {
currentlyIdle = 1;
changeIdle();
}
function stepCycle() {
if ((currentlyIdle == 1) and (currentlyAlive == 1)) {
aggressionModifier = 0.1;
boboboWindup = _parent.boboboPower;
RecentAttacks = _parent.attackTimes.length;
if (RecentAttacks > 2) {
aggressionModifier = 0;
} else if (boboboWindup > 10) {
modifiedPerception = Perception + (boboboWindup * 0.5);
perceptionRoll = percentileCheck(Perception);
intelligenceRoll = percentileCheck(Intelligence);
if (perceptionRoll >= 0) {
if (intelligenceRoll >= 0) {
aggressionModifier = 100;
windupPreset = 1;
} else {
aggressionModifier = 0;
}
}
}
modifiedAggression = Aggression * aggressionModifier;
if (percentileCheck(modifiedAggression) >= 0) {
trace("Attacking at " + (getTimer() / 1000));
playerSector = guessPlayerSector();
attackSector = pickTargetLocation(playerSector);
beginAttack(attackSector);
} else {
currentSector = guessPlayerSector();
}
}
}
function getCurrentSector() {
return(currentSector);
}
function getPower() {
currentPower = attackState;
return(currentPower);
}
function blockAttack(whichSector) {
if (currentlyAlive == 1) {
currentlyIdle = 0;
gotoAndPlay("Block" + currentSector);
enemyState = "blocking";
}
}
function beginAttack(whichSector) {
currentSector = whichSector;
currentlyIdle = 0;
attackState = 1;
if (windupPreset > 0) {
windupFull = windupPreset;
windupPreset = 0;
} else if ((percentileCheck(Intelligence) >= 0) and (lastHits.length == 10)) {
lastHitCount = 0;
var _local1 = 0;
while (_local1 < lastHits.length) {
lastHitCount = lastHitCount + lastHits[_local1];
_local1++;
}
lastHitAverage = lastHitCount / lastHits.length;
trace(((("Average hitting windup is " + lastHitAverage) + " -- (") + lastHits) + ")");
windupFull = (lastHitAverage + random(11)) - 5;
if (windupFull > 100) {
windupFull = 100;
}
} else {
windupFull = random(100);
}
pauseLength = windupFull / 5;
gotoAndPlay("Attack" + whichSector);
enemyState = "windingUp";
}
function windupCheck() {
if (attackState > 0) {
if (attackState < windupFull) {
boboboWindup = _parent.boboboPower;
if (boboboWindup > 0) {
modifiedPerception = Perception + (boboboWindup * 0.5);
perceptionRoll = percentileCheck(Perception);
intelligenceRoll = percentileCheck(Intelligence);
if (perceptionRoll >= 0) {
if (intelligenceRoll >= 0) {
currentSector = guessPlayerSector();
}
}
}
attackState = (attackState + 1) + (Speed / 25);
gotoAndPlay("WindupCheck" + currentSector);
} else {
enemyState = "attacking";
}
}
}
function attackPause() {
if (pauseLength > 0) {
pauseLength--;
gotoAndPlay("AttackPause" + currentSector);
}
}
function hitByPlayer(whichSector) {
if (currentlyAlive == 1) {
currentSector = whichSector;
currentlyIdle = 0;
pauseLength = 0;
attackState = 0;
gotoAndPlay("Hit" + currentSector);
enemyState = "stunned";
}
}
function attackHit() {
_parent.checkEnemyAttack(currentSector);
attackState = 0;
}
function Die() {
if (currentlyAlive == 1) {
currentlyAlive = 0;
currentlyIdle = 0;
gotoAndPlay ("Die");
}
}
function percentileCheck(percentChance) {
randomNumber = random(100) + 1;
percentDifference = percentChance - randomNumber;
return(percentDifference);
}
function guessPlayerSector() {
actualPlayerSector = _parent.getCurrentSector();
boboboWindup = _parent.boboboPower;
modifiedPerception = Perception + (boboboWindup * 0.25);
RecentAttacks = _parent.attackTimes.length;
if (RecentAttacks > 2) {
modifiedPerception = 100;
}
perceptionRoll = percentileCheck(modifiedPerception);
if (perceptionRoll >= 0) {
return(actualPlayerSector);
}
xCurrent = _parent._xmouse;
yCurrent = _parent._ymouse;
xMiss = xCurrent + (random(perceptionRoll * -12) / 2);
if (xMiss > 600) {
xMiss = 600 - (xMiss - 600);
} else if (xMiss < 0) {
xMiss = -xMiss;
}
yMiss = yCurrent + (random(perceptionRoll * -8) / 2);
if (yMiss > 400) {
yMiss = 400 - (yMiss - 400);
} else if (yMiss < 0) {
yMiss = -yMiss;
}
guessedSector = _parent.coordinateToSector(xMiss, yMiss);
return(guessedSector);
}
function pickTargetLocation(playerSector) {
if (playerSector == "A1") {
possibleSectors = ["A3", "B2", "B3", "C1", "C2", "C3"];
} else if (playerSector == "A2") {
possibleSectors = ["B1", "B3", "C1", "C2", "C3"];
} else if (playerSector == "A3") {
possibleSectors = ["A1", "B1", "B2", "C1", "C2", "C3"];
} else if (playerSector == "B1") {
possibleSectors = ["A2", "A3", "B3", "C2", "C3"];
} else if (playerSector == "B2") {
possibleSectors = ["A1", "A3", "C1", "C3"];
} else if (playerSector == "B3") {
possibleSectors = ["A1", "A2", "B1", "C1", "C2"];
} else if (playerSector == "C1") {
possibleSectors = ["A1", "A2", "A3", "B2", "B3", "C3"];
} else if (playerSector == "C2") {
possibleSectors = ["A1", "A2", "A3", "B1", "B3"];
} else if (playerSector == "C3") {
possibleSectors = ["A1", "A2", "A3", "B1", "B2", "C1"];
}
trace("DEBUG -- possiblesectors is " + possibleSectors);
whichSector = possibleSectors[random(possibleSectors.length)];
trace("DEBUG -- sector chosen: " + whichSector);
return(whichSector);
}
currentlyIdle = 1;
currentSector = "B2";
lastUpdate = getTimer();
changeIdle();
enemyState = "idle";
attackState = 0;
windupFull = 0;
pauseLength = 0;
idleSector = null;
windupPreset = 0;
lastHits = [];
this.onEnterFrame = function () {
if ((currentlyAlive == 1) and (_parent.inCombat == 1)) {
RecentAttacks = _parent.attackTimes.length;
if (RecentAttacks > 2) {
changeIdle();
}
currentTime = getTimer();
if ((currentTime - lastUpdate) > 100) {
lastUpdate = currentTime;
stepCycle();
}
}
};
Symbol 397 MovieClip [Enemy_G] Frame 2
currentlyIdle = 1;
Symbol 397 MovieClip [Enemy_G] Frame 22
if (continueIdle == 1) {
gotoAndPlay ("IdleLoop");
}
Symbol 397 MovieClip [Enemy_G] Frame 43
changeIdle();
Symbol 397 MovieClip [Enemy_G] Frame 64
changeIdle();
Symbol 397 MovieClip [Enemy_G] Frame 85
changeIdle();
Symbol 397 MovieClip [Enemy_G] Frame 106
changeIdle();
Symbol 397 MovieClip [Enemy_G] Frame 127
changeIdle();
Symbol 397 MovieClip [Enemy_G] Frame 148
changeIdle();
Symbol 397 MovieClip [Enemy_G] Frame 169
changeIdle();
Symbol 397 MovieClip [Enemy_G] Frame 190
changeIdle();
Symbol 397 MovieClip [Enemy_G] Frame 211
changeIdle();
Symbol 397 MovieClip [Enemy_G] Frame 221
Symbol 397 MovieClip [Enemy_G] Frame 222
windupCheck();
Symbol 397 MovieClip [Enemy_G] Frame 224
attackHit();
Symbol 397 MovieClip [Enemy_G] Frame 229
attackPause();
Symbol 397 MovieClip [Enemy_G] Frame 234
returnIdle();
Symbol 397 MovieClip [Enemy_G] Frame 244
Symbol 397 MovieClip [Enemy_G] Frame 245
windupCheck();
Symbol 397 MovieClip [Enemy_G] Frame 247
attackHit();
Symbol 397 MovieClip [Enemy_G] Frame 252
attackPause();
Symbol 397 MovieClip [Enemy_G] Frame 257
returnIdle();
Symbol 397 MovieClip [Enemy_G] Frame 267
Symbol 397 MovieClip [Enemy_G] Frame 268
windupCheck();
Symbol 397 MovieClip [Enemy_G] Frame 270
attackHit();
Symbol 397 MovieClip [Enemy_G] Frame 275
attackPause();
Symbol 397 MovieClip [Enemy_G] Frame 280
returnIdle();
Symbol 397 MovieClip [Enemy_G] Frame 290
Symbol 397 MovieClip [Enemy_G] Frame 291
windupCheck();
Symbol 397 MovieClip [Enemy_G] Frame 293
attackHit();
Symbol 397 MovieClip [Enemy_G] Frame 298
attackPause();
Symbol 397 MovieClip [Enemy_G] Frame 303
returnIdle();
Symbol 397 MovieClip [Enemy_G] Frame 313
Symbol 397 MovieClip [Enemy_G] Frame 314
windupCheck();
Symbol 397 MovieClip [Enemy_G] Frame 316
attackHit();
Symbol 397 MovieClip [Enemy_G] Frame 321
attackPause();
Symbol 397 MovieClip [Enemy_G] Frame 326
returnIdle();
Symbol 397 MovieClip [Enemy_G] Frame 336
Symbol 397 MovieClip [Enemy_G] Frame 337
windupCheck();
Symbol 397 MovieClip [Enemy_G] Frame 339
attackHit();
Symbol 397 MovieClip [Enemy_G] Frame 344
attackPause();
Symbol 397 MovieClip [Enemy_G] Frame 349
returnIdle();
Symbol 397 MovieClip [Enemy_G] Frame 359
Symbol 397 MovieClip [Enemy_G] Frame 360
windupCheck();
Symbol 397 MovieClip [Enemy_G] Frame 362
attackHit();
Symbol 397 MovieClip [Enemy_G] Frame 367
attackPause();
Symbol 397 MovieClip [Enemy_G] Frame 372
returnIdle();
Symbol 397 MovieClip [Enemy_G] Frame 382
Symbol 397 MovieClip [Enemy_G] Frame 383
windupCheck();
Symbol 397 MovieClip [Enemy_G] Frame 385
attackHit();
Symbol 397 MovieClip [Enemy_G] Frame 390
attackPause();
Symbol 397 MovieClip [Enemy_G] Frame 395
returnIdle();
Symbol 397 MovieClip [Enemy_G] Frame 405
Symbol 397 MovieClip [Enemy_G] Frame 406
windupCheck();
Symbol 397 MovieClip [Enemy_G] Frame 408
attackHit();
Symbol 397 MovieClip [Enemy_G] Frame 413
attackPause();
Symbol 397 MovieClip [Enemy_G] Frame 418
returnIdle();
Symbol 397 MovieClip [Enemy_G] Frame 431
returnIdle();
Symbol 397 MovieClip [Enemy_G] Frame 444
returnIdle();
Symbol 397 MovieClip [Enemy_G] Frame 457
returnIdle();
Symbol 397 MovieClip [Enemy_G] Frame 470
returnIdle();
Symbol 397 MovieClip [Enemy_G] Frame 483
returnIdle();
Symbol 397 MovieClip [Enemy_G] Frame 496
returnIdle();
Symbol 397 MovieClip [Enemy_G] Frame 509
returnIdle();
Symbol 397 MovieClip [Enemy_G] Frame 522
returnIdle();
Symbol 397 MovieClip [Enemy_G] Frame 535
returnIdle();
Symbol 397 MovieClip [Enemy_G] Frame 548
returnIdle();
Symbol 397 MovieClip [Enemy_G] Frame 561
returnIdle();
Symbol 397 MovieClip [Enemy_G] Frame 574
returnIdle();
Symbol 397 MovieClip [Enemy_G] Frame 587
returnIdle();
Symbol 397 MovieClip [Enemy_G] Frame 600
returnIdle();
Symbol 397 MovieClip [Enemy_G] Frame 613
returnIdle();
Symbol 397 MovieClip [Enemy_G] Frame 626
returnIdle();
Symbol 397 MovieClip [Enemy_G] Frame 639
returnIdle();
Symbol 397 MovieClip [Enemy_G] Frame 652
returnIdle();
Symbol 397 MovieClip [Enemy_G] Frame 713
_parent.AreaCleared();
stop();
Symbol 412 MovieClip [Enemy_H] Frame 1
function changeIdle() {
if (currentlyAlive == 1) {
if (currentlyIdle == 1) {
enemyState = "idle";
newIdle = "Idle" + currentSector;
if (newIdle != idleSector) {
_parent.SoundFX.EnemyIdle();
}
idleSector = newIdle;
gotoAndPlay(newIdle);
}
}
}
function returnIdle() {
currentlyIdle = 1;
changeIdle();
}
function stepCycle() {
if ((currentlyIdle == 1) and (currentlyAlive == 1)) {
aggressionModifier = 0.1;
boboboWindup = _parent.boboboPower;
RecentAttacks = _parent.attackTimes.length;
if (RecentAttacks > 2) {
aggressionModifier = 0;
} else if (boboboWindup > 10) {
modifiedPerception = Perception + (boboboWindup * 0.5);
perceptionRoll = percentileCheck(Perception);
intelligenceRoll = percentileCheck(Intelligence);
if (perceptionRoll >= 0) {
if (intelligenceRoll >= 0) {
aggressionModifier = 100;
windupPreset = 1;
} else {
aggressionModifier = 0;
}
}
}
modifiedAggression = Aggression * aggressionModifier;
if (percentileCheck(modifiedAggression) >= 0) {
trace("Attacking at " + (getTimer() / 1000));
playerSector = guessPlayerSector();
attackSector = pickTargetLocation(playerSector);
beginAttack(attackSector);
} else {
currentSector = guessPlayerSector();
}
}
}
function getCurrentSector() {
return(currentSector);
}
function getPower() {
currentPower = attackState;
return(currentPower);
}
function blockAttack(whichSector) {
if (currentlyAlive == 1) {
currentlyIdle = 0;
gotoAndPlay("Block" + currentSector);
enemyState = "blocking";
}
}
function beginAttack(whichSector) {
currentSector = whichSector;
currentlyIdle = 0;
attackState = 1;
if (windupPreset > 0) {
windupFull = windupPreset;
windupPreset = 0;
} else if ((percentileCheck(Intelligence) >= 0) and (lastHits.length == 10)) {
lastHitCount = 0;
var _local1 = 0;
while (_local1 < lastHits.length) {
lastHitCount = lastHitCount + lastHits[_local1];
_local1++;
}
lastHitAverage = lastHitCount / lastHits.length;
trace(((("Average hitting windup is " + lastHitAverage) + " -- (") + lastHits) + ")");
windupFull = (lastHitAverage + random(11)) - 5;
if (windupFull > 100) {
windupFull = 100;
}
} else {
windupFull = random(100);
}
pauseLength = windupFull / 5;
gotoAndPlay("Attack" + whichSector);
enemyState = "windingUp";
}
function windupCheck() {
if (attackState > 0) {
if (attackState < windupFull) {
boboboWindup = _parent.boboboPower;
if (boboboWindup > 0) {
modifiedPerception = Perception + (boboboWindup * 0.5);
perceptionRoll = percentileCheck(Perception);
intelligenceRoll = percentileCheck(Intelligence);
if (perceptionRoll >= 0) {
if (intelligenceRoll >= 0) {
currentSector = guessPlayerSector();
}
}
}
attackState = (attackState + 1) + (Speed / 25);
gotoAndPlay("WindupCheck" + currentSector);
} else {
enemyState = "attacking";
}
}
}
function attackPause() {
if (pauseLength > 0) {
pauseLength--;
gotoAndPlay("AttackPause" + currentSector);
}
}
function hitByPlayer(whichSector) {
if (currentlyAlive == 1) {
currentSector = whichSector;
currentlyIdle = 0;
pauseLength = 0;
attackState = 0;
gotoAndPlay("Hit" + currentSector);
enemyState = "stunned";
}
}
function attackHit() {
_parent.checkEnemyAttack(currentSector);
attackState = 0;
}
function Die() {
if (currentlyAlive == 1) {
currentlyAlive = 0;
currentlyIdle = 0;
gotoAndPlay ("Die");
}
}
function percentileCheck(percentChance) {
randomNumber = random(100) + 1;
percentDifference = percentChance - randomNumber;
return(percentDifference);
}
function guessPlayerSector() {
actualPlayerSector = _parent.getCurrentSector();
boboboWindup = _parent.boboboPower;
modifiedPerception = Perception + (boboboWindup * 0.25);
RecentAttacks = _parent.attackTimes.length;
if (RecentAttacks > 2) {
modifiedPerception = 100;
}
perceptionRoll = percentileCheck(modifiedPerception);
if (perceptionRoll >= 0) {
return(actualPlayerSector);
}
xCurrent = _parent._xmouse;
yCurrent = _parent._ymouse;
xMiss = xCurrent + (random(perceptionRoll * -12) / 2);
if (xMiss > 600) {
xMiss = 600 - (xMiss - 600);
} else if (xMiss < 0) {
xMiss = -xMiss;
}
yMiss = yCurrent + (random(perceptionRoll * -8) / 2);
if (yMiss > 400) {
yMiss = 400 - (yMiss - 400);
} else if (yMiss < 0) {
yMiss = -yMiss;
}
guessedSector = _parent.coordinateToSector(xMiss, yMiss);
return(guessedSector);
}
function pickTargetLocation(playerSector) {
if (playerSector == "A1") {
possibleSectors = ["A3", "B2", "B3", "C1", "C2", "C3"];
} else if (playerSector == "A2") {
possibleSectors = ["B1", "B3", "C1", "C2", "C3"];
} else if (playerSector == "A3") {
possibleSectors = ["A1", "B1", "B2", "C1", "C2", "C3"];
} else if (playerSector == "B1") {
possibleSectors = ["A2", "A3", "B3", "C2", "C3"];
} else if (playerSector == "B2") {
possibleSectors = ["A1", "A3", "C1", "C3"];
} else if (playerSector == "B3") {
possibleSectors = ["A1", "A2", "B1", "C1", "C2"];
} else if (playerSector == "C1") {
possibleSectors = ["A1", "A2", "A3", "B2", "B3", "C3"];
} else if (playerSector == "C2") {
possibleSectors = ["A1", "A2", "A3", "B1", "B3"];
} else if (playerSector == "C3") {
possibleSectors = ["A1", "A2", "A3", "B1", "B2", "C1"];
}
trace("DEBUG -- possiblesectors is " + possibleSectors);
whichSector = possibleSectors[random(possibleSectors.length)];
trace("DEBUG -- sector chosen: " + whichSector);
return(whichSector);
}
currentlyIdle = 1;
currentSector = "B2";
lastUpdate = getTimer();
changeIdle();
enemyState = "idle";
attackState = 0;
windupFull = 0;
pauseLength = 0;
idleSector = null;
windupPreset = 0;
lastHits = [];
this.onEnterFrame = function () {
if ((currentlyAlive == 1) and (_parent.inCombat == 1)) {
RecentAttacks = _parent.attackTimes.length;
if (RecentAttacks > 2) {
changeIdle();
}
currentTime = getTimer();
if ((currentTime - lastUpdate) > 100) {
lastUpdate = currentTime;
stepCycle();
}
}
};
Symbol 412 MovieClip [Enemy_H] Frame 2
currentlyIdle = 1;
Symbol 412 MovieClip [Enemy_H] Frame 22
if (continueIdle == 1) {
gotoAndPlay ("IdleLoop");
}
Symbol 412 MovieClip [Enemy_H] Frame 43
changeIdle();
Symbol 412 MovieClip [Enemy_H] Frame 64
changeIdle();
Symbol 412 MovieClip [Enemy_H] Frame 85
changeIdle();
Symbol 412 MovieClip [Enemy_H] Frame 106
changeIdle();
Symbol 412 MovieClip [Enemy_H] Frame 127
changeIdle();
Symbol 412 MovieClip [Enemy_H] Frame 148
changeIdle();
Symbol 412 MovieClip [Enemy_H] Frame 169
changeIdle();
Symbol 412 MovieClip [Enemy_H] Frame 190
changeIdle();
Symbol 412 MovieClip [Enemy_H] Frame 211
changeIdle();
Symbol 412 MovieClip [Enemy_H] Frame 221
Symbol 412 MovieClip [Enemy_H] Frame 222
windupCheck();
Symbol 412 MovieClip [Enemy_H] Frame 224
attackHit();
Symbol 412 MovieClip [Enemy_H] Frame 229
attackPause();
Symbol 412 MovieClip [Enemy_H] Frame 234
returnIdle();
Symbol 412 MovieClip [Enemy_H] Frame 244
Symbol 412 MovieClip [Enemy_H] Frame 245
windupCheck();
Symbol 412 MovieClip [Enemy_H] Frame 247
attackHit();
Symbol 412 MovieClip [Enemy_H] Frame 252
attackPause();
Symbol 412 MovieClip [Enemy_H] Frame 257
returnIdle();
Symbol 412 MovieClip [Enemy_H] Frame 267
Symbol 412 MovieClip [Enemy_H] Frame 268
windupCheck();
Symbol 412 MovieClip [Enemy_H] Frame 270
attackHit();
Symbol 412 MovieClip [Enemy_H] Frame 275
attackPause();
Symbol 412 MovieClip [Enemy_H] Frame 280
returnIdle();
Symbol 412 MovieClip [Enemy_H] Frame 290
Symbol 412 MovieClip [Enemy_H] Frame 291
windupCheck();
Symbol 412 MovieClip [Enemy_H] Frame 293
attackHit();
Symbol 412 MovieClip [Enemy_H] Frame 298
attackPause();
Symbol 412 MovieClip [Enemy_H] Frame 303
returnIdle();
Symbol 412 MovieClip [Enemy_H] Frame 313
Symbol 412 MovieClip [Enemy_H] Frame 314
windupCheck();
Symbol 412 MovieClip [Enemy_H] Frame 316
attackHit();
Symbol 412 MovieClip [Enemy_H] Frame 321
attackPause();
Symbol 412 MovieClip [Enemy_H] Frame 326
returnIdle();
Symbol 412 MovieClip [Enemy_H] Frame 336
Symbol 412 MovieClip [Enemy_H] Frame 337
windupCheck();
Symbol 412 MovieClip [Enemy_H] Frame 339
attackHit();
Symbol 412 MovieClip [Enemy_H] Frame 344
attackPause();
Symbol 412 MovieClip [Enemy_H] Frame 349
returnIdle();
Symbol 412 MovieClip [Enemy_H] Frame 359
Symbol 412 MovieClip [Enemy_H] Frame 360
windupCheck();
Symbol 412 MovieClip [Enemy_H] Frame 362
attackHit();
Symbol 412 MovieClip [Enemy_H] Frame 367
attackPause();
Symbol 412 MovieClip [Enemy_H] Frame 372
returnIdle();
Symbol 412 MovieClip [Enemy_H] Frame 382
Symbol 412 MovieClip [Enemy_H] Frame 383
windupCheck();
Symbol 412 MovieClip [Enemy_H] Frame 385
attackHit();
Symbol 412 MovieClip [Enemy_H] Frame 390
attackPause();
Symbol 412 MovieClip [Enemy_H] Frame 395
returnIdle();
Symbol 412 MovieClip [Enemy_H] Frame 405
Symbol 412 MovieClip [Enemy_H] Frame 406
windupCheck();
Symbol 412 MovieClip [Enemy_H] Frame 408
attackHit();
Symbol 412 MovieClip [Enemy_H] Frame 413
attackPause();
Symbol 412 MovieClip [Enemy_H] Frame 418
returnIdle();
Symbol 412 MovieClip [Enemy_H] Frame 431
returnIdle();
Symbol 412 MovieClip [Enemy_H] Frame 444
returnIdle();
Symbol 412 MovieClip [Enemy_H] Frame 457
returnIdle();
Symbol 412 MovieClip [Enemy_H] Frame 470
returnIdle();
Symbol 412 MovieClip [Enemy_H] Frame 483
returnIdle();
Symbol 412 MovieClip [Enemy_H] Frame 496
returnIdle();
Symbol 412 MovieClip [Enemy_H] Frame 509
returnIdle();
Symbol 412 MovieClip [Enemy_H] Frame 522
returnIdle();
Symbol 412 MovieClip [Enemy_H] Frame 535
returnIdle();
Symbol 412 MovieClip [Enemy_H] Frame 548
returnIdle();
Symbol 412 MovieClip [Enemy_H] Frame 561
returnIdle();
Symbol 412 MovieClip [Enemy_H] Frame 574
returnIdle();
Symbol 412 MovieClip [Enemy_H] Frame 587
returnIdle();
Symbol 412 MovieClip [Enemy_H] Frame 600
returnIdle();
Symbol 412 MovieClip [Enemy_H] Frame 613
returnIdle();
Symbol 412 MovieClip [Enemy_H] Frame 626
returnIdle();
Symbol 412 MovieClip [Enemy_H] Frame 639
returnIdle();
Symbol 412 MovieClip [Enemy_H] Frame 652
returnIdle();
Symbol 412 MovieClip [Enemy_H] Frame 713
_parent.AreaCleared();
stop();
Symbol 418 MovieClip Frame 1
function EnemyIdle() {
randomWhich = 1 + random(4);
gotoAndPlay("EnemyMove" + randomWhich);
}
function PlayerSwish() {
if (playerSwishPause == 0) {
playerSwishPause = 10;
randomWhich = 1 + random(2);
gotoAndPlay("PlayerSwish" + randomWhich);
}
}
playerSwishPause = 0;
stop();
this.onEnterFrame = function () {
if (playerSwishPause > 0) {
playerSwishPause--;
}
};
Symbol 418 MovieClip Frame 16
stop();
Symbol 421 Button
on (release) {
SFX_Interface.gotoAndPlay("Accept");
gotoAndPlay (48);
}
Symbol 424 Button
on (release) {
var fakeVar = new Date().getTime();
("tracker.swf?" + fakeVar);// not popped
SFX_Interface.gotoAndPlay("Accept");
gotoAndPlay (51);
}
Symbol 438 MovieClip Frame 1
function loadBG(BGName) {
currentLocation = BGName;
trace("-- Showing BG for area " + currentLocation);
gotoAndPlay(BGName);
}
Symbol 438 MovieClip Frame 13
stop();
Symbol 438 MovieClip Frame 26
stop();
Symbol 438 MovieClip Frame 39
stop();
Symbol 438 MovieClip Frame 53
stop();
Symbol 438 MovieClip Frame 68
stop();
Symbol 438 MovieClip Frame 81
stop();
Symbol 438 MovieClip Frame 93
stop();
Symbol 438 MovieClip Frame 106
stop();
Symbol 438 MovieClip Frame 118
stop();
Symbol 438 MovieClip Frame 131
stop();
Symbol 469 MovieClip Frame 55
stop();
Symbol 475 MovieClip Frame 45
stop();
Symbol 476 MovieClip Frame 8
stop();
Symbol 484 MovieClip Frame 8
stop();
Symbol 488 MovieClip Frame 1
function showFace() {
playerState = _parent._parent.playerState;
if (playerState == "idle") {
gotoAndPlay ("Idle");
} else if (playerState == "windingUp") {
gotoAndPlay ("windup");
} else if (playerState == "stunned") {
gotoAndPlay ("stunned");
} else if (playerState == "recovery") {
gotoAndPlay ("attackRecover");
} else if (playerState == "attacking") {
gotoAndPlay ("striking");
} else if (playerState == "blocking") {
gotoAndPlay ("Blocking");
}
}
Symbol 488 MovieClip Frame 3
showFace();
Symbol 488 MovieClip Frame 8
showFace();
Symbol 488 MovieClip Frame 18
showFace();
Symbol 488 MovieClip Frame 26
showFace();
Symbol 488 MovieClip Frame 36
showFace();
Symbol 488 MovieClip Frame 46
showFace();
Symbol 489 MovieClip Frame 1
this.onEnterFrame = function () {
currentHealth = _parent.PlayerHealth;
HealthBar._xscale = currentHealth;
currentPower = _parent.boboboPower;
PowerBar._xscale = currentPower;
};
Symbol 501 MovieClip Frame 1
function showFace() {
enemyState = _parent._parent._parent.Enemy.enemyState;
if (enemyState == "idle") {
gotoAndPlay ("Idle");
} else if (enemyState == "windingUp") {
gotoAndPlay ("windup");
} else if (enemyState == "stunned") {
gotoAndPlay ("stunned");
} else if (enemyState == "attacking") {
gotoAndPlay ("striking");
} else if (enemyState == "blocking") {
gotoAndPlay ("Blocking");
}
}
Symbol 501 MovieClip Frame 3
showFace();
Symbol 501 MovieClip Frame 9
showFace();
Symbol 501 MovieClip Frame 17
showFace();
Symbol 501 MovieClip Frame 23
showFace();
Symbol 501 MovieClip Frame 32
showFace();
Symbol 504 MovieClip Frame 1
function showFace() {
enemyState = _parent._parent._parent.Enemy.enemyState;
if (enemyState == "idle") {
gotoAndPlay ("Idle");
} else if (enemyState == "windingUp") {
gotoAndPlay ("windup");
} else if (enemyState == "stunned") {
gotoAndPlay ("stunned");
} else if (enemyState == "attacking") {
gotoAndPlay ("striking");
} else if (enemyState == "blocking") {
gotoAndPlay ("Blocking");
}
}
Symbol 504 MovieClip Frame 3
showFace();
Symbol 504 MovieClip Frame 9
showFace();
Symbol 504 MovieClip Frame 17
showFace();
Symbol 504 MovieClip Frame 23
showFace();
Symbol 504 MovieClip Frame 32
showFace();
Symbol 514 MovieClip Frame 1
function showFace() {
enemyState = _parent._parent._parent.Enemy.enemyState;
if (enemyState == "idle") {
gotoAndPlay ("Idle");
} else if (enemyState == "windingUp") {
gotoAndPlay ("windup");
} else if (enemyState == "stunned") {
gotoAndPlay ("stunned");
} else if (enemyState == "attacking") {
gotoAndPlay ("striking");
} else if (enemyState == "blocking") {
gotoAndPlay ("Blocking");
}
}
Symbol 514 MovieClip Frame 3
showFace();
Symbol 514 MovieClip Frame 9
showFace();
Symbol 514 MovieClip Frame 17
showFace();
Symbol 514 MovieClip Frame 23
showFace();
Symbol 514 MovieClip Frame 32
showFace();
Symbol 520 MovieClip Frame 1
function showFace() {
enemyState = _parent._parent._parent.Enemy.enemyState;
if (enemyState == "idle") {
gotoAndPlay ("Idle");
} else if (enemyState == "windingUp") {
gotoAndPlay ("windup");
} else if (enemyState == "stunned") {
gotoAndPlay ("stunned");
} else if (enemyState == "attacking") {
gotoAndPlay ("striking");
} else if (enemyState == "blocking") {
gotoAndPlay ("Blocking");
}
}
Symbol 520 MovieClip Frame 3
showFace();
Symbol 520 MovieClip Frame 9
showFace();
Symbol 520 MovieClip Frame 17
showFace();
Symbol 520 MovieClip Frame 23
showFace();
Symbol 520 MovieClip Frame 32
showFace();
Symbol 523 MovieClip Frame 1
function showFace() {
enemyState = _parent._parent._parent.Enemy.enemyState;
if (enemyState == "idle") {
gotoAndPlay ("Idle");
} else if (enemyState == "windingUp") {
gotoAndPlay ("windup");
} else if (enemyState == "stunned") {
gotoAndPlay ("stunned");
} else if (enemyState == "attacking") {
gotoAndPlay ("striking");
} else if (enemyState == "blocking") {
gotoAndPlay ("Blocking");
}
}
Symbol 523 MovieClip Frame 3
showFace();
Symbol 523 MovieClip Frame 9
showFace();
Symbol 523 MovieClip Frame 17
showFace();
Symbol 523 MovieClip Frame 23
showFace();
Symbol 523 MovieClip Frame 32
showFace();
Symbol 526 MovieClip Frame 1
function showFace() {
enemyState = _parent._parent._parent.Enemy.enemyState;
if (enemyState == "idle") {
gotoAndPlay ("Idle");
} else if (enemyState == "windingUp") {
gotoAndPlay ("windup");
} else if (enemyState == "stunned") {
gotoAndPlay ("stunned");
} else if (enemyState == "attacking") {
gotoAndPlay ("striking");
} else if (enemyState == "blocking") {
gotoAndPlay ("Blocking");
}
}
Symbol 526 MovieClip Frame 3
showFace();
Symbol 526 MovieClip Frame 9
showFace();
Symbol 526 MovieClip Frame 17
showFace();
Symbol 526 MovieClip Frame 23
showFace();
Symbol 526 MovieClip Frame 32
showFace();
Symbol 529 MovieClip Frame 1
function showFace() {
enemyState = _parent._parent._parent.Enemy.enemyState;
if (enemyState == "idle") {
gotoAndPlay ("Idle");
} else if (enemyState == "windingUp") {
gotoAndPlay ("windup");
} else if (enemyState == "stunned") {
gotoAndPlay ("stunned");
} else if (enemyState == "attacking") {
gotoAndPlay ("striking");
} else if (enemyState == "blocking") {
gotoAndPlay ("Blocking");
}
}
Symbol 529 MovieClip Frame 3
showFace();
Symbol 529 MovieClip Frame 9
showFace();
Symbol 529 MovieClip Frame 17
showFace();
Symbol 529 MovieClip Frame 23
showFace();
Symbol 529 MovieClip Frame 32
showFace();
Symbol 532 MovieClip Frame 1
function showFace() {
enemyState = _parent._parent._parent.Enemy.enemyState;
if (enemyState == "idle") {
gotoAndPlay ("Idle");
} else if (enemyState == "windingUp") {
gotoAndPlay ("windup");
} else if (enemyState == "stunned") {
gotoAndPlay ("stunned");
} else if (enemyState == "attacking") {
gotoAndPlay ("striking");
} else if (enemyState == "blocking") {
gotoAndPlay ("Blocking");
}
}
Symbol 532 MovieClip Frame 3
showFace();
Symbol 532 MovieClip Frame 9
showFace();
Symbol 532 MovieClip Frame 17
showFace();
Symbol 532 MovieClip Frame 23
showFace();
Symbol 532 MovieClip Frame 32
showFace();
Symbol 536 MovieClip Frame 1
function showFace() {
enemyState = _parent._parent._parent.Enemy.enemyState;
if (enemyState == "idle") {
gotoAndPlay ("Idle");
} else if (enemyState == "windingUp") {
gotoAndPlay ("windup");
} else if (enemyState == "stunned") {
gotoAndPlay ("stunned");
} else if (enemyState == "attacking") {
gotoAndPlay ("striking");
} else if (enemyState == "blocking") {
gotoAndPlay ("Blocking");
}
}
Symbol 536 MovieClip Frame 3
showFace();
Symbol 536 MovieClip Frame 9
showFace();
Symbol 536 MovieClip Frame 17
showFace();
Symbol 536 MovieClip Frame 23
showFace();
Symbol 536 MovieClip Frame 32
showFace();
Symbol 537 MovieClip Frame 2
stop();
Symbol 537 MovieClip Frame 10
stop();
Symbol 537 MovieClip Frame 18
stop();
Symbol 537 MovieClip Frame 26
stop();
Symbol 537 MovieClip Frame 34
stop();
Symbol 537 MovieClip Frame 41
stop();
Symbol 537 MovieClip Frame 48
stop();
Symbol 537 MovieClip Frame 56
stop();
Symbol 537 MovieClip Frame 66
stop();
Symbol 538 MovieClip Frame 1
this.onEnterFrame = function () {
currentHealth = 100 * (_parent.Enemy.hitPoints / _parent.EnemyHealth);
HealthBar._xscale = currentHealth;
currentPower = _parent.Enemy.getPower();
PowerBar._xscale = currentPower;
};
Symbol 539 Button
on (press) {
wantstoWindUp = 1;
BeginWindUp();
}
on (release) {
BeginAttack();
wantstoWindUp = 0;
PowerUpFX.gotoAndPlay("Idle");
}
Symbol 553 MovieClip Frame 2
stop();
Symbol 553 MovieClip Frame 10
gotoAndStop ("Hide");
Symbol 590 MovieClip Frame 1
_parent.playerState = "idle";
Symbol 590 MovieClip Frame 2
stop();
Symbol 590 MovieClip Frame 10
_parent.CheckHit();
Symbol 590 MovieClip Frame 21
gotoAndStop ("Hide");
Symbol 590 MovieClip Frame 26
_parent.CheckHit();
Symbol 590 MovieClip Frame 37
gotoAndStop ("Hide");
Symbol 590 MovieClip Frame 43
_parent.CheckHit();
Symbol 590 MovieClip Frame 54
gotoAndStop ("Hide");
Symbol 590 MovieClip Frame 60
_parent.CheckHit();
Symbol 590 MovieClip Frame 70
gotoAndStop ("Hide");
Symbol 590 MovieClip Frame 75
_parent.CheckHit();
Symbol 590 MovieClip Frame 84
gotoAndStop ("Hide");
Symbol 590 MovieClip Frame 90
_parent.CheckHit();
Symbol 590 MovieClip Frame 99
gotoAndStop ("Hide");
Symbol 590 MovieClip Frame 105
_parent.CheckHit();
Symbol 590 MovieClip Frame 113
gotoAndStop ("Hide");
Symbol 590 MovieClip Frame 118
_parent.CheckHit();
Symbol 590 MovieClip Frame 126
gotoAndStop ("Hide");
Symbol 590 MovieClip Frame 132
_parent.CheckHit();
Symbol 590 MovieClip Frame 141
gotoAndStop ("Hide");
Symbol 590 MovieClip Frame 150
gotoAndStop ("Hide");
Symbol 590 MovieClip Frame 159
gotoAndStop ("Hide");
Symbol 590 MovieClip Frame 168
gotoAndStop ("Hide");
Symbol 590 MovieClip Frame 177
gotoAndStop ("Hide");
Symbol 590 MovieClip Frame 185
gotoAndStop ("Hide");
Symbol 590 MovieClip Frame 193
gotoAndStop ("Hide");
Symbol 590 MovieClip Frame 201
gotoAndStop ("Hide");
Symbol 590 MovieClip Frame 209
gotoAndStop ("Hide");
Symbol 590 MovieClip Frame 217
gotoAndStop ("Hide");
Symbol 590 MovieClip Frame 233
if ((_parent.stunnedAmount > 0) and (_parent.playerState == "stunned")) {
gotoAndPlay ("StunnedLoop");
} else {
gotoAndStop ("Hide");
}
Symbol 590 MovieClip Frame 244
_parent.playerState = "recovery";
Hair2.gotoAndPlay(3);
Symbol 590 MovieClip Frame 246
if ((_parent.playerState == "recovery") and (_parent.recoverAmount > 0)) {
gotoAndPlay ("PauseLoop");
}
Symbol 590 MovieClip Frame 254
_parent.attackRecovery = 0;
gotoAndStop ("Hide");
Symbol 596 MovieClip Frame 2
stop();
Symbol 596 MovieClip Frame 55
stop();
Symbol 612 MovieClip Frame 116
stop();
Symbol 614 MovieClip Frame 47
stop();
Symbol 615 MovieClip Frame 75
stop();
Symbol 618 MovieClip Frame 35
stop();
Symbol 619 MovieClip Frame 62
stop();
Symbol 627 Button
on (release) {
_parent.MoveTo(this);
}
Symbol 630 MovieClip Frame 10
stop();
Symbol 630 MovieClip Frame 20
stop();
Symbol 630 MovieClip Frame 30
stop();
Symbol 630 MovieClip Frame 40
stop();
Symbol 635 MovieClip Frame 10
stop();
Symbol 635 MovieClip Frame 20
stop();
Symbol 635 MovieClip Frame 30
stop();
Symbol 635 MovieClip Frame 40
stop();
Symbol 638 MovieClip Frame 10
stop();
Symbol 638 MovieClip Frame 20
stop();
Symbol 638 MovieClip Frame 30
stop();
Symbol 638 MovieClip Frame 40
stop();
Symbol 640 MovieClip Frame 10
stop();
Symbol 640 MovieClip Frame 20
stop();
Symbol 640 MovieClip Frame 30
stop();
Symbol 640 MovieClip Frame 40
stop();
Symbol 642 MovieClip Frame 10
stop();
Symbol 642 MovieClip Frame 20
stop();
Symbol 642 MovieClip Frame 30
stop();
Symbol 642 MovieClip Frame 40
stop();
Symbol 645 MovieClip Frame 10
stop();
Symbol 645 MovieClip Frame 20
stop();
Symbol 645 MovieClip Frame 30
stop();
Symbol 645 MovieClip Frame 40
stop();
Symbol 647 MovieClip Frame 10
stop();
Symbol 647 MovieClip Frame 20
stop();
Symbol 647 MovieClip Frame 30
stop();
Symbol 647 MovieClip Frame 40
stop();
Symbol 651 MovieClip Frame 10
stop();
Symbol 651 MovieClip Frame 20
stop();
Symbol 651 MovieClip Frame 30
stop();
Symbol 651 MovieClip Frame 40
stop();
Symbol 651 MovieClip Frame 48
stop();
Symbol 654 MovieClip Frame 10
stop();
Symbol 654 MovieClip Frame 20
stop();
Symbol 654 MovieClip Frame 30
stop();
Symbol 654 MovieClip Frame 40
stop();
Symbol 659 MovieClip Frame 10
stop();
Symbol 659 MovieClip Frame 20
stop();
Symbol 659 MovieClip Frame 30
stop();
Symbol 659 MovieClip Frame 40
stop();
Symbol 660 MovieClip Frame 1
function mapCheat() {
if (cheatSet == 0) {
cheatSet = 1;
var _local1 = 0;
while (_local1 < 9) {
nodeList[_local1][0] = 1;
_local1++;
}
setMap();
}
}
function setMap() {
bridgeDenied = 0;
var j = 0;
while (j < 9) {
if (nodeList[j][0] == 0) {
bridgeDenied = 1;
}
j++;
}
if (bridgeDenied == 0) {
Bridge.unlocked = 1;
}
var i = 0;
while (i < nodeList.length) {
whichNode = eval (nodeList[i][1]);
if (nodeList[i][0] == 1) {
whichNode.currentStatus = "Completed";
whichNode.gotoAndPlay("Completed");
} else if (whichNode.unlocked == 1) {
whichNode.currentStatus = "Unlocked";
whichNode.gotoAndPlay("Unlocked");
} else {
whichNode.currentStatus = "Locked";
whichNode.gotoAndPlay("Locked");
}
if (nodeList[i][1] == CurrentLocation) {
currentInfo = nodeList[i];
}
i++;
}
currentNode = eval (currentInfo[1]);
currentNode.currentStatus = "Current";
currentNode.gotoAndPlay("Current");
var i = 2;
while (i < currentInfo.length) {
whichNode = eval (currentInfo[i]);
if (whichNode.currentStatus == "Locked") {
if (currentInfo[i] == "Bridge") {
if (bridgeDenied == 1) {
trace("Setting bridge to denied status");
whichNode.currentStatus = "Denied";
whichNode.gotoAndPlay("Denied");
} else {
trace("setting bridge to unlocked");
whichNode.currentStatus = "Unlocked";
whichNode.gotoAndPlay("Unlocked");
whichNode.unlocked = 1;
}
} else {
whichNode.currentStatus = "Unlocked";
whichNode.gotoAndPlay("Unlocked");
whichNode.unlocked = 1;
}
}
i++;
}
}
function setCleared(locationName) {
var _local1 = 0;
while (_local1 < nodeList.length) {
if (nodeList[_local1][1] == locationName) {
nodeList[_local1][0] = 1;
}
_local1++;
}
}
function setLocation(locationName) {
CurrentLocation = locationName;
setMap();
}
function MoveTo(nodeLocation) {
var i = 0;
while (i < nodeList.length) {
if (eval (nodeList[i][1]) == nodeLocation) {
nodeInfo = nodeList[i];
break;
}
i++;
}
if (nodeInfo[0] == 1) {
CurrentLocation = nodeInfo[1];
setMap();
} else {
_parent.MusicMapPlay();
_parent.SFX_Interface.gotoAndPlay("Accept");
_parent.CutScene.loadCutScene(nodeInfo[1]);
_parent.BGs.loadBG(nodeInfo[1]);
this._visible = 0;
}
}
function isNodeCleared(locationName) {
var _local1 = 0;
while (_local1 < nodeList.length) {
if (nodeList[_local1][1] == locationName) {
if (nodeList[_local1][0] == 1) {
return(1);
}
return(0);
}
_local1++;
}
}
CurrentLocation = "Farmhouse";
LastLocation = CurrentLocation;
cheatSet = 0;
bridgeDenied = 0;
nodeList = [];
nodeList.push([1, "StartLocation", "Farmhouse"]);
nodeList.push([1, "Farmhouse", "Market", "Dojo"]);
nodeList.push([0, "Market", "Farmhouse", "Bank", "TownSquare"]);
nodeList.push([0, "Warehouse", "Bank", "TownSquare", "Bridge"]);
nodeList.push([0, "Bank", "Market", "TownSquare", "Warehouse"]);
nodeList.push([0, "TownSquare", "Market", "Warehouse", "Mill", "Bridge", "Library", "Bank", "Dojo"]);
nodeList.push([0, "Mill", "Library", "TownSquare", "Bridge"]);
nodeList.push([0, "Dojo", "TownSquare", "Library", "Farmhouse"]);
nodeList.push([0, "Library", "Mill", "TownSquare", "Dojo"]);
nodeList.push([0, "Bridge", "Mill", "TownSquare", "Warehouse", "Castle"]);
nodeList.push([0, "Castle", "Dojo"]);
setMap();
NoClick.useHandCursor = false;
stop();
Symbol 682 MovieClip Frame 4
RandomMax = 5;
randomNumber = random(RandomMax) + 1;
RandomLabel = "Text" + randomNumber;
trace("RandomLabel = " + RandomLabel);
gotoAndStop(RandomLabel);
Symbol 682 MovieClip Frame 8
stop();
Symbol 682 MovieClip Frame 13
stop();
Symbol 682 MovieClip Frame 18
stop();
Symbol 682 MovieClip Frame 24
stop();
Symbol 682 MovieClip Frame 30
stop();
Symbol 683 MovieClip Frame 107
_parent.loadScene();
stop();
Symbol 687 MovieClip Frame 117
_parent.loadScene();
stop();
Symbol 691 MovieClip Frame 91
_parent.loadScene();
stop();
Symbol 692 MovieClip Frame 107
_parent.loadScene();
stop();
Symbol 695 MovieClip Frame 117
_parent.loadScene();
stop();
Symbol 699 MovieClip Frame 117
_parent.loadScene();
stop();
Symbol 709 MovieClip Frame 4
RandomMax = 2;
randomNumber = random(RandomMax) + 1;
RandomLabel = "Text" + randomNumber;
trace("RandomLabel = " + RandomLabel);
gotoAndStop(RandomLabel);
Symbol 709 MovieClip Frame 8
stop();
Symbol 709 MovieClip Frame 13
stop();
Symbol 709 MovieClip Frame 18
stop();
Symbol 709 MovieClip Frame 24
stop();
Symbol 709 MovieClip Frame 30
stop();
Symbol 710 MovieClip Frame 76
_parent._parent.CutScene._visible = 0;
_parent._parent.MusicMapPlay();
stop();
Symbol 727 MovieClip Frame 88
_parent._parent.CutScene._visible = 0;
_parent._parent.MusicMapPlay();
stop();
Symbol 729 MovieClip Frame 1
function loadCutScene(cutSceneName) {
lastLocation = currentLocation;
currentLocation = cutSceneName;
this._visible = 1;
trace("-- Playing cutScene for area " + currentLocation);
gotoAndPlay(cutSceneName);
}
function loadScene() {
if (_parent.Map.isNodeCleared(currentLocation) == 1) {
_parent.Map.setLocation(currentLocation);
_parent.Map._visible = true;
this._visible = false;
} else {
this._visible = false;
_parent.BeginCombat(currentLocation);
}
}
currentLocation = "Farmhouse";
lastLocation = "Farmhouse";
NoClick.useHandCursor = false;
stop();
Symbol 729 MovieClip Frame 13
loadScene();
stop();
Symbol 729 MovieClip Frame 14
_parent.MusicMapStop();
Symbol 729 MovieClip Frame 25
stop();
Symbol 729 MovieClip Frame 27
_parent.MusicMapStop();
Symbol 729 MovieClip Frame 38
stop();
Symbol 729 MovieClip Frame 40
_parent.MusicMapStop();
Symbol 729 MovieClip Frame 52
stop();
Symbol 729 MovieClip Frame 54
_parent.MusicMapStop();
Symbol 729 MovieClip Frame 67
stop();
Symbol 729 MovieClip Frame 69
_parent.MusicMapStop();
Symbol 729 MovieClip Frame 80
stop();
Symbol 729 MovieClip Frame 82
_parent.MusicMapStop();
Symbol 729 MovieClip Frame 93
stop();
Symbol 729 MovieClip Frame 95
_parent.MusicMapStop();
Symbol 729 MovieClip Frame 106
stop();
Symbol 729 MovieClip Frame 108
_parent.MusicMapStop();
Symbol 729 MovieClip Frame 117
stop();
Symbol 729 MovieClip Frame 119
_parent.MusicMapStop();
Symbol 729 MovieClip Frame 130
stop();
Symbol 729 MovieClip Frame 132
_parent.MusicFightStop();
Symbol 729 MovieClip Frame 145
stop();
Symbol 729 MovieClip Frame 153
_parent.MusicFightStop();
Symbol 729 MovieClip Frame 203
stop();
Symbol 732 MovieClip Frame 1
function EnemyIdle() {
randomWhich = 1 + random(4);
gotoAndPlay("EnemyMove" + randomWhich);
}
function PlayerSwish() {
if (playerSwishPause == 0) {
playerSwishPause = 10;
randomWhich = 1 + random(2);
gotoAndPlay("PlayerSwish" + randomWhich);
}
}
playerSwishPause = 0;
stop();
this.onEnterFrame = function () {
if (playerSwishPause > 0) {
playerSwishPause--;
}
};
Symbol 732 MovieClip Frame 16
stop();
Symbol 732 MovieClip Frame 27
stop();
Symbol 732 MovieClip Frame 38
stop();
Symbol 732 MovieClip Frame 49
stop();
Symbol 732 MovieClip Frame 60
stop();
Symbol 732 MovieClip Frame 71
stop();
Symbol 735 MovieClip Frame 1
stop();
Symbol 735 MovieClip Frame 16
stop();
Symbol 738 MovieClip Frame 1
stop();
Symbol 738 MovieClip Frame 16
stop();
Symbol 739 Button
on (release) {
MusicMapPlay();
}
Symbol 740 Button
on (release) {
MusicMap.gotoAndPlay("Play");
}
Symbol 748 MovieClip Frame 12
gotoAndPlay ("Loop");
Symbol 772 Button
on (release) {
var fakeVar = new Date().getTime();
("tracker.swf?" + fakeVar);// not popped
gotoAndPlay (51);
}