Frame 2
if (this.getBytesLoaded() != this.getBytesTotal()) {
gotoAndPlay (1);
} else {
_quality = "MEDIUM";
trace("goto title from loader");
gotoAndPlay (3);
}
trace("loader");
Frame 3
trace("title");
Frame 4
trace("title");
Frame 5
trace("title");
Frame 6
trace("title");
Frame 7
trace("title");
Frame 8
trace(_root.highScoreGo);
trace(_root.swHighScoreObject.player1Score);
if (_root.highScoreGo) {
gotoAndPlay (9);
} else {
trace("Resetting Score");
System.security.allowDomain("shockwave.com", "gameblast.shockwave.com", "www.shockwave.com", "dev.shockwave.com", "stage.shockwave.com");
_root.swHighScoreObject = new Object();
_root.swHighScoreObject.showTab = "view";
_root.swHighScoreObject.gameId = "smacky";
_root.swHighScoreObject.gameTitle = "Smacky";
_root.swHighScoreObject.screenWidth = 660;
_root.swHighScoreObject.screenHeight = 500;
_root.swHighScoreObject.scoreDescriptor = "points";
_root.swHighScoreObject.numPlayers = 1;
_root.swHighScoreObject.player1Score = 0;
_root.swHighScoreObject.player2Score = 0;
_root.swHighScoreObject.player3Score = 0;
_root.swHighScoreObject.player4Score = 0;
_root.HSHubURL = "http://www.shockwave.com/content/highscores/scorez-2002.swf";
stop();
}
Frame 9
function playAgain() {
_root.HSHubSubmitter._visible = true;
_root.disabler._visible = false;
}
function goBack() {
gotoAndPlay (3);
}
function goGame() {
gotoAndPlay (844);
}
_root.highScoreGo = false;
trace(_root.swHighScoreObject.player1Score);
stop();
Instance of Symbol 479 MovieClip "HSHubSubmitter" in Frame 9
onClipEvent (load) {
docount = false;
}
onClipEvent (enterFrame) {
if (docount) {
trycount++;
if ((_level2.getBytesTotal() == -1) && (trycount > 60)) {
docount = false;
trycount = 0;
}
}
}
Instance of Symbol 482 MovieClip "disabler" in Frame 9
onClipEvent (load) {
this.swapDepths(120001);
_visible = false;
}
Frame 10
trace("prologue");
Frame 841
gotoAndPlay (842);
Frame 842
trace("control screen");
stop();
Instance of Symbol 665 MovieClip "world" in Frame 842
onClipEvent (load) {
function getDistance(sx, sy, tx, ty) {
var _local1 = Math.abs(sy - ty);
var _local2 = Math.abs(sx - tx);
return(Math.sqrt((_local1 * _local1) + (_local2 * _local2)));
}
function getQuadrant(sx, sy, tx, ty) {
var _local1 = sy - ty;
var _local2 = sx - tx;
var _local3;
if ((_local1 > 0) && (_local2 < 0)) {
_local3 = 1;
}
if ((_local1 < 0) && (_local2 < 0)) {
_local3 = 2;
}
if ((_local1 < 0) && (_local2 > 0)) {
_local3 = 3;
}
if ((_local1 > 0) && (_local2 > 0)) {
_local3 = 4;
}
if ((_local1 > 0) && (_local2 == 0)) {
_local3 = 5;
}
if ((_local1 == 0) && (_local2 < 0)) {
_local3 = 6;
}
if ((_local1 < 0) && (_local2 == 0)) {
_local3 = 7;
}
if ((_local1 == 0) && (_local2 > 0)) {
_local3 = 8;
}
if ((_local1 == 0) && (_local2 == 0)) {
_local3 = 9;
}
return(_local3);
}
function getAngle(sx, sy, tx, ty) {
var _local3;
var _local10;
var _local4 = Math.abs(sy - ty);
var _local5 = Math.abs(sx - tx);
var _local2;
var _local1 = getQuadrant(sx, sy, tx, ty);
if (_local1 > 4) {
if (_local1 == 5) {
_local2 = 0;
}
if (_local1 == 6) {
_local2 = 90;
}
if (_local1 == 7) {
_local2 = 180;
}
if (_local1 == 8) {
_local2 = 270;
}
if (_local1 == 9) {
_local2 = undefined;
}
} else {
_local3 = Math.atan(_local4 / _local5);
_local3 = (_local3 / (Math.PI/2)) * 90;
if (_local1 == 1) {
_local2 = 90 - _local3;
}
if (_local1 == 2) {
_local2 = 90 + _local3;
}
if (_local1 == 3) {
_local2 = 270 - _local3;
}
if (_local1 == 4) {
_local2 = 270 + _local3;
}
}
return(_local2);
}
function getDxDy(speed, angle) {
var _local3 = [0, 0];
var _local2;
var _local8;
var _local7;
var _local4;
var _local5;
switch (angle) {
case 0 :
_local3 = [0, -speed];
break;
case 90 :
_local3 = [speed, 0];
break;
case 180 :
_local3 = [0, speed];
break;
case 270 :
_local3 = [-speed, 0];
break;
default :
if ((angle > 0) && (angle < 90)) {
_local2 = 90 - angle;
_local4 = 1;
_local5 = -1;
}
if ((angle > 90) && (angle < 180)) {
_local2 = angle - 90;
_local4 = 1;
_local5 = 1;
}
if ((angle > 180) && (angle < 270)) {
_local2 = 270 - angle;
_local4 = -1;
_local5 = 1;
}
if ((angle > 270) && (angle < 360)) {
_local2 = angle - 270;
_local4 = -1;
_local5 = -1;
}
_local2 = Math.abs(_local2);
_local2 = (Math.PI/180) * _local2;
_local8 = Math.cos(_local2) * speed;
_local7 = Math.sin(_local2) * speed;
_local3 = [_local8 * _local4, _local7 * _local5];
}
return(_local3);
}
gamePause = false;
M_WIDTH = 800;
M_HEIGHT = 600;
M_SAFEBORDER = 50;
RAGE_MODIFIER = 0.75;
DELETEAT = M_HEIGHT + 200;
GROUND = 400;
GRAVITY = 4;
TVELOCITY = 40;
hpScale = 1;
attackScale = 1;
damageObjects = [player, squa, upafire, eyeBeam, dashLine, smiter, fireExplode];
damageObjPath = [".attBox", "", "", "", "", "", ""];
collisionObjects = [];
}
Instance of Symbol 32 MovieClip "battleManager" in Frame 842
onClipEvent (load) {
function getAI(instance) {
ai = -1;
obj = -1;
index = -1;
i = 0;
while (i < aiName.length) {
if (aiName[i] == instance) {
ai = aiBehavior[i];
obj = aiObject[i];
index = i;
}
i++;
}
switch (ai) {
case 1 :
instance.code.AI_APPROACH = true;
instance.code.AI_FLEE_TOLERANCE = 80;
instance.code.approach = true;
break;
case 2 :
instance.code.AI_APPROACH = true;
instance.code.AI_JUMP = true;
instance.code.approach = true;
break;
case 3 :
instance.code.AI_FLEE = true;
instance.code.AI_APPROACH_WITHIN = 240;
instance.code._FLEE_TOLERANCE = 80;
break;
case 4 :
instance.code.AI_JUMP = true;
instance.code.AI_FLEE = true;
instance.code.AI_APPROACH_WITHIN = 240;
instance.code.flee = true;
instance.code.AI_FLEE_TOLERANCE = 80;
break;
case 5 :
instance.code.AI_APPROACH = true;
instance.code.AI_APPROACH_WITHIN = 80;
instance.code.approach = true;
instance.code.AI_GLOMP = true;
break;
case 6 :
instance.code.AI_FLEE = true;
instance.code.AI_APPROACH_WITHIN = 240;
instance.code.AI_FLEE_TOLERANCE = 80;
instance.code.MV_TOPSPEED = 10;
}
switch (obj) {
case 1 :
instance.code.hasObject = true;
instance.code.objectType = "bluePresent";
instance.object.gotoAndStop(2);
instance.object._visible = true;
break;
case 2 :
instance.code.hasObject = true;
instance.code.objectType = "present";
instance.object.gotoAndStop(1);
instance.object._visible = true;
break;
case 3 :
instance.code.hasObject = true;
instance.code.objectType = "cookies";
instance.object.gotoAndStop(3);
instance.object._visible = true;
break;
case 4 :
instance.code.hasObject = true;
instance.code.objectType = "cake";
instance.object.gotoAndStop(4);
instance.object._visible = true;
break;
case 5 :
instance.code.hasObject = true;
instance.code.objectType = "iceCream";
instance.object.gotoAndStop(5);
instance.object._visible = true;
break;
default :
instance.code.hasObject = false;
instance.object._visible = false;
}
aiName.splice(index, 1);
aiBehavior.splice(index, 1);
aiObject.splice(index, 1);
}
function spawn(libname, insname, xcoor, ai, obj) {
wp.attachMovie(libname, insname, wp.getNextHighestDepth(), temp);
var oT = eval ((wp + ".") + insname);
oT._x = xcoor;
oT._y = wp.GROUND - 1;
register(insname, dmgP);
aiName.push(oT);
aiBehavior.push(ai);
aiObject.push(obj);
}
function collisionCheck() {
i = 0;
while (i < wp.collisionObjects.length) {
wp.collisionObjects[i].collidingWith = null;
i++;
}
i = 0;
while (i < wp.collisionObjects.length) {
j = i + 1;
while (j < wp.collisionObjects.length) {
if (wp.collisionObjects[i].hitBox.hitTest(wp.collisionObjects[j].hitBox)) {
wp.collisionObjects[i].collidingWith = wp.collisionObjects[j];
wp.collisionObjects[j].collidingWith = wp.collisionObjects[i];
}
j++;
}
i++;
}
}
function register(pname, dmgP) {
var doneIt = false;
var doneIt = false;
i = 0;
while (i < wp.collisionObjects.length) {
if (wp.collisionObjects[i] == "") {
wp.collisionObjects[i] = eval ((wp + ".") + pname);
doneIt = true;
}
i++;
}
if (!doneIt) {
wp.collisionObjects.push(eval ((wp + ".") + pname));
}
}
function unRegister(pname) {
i = 0;
while (i < wp.collisionObjects.length) {
if (wp.collisionObjects[i] == eval ((wp + ".") + pname)) {
wp.collisionObjects.splice(i, 1);
}
i++;
}
}
function gimmie() {
if (level > 8) {
minimumOnscreen = 1;
maxEnemies = 5;
}
if (level > 13) {
minimumOnscreen = 2;
maxEnemies = 4;
}
if (finalBattle && (_parent.world.player.sanity > 0)) {
if (!done) {
_parent.altScreen.timeout("over");
win = true;
done = true;
}
} else {
if (kills >= (level * levelMultiplier)) {
level++;
levelString = "Level " + level;
_parent.levelDisp.gotoAndPlay(2);
kills = Math.round(kills * KILL_RESET_PERC);
}
var _local8 = 0;
var _local2 = level * 100;
var _local10 = 0;
var _local9 = 0;
var _local3;
var _local4;
var _local6;
var _local7;
while (_local2 > 0) {
if (Math.round(Math.random() * 100) < 50) {
_local7 = spawnLeft - (_local10 * spawnOffset);
_local10 = _local10 + 1;
} else {
_local7 = spawnRight + (_local9 * spawnOffset);
_local9 = _local9 + 1;
}
_local3 = Math.round(((Math.random() * 0.8) + ((level / DIFFICULTY_SCALE) * 0.2)) * (enemyTypes.length - 1));
if (_local3 > (enemyTypes.length - 1)) {
_local3 = enemyTypes.length - 1;
}
if ((_local3 == 2) && (level < 9)) {
_local3 = 0;
}
if ((_local3 == 3) && (level < 10)) {
_local3 = 0;
}
switch (_local3) {
case 0 :
_local2 = _local2 - 100;
break;
case 1 :
_local2 = _local2 - 100;
break;
case 2 :
_local2 = _local2 - 150;
break;
case 3 :
_local2 = _local2 - 200;
}
_local4 = Math.round(((Math.random() * 0.8) + ((level / DIFFICULTY_SCALE) * 0.2)) * aiTypes);
if (_local4 > aiTypes) {
_local4 = aiTypes;
}
if (_local4 < 1) {
_local4 = 1;
}
if ((level < 5) && (_local4 > 2)) {
_local4 = 1;
}
switch (_local4) {
case 1 :
_local2 = _local2 - 0;
break;
case 2 :
_local2 = _local2 - 10;
break;
case 3 :
_local2 = _local2 - 30;
break;
case 4 :
_local2 = _local2 - 30;
break;
case 5 :
_local2 = _local2 - 50;
break;
case 6 :
_local2 = _local2 - 50;
}
_local6 = 0;
var _local5 = 1 - (level / PRESENT_LEVEL_MOD);
if (_local5 < 0) {
_local5 = 0;
}
if (Math.random() < (_local5 * BASE_PRESENT_CHANCE)) {
_local6 = 1;
} else if (Math.random() < OBJECT_CHANCE) {
_local6 = Math.round(Math.random() * (NUM_OBJECTS - 1)) + 2;
}
_local8++;
if (_local8 <= maxEnemies) {
spawn(enemyTypes[_local3], enemyTypes[_local3] + wp.getNextHighestDepth(), _local7, _local4, _local6);
} else {
_local2 = 0;
}
}
}
}
bossPlaying = true;
BASE_PRESENT_CHANCE = 0.25;
OBJECT_CHANCE = 0.25;
PRESENT_LEVEL_MOD = 20;
DIFFICULTY_SCALE = 20;
KILL_RESET_PERC = 0.8;
NUM_OBJECTS = 4;
win = true;
noScore = false;
done = false;
finalBattle = false;
wp = _parent.world;
wp.player.hat = 22;
aiName = [];
aiBehavior = [];
aiObject = [];
minimumOnscreen = 0;
maxEnemies = 6;
score = 0;
level = 1;
levelString = "Level " + level;
kills = (level - 1) * 10;
killCount = 0;
levelMultiplier = 10;
enemyTypes = ["sqm", "sqf", "sqt", "sql"];
objectTypes = 2;
aiTypes = 6;
spawnLeft = -100;
spawnRight = 900;
spawnOffset = 100;
spawn("flowerSack", "testTarget", 600, 0, 0);
}
onClipEvent (enterFrame) {
trace(wp.player.sanity);
collisionCheck();
if (wp.objectStack < 0) {
wp.objectStack = 0;
}
if (wp.collisionObjects.length <= minimumOnscreen) {
}
if (noScore) {
score = 0;
}
}
Instance of Symbol 32 MovieClip "altScreen" in Frame 842
onClipEvent (load) {
function timeout(blarg) {
_parent.world.player.goDemon();
}
_parent.world.player.rage = 100;
}
Frame 843
trace("goto gameplay from controls");
gotoAndStop (844);
Frame 844
trace("gameplay");
stop();
Instance of Symbol 784 MovieClip "backGround" in Frame 844
onClipEvent (enterFrame) {
if (((_parent.battleManager.level % 10) > 0) && ((_parent.battleManager.level % 10) < 3)) {
if (_parent.world.player.scary) {
this.gotoAndStop(2);
} else {
this.gotoAndStop(1);
}
}
if (((_parent.battleManager.level % 10) >= 3) && ((_parent.battleManager.level % 10) <= 4)) {
if (_parent.world.player.scary) {
this.gotoAndStop(4);
} else {
this.gotoAndStop(3);
}
}
if (((_parent.battleManager.level % 10) >= 5) && ((_parent.battleManager.level % 10) <= 7)) {
if (_parent.world.player.scary) {
this.gotoAndStop(6);
} else {
this.gotoAndStop(5);
}
}
if (((_parent.battleManager.level % 10) >= 8) || ((_parent.battleManager.level % 10) == 0)) {
if (_parent.world.player.scary) {
this.gotoAndStop(8);
} else {
this.gotoAndStop(7);
}
}
}
Instance of Symbol 665 MovieClip "world" in Frame 844
onClipEvent (load) {
function getDistance(sx, sy, tx, ty) {
var _local1 = Math.abs(sy - ty);
var _local2 = Math.abs(sx - tx);
return(Math.sqrt((_local1 * _local1) + (_local2 * _local2)));
}
function getQuadrant(sx, sy, tx, ty) {
var _local1 = sy - ty;
var _local2 = sx - tx;
var _local3;
if ((_local1 > 0) && (_local2 < 0)) {
_local3 = 1;
}
if ((_local1 < 0) && (_local2 < 0)) {
_local3 = 2;
}
if ((_local1 < 0) && (_local2 > 0)) {
_local3 = 3;
}
if ((_local1 > 0) && (_local2 > 0)) {
_local3 = 4;
}
if ((_local1 > 0) && (_local2 == 0)) {
_local3 = 5;
}
if ((_local1 == 0) && (_local2 < 0)) {
_local3 = 6;
}
if ((_local1 < 0) && (_local2 == 0)) {
_local3 = 7;
}
if ((_local1 == 0) && (_local2 > 0)) {
_local3 = 8;
}
if ((_local1 == 0) && (_local2 == 0)) {
_local3 = 9;
}
return(_local3);
}
function getAngle(sx, sy, tx, ty) {
var _local3;
var _local10;
var _local4 = Math.abs(sy - ty);
var _local5 = Math.abs(sx - tx);
var _local2;
var _local1 = getQuadrant(sx, sy, tx, ty);
if (_local1 > 4) {
if (_local1 == 5) {
_local2 = 0;
}
if (_local1 == 6) {
_local2 = 90;
}
if (_local1 == 7) {
_local2 = 180;
}
if (_local1 == 8) {
_local2 = 270;
}
if (_local1 == 9) {
_local2 = undefined;
}
} else {
_local3 = Math.atan(_local4 / _local5);
_local3 = (_local3 / (Math.PI/2)) * 90;
if (_local1 == 1) {
_local2 = 90 - _local3;
}
if (_local1 == 2) {
_local2 = 90 + _local3;
}
if (_local1 == 3) {
_local2 = 270 - _local3;
}
if (_local1 == 4) {
_local2 = 270 + _local3;
}
}
return(_local2);
}
function getDxDy(speed, angle) {
var _local3 = [0, 0];
var _local2;
var _local8;
var _local7;
var _local4;
var _local5;
switch (angle) {
case 0 :
_local3 = [0, -speed];
break;
case 90 :
_local3 = [speed, 0];
break;
case 180 :
_local3 = [0, speed];
break;
case 270 :
_local3 = [-speed, 0];
break;
default :
if ((angle > 0) && (angle < 90)) {
_local2 = 90 - angle;
_local4 = 1;
_local5 = -1;
}
if ((angle > 90) && (angle < 180)) {
_local2 = angle - 90;
_local4 = 1;
_local5 = 1;
}
if ((angle > 180) && (angle < 270)) {
_local2 = 270 - angle;
_local4 = -1;
_local5 = 1;
}
if ((angle > 270) && (angle < 360)) {
_local2 = angle - 270;
_local4 = -1;
_local5 = -1;
}
_local2 = Math.abs(_local2);
_local2 = (Math.PI/180) * _local2;
_local8 = Math.cos(_local2) * speed;
_local7 = Math.sin(_local2) * speed;
_local3 = [_local8 * _local4, _local7 * _local5];
}
return(_local3);
}
gamePause = false;
M_WIDTH = 800;
M_HEIGHT = 600;
M_SAFEBORDER = 50;
RAGE_MODIFIER = 0.75;
DELETEAT = M_HEIGHT + 200;
OBJECT_DELAY = 2;
GROUND = 400;
GRAVITY = 4;
TVELOCITY = 40;
hpScale = 1;
attackScale = 3;
damageObjects = [player, squa, upafire, eyeBeam, dashLine, smiter, fireExplode];
damageObjPath = [".attBox", "", "", "", "", "", ""];
collisionObjects = [];
jukebox.normMusic.start();
}
onClipEvent (enterFrame) {
if (jukebox.imLoaded) {
jukebox.normMusic.start(0, 52800);
jukebox.imLoaded = false;
}
}
Instance of Symbol 32 MovieClip "battleManager" in Frame 844
onClipEvent (load) {
function tipCheck() {
var _local2 = 0;
if (wp.player.rage < 20) {
_local2 = 1;
}
if ((wp.player.rage > 35) && (wp.player.demonMode == false)) {
var _local3 = Math.round(Math.random() * 3) + 1;
if (_local3 == 1) {
_local2 = 2;
}
if (_local3 == 2) {
_local2 = 3;
}
if (_local3 == 3) {
_local2 = 6;
}
}
if ((wp.player.rage > 50) && (wp.player.demonMode == false)) {
var _local3 = Math.round(Math.random() * 2) + 1;
if (_local3 == 1) {
_local2 = 4;
}
if (_local3 == 2) {
_local2 = 5;
}
}
if (level > 4) {
_local2 = 0;
}
if (wp.player.demonMode == true) {
var _local3 = Math.round(Math.random() * 2) + 1;
if (_local3 == 1) {
_local2 = 8;
}
if (_local3 == 2) {
_local2 = 9;
}
}
if (bossPlaying && (wp.player.rage > 50)) {
if (level == 4) {
_local2 = 2;
}
if (level == 7) {
_local2 = 4;
}
if (level == 10) {
_local2 = 5;
}
}
if ((wp.player.rage >= 900) && (wp.player.demonMode == false)) {
_local2 = 7;
}
if ((_parent.tipMarquee._currentframe == 1) && (_local2 > 0)) {
_parent.tipMarquee.tipNum.gotoAndStop(_local2);
_parent.tipMarquee.play();
}
}
function getAI(instance) {
ai = -1;
obj = -1;
index = -1;
i = 0;
while (i < aiName.length) {
if (aiName[i] == instance) {
ai = aiBehavior[i];
obj = aiObject[i];
index = i;
}
i++;
}
switch (ai) {
case 1 :
instance.code.AI_APPROACH = true;
instance.code.AI_FLEE_TOLERANCE = 80;
instance.code.approach = true;
break;
case 2 :
instance.code.AI_APPROACH = true;
instance.code.AI_JUMP = true;
instance.code.approach = true;
break;
case 3 :
instance.code.AI_FLEE = true;
instance.code.AI_APPROACH_WITHIN = 160;
instance.code.ATTACK_RANGE = 300;
instance.code._FLEE_TOLERANCE = 80;
break;
case 4 :
instance.code.AI_JUMP = true;
instance.code.AI_FLEE = true;
instance.code.AI_APPROACH_WITHIN = 160;
instance.code.ATTACK_RANGE = 300;
instance.code.flee = true;
instance.code.AI_FLEE_TOLERANCE = 80;
break;
case 5 :
instance.code.AI_APPROACH = true;
instance.code.AI_APPROACH_WITHIN = 80;
instance.code.approach = true;
instance.code.AI_GLOMP = true;
break;
case 6 :
instance.code.AI_FLEE = true;
instance.code.AI_APPROACH_WITHIN = 160;
instance.code.ATTACK_RANGE = 300;
instance.code.AI_FLEE_TOLERANCE = 80;
instance.code.MV_TOPSPEED = 10;
}
switch (obj) {
case 1 :
var _local2 = Math.random();
if (_local2 < 0.65) {
instance.code.hasObject = true;
instance.code.objectType = "bluePresent";
instance.object.gotoAndStop(2);
instance.object._visible = true;
} else if (_local2 >= 0.65) {
instance.code.hasObject = true;
instance.code.objectType = "bluePresentTall";
instance.object.gotoAndStop(9);
instance.object._visible = true;
if (_local2 >= 0.9) {
instance.code.hasObject = true;
instance.code.objectType = "bluePresentBig";
instance.object.gotoAndStop(10);
instance.object._visible = true;
}
}
break;
case 2 :
instance.code.hasObject = true;
instance.code.objectType = "iceCream";
instance.object.gotoAndStop(5);
instance.object._visible = true;
break;
case 3 :
instance.code.hasObject = true;
instance.code.objectType = "cookies";
instance.object.gotoAndStop(3);
instance.object._visible = true;
break;
case 4 :
instance.code.hasObject = true;
instance.code.objectType = "present";
instance.object.gotoAndStop(1);
instance.object._visible = true;
break;
case 5 :
instance.code.hasObject = true;
instance.code.objectType = "cake";
instance.object.gotoAndStop(4);
instance.object._visible = true;
break;
case 6 :
instance.code.hasObject = true;
instance.code.objectType = "pillow";
instance.object.gotoAndStop(6);
instance.object._visible = true;
break;
case 8 :
instance.code.hasObject = true;
instance.code.objectType = "jackBox";
instance.object.gotoAndStop(8);
instance.object._visible = true;
break;
default :
instance.code.hasObject = false;
instance.object._visible = false;
}
aiName.splice(index, 1);
aiBehavior.splice(index, 1);
aiObject.splice(index, 1);
}
function spawn(libname, insname, xcoor, ai, obj) {
wp.attachMovie(libname, insname, wp.getNextHighestDepth(), temp);
var oT = eval ((wp + ".") + insname);
oT._x = xcoor;
oT._y = wp.GROUND - 1;
register(insname, dmgP);
aiName.push(oT);
aiBehavior.push(ai);
aiObject.push(obj);
}
function collisionCheck() {
i = 0;
while (i < wp.collisionObjects.length) {
wp.collisionObjects[i].collidingWith = null;
i++;
}
i = 0;
while (i < wp.collisionObjects.length) {
j = i + 1;
while (j < wp.collisionObjects.length) {
if (wp.collisionObjects[i].hitBox.hitTest(wp.collisionObjects[j].hitBox)) {
wp.collisionObjects[i].collidingWith = wp.collisionObjects[j];
wp.collisionObjects[j].collidingWith = wp.collisionObjects[i];
}
j++;
}
i++;
}
}
function register(pname, dmgP) {
var doneIt = false;
var doneIt = false;
i = 0;
while (i < wp.collisionObjects.length) {
if (wp.collisionObjects[i] == "") {
wp.collisionObjects[i] = eval ((wp + ".") + pname);
doneIt = true;
}
i++;
}
if (!doneIt) {
wp.collisionObjects.push(eval ((wp + ".") + pname));
}
}
function unRegister(pname) {
i = 0;
while (i < wp.collisionObjects.length) {
if (wp.collisionObjects[i] == eval ((wp + ".") + pname)) {
wp.collisionObjects.splice(i, 1);
}
i++;
}
}
function gimmie() {
waveCount++;
if (!bossPlaying) {
if (level > 6) {
minimumOnscreen = 1;
maxEnemies = 5;
}
if (level > 8) {
minimumOnscreen = 2;
maxEnemies = 4;
}
}
if (finalBattle && (_parent.world.player.sanity > 0)) {
if (!done) {
_parent.altScreen.timeout("over");
win = true;
done = true;
}
} else {
if (waveCount == Math.round((((level - 1) / 2) + 3) * 3)) {
if (bossPlaying) {
if (!_parent.world.player.scary) {
_parent.world.jukebox.demonMusic.stop();
_parent.world.jukebox.normMusic.start(0, 52800);
}
bossPlaying = false;
_parent.bossHud._visible = false;
}
waveCount = 0;
if (((level % 10) == 2) || ((level % 10) == 4)) {
_parent.altScreen.timeout("levelInOut");
levelString = "Level " + level;
_parent.levelDisp.gotoAndPlay(2);
} else if ((level % 10) == 7) {
_parent.altScreen.timeout("levelInOut");
levelString = "Level " + level;
_parent.levelDisp.gotoAndPlay(2);
} else if ((level % 10) == 0) {
_parent.altScreen.timeout("endStart");
} else {
level++;
levelString = "Level " + level;
_parent.levelDisp.gotoAndPlay(2);
}
}
var _local8 = 0;
var _local2 = (level + (level / 3)) * 100;
var _local10 = 0;
var _local9 = 0;
var _local3;
var _local4;
var _local5;
var _local6;
while (_local2 > 0) {
if (Math.round(Math.random() * 100) < 50) {
_local6 = spawnLeft - (_local10 * spawnOffset);
_local10 = _local10 + 1;
} else {
_local6 = spawnRight + (_local9 * spawnOffset);
_local9 = _local9 + 1;
}
_local3 = Math.round(((Math.random() * 0.8) + ((level / DIFFICULTY_SCALE) * 0.2)) * 3);
if (_local3 > (enemyTypes.length - 1)) {
_local3 = enemyTypes.length - 1;
}
if ((_local3 == 2) && (level < 5)) {
_local3 = 0;
}
if ((_local3 == 3) && (level < 7)) {
_local3 = 0;
}
switch (_local3) {
case 0 :
_local2 = _local2 - 135;
break;
case 1 :
_local2 = _local2 - 135;
break;
case 2 :
_local2 = _local2 - 155;
break;
case 3 :
_local2 = _local2 - 165;
}
_local4 = Math.round(((Math.random() * 0.8) + ((level / DIFFICULTY_SCALE) * 0.2)) * aiTypes);
if (_local4 > aiTypes) {
_local4 = aiTypes;
}
if (_local4 < 1) {
_local4 = 1;
}
if ((level < 5) && (_local4 > 2)) {
_local4 = 1;
}
switch (_local4) {
case 1 :
_local2 = _local2 - 0;
break;
case 2 :
_local2 = _local2 - 10;
break;
case 3 :
_local2 = _local2 - 30;
break;
case 4 :
_local2 = _local2 - 30;
break;
case 5 :
_local2 = _local2 - 50;
break;
case 6 :
_local2 = _local2 - 50;
}
_local5 = 0;
var _local7 = 1 - (level / PRESENT_LEVEL_MOD);
if (_local7 < 0) {
_local7 = 0;
}
if (Math.random() < (_local7 * BASE_PRESENT_CHANCE)) {
_local5 = 1;
}
if ((Math.random() < OBJECT_CHANCE) && (_local5 == 0)) {
_local5 = Math.round(Math.random() * (NUM_OBJECTS - 1)) + 2;
if (_local5 > level) {
_local5 = level;
}
}
if (((level % 10) == 4) && (waveCount == (Math.round((((level - 1) / 2) + 3) * 3) - 1))) {
_local3 = 4;
_local6 = 600;
_local4 = 99;
_local5 = 99;
levelString = "Boss Battle";
_parent.levelDisp.gotoAndPlay(2);
_parent.world.jukebox.normMusic.stop();
_parent.world.jukebox.demonMusic.start(0, 52800);
bossPlaying = true;
_parent.bossHud._visible = true;
_parent.bossHud.bossPortrait.gotoAndStop(1);
bossName = "Squirrel Scout";
minimumOnscreen = 0;
_local2 = 0;
_parent.altScreen.timeout("scoutCut");
}
if (((level % 10) == 7) && (waveCount == (Math.round((((level - 1) / 2) + 3) * 3) - 1))) {
_local3 = 5;
_local6 = 1100;
_local4 = 1;
_local5 = 99;
levelString = "Boss Battle";
_parent.levelDisp.gotoAndPlay(2);
_parent.world.jukebox.normMusic.stop();
_parent.world.jukebox.demonMusic.start(0, 52800);
bossPlaying = true;
_parent.bossHud._visible = true;
_parent.bossHud.bossPortrait.gotoAndStop(2);
bossName = "Mime Clown";
minimumOnscreen = 0;
_local2 = 0;
}
if (((level % 10) == 0) && (waveCount == (Math.round((((level - 1) / 2) + 3) * 3) - 1))) {
_local3 = 6;
_local6 = 800;
_local4 = 1;
_local5 = 99;
levelString = "Boss Battle";
_parent.levelDisp.gotoAndPlay(2);
_parent.world.jukebox.normMusic.stop();
_parent.world.jukebox.demonMusic.start(0, 52800);
bossPlaying = true;
_parent.bossHud._visible = true;
_parent.bossHud.bossPortrait.gotoAndStop(3);
bossName = "Squirrel Claus";
minimumOnscreen = 0;
_local2 = 0;
_parent.altScreen.timeout("santaCut");
}
_local8++;
if (_local8 <= maxEnemies) {
spawn(enemyTypes[_local3], enemyTypes[_local3] + wp.getNextHighestDepth(), _local6, _local4, _local5);
} else {
_local2 = 0;
}
}
}
}
BASE_PRESENT_CHANCE = 0.25;
OBJECT_CHANCE = 0.5;
PRESENT_LEVEL_MOD = 20;
DIFFICULTY_SCALE = 20;
NUM_OBJECTS = 7;
waveCount = 0;
bossPlaying = false;
win = true;
noScore = false;
done = false;
finalBattle = false;
wp = _parent.world;
aiName = [];
aiBehavior = [];
aiObject = [];
minimumOnscreen = 0;
maxEnemies = 6;
score = 0;
killCount = 0;
level = 1;
levelString = "Level " + level;
levelMultiplier = 30;
enemyTypes = ["sqm", "sqf", "sqt", "sql", "sqScout", "sqMime", "sqClaus"];
aiTypes = 6;
spawnLeft = -100;
spawnRight = 900;
spawnOffset = 100;
gimmie();
}
onClipEvent (enterFrame) {
collisionCheck();
if (wp.objectStack < 0) {
wp.objectStack = 0;
}
if (wp.collisionObjects.length <= minimumOnscreen) {
gimmie();
tipCheck();
}
if (bossPlaying) {
tipCheck();
}
if (noScore) {
score = 0;
}
}
Instance of Symbol 798 MovieClip in Frame 844
onClipEvent (enterFrame) {
if (((_parent.battleManager.level % 10) > 0) && ((_parent.battleManager.level % 10) < 3)) {
if (_parent.world.player.scary) {
this.gotoAndStop(2);
} else {
this.gotoAndStop(1);
}
}
if (((_parent.battleManager.level % 10) >= 3) && ((_parent.battleManager.level % 10) <= 4)) {
if (_parent.world.player.scary) {
this.gotoAndStop(4);
} else {
this.gotoAndStop(3);
}
}
if (((_parent.battleManager.level % 10) >= 5) && ((_parent.battleManager.level % 10) <= 7)) {
if (_parent.world.player.scary) {
this.gotoAndStop(6);
} else {
this.gotoAndStop(5);
}
}
if (((_parent.battleManager.level % 10) >= 8) || ((_parent.battleManager.level % 10) == 0)) {
if (_parent.world.player.scary) {
this.gotoAndStop(8);
} else {
this.gotoAndStop(7);
}
}
}
Instance of Symbol 809 MovieClip "bossHud" in Frame 844
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 990 MovieClip "altScreen" in Frame 844
onClipEvent (load) {
function timeout(type) {
this._visible = true;
this.gotoAndPlay(type);
_parent.world.gamePause = true;
if ((type == "pause") || (type == "over")) {
vslider.knob._x = _parent.world.jukebox.snd.getVolume() * 2;
_parent.world.jukebox.snd.setVolume(0);
}
if (type == "endStart") {
vslider.knob._x = _parent.world.jukebox.snd.getVolume() * 2;
_parent.world.jukebox.snd.setVolume(0);
}
if (_quality == "LOW") {
qslider.knob._x = 0;
}
if (_quality == "MEDIUM") {
qslider.knob._x = 100;
}
if (_quality == "HIGH") {
qslider.knob._x = 200;
}
}
function timein() {
_parent.world.gamePause = false;
_parent.world.jukebox.snd.setVolume(sndVol);
trace("vslider.knob._x=" + (vslider.knob._x / 2));
_visible = false;
if ((qslider.knob._x > 0) && (knob._x <= 66)) {
_quality = "LOW";
}
if ((qslider.knob._x > 66) && (knob._x <= 132)) {
_quality = "MEDIUM";
}
if ((qslider.knob._x > 132) && (knob._x <= 200)) {
_quality = "HIGH";
}
}
function checkCheat(cheat) {
msg = "Invalid Cheat";
cheat = cheat.toLowerCase();
idx = -1;
if (idx == -1) {
i = 0;
while (i < levelCode.length) {
if (levelCode[i] == cheat) {
idx = i;
msg = levelMsg[i];
}
i++;
}
switch (idx) {
case 0 :
_parent.battleManager.level = 4;
_parent.battleManager.score = 0;
break;
case 1 :
_parent.battleManager.level = 7;
_parent.battleManager.score = 0;
break;
case 2 :
_parent.battleManager.level = 10;
_parent.battleManager.score = 0;
break;
case 3 :
_parent.battleManager.level = 12;
_parent.battleManager.score = 0;
break;
case 4 :
_parent.battleManager.level = 15;
_parent.battleManager.score = 0;
break;
default :
msg = "Invalid Cheat";
}
}
if (idx == -1) {
i = 0;
while (i < hatCode.length) {
if (hatCode[i] == cheat) {
idx = i;
msg = hatMsg[i];
}
i++;
}
_parent.world.player.hat = idx + 1;
}
return(msg);
}
this._visible = false;
frameCount = 0;
loadVariables ("http://www.shockwave.com/content/smacky/sis/secure/vload02.txt", this);
this.stop();
}
onClipEvent (enterFrame) {
if (Key.isDown(32) && (this._visible == false)) {
timeout("pause");
}
if (frameCount == 90) {
if (levelCode[0] == undefined) {
levelCode = levelCode.split(",");
if (levelCode[0] == undefined) {
_root.play();
}
}
if (levelMsg[0] == undefined) {
levelMsg = levelMsg.split(",");
if (levelMsg[0] == undefined) {
_root.play();
}
}
if (hatCode[0] == undefined) {
hatCode = hatCode.split(",");
if (hatCode[0] == undefined) {
_root.play();
}
}
if (hatMsg[0] == undefined) {
hatMsg = hatMsg.split(",");
if (hatMsg[0] == undefined) {
_root.play();
}
}
}
if (frameCount <= 91) {
frameCount++;
}
}
Frame 846
gotoAndPlay (851);
stop();
Frame 848
gotoAndPlay (9);
Frame 850
gotoAndPlay (9);
Frame 851
trace("shutdown");
stop();
Symbol 32 MovieClip Frame 1
this._visible = false;
Symbol 39 MovieClip Frame 42
stop();
Symbol 40 MovieClip [cookBox] Frame 1
stop();
Instance of Symbol 32 MovieClip "code" in Symbol 40 MovieClip [cookBox] Frame 1
onClipEvent (load) {
function destroy() {
bm.battleManager.unRegister(op);
op.removeMovieClip();
}
function getHit(x, y, type, dmg) {
if (type != "throw") {
if (pp.player._x > this._x) {
dx = -x;
}
if (pp.player._x <= this._x) {
dx = x;
}
dy = y * -1;
grounded = false;
splashPoint._x = op._x;
splashPoint._y = op._y - 20;
pp.attachMovie("FX_Splash", "splash" + pp.getNextHighestDepth(), pp.getNextHighestDepth(), splashPoint);
}
if (type == "throw") {
gettingThrown = true;
}
if (type == "mid") {
pp.jukebox.punch1.start();
}
if (type == "low") {
pp.jukebox.punch2.start();
}
if (type == "upper") {
pp.jukebox.punch3.start();
}
if (type == "spinUpper") {
pp.jukebox.punch3.start();
}
if (type == "flyBack") {
pp.jukebox.punch3.start();
}
if (type == "smackDown") {
type = "upper";
}
hp = hp - dmg;
bm.battleManager.score = bm.battleManager.score + Math.round(dmg / 10);
if (hp <= 0) {
hp = 0;
bm.battleManager.score = bm.battleManager.score + POINTS;
dead = true;
if (!pp.player.demonMode) {
pp.attachMovie("rageRecover", "ragRecover", 60);
pp.player.rage = pp.player.rage + Math.round(POINTS * pp.RAGE_MODIFIER);
pp.ragRecover._x = op._x;
pp.ragRecover._y = op._y;
}
dy = -40;
dx = 15 * (pp.player._xscale / 100);
}
}
op.stop();
bm = _parent._parent._parent;
pp = _parent._parent;
op = _parent;
splashPoint = new Object();
hp = 30 * pp.hpScale;
dead = false;
rotateSpeed = 30;
hitResult = 0;
grounded = false;
POINTS = 75;
MV_GROUND = pp.GROUND;
MV_GRAVITY = pp.GRAVITY;
MV_TVELOCITY = pp.TVELOCITY;
MV_DELETEAT = pp.DELETEAT;
MV_FRICTION = 2;
MV_ROTOFF = 180;
MV_BOUNCE = 20;
MV_TOPSPEED = 6;
MV_COLLISION_TOL = 40;
op.collidingWith;
op.attacking = false;
op.kbx = 5;
op.kby = 22;
op.damage = 0;
op.attType = "upper";
dx = 0;
dy = 40;
WINCE_DELAY = 4;
winceTimer = 100;
EXPIRATION = 30 * pp.OBJECT_DELAY;
expireTimer = 0;
gettingThrown = false;
}
onClipEvent (enterFrame) {
if (pp.gamePause == false) {
animstate = "stand";
if ((!grounded) && (!dead)) {
op._rotation = op._rotation + rotateSpeed;
}
if (wincing) {
animstate = "wince";
}
if (hp <= 0) {
animstate = "dead";
}
op.gotoAndStop(animstate);
hitResult = -1;
i = 0;
while (i < pp.damageObjects.length) {
hitTarget = eval (((pp + ".") + pp.damageObjects[i]) + pp.damageObjPath[i]);
if (op.hitTest(hitTarget) && (hitTarget.attacking == true)) {
if (!wincing) {
hitResult = i;
}
}
i++;
}
if (hitResult > -1) {
var t = eval ((pp + ".") + pp.damageObjects[hitResult]);
getHit(t.kbx, t.kby, t.attType, t.damage);
winceTimer = 0;
wincing = true;
} else if (grounded && (winceTimer >= WINCE_DELAY)) {
wincing = false;
}
if (gettingThrown) {
dx = 0;
dy = 0;
op._x = pp.player._x + pp.player.throwGuide._x;
op._y = pp.player._y + pp.player.throwGuide._y;
op._rotation = pp.player.throwGuide._rotation * (100 / pp.player._xscale);
if (pp.player._currentframe == pp.player.FT_THROWRELEASE) {
op._rotation = 180;
getHit(-10, -30, "smackDown", 0);
grounded = false;
gettingThrown = false;
}
}
if (Math.abs(pp.player._x - op._x) > Math.abs(pp.player._x - (op._x + dx))) {
dxRelativePlayer = -1;
}
if (Math.abs(pp.player._x - op._x) < Math.abs(pp.player._x - (op._x + dx))) {
dxRelativePlayer = 1;
}
if (Math.abs(pp.player._x - op._x) == Math.abs(pp.player._x - (op._x + dx))) {
dxRelativePlayer = 0;
}
if (op.collidingWith != null) {
if (Math.abs(op._x - pp.player._x) < Math.abs(op.collidingWith._x - pp.player._x)) {
if (dxRelativePlayer == -1) {
if (op.collidingWith._x > op._x) {
dx = -MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
dx = MV_TOPSPEED;
}
}
if (dxRelativePlayer == 0) {
if (op.collidingWith._x > op._x) {
op._x = op._x - MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
op._x = op._x + MV_TOPSPEED;
}
}
}
if (Math.abs(op._x - pp.player._x) > Math.abs(op.collidingWith._x - pp.player._x)) {
if (dxRelativePlayer == 1) {
if (op._x < op.collidingWith._x) {
dx = -MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
dx = MV_TOPSPEED;
}
}
if (dxRelativePlayer == 0) {
if (op._x < op.collidingWith._x) {
op._x = op._x - MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
op._x = op._x + MV_TOPSPEED;
}
}
}
}
if (dead) {
grounded = false;
}
winceTimer++;
if (Math.abs(dx - 1) < 1) {
dx = 0;
}
op._x = op._x + dx;
op._y = op._y + dy;
if (!grounded) {
dy = dy + MV_GRAVITY;
if (dy > MV_TVELOCITY) {
dy = MV_TVELOCITY;
}
}
if ((op._y >= MV_GROUND) && (!dead)) {
op._y = MV_GROUND;
grounded = true;
if (dy == MV_TVELOCITY) {
dy = -MV_BOUNCE;
grounded = false;
winceTimer = 0;
} else {
dy = 0;
}
op._rotation = 0;
}
expireTimer++;
if (expireTimer == EXPIRATION) {
dead = true;
grounded = false;
}
if (op._y > MV_DELETEAT) {
destroy();
}
if (grounded) {
if (dx > 0) {
dx = dx - MV_FRICTION;
}
if (dx < 0) {
dx = dx + MV_FRICTION;
}
}
if (op._x < 0) {
op._x = op._x + MV_TOPSPEED;
}
if (op._x > pp.M_WIDTH) {
op._x = op._x - MV_TOPSPEED;
}
}
}
Symbol 40 MovieClip [cookBox] Frame 2
stop();
Instance of Symbol 42 MovieClip [FX_squaBall] in Symbol 43 MovieClip [FX_fireTrail] Frame 1
onClipEvent (enterFrame) {
_parent._y--;
}
Symbol 43 MovieClip [FX_fireTrail] Frame 17
this.removeMovieClip();
Symbol 52 MovieClip Frame 1
stop();
Symbol 52 MovieClip Frame 2
stop();
Symbol 54 MovieClip Frame 1
stop();
Symbol 54 MovieClip Frame 2
stop();
Instance of Symbol 52 MovieClip "pillowHold" in Symbol 58 MovieClip Frame 6
onClipEvent (enterFrame) {
if (_parent._parent.code.itemWince) {
this.gotoAndStop(2);
} else {
gotoAndStop (1);
}
}
Instance of Symbol 54 MovieClip in Symbol 58 MovieClip Frame 7
onClipEvent (enterFrame) {
if (_parent._parent.code.itemWince) {
this.gotoAndStop(2);
} else {
gotoAndStop (1);
}
}
Instance of Symbol 32 MovieClip "code" in Symbol 121 MovieClip [sqScout] Frame 1
onClipEvent (load) {
function getHit(x, y, type, dmg) {
if (attacking == false) {
if (type == "throw") {
gettingThrown = true;
}
if (type == "mid") {
if ((objectType == "pillow") or (objectType == "cookBox")) {
if (!itemWince) {
itemWince = true;
pp.jukebox.pillowHit.start();
pp.player.rageDown(3 * pp.RAGE_MODIFIER);
}
dmg = 0;
} else {
pp.jukebox.punch1.start();
}
}
if (type == "low") {
if ((objectType == "pillow") or (objectType == "cookBox")) {
if (!itemWince) {
itemWince = true;
pp.jukebox.pillowHit.start();
pp.player.rageDown(3 * pp.RAGE_MODIFIER);
}
dmg = 0;
} else {
pp.jukebox.punch2.start();
}
}
if (type == "upper") {
if ((objectType == "pillow") or (objectType == "cookBox")) {
if (!itemWince) {
itemWince = true;
pp.jukebox.pillowHit.start();
pp.player.rageDown(3 * pp.RAGE_MODIFIER);
}
dmg = 0;
} else {
pp.jukebox.punch3.start();
}
}
if (type == "spinUpper") {
pp.jukebox.punch3.start();
}
if (type == "flyBack") {
pp.jukebox.punch3.start();
}
if (type == "kickBack") {
if ((objectType == "pillow") or (objectType == "cookBox")) {
if (!itemWince) {
itemWince = true;
pp.jukebox.pillowHit.start();
pp.player.rageDown(3 * pp.RAGE_MODIFIER);
}
dmg = 0;
} else {
pp.jukebox.punch3.start();
}
}
if (type == "smackDown") {
type = "upper";
}
if (type == "energy") {
type = "upper";
}
if (type == "laser") {
type = "mid";
}
if ((dmg > 0) && (attacking == false)) {
if (type != "throw") {
if (pp.player._x > op._x) {
dx = -x;
}
if (pp.player._x <= op._x) {
dx = x;
}
facePlayer();
dy = y * -1;
grounded = false;
attackTimer = 0;
attacking = false;
splashPoint._x = op._x;
splashPoint._y = op._y - 20;
pp.attachMovie("FX_Splash", "splash" + pp.getNextHighestDepth(), pp.getNextHighestDepth(), splashPoint);
}
lastHitType = type;
hp = hp - dmg;
bm.bossHud.sbar._xscale = (hp / (500 * pp.hpScale)) * 100;
if (hp < 0) {
bm.bossHud.sbar._xscale = 0;
}
winceTimer = 0;
wincing = true;
approach = false;
flee = false;
bm.battleManager.score = bm.battleManager.score + Math.round(dmg / 10);
if (hp <= 0) {
hp = 0;
bm.battleManager.score = bm.battleManager.score + POINTS;
bm.battleManager.kills++;
bm.battleManager.killCount++;
dead = true;
}
}
}
}
function destroy() {
pp.jukebox.aaah.start();
bm.battleManager.unRegister(op);
op.removeMovieClip();
}
function facePlayer() {
if (pp.player._x < op._x) {
op._xscale = -100;
}
if (pp.player._x > op._x) {
op._xscale = 100;
}
}
function autoOrient() {
if (pp.getAngle(op._x, op._y, last_x, last_y) != undefined) {
op._rotation = pp.getAngle(op._x, op._y, last_x, last_y);
}
}
function dropItem() {
var _local1 = pp.getNextHighestDepth();
var _local2 = new Object();
_local2._x = op._x + (100 * (op._xscale / 100));
_local2._y = op._y - 100;
pp.attachMovie(objectType, objectType + _local1, _local1, _local2);
bm.battleManager.register(objectType + _local1);
hasObject = false;
op.object._visible = false;
objectType = "";
boxTimer = 0;
}
function jumpNow() {
if ((!dead) && (grounded)) {
if ((!wincing) && (dx != 0)) {
grounded = false;
jumping = true;
dy = -MV_JUMPPOWER;
}
}
}
function attackNow() {
if (!dead) {
if (!wincing) {
if ((op._x > 0) && (op._x < pp.M_WIDTH)) {
if (Math.random() < ATTACK_CHANCE) {
if (Math.abs(pp.player._x - op._x) < ATTACK_RANGE) {
attacking = true;
pp.player.sanityChange(-attackPwr);
if (Math.random() < 0.5) {
pp.jukebox.yoohoo.start();
} else {
pp.jukebox.heyCutie.start();
}
}
}
}
}
}
}
op = _parent;
pp = _parent._parent;
bm = _parent._parent._parent;
splashPoint = new Object();
op.stop();
active = true;
hp = 500 * pp.hpScale;
dead = false;
op.collidingWith = "blarg";
hitResult = -1;
grounded = false;
dxRelativePlayer = -1;
POINTS = 1000;
MV_GROUND = pp.GROUND;
MV_GRAVITY = pp.GRAVITY;
MV_TVELOCITY = pp.TVELOCITY;
MV_DELETEAT = pp.DELETEAT;
MV_FRICTION = 2;
MV_ROTOFF = 180;
MV_BOUNCE = 20;
MV_TOPSPEED = 6;
MV_COLLISION_TOL = 40;
MV_JUMPPOWER = 30;
AI_APPROACH_WITHIN = 100;
AI_APPROACH = true;
AI_JUMP = false;
AI_FLEE = false;
AI_HIT_STUN = 45;
AI_JUMP_WAIT = 20;
AI_FLEE_TOLERANCE = 80;
AI_GLOMP = false;
glompXoff = 30;
AI_GLOMP_YOFF = Math.round(Math.random() * 30);
AI_GLOMP_WAIT = 20;
attackPwr = 8 * pp.attackScale;
ATTACK_DELAY = 40;
ATTACK_TIME = 20;
ATTACK_CHANCE = 1;
ATTACK_RANGE = 100;
attackTimer = Math.round(Math.random() * ATTACK_DELAY) - 50;
attacking = false;
annoy = true;
BOX_DELAY = 150;
boxTimer = 0;
dx = 0;
dy = 0;
wincing = false;
lastHitType = "mid";
animstate = "";
last_x = op._x;
last_y = op._y;
WINCE_DELAY = 4;
HIT_HOLD = 4;
winceTimer = 100;
itemWince = false;
jumpTimer = 0;
jumping = false;
gettingThrown = false;
objectType = "";
hasObject = false;
objectLossModifier = 0;
op.glomping = false;
glompTimer = 0;
bm.battleManager.getAI(op);
}
onClipEvent (enterFrame) {
if (pp.gamePause == false) {
if (boxTimer < BOX_DELAY) {
boxTimer++;
}
if (boxTimer == BOX_DELAY) {
objectType = "cookBox";
hasObject = true;
op.object._visible = true;
op.object.gotoAndStop(objectType);
}
if (active) {
if (grounded && (dx == 0)) {
animstate = "stand";
if (pp.player.scary) {
animstate = "scareStand";
}
}
if (grounded && (dx != 0)) {
animstate = "run";
if (pp.player.scary) {
animstate = "scareRun";
}
}
if (winceTimer < AI_HIT_STUN) {
animstate = "stun";
}
if ((!grounded) && (dy < 0)) {
animstate = "jumpUp";
if (pp.player.scary) {
animstate = "scareJumpUp";
}
}
if ((!grounded) && (dy >= 0)) {
animstate = "jumpDown";
if (pp.player.scary) {
animstate = "scareJumpDown";
}
}
if (attacking) {
animstate = "annoy";
}
if (op.glomping) {
animstate = "glomp";
}
if (wincing) {
animstate = lastHitType;
}
if (winceTimer <= HIT_HOLD) {
animstate = lastHitType;
}
if (gettingThrown) {
animstate = "throw";
}
if (dead) {
animstate = "upper";
}
op.gotoAndStop(animstate);
if ((animstate == "upper") || (animstate == "spinUpper")) {
autoOrient();
}
if (((animstate == "upper") || (animstate == "spinUpper")) || (animstate == "flyBack")) {
if (dy > 0) {
op.hitBox.attacking = true;
}
if (hasObject) {
dropItem();
}
} else {
op.hitBox.attacking = false;
}
hitResult = -1;
i = 0;
while (i < pp.damageObjects.length) {
hitTarget = eval (pp.damageObjects[i] + pp.damageObjPath[i]);
if (op.hitBox.hitTest(hitTarget) && (hitTarget.attacking == true)) {
if ((hitTarget != pp.player) && (hitTarget != op)) {
if (!wincing) {
if (!op.glomping) {
hitResult = i;
}
if ((op.glomping && (pp.player.specialMove == "Cute Buster")) && (pp.player.specialMoving)) {
hitResult = i;
op.glomping = false;
}
if ((op.glomping && (pp.player.specialMove == "Upawcut")) && (pp.player.specialMoving)) {
hitResult = i;
op.glomping = false;
}
}
}
}
i++;
}
if (hitResult > -1) {
var t = eval ((pp + ".") + pp.damageObjects[hitResult]);
getHit(t.kbx, t.kby, t.attType, t.damage);
} else if (grounded && (winceTimer >= WINCE_DELAY)) {
wincing = false;
itemWince = false;
}
if (winceTimer > AI_HIT_STUN) {
if (AI_APPROACH) {
approach = true;
}
if (AI_FLEE) {
flee = true;
}
}
if (approach && (!wincing)) {
if (grounded) {
if (Math.abs(pp.player._x - op._x) > AI_APPROACH_WITHIN) {
if (pp.player._x < op._x) {
playerSide = -1;
}
if (pp.player._x > op._x) {
playerSide = 1;
}
dx = MV_TOPSPEED * playerSide;
op._xscale = playerSide * 100;
}
}
}
if (flee && (!wincing)) {
if (grounded) {
if (Math.abs(pp.player._x - op._x) < AI_APPROACH_WITHIN) {
if (pp.player._x < op._x) {
playerSide = -1;
}
if (pp.player._x > op._x) {
playerSide = 1;
}
dx = (MV_TOPSPEED * playerSide) * -1;
op._xscale = (playerSide * 100) * -1;
if ((AI_APPROACH_WITHIN - Math.abs(pp.player._x - op._x)) < AI_FLEE_TOLERANCE) {
dx = 0;
}
}
if (Math.abs(pp.player._x - op._x) > AI_APPROACH_WITHIN) {
if (pp.player._x < op._x) {
playerSide = -1;
}
if (pp.player._x > op._x) {
playerSide = 1;
}
dx = MV_TOPSPEED * playerSide;
op._xscale = playerSide * 100;
if ((Math.abs(pp.player._x - op._x) - AI_APPROACH_WITHIN) < AI_FLEE_TOLERANCE) {
dx = 0;
}
}
}
}
if (Math.abs(pp.player._x - op._x) > Math.abs(pp.player._x - (op._x + dx))) {
dxRelativePlayer = -1;
}
if (Math.abs(pp.player._x - op._x) < Math.abs(pp.player._x - (op._x + dx))) {
dxRelativePlayer = 1;
}
if (Math.abs(pp.player._x - op._x) == Math.abs(pp.player._x - (op._x + dx))) {
dxRelativePlayer = 0;
}
if (op.collidingWith != null) {
if (Math.abs(op._x - pp.player._x) < Math.abs(op.collidingWith._x - pp.player._x)) {
if (dxRelativePlayer == -1) {
if (op.collidingWith._x > op._x) {
dx = -MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
dx = MV_TOPSPEED;
}
}
if (dxRelativePlayer == 0) {
if (op.collidingWith._x > op._x) {
op._x = op._x - MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
op._x = op._x + MV_TOPSPEED;
}
}
}
if (Math.abs(op._x - pp.player._x) > Math.abs(op.collidingWith._x - pp.player._x)) {
if (dxRelativePlayer == 1) {
if (op._x < op.collidingWith._x) {
dx = -MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
dx = MV_TOPSPEED;
}
}
if (dxRelativePlayer == 0) {
if (op._x < op.collidingWith._x) {
op._x = op._x - MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
op._x = op._x + MV_TOPSPEED;
}
}
}
}
if (gettingThrown) {
dx = 0;
dy = 0;
op._x = pp.player._x + pp.player.throwGuide._x;
op._y = pp.player._y + pp.player.throwGuide._y;
op._rotation = pp.player.throwGuide._rotation * (100 / pp.player._xscale);
if (pp.player._currentframe == pp.player.FT_THROWRELEASE) {
op._rotation = 180;
getHit(-10, -30, "smackDown", 0);
grounded = false;
gettingThrown = false;
}
}
if ((jumpTimer > AI_JUMP_WAIT) && (AI_JUMP)) {
jumpNow();
jumpTimer = 0;
}
if ((attackTimer == ATTACK_DELAY) && (annoy)) {
attackNow();
}
if (attackTimer == (ATTACK_DELAY + ATTACK_TIME)) {
attacking = false;
attackTimer = 0;
}
if ((!op.glomping) && (AI_GLOMP)) {
if (Math.abs(pp.player._x - op._x) < op._width) {
glompTimer++;
} else {
glompTimer = 0;
}
}
if ((glompTimer == AI_GLOMP_WAIT) && (!wincing)) {
op.glomping = true;
glompXoff = glompXoff * (-1 * (op._xscale / 100));
glompTimer++;
grounded = false;
}
if (pp.player.demonMode) {
glompTimer = 0;
attackTimer = 0;
attacking = false;
op.glomping = false;
}
winceTimer++;
jumpTimer++;
attackTimer++;
if (Math.abs(dx) < 1) {
dx = 0;
}
last_x = op._x;
last_y = op._y;
if ((animstate == "annoy") && (grounded)) {
dx = 0;
}
if (op.glomping) {
if (pp.player._xscale == 100) {
op._x = (pp.player._x + glompXoff) + pp.player.glompTarget._x;
}
if (pp.player._xscale == -100) {
op._x = (pp.player._x + glompXoff) - pp.player.glompTarget._x;
}
op._y = pp.player._y - AI_GLOMP_YOFF;
}
if (!op.glomping) {
op._x = op._x + dx;
op._y = op._y + dy;
if (!grounded) {
dy = dy + MV_GRAVITY;
if (dy > MV_TVELOCITY) {
dy = MV_TVELOCITY;
}
}
if ((op._y >= MV_GROUND) && (!dead)) {
op._y = MV_GROUND;
grounded = true;
if ((dy == MV_TVELOCITY) && (!jumping)) {
dy = -MV_BOUNCE;
grounded = false;
winceTimer = 0;
} else {
dy = 0;
jumping = false;
}
op._rotation = 0;
}
if (op._y > MV_DELETEAT) {
destroy();
}
if (grounded) {
if (dx > 0) {
dx = dx - MV_FRICTION;
}
if (dx < 0) {
dx = dx + MV_FRICTION;
}
}
}
}
}
}
Instance of Symbol 58 MovieClip "object" in Symbol 121 MovieClip [sqScout] Frame 1
onClipEvent (load) {
stop();
}
Instance of Symbol 32 MovieClip "code" in Symbol 159 MovieClip [sqf] Frame 1
onClipEvent (load) {
function getHit(x, y, type, dmg) {
if (attacking == false) {
if (type == "throw") {
gettingThrown = true;
}
if (type == "mid") {
if ((objectType == "pillow") or (objectType == "umbrella")) {
if (!itemWince) {
itemWince = true;
pp.jukebox.pillowHit.start();
pp.player.rageDown(3 * pp.RAGE_MODIFIER);
}
dmg = 0;
} else {
pp.jukebox.punch1.start();
}
}
if (type == "low") {
if ((objectType == "pillow") or (objectType == "umbrella")) {
if (!itemWince) {
itemWince = true;
pp.jukebox.pillowHit.start();
pp.player.rageDown(3 * pp.RAGE_MODIFIER);
}
dmg = 0;
} else {
pp.jukebox.punch2.start();
}
}
if (type == "upper") {
if ((objectType == "pillow") or (objectType == "umbrella")) {
if (!itemWince) {
itemWince = true;
pp.jukebox.pillowHit.start();
pp.player.rageDown(3 * pp.RAGE_MODIFIER);
}
dmg = 0;
} else {
pp.jukebox.punch3.start();
}
}
if (type == "spinUpper") {
pp.jukebox.punch3.start();
}
if (type == "flyBack") {
pp.jukebox.punch3.start();
}
if (type == "kickBack") {
if ((objectType == "pillow") or (objectType == "umbrella")) {
if (!itemWince) {
itemWince = true;
pp.jukebox.pillowHit.start();
pp.player.rageDown(3 * pp.RAGE_MODIFIER);
}
dmg = 0;
} else {
pp.jukebox.punch3.start();
}
}
if (type == "smackDown") {
type = "upper";
}
if (type == "energy") {
type = "upper";
}
if (type == "laser") {
type = "mid";
}
if ((dmg > 0) && (attacking == false)) {
if (type != "throw") {
if (pp.player._x > op._x) {
dx = -x;
}
if (pp.player._x <= op._x) {
dx = x;
}
facePlayer();
dy = y * -1;
grounded = false;
attackTimer = 0;
attacking = false;
splashPoint._x = op._x;
splashPoint._y = op._y - 20;
pp.attachMovie("FX_Splash", "splash" + pp.getNextHighestDepth(), pp.getNextHighestDepth(), splashPoint);
}
lastHitType = type;
hp = hp - dmg;
winceTimer = 0;
wincing = true;
approach = false;
flee = false;
bm.battleManager.score = bm.battleManager.score + Math.round(dmg / 10);
if (hp <= 0) {
hp = 0;
bm.battleManager.score = bm.battleManager.score + POINTS;
bm.battleManager.kills++;
bm.battleManager.killCount++;
dead = true;
}
}
}
}
function destroy() {
pp.jukebox.aaah.start();
bm.battleManager.unRegister(op);
op.removeMovieClip();
}
function facePlayer() {
if (pp.player._x < op._x) {
op._xscale = -100;
}
if (pp.player._x > op._x) {
op._xscale = 100;
}
}
function autoOrient() {
if (pp.getAngle(op._x, op._y, last_x, last_y) != undefined) {
op._rotation = pp.getAngle(op._x, op._y, last_x, last_y);
}
}
function dropItem() {
var _local1 = pp.getNextHighestDepth();
var _local2 = new Object();
_local2._x = op._x + (100 * (op._xscale / 100));
_local2._y = op._y - 100;
pp.attachMovie(objectType, objectType + _local1, _local1, _local2);
bm.battleManager.register(objectType + _local1);
hasObject = false;
op.object._visible = false;
objectType = "";
}
function jumpNow() {
if ((!dead) && (grounded)) {
if ((!wincing) && (dx != 0)) {
grounded = false;
jumping = true;
dy = -MV_JUMPPOWER;
}
}
}
function attackNow() {
if (!dead) {
if (!wincing) {
if ((op._x > 0) && (op._x < pp.M_WIDTH)) {
if (Math.random() < ATTACK_CHANCE) {
if (Math.abs(pp.player._x - op._x) < ATTACK_RANGE) {
attacking = true;
pp.player.sanityChange(-attackPwr);
if (Math.random() < 0.5) {
pp.jukebox.yoohoo.start();
} else {
pp.jukebox.heyCutie.start();
}
}
}
}
}
}
}
op = _parent;
pp = _parent._parent;
bm = _parent._parent._parent;
splashPoint = new Object();
op.stop();
active = true;
hp = 50 * pp.hpScale;
dead = false;
op.collidingWith = "blarg";
hitResult = -1;
grounded = false;
dxRelativePlayer = -1;
POINTS = 50;
MV_GROUND = pp.GROUND;
MV_GRAVITY = pp.GRAVITY;
MV_TVELOCITY = pp.TVELOCITY;
MV_DELETEAT = pp.DELETEAT;
MV_FRICTION = 2;
MV_ROTOFF = 180;
MV_BOUNCE = 20;
MV_TOPSPEED = 6;
MV_COLLISION_TOL = 40;
MV_JUMPPOWER = 30;
AI_APPROACH_WITHIN = 120;
AI_APPROACH = false;
AI_JUMP = false;
AI_FLEE = false;
AI_HIT_STUN = 45;
AI_JUMP_WAIT = 20;
AI_FLEE_TOLERANCE = 80;
AI_GLOMP = false;
glompXoff = 30;
AI_GLOMP_YOFF = Math.round(Math.random() * 30);
AI_GLOMP_WAIT = 20;
attackPwr = 5 * pp.attackScale;
ATTACK_DELAY = 90;
ATTACK_TIME = 20;
ATTACK_CHANCE = 0.8;
ATTACK_RANGE = 200;
attackTimer = Math.round(Math.random() * ATTACK_DELAY) - 50;
attacking = false;
annoy = true;
dx = 0;
dy = 0;
wincing = false;
lastHitType = "mid";
animstate = "";
last_x = op._x;
last_y = op._y;
WINCE_DELAY = 4;
HIT_HOLD = 4;
winceTimer = 100;
itemWince = false;
jumpTimer = 0;
jumping = false;
gettingThrown = false;
objectType = "";
hasObject = false;
objectLossModifier = 0;
op.glomping = false;
glompTimer = 0;
bm.battleManager.getAI(op);
}
onClipEvent (enterFrame) {
if (pp.gamePause == false) {
if (active) {
if (grounded && (dx == 0)) {
animstate = "stand";
if (pp.player.scary) {
animstate = "scareStand";
}
}
if (grounded && (dx != 0)) {
animstate = "run";
if (pp.player.scary) {
animstate = "scareRun";
}
}
if (winceTimer < AI_HIT_STUN) {
animstate = "stun";
}
if ((!grounded) && (dy < 0)) {
animstate = "jumpUp";
if (pp.player.scary) {
animstate = "scareJumpUp";
}
}
if ((!grounded) && (dy >= 0)) {
animstate = "jumpDown";
if (pp.player.scary) {
animstate = "scareJumpDown";
}
}
if (attacking) {
animstate = "annoy";
}
if (op.glomping) {
animstate = "glomp";
}
if (wincing) {
animstate = lastHitType;
}
if (winceTimer <= HIT_HOLD) {
animstate = lastHitType;
}
if (gettingThrown) {
animstate = "throw";
}
if (dead) {
animstate = "upper";
}
op.gotoAndStop(animstate);
if ((animstate == "upper") || (animstate == "spinUpper")) {
autoOrient();
}
if (((animstate == "upper") || (animstate == "spinUpper")) || (animstate == "flyBack")) {
if (dy > 0) {
op.hitBox.attacking = true;
}
if (hasObject) {
dropItem();
}
} else {
op.hitBox.attacking = false;
}
hitResult = -1;
i = 0;
while (i < pp.damageObjects.length) {
hitTarget = eval (pp.damageObjects[i] + pp.damageObjPath[i]);
if (op.hitBox.hitTest(hitTarget) && (hitTarget.attacking == true)) {
if ((hitTarget != pp.player) && (hitTarget != op)) {
if (!wincing) {
if (!op.glomping) {
hitResult = i;
}
if ((op.glomping && (pp.player.specialMove == "Cute Buster")) && (pp.player.specialMoving)) {
hitResult = i;
op.glomping = false;
}
if ((op.glomping && (pp.player.specialMove == "Upawcut")) && (pp.player.specialMoving)) {
hitResult = i;
op.glomping = false;
}
}
}
}
i++;
}
if (hitResult > -1) {
var t = eval ((pp + ".") + pp.damageObjects[hitResult]);
getHit(t.kbx, t.kby, t.attType, t.damage);
} else if (grounded && (winceTimer >= WINCE_DELAY)) {
wincing = false;
itemWince = false;
}
if (winceTimer > AI_HIT_STUN) {
if (AI_APPROACH) {
approach = true;
}
if (AI_FLEE) {
flee = true;
}
}
if (approach && (!wincing)) {
if (grounded) {
if (Math.abs(pp.player._x - op._x) > AI_APPROACH_WITHIN) {
if (pp.player._x < op._x) {
playerSide = -1;
}
if (pp.player._x > op._x) {
playerSide = 1;
}
dx = MV_TOPSPEED * playerSide;
op._xscale = playerSide * 100;
}
}
}
if (flee && (!wincing)) {
if (grounded) {
if (Math.abs(pp.player._x - op._x) < AI_APPROACH_WITHIN) {
if (pp.player._x < op._x) {
playerSide = -1;
}
if (pp.player._x > op._x) {
playerSide = 1;
}
dx = (MV_TOPSPEED * playerSide) * -1;
op._xscale = (playerSide * 100) * -1;
if ((AI_APPROACH_WITHIN - Math.abs(pp.player._x - op._x)) < AI_FLEE_TOLERANCE) {
dx = 0;
}
}
if (Math.abs(pp.player._x - op._x) > AI_APPROACH_WITHIN) {
if (pp.player._x < op._x) {
playerSide = -1;
}
if (pp.player._x > op._x) {
playerSide = 1;
}
dx = MV_TOPSPEED * playerSide;
op._xscale = playerSide * 100;
if ((Math.abs(pp.player._x - op._x) - AI_APPROACH_WITHIN) < AI_FLEE_TOLERANCE) {
dx = 0;
}
}
}
}
if (Math.abs(pp.player._x - op._x) > Math.abs(pp.player._x - (op._x + dx))) {
dxRelativePlayer = -1;
}
if (Math.abs(pp.player._x - op._x) < Math.abs(pp.player._x - (op._x + dx))) {
dxRelativePlayer = 1;
}
if (Math.abs(pp.player._x - op._x) == Math.abs(pp.player._x - (op._x + dx))) {
dxRelativePlayer = 0;
}
if (op.collidingWith != null) {
if (Math.abs(op._x - pp.player._x) < Math.abs(op.collidingWith._x - pp.player._x)) {
if (dxRelativePlayer == -1) {
if (op.collidingWith._x > op._x) {
dx = -MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
dx = MV_TOPSPEED;
}
}
if (dxRelativePlayer == 0) {
if (op.collidingWith._x > op._x) {
op._x = op._x - MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
op._x = op._x + MV_TOPSPEED;
}
}
}
if (Math.abs(op._x - pp.player._x) > Math.abs(op.collidingWith._x - pp.player._x)) {
if (dxRelativePlayer == 1) {
if (op._x < op.collidingWith._x) {
dx = -MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
dx = MV_TOPSPEED;
}
}
if (dxRelativePlayer == 0) {
if (op._x < op.collidingWith._x) {
op._x = op._x - MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
op._x = op._x + MV_TOPSPEED;
}
}
}
}
if (gettingThrown) {
dx = 0;
dy = 0;
op._x = pp.player._x + pp.player.throwGuide._x;
op._y = pp.player._y + pp.player.throwGuide._y;
op._rotation = pp.player.throwGuide._rotation * (100 / pp.player._xscale);
if (pp.player._currentframe == pp.player.FT_THROWRELEASE) {
op._rotation = 180;
getHit(-10, -30, "smackDown", 0);
grounded = false;
gettingThrown = false;
}
}
if ((jumpTimer > AI_JUMP_WAIT) && (AI_JUMP)) {
jumpNow();
jumpTimer = 0;
}
if ((attackTimer == ATTACK_DELAY) && (annoy)) {
attackNow();
}
if (attackTimer == (ATTACK_DELAY + ATTACK_TIME)) {
attacking = false;
attackTimer = 0;
}
if ((!op.glomping) && (AI_GLOMP)) {
if (Math.abs(pp.player._x - op._x) < op._width) {
glompTimer++;
} else {
glompTimer = 0;
}
}
if ((glompTimer == AI_GLOMP_WAIT) && (!wincing)) {
op.glomping = true;
glompXoff = glompXoff * (-1 * (op._xscale / 100));
glompTimer++;
grounded = false;
}
if (pp.player.demonMode) {
glompTimer = 0;
attackTimer = 0;
attacking = false;
op.glomping = false;
}
winceTimer++;
jumpTimer++;
attackTimer++;
if (Math.abs(dx) < 1) {
dx = 0;
}
last_x = op._x;
last_y = op._y;
if ((animstate == "annoy") && (grounded)) {
dx = 0;
}
if (op.glomping) {
if (pp.player._xscale == 100) {
op._x = (pp.player._x + glompXoff) + pp.player.glompTarget._x;
}
if (pp.player._xscale == -100) {
op._x = (pp.player._x + glompXoff) - pp.player.glompTarget._x;
}
op._y = pp.player._y - AI_GLOMP_YOFF;
}
if (!op.glomping) {
op._x = op._x + dx;
op._y = op._y + dy;
if (!grounded) {
dy = dy + MV_GRAVITY;
if (dy > MV_TVELOCITY) {
dy = MV_TVELOCITY;
}
}
if ((op._y >= MV_GROUND) && (!dead)) {
op._y = MV_GROUND;
grounded = true;
if ((dy == MV_TVELOCITY) && (!jumping)) {
dy = -MV_BOUNCE;
grounded = false;
winceTimer = 0;
} else {
dy = 0;
jumping = false;
}
op._rotation = 0;
}
if (op._y > MV_DELETEAT) {
destroy();
}
if (grounded) {
if (dx > 0) {
dx = dx - MV_FRICTION;
}
if (dx < 0) {
dx = dx + MV_FRICTION;
}
}
}
}
}
}
Instance of Symbol 58 MovieClip "object" in Symbol 159 MovieClip [sqf] Frame 1
onClipEvent (load) {
stop();
}
Instance of Symbol 32 MovieClip "code" in Symbol 194 MovieClip [sqt] Frame 1
onClipEvent (load) {
function getHit(x, y, type, dmg) {
if (attacking == false) {
if (type == "throw") {
gettingThrown = true;
}
if (type == "mid") {
if ((objectType == "pillow") or (objectType == "umbrella")) {
if (!itemWince) {
itemWince = true;
pp.jukebox.pillowHit.start();
pp.player.rageDown(3 * pp.RAGE_MODIFIER);
}
dmg = 0;
} else {
pp.jukebox.punch1.start();
}
}
if (type == "low") {
if ((objectType == "pillow") or (objectType == "umbrella")) {
if (!itemWince) {
itemWince = true;
pp.jukebox.pillowHit.start();
pp.player.rageDown(3 * pp.RAGE_MODIFIER);
}
dmg = 0;
} else {
pp.jukebox.punch2.start();
}
}
if (type == "upper") {
if ((objectType == "pillow") or (objectType == "umbrella")) {
if (!itemWince) {
itemWince = true;
pp.jukebox.pillowHit.start();
pp.player.rageDown(3 * pp.RAGE_MODIFIER);
}
dmg = 0;
} else {
pp.jukebox.punch3.start();
}
}
if (type == "spinUpper") {
pp.jukebox.punch3.start();
}
if (type == "flyBack") {
pp.jukebox.punch3.start();
}
if (type == "kickBack") {
if ((objectType == "pillow") or (objectType == "umbrella")) {
if (!itemWince) {
itemWince = true;
pp.jukebox.pillowHit.start();
pp.player.rageDown(3 * pp.RAGE_MODIFIER);
}
dmg = 0;
} else {
pp.jukebox.punch3.start();
}
}
if (type == "smackDown") {
type = "upper";
}
if (type == "energy") {
type = "upper";
}
if (type == "laser") {
type = "mid";
}
if ((dmg > 0) && (attacking == false)) {
if (type != "throw") {
if (pp.player._x > op._x) {
dx = -x;
}
if (pp.player._x <= op._x) {
dx = x;
}
facePlayer();
dy = y * -1;
grounded = false;
attackTimer = 0;
attacking = false;
splashPoint._x = op._x;
splashPoint._y = op._y - 20;
pp.attachMovie("FX_Splash", "splash" + pp.getNextHighestDepth(), pp.getNextHighestDepth(), splashPoint);
}
lastHitType = type;
hp = hp - dmg;
winceTimer = 0;
wincing = true;
approach = false;
flee = false;
bm.battleManager.score = bm.battleManager.score + Math.round(dmg / 10);
if (hp <= 0) {
hp = 0;
bm.battleManager.score = bm.battleManager.score + POINTS;
bm.battleManager.kills++;
bm.battleManager.killCount++;
dead = true;
}
}
}
}
function destroy() {
pp.jukebox.ohNo.start();
bm.battleManager.unRegister(op);
op.removeMovieClip();
}
function facePlayer() {
if (pp.player._x < op._x) {
op._xscale = -100;
}
if (pp.player._x > op._x) {
op._xscale = 100;
}
}
function autoOrient() {
if (pp.getAngle(op._x, op._y, last_x, last_y) != undefined) {
op._rotation = pp.getAngle(op._x, op._y, last_x, last_y);
}
}
function dropItem() {
var _local1 = pp.getNextHighestDepth();
var _local2 = new Object();
_local2._x = op._x + (100 * (op._xscale / 100));
_local2._y = op._y - 100;
pp.attachMovie(objectType, objectType + _local1, _local1, _local2);
bm.battleManager.register(objectType + _local1);
hasObject = false;
op.object._visible = false;
objectType = "";
}
function jumpNow() {
if ((!dead) && (grounded)) {
if ((!wincing) && (dx != 0)) {
grounded = false;
jumping = true;
dy = -MV_JUMPPOWER;
}
}
}
function attackNow() {
if (!dead) {
if (!wincing) {
if ((op._x > 0) && (op._x < pp.M_WIDTH)) {
if (Math.random() < ATTACK_CHANCE) {
if (Math.abs(pp.player._x - op._x) < ATTACK_RANGE) {
attacking = true;
pp.player.sanityChange(-attackPwr);
if (Math.random() < 0.5) {
pp.jukebox.uncleSmacky.start();
} else {
pp.jukebox.frownUpsideDown.start();
}
}
}
}
}
}
}
op = _parent;
pp = _parent._parent;
bm = _parent._parent._parent;
splashPoint = new Object();
op.stop();
active = true;
hp = 25 * pp.hpScale;
dead = false;
op.collidingWith = "blarg";
hitResult = -1;
grounded = false;
dxRelativePlayer = -1;
POINTS = 75;
MV_GROUND = pp.GROUND;
MV_GRAVITY = pp.GRAVITY;
MV_TVELOCITY = pp.TVELOCITY;
MV_DELETEAT = pp.DELETEAT;
MV_FRICTION = 2;
MV_ROTOFF = 180;
MV_BOUNCE = 20;
MV_TOPSPEED = 6;
MV_COLLISION_TOL = 40;
MV_JUMPPOWER = 30;
AI_APPROACH_WITHIN = 120;
AI_APPROACH = false;
AI_JUMP = false;
AI_FLEE = false;
AI_HIT_STUN = 45;
AI_JUMP_WAIT = 20;
AI_FLEE_TOLERANCE = 80;
AI_GLOMP = true;
glompXoff = 30;
AI_GLOMP_YOFF = Math.round(Math.random() * 30);
AI_GLOMP_WAIT = 20;
attackPwr = 4 * pp.attackScale;
ATTACK_DELAY = 90;
ATTACK_TIME = 20;
ATTACK_CHANCE = 1;
ATTACK_RANGE = 200;
attackTimer = Math.round(Math.random() * ATTACK_DELAY) - 50;
attacking = false;
annoy = true;
dx = 0;
dy = 0;
wincing = false;
lastHitType = "mid";
animstate = "";
last_x = op._x;
last_y = op._y;
WINCE_DELAY = 4;
HIT_HOLD = 4;
winceTimer = 100;
jumpTimer = 0;
jumping = false;
gettingThrown = false;
objectType = "";
hasObject = false;
objectLossModifier = 0;
op.glomping = false;
glompTimer = 0;
bm.battleManager.getAI(op);
}
onClipEvent (enterFrame) {
if (pp.gamePause == false) {
if (active) {
if (grounded && (dx == 0)) {
animstate = "stand";
if (pp.player.scary) {
animstate = "scareStand";
}
}
if (grounded && (dx != 0)) {
animstate = "run";
if (pp.player.scary) {
animstate = "scareRun";
}
}
if (winceTimer < AI_HIT_STUN) {
animstate = "stun";
}
if ((!grounded) && (dy < 0)) {
animstate = "jumpUp";
if (pp.player.scary) {
animstate = "scareJumpUp";
}
}
if ((!grounded) && (dy >= 0)) {
animstate = "jumpDown";
if (pp.player.scary) {
animstate = "scareJumpDown";
}
}
if (attacking) {
animstate = "annoy";
}
if (op.glomping) {
animstate = "glomp";
}
if (wincing) {
animstate = lastHitType;
}
if (winceTimer <= HIT_HOLD) {
animstate = lastHitType;
}
if (gettingThrown) {
animstate = "throw";
}
if (dead) {
animstate = "upper";
}
op.gotoAndStop(animstate);
if ((animstate == "upper") || (animstate == "spinUpper")) {
autoOrient();
}
if (((animstate == "upper") || (animstate == "spinUpper")) || (animstate == "flyBack")) {
if (dy > 0) {
op.hitBox.attacking = true;
}
if (hasObject) {
dropItem();
}
} else {
op.hitBox.attacking = false;
}
hitResult = -1;
i = 0;
while (i < pp.damageObjects.length) {
hitTarget = eval (pp.damageObjects[i] + pp.damageObjPath[i]);
if (op.hitBox.hitTest(hitTarget) && (hitTarget.attacking == true)) {
if ((hitTarget != pp.player) && (hitTarget != op)) {
if (!wincing) {
if (!op.glomping) {
hitResult = i;
}
if ((op.glomping && (pp.player.specialMove == "Cute Buster")) && (pp.player.specialMoving)) {
hitResult = i;
op.glomping = false;
}
if ((op.glomping && (pp.player.specialMove == "Upawcut")) && (pp.player.specialMoving)) {
hitResult = i;
op.glomping = false;
}
}
}
}
i++;
}
if (hitResult > -1) {
var t = eval ((pp + ".") + pp.damageObjects[hitResult]);
getHit(t.kbx, t.kby, t.attType, t.damage);
} else if (grounded && (winceTimer >= WINCE_DELAY)) {
wincing = false;
itemWince = false;
}
if (winceTimer > AI_HIT_STUN) {
if (AI_APPROACH) {
approach = true;
}
if (AI_FLEE) {
flee = true;
}
}
if (approach && (!wincing)) {
if (grounded) {
if (Math.abs(pp.player._x - op._x) > AI_APPROACH_WITHIN) {
if (pp.player._x < op._x) {
playerSide = -1;
}
if (pp.player._x > op._x) {
playerSide = 1;
}
dx = MV_TOPSPEED * playerSide;
op._xscale = playerSide * 100;
}
}
}
if (flee && (!wincing)) {
if (grounded) {
if (Math.abs(pp.player._x - op._x) < AI_APPROACH_WITHIN) {
if (pp.player._x < op._x) {
playerSide = -1;
}
if (pp.player._x > op._x) {
playerSide = 1;
}
dx = (MV_TOPSPEED * playerSide) * -1;
op._xscale = (playerSide * 100) * -1;
if ((AI_APPROACH_WITHIN - Math.abs(pp.player._x - op._x)) < AI_FLEE_TOLERANCE) {
dx = 0;
}
}
if (Math.abs(pp.player._x - op._x) > AI_APPROACH_WITHIN) {
if (pp.player._x < op._x) {
playerSide = -1;
}
if (pp.player._x > op._x) {
playerSide = 1;
}
dx = MV_TOPSPEED * playerSide;
op._xscale = playerSide * 100;
if ((Math.abs(pp.player._x - op._x) - AI_APPROACH_WITHIN) < AI_FLEE_TOLERANCE) {
dx = 0;
}
}
}
}
if (Math.abs(pp.player._x - op._x) > Math.abs(pp.player._x - (op._x + dx))) {
dxRelativePlayer = -1;
}
if (Math.abs(pp.player._x - op._x) < Math.abs(pp.player._x - (op._x + dx))) {
dxRelativePlayer = 1;
}
if (Math.abs(pp.player._x - op._x) == Math.abs(pp.player._x - (op._x + dx))) {
dxRelativePlayer = 0;
}
if (op.collidingWith != null) {
if (Math.abs(op._x - pp.player._x) < Math.abs(op.collidingWith._x - pp.player._x)) {
if (dxRelativePlayer == -1) {
if (op.collidingWith._x > op._x) {
dx = -MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
dx = MV_TOPSPEED;
}
}
if (dxRelativePlayer == 0) {
if (op.collidingWith._x > op._x) {
op._x = op._x - MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
op._x = op._x + MV_TOPSPEED;
}
}
}
if (Math.abs(op._x - pp.player._x) > Math.abs(op.collidingWith._x - pp.player._x)) {
if (dxRelativePlayer == 1) {
if (op._x < op.collidingWith._x) {
dx = -MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
dx = MV_TOPSPEED;
}
}
if (dxRelativePlayer == 0) {
if (op._x < op.collidingWith._x) {
op._x = op._x - MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
op._x = op._x + MV_TOPSPEED;
}
}
}
}
if (gettingThrown) {
dx = 0;
dy = 0;
op._x = pp.player._x + pp.player.throwGuide._x;
op._y = pp.player._y + pp.player.throwGuide._y;
op._rotation = pp.player.throwGuide._rotation * (100 / pp.player._xscale);
if (pp.player._currentframe == pp.player.FT_THROWRELEASE) {
op._rotation = 180;
getHit(-10, -30, "smackDown", 0);
grounded = false;
gettingThrown = false;
}
}
if ((jumpTimer > AI_JUMP_WAIT) && (AI_JUMP)) {
jumpNow();
jumpTimer = 0;
}
if ((attackTimer == ATTACK_DELAY) && (annoy)) {
attackNow();
}
if (attackTimer == (ATTACK_DELAY + ATTACK_TIME)) {
attacking = false;
attackTimer = 0;
}
if ((!op.glomping) && (AI_GLOMP)) {
if (Math.abs(pp.player._x - op._x) < op._width) {
glompTimer++;
} else {
glompTimer = 0;
}
}
if ((glompTimer == AI_GLOMP_WAIT) && (!wincing)) {
op.glomping = true;
glompXoff = glompXoff * (-1 * (op._xscale / 100));
glompTimer++;
grounded = false;
}
if (pp.player.demonMode) {
glompTimer = 0;
attackTimer = 0;
attacking = false;
op.glomping = false;
}
winceTimer++;
jumpTimer++;
attackTimer++;
if (Math.abs(dx) < 1) {
dx = 0;
}
last_x = op._x;
last_y = op._y;
if ((animstate == "annoy") && (grounded)) {
dx = 0;
}
if (op.glomping) {
if (pp.player._xscale == 100) {
op._x = (pp.player._x + glompXoff) + pp.player.glompTarget._x;
}
if (pp.player._xscale == -100) {
op._x = (pp.player._x + glompXoff) - pp.player.glompTarget._x;
}
op._y = pp.player._y - AI_GLOMP_YOFF;
}
if (!op.glomping) {
op._x = op._x + dx;
op._y = op._y + dy;
if (!grounded) {
dy = dy + MV_GRAVITY;
if (dy > MV_TVELOCITY) {
dy = MV_TVELOCITY;
}
}
if ((op._y >= MV_GROUND) && (!dead)) {
op._y = MV_GROUND;
grounded = true;
if ((dy == MV_TVELOCITY) && (!jumping)) {
dy = -MV_BOUNCE;
grounded = false;
winceTimer = 0;
} else {
dy = 0;
jumping = false;
}
op._rotation = 0;
}
if (op._y > MV_DELETEAT) {
destroy();
}
if (grounded) {
if (dx > 0) {
dx = dx - MV_FRICTION;
}
if (dx < 0) {
dx = dx + MV_FRICTION;
}
}
}
}
}
}
Instance of Symbol 58 MovieClip "object" in Symbol 194 MovieClip [sqt] Frame 1
onClipEvent (load) {
stop();
}
Instance of Symbol 32 MovieClip "code" in Symbol 229 MovieClip [sqMime] Frame 1
onClipEvent (load) {
function getHit(x, y, type, dmg) {
if (attacking == false) {
if (type == "throw") {
gettingThrown = true;
}
if (type == "mid") {
if ((objectType == "pillow") or (objectType == "cookBox")) {
if (!itemWince) {
itemWince = true;
pp.jukebox.pillowHit.start();
pp.player.rageDown(3 * pp.RAGE_MODIFIER);
}
dmg = 0;
} else {
pp.jukebox.punch1.start();
}
}
if (type == "low") {
if ((objectType == "pillow") or (objectType == "cookBox")) {
if (!itemWince) {
itemWince = true;
pp.jukebox.pillowHit.start();
pp.player.rageDown(3 * pp.RAGE_MODIFIER);
}
dmg = 0;
} else {
pp.jukebox.punch2.start();
}
}
if (type == "upper") {
if (dmg == 30) {
dmg = 0;
}
}
if (type == "spinUpper") {
pp.jukebox.punch3.start();
}
if (type == "flyBack") {
pp.jukebox.punch3.start();
}
if (type == "kickBack") {
if ((objectType == "pillow") or (objectType == "cookBox")) {
if (!itemWince) {
itemWince = true;
pp.jukebox.pillowHit.start();
pp.player.rageDown(3 * pp.RAGE_MODIFIER);
}
dmg = 0;
} else {
pp.jukebox.punch3.start();
}
}
if (type == "smackDown") {
type = "upper";
}
if (type == "energy") {
type = "upper";
}
if (type == "laser") {
type = "mid";
}
if ((dmg > 0) && (attacking == false)) {
if (type != "throw") {
if (pp.player._x > op._x) {
dx = -x;
}
if (pp.player._x <= op._x) {
dx = x;
}
facePlayer();
dy = y * -1;
grounded = false;
attackTimer = 0;
attacking = false;
splashPoint._x = op._x;
splashPoint._y = op._y - 20;
pp.attachMovie("FX_Splash", "splash" + pp.getNextHighestDepth(), pp.getNextHighestDepth(), splashPoint);
}
lastHitType = type;
hp = hp - dmg;
bm.bossHud.sbar._xscale = (hp / (MAX_HP * pp.hpScale)) * 100;
if (hp < 0) {
bm.bossHud.sbar._xscale = 0;
}
winceTimer = 0;
wincing = true;
approach = false;
flee = false;
bm.battleManager.score = bm.battleManager.score + Math.round(dmg / 10);
if (hp <= 0) {
hp = 0;
bm.battleManager.score = bm.battleManager.score + POINTS;
bm.battleManager.kills++;
bm.battleManager.killCount++;
dead = true;
}
}
}
}
function destroy() {
pp.jukebox.aaah.start();
bm.battleManager.unRegister(op);
op.removeMovieClip();
}
function facePlayer() {
if (pp.player._x < op._x) {
op._xscale = -100;
}
if (pp.player._x > op._x) {
op._xscale = 100;
}
}
function autoOrient() {
if (pp.getAngle(op._x, op._y, last_x, last_y) != undefined) {
op._rotation = pp.getAngle(op._x, op._y, last_x, last_y);
}
}
function dropItem() {
var _local1 = pp.getNextHighestDepth();
var _local2 = new Object();
_local2._x = op._x + (100 * (op._xscale / 100));
_local2._y = op._y - 100;
pp.attachMovie(objectType, objectType + _local1, _local1, _local2);
bm.battleManager.register(objectType + _local1);
hasObject = false;
op.object._visible = false;
objectType = "";
boxTimer = 0;
}
function jumpNow() {
if ((!dead) && (grounded)) {
if ((!wincing) && (dx != 0)) {
grounded = false;
jumping = true;
dy = -MV_JUMPPOWER;
}
}
}
function attackNow() {
if (!dead) {
if (!wincing) {
if ((op._x > 0) && (op._x < pp.M_WIDTH)) {
if (Math.random() < ATTACK_CHANCE) {
if (Math.abs(pp.player._x - op._x) < ATTACK_RANGE) {
attacking = true;
pp.player.sanityChange(-attackPwr);
if (Math.random() < 0.5) {
pp.jukebox.yoohoo.start();
} else {
pp.jukebox.heyCutie.start();
}
}
}
}
}
}
}
op = _parent;
pp = _parent._parent;
bm = _parent._parent._parent;
splashPoint = new Object();
op.stop();
active = true;
MAX_HP = 300 * pp.hpScale;
hp = MAX_HP;
dead = false;
op.collidingWith = "blarg";
hitResult = -1;
grounded = false;
dxRelativePlayer = -1;
POINTS = 1000;
MV_GROUND = pp.GROUND;
MV_GRAVITY = pp.GRAVITY;
MV_TVELOCITY = pp.TVELOCITY;
MV_DELETEAT = pp.DELETEAT;
MV_FRICTION = 2;
MV_ROTOFF = 180;
MV_BOUNCE = 20;
MV_TOPSPEED = 6;
MV_COLLISION_TOL = 40;
MV_JUMPPOWER = 30;
AI_APPROACH_WITHIN = 100;
AI_APPROACH = true;
AI_JUMP = false;
AI_FLEE = false;
AI_HIT_STUN = 45;
AI_JUMP_WAIT = 20;
AI_FLEE_TOLERANCE = 80;
AI_GLOMP = false;
glompXoff = 30;
AI_GLOMP_YOFF = Math.round(Math.random() * 30);
AI_GLOMP_WAIT = 20;
attackPwr = 3 * pp.attackScale;
ATTACK_DELAY = 80;
ATTACK_TIME = 20;
ATTACK_CHANCE = 0.9;
ATTACK_RANGE = 100;
attackTimer = Math.round(Math.random() * ATTACK_DELAY) - 50;
attacking = false;
annoy = false;
BOX_DELAY = 45;
boxTimer = 0;
dx = 0;
dy = 0;
wincing = false;
lastHitType = "mid";
animstate = "";
last_x = op._x;
last_y = op._y;
WINCE_DELAY = 4;
HIT_HOLD = 4;
winceTimer = 100;
itemWince = false;
jumpTimer = 0;
jumping = false;
gettingThrown = false;
objectType = "";
hasObject = false;
objectLossModifier = 0;
op.glomping = false;
glompTimer = 0;
bm.battleManager.getAI(op);
}
onClipEvent (enterFrame) {
if (pp.gamePause == false) {
if (boxTimer < BOX_DELAY) {
boxTimer++;
}
if (boxTimer == BOX_DELAY) {
objectType = "jackBox";
hasObject = true;
op.object._visible = true;
op.object.gotoAndStop(objectType);
dropItem();
}
if (active) {
if (grounded && (dx == 0)) {
animstate = "stand";
if (pp.player.scary) {
animstate = "scareStand";
}
}
if (grounded && (dx != 0)) {
animstate = "run";
if (pp.player.scary) {
animstate = "scareRun";
}
}
if (winceTimer < AI_HIT_STUN) {
animstate = "stun";
}
if ((!grounded) && (dy < 0)) {
animstate = "jumpUp";
if (pp.player.scary) {
animstate = "scareJumpUp";
}
}
if ((!grounded) && (dy >= 0)) {
animstate = "jumpDown";
if (pp.player.scary) {
animstate = "scareJumpDown";
}
}
if (attacking) {
animstate = "annoy";
}
if (op.glomping) {
animstate = "glomp";
}
if (wincing) {
animstate = lastHitType;
}
if (winceTimer <= HIT_HOLD) {
animstate = lastHitType;
}
if (gettingThrown) {
animstate = "throw";
}
if (dead) {
animstate = "upper";
}
op.gotoAndStop(animstate);
if ((animstate == "upper") || (animstate == "spinUpper")) {
autoOrient();
}
if (((animstate == "upper") || (animstate == "spinUpper")) || (animstate == "flyBack")) {
if (dy > 0) {
op.hitBox.attacking = true;
}
if (hasObject) {
dropItem();
}
} else {
op.hitBox.attacking = false;
}
hitResult = -1;
i = 0;
while (i < pp.damageObjects.length) {
hitTarget = eval (pp.damageObjects[i] + pp.damageObjPath[i]);
if (op.hitBox.hitTest(hitTarget) && (hitTarget.attacking == true)) {
if ((hitTarget != pp.player) && (hitTarget != op)) {
if (!wincing) {
if (!op.glomping) {
hitResult = i;
}
if ((op.glomping && (pp.player.specialMove == "Cute Buster")) && (pp.player.specialMoving)) {
hitResult = i;
op.glomping = false;
}
if ((op.glomping && (pp.player.specialMove == "Upawcut")) && (pp.player.specialMoving)) {
hitResult = i;
op.glomping = false;
}
}
}
}
i++;
}
if (hitResult > -1) {
var t = eval ((pp + ".") + pp.damageObjects[hitResult]);
getHit(t.kbx, t.kby, t.attType, t.damage);
} else if (grounded && (winceTimer >= WINCE_DELAY)) {
wincing = false;
itemWince = false;
}
if (winceTimer > AI_HIT_STUN) {
if (AI_APPROACH) {
approach = true;
}
if (AI_FLEE) {
flee = true;
}
}
if (approach && (!wincing)) {
if (grounded) {
if (Math.abs(pp.player._x - op._x) > AI_APPROACH_WITHIN) {
if (pp.player._x < op._x) {
playerSide = -1;
}
if (pp.player._x > op._x) {
playerSide = 1;
}
dx = MV_TOPSPEED * playerSide;
op._xscale = playerSide * 100;
}
}
}
if (flee && (!wincing)) {
if (grounded) {
if (Math.abs(pp.player._x - op._x) < AI_APPROACH_WITHIN) {
if (pp.player._x < op._x) {
playerSide = -1;
}
if (pp.player._x > op._x) {
playerSide = 1;
}
dx = (MV_TOPSPEED * playerSide) * -1;
op._xscale = (playerSide * 100) * -1;
if ((AI_APPROACH_WITHIN - Math.abs(pp.player._x - op._x)) < AI_FLEE_TOLERANCE) {
dx = 0;
}
}
if (Math.abs(pp.player._x - op._x) > AI_APPROACH_WITHIN) {
if (pp.player._x < op._x) {
playerSide = -1;
}
if (pp.player._x > op._x) {
playerSide = 1;
}
dx = MV_TOPSPEED * playerSide;
op._xscale = playerSide * 100;
if ((Math.abs(pp.player._x - op._x) - AI_APPROACH_WITHIN) < AI_FLEE_TOLERANCE) {
dx = 0;
}
}
}
}
if (Math.abs(pp.player._x - op._x) > Math.abs(pp.player._x - (op._x + dx))) {
dxRelativePlayer = -1;
}
if (Math.abs(pp.player._x - op._x) < Math.abs(pp.player._x - (op._x + dx))) {
dxRelativePlayer = 1;
}
if (Math.abs(pp.player._x - op._x) == Math.abs(pp.player._x - (op._x + dx))) {
dxRelativePlayer = 0;
}
if (op.collidingWith != null) {
if (Math.abs(op._x - pp.player._x) < Math.abs(op.collidingWith._x - pp.player._x)) {
if (dxRelativePlayer == -1) {
if (op.collidingWith._x > op._x) {
dx = -MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
dx = MV_TOPSPEED;
}
}
if (dxRelativePlayer == 0) {
if (op.collidingWith._x > op._x) {
op._x = op._x - MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
op._x = op._x + MV_TOPSPEED;
}
}
}
if (Math.abs(op._x - pp.player._x) > Math.abs(op.collidingWith._x - pp.player._x)) {
if (dxRelativePlayer == 1) {
if (op._x < op.collidingWith._x) {
dx = -MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
dx = MV_TOPSPEED;
}
}
if (dxRelativePlayer == 0) {
if (op._x < op.collidingWith._x) {
op._x = op._x - MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
op._x = op._x + MV_TOPSPEED;
}
}
}
}
if (gettingThrown) {
dx = 0;
dy = 0;
op._x = pp.player._x + pp.player.throwGuide._x;
op._y = pp.player._y + pp.player.throwGuide._y;
op._rotation = pp.player.throwGuide._rotation * (100 / pp.player._xscale);
if (pp.player._currentframe == pp.player.FT_THROWRELEASE) {
op._rotation = 180;
getHit(-10, -30, "smackDown", 0);
grounded = false;
gettingThrown = false;
}
}
if ((jumpTimer > AI_JUMP_WAIT) && (AI_JUMP)) {
jumpNow();
jumpTimer = 0;
}
if ((attackTimer == ATTACK_DELAY) && (annoy)) {
attackNow();
}
if (attackTimer == (ATTACK_DELAY + ATTACK_TIME)) {
attacking = false;
attackTimer = 0;
}
if ((!op.glomping) && (AI_GLOMP)) {
if (Math.abs(pp.player._x - op._x) < op._width) {
glompTimer++;
} else {
glompTimer = 0;
}
}
if ((glompTimer == AI_GLOMP_WAIT) && (!wincing)) {
op.glomping = true;
glompXoff = glompXoff * (-1 * (op._xscale / 100));
glompTimer++;
grounded = false;
}
if (pp.player.demonMode) {
glompTimer = 0;
attackTimer = 0;
attacking = false;
op.glomping = false;
}
winceTimer++;
jumpTimer++;
attackTimer++;
if (Math.abs(dx) < 1) {
dx = 0;
}
last_x = op._x;
last_y = op._y;
if ((animstate == "annoy") && (grounded)) {
dx = 0;
}
if (op.glomping) {
if (pp.player._xscale == 100) {
op._x = (pp.player._x + glompXoff) + pp.player.glompTarget._x;
}
if (pp.player._xscale == -100) {
op._x = (pp.player._x + glompXoff) - pp.player.glompTarget._x;
}
op._y = pp.player._y - AI_GLOMP_YOFF;
}
if (!op.glomping) {
op._x = op._x + dx;
op._y = op._y + dy;
if (!grounded) {
dy = dy + MV_GRAVITY;
if (dy > MV_TVELOCITY) {
dy = MV_TVELOCITY;
}
}
if ((op._y >= MV_GROUND) && (!dead)) {
op._y = MV_GROUND;
grounded = true;
if ((dy == MV_TVELOCITY) && (!jumping)) {
dy = -MV_BOUNCE;
grounded = false;
winceTimer = 0;
} else {
dy = 0;
jumping = false;
}
op._rotation = 0;
}
if (op._y > MV_DELETEAT) {
destroy();
}
if (grounded) {
if (dx > 0) {
dx = dx - MV_FRICTION;
}
if (dx < 0) {
dx = dx + MV_FRICTION;
}
}
}
}
}
}
Instance of Symbol 58 MovieClip "object" in Symbol 229 MovieClip [sqMime] Frame 1
onClipEvent (load) {
stop();
}
Instance of Symbol 32 MovieClip "code" in Symbol 292 MovieClip [sqm] Frame 1
onClipEvent (load) {
function getHit(x, y, type, dmg) {
if (attacking == false) {
if (type == "throw") {
gettingThrown = true;
}
if (type == "mid") {
if ((objectType == "pillow") or (objectType == "umbrella")) {
if (!itemWince) {
itemWince = true;
pp.jukebox.pillowHit.start();
pp.player.rageDown(3 * pp.RAGE_MODIFIER);
}
dmg = 0;
} else {
pp.jukebox.punch1.start();
}
}
if (type == "low") {
if ((objectType == "pillow") or (objectType == "umbrella")) {
if (!itemWince) {
itemWince = true;
pp.jukebox.pillowHit.start();
pp.player.rageDown(3 * pp.RAGE_MODIFIER);
}
dmg = 0;
} else {
pp.jukebox.punch2.start();
}
}
if (type == "upper") {
if ((objectType == "pillow") or (objectType == "umbrella")) {
if (!itemWince) {
itemWince = true;
pp.jukebox.pillowHit.start();
pp.player.rageDown(3 * pp.RAGE_MODIFIER);
}
dmg = 0;
} else {
pp.jukebox.punch3.start();
}
}
if (type == "spinUpper") {
pp.jukebox.punch3.start();
}
if (type == "flyBack") {
pp.jukebox.punch3.start();
}
if (type == "kickBack") {
if ((objectType == "pillow") or (objectType == "umbrella")) {
if (!itemWince) {
itemWince = true;
pp.jukebox.pillowHit.start();
pp.player.rageDown(3 * pp.RAGE_MODIFIER);
}
dmg = 0;
} else {
pp.jukebox.punch3.start();
}
}
if (type == "smackDown") {
type = "upper";
}
if (type == "energy") {
type = "upper";
}
if (type == "laser") {
type = "mid";
}
if ((dmg > 0) && (attacking == false)) {
if (type != "throw") {
if (pp.player._x > op._x) {
dx = -x;
}
if (pp.player._x <= op._x) {
dx = x;
}
facePlayer();
dy = y * -1;
grounded = false;
attackTimer = 0;
attacking = false;
splashPoint._x = op._x;
splashPoint._y = op._y - 20;
pp.attachMovie("FX_Splash", "splash" + pp.getNextHighestDepth(), pp.getNextHighestDepth(), splashPoint);
}
lastHitType = type;
hp = hp - dmg;
winceTimer = 0;
wincing = true;
approach = false;
flee = false;
bm.battleManager.score = bm.battleManager.score + Math.round(dmg / 10);
if (hp <= 0) {
hp = 0;
bm.battleManager.score = bm.battleManager.score + POINTS;
bm.battleManager.kills++;
bm.battleManager.killCount++;
dead = true;
}
}
}
}
function destroy() {
pp.jukebox.ohBoy.start();
bm.battleManager.unRegister(op);
op.removeMovieClip();
}
function facePlayer() {
if (pp.player._x < op._x) {
op._xscale = -100;
}
if (pp.player._x > op._x) {
op._xscale = 100;
}
}
function autoOrient() {
if (pp.getAngle(op._x, op._y, last_x, last_y) != undefined) {
op._rotation = pp.getAngle(op._x, op._y, last_x, last_y);
}
}
function dropItem() {
var _local1 = pp.getNextHighestDepth();
var _local2 = new Object();
_local2._x = op._x + (100 * (op._xscale / 100));
_local2._y = op._y - 100;
pp.attachMovie(objectType, objectType + _local1, _local1, _local2);
bm.battleManager.register(objectType + _local1);
hasObject = false;
op.object._visible = false;
objectType = "";
}
function jumpNow() {
if ((!dead) && (grounded)) {
if ((!wincing) && (dx != 0)) {
grounded = false;
jumping = true;
dy = -MV_JUMPPOWER;
}
}
}
function attackNow() {
if (!dead) {
if (!wincing) {
if ((op._x > 0) && (op._x < pp.M_WIDTH)) {
if (Math.random() < ATTACK_CHANCE) {
if (Math.abs(pp.player._x - op._x) < ATTACK_RANGE) {
attacking = true;
pp.player.sanityChange(-attackPwr);
if (Math.random() < 0.5) {
pp.jukebox.hello.start();
} else {
pp.jukebox.heyNeighbor.start();
}
}
}
}
}
}
}
op = _parent;
pp = _parent._parent;
bm = _parent._parent._parent;
splashPoint = new Object();
op.stop();
active = true;
hp = 50 * pp.hpScale;
dead = false;
op.collidingWith = "blarg";
hitResult = -1;
grounded = false;
dxRelativePlayer = -1;
POINTS = 50;
MV_GROUND = pp.GROUND;
MV_GRAVITY = pp.GRAVITY;
MV_TVELOCITY = pp.TVELOCITY;
MV_DELETEAT = pp.DELETEAT;
MV_FRICTION = 2;
MV_ROTOFF = 180;
MV_BOUNCE = 20;
MV_TOPSPEED = 6;
MV_COLLISION_TOL = 40;
MV_JUMPPOWER = 30;
AI_APPROACH_WITHIN = 120;
AI_APPROACH = false;
AI_JUMP = false;
AI_FLEE = false;
AI_HIT_STUN = 45;
AI_JUMP_WAIT = 20;
AI_FLEE_TOLERANCE = 80;
AI_GLOMP = false;
glompXoff = 30;
AI_GLOMP_YOFF = Math.round(Math.random() * 30);
AI_GLOMP_WAIT = 20;
attackPwr = 5 * pp.attackScale;
ATTACK_DELAY = 90;
ATTACK_TIME = 20;
ATTACK_CHANCE = 0.8;
ATTACK_RANGE = 200;
attackTimer = Math.round(Math.random() * ATTACK_DELAY) - 50;
attacking = false;
annoy = true;
dx = 0;
dy = 0;
wincing = false;
itemWince = false;
lastHitType = "mid";
animstate = "";
last_x = op._x;
last_y = op._y;
WINCE_DELAY = 4;
HIT_HOLD = 4;
winceTimer = 100;
jumpTimer = 0;
jumping = false;
gettingThrown = false;
objectType = "";
hasObject = false;
objectLossModifier = 0;
op.glomping = false;
glompTimer = 0;
bm.battleManager.getAI(op);
}
onClipEvent (enterFrame) {
if (pp.gamePause == false) {
if (active) {
if (grounded && (dx == 0)) {
animstate = "stand";
if (pp.player.scary) {
animstate = "scareStand";
}
}
if (grounded && (dx != 0)) {
animstate = "run";
if (pp.player.scary) {
animstate = "scareRun";
}
}
if (winceTimer < AI_HIT_STUN) {
animstate = "stun";
}
if ((!grounded) && (dy < 0)) {
animstate = "jumpUp";
if (pp.player.scary) {
animstate = "scareJumpUp";
}
}
if ((!grounded) && (dy >= 0)) {
animstate = "jumpDown";
if (pp.player.scary) {
animstate = "scareJumpDown";
}
}
if (attacking) {
animstate = "annoy";
}
if (op.glomping) {
animstate = "glomp";
}
if (wincing) {
animstate = lastHitType;
}
if (winceTimer <= HIT_HOLD) {
animstate = lastHitType;
}
if (gettingThrown) {
animstate = "throw";
}
if (dead) {
animstate = "upper";
}
op.gotoAndStop(animstate);
if ((animstate == "upper") || (animstate == "spinUpper")) {
autoOrient();
}
if (((animstate == "upper") || (animstate == "spinUpper")) || (animstate == "flyBack")) {
if (dy > 0) {
op.hitBox.attacking = true;
}
if (hasObject) {
dropItem();
}
} else {
op.hitBox.attacking = false;
}
hitResult = -1;
i = 0;
while (i < pp.damageObjects.length) {
hitTarget = eval (pp.damageObjects[i] + pp.damageObjPath[i]);
if (op.hitBox.hitTest(hitTarget) && (hitTarget.attacking == true)) {
if ((hitTarget != pp.player) && (hitTarget != op)) {
if (!wincing) {
if (!op.glomping) {
hitResult = i;
}
if ((op.glomping && (pp.player.specialMove == "Cute Buster")) && (pp.player.specialMoving)) {
hitResult = i;
op.glomping = false;
}
if ((op.glomping && (pp.player.specialMove == "Upawcut")) && (pp.player.specialMoving)) {
hitResult = i;
op.glomping = false;
}
}
}
}
i++;
}
if (hitResult > -1) {
var t = eval ((pp + ".") + pp.damageObjects[hitResult]);
getHit(t.kbx, t.kby, t.attType, t.damage);
} else if (grounded && (winceTimer >= WINCE_DELAY)) {
wincing = false;
itemWince = false;
}
if (winceTimer > AI_HIT_STUN) {
if (AI_APPROACH) {
approach = true;
}
if (AI_FLEE) {
flee = true;
}
}
if (approach && (!wincing)) {
if (grounded) {
if (Math.abs(pp.player._x - op._x) > AI_APPROACH_WITHIN) {
if (pp.player._x < op._x) {
playerSide = -1;
}
if (pp.player._x > op._x) {
playerSide = 1;
}
dx = MV_TOPSPEED * playerSide;
op._xscale = playerSide * 100;
}
}
}
if (flee && (!wincing)) {
if (grounded) {
if (Math.abs(pp.player._x - op._x) < AI_APPROACH_WITHIN) {
if (pp.player._x < op._x) {
playerSide = -1;
}
if (pp.player._x > op._x) {
playerSide = 1;
}
dx = (MV_TOPSPEED * playerSide) * -1;
op._xscale = (playerSide * 100) * -1;
if ((AI_APPROACH_WITHIN - Math.abs(pp.player._x - op._x)) < AI_FLEE_TOLERANCE) {
dx = 0;
}
}
if (Math.abs(pp.player._x - op._x) > AI_APPROACH_WITHIN) {
if (pp.player._x < op._x) {
playerSide = -1;
}
if (pp.player._x > op._x) {
playerSide = 1;
}
dx = MV_TOPSPEED * playerSide;
op._xscale = playerSide * 100;
if ((Math.abs(pp.player._x - op._x) - AI_APPROACH_WITHIN) < AI_FLEE_TOLERANCE) {
dx = 0;
}
}
}
}
if (Math.abs(pp.player._x - op._x) > Math.abs(pp.player._x - (op._x + dx))) {
dxRelativePlayer = -1;
}
if (Math.abs(pp.player._x - op._x) < Math.abs(pp.player._x - (op._x + dx))) {
dxRelativePlayer = 1;
}
if (Math.abs(pp.player._x - op._x) == Math.abs(pp.player._x - (op._x + dx))) {
dxRelativePlayer = 0;
}
if (op.collidingWith != null) {
if (Math.abs(op._x - pp.player._x) < Math.abs(op.collidingWith._x - pp.player._x)) {
if (dxRelativePlayer == -1) {
if (op.collidingWith._x > op._x) {
dx = -MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
dx = MV_TOPSPEED;
}
}
if (dxRelativePlayer == 0) {
if (op.collidingWith._x > op._x) {
op._x = op._x - MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
op._x = op._x + MV_TOPSPEED;
}
}
}
if (Math.abs(op._x - pp.player._x) > Math.abs(op.collidingWith._x - pp.player._x)) {
if (dxRelativePlayer == 1) {
if (op._x < op.collidingWith._x) {
dx = -MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
dx = MV_TOPSPEED;
}
}
if (dxRelativePlayer == 0) {
if (op._x < op.collidingWith._x) {
op._x = op._x - MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
op._x = op._x + MV_TOPSPEED;
}
}
}
}
if (gettingThrown) {
dx = 0;
dy = 0;
op._x = pp.player._x + pp.player.throwGuide._x;
op._y = pp.player._y + pp.player.throwGuide._y;
op._rotation = pp.player.throwGuide._rotation * (100 / pp.player._xscale);
if (pp.player._currentframe == pp.player.FT_THROWRELEASE) {
op._rotation = 180;
getHit(-10, -30, "smackDown", 0);
grounded = false;
gettingThrown = false;
}
}
if ((jumpTimer > AI_JUMP_WAIT) && (AI_JUMP)) {
jumpNow();
jumpTimer = 0;
}
if ((attackTimer == ATTACK_DELAY) && (annoy)) {
attackNow();
}
if (attackTimer == (ATTACK_DELAY + ATTACK_TIME)) {
attacking = false;
attackTimer = 0;
}
if ((!op.glomping) && (AI_GLOMP)) {
if (Math.abs(pp.player._x - op._x) < op._width) {
glompTimer++;
} else {
glompTimer = 0;
}
}
if ((glompTimer == AI_GLOMP_WAIT) && (!wincing)) {
op.glomping = true;
glompXoff = glompXoff * (-1 * (op._xscale / 100));
glompTimer++;
grounded = false;
}
if (pp.player.demonMode) {
glompTimer = 0;
attackTimer = 0;
attacking = false;
op.glomping = false;
}
winceTimer++;
jumpTimer++;
attackTimer++;
if (Math.abs(dx) < 1) {
dx = 0;
}
last_x = op._x;
last_y = op._y;
if ((animstate == "annoy") && (grounded)) {
dx = 0;
}
if (op.glomping) {
if (pp.player._xscale == 100) {
op._x = (pp.player._x + glompXoff) + pp.player.glompTarget._x;
}
if (pp.player._xscale == -100) {
op._x = (pp.player._x + glompXoff) - pp.player.glompTarget._x;
}
op._y = pp.player._y - AI_GLOMP_YOFF;
}
if (!op.glomping) {
op._x = op._x + dx;
op._y = op._y + dy;
if (!grounded) {
dy = dy + MV_GRAVITY;
if (dy > MV_TVELOCITY) {
dy = MV_TVELOCITY;
}
}
if ((op._y >= MV_GROUND) && (!dead)) {
op._y = MV_GROUND;
grounded = true;
if ((dy == MV_TVELOCITY) && (!jumping)) {
dy = -MV_BOUNCE;
grounded = false;
winceTimer = 0;
} else {
dy = 0;
jumping = false;
}
op._rotation = 0;
}
if (op._y > MV_DELETEAT) {
destroy();
}
if (grounded) {
if (dx > 0) {
dx = dx - MV_FRICTION;
}
if (dx < 0) {
dx = dx + MV_FRICTION;
}
}
}
}
}
}
Instance of Symbol 58 MovieClip "object" in Symbol 292 MovieClip [sqm] Frame 1
onClipEvent (load) {
stop();
}
Symbol 299 MovieClip Frame 34
stop();
Instance of Symbol 32 MovieClip "code" in Symbol 300 MovieClip [flowerSack] Frame 1
onClipEvent (load) {
function destroy() {
bm.battleManager.unRegister(op);
op.removeMovieClip();
}
function getHit(x, y, type, dmg) {
if (type != "throw") {
if (pp.player._x > this._x) {
dx = -x;
}
if (pp.player._x <= this._x) {
dx = x;
}
dy = y * -1;
grounded = false;
splashPoint._x = op._x;
splashPoint._y = op._y - 20;
pp.attachMovie("FX_Splash", "splash" + pp.getNextHighestDepth(), pp.getNextHighestDepth(), splashPoint);
}
if (type == "throw") {
gettingThrown = true;
}
if (type == "mid") {
pp.jukebox.punch1.start();
}
if (type == "low") {
pp.jukebox.punch2.start();
}
if (type == "upper") {
pp.jukebox.punch3.start();
}
if (type == "spinUpper") {
pp.jukebox.punch3.start();
}
if (type == "flyBack") {
pp.jukebox.punch3.start();
}
if (type == "smackDown") {
type = "upper";
}
bm.battleManager.score = bm.battleManager.score + Math.round(dmg / 10);
if (hp <= 0) {
hp = 0;
bm.battleManager.score = bm.battleManager.score + POINTS;
dead = true;
pp.attachMovie("sanityRecover", "sanRecover", 60);
pp.player.sanityChange(15);
pp.sanRecover._x = op._x;
pp.sanRecover._y = op._y;
dy = -40;
dx = 15 * (pp.player._xscale / 100);
}
}
op.stop();
bm = _parent._parent._parent;
pp = _parent._parent;
splashPoint = new Object();
op = _parent;
hp = 20 * pp.hpScale;
dead = false;
rotateSpeed = 30;
hitResult = 0;
grounded = false;
POINTS = 25;
MV_GROUND = pp.GROUND;
MV_GRAVITY = pp.GRAVITY;
MV_TVELOCITY = pp.TVELOCITY;
MV_DELETEAT = pp.DELETEAT;
MV_FRICTION = 2;
MV_ROTOFF = 180;
MV_BOUNCE = 20;
MV_TOPSPEED = 6;
MV_COLLISION_TOL = 40;
op.collidingWith;
op.attacking = false;
op.kbx = 5;
op.kby = 22;
op.damage = 0;
op.attType = "upper";
dx = 0;
dy = 40;
WINCE_DELAY = 4;
winceTimer = 100;
gettingThrown = false;
}
onClipEvent (enterFrame) {
animstate = "stand";
if ((!grounded) && (!dead)) {
op._rotation = op._rotation + rotateSpeed;
}
if (wincing) {
animstate = "wince";
}
if (dead) {
animstate = "dead";
}
op.gotoAndStop(animstate);
hitResult = -1;
i = 0;
while (i < pp.damageObjects.length) {
hitTarget = eval (((pp + ".") + pp.damageObjects[i]) + pp.damageObjPath[i]);
if (op.hitTest(hitTarget) && (hitTarget.attacking == true)) {
if (!wincing) {
hitResult = i;
}
}
i++;
}
if (hitResult > -1) {
var t = eval ((pp + ".") + pp.damageObjects[hitResult]);
getHit(t.kbx, t.kby, t.attType, t.damage);
winceTimer = 0;
wincing = true;
} else if (grounded && (winceTimer >= WINCE_DELAY)) {
wincing = false;
}
if (gettingThrown) {
dx = 0;
dy = 0;
op._x = pp.player._x + pp.player.throwGuide._x;
op._y = pp.player._y + pp.player.throwGuide._y;
op._rotation = pp.player.throwGuide._rotation * (100 / pp.player._xscale);
if (pp.player._currentframe == pp.player.FT_THROWRELEASE) {
op._rotation = 180;
getHit(-10, -30, "smackDown", 0);
grounded = false;
gettingThrown = false;
}
}
if (Math.abs(pp.player._x - op._x) > Math.abs(pp.player._x - (op._x + dx))) {
dxRelativePlayer = -1;
}
if (Math.abs(pp.player._x - op._x) < Math.abs(pp.player._x - (op._x + dx))) {
dxRelativePlayer = 1;
}
if (Math.abs(pp.player._x - op._x) == Math.abs(pp.player._x - (op._x + dx))) {
dxRelativePlayer = 0;
}
if (op.collidingWith != null) {
if (Math.abs(op._x - pp.player._x) < Math.abs(op.collidingWith._x - pp.player._x)) {
if (dxRelativePlayer == -1) {
if (op.collidingWith._x > op._x) {
dx = -MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
dx = MV_TOPSPEED;
}
}
if (dxRelativePlayer == 0) {
if (op.collidingWith._x > op._x) {
op._x = op._x - MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
op._x = op._x + MV_TOPSPEED;
}
}
}
if (Math.abs(op._x - pp.player._x) > Math.abs(op.collidingWith._x - pp.player._x)) {
if (dxRelativePlayer == 1) {
if (op._x < op.collidingWith._x) {
dx = -MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
dx = MV_TOPSPEED;
}
}
if (dxRelativePlayer == 0) {
if (op._x < op.collidingWith._x) {
op._x = op._x - MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
op._x = op._x + MV_TOPSPEED;
}
}
}
}
if (dead) {
grounded = false;
}
winceTimer++;
if (Math.abs(dx - 1) < 1) {
dx = 0;
}
op._x = op._x + dx;
op._y = op._y + dy;
if (!grounded) {
dy = dy + MV_GRAVITY;
if (dy > MV_TVELOCITY) {
dy = MV_TVELOCITY;
}
}
if ((op._y >= MV_GROUND) && (!dead)) {
op._y = MV_GROUND;
grounded = true;
if (dy == MV_TVELOCITY) {
dy = -MV_BOUNCE;
grounded = false;
winceTimer = 0;
} else {
dy = 0;
}
op._rotation = 0;
}
if (op._y > MV_DELETEAT) {
destroy();
}
if (grounded) {
if (dx > 0) {
dx = dx - MV_FRICTION;
}
if (dx < 0) {
dx = dx + MV_FRICTION;
}
}
if (op._x < 0) {
op._x = op._x + MV_TOPSPEED;
}
if (op._x > pp.M_WIDTH) {
op._x = op._x - MV_TOPSPEED;
}
}
Instance of Symbol 32 MovieClip "code" in Symbol 302 MovieClip [bluePresentBig] Frame 1
onClipEvent (load) {
function destroy() {
bm.battleManager.unRegister(op);
op.removeMovieClip();
}
function getHit(x, y, type, dmg) {
if (type != "throw") {
if (pp.player._x > this._x) {
dx = -x;
}
if (pp.player._x <= this._x) {
dx = x;
}
dy = y * -1;
grounded = false;
splashPoint._x = op._x;
splashPoint._y = op._y - 20;
pp.attachMovie("FX_Splash", "splash" + pp.getNextHighestDepth(), pp.getNextHighestDepth(), splashPoint);
}
if (type == "throw") {
gettingThrown = true;
}
if (type == "mid") {
pp.jukebox.punch1.start();
}
if (type == "low") {
pp.jukebox.punch2.start();
}
if (type == "upper") {
pp.jukebox.punch3.start();
}
if (type == "spinUpper") {
pp.jukebox.punch3.start();
}
if (type == "flyBack") {
pp.jukebox.punch3.start();
}
if (type == "smackDown") {
type = "upper";
}
hp = hp - dmg;
bm.battleManager.score = bm.battleManager.score + Math.round(dmg / 10);
if (hp <= 0) {
hp = 0;
bm.battleManager.score = bm.battleManager.score + POINTS;
dead = true;
pp.attachMovie("sanityRecover", "sanRecover", 60);
pp.player.sanityChange(100);
pp.sanRecover._x = op._x;
pp.sanRecover._y = op._y;
dy = -40;
dx = 15 * (pp.player._xscale / 100);
}
}
op.stop();
bm = _parent._parent._parent;
pp = _parent._parent;
splashPoint = new Object();
op = _parent;
hp = 20 * pp.hpScale;
dead = false;
rotateSpeed = 30;
hitResult = 0;
grounded = false;
POINTS = 25;
MV_GROUND = pp.GROUND;
MV_GRAVITY = pp.GRAVITY;
MV_TVELOCITY = pp.TVELOCITY;
MV_DELETEAT = pp.DELETEAT;
MV_FRICTION = 2;
MV_ROTOFF = 180;
MV_BOUNCE = 20;
MV_TOPSPEED = 6;
MV_COLLISION_TOL = 40;
op.collidingWith;
op.attacking = false;
op.kbx = 5;
op.kby = 22;
op.damage = 0;
op.attType = "upper";
dx = 0;
dy = 40;
WINCE_DELAY = 4;
EXPIRATION = 30 * pp.OBJECT_DELAY;
expireTimer = 0;
winceTimer = 100;
gettingThrown = false;
}
onClipEvent (enterFrame) {
if (pp.gamePause == false) {
animstate = "stand";
if ((!grounded) && (!dead)) {
op._rotation = op._rotation + rotateSpeed;
}
if (wincing) {
animstate = "wince";
}
if (hp <= 0) {
animstate = "dead";
}
op.gotoAndStop(animstate);
hitResult = -1;
i = 0;
while (i < pp.damageObjects.length) {
hitTarget = eval (((pp + ".") + pp.damageObjects[i]) + pp.damageObjPath[i]);
if (op.hitTest(hitTarget) && (hitTarget.attacking == true)) {
if (!wincing) {
hitResult = i;
}
}
i++;
}
if (hitResult > -1) {
var t = eval ((pp + ".") + pp.damageObjects[hitResult]);
getHit(t.kbx, t.kby, t.attType, t.damage);
winceTimer = 0;
wincing = true;
} else if (grounded && (winceTimer >= WINCE_DELAY)) {
wincing = false;
}
if (gettingThrown) {
dx = 0;
dy = 0;
op._x = pp.player._x + pp.player.throwGuide._x;
op._y = pp.player._y + pp.player.throwGuide._y;
op._rotation = pp.player.throwGuide._rotation * (100 / pp.player._xscale);
if (pp.player._currentframe == pp.player.FT_THROWRELEASE) {
op._rotation = 180;
getHit(-10, -30, "smackDown", 0);
grounded = false;
gettingThrown = false;
}
}
if (Math.abs(pp.player._x - op._x) > Math.abs(pp.player._x - (op._x + dx))) {
dxRelativePlayer = -1;
}
if (Math.abs(pp.player._x - op._x) < Math.abs(pp.player._x - (op._x + dx))) {
dxRelativePlayer = 1;
}
if (Math.abs(pp.player._x - op._x) == Math.abs(pp.player._x - (op._x + dx))) {
dxRelativePlayer = 0;
}
if (op.collidingWith != null) {
if (Math.abs(op._x - pp.player._x) < Math.abs(op.collidingWith._x - pp.player._x)) {
if (dxRelativePlayer == -1) {
if (op.collidingWith._x > op._x) {
dx = -MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
dx = MV_TOPSPEED;
}
}
if (dxRelativePlayer == 0) {
if (op.collidingWith._x > op._x) {
op._x = op._x - MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
op._x = op._x + MV_TOPSPEED;
}
}
}
if (Math.abs(op._x - pp.player._x) > Math.abs(op.collidingWith._x - pp.player._x)) {
if (dxRelativePlayer == 1) {
if (op._x < op.collidingWith._x) {
dx = -MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
dx = MV_TOPSPEED;
}
}
if (dxRelativePlayer == 0) {
if (op._x < op.collidingWith._x) {
op._x = op._x - MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
op._x = op._x + MV_TOPSPEED;
}
}
}
}
if (dead) {
grounded = false;
}
winceTimer++;
if (Math.abs(dx - 1) < 1) {
dx = 0;
}
op._x = op._x + dx;
op._y = op._y + dy;
if (!grounded) {
dy = dy + MV_GRAVITY;
if (dy > MV_TVELOCITY) {
dy = MV_TVELOCITY;
}
}
if ((op._y >= MV_GROUND) && (!dead)) {
op._y = MV_GROUND;
grounded = true;
if (dy == MV_TVELOCITY) {
dy = -MV_BOUNCE;
grounded = false;
winceTimer = 0;
} else {
dy = 0;
}
op._rotation = 0;
}
expireTimer++;
if (expireTimer == EXPIRATION) {
dead = true;
grounded = false;
}
if (op._y > MV_DELETEAT) {
destroy();
}
if (grounded) {
if (dx > 0) {
dx = dx - MV_FRICTION;
}
if (dx < 0) {
dx = dx + MV_FRICTION;
}
}
if (op._x < 0) {
op._x = op._x + MV_TOPSPEED;
}
if (op._x > pp.M_WIDTH) {
op._x = op._x - MV_TOPSPEED;
}
}
}
Instance of Symbol 32 MovieClip "code" in Symbol 305 MovieClip [bluePresentTall] Frame 1
onClipEvent (load) {
function destroy() {
bm.battleManager.unRegister(op);
op.removeMovieClip();
}
function getHit(x, y, type, dmg) {
if (type != "throw") {
if (pp.player._x > this._x) {
dx = -x;
}
if (pp.player._x <= this._x) {
dx = x;
}
dy = y * -1;
grounded = false;
splashPoint._x = op._x;
splashPoint._y = op._y - 20;
pp.attachMovie("FX_Splash", "splash" + pp.getNextHighestDepth(), pp.getNextHighestDepth(), splashPoint);
}
if (type == "throw") {
gettingThrown = true;
}
if (type == "mid") {
pp.jukebox.punch1.start();
}
if (type == "low") {
pp.jukebox.punch2.start();
}
if (type == "upper") {
pp.jukebox.punch3.start();
}
if (type == "spinUpper") {
pp.jukebox.punch3.start();
}
if (type == "flyBack") {
pp.jukebox.punch3.start();
}
if (type == "smackDown") {
type = "upper";
}
hp = hp - dmg;
bm.battleManager.score = bm.battleManager.score + Math.round(dmg / 10);
if (hp <= 0) {
hp = 0;
bm.battleManager.score = bm.battleManager.score + POINTS;
dead = true;
pp.attachMovie("sanityRecover", "sanRecover", 60);
pp.player.sanityChange(50);
pp.sanRecover._x = op._x;
pp.sanRecover._y = op._y;
dy = -40;
dx = 15 * (pp.player._xscale / 100);
}
}
op.stop();
bm = _parent._parent._parent;
pp = _parent._parent;
splashPoint = new Object();
op = _parent;
hp = 20 * pp.hpScale;
dead = false;
rotateSpeed = 30;
hitResult = 0;
grounded = false;
POINTS = 25;
MV_GROUND = pp.GROUND;
MV_GRAVITY = pp.GRAVITY;
MV_TVELOCITY = pp.TVELOCITY;
MV_DELETEAT = pp.DELETEAT;
MV_FRICTION = 2;
MV_ROTOFF = 180;
MV_BOUNCE = 20;
MV_TOPSPEED = 6;
MV_COLLISION_TOL = 40;
op.collidingWith;
op.attacking = false;
op.kbx = 5;
op.kby = 22;
op.damage = 0;
op.attType = "upper";
dx = 0;
dy = 40;
WINCE_DELAY = 4;
EXPIRATION = 30 * pp.OBJECT_DELAY;
expireTimer = 0;
winceTimer = 100;
gettingThrown = false;
}
onClipEvent (enterFrame) {
if (pp.gamePause == false) {
animstate = "stand";
if ((!grounded) && (!dead)) {
op._rotation = op._rotation + rotateSpeed;
}
if (wincing) {
animstate = "wince";
}
if (hp <= 0) {
animstate = "dead";
}
op.gotoAndStop(animstate);
hitResult = -1;
i = 0;
while (i < pp.damageObjects.length) {
hitTarget = eval (((pp + ".") + pp.damageObjects[i]) + pp.damageObjPath[i]);
if (op.hitTest(hitTarget) && (hitTarget.attacking == true)) {
if (!wincing) {
hitResult = i;
}
}
i++;
}
if (hitResult > -1) {
var t = eval ((pp + ".") + pp.damageObjects[hitResult]);
getHit(t.kbx, t.kby, t.attType, t.damage);
winceTimer = 0;
wincing = true;
} else if (grounded && (winceTimer >= WINCE_DELAY)) {
wincing = false;
}
if (gettingThrown) {
dx = 0;
dy = 0;
op._x = pp.player._x + pp.player.throwGuide._x;
op._y = pp.player._y + pp.player.throwGuide._y;
op._rotation = pp.player.throwGuide._rotation * (100 / pp.player._xscale);
if (pp.player._currentframe == pp.player.FT_THROWRELEASE) {
op._rotation = 180;
getHit(-10, -30, "smackDown", 0);
grounded = false;
gettingThrown = false;
}
}
if (Math.abs(pp.player._x - op._x) > Math.abs(pp.player._x - (op._x + dx))) {
dxRelativePlayer = -1;
}
if (Math.abs(pp.player._x - op._x) < Math.abs(pp.player._x - (op._x + dx))) {
dxRelativePlayer = 1;
}
if (Math.abs(pp.player._x - op._x) == Math.abs(pp.player._x - (op._x + dx))) {
dxRelativePlayer = 0;
}
if (op.collidingWith != null) {
if (Math.abs(op._x - pp.player._x) < Math.abs(op.collidingWith._x - pp.player._x)) {
if (dxRelativePlayer == -1) {
if (op.collidingWith._x > op._x) {
dx = -MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
dx = MV_TOPSPEED;
}
}
if (dxRelativePlayer == 0) {
if (op.collidingWith._x > op._x) {
op._x = op._x - MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
op._x = op._x + MV_TOPSPEED;
}
}
}
if (Math.abs(op._x - pp.player._x) > Math.abs(op.collidingWith._x - pp.player._x)) {
if (dxRelativePlayer == 1) {
if (op._x < op.collidingWith._x) {
dx = -MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
dx = MV_TOPSPEED;
}
}
if (dxRelativePlayer == 0) {
if (op._x < op.collidingWith._x) {
op._x = op._x - MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
op._x = op._x + MV_TOPSPEED;
}
}
}
}
if (dead) {
grounded = false;
}
winceTimer++;
if (Math.abs(dx - 1) < 1) {
dx = 0;
}
op._x = op._x + dx;
op._y = op._y + dy;
if (!grounded) {
dy = dy + MV_GRAVITY;
if (dy > MV_TVELOCITY) {
dy = MV_TVELOCITY;
}
}
if ((op._y >= MV_GROUND) && (!dead)) {
op._y = MV_GROUND;
grounded = true;
if (dy == MV_TVELOCITY) {
dy = -MV_BOUNCE;
grounded = false;
winceTimer = 0;
} else {
dy = 0;
}
op._rotation = 0;
}
expireTimer++;
if (expireTimer == EXPIRATION) {
dead = true;
grounded = false;
}
if (op._y > MV_DELETEAT) {
destroy();
}
if (grounded) {
if (dx > 0) {
dx = dx - MV_FRICTION;
}
if (dx < 0) {
dx = dx + MV_FRICTION;
}
}
if (op._x < 0) {
op._x = op._x + MV_TOPSPEED;
}
if (op._x > pp.M_WIDTH) {
op._x = op._x - MV_TOPSPEED;
}
}
}
Instance of Symbol 32 MovieClip "code" in Symbol 308 MovieClip [bluePresent] Frame 1
onClipEvent (load) {
function destroy() {
bm.battleManager.unRegister(op);
op.removeMovieClip();
}
function getHit(x, y, type, dmg) {
if (type != "throw") {
if (pp.player._x > this._x) {
dx = -x;
}
if (pp.player._x <= this._x) {
dx = x;
}
dy = y * -1;
grounded = false;
splashPoint._x = op._x;
splashPoint._y = op._y - 20;
pp.attachMovie("FX_Splash", "splash" + pp.getNextHighestDepth(), pp.getNextHighestDepth(), splashPoint);
}
if (type == "throw") {
gettingThrown = true;
}
if (type == "mid") {
pp.jukebox.punch1.start();
}
if (type == "low") {
pp.jukebox.punch2.start();
}
if (type == "upper") {
pp.jukebox.punch3.start();
}
if (type == "spinUpper") {
pp.jukebox.punch3.start();
}
if (type == "flyBack") {
pp.jukebox.punch3.start();
}
if (type == "smackDown") {
type = "upper";
}
hp = hp - dmg;
bm.battleManager.score = bm.battleManager.score + Math.round(dmg / 10);
if (hp <= 0) {
hp = 0;
bm.battleManager.score = bm.battleManager.score + POINTS;
dead = true;
pp.attachMovie("sanityRecover", "sanRecover", 60);
pp.player.sanityChange(25);
pp.sanRecover._x = op._x;
pp.sanRecover._y = op._y;
dy = -40;
dx = 15 * (pp.player._xscale / 100);
}
}
op.stop();
bm = _parent._parent._parent;
pp = _parent._parent;
splashPoint = new Object();
op = _parent;
hp = 20 * pp.hpScale;
dead = false;
rotateSpeed = 30;
hitResult = 0;
grounded = false;
POINTS = 25;
MV_GROUND = pp.GROUND;
MV_GRAVITY = pp.GRAVITY;
MV_TVELOCITY = pp.TVELOCITY;
MV_DELETEAT = pp.DELETEAT;
MV_FRICTION = 2;
MV_ROTOFF = 180;
MV_BOUNCE = 20;
MV_TOPSPEED = 6;
MV_COLLISION_TOL = 40;
op.collidingWith;
op.attacking = false;
op.kbx = 5;
op.kby = 22;
op.damage = 0;
op.attType = "upper";
dx = 0;
dy = 40;
WINCE_DELAY = 4;
EXPIRATION = 30 * pp.OBJECT_DELAY;
expireTimer = 0;
winceTimer = 100;
gettingThrown = false;
}
onClipEvent (enterFrame) {
if (pp.gamePause == false) {
animstate = "stand";
if ((!grounded) && (!dead)) {
op._rotation = op._rotation + rotateSpeed;
}
if (wincing) {
animstate = "wince";
}
if (hp <= 0) {
animstate = "dead";
}
op.gotoAndStop(animstate);
hitResult = -1;
i = 0;
while (i < pp.damageObjects.length) {
hitTarget = eval (((pp + ".") + pp.damageObjects[i]) + pp.damageObjPath[i]);
if (op.hitTest(hitTarget) && (hitTarget.attacking == true)) {
if (!wincing) {
hitResult = i;
}
}
i++;
}
if (hitResult > -1) {
var t = eval ((pp + ".") + pp.damageObjects[hitResult]);
getHit(t.kbx, t.kby, t.attType, t.damage);
winceTimer = 0;
wincing = true;
} else if (grounded && (winceTimer >= WINCE_DELAY)) {
wincing = false;
}
if (gettingThrown) {
dx = 0;
dy = 0;
op._x = pp.player._x + pp.player.throwGuide._x;
op._y = pp.player._y + pp.player.throwGuide._y;
op._rotation = pp.player.throwGuide._rotation * (100 / pp.player._xscale);
if (pp.player._currentframe == pp.player.FT_THROWRELEASE) {
op._rotation = 180;
getHit(-10, -30, "smackDown", 0);
grounded = false;
gettingThrown = false;
}
}
if (Math.abs(pp.player._x - op._x) > Math.abs(pp.player._x - (op._x + dx))) {
dxRelativePlayer = -1;
}
if (Math.abs(pp.player._x - op._x) < Math.abs(pp.player._x - (op._x + dx))) {
dxRelativePlayer = 1;
}
if (Math.abs(pp.player._x - op._x) == Math.abs(pp.player._x - (op._x + dx))) {
dxRelativePlayer = 0;
}
if (op.collidingWith != null) {
if (Math.abs(op._x - pp.player._x) < Math.abs(op.collidingWith._x - pp.player._x)) {
if (dxRelativePlayer == -1) {
if (op.collidingWith._x > op._x) {
dx = -MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
dx = MV_TOPSPEED;
}
}
if (dxRelativePlayer == 0) {
if (op.collidingWith._x > op._x) {
op._x = op._x - MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
op._x = op._x + MV_TOPSPEED;
}
}
}
if (Math.abs(op._x - pp.player._x) > Math.abs(op.collidingWith._x - pp.player._x)) {
if (dxRelativePlayer == 1) {
if (op._x < op.collidingWith._x) {
dx = -MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
dx = MV_TOPSPEED;
}
}
if (dxRelativePlayer == 0) {
if (op._x < op.collidingWith._x) {
op._x = op._x - MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
op._x = op._x + MV_TOPSPEED;
}
}
}
}
if (dead) {
grounded = false;
}
winceTimer++;
if (Math.abs(dx - 1) < 1) {
dx = 0;
}
op._x = op._x + dx;
op._y = op._y + dy;
if (!grounded) {
dy = dy + MV_GRAVITY;
if (dy > MV_TVELOCITY) {
dy = MV_TVELOCITY;
}
}
if ((op._y >= MV_GROUND) && (!dead)) {
op._y = MV_GROUND;
grounded = true;
if (dy == MV_TVELOCITY) {
dy = -MV_BOUNCE;
grounded = false;
winceTimer = 0;
} else {
dy = 0;
}
op._rotation = 0;
}
expireTimer++;
if (expireTimer == EXPIRATION) {
dead = true;
grounded = false;
}
if (op._y > MV_DELETEAT) {
destroy();
}
if (grounded) {
if (dx > 0) {
dx = dx - MV_FRICTION;
}
if (dx < 0) {
dx = dx + MV_FRICTION;
}
}
if (op._x < 0) {
op._x = op._x + MV_TOPSPEED;
}
if (op._x > pp.M_WIDTH) {
op._x = op._x - MV_TOPSPEED;
}
}
}
Instance of Symbol 32 MovieClip "code" in Symbol 309 MovieClip [cookies] Frame 1
onClipEvent (load) {
function destroy() {
bm.battleManager.unRegister(op);
op.removeMovieClip();
}
function getHit(x, y, type, dmg) {
if (type != "throw") {
if (pp.player._x > this._x) {
dx = -x;
}
if (pp.player._x <= this._x) {
dx = x;
}
dy = y * -1;
grounded = false;
splashPoint._x = op._x;
splashPoint._y = op._y - 20;
pp.attachMovie("FX_Splash", "splash" + pp.getNextHighestDepth(), pp.getNextHighestDepth(), splashPoint);
}
if (type == "throw") {
gettingThrown = true;
}
if (type == "mid") {
pp.jukebox.punch1.start();
}
if (type == "low") {
pp.jukebox.punch2.start();
}
if (type == "upper") {
pp.jukebox.punch3.start();
}
if (type == "spinUpper") {
pp.jukebox.punch3.start();
}
if (type == "flyBack") {
pp.jukebox.punch3.start();
}
if (type == "smackDown") {
type = "upper";
}
hp = hp - dmg;
bm.battleManager.score = bm.battleManager.score + Math.round(dmg / 10);
if (hp <= 0) {
hp = 0;
bm.battleManager.score = bm.battleManager.score + POINTS;
dead = true;
if (!pp.player.demonMode) {
pp.attachMovie("rageRecover", "ragRecover", 60);
pp.player.rage = pp.player.rage + Math.round(POINTS * pp.RAGE_MODIFIER);
pp.ragRecover._x = op._x;
pp.ragRecover._y = op._y;
}
dy = -40;
dx = 15 * (pp.player._xscale / 100);
}
}
op.stop();
bm = _parent._parent._parent;
pp = _parent._parent;
op = _parent;
splashPoint = new Object();
hp = 30 * pp.hpScale;
dead = false;
rotateSpeed = 30;
hitResult = 0;
grounded = false;
POINTS = 73;
MV_GROUND = pp.GROUND;
MV_GRAVITY = pp.GRAVITY;
MV_TVELOCITY = pp.TVELOCITY;
MV_DELETEAT = pp.DELETEAT;
MV_FRICTION = 2;
MV_ROTOFF = 180;
MV_BOUNCE = 20;
MV_TOPSPEED = 6;
MV_COLLISION_TOL = 40;
op.collidingWith;
op.attacking = false;
op.kbx = 5;
op.kby = 22;
op.damage = 0;
op.attType = "upper";
dx = 0;
dy = 40;
WINCE_DELAY = 4;
winceTimer = 100;
EXPIRATION = 30 * pp.OBJECT_DELAY;
expireTimer = 0;
gettingThrown = false;
}
onClipEvent (enterFrame) {
if (pp.gamePause == false) {
animstate = "stand";
if ((!grounded) && (!dead)) {
op._rotation = op._rotation + rotateSpeed;
}
if (wincing) {
animstate = "wince";
}
if (hp <= 0) {
animstate = "dead";
}
op.gotoAndStop(animstate);
hitResult = -1;
i = 0;
while (i < pp.damageObjects.length) {
hitTarget = eval (((pp + ".") + pp.damageObjects[i]) + pp.damageObjPath[i]);
if (op.hitTest(hitTarget) && (hitTarget.attacking == true)) {
if (!wincing) {
hitResult = i;
}
}
i++;
}
if (hitResult > -1) {
var t = eval ((pp + ".") + pp.damageObjects[hitResult]);
getHit(t.kbx, t.kby, t.attType, t.damage);
winceTimer = 0;
wincing = true;
} else if (grounded && (winceTimer >= WINCE_DELAY)) {
wincing = false;
}
if (gettingThrown) {
dx = 0;
dy = 0;
op._x = pp.player._x + pp.player.throwGuide._x;
op._y = pp.player._y + pp.player.throwGuide._y;
op._rotation = pp.player.throwGuide._rotation * (100 / pp.player._xscale);
if (pp.player._currentframe == pp.player.FT_THROWRELEASE) {
op._rotation = 180;
getHit(-10, -30, "smackDown", 0);
grounded = false;
gettingThrown = false;
}
}
if (Math.abs(pp.player._x - op._x) > Math.abs(pp.player._x - (op._x + dx))) {
dxRelativePlayer = -1;
}
if (Math.abs(pp.player._x - op._x) < Math.abs(pp.player._x - (op._x + dx))) {
dxRelativePlayer = 1;
}
if (Math.abs(pp.player._x - op._x) == Math.abs(pp.player._x - (op._x + dx))) {
dxRelativePlayer = 0;
}
if (op.collidingWith != null) {
if (Math.abs(op._x - pp.player._x) < Math.abs(op.collidingWith._x - pp.player._x)) {
if (dxRelativePlayer == -1) {
if (op.collidingWith._x > op._x) {
dx = -MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
dx = MV_TOPSPEED;
}
}
if (dxRelativePlayer == 0) {
if (op.collidingWith._x > op._x) {
op._x = op._x - MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
op._x = op._x + MV_TOPSPEED;
}
}
}
if (Math.abs(op._x - pp.player._x) > Math.abs(op.collidingWith._x - pp.player._x)) {
if (dxRelativePlayer == 1) {
if (op._x < op.collidingWith._x) {
dx = -MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
dx = MV_TOPSPEED;
}
}
if (dxRelativePlayer == 0) {
if (op._x < op.collidingWith._x) {
op._x = op._x - MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
op._x = op._x + MV_TOPSPEED;
}
}
}
}
if (dead) {
grounded = false;
}
winceTimer++;
if (Math.abs(dx - 1) < 1) {
dx = 0;
}
op._x = op._x + dx;
op._y = op._y + dy;
if (!grounded) {
dy = dy + MV_GRAVITY;
if (dy > MV_TVELOCITY) {
dy = MV_TVELOCITY;
}
}
if ((op._y >= MV_GROUND) && (!dead)) {
op._y = MV_GROUND;
grounded = true;
if (dy == MV_TVELOCITY) {
dy = -MV_BOUNCE;
grounded = false;
winceTimer = 0;
} else {
dy = 0;
}
op._rotation = 0;
}
expireTimer++;
if (expireTimer == EXPIRATION) {
dead = true;
grounded = false;
}
if (op._y > MV_DELETEAT) {
destroy();
}
if (grounded) {
if (dx > 0) {
dx = dx - MV_FRICTION;
}
if (dx < 0) {
dx = dx + MV_FRICTION;
}
}
if (op._x < 0) {
op._x = op._x + MV_TOPSPEED;
}
if (op._x > pp.M_WIDTH) {
op._x = op._x - MV_TOPSPEED;
}
}
}
Symbol 315 MovieClip Frame 38
stop();
Instance of Symbol 32 MovieClip "code" in Symbol 316 MovieClip [cake] Frame 1
onClipEvent (load) {
function destroy() {
bm.battleManager.unRegister(op);
op.removeMovieClip();
}
function getHit(x, y, type, dmg) {
if (type != "throw") {
if (pp.player._x > this._x) {
dx = -x;
}
if (pp.player._x <= this._x) {
dx = x;
}
dy = y * -1;
grounded = false;
splashPoint._x = op._x;
splashPoint._y = op._y - 20;
pp.attachMovie("FX_Splash", "splash" + pp.getNextHighestDepth(), pp.getNextHighestDepth(), splashPoint);
}
if (type == "throw") {
gettingThrown = true;
}
if (type == "mid") {
pp.jukebox.punch1.start();
}
if (type == "low") {
pp.jukebox.punch2.start();
}
if (type == "upper") {
pp.jukebox.punch3.start();
}
if (type == "spinUpper") {
pp.jukebox.punch3.start();
}
if (type == "flyBack") {
pp.jukebox.punch3.start();
}
if (type == "smackDown") {
type = "upper";
}
hp = hp - dmg;
bm.battleManager.score = bm.battleManager.score + Math.round(dmg / 10);
if (hp <= 0) {
hp = 0;
bm.battleManager.score = bm.battleManager.score + POINTS;
dead = true;
if (!pp.player.demonMode) {
pp.attachMovie("rageRecover", "ragRecover", 60);
pp.player.rage = pp.player.rage + Math.round(POINTS * pp.RAGE_MODIFIER);
pp.ragRecover._x = op._x;
pp.ragRecover._y = op._y;
}
dy = -40;
dx = 15 * (pp.player._xscale / 100);
}
}
op.stop();
bm = _parent._parent._parent;
pp = _parent._parent;
op = _parent;
splashPoint = new Object();
hp = 50 * pp.hpScale;
dead = false;
rotateSpeed = 30;
hitResult = 0;
grounded = false;
POINTS = 200;
MV_GROUND = pp.GROUND;
MV_GRAVITY = pp.GRAVITY;
MV_TVELOCITY = pp.TVELOCITY;
MV_DELETEAT = pp.DELETEAT;
MV_FRICTION = 2;
MV_ROTOFF = 180;
MV_BOUNCE = 20;
MV_TOPSPEED = 6;
MV_COLLISION_TOL = 40;
op.collidingWith;
op.attacking = false;
op.kbx = 5;
op.kby = 22;
op.damage = 0;
op.attType = "upper";
dx = 0;
dy = 40;
WINCE_DELAY = 4;
winceTimer = 100;
EXPIRATION = 30 * pp.OBJECT_DELAY;
expireTimer = 0;
gettingThrown = false;
}
onClipEvent (enterFrame) {
if (pp.gamePause == false) {
animstate = "stand";
if ((!grounded) && (!dead)) {
op._rotation = op._rotation + rotateSpeed;
}
if (wincing) {
animstate = "wince";
}
if (hp <= 0) {
animstate = "dead";
}
op.gotoAndStop(animstate);
hitResult = -1;
i = 0;
while (i < pp.damageObjects.length) {
hitTarget = eval (((pp + ".") + pp.damageObjects[i]) + pp.damageObjPath[i]);
if (op.hitTest(hitTarget) && (hitTarget.attacking == true)) {
if (!wincing) {
hitResult = i;
}
}
i++;
}
if (hitResult > -1) {
var t = eval ((pp + ".") + pp.damageObjects[hitResult]);
getHit(t.kbx, t.kby, t.attType, t.damage);
winceTimer = 0;
wincing = true;
} else if (grounded && (winceTimer >= WINCE_DELAY)) {
wincing = false;
}
if (gettingThrown) {
dx = 0;
dy = 0;
op._x = pp.player._x + pp.player.throwGuide._x;
op._y = pp.player._y + pp.player.throwGuide._y;
op._rotation = pp.player.throwGuide._rotation * (100 / pp.player._xscale);
if (pp.player._currentframe == pp.player.FT_THROWRELEASE) {
op._rotation = 180;
getHit(-10, -30, "smackDown", 0);
grounded = false;
gettingThrown = false;
}
}
if (Math.abs(pp.player._x - op._x) > Math.abs(pp.player._x - (op._x + dx))) {
dxRelativePlayer = -1;
}
if (Math.abs(pp.player._x - op._x) < Math.abs(pp.player._x - (op._x + dx))) {
dxRelativePlayer = 1;
}
if (Math.abs(pp.player._x - op._x) == Math.abs(pp.player._x - (op._x + dx))) {
dxRelativePlayer = 0;
}
if (op.collidingWith != null) {
if (Math.abs(op._x - pp.player._x) < Math.abs(op.collidingWith._x - pp.player._x)) {
if (dxRelativePlayer == -1) {
if (op.collidingWith._x > op._x) {
dx = -MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
dx = MV_TOPSPEED;
}
}
if (dxRelativePlayer == 0) {
if (op.collidingWith._x > op._x) {
op._x = op._x - MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
op._x = op._x + MV_TOPSPEED;
}
}
}
if (Math.abs(op._x - pp.player._x) > Math.abs(op.collidingWith._x - pp.player._x)) {
if (dxRelativePlayer == 1) {
if (op._x < op.collidingWith._x) {
dx = -MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
dx = MV_TOPSPEED;
}
}
if (dxRelativePlayer == 0) {
if (op._x < op.collidingWith._x) {
op._x = op._x - MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
op._x = op._x + MV_TOPSPEED;
}
}
}
}
if (dead) {
grounded = false;
}
winceTimer++;
if (Math.abs(dx - 1) < 1) {
dx = 0;
}
op._x = op._x + dx;
op._y = op._y + dy;
if (!grounded) {
dy = dy + MV_GRAVITY;
if (dy > MV_TVELOCITY) {
dy = MV_TVELOCITY;
}
}
if ((op._y >= MV_GROUND) && (!dead)) {
op._y = MV_GROUND;
grounded = true;
if (dy == MV_TVELOCITY) {
dy = -MV_BOUNCE;
grounded = false;
winceTimer = 0;
} else {
dy = 0;
}
op._rotation = 0;
}
expireTimer++;
if (expireTimer == EXPIRATION) {
dead = true;
grounded = false;
}
if (op._y > MV_DELETEAT) {
destroy();
}
if (grounded) {
if (dx > 0) {
dx = dx - MV_FRICTION;
}
if (dx < 0) {
dx = dx + MV_FRICTION;
}
}
if (op._x < 0) {
op._x = op._x + MV_TOPSPEED;
}
if (op._x > pp.M_WIDTH) {
op._x = op._x - MV_TOPSPEED;
}
}
}
Symbol 328 MovieClip Frame 32
stop();
Instance of Symbol 32 MovieClip "code" in Symbol 329 MovieClip [jackBox] Frame 1
onClipEvent (load) {
function destroy() {
bm.battleManager.unRegister(op);
op.removeMovieClip();
}
function getHit(x, y, type, dmg) {
if (type != "throw") {
if (pp.player._x > this._x) {
dx = -x;
}
if (pp.player._x <= this._x) {
dx = x;
}
dy = y * -1;
grounded = false;
splashPoint._x = op._x;
splashPoint._y = op._y - 20;
pp.attachMovie("FX_Splash", "splash" + pp.getNextHighestDepth(), pp.getNextHighestDepth(), splashPoint);
}
if (type == "throw") {
gettingThrown = true;
}
if (type == "mid") {
pp.jukebox.punch1.start();
}
if (type == "low") {
pp.jukebox.punch2.start();
}
if (type == "upper") {
pp.jukebox.punch3.start();
}
if (type == "spinUpper") {
pp.jukebox.punch3.start();
}
if (type == "flyBack") {
pp.jukebox.punch3.start();
}
if (type == "smackDown") {
type = "upper";
}
hp = hp - dmg;
bm.battleManager.score = bm.battleManager.score + Math.round(dmg / 10);
if (hp <= 0) {
hp = 0;
bm.battleManager.score = bm.battleManager.score + POINTS;
dead = true;
if (!pp.player.demonMode) {
pp.attachMovie("rageRecover", "ragRecover", 60);
pp.player.rage = pp.player.rage + Math.round(POINTS * pp.RAGE_MODIFIER);
pp.ragRecover._x = op._x;
pp.ragRecover._y = op._y;
}
dy = -40;
dx = 15 * (pp.player._xscale / 100);
}
}
function attackNow() {
if (!dead) {
if (!wincing) {
if ((op._x > 0) && (op._x < pp.M_WIDTH)) {
attacking = true;
pp.player.sanityChange(-attackPwr);
pp.jukebox.jack_n_box.start();
}
}
}
}
op.stop();
bm = _parent._parent._parent;
pp = _parent._parent;
op = _parent;
splashPoint = new Object();
hp = 20 * pp.hpScale;
dead = false;
rotateSpeed = 30;
hitResult = 0;
grounded = false;
attackPwr = 4 * pp.attackScale;
POINTS = 20;
MV_GROUND = pp.GROUND;
MV_GRAVITY = pp.GRAVITY;
MV_TVELOCITY = pp.TVELOCITY;
MV_DELETEAT = pp.DELETEAT;
MV_FRICTION = 2;
MV_ROTOFF = 180;
MV_BOUNCE = 20;
MV_TOPSPEED = 6;
MV_COLLISION_TOL = 40;
op.collidingWith;
op.attacking = false;
op.kbx = 5;
op.kby = 22;
op.damage = 0;
op.attType = "upper";
dx = 0;
dy = 40;
WINCE_DELAY = 4;
winceTimer = 100;
EXPIRATION = 10 * pp.OBJECT_DELAY;
expireTimer = 0;
POP_TIME = 80;
popTimer = 0;
gettingThrown = false;
}
onClipEvent (enterFrame) {
if (pp.gamePause == false) {
if (popTimer < POP_TIME) {
animstate = "stand";
} else {
animstate = "pop";
}
if ((!grounded) && (!dead)) {
op._rotation = op._rotation + rotateSpeed;
}
if (wincing) {
animstate = "wince";
}
if (hp <= 0) {
animstate = "dead";
}
op.gotoAndStop(animstate);
hitResult = -1;
i = 0;
while (i < pp.damageObjects.length) {
hitTarget = eval (((pp + ".") + pp.damageObjects[i]) + pp.damageObjPath[i]);
if (op.hitTest(hitTarget) && (hitTarget.attacking == true)) {
if (!wincing) {
hitResult = i;
}
}
i++;
}
if (hitResult > -1) {
var t = eval ((pp + ".") + pp.damageObjects[hitResult]);
getHit(t.kbx, t.kby, t.attType, t.damage);
winceTimer = 0;
wincing = true;
} else if (grounded && (winceTimer >= WINCE_DELAY)) {
wincing = false;
}
if (gettingThrown) {
dx = 0;
dy = 0;
op._x = pp.player._x + pp.player.throwGuide._x;
op._y = pp.player._y + pp.player.throwGuide._y;
op._rotation = pp.player.throwGuide._rotation * (100 / pp.player._xscale);
if (pp.player._currentframe == pp.player.FT_THROWRELEASE) {
op._rotation = 180;
getHit(-10, -30, "smackDown", 0);
grounded = false;
gettingThrown = false;
}
}
if (Math.abs(pp.player._x - op._x) > Math.abs(pp.player._x - (op._x + dx))) {
dxRelativePlayer = -1;
}
if (Math.abs(pp.player._x - op._x) < Math.abs(pp.player._x - (op._x + dx))) {
dxRelativePlayer = 1;
}
if (Math.abs(pp.player._x - op._x) == Math.abs(pp.player._x - (op._x + dx))) {
dxRelativePlayer = 0;
}
if (op.collidingWith != null) {
if (Math.abs(op._x - pp.player._x) < Math.abs(op.collidingWith._x - pp.player._x)) {
if (dxRelativePlayer == -1) {
if (op.collidingWith._x > op._x) {
dx = -MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
dx = MV_TOPSPEED;
}
}
if (dxRelativePlayer == 0) {
if (op.collidingWith._x > op._x) {
op._x = op._x - MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
op._x = op._x + MV_TOPSPEED;
}
}
}
if (Math.abs(op._x - pp.player._x) > Math.abs(op.collidingWith._x - pp.player._x)) {
if (dxRelativePlayer == 1) {
if (op._x < op.collidingWith._x) {
dx = -MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
dx = MV_TOPSPEED;
}
}
if (dxRelativePlayer == 0) {
if (op._x < op.collidingWith._x) {
op._x = op._x - MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
op._x = op._x + MV_TOPSPEED;
}
}
}
}
if (dead) {
grounded = false;
}
winceTimer++;
if (Math.abs(dx - 1) < 1) {
dx = 0;
}
op._x = op._x + dx;
op._y = op._y + dy;
if (!grounded) {
dy = dy + MV_GRAVITY;
if (dy > MV_TVELOCITY) {
dy = MV_TVELOCITY;
}
}
if ((op._y >= MV_GROUND) && (!dead)) {
op._y = MV_GROUND;
grounded = true;
if (dy == MV_TVELOCITY) {
dy = -MV_BOUNCE;
grounded = false;
winceTimer = 0;
} else {
dy = 0;
}
op._rotation = 0;
}
if (popTimer < POP_TIME) {
popTimer++;
}
if (popTimer == (POP_TIME - 1)) {
attackNow();
}
if (popTimer == POP_TIME) {
expireTimer++;
}
if (expireTimer == EXPIRATION) {
dead = true;
grounded = false;
}
if (op._y > MV_DELETEAT) {
destroy();
}
if (grounded) {
if (dx > 0) {
dx = dx - MV_FRICTION;
}
if (dx < 0) {
dx = dx + MV_FRICTION;
}
}
if (op._x < 0) {
op._x = op._x + MV_TOPSPEED;
}
if (op._x > pp.M_WIDTH) {
op._x = op._x - MV_TOPSPEED;
}
}
}
Instance of Symbol 32 MovieClip "code" in Symbol 332 MovieClip [present] Frame 1
onClipEvent (load) {
function destroy() {
bm.battleManager.unRegister(op);
op.removeMovieClip();
}
function getHit(x, y, type, dmg) {
if (type != "throw") {
if (pp.player._x > this._x) {
dx = -x;
}
if (pp.player._x <= this._x) {
dx = x;
}
dy = y * -1;
grounded = false;
splashPoint._x = op._x;
splashPoint._y = op._y - 20;
pp.attachMovie("FX_Splash", "splash" + pp.getNextHighestDepth(), pp.getNextHighestDepth(), splashPoint);
}
if (type == "throw") {
gettingThrown = true;
}
if (type == "mid") {
pp.jukebox.punch1.start();
}
if (type == "low") {
pp.jukebox.punch2.start();
}
if (type == "upper") {
pp.jukebox.punch3.start();
}
if (type == "spinUpper") {
pp.jukebox.punch3.start();
}
if (type == "flyBack") {
pp.jukebox.punch3.start();
}
if (type == "smackDown") {
type = "upper";
}
hp = hp - dmg;
bm.battleManager.score = bm.battleManager.score + Math.round(dmg / 10);
if (hp <= 0) {
hp = 0;
bm.battleManager.score = bm.battleManager.score + POINTS;
dead = true;
if (!pp.player.demonMode) {
pp.attachMovie("rageRecover", "ragRecover", 60);
pp.player.rage = pp.player.rage + Math.round(POINTS * pp.RAGE_MODIFIER);
pp.ragRecover._x = op._x;
pp.ragRecover._y = op._y;
}
dy = -40;
dx = 15 * (pp.player._xscale / 100);
}
}
op.stop();
bm = _parent._parent._parent;
pp = _parent._parent;
op = _parent;
splashPoint = new Object();
hp = 20 * pp.hpScale;
dead = false;
rotateSpeed = 30;
hitResult = 0;
grounded = false;
POINTS = 100;
MV_GROUND = pp.GROUND;
MV_GRAVITY = pp.GRAVITY;
MV_TVELOCITY = pp.TVELOCITY;
MV_DELETEAT = pp.DELETEAT;
MV_FRICTION = 2;
MV_ROTOFF = 180;
MV_BOUNCE = 20;
MV_TOPSPEED = 6;
MV_COLLISION_TOL = 40;
op.collidingWith;
op.attacking = false;
op.kbx = 5;
op.kby = 22;
op.damage = 0;
op.attType = "upper";
dx = 0;
dy = 40;
WINCE_DELAY = 4;
winceTimer = 100;
EXPIRATION = 30 * pp.OBJECT_DELAY;
expireTimer = 0;
gettingThrown = false;
}
onClipEvent (enterFrame) {
if (pp.gamePause == false) {
animstate = "stand";
if ((!grounded) && (!dead)) {
op._rotation = op._rotation + rotateSpeed;
}
if (wincing) {
animstate = "wince";
}
if (hp <= 0) {
animstate = "dead";
}
op.gotoAndStop(animstate);
hitResult = -1;
i = 0;
while (i < pp.damageObjects.length) {
hitTarget = eval (((pp + ".") + pp.damageObjects[i]) + pp.damageObjPath[i]);
if (op.hitTest(hitTarget) && (hitTarget.attacking == true)) {
if (!wincing) {
hitResult = i;
}
}
i++;
}
if (hitResult > -1) {
var t = eval ((pp + ".") + pp.damageObjects[hitResult]);
getHit(t.kbx, t.kby, t.attType, t.damage);
winceTimer = 0;
wincing = true;
} else if (grounded && (winceTimer >= WINCE_DELAY)) {
wincing = false;
}
if (gettingThrown) {
dx = 0;
dy = 0;
op._x = pp.player._x + pp.player.throwGuide._x;
op._y = pp.player._y + pp.player.throwGuide._y;
op._rotation = pp.player.throwGuide._rotation * (100 / pp.player._xscale);
if (pp.player._currentframe == pp.player.FT_THROWRELEASE) {
op._rotation = 180;
getHit(-10, -30, "smackDown", 0);
grounded = false;
gettingThrown = false;
}
}
if (Math.abs(pp.player._x - op._x) > Math.abs(pp.player._x - (op._x + dx))) {
dxRelativePlayer = -1;
}
if (Math.abs(pp.player._x - op._x) < Math.abs(pp.player._x - (op._x + dx))) {
dxRelativePlayer = 1;
}
if (Math.abs(pp.player._x - op._x) == Math.abs(pp.player._x - (op._x + dx))) {
dxRelativePlayer = 0;
}
if (op.collidingWith != null) {
if (Math.abs(op._x - pp.player._x) < Math.abs(op.collidingWith._x - pp.player._x)) {
if (dxRelativePlayer == -1) {
if (op.collidingWith._x > op._x) {
dx = -MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
dx = MV_TOPSPEED;
}
}
if (dxRelativePlayer == 0) {
if (op.collidingWith._x > op._x) {
op._x = op._x - MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
op._x = op._x + MV_TOPSPEED;
}
}
}
if (Math.abs(op._x - pp.player._x) > Math.abs(op.collidingWith._x - pp.player._x)) {
if (dxRelativePlayer == 1) {
if (op._x < op.collidingWith._x) {
dx = -MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
dx = MV_TOPSPEED;
}
}
if (dxRelativePlayer == 0) {
if (op._x < op.collidingWith._x) {
op._x = op._x - MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
op._x = op._x + MV_TOPSPEED;
}
}
}
}
if (dead) {
grounded = false;
}
winceTimer++;
if (Math.abs(dx - 1) < 1) {
dx = 0;
}
op._x = op._x + dx;
op._y = op._y + dy;
if (!grounded) {
dy = dy + MV_GRAVITY;
if (dy > MV_TVELOCITY) {
dy = MV_TVELOCITY;
}
}
if ((op._y >= MV_GROUND) && (!dead)) {
op._y = MV_GROUND;
grounded = true;
if (dy == MV_TVELOCITY) {
dy = -MV_BOUNCE;
grounded = false;
winceTimer = 0;
} else {
dy = 0;
}
op._rotation = 0;
}
expireTimer++;
if (expireTimer == EXPIRATION) {
dead = true;
grounded = false;
}
if (op._y > MV_DELETEAT) {
destroy();
}
if (grounded) {
if (dx > 0) {
dx = dx - MV_FRICTION;
}
if (dx < 0) {
dx = dx + MV_FRICTION;
}
}
if (op._x < 0) {
op._x = op._x + MV_TOPSPEED;
}
if (op._x > pp.M_WIDTH) {
op._x = op._x - MV_TOPSPEED;
}
}
}
Instance of Symbol 335 MovieClip in Symbol 336 MovieClip Frame 1
/* no clip actions */
Instance of Symbol 32 MovieClip in Symbol 337 MovieClip [rageRecover] Frame 1
onClipEvent (enterFrame) {
_parent._y--;
}
Symbol 337 MovieClip [rageRecover] Frame 43
this.removeMovieClip();
Instance of Symbol 32 MovieClip in Symbol 340 MovieClip [cheerRecover] Frame 1
onClipEvent (enterFrame) {
_parent._y--;
}
Symbol 340 MovieClip [cheerRecover] Frame 43
this.removeMovieClip();
Instance of Symbol 32 MovieClip in Symbol 343 MovieClip [sanityRecover] Frame 1
onClipEvent (enterFrame) {
_parent._y--;
}
Symbol 343 MovieClip [sanityRecover] Frame 43
this.removeMovieClip();
Instance of Symbol 32 MovieClip "code" in Symbol 372 MovieClip [sqClaus] Frame 1
onClipEvent (load) {
function getHit(x, y, type, dmg) {
if (attacking == false) {
if (type == "throw") {
gettingThrown = true;
}
if (type == "mid") {
if (!pp.player.demonMode) {
dmg = 0;
} else {
pp.jukebox.punch1.start();
}
}
if (type == "low") {
if (!pp.player.demonMode) {
dmg = 0;
} else {
pp.jukebox.punch2.start();
}
}
if (type == "upper") {
if (!pp.player.demonMode) {
dmg = 0;
} else {
pp.jukebox.punch3.start();
}
}
if (type == "spinUpper") {
if (!pp.player.demonMode) {
dmg = 0;
} else {
pp.jukebox.punch3.start();
}
}
if (type == "flyBack") {
if (!pp.player.demonMode) {
dmg = 0;
} else {
pp.jukebox.punch3.start();
}
}
if (type == "kickBack") {
if (!pp.player.demonMode) {
dmg = 0;
} else {
pp.jukebox.punch3.start();
}
}
if (type == "smackDown") {
type = "upper";
}
if (type == "energy") {
type = "upper";
if (!pp.player.demonMode) {
dmg = 0;
}
}
if (type == "laser") {
type = "mid";
}
if ((dmg > 0) && (attacking == false)) {
if (type != "throw") {
if (pp.player._x > op._x) {
dx = -x;
}
if (pp.player._x <= op._x) {
dx = x;
}
facePlayer();
dy = y * -1;
grounded = false;
attackTimer = 0;
attacking = false;
splashPoint._x = op._x;
splashPoint._y = op._y - 20;
pp.attachMovie("FX_Splash", "splash" + pp.getNextHighestDepth(), pp.getNextHighestDepth(), splashPoint);
}
lastHitType = type;
hp = hp - dmg;
bm.bossHud.sbar._xscale = (hp / (MAX_HP * pp.hpScale)) * 100;
if (hp < 0) {
bm.bossHud.sbar._xscale = 0;
}
winceTimer = 0;
wincing = true;
approach = false;
flee = false;
bm.battleManager.score = bm.battleManager.score + Math.round(dmg / 10);
if (hp <= 0) {
hp = 0;
bm.battleManager.score = bm.battleManager.score + POINTS;
bm.battleManager.kills++;
bm.battleManager.killCount++;
dead = true;
}
}
}
}
function destroy() {
pp.jukebox.regretNothing.start();
bm.battleManager.unRegister(op);
op.removeMovieClip();
}
function facePlayer() {
if (pp.player._x < op._x) {
op._xscale = -100;
}
if (pp.player._x > op._x) {
op._xscale = 100;
}
}
function autoOrient() {
if (pp.getAngle(op._x, op._y, last_x, last_y) != undefined) {
op._rotation = pp.getAngle(op._x, op._y, last_x, last_y);
}
}
function dropItem() {
var _local1 = pp.getNextHighestDepth();
var _local2 = new Object();
_local2._x = op._x + (100 * (op._xscale / 100));
_local2._y = op._y - 100;
pp.attachMovie(objectType, objectType + _local1, _local1, _local2);
bm.battleManager.register(objectType + _local1);
hasObject = false;
op.object._visible = false;
objectType = "";
}
function jumpNow() {
if ((!dead) && (grounded)) {
if ((!wincing) && (dx != 0)) {
grounded = false;
jumping = true;
dy = -MV_JUMPPOWER;
}
}
}
function attackNow() {
if (!dead) {
if (!wincing) {
if ((op._x > 0) && (op._x < pp.M_WIDTH)) {
if (Math.random() < ATTACK_CHANCE) {
if (Math.abs(pp.player._x - op._x) < ATTACK_RANGE) {
attacking = true;
if (pp.collisionObjects.length == 1) {
bm.battleManager.spawn("sqm", "sqm" + pp.getNextHighestDepth(), -200, 1, 0);
bm.battleManager.spawn("sqf", "sqf" + pp.getNextHighestDepth(), -400, 1, 3);
bm.battleManager.spawn("sqm", "sqm" + pp.getNextHighestDepth(), 1000, 1, 0);
bm.battleManager.spawn("sqf", "sqf" + pp.getNextHighestDepth(), 1200, 1, 3);
} else {
pp.player.sanityChange(-attackPwr);
}
if (Math.random() < 0.5) {
pp.jukebox.ho_ho_ho.start();
} else {
pp.jukebox.santa.start();
}
}
}
}
}
}
}
op = _parent;
pp = _parent._parent;
bm = _parent._parent._parent;
splashPoint = new Object();
op.stop();
active = true;
MAX_HP = 800 * pp.hpScale;
hp = MAX_HP;
dead = false;
op.collidingWith = "blarg";
hitResult = -1;
grounded = false;
dxRelativePlayer = -1;
POINTS = 150;
MV_GROUND = pp.GROUND;
MV_GRAVITY = pp.GRAVITY;
MV_TVELOCITY = pp.TVELOCITY;
MV_DELETEAT = pp.DELETEAT;
MV_FRICTION = 2;
MV_ROTOFF = 180;
MV_BOUNCE = 20;
MV_TOPSPEED = 4;
MV_COLLISION_TOL = 40;
MV_JUMPPOWER = 30;
AI_APPROACH_WITHIN = 120;
AI_APPROACH = true;
AI_JUMP = false;
AI_FLEE = false;
AI_HIT_STUN = 45;
AI_JUMP_WAIT = 20;
AI_FLEE_TOLERANCE = 80;
AI_GLOMP = false;
glompXoff = 30;
AI_GLOMP_YOFF = Math.round(Math.random() * 30);
AI_GLOMP_WAIT = 20;
attackPwr = 8 * pp.attackScale;
ATTACK_DELAY = 90;
ATTACK_TIME = 20;
ATTACK_CHANCE = 0.7;
ATTACK_RANGE = 200;
COOKIE_RECOVER = 100;
attackTimer = Math.round(Math.random() * ATTACK_DELAY) - 50;
attacking = false;
annoy = true;
dx = 0;
dy = 0;
wincing = false;
lastHitType = "mid";
animstate = "";
last_x = op._x;
last_y = op._y;
WINCE_DELAY = 4;
HIT_HOLD = 4;
winceTimer = 100;
jumpTimer = 0;
jumping = false;
gettingThrown = false;
objectType = "";
hasObject = false;
objectLossModifier = 0;
op.glomping = false;
glompTimer = 0;
bm.battleManager.getAI(op);
}
onClipEvent (enterFrame) {
if (pp.gamePause == false) {
if (active) {
if (grounded && (dx == 0)) {
animstate = "stand";
if (pp.player.scary) {
animstate = "scareStand";
}
}
if (grounded && (dx != 0)) {
animstate = "run";
if (pp.player.scary) {
animstate = "scareRun";
}
}
if (winceTimer < AI_HIT_STUN) {
animstate = "stun";
}
if ((!grounded) && (dy < 0)) {
animstate = "jumpUp";
if (pp.player.scary) {
animstate = "scareJumpUp";
}
}
if ((!grounded) && (dy >= 0)) {
animstate = "jumpDown";
if (pp.player.scary) {
animstate = "scareJumpDown";
}
}
if (attacking) {
animstate = "annoy";
}
if (op.glomping) {
animstate = "glomp";
}
if (wincing) {
animstate = lastHitType;
}
if (winceTimer <= HIT_HOLD) {
animstate = lastHitType;
}
if (gettingThrown) {
animstate = "throw";
}
if (dead) {
animstate = "upper";
}
op.gotoAndStop(animstate);
if ((animstate == "upper") || (animstate == "spinUpper")) {
autoOrient();
}
if (((animstate == "upper") || (animstate == "spinUpper")) || (animstate == "flyBack")) {
if (dy > 0) {
op.hitBox.attacking = true;
}
if (hasObject) {
dropItem();
}
} else {
op.hitBox.attacking = false;
}
hitResult = -1;
i = 0;
while (i < pp.damageObjects.length) {
hitTarget = eval (pp.damageObjects[i] + pp.damageObjPath[i]);
if (op.hitBox.hitTest(hitTarget) && (hitTarget.attacking == true)) {
if ((hitTarget != pp.player) && (hitTarget != op)) {
if (!wincing) {
if (!op.glomping) {
hitResult = i;
}
if ((op.glomping && (pp.player.specialMove == "Cute Buster")) && (pp.player.specialMoving)) {
hitResult = i;
op.glomping = false;
}
if ((op.glomping && (pp.player.specialMove == "Upawcut")) && (pp.player.specialMoving)) {
hitResult = i;
op.glomping = false;
}
}
}
}
i++;
}
if (hitResult > -1) {
var t = eval ((pp + ".") + pp.damageObjects[hitResult]);
getHit(t.kbx, t.kby, t.attType, t.damage);
} else if (grounded && (winceTimer >= WINCE_DELAY)) {
wincing = false;
itemWince = false;
}
if (winceTimer > AI_HIT_STUN) {
if (AI_APPROACH) {
approach = true;
}
if (AI_FLEE) {
flee = true;
}
}
if (approach && (!wincing)) {
if (grounded) {
if (Math.abs(pp.player._x - op._x) > AI_APPROACH_WITHIN) {
if (pp.player._x < op._x) {
playerSide = -1;
}
if (pp.player._x > op._x) {
playerSide = 1;
}
dx = MV_TOPSPEED * playerSide;
op._xscale = playerSide * 100;
}
}
}
if (flee && (!wincing)) {
if (grounded) {
if (Math.abs(pp.player._x - op._x) < AI_APPROACH_WITHIN) {
if (pp.player._x < op._x) {
playerSide = -1;
}
if (pp.player._x > op._x) {
playerSide = 1;
}
dx = (MV_TOPSPEED * playerSide) * -1;
op._xscale = (playerSide * 100) * -1;
if ((AI_APPROACH_WITHIN - Math.abs(pp.player._x - op._x)) < AI_FLEE_TOLERANCE) {
dx = 0;
}
}
if (Math.abs(pp.player._x - op._x) > AI_APPROACH_WITHIN) {
if (pp.player._x < op._x) {
playerSide = -1;
}
if (pp.player._x > op._x) {
playerSide = 1;
}
dx = MV_TOPSPEED * playerSide;
op._xscale = playerSide * 100;
if ((Math.abs(pp.player._x - op._x) - AI_APPROACH_WITHIN) < AI_FLEE_TOLERANCE) {
dx = 0;
}
}
}
}
if (op.collidingWith.code.POINTS == 73) {
op.collidingWith.code.destroy();
hp = hp + COOKIE_RECOVER;
pp.attachMovie("cheerRecover", "cheRecover", pp.getNextHighestDepth());
pp.jukebox.mmm.start();
if (hp > MAX_HP) {
hp = MAX_HP;
}
bm.bossHud.sbar._xscale = (hp / (MAX_HP * pp.hpScale)) * 100;
pp.cheRecover._x = op._x;
pp.cheRecover._y = op._y;
}
if (Math.abs(pp.player._x - op._x) > Math.abs(pp.player._x - (op._x + dx))) {
dxRelativePlayer = -1;
}
if (Math.abs(pp.player._x - op._x) < Math.abs(pp.player._x - (op._x + dx))) {
dxRelativePlayer = 1;
}
if (Math.abs(pp.player._x - op._x) == Math.abs(pp.player._x - (op._x + dx))) {
dxRelativePlayer = 0;
}
if (op.collidingWith != null) {
if (Math.abs(op._x - pp.player._x) < Math.abs(op.collidingWith._x - pp.player._x)) {
if (dxRelativePlayer == -1) {
if (op.collidingWith._x > op._x) {
dx = -MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
dx = MV_TOPSPEED;
}
}
if (dxRelativePlayer == 0) {
if (op.collidingWith._x > op._x) {
op._x = op._x - MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
op._x = op._x + MV_TOPSPEED;
}
}
}
if (Math.abs(op._x - pp.player._x) > Math.abs(op.collidingWith._x - pp.player._x)) {
if (dxRelativePlayer == 1) {
if (op._x < op.collidingWith._x) {
dx = -MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
dx = MV_TOPSPEED;
}
}
if (dxRelativePlayer == 0) {
if (op._x < op.collidingWith._x) {
op._x = op._x - MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
op._x = op._x + MV_TOPSPEED;
}
}
}
}
if (gettingThrown) {
dx = 0;
dy = 0;
op._x = pp.player._x + pp.player.throwGuide._x;
op._y = pp.player._y + pp.player.throwGuide._y;
op._rotation = pp.player.throwGuide._rotation * (100 / pp.player._xscale);
if (pp.player._currentframe == pp.player.FT_THROWRELEASE) {
op._rotation = 180;
getHit(-10, -30, "smackDown", 0);
grounded = false;
gettingThrown = false;
}
}
if ((jumpTimer > AI_JUMP_WAIT) && (AI_JUMP)) {
jumpNow();
jumpTimer = 0;
}
if ((attackTimer == ATTACK_DELAY) && (annoy)) {
attackNow();
}
if (attackTimer == (ATTACK_DELAY + ATTACK_TIME)) {
attacking = false;
attackTimer = 0;
}
if ((!op.glomping) && (AI_GLOMP)) {
if (Math.abs(pp.player._x - op._x) < op._width) {
glompTimer++;
} else {
glompTimer = 0;
}
}
if ((glompTimer == AI_GLOMP_WAIT) && (!wincing)) {
op.glomping = true;
glompXoff = glompXoff * (-1 * (op._xscale / 100));
glompTimer++;
grounded = false;
}
if (pp.player.demonMode) {
glompTimer = 0;
attackTimer = 0;
attacking = false;
op.glomping = false;
}
winceTimer++;
jumpTimer++;
attackTimer++;
if (Math.abs(dx) < 1) {
dx = 0;
}
last_x = op._x;
last_y = op._y;
if ((animstate == "annoy") && (grounded)) {
dx = 0;
}
if (op.glomping) {
if (pp.player._xscale == 100) {
op._x = (pp.player._x + glompXoff) + pp.player.glompTarget._x;
}
if (pp.player._xscale == -100) {
op._x = (pp.player._x + glompXoff) - pp.player.glompTarget._x;
}
op._y = pp.player._y - AI_GLOMP_YOFF;
}
if (!op.glomping) {
op._x = op._x + dx;
op._y = op._y + dy;
if (!grounded) {
dy = dy + MV_GRAVITY;
if (dy > MV_TVELOCITY) {
dy = MV_TVELOCITY;
}
}
if ((op._y >= MV_GROUND) && (!dead)) {
op._y = MV_GROUND;
grounded = true;
if ((dy == MV_TVELOCITY) && (!jumping)) {
dy = -MV_BOUNCE;
grounded = false;
winceTimer = 0;
} else {
dy = 0;
jumping = false;
}
op._rotation = 0;
}
if (op._y > MV_DELETEAT) {
destroy();
}
if (grounded) {
if (dx > 0) {
dx = dx - MV_FRICTION;
}
if (dx < 0) {
dx = dx + MV_FRICTION;
}
}
}
}
}
}
Instance of Symbol 58 MovieClip "object" in Symbol 372 MovieClip [sqClaus] Frame 1
onClipEvent (load) {
stop();
}
Instance of Symbol 32 MovieClip "code" in Symbol 399 MovieClip [sql] Frame 1
onClipEvent (load) {
function getHit(x, y, type, dmg) {
if (attacking == false) {
if (type == "throw") {
gettingThrown = true;
}
if (type == "mid") {
if ((objectType == "pillow") or (objectType == "umbrella")) {
if (!itemWince) {
itemWince = true;
pp.jukebox.pillowHit.start();
pp.player.rageDown(3 * pp.RAGE_MODIFIER);
}
dmg = 0;
} else {
pp.jukebox.punch1.start();
}
}
if (type == "low") {
if ((objectType == "pillow") or (objectType == "umbrella")) {
if (!itemWince) {
itemWince = true;
pp.jukebox.pillowHit.start();
pp.player.rageDown(3 * pp.RAGE_MODIFIER);
}
dmg = 0;
} else {
pp.jukebox.punch2.start();
}
}
if (type == "upper") {
if ((objectType == "pillow") or (objectType == "umbrella")) {
if (!itemWince) {
itemWince = true;
pp.jukebox.pillowHit.start();
pp.player.rageDown(3 * pp.RAGE_MODIFIER);
}
dmg = 0;
} else {
pp.jukebox.punch3.start();
}
}
if (type == "spinUpper") {
pp.jukebox.punch3.start();
}
if (type == "flyBack") {
pp.jukebox.punch3.start();
}
if (type == "kickBack") {
if ((objectType == "pillow") or (objectType == "umbrella")) {
if (!itemWince) {
itemWince = true;
pp.jukebox.pillowHit.start();
pp.player.rageDown(3 * pp.RAGE_MODIFIER);
}
dmg = 0;
} else {
pp.jukebox.punch3.start();
}
}
if (type == "smackDown") {
type = "upper";
}
if (type == "energy") {
type = "upper";
}
if (type == "laser") {
type = "mid";
}
if ((dmg > 0) && (attacking == false)) {
if (type != "throw") {
if (pp.player._x > op._x) {
dx = -x;
}
if (pp.player._x <= op._x) {
dx = x;
}
facePlayer();
dy = y * -1;
grounded = false;
attackTimer = 0;
attacking = false;
splashPoint._x = op._x;
splashPoint._y = op._y - 20;
pp.attachMovie("FX_Splash", "splash" + pp.getNextHighestDepth(), pp.getNextHighestDepth(), splashPoint);
}
lastHitType = type;
hp = hp - dmg;
winceTimer = 0;
wincing = true;
approach = false;
flee = false;
bm.battleManager.score = bm.battleManager.score + Math.round(dmg / 10);
if (hp <= 0) {
hp = 0;
bm.battleManager.score = bm.battleManager.score + POINTS;
bm.battleManager.kills++;
bm.battleManager.killCount++;
dead = true;
}
}
}
}
function destroy() {
pp.jukebox.regretNothing.start();
bm.battleManager.unRegister(op);
op.removeMovieClip();
}
function facePlayer() {
if (pp.player._x < op._x) {
op._xscale = -100;
}
if (pp.player._x > op._x) {
op._xscale = 100;
}
}
function autoOrient() {
if (pp.getAngle(op._x, op._y, last_x, last_y) != undefined) {
op._rotation = pp.getAngle(op._x, op._y, last_x, last_y);
}
}
function dropItem() {
var _local1 = pp.getNextHighestDepth();
var _local2 = new Object();
_local2._x = op._x + (100 * (op._xscale / 100));
_local2._y = op._y - 100;
pp.attachMovie(objectType, objectType + _local1, _local1, _local2);
bm.battleManager.register(objectType + _local1);
hasObject = false;
op.object._visible = false;
objectType = "";
}
function jumpNow() {
if ((!dead) && (grounded)) {
if ((!wincing) && (dx != 0)) {
grounded = false;
jumping = true;
dy = -MV_JUMPPOWER;
}
}
}
function attackNow() {
if (!dead) {
if (!wincing) {
if ((op._x > 0) && (op._x < pp.M_WIDTH)) {
if (Math.random() < ATTACK_CHANCE) {
if (Math.abs(pp.player._x - op._x) < ATTACK_RANGE) {
attacking = true;
pp.player.sanityChange(-attackPwr);
if (Math.random() < 0.5) {
pp.jukebox.heyhey.start();
} else {
pp.jukebox.gimmieHug.start();
}
}
}
}
}
}
}
op = _parent;
pp = _parent._parent;
bm = _parent._parent._parent;
splashPoint = new Object();
op.stop();
active = true;
hp = 120 * pp.hpScale;
dead = false;
op.collidingWith = "blarg";
hitResult = -1;
grounded = false;
dxRelativePlayer = -1;
POINTS = 150;
MV_GROUND = pp.GROUND;
MV_GRAVITY = pp.GRAVITY;
MV_TVELOCITY = pp.TVELOCITY;
MV_DELETEAT = pp.DELETEAT;
MV_FRICTION = 2;
MV_ROTOFF = 180;
MV_BOUNCE = 20;
MV_TOPSPEED = 4;
MV_COLLISION_TOL = 40;
MV_JUMPPOWER = 30;
AI_APPROACH_WITHIN = 120;
AI_APPROACH = false;
AI_JUMP = false;
AI_FLEE = false;
AI_HIT_STUN = 45;
AI_JUMP_WAIT = 20;
AI_FLEE_TOLERANCE = 80;
AI_GLOMP = false;
glompXoff = 30;
AI_GLOMP_YOFF = Math.round(Math.random() * 30);
AI_GLOMP_WAIT = 20;
attackPwr = 7 * pp.attackScale;
ATTACK_DELAY = 90;
ATTACK_TIME = 20;
ATTACK_CHANCE = 0.7;
ATTACK_RANGE = 200;
attackTimer = Math.round(Math.random() * ATTACK_DELAY) - 50;
attacking = false;
annoy = true;
dx = 0;
dy = 0;
wincing = false;
lastHitType = "mid";
animstate = "";
last_x = op._x;
last_y = op._y;
WINCE_DELAY = 4;
HIT_HOLD = 4;
winceTimer = 100;
jumpTimer = 0;
jumping = false;
gettingThrown = false;
objectType = "";
hasObject = false;
objectLossModifier = 0;
op.glomping = false;
glompTimer = 0;
bm.battleManager.getAI(op);
}
onClipEvent (enterFrame) {
if (pp.gamePause == false) {
if (active) {
if (grounded && (dx == 0)) {
animstate = "stand";
if (pp.player.scary) {
animstate = "scareStand";
}
}
if (grounded && (dx != 0)) {
animstate = "run";
if (pp.player.scary) {
animstate = "scareRun";
}
}
if (winceTimer < AI_HIT_STUN) {
animstate = "stun";
}
if ((!grounded) && (dy < 0)) {
animstate = "jumpUp";
if (pp.player.scary) {
animstate = "scareJumpUp";
}
}
if ((!grounded) && (dy >= 0)) {
animstate = "jumpDown";
if (pp.player.scary) {
animstate = "scareJumpDown";
}
}
if (attacking) {
animstate = "annoy";
}
if (op.glomping) {
animstate = "glomp";
}
if (wincing) {
animstate = lastHitType;
}
if (winceTimer <= HIT_HOLD) {
animstate = lastHitType;
}
if (gettingThrown) {
animstate = "throw";
}
if (dead) {
animstate = "upper";
}
op.gotoAndStop(animstate);
if ((animstate == "upper") || (animstate == "spinUpper")) {
autoOrient();
}
if (((animstate == "upper") || (animstate == "spinUpper")) || (animstate == "flyBack")) {
if (dy > 0) {
op.hitBox.attacking = true;
}
if (hasObject) {
dropItem();
}
} else {
op.hitBox.attacking = false;
}
hitResult = -1;
i = 0;
while (i < pp.damageObjects.length) {
hitTarget = eval (pp.damageObjects[i] + pp.damageObjPath[i]);
if (op.hitBox.hitTest(hitTarget) && (hitTarget.attacking == true)) {
if ((hitTarget != pp.player) && (hitTarget != op)) {
if (!wincing) {
if (!op.glomping) {
hitResult = i;
}
if ((op.glomping && (pp.player.specialMove == "Cute Buster")) && (pp.player.specialMoving)) {
hitResult = i;
op.glomping = false;
}
if ((op.glomping && (pp.player.specialMove == "Upawcut")) && (pp.player.specialMoving)) {
hitResult = i;
op.glomping = false;
}
}
}
}
i++;
}
if (hitResult > -1) {
var t = eval ((pp + ".") + pp.damageObjects[hitResult]);
getHit(t.kbx, t.kby, t.attType, t.damage);
} else if (grounded && (winceTimer >= WINCE_DELAY)) {
wincing = false;
itemWince = false;
}
if (winceTimer > AI_HIT_STUN) {
if (AI_APPROACH) {
approach = true;
}
if (AI_FLEE) {
flee = true;
}
}
if (approach && (!wincing)) {
if (grounded) {
if (Math.abs(pp.player._x - op._x) > AI_APPROACH_WITHIN) {
if (pp.player._x < op._x) {
playerSide = -1;
}
if (pp.player._x > op._x) {
playerSide = 1;
}
dx = MV_TOPSPEED * playerSide;
op._xscale = playerSide * 100;
}
}
}
if (flee && (!wincing)) {
if (grounded) {
if (Math.abs(pp.player._x - op._x) < AI_APPROACH_WITHIN) {
if (pp.player._x < op._x) {
playerSide = -1;
}
if (pp.player._x > op._x) {
playerSide = 1;
}
dx = (MV_TOPSPEED * playerSide) * -1;
op._xscale = (playerSide * 100) * -1;
if ((AI_APPROACH_WITHIN - Math.abs(pp.player._x - op._x)) < AI_FLEE_TOLERANCE) {
dx = 0;
}
}
if (Math.abs(pp.player._x - op._x) > AI_APPROACH_WITHIN) {
if (pp.player._x < op._x) {
playerSide = -1;
}
if (pp.player._x > op._x) {
playerSide = 1;
}
dx = MV_TOPSPEED * playerSide;
op._xscale = playerSide * 100;
if ((Math.abs(pp.player._x - op._x) - AI_APPROACH_WITHIN) < AI_FLEE_TOLERANCE) {
dx = 0;
}
}
}
}
if (Math.abs(pp.player._x - op._x) > Math.abs(pp.player._x - (op._x + dx))) {
dxRelativePlayer = -1;
}
if (Math.abs(pp.player._x - op._x) < Math.abs(pp.player._x - (op._x + dx))) {
dxRelativePlayer = 1;
}
if (Math.abs(pp.player._x - op._x) == Math.abs(pp.player._x - (op._x + dx))) {
dxRelativePlayer = 0;
}
if (op.collidingWith != null) {
if (Math.abs(op._x - pp.player._x) < Math.abs(op.collidingWith._x - pp.player._x)) {
if (dxRelativePlayer == -1) {
if (op.collidingWith._x > op._x) {
dx = -MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
dx = MV_TOPSPEED;
}
}
if (dxRelativePlayer == 0) {
if (op.collidingWith._x > op._x) {
op._x = op._x - MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
op._x = op._x + MV_TOPSPEED;
}
}
}
if (Math.abs(op._x - pp.player._x) > Math.abs(op.collidingWith._x - pp.player._x)) {
if (dxRelativePlayer == 1) {
if (op._x < op.collidingWith._x) {
dx = -MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
dx = MV_TOPSPEED;
}
}
if (dxRelativePlayer == 0) {
if (op._x < op.collidingWith._x) {
op._x = op._x - MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
op._x = op._x + MV_TOPSPEED;
}
}
}
}
if (gettingThrown) {
dx = 0;
dy = 0;
op._x = pp.player._x + pp.player.throwGuide._x;
op._y = pp.player._y + pp.player.throwGuide._y;
op._rotation = pp.player.throwGuide._rotation * (100 / pp.player._xscale);
if (pp.player._currentframe == pp.player.FT_THROWRELEASE) {
op._rotation = 180;
getHit(-10, -30, "smackDown", 0);
grounded = false;
gettingThrown = false;
}
}
if ((jumpTimer > AI_JUMP_WAIT) && (AI_JUMP)) {
jumpNow();
jumpTimer = 0;
}
if ((attackTimer == ATTACK_DELAY) && (annoy)) {
attackNow();
}
if (attackTimer == (ATTACK_DELAY + ATTACK_TIME)) {
attacking = false;
attackTimer = 0;
}
if ((!op.glomping) && (AI_GLOMP)) {
if (Math.abs(pp.player._x - op._x) < op._width) {
glompTimer++;
} else {
glompTimer = 0;
}
}
if ((glompTimer == AI_GLOMP_WAIT) && (!wincing)) {
op.glomping = true;
glompXoff = glompXoff * (-1 * (op._xscale / 100));
glompTimer++;
grounded = false;
}
if (pp.player.demonMode) {
glompTimer = 0;
attackTimer = 0;
attacking = false;
op.glomping = false;
}
winceTimer++;
jumpTimer++;
attackTimer++;
if (Math.abs(dx) < 1) {
dx = 0;
}
last_x = op._x;
last_y = op._y;
if ((animstate == "annoy") && (grounded)) {
dx = 0;
}
if (op.glomping) {
if (pp.player._xscale == 100) {
op._x = (pp.player._x + glompXoff) + pp.player.glompTarget._x;
}
if (pp.player._xscale == -100) {
op._x = (pp.player._x + glompXoff) - pp.player.glompTarget._x;
}
op._y = pp.player._y - AI_GLOMP_YOFF;
}
if (!op.glomping) {
op._x = op._x + dx;
op._y = op._y + dy;
if (!grounded) {
dy = dy + MV_GRAVITY;
if (dy > MV_TVELOCITY) {
dy = MV_TVELOCITY;
}
}
if ((op._y >= MV_GROUND) && (!dead)) {
op._y = MV_GROUND;
grounded = true;
if ((dy == MV_TVELOCITY) && (!jumping)) {
dy = -MV_BOUNCE;
grounded = false;
winceTimer = 0;
} else {
dy = 0;
jumping = false;
}
op._rotation = 0;
}
if (op._y > MV_DELETEAT) {
destroy();
}
if (grounded) {
if (dx > 0) {
dx = dx - MV_FRICTION;
}
if (dx < 0) {
dx = dx + MV_FRICTION;
}
}
}
}
}
}
Instance of Symbol 58 MovieClip "object" in Symbol 399 MovieClip [sql] Frame 1
onClipEvent (load) {
stop();
}
Symbol 404 MovieClip [FX_splash] Frame 5
this.removeMovieClip();
Symbol 409 MovieClip Frame 28
stop();
Instance of Symbol 32 MovieClip "code" in Symbol 410 MovieClip [iceCream] Frame 1
onClipEvent (load) {
function destroy() {
bm.battleManager.unRegister(op);
op.removeMovieClip();
}
function getHit(x, y, type, dmg) {
if (type != "throw") {
if (pp.player._x > this._x) {
dx = -x;
}
if (pp.player._x <= this._x) {
dx = x;
}
dy = y * -1;
grounded = false;
splashPoint._x = op._x;
splashPoint._y = op._y - 20;
pp.attachMovie("FX_Splash", "splash" + pp.getNextHighestDepth(), pp.getNextHighestDepth(), splashPoint);
}
if (type == "throw") {
gettingThrown = true;
}
if (type == "mid") {
pp.jukebox.punch1.start();
}
if (type == "low") {
pp.jukebox.punch2.start();
}
if (type == "upper") {
pp.jukebox.punch3.start();
}
if (type == "spinUpper") {
pp.jukebox.punch3.start();
}
if (type == "flyBack") {
pp.jukebox.punch3.start();
}
if (type == "smackDown") {
type = "upper";
}
hp = hp - dmg;
bm.battleManager.score = bm.battleManager.score + Math.round(dmg / 10);
if (hp <= 0) {
hp = 0;
bm.battleManager.score = bm.battleManager.score + POINTS;
dead = true;
if (!pp.player.demonMode) {
pp.attachMovie("rageRecover", "ragRecover", 60);
pp.player.rage = pp.player.rage + Math.round(POINTS * pp.RAGE_MODIFIER);
pp.ragRecover._x = op._x;
pp.ragRecover._y = op._y;
}
dy = -40;
dx = 15 * (pp.player._xscale / 100);
}
}
op.stop();
bm = _parent._parent._parent;
pp = _parent._parent;
op = _parent;
splashPoint = new Object();
hp = 20 * pp.hpScale;
dead = false;
rotateSpeed = 30;
hitResult = 0;
grounded = false;
POINTS = 35;
MV_GROUND = pp.GROUND;
MV_GRAVITY = pp.GRAVITY;
MV_TVELOCITY = pp.TVELOCITY;
MV_DELETEAT = pp.DELETEAT;
MV_FRICTION = 2;
MV_ROTOFF = 180;
MV_BOUNCE = 20;
MV_TOPSPEED = 6;
MV_COLLISION_TOL = 40;
op.collidingWith;
op.attacking = false;
op.kbx = 5;
op.kby = 22;
op.damage = 0;
op.attType = "upper";
dx = 0;
dy = 40;
WINCE_DELAY = 4;
winceTimer = 100;
EXPIRATION = 30 * pp.OBJECT_DELAY;
expireTimer = 0;
gettingThrown = false;
}
onClipEvent (enterFrame) {
if (pp.gamePause == false) {
animstate = "stand";
if ((!grounded) && (!dead)) {
op._rotation = op._rotation + rotateSpeed;
}
if (wincing) {
animstate = "wince";
}
if (hp <= 0) {
animstate = "dead";
}
op.gotoAndStop(animstate);
hitResult = -1;
i = 0;
while (i < pp.damageObjects.length) {
hitTarget = eval (((pp + ".") + pp.damageObjects[i]) + pp.damageObjPath[i]);
if (op.hitTest(hitTarget) && (hitTarget.attacking == true)) {
if (!wincing) {
hitResult = i;
}
}
i++;
}
if (hitResult > -1) {
var t = eval ((pp + ".") + pp.damageObjects[hitResult]);
getHit(t.kbx, t.kby, t.attType, t.damage);
winceTimer = 0;
wincing = true;
} else if (grounded && (winceTimer >= WINCE_DELAY)) {
wincing = false;
}
if (gettingThrown) {
dx = 0;
dy = 0;
op._x = pp.player._x + pp.player.throwGuide._x;
op._y = pp.player._y + pp.player.throwGuide._y;
op._rotation = pp.player.throwGuide._rotation * (100 / pp.player._xscale);
if (pp.player._currentframe == pp.player.FT_THROWRELEASE) {
op._rotation = 180;
getHit(-10, -30, "smackDown", 0);
grounded = false;
gettingThrown = false;
}
}
if (Math.abs(pp.player._x - op._x) > Math.abs(pp.player._x - (op._x + dx))) {
dxRelativePlayer = -1;
}
if (Math.abs(pp.player._x - op._x) < Math.abs(pp.player._x - (op._x + dx))) {
dxRelativePlayer = 1;
}
if (Math.abs(pp.player._x - op._x) == Math.abs(pp.player._x - (op._x + dx))) {
dxRelativePlayer = 0;
}
if (op.collidingWith != null) {
if (Math.abs(op._x - pp.player._x) < Math.abs(op.collidingWith._x - pp.player._x)) {
if (dxRelativePlayer == -1) {
if (op.collidingWith._x > op._x) {
dx = -MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
dx = MV_TOPSPEED;
}
}
if (dxRelativePlayer == 0) {
if (op.collidingWith._x > op._x) {
op._x = op._x - MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
op._x = op._x + MV_TOPSPEED;
}
}
}
if (Math.abs(op._x - pp.player._x) > Math.abs(op.collidingWith._x - pp.player._x)) {
if (dxRelativePlayer == 1) {
if (op._x < op.collidingWith._x) {
dx = -MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
dx = MV_TOPSPEED;
}
}
if (dxRelativePlayer == 0) {
if (op._x < op.collidingWith._x) {
op._x = op._x - MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
op._x = op._x + MV_TOPSPEED;
}
}
}
}
if (dead) {
grounded = false;
}
winceTimer++;
if (Math.abs(dx - 1) < 1) {
dx = 0;
}
op._x = op._x + dx;
op._y = op._y + dy;
if (!grounded) {
dy = dy + MV_GRAVITY;
if (dy > MV_TVELOCITY) {
dy = MV_TVELOCITY;
}
}
if ((op._y >= MV_GROUND) && (!dead)) {
op._y = MV_GROUND;
grounded = true;
if (dy == MV_TVELOCITY) {
dy = -MV_BOUNCE;
grounded = false;
winceTimer = 0;
} else {
dy = 0;
}
op._rotation = 0;
}
expireTimer++;
if (expireTimer == EXPIRATION) {
dead = true;
grounded = false;
}
if (op._y > MV_DELETEAT) {
destroy();
}
if (grounded) {
if (dx > 0) {
dx = dx - MV_FRICTION;
}
if (dx < 0) {
dx = dx + MV_FRICTION;
}
}
if (op._x < 0) {
op._x = op._x + MV_TOPSPEED;
}
if (op._x > pp.M_WIDTH) {
op._x = op._x - MV_TOPSPEED;
}
}
}
Instance of Symbol 32 MovieClip "code" in Symbol 413 MovieClip [pillow] Frame 1
onClipEvent (load) {
function destroy() {
bm.battleManager.unRegister(op);
op.removeMovieClip();
}
function getHit(x, y, type, dmg) {
if (type == "throw") {
gettingThrown = true;
}
if (type == "mid") {
pp.jukebox.pillowHit.start();
pp.player.rageDown(3 * pp.RAGE_MODIFIER);
dmg = 0;
}
if (type == "low") {
pp.jukebox.pillowHit.start();
pp.player.rageDown(3 * pp.RAGE_MODIFIER);
dmg = 0;
}
if (type == "upper") {
pp.jukebox.pillowHit.start();
dmg = 0;
pp.player.rageDown(3 * pp.RAGE_MODIFIER);
}
if (type == "spinUpper") {
pp.jukebox.punch3.start();
}
if (type == "flyBack") {
pp.jukebox.punch3.start();
}
if (type == "kickBack") {
pp.jukebox.pillowHit.start();
dmg = 0;
pp.player.rageDown(3 * pp.RAGE_MODIFIER);
}
if (type == "smackDown") {
type = "upper";
}
if (type != "throw") {
if (dmg > 0) {
if (pp.player._x > this._x) {
dx = -x;
}
if (pp.player._x <= this._x) {
dx = x;
}
dy = y * -1;
grounded = false;
splashPoint._x = op._x;
splashPoint._y = op._y - 20;
pp.attachMovie("FX_Splash", "splash" + pp.getNextHighestDepth(), pp.getNextHighestDepth(), splashPoint);
}
}
hp = hp - dmg;
bm.battleManager.score = bm.battleManager.score + Math.round(dmg / 10);
if (hp <= 0) {
hp = 0;
bm.battleManager.score = bm.battleManager.score + POINTS;
dead = true;
if (!pp.player.demonMode) {
pp.attachMovie("rageRecover", "ragRecover", 60);
pp.player.rage = pp.player.rage + Math.round(POINTS * pp.RAGE_MODIFIER);
pp.ragRecover._x = op._x;
pp.ragRecover._y = op._y;
}
dy = -40;
dx = 15 * (pp.player._xscale / 100);
}
}
op.stop();
bm = _parent._parent._parent;
pp = _parent._parent;
op = _parent;
splashPoint = new Object();
hp = 35 * pp.hpScale;
dead = false;
rotateSpeed = 30;
hitResult = 0;
grounded = false;
POINTS = 200;
MV_GROUND = pp.GROUND;
MV_GRAVITY = pp.GRAVITY;
MV_TVELOCITY = pp.TVELOCITY;
MV_DELETEAT = pp.DELETEAT;
MV_FRICTION = 2;
MV_ROTOFF = 180;
MV_BOUNCE = 20;
MV_TOPSPEED = 6;
MV_COLLISION_TOL = 40;
op.collidingWith;
op.attacking = false;
op.kbx = 5;
op.kby = 22;
op.damage = 0;
op.attType = "upper";
dx = 0;
dy = 40;
EXPIRATION = 60 * pp.OBJECT_DELAY;
expireTimer = 0;
WINCE_DELAY = 4;
winceTimer = 100;
gettingThrown = false;
}
onClipEvent (enterFrame) {
if (pp.gamePause == false) {
animstate = "stand";
if ((!grounded) && (!dead)) {
op._rotation = op._rotation + rotateSpeed;
}
if (wincing) {
animstate = "wince";
}
if (dead) {
animstate = "dead";
}
op.gotoAndStop(animstate);
hitResult = -1;
i = 0;
while (i < pp.damageObjects.length) {
hitTarget = eval (((pp + ".") + pp.damageObjects[i]) + pp.damageObjPath[i]);
if (op.hitTest(hitTarget) && (hitTarget.attacking == true)) {
if (!wincing) {
hitResult = i;
}
}
i++;
}
if (hitResult > -1) {
var t = eval ((pp + ".") + pp.damageObjects[hitResult]);
getHit(t.kbx, t.kby, t.attType, t.damage);
winceTimer = 0;
wincing = true;
} else if (grounded && (winceTimer >= WINCE_DELAY)) {
wincing = false;
}
if (gettingThrown) {
dx = 0;
dy = 0;
op._x = pp.player._x + pp.player.throwGuide._x;
op._y = pp.player._y + pp.player.throwGuide._y;
op._rotation = pp.player.throwGuide._rotation * (100 / pp.player._xscale);
if (pp.player._currentframe == pp.player.FT_THROWRELEASE) {
op._rotation = 180;
getHit(-10, -30, "smackDown", 0);
grounded = false;
gettingThrown = false;
}
}
if (Math.abs(pp.player._x - op._x) > Math.abs(pp.player._x - (op._x + dx))) {
dxRelativePlayer = -1;
}
if (Math.abs(pp.player._x - op._x) < Math.abs(pp.player._x - (op._x + dx))) {
dxRelativePlayer = 1;
}
if (Math.abs(pp.player._x - op._x) == Math.abs(pp.player._x - (op._x + dx))) {
dxRelativePlayer = 0;
}
if (op.collidingWith != null) {
if (Math.abs(op._x - pp.player._x) < Math.abs(op.collidingWith._x - pp.player._x)) {
if (dxRelativePlayer == -1) {
if (op.collidingWith._x > op._x) {
dx = -MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
dx = MV_TOPSPEED;
}
}
if (dxRelativePlayer == 0) {
if (op.collidingWith._x > op._x) {
op._x = op._x - MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
op._x = op._x + MV_TOPSPEED;
}
}
}
if (Math.abs(op._x - pp.player._x) > Math.abs(op.collidingWith._x - pp.player._x)) {
if (dxRelativePlayer == 1) {
if (op._x < op.collidingWith._x) {
dx = -MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
dx = MV_TOPSPEED;
}
}
if (dxRelativePlayer == 0) {
if (op._x < op.collidingWith._x) {
op._x = op._x - MV_TOPSPEED;
}
if (op.collidingWith._x < op._x) {
op._x = op._x + MV_TOPSPEED;
}
}
}
}
if (dead) {
grounded = false;
}
winceTimer++;
if (Math.abs(dx - 1) < 1) {
dx = 0;
}
op._x = op._x + dx;
op._y = op._y + dy;
if (!grounded) {
dy = dy + MV_GRAVITY;
if (dy > MV_TVELOCITY) {
dy = MV_TVELOCITY;
}
}
if ((op._y >= MV_GROUND) && (!dead)) {
op._y = MV_GROUND;
grounded = true;
if (dy == MV_TVELOCITY) {
dy = -MV_BOUNCE;
grounded = false;
winceTimer = 0;
} else {
dy = 0;
}
op._rotation = 0;
}
if (op._y > MV_DELETEAT) {
destroy();
}
expireTimer++;
if (expireTimer == EXPIRATION) {
dead = true;
grounded = false;
}
if (grounded) {
if (dx > 0) {
dx = dx - MV_FRICTION;
}
if (dx < 0) {
dx = dx + MV_FRICTION;
}
}
if (op._x < 0) {
op._x = op._x + MV_TOPSPEED;
}
if (op._x > pp.M_WIDTH) {
op._x = op._x - MV_TOPSPEED;
}
}
}
Symbol 439 Button
on (release) {
gotoAndPlay (10);
}
Symbol 445 Button
on (release) {
gotoAndPlay (844);
}
Symbol 462 Button
on (release) {
_parent.goGame();
}
Symbol 467 Button
on (release) {
_root.swHighScoreObject.showTab = "view";
_visible = false;
docount = true;
_root.disabler._visible = true;
loadMovieNum (_root.HSHubURL, 2);
}
Symbol 472 Button
on (release) {
_root.swHighScoreObject.showTab = "submit";
_visible = false;
docount = true;
_root.disabler._visible = true;
loadMovieNum (_root.HSHubURL, 2);
}
Symbol 477 Button
on (release) {
_parent.goBack();
}
Symbol 491 Button
on (release) {
gotoAndStop (842);
}
Instance of Symbol 530 MovieClip "code" in Symbol 531 MovieClip Frame 1
onClipEvent (load) {
function trail() {
trailInit._x = _parent._x - (side * (Math.random() * trail_xOffset));
trailInit._y = _parent._y + trail_yOffset;
trailInit._rotation = Math.random() * trail_rotRange;
_root.attachMovie("FX_fireTrail", "ftr" + trailIncrement, trailIncrement + trail_depthOff, trailInit);
trailIncrement++;
if (trailIncrement > TRAILMAXIMUM) {
trailIncrement = 0;
}
}
function go(ix, iy, idirec) {
_parent.attacking = true;
xorig = ix;
yorig = iy;
_parent._x = ix + (idirec * XOFF);
_parent._y = iy + YOFF;
_parent._visible = true;
side = idirec;
_parent._xscale = side * 100;
}
_parent._visible = false;
side = 1;
RANGE = 1000;
YOFF = -20;
XOFF = 100;
SPEED = 30;
xorig = 0;
yorig = 0;
trail_randomOffset = 40;
trailIncrement = 0;
TRAILMAXIMUM = 15;
trail_depthOff = 50;
trail_xOffset = 100;
trail_yOffset = -20;
trail_rotRange = 90;
trailInit = new Object();
trailInit._x = 300;
trailInit._y = 300;
trailInit._rotation = 0;
}
onClipEvent (enterFrame) {
if (_parent._visible) {
_parent._x = _parent._x + (SPEED * side);
trail();
}
if (Math.abs(_parent._x - xorig) > RANGE) {
_parent._visible = false;
_parent.attacking = false;
}
}
Symbol 541 MovieClip Frame 23
stop();
Symbol 571 MovieClip Frame 1
stop();
Instance of Symbol 568 MovieClip "hitMask" in Symbol 571 MovieClip Frame 1
onClipEvent (load) {
_parent.hitMask._visible = false;
}
onClipEvent (enterFrame) {
if (_parent.hitMask.hitTest(_root._xmouse, _root._ymouse, true)) {
if (_parent._parent._visible) {
_parent.gotoAndStop(2);
_parent._parent.currentDir = _parent.dirChar;
}
} else {
_parent.gotoAndStop(1);
}
}
Instance of Symbol 571 MovieClip in Symbol 575 MovieClip Frame 1
onClipEvent (load) {
dirChar = "U";
}
Instance of Symbol 571 MovieClip in Symbol 575 MovieClip Frame 1
onClipEvent (load) {
dirChar = "R";
}
Instance of Symbol 571 MovieClip in Symbol 575 MovieClip Frame 1
onClipEvent (load) {
dirChar = "D";
}
Instance of Symbol 571 MovieClip in Symbol 575 MovieClip Frame 1
onClipEvent (load) {
dirChar = "L";
}
Instance of Symbol 32 MovieClip "code" in Symbol 599 MovieClip Frame 1
onClipEvent (enterFrame) {
_parent.gotoAndStop(_parent._parent.hat);
}
Instance of Symbol 32 MovieClip "attBox" in Symbol 664 MovieClip Frame 1
onClipEvent (enterFrame) {
attacking = false;
}
Instance of Symbol 32 MovieClip "attBox" in Symbol 664 MovieClip Frame 6
onClipEvent (enterFrame) {
attacking = true;
}
Instance of Symbol 32 MovieClip "attBox" in Symbol 664 MovieClip Frame 14
onClipEvent (enterFrame) {
attacking = false;
}
Instance of Symbol 32 MovieClip "attBox" in Symbol 664 MovieClip Frame 53
onClipEvent (enterFrame) {
attacking = true;
}
Instance of Symbol 32 MovieClip "attBox" in Symbol 664 MovieClip Frame 55
onClipEvent (enterFrame) {
attacking = false;
}
Instance of Symbol 32 MovieClip "attBox" in Symbol 664 MovieClip Frame 56
onClipEvent (enterFrame) {
attacking = true;
}
Instance of Symbol 32 MovieClip "attBox" in Symbol 664 MovieClip Frame 57
onClipEvent (enterFrame) {
attacking = false;
}
Instance of Symbol 32 MovieClip "attBox" in Symbol 664 MovieClip Frame 58
onClipEvent (enterFrame) {
attacking = true;
}
Instance of Symbol 32 MovieClip "attBox" in Symbol 664 MovieClip Frame 60
onClipEvent (enterFrame) {
attacking = false;
}
Instance of Symbol 32 MovieClip "attBox" in Symbol 664 MovieClip Frame 87
onClipEvent (enterFrame) {
attacking = true;
}
Instance of Symbol 517 MovieClip "fireExplode" in Symbol 665 MovieClip Frame 1
onClipEvent (load) {
function activate(x, y) {
this._x = x;
this._y = y;
this._visible = true;
this.gotoAndPlay(1);
}
this._visible = false;
this.stop();
END = 45;
attacking = false;
kbx = 20;
kby = 40;
attType = "energy";
damage = 50;
}
onClipEvent (enterFrame) {
if (this._currentframe >= END) {
this._visible = false;
this.stop();
}
if (this._currentframe == 15) {
attacking = true;
} else {
attacking = false;
}
}
Instance of Symbol 531 MovieClip "squa" in Symbol 665 MovieClip Frame 1
onClipEvent (load) {
attacking = true;
kbx = 15;
kby = 30;
attType = "energy";
damage = 35;
}
Instance of Symbol 537 MovieClip "upafire" in Symbol 665 MovieClip Frame 1
onClipEvent (load) {
function trail() {
trailInit._x = _x + (Math.random() * trail_xOffset);
trailInit._y = _y + (Math.random() * trail_yOffset);
_root.attachMovie("FX_fireTrail", "ftr" + trailIncrement, trailIncrement + trail_depthOff, trailInit);
trailIncrement++;
if (trailIncrement > TRAILMAXIMUM) {
trailIncrement = 0;
}
}
this._visible = false;
attacking = false;
kbx = 8;
kby = 60;
damage = 75;
attType = "spinUpper";
trail_randomOffset = 40;
trailIncrement = 0;
TRAILMAXIMUM = 15;
trail_depthOff = 50;
trail_xOffset = 20;
trail_yOffset = 80;
trail_rotRange = 45;
trailInit = new Object();
trailInit._x = 300;
trailInit._y = 300;
trailInit._rotation = 180;
}
onClipEvent (enterFrame) {
if (this._visible) {
if (_parent.player.animstate == "Upawcut") {
_x = _parent.player._x;
_y = _parent.player._y;
trail();
} else {
this._visible = false;
}
}
attacking = this._visible;
}
Instance of Symbol 541 MovieClip "dashLine" in Symbol 665 MovieClip Frame 1
onClipEvent (load) {
function go() {
this.gotoAndPlay(1);
this._visible = true;
this._x = _parent.player._x;
this._y = _parent.player._y;
this._xscale = _parent.player._xscale;
}
this._visible = false;
this.stop();
attacking = false;
kbx = -15;
kby = 20;
damage = 25;
attType = "flyBack";
LAST_FRAME = 23;
}
onClipEvent (enterFrame) {
if (this._currentframe == LAST_FRAME) {
this._visible = false;
_parent.player.specialMoving = false;
this.gotoAndStop(1);
}
attacking = _visible;
}
Instance of Symbol 560 MovieClip "eyeBeam" in Symbol 665 MovieClip Frame 1
onClipEvent (load) {
function activate(side) {
this._visible = true;
this.gotoAndPlay(1);
this._xscale = 100 * side;
side1 = side;
this._x = _parent.player._x + (side1 * XOFF);
this._y = _parent.player.MV_HOVERHT + YOFF;
attacking = true;
}
this._visible = false;
attacking = false;
this.gotoAndStop(1);
attacking = true;
kbx = 15;
kby = 5;
attType = "laser";
damage = 25;
YOFF = -60;
XOFF = 8;
side1 = 1;
}
onClipEvent (enterFrame) {
if (this._currentFrame == 37) {
this.stop();
this._visible = false;
attacking = false;
}
}
Instance of Symbol 566 MovieClip "smiter" in Symbol 665 MovieClip Frame 1
onClipEvent (load) {
function activate(x, y) {
this._x = x;
this._y = y;
this._visible = true;
this.gotoAndPlay(1);
}
this._visible = false;
this.stop();
END = 7;
attacking = false;
kbx = 5;
kby = 10;
attType = "energy";
damage = 25;
}
onClipEvent (enterFrame) {
if (this._currentframe >= END) {
this._visible = false;
this.stop();
}
if (this._currentframe == 1) {
attacking = true;
} else {
attacking = false;
}
}
Instance of Symbol 32 MovieClip "jukebox" in Symbol 665 MovieClip Frame 1
onClipEvent (load) {
snd = new Sound();
snd.setVolume(50);
normMusic = new Sound();
normMusic.attachSound("smacky_loop.wav");
demonMusic = new Sound();
demonMusic.attachSound("demon_loop.wav");
thatsIt = new Sound();
thatsIt.attachSound("thatsIt.wav");
punch1 = new Sound();
punch1.attachSound("punch1.wav");
punch2 = new Sound();
punch2.attachSound("punch2.wav");
punch3 = new Sound();
punch3.attachSound("punch3.wav");
pillowHit = new Sound();
pillowHit.attachSound("pillowHit.wav");
huya = new Sound();
huya.attachSound("huya.wav");
squadoken = new Sound();
squadoken.attachSound("squadoken.wav");
spin = new Sound();
spin.attachSound("smacky_spin.wav");
kick = new Sound();
kick.attachSound("kick.wav");
throww = new Sound();
throww.attachSound("throw.wav");
hello = new Sound();
hello.attachSound("hello.wav");
heyNeighbor = new Sound();
heyNeighbor.attachSound("heyNeighbor.wav");
ohBoy = new Sound();
ohBoy.attachSound("ohBoy.wav");
yoohoo = new Sound();
yoohoo.attachSound("yoohoo.wav");
heyCutie = new Sound();
heyCutie.attachSound("heyCutie.wav");
aaah = new Sound();
aaah.attachSound("aaah.wav");
gimmieHug = new Sound();
gimmieHug.attachSound("gimmieHug.wav");
heyhey = new Sound();
heyhey.attachSound("heyhey.wav");
regretNothing = new Sound();
regretNothing.attachSound("regretNothing.wav");
uncleSmacky = new Sound();
uncleSmacky.attachSound("uncleSmacky.wav");
frownUpsideDown = new Sound();
frownUpsideDown.attachSound("frownUpsideDown.wav");
ohNo = new Sound();
ohNo.attachSound("ohNo.wav");
jack_n_box = new Sound();
jack_n_box.attachSound("jack_n_box.wav");
mmm = new Sound();
mmm.attachSound("mmm.wav");
ho_ho_ho = new Sound();
ho_ho_ho.attachSound("ho_ho_ho.wav");
santa = new Sound();
santa.attachSound("santa.wav");
imLoaded = true;
}
Instance of Symbol 575 MovieClip "specRing" in Symbol 665 MovieClip Frame 1
onClipEvent (load) {
function closeRing() {
currentDir = "";
this._visible = false;
specTimer = 0;
parseCombo(combo_string);
combo_string = "";
charging = false;
}
function openRing() {
if ((_root._xmouse > _parent.M_SAFEBORDER) && (_root._xmouse < (_parent.M_WIDTH - _parent.M_SAFEBORDER))) {
combo_string = "";
this._x = openX;
this._y = openY;
this._visible = true;
charging = true;
}
}
function parseCombo(s) {
switch (s) {
case "DR" :
combo_string = "Squadoken";
side = 1;
break;
case "DL" :
combo_string = "Squadoken";
side = -1;
break;
case "RU" :
combo_string = "Upawcut";
side = 1;
break;
case "LU" :
combo_string = "Upawcut";
side = -1;
break;
case "RD" :
combo_string = "Acorn Drop";
side = -1;
break;
case "LD" :
combo_string = "Acorn Drop";
side = 1;
break;
case "D" :
combo_string = "Cute Buster";
break;
case "R" :
combo_string = "Dash Charge";
side = 1;
break;
case "L" :
combo_string = "Dash Charge";
side = -1;
break;
case "DRULD" :
combo_string = "Demon Transform";
break;
case "DLURD" :
combo_string = "Demon Transform";
break;
case "LDR" :
combo_string = "Fires of Wrath";
break;
case "RDL" :
combo_string = "Fires of Wrath";
break;
default :
combo_string = "";
}
if (combo_string != "") {
_parent.player.goSpecial(combo_string, side);
}
}
this._visible = false;
charging = false;
side = 1;
fp = _parent;
SPEC_DELAY = 8;
specTimer = 0;
mouseIsDown = false;
last_xmouse = _root._xmouse;
last_ymouse = _root._ymouse;
d_xmouse = 0;
d_ymouse = 0;
combo_string = "";
currentDir = "";
lastDir = "";
lineDist = 0;
lineAngle = 0;
openX = 0;
openY = 0;
}
onClipEvent (mouseDown) {
if (!mouseIsDown) {
openX = _root._xmouse;
openY = _root._ymouse;
}
mouseIsDown = true;
}
onClipEvent (mouseUp) {
closeRing();
mouseIsDown = false;
}
onClipEvent (enterFrame) {
if (this._visible) {
lineLength = fp.getDistance(this._x, this._y, _root._xmouse, _root._ymouse);
lineAngle = fp.getAngle(this._x, this._y, _root._xmouse, _root._ymouse);
this.pointer.line._height = lineLength;
this.pointer._rotation = lineAngle;
} else {
this.pointer.line._height = 0;
this.pointer._rotation = 0;
}
if (mouseIsDown && (specTimer <= SPEC_DELAY)) {
specTimer++;
}
if (mouseIsDown && (specTimer == SPEC_DELAY)) {
openRing();
}
d_xmouse = _root._xmouse - last_xmouse;
d_ymouse = _root._ymouse - last_ymouse;
if ((_root._xmouse + d_xmouse) >= _parent.M_WIDTH) {
closeRing();
}
if ((_root._xmouse + d_xmouse) <= 0) {
closeRing();
}
if ((_root._ymouse + d_ymouse) >= _parent.M_HEIGHT) {
closeRing();
}
if ((_root._ymouse + d_ymouse) <= 0) {
closeRing();
}
if (currentDir != lastDir) {
combo_string = combo_string + currentDir;
}
last_xmouse = _root._xmouse;
last_ymouse = _root._ymouse;
lastDir = currentDir;
}
Instance of Symbol 664 MovieClip "player" in Symbol 665 MovieClip Frame 1
onClipEvent (load) {
function demonDeactivate() {
_parent._parent.altScreen.timeout("flash");
if (!_parent._parent.battleManager.bossPlaying) {
_parent.jukebox.demonMusic.stop();
_parent.jukebox.normMusic.start(0, 52800);
}
controlLock = false;
demonMode = false;
grounded = false;
attacking = false;
specialMoving = false;
scary = false;
if (rage < 0) {
rage = 0;
}
}
function goDemon() {
demonMode = true;
this._y = MV_HOVERHT;
dy = -10;
_parent._parent.battleManager.score = _parent._parent.battleManager.score + 1000;
scary = true;
}
function die() {
gotoAndStop ("dead");
animstate = "dead";
_parent._parent.altScreen.timeout("over");
_parent._parent.battleManager.win = false;
}
function rageDown(amount) {
rage = rage - amount;
if (rage < 0) {
rage = 0;
}
if (rage > maxRage) {
rage = MAX_RAGE;
}
}
function sanityChange(amount) {
if (demonMode && (amount < 0)) {
amount = 0;
}
if (amount < 0) {
_parent._parent.hud.sanity.gotoAndPlay(2);
}
sanity = sanity + amount;
if (sanity > MAX_SANITY) {
sanity = MAX_SANITY;
}
if (sanity < 0) {
sanity = 0;
}
}
function setAttack(x, y, type, dmg) {
kbx = x;
kby = y;
attType = type;
damage = dmg;
}
function goSpecial(comboString, sd) {
if (demonMode) {
if (comboString == "Squadoken") {
specialMove = "Laser Eye Beam";
specialSide = sd;
specialMoving = true;
_parent.eyeBeam.activate(specialSide);
rageDown(0);
}
if (comboString == "Fires of Wrath") {
specialMove = "Fires of Wrath";
specialMoving = true;
_parent.fireExplode.activate(this._x, this._y);
rageDown(0);
}
}
if (!demonMode) {
if ((comboString == "Squadoken") && (rage >= 35)) {
specialMove = comboString;
specialSide = sd;
specialMoving = true;
rageDown(35);
}
if ((comboString == "Upawcut") && (rage >= 40)) {
_parent.jukebox.spin.start();
specialMove = comboString;
specialMoving = true;
grounded = false;
dy = FT_UPAWCUT_YPWR;
dx = FT_UPAWCUT_XPWR * sd;
_parent.upafire._visible = true;
rageDown(40);
}
if ((comboString == "Acorn Drop") && (rage >= 50)) {
specialMove = comboString;
specialMoving = true;
grounded = false;
dy = FT_DROP_YPWR;
dx = FT_DROP_XPWR * sd;
setAttack(5, -40, "throw", 125);
rageDown(50);
}
if ((comboString == "Dash Charge") && (rage >= 35)) {
specialMove = comboString;
specialMoving = true;
dx = MV_TOPSPEED * sd;
this._x = this._x + (FT_DASHPWR * sd);
_parent.dashLine.go();
rageDown(35);
}
if ((comboString == "Cute Buster") && (rage >= 30)) {
_parent.jukebox.spin.start();
specialMove = comboString;
specialMoving = true;
dy = FT_SPINPWR;
grounded = false;
setAttack(5, 40, "upper", 25);
rageDown(30);
}
}
if (comboString == "Demon Transform") {
if (demonMode) {
demonDeactivate();
} else if (rage >= 900) {
_parent._parent.altScreen.timeout("demon");
}
}
}
MAX_SANITY = 100;
MAX_RAGE = 900;
sanity = MAX_SANITY;
rage = 0;
scary = false;
hat = 1;
MV_STOPTOL = 80;
MV_TOPSPEED = 16;
MV_ACCEL = 2;
MV_FRICTION = 2;
MV_GROUND = _parent.GROUND;
MV_JUMPOFFSET = -150;
MV_JUMPPOWER = -40;
MV_TVELOCITY = _parent.TVELOCITY;
MV_HOVERHT = 260;
MV_HOVERAMP = 40;
MV_MAXHOVER = 12.5663706143592;
MV_HOVERACC = 0.01;
MV_SHOVESPEED = 5;
AN_HITHOLD = 3;
AN_RUN_FIRST = 14;
AN_RUN_LAST = 21;
AN_SKID_FIRST = 22;
AN_SKID_LAST = 26;
AN_JUMPDOWN_FIRST = 28;
AN_JUMPDOWN_LAST = 31;
AN_GRIT_FIRST = 32;
AN_GRIT_LAST = 33;
AN_SQUA_FIRST = 34;
AN_SQUA_LAST = 52;
AN_SQUA_GO = 44;
AN_UPCUT_FIRST = 54;
AN_UPCUT_LAST = 57;
AN_DROP_FIRST = 58;
AN_DROP_LAST = 86;
AN_DROP_BOOST = 70;
AN_BUST_FIRST = 87;
AN_BLINKFREQ = 0.01;
AN_TWITCHFREQ = 0.03;
FT_COMBOIDX = ["punchLeft", "punchRight", "kickFront", "punchLeft", "punchLeft"];
FT_COMBODELAY = 6;
FT_FULLCOMBODELAY = 20;
FT_COMBOTOL = 1;
FT_MAXCOMBOTIMER = 100;
FT_ENDCOMBOHEIGHT = -75;
FT_PUNCHUPPOWER = -25;
FT_PUNCHFORWARD = 5;
FT_KICKUPPOWER = -20;
FT_MAXKICK = 5;
FT_UPAWCUT_YPWR = -50;
FT_UPAWCUT_XPWR = 10;
FT_DROP_YPWR = -40;
FT_DROP_YBOOST = -20;
FT_DROP_XPWR = 5;
FT_DASHPWR = 400;
FT_SPINPWR = -20;
FT_EYEMAX = 24;
FT_THROWRELEASE = 70;
RAGE_CHARGE = 0.4;
controlLock = false;
grounded = false;
specialMoving = false;
attacking = false;
punchingup = false;
kicking = false;
jumpkicking = false;
demonMode = false;
comboTimer = 0;
comboCounter = 0;
eyeTimer = 0;
hoverCount = 0;
animstate = "stand";
specialMove = "";
specialSide = 1;
cursorSide = 1;
kbx = 0;
kby = 0;
attType = 0;
damage = 0;
dx = 0;
dy = 0;
setAttack(0, 0, "mid", 0);
}
onClipEvent (mouseDown) {
if (_parent.gamePause == false) {
if (!demonMode) {
if ((_root._ymouse < (MV_GROUND + MV_JUMPOFFSET)) && (grounded)) {
grounded = false;
dy = MV_JUMPPOWER;
}
if (!specialMoving) {
if ((comboTimer > (FT_COMBODELAY + FT_COMBOTOL)) || (comboTimer < (FT_COMBODELAY - FT_COMBOTOL))) {
comboCounter = 0;
} else if (comboCounter < (FT_COMBOIDX.length - 1)) {
comboCounter++;
} else {
comboCounter = 0;
}
comboTimer = 0;
attacking = true;
}
}
if (demonMode) {
comboTimer = 0;
attacking = true;
}
}
}
onClipEvent (enterFrame) {
if (_parent.gamePause == false) {
if (!controlLock) {
if (_root._xmouse < this._x) {
cursorSide = -1;
} else {
cursorSide = 1;
}
}
if (_parent._parent.hud.sbar._xscale <= 1) {
sanity = 0;
die();
}
if (rage > maxRage) {
rage = MAX_RAGE;
}
if (!demonMode) {
if (Math.abs(this._x - _root._xmouse) <= MV_STOPTOL) {
if (dx == 0) {
if (sanity >= 30) {
animstate = "stand";
}
if (sanity < 30) {
animstate = "stand2";
}
if (sanity < 15) {
animstate = "stand3";
}
if (Math.random() < AN_BLINKFREQ) {
animstate = "blink";
}
if (Math.random() < AN_TWITCHFREQ) {
animstate = "twitch";
}
} else {
animstate = "skid";
}
}
if (Math.abs(this._x - _root._xmouse) > MV_STOPTOL) {
if ((dx / cursorSide) >= 0) {
animstate = "run";
}
if ((dx / cursorSide) < 0) {
animstate = "skid";
}
}
if (!grounded) {
if (dy <= 0) {
animstate = "jumpUp";
if (punchingup) {
animstate = "punchUp";
setAttack(5, 40, "upper", 30);
}
}
if (dy > 0) {
animstate = "jumpDown";
if (attacking) {
jumpkicking = true;
}
}
}
if (attacking && (grounded)) {
if (comboCounter < (FT_COMBOIDX.length - 1)) {
if (comboTimer < AN_HITHOLD) {
animstate = FT_COMBOIDX[comboCounter];
if (animstate == "punchLeft") {
setAttack(0, 0, "mid", 8);
}
if (animstate == "punchRight") {
setAttack(0, 0, "low", 8);
}
if (animstate == "kickFront") {
setAttack(0, 0, "mid", 8);
}
}
}
if (comboCounter == (FT_COMBOIDX.length - 1)) {
if (_root._ymouse < (MV_GROUND + FT_ENDCOMBOHEIGHT)) {
animstate = "punchUp";
grounded = false;
dy = FT_PUNCHUPPOWER;
dx = FT_PUNCHFORWARD * cursorSide;
punchingup = true;
_parent.jukebox.huya.start();
}
if (_root._ymouse > (MV_GROUND + FT_ENDCOMBOHEIGHT)) {
animstate = "kickFront";
grounded = false;
dy = FT_KICKPOWER;
dx = MV_TOPSPEED * cursorSide;
if (kicking == false) {
_parent.jukebox.kick.start();
}
kicking = true;
setAttack(22, 5, "kickBack", 30);
}
}
}
if (kicking) {
animstate = "kickFront";
}
if (jumpkicking) {
animstate = "jumpKick";
setAttack(5, 30, "upper", 40);
}
if (_parent.specRing.charging) {
animstate = "grit";
}
if (specialMoving && (specialMove == "Squadoken")) {
animstate = specialMove;
}
if (specialMoving && (specialMove == "Upawcut")) {
animstate = specialMove;
}
if (specialMoving && (specialMove == "Acorn Drop")) {
animstate = specialMove;
}
if (specialMoving && (specialMove == "Cute Buster")) {
animstate = specialMove;
}
if (sanity <= 0) {
animstate = "dead";
gotoAndStop(animstate);
}
}
if (demonMode) {
if (!controlLock) {
if (Math.abs(this._x - _root._xmouse) > MV_STOPTOL) {
animstate = "hoverFly";
} else {
if (dx == 0) {
animstate = "hover";
}
if ((Math.abs(dx) / (dx * cursorSide)) == -1) {
animstate = "hoverSkid";
}
}
if (attacking && (comboTimer < AN_HITHOLD)) {
if (comboTimer == 0) {
_parent.smiter.activate(_root._xmouse, _root._ymouse);
}
}
if (specialMoving && (specialMove == "Laser Eye Beam")) {
animstate = specialMove;
}
if (specialMoving && (specialMove == "Fires of Wrath")) {
animstate = specialMove;
}
}
}
if (demonMode) {
if (animstate == "hover") {
gotoAndStop(animstate);
}
if (animstate == "hoverFly") {
gotoAndStop(animstate);
}
if (animstate == "hoverSkid") {
gotoAndStop(animstate);
}
if (animstate == "Laser Eye Beam") {
gotoAndStop ("laserEye");
controlLock = true;
dx = 0;
dy = 0;
this._y = MV_HOVERHT;
eyeTimer++;
if (eyeTimer >= FT_EYEMAX) {
specialMoving = false;
controlLock = false;
eyeTimer = 0;
}
}
if (animstate == "Fires of Wrath") {
gotoAndStop ("laserEye");
controlLock = true;
dx = 0;
dy = 0;
eyeTimer++;
if (eyeTimer >= FT_EYEMAX) {
specialMoving = false;
controlLock = false;
eyeTimer = 0;
}
}
if (!controlLock) {
this._y = Math.round(MV_HOVERHT + (Math.sin(hoverCount) * MV_HOVERAMP));
if (Math.abs(this._x - _root._xmouse) > MV_STOPTOL) {
dx = dx + (cursorSide * MV_ACCEL);
if (Math.abs(dx) > MV_TOPSPEED) {
dx = (Math.abs(dx) / dx) * MV_TOPSPEED;
}
}
if (Math.abs(dx - 1) < 1) {
dx = 0;
}
this._y = this._y + dy;
hoverCount = hoverCount + (MV_MAXHOVER * MV_HOVERACC);
if (hoverCount >= MV_MAXHOVER) {
hoverCount = 0;
}
if (comboTimer < FT_MAXCOMBOTIMER) {
comboTimer++;
}
}
}
if (!demonmode) {
if (attacking) {
if (comboTimer < AN_HITHOLD) {
gotoAndStop(animstate);
} else {
attacking = false;
}
}
if ((animstate == "Cute Buster") && (this.currentframe != AN_BUST_FIRST)) {
gotoAndStop ("Cute_Buster");
}
if (animstate == "jumpUp") {
gotoAndStop(animstate);
}
if (animstate == "jumpKick") {
gotoAndStop(animstate);
}
if (animstate == "stand") {
gotoAndStop(animstate);
}
if (animstate == "stand2") {
gotoAndStop(animstate);
}
if (animstate == "stand3") {
gotoAndStop(animstate);
}
if (animstate == "blink") {
gotoAndStop(animstate);
}
if (animstate == "twitch") {
gotoAndStop(animstate);
}
if (animstate == "skid") {
if ((this._currentframe >= AN_SKID_FIRST) && (this._currentframe <= AN_SKID_LAST)) {
if (this._currentframe != AN_SKID_LAST) {
this.nextFrame();
} else {
this.gotoAndStop(AN_SKID_LAST);
}
} else {
this.gotoAndStop(AN_SKID_FIRST);
}
}
if (animstate == "Squadoken") {
if ((this._currentframe >= AN_SQUA_FIRST) && (this._currentframe <= AN_SQUA_LAST)) {
if (this._currentframe != AN_SQUA_LAST) {
this.nextFrame();
}
if (this._currentframe == AN_SQUA_LAST) {
specialMoving = false;
}
if (this._currentframe == AN_SQUA_GO) {
_parent.jukebox.squadoken.start();
_parent.squa.code.go(this._x, this._y, specialSide);
}
} else {
this.gotoAndStop(AN_SQUA_FIRST);
}
}
if (animstate == "Acorn Drop") {
if ((this._currentframe >= AN_DROP_FIRST) && (this._currentframe <= AN_DROP_LAST)) {
if (this._currentframe != AN_DROP_LAST) {
this.nextFrame();
} else {
specialMoving = false;
}
if (this._currentframe == AN_DROP_BOOST) {
_parent.jukebox.throww.start();
this.dy = FT_DROP_YBOOST;
}
} else {
this.gotoAndStop(AN_DROP_FIRST);
}
}
if (animstate == "run") {
if ((this._currentframe >= AN_RUN_FIRST) && (this._currentframe < AN_RUN_LAST)) {
this.nextFrame();
} else {
this.gotoAndStop(AN_RUN_FIRST);
}
}
if (animstate == "Upawcut") {
if ((this._currentframe >= AN_UPCUT_FIRST) && (this._currentframe < AN_UPCUT_LAST)) {
this.nextFrame();
} else {
this.gotoAndStop(AN_UPCUT_FIRST);
}
if (dy > 0) {
specialMoving = false;
_parent.upafire._visible = false;
}
}
if (animstate == "jumpDown") {
punchingup = false;
if ((this._currentframe >= AN_JUMPDOWN_FIRST) && (this._currentframe < AN_JUMPDOWN_LAST)) {
this.nextFrame();
} else {
this.gotoAndStop(AN_JUMPDOWN_FIRST);
}
}
this._xscale = cursorSide * 100;
if (animstate == "Squadoken") {
this._xscale = specialSide * 100;
}
if (animstate == "grit") {
rage = rage + (RAGE_CHARGE * _parent.RAGE_MODIFIER);
}
if (demonMode) {
rage--;
if (rage <= 0) {
demonDeactivate();
}
}
if (grounded) {
if ((((Math.abs(dx) / dx) * cursorSide) == -1) || (animstate == "skid")) {
dx = dx + ((-1 * (Math.abs(dx) / dx)) * MV_FRICTION);
}
}
if (animstate == "run") {
dx = dx + (cursorSide * MV_ACCEL);
if (Math.abs(dx) > MV_TOPSPEED) {
dx = (Math.abs(dx) / dx) * MV_TOPSPEED;
}
}
if (animstate == "grit") {
if ((this._currentframe >= AN_GRIT_FIRST) && (this._currentframe < AN_GRIT_LAST)) {
this.nextFrame();
} else {
this.gotoAndStop(AN_GRIT_FIRST);
}
}
if (Math.abs(dx - 1) < 1) {
dx = 0;
}
if (comboTimer < FT_MAXCOMBOTIMER) {
comboTimer++;
}
i = 0;
while (i < _parent.collisionObjects.length) {
var temp;
if (this.hitTest(_parent.collisionObjects[i].hitBox)) {
if ((_parent.collisionObjects[i]._x > this._x) && (cursorSide == 1)) {
if (dx > 0) {
if (animstate != "skid") {
temp = dx;
dx = MV_SHOVESPEED;
if (_parent.collisionObjects[i].glomping == true) {
dx = temp;
}
}
_parent.collisionObjects[i]._x = _parent.collisionObjects[i]._x + dx;
}
}
if ((_parent.collisionObjects[i]._x < this._x) && (cursorSide == -1)) {
if (dx < 0) {
temp = dx;
dx = -MV_SHOVESPEED;
if (_parent.collisionObjects[i].glomping == true) {
dx = temp;
}
_parent.collisionObjects[i]._x = _parent.collisionObjects[i]._x + dx;
}
}
}
i++;
}
this._x = this._x + dx;
this._y = this._y + dy;
if ((dx == 0) || (comboTimer > FT_MAXKICK)) {
kicking = false;
}
if (!grounded) {
dy = dy + _parent.GRAVITY;
if (dy > MV_TVELOCITY) {
dy = MV_TVELOCITY;
}
}
if (this._y >= MV_GROUND) {
this._y = MV_GROUND;
grounded = true;
jumpkicking = false;
if (specialMoving && (animstate == "Cute Buster")) {
specialMoving = false;
}
dy = 0;
}
}
}
}
Symbol 667 Button
on (release) {
_root.nextFrame();
}
Symbol 678 MovieClip Frame 1
stop();
_visible = false;
Symbol 678 MovieClip Frame 2
_visible = true;
Symbol 678 MovieClip Frame 49
gotoAndStop (1);
Symbol 683 MovieClip Frame 9
gotoAndStop (1);
Instance of Symbol 683 MovieClip in Symbol 694 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(1);
}
Instance of Symbol 688 MovieClip "sbar" in Symbol 694 MovieClip Frame 1
onClipEvent (load) {
wp = _parent._parent.world;
this._xscale = 100;
}
onClipEvent (enterFrame) {
if (Math.round(wp.player.sanity) > this._xscale) {
this._xscale++;
}
if (Math.round(wp.player.sanity) < this._xscale) {
this._xscale--;
}
}
Instance of Symbol 690 MovieClip in Symbol 694 MovieClip Frame 1
onClipEvent (load) {
wp = _parent._parent.world;
}
onClipEvent (enterFrame) {
if (wp.player.rage < 100) {
this._xscale = wp.player.rage;
} else {
this._xscale = 100;
}
}
Instance of Symbol 690 MovieClip in Symbol 694 MovieClip Frame 1
onClipEvent (load) {
wp = _parent._parent.world;
}
onClipEvent (enterFrame) {
if ((wp.player.rage >= 100) && (wp.player.rage < 400)) {
this._visible = true;
this._xscale = (wp.player.rage - 100) / 3;
}
if (wp.player.rage > 400) {
this._xscale = 100;
this._visible = true;
}
if (wp.player.rage < 100) {
this._xscale = 100;
this._visible = false;
}
}
Instance of Symbol 690 MovieClip in Symbol 694 MovieClip Frame 1
onClipEvent (load) {
wp = _parent._parent.world;
}
onClipEvent (enterFrame) {
if ((wp.player.rage > 400) && (wp.player.rage < 900)) {
this._visible = true;
this._xscale = (wp.player.rage - 400) / 5;
}
if (wp.player.rage >= 900) {
this._xscale = 100;
this._visible = false;
}
if (wp.player.rage < 400) {
this._xscale = 100;
this._visible = false;
}
}
Instance of Symbol 693 MovieClip in Symbol 694 MovieClip Frame 1
onClipEvent (load) {
wp = _parent._parent.world;
}
onClipEvent (enterFrame) {
if (wp.player.rage >= 900) {
this._visible = true;
} else {
this._visible = false;
}
}
Symbol 698 Button
on (release) {
nextFrame();
}
Symbol 702 Button
on (release) {
prevFrame();
}
Symbol 770 MovieClip Frame 1
stop();
Instance of Symbol 428 MovieClip in Symbol 784 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_quality == "LOW") {
this.gotoAndStop(1);
} else {
this.play();
}
}
Instance of Symbol 774 MovieClip in Symbol 784 MovieClip Frame 2
onClipEvent (enterFrame) {
if (_quality == "LOW") {
this.stop();
this._visible = false;
} else {
this.play();
this._visible = true;
}
}
Instance of Symbol 774 MovieClip in Symbol 784 MovieClip Frame 4
onClipEvent (enterFrame) {
if (_quality == "LOW") {
this.stop();
this._visible = false;
} else {
this.play();
this._visible = true;
}
}
Instance of Symbol 774 MovieClip in Symbol 784 MovieClip Frame 6
onClipEvent (enterFrame) {
if (_quality == "LOW") {
this.stop();
this._visible = false;
} else {
this.play();
this._visible = true;
}
}
Instance of Symbol 774 MovieClip in Symbol 784 MovieClip Frame 8
onClipEvent (enterFrame) {
if (_quality == "LOW") {
this.stop();
this._visible = false;
} else {
this.play();
this._visible = true;
}
}
Instance of Symbol 791 MovieClip in Symbol 798 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_parent._parent.world.player.scary) {
this._visible = false;
} else {
this._visible = true;
}
if (_quality == "LOW") {
this.gotoAndStop(1);
} else {
this.play();
}
}
Instance of Symbol 804 MovieClip "sbar" in Symbol 809 MovieClip Frame 1
onClipEvent (load) {
wp = _parent._parent.world;
this._xscale = 100;
}
Symbol 848 MovieClip Frame 1
stop();
Instance of Symbol 847 MovieClip "tipNum" in Symbol 848 MovieClip Frame 120
onClipEvent (load) {
stop();
}
Symbol 848 MovieClip Frame 250
gotoAndStop (1);
Symbol 861 Button
on (release) {
res = checkCheat(cht);
cht = "";
}
Symbol 867 Button
on (release) {
play();
}
Symbol 872 Button
on (release) {
_parent.world.jukebox.normMusic.stop();
_parent.world.jukebox.demonMusic.stop();
_root.highScoreGo = false;
_parent.gotoAndPlay(5);
}
Symbol 875 Button
on (press) {
dragging = true;
}
on (release) {
dragging = false;
}
Instance of Symbol 876 MovieClip "knob" in Symbol 877 MovieClip Frame 1
onClipEvent (enterFrame) {
if (dragging) {
if (((_root._xmouse - _parent._x) >= 0) && ((_root._xmouse - _parent._x) <= 200)) {
this._x = _root._xmouse - _parent._x;
}
}
}
onClipEvent (mouseUp) {
dragging = false;
}
Instance of Symbol 876 MovieClip "knob" in Symbol 881 MovieClip Frame 1
onClipEvent (enterFrame) {
if (dragging) {
if (((_root._xmouse - _parent._x) >= 0) && ((_root._xmouse - _parent._x) <= 200)) {
this._x = _root._xmouse - _parent._x;
}
}
}
onClipEvent (mouseUp) {
dragging = false;
}
Symbol 895 MovieClip Frame 1
if (_parent._parent.battleManager.win) {
gotoAndStop (2);
} else {
gotoAndStop (1);
}
Symbol 900 MovieClip Frame 1
if (_parent._parent.battleManager.win) {
gotoAndStop (2);
} else {
gotoAndStop (1);
}
Symbol 917 MovieClip Frame 78
stop();
Symbol 919 Button
on (release) {
_parent.world.jukebox.normMusic.stop();
_parent.world.jukebox.demonMusic.stop();
_root.gotoAndPlay(4);
}
Symbol 929 Button
on (release) {
_parent.world.jukebox.normMusic.stop();
_parent.world.jukebox.demonMusic.stop();
if (_parent.battleManager.score > 0) {
_root.swHighScoreObject.player1Score = _parent.battleManager.score;
trace("_root=" + _root.swHighScoreObject.player1Score);
trace("battleManager score=" + _parent.battleManager.score);
_root.highScoreGo = true;
}
_parent.gotoAndPlay(7);
}
Symbol 977 Button
on (release) {
this.gotoAndPlay("ending");
}
Symbol 982 Button
on (release) {
this.gotoAndPlay("loopage");
}
Symbol 990 MovieClip Frame 1
res = "";
Instance of Symbol 881 MovieClip "vslider" in Symbol 990 MovieClip Frame 1
onClipEvent (enterFrame) {
_parent.sndVol = knob._x / 2;
}
Symbol 990 MovieClip Frame 15
stop();
Symbol 990 MovieClip Frame 22
timein();
stop();
Symbol 990 MovieClip Frame 66
_parent.battleManager.finalBattle = true;
_parent.battleManager.minimumOnscreen = 0;
timein();
stop();
Symbol 990 MovieClip Frame 119
kills = 0;
pickedLevel = "--";
if (_parent.battleManager.level >= 3) {
pickedLevel = levelCode[0];
}
if (_parent.battleManager.level >= 6) {
pickedLevel = levelCode[1];
}
if (_parent.battleManager.level >= 9) {
pickedLevel = levelCode[2];
}
if (_parent.battleManager.level >= 12) {
pickedLevel = levelCode[3];
}
if (_parent.battleManager.level >= 15) {
pickedLevel = levelCode[4];
}
pickedCheat = "--";
var roll = Math.round(Math.random() * (hatCode.length - 1));
trace("Cheat roll=" + roll);
pickedCheat = hatCode[roll];
Instance of Symbol 917 MovieClip "stack" in Symbol 990 MovieClip Frame 120
onClipEvent (enterFrame) {
if (_parent.kills < _parent._parent.battleManager.killCount) {
_parent.kills = _parent.kills + 2;
} else {
this.stop();
_parent.kills = _parent._parent.battleManager.killCount;
}
}
Symbol 990 MovieClip Frame 124
stop();
Symbol 990 MovieClip Frame 125
_parent.world.jukebox.normMusic.stop();
_parent.world.jukebox.demonMusic.start(0, 52800);
_parent.world.jukebox.thatsIt.start();
var rand = (Math.round(Math.random() * 4) + 1);
trans = "";
trace(rand);
switch (rand) {
case 1 :
trans = "\"Your minty breath is offensive to my sensibilities.\"";
break;
case 2 :
trans = "\"I do not like cookies.\"";
break;
case 3 :
trans = "\"Golly gee, now you've done it.\"";
break;
case 4 :
trans = "\"Smacky will no longer tolerate your concerend neighborly acts!\"";
break;
case 5 :
trans = "\"I need to go to the store. I'm out of milk.\"";
}
Symbol 990 MovieClip Frame 385
_parent.world.player.goDemon();
_parent.world.gamePause = false;
Symbol 990 MovieClip Frame 415
timein();
stop();
Symbol 990 MovieClip Frame 425
timein();
gotoAndStop (1);
Symbol 990 MovieClip Frame 437
_parent.battleManager.level++;
_parent.battleManager.levelString = "Level " + _parent.battleManager.level;
_parent._parent.levelDisp.gotoAndPlay(2);
Symbol 990 MovieClip Frame 448
timein();
stop();
Symbol 990 MovieClip Frame 812
timein();
stop();
Symbol 990 MovieClip Frame 1062
timein();
stop();
Symbol 990 MovieClip Frame 1233
stop();
Symbol 990 MovieClip Frame 1454
_parent.battleManager.win = true;
this.gotoAndPlay("overDirect");
Symbol 990 MovieClip Frame 1653
_parent.battleManager.level++;
timein();
stop();