Frame 1
function Encode100(Num) {
if (Num >= 100) {
return("zR");
}
return(chr(65 + parseInt(Num / 10)) + chr(74 + (Num % 10)));
}
function Encode26(Num) {
return(chr(65 + Num));
}
function Encode10(Num) {
return(chr(90 - Num));
}
function EncodeStr(Str) {
var temp;
temp = "";
i = 0;
while (i < Str.length) {
temp = temp + chr(Str.charCodeAt(i) + 5);
i++;
}
return(Encode26(Str.length) + temp);
}
function EncodeNum(Num) {
return(Encode26((Num - (Num % 100)) / 100) + Encode100(Num % 100));
}
function CodeSet(Code) {
this.c = Code;
this.l = 0;
}
function Decode100(Code, Point) {
return(parseInt(((Code.charCodeAt(Point) - 65) * 10) + (Code.charCodeAt(Point + 1) - 74)));
}
function Decode26(Code, Point) {
return(parseInt(Code.charCodeAt(Point) - 65));
}
function Decode10(Code, Point) {
return(parseInt(90 - Code.charCodeAt(Point)));
}
function DecodeStr(Code, Point) {
var temp;
temp = "";
i = 0;
while (i < Decode26(Code, Point)) {
temp = temp + chr(Code.charCodeAt((i + Point) + 1) - 5);
i++;
}
return(temp);
}
function DecodeNum(Code, Point) {
return((Decode26(Code, Point) * 100) + Decode100(Code, Point + 1));
}
function DecodeSet100(CS) {
var p = CS.l;
CS.l = CS.l + 2;
return(Decode100(CS.c, p));
}
function DecodeSet26(CS) {
var p = CS.l;
CS.l = CS.l + 1;
return(Decode26(CS.c, p));
}
function DecodeSet10(CS) {
var p = CS.l;
CS.l = CS.l + 1;
return(Decode10(CS.c, p));
}
function DecodeSetStr(CS) {
var p = CS.l;
trace(Decode26(CS.c, p) + 1);
CS.l = CS.l + (Decode26(CS.c, p) + 1);
return(DecodeStr(CS.c, p));
}
function DecodeSetNum(CS) {
var p = CS.l;
CS.l = CS.l + 3;
return(DecodeNum(CS.c, p));
}
function DecodeSetPar(CS, ST) {
var p = CS.l;
CS.l++;
return(Cs.c.charAt(p) == ST);
}
function EncodePlayer() {
var temp = new String();
var i;
temp = temp + Encode26(playerEpisode);
temp = temp + "N";
i = 0;
while (i < 4) {
temp = temp + EncodeNum(playerMaxStats[i]);
i++;
}
temp = temp + "E";
temp = temp + EncodeNum(playerCurStats[1]);
temp = temp + EncodeNum(playerCurStats[3]);
temp = temp + "O";
i = 0;
while (i < 5) {
temp = temp + Encode26(playerInventory[i] + i);
i++;
}
temp = temp + "N";
temp = temp + Encode10(playerLevel);
return(temp);
}
function DecodePlayer(Code) {
var CS = new CodeSet(Code);
var i;
i = 0;
while (i < Code.length) {
if ((Code.charCodeAt(i) < 65) || (Code.charCodeAt(i) > 90)) {
return(false);
}
i++;
}
playerEpisode = DecodeSet26(CS);
if (!DecodeSetPar(CS, "N")) {
return(false);
}
i = 0;
while (i < 4) {
playerMaxStats[i] = DecodeSetNum(CS);
i++;
}
if (!DecodeSetPar(CS, "E")) {
return(false);
}
playerCurStats[0] = playerMaxStats[0];
playerCurStats[1] = DecodeSetNum(CS);
playerCurStats[2] = playerMaxStats[2];
playerCurStats[3] = DecodeSetNum(CS);
if (!DecodeSetPar(CS, "O")) {
return(false);
}
i = 0;
while (i < 5) {
playerInventory[i] = DecodeSet26(CS) - i;
i++;
}
if (!DecodeSetPar(CS, "N")) {
return(false);
}
playerLevel = DecodeSet10(CS);
return(true);
}
function getNextLevel(cur, low, hi) {
cur++;
if ((cur >= hi) || (cur < low)) {
return(low);
}
return(cur);
}
MAP_LOWER_LIM = 1;
MAP_UPPER_LIM = 200;
EOBJ_LOWER_LIM = 200;
EOBJ_UPPER_LIM = 250;
SHADOW_LOWER_LIM = 251;
SHADOW_UPPER_LIM = 259;
ATTACK_LOWER_LIM = 260;
ATTACK_UPPER_LIM = 300;
FX_LOWER_LIM = 300;
FX_UPPER_LIM = 400;
slashCount = 0;
fxCount = 0;
attackLevel = 0;
eobjCount = 0;
function generateFullMapDisplay(w, h) {
FullMap.generateMapDisplay(w, h);
}
function updateFullMapDisplay(sx, sy, w, h) {
var i;
var j;
var k;
var displayFrame;
i = 0;
while (i < w) {
j = 0;
while (j < h) {
if ((playerGrid[i][j] % 2) == 1) {
if ((MapGrid[i][j] >> 4) > 0) {
displayFrame = 1;
} else {
displayFrame = 5;
}
displayFrame = displayFrame + (MapGrid[i][j] % 4);
} else {
displayFrame = 5;
if ((((i + 1) < w) && ((playerGrid[i + 1][j] % 2) == 1)) && ((MapGrid[i][j] & 1) > 0)) {
displayFrame = displayFrame + 1;
}
if ((((j + 1) < h) && ((playerGrid[i][j + 1] % 2) == 1)) && ((MapGrid[i][j] & 2) > 0)) {
displayFrame = displayFrame + 2;
}
}
eval ((("FullMap.Grid" + i) + "-") + j).gotoAndStop(displayFrame);
j++;
}
i++;
}
FullMap.setPlayerIcon(sx, sy);
}
function generateMapDisplay(w, h) {
var i;
var j;
c = 1;
i = 0;
while (i < w) {
j = 0;
while (j < h) {
c = getNextLevel(c, MAP_LOWER_LIM, MAP_UPPER_LIM);
duplicateMovieClip ("oMapIndicator", (("Grid" + i) + "-") + j, c);
eval ((("Grid" + i) + "-") + j)._x = (oMapIndicator._width * i) + DISPLAY_OFFSET_X;
eval ((("Grid" + i) + "-") + j)._y = (oMapIndicator._height * j) + DISPLAY_OFFSET_Y;
j++;
}
i++;
}
}
function removeMapDisplay(w, h) {
var i;
var j;
i = 0;
while (i < w) {
j = 0;
while (j < h) {
removeMovieClip((("Grid" + i) + "-") + j);
j++;
}
i++;
}
}
function updateMapDisplay(sx, sy, w, h) {
var i;
var j;
var k;
var displayFrame;
i = 0;
while (i < w) {
j = 0;
while (j < h) {
if (!isLegalSpace(sx + i, sy + j)) {
displayFrame = 1;
} else {
displayFrame = (Maze[sx + i][sy + j] >> 8) + 1;
if ((Maze[sx + i][sy + j] % 16) > 0) {
if (((Maze[sx + i][sy + j] % 16) <= 4) || ((Maze[sx + i][sy + j] % 16) == 11)) {
if ((Maze[sx + i][sy + j] >> 8) == 0) {
displayFrame = 13;
} else {
displayFrame = 9;
}
} else if ((Maze[sx + i][sy + j] % 16) <= 8) {
displayFrame = 10;
} else if ((Maze[sx + i][sy + j] >> 8) == 0) {
displayFrame = 12;
} else {
displayFrame = 11;
}
}
}
if ((playerX == (sx + i)) && (playerY == (sy + j))) {
displayFrame = displayFrame + 16;
}
eval ((("Grid" + i) + "-") + j).gotoAndStop(displayFrame);
j++;
}
i++;
}
}
c = 1;
DISPLAY_OFFSET_X = 40;
DISPLAY_OFFSET_Y = 20;
function createSquareRoom(x, y, connections, special) {
var sx = (x * ROOM_SIZE);
var sy = (y * ROOM_SIZE);
var wall = new Array(4);
var wallCount = 0;
var i;
var j;
i = 0;
while (i < ROOM_SIZE) {
j = 0;
while (j < ROOM_SIZE) {
Maze[sx + i][sy + j] = TILE_EMPTY;
j++;
}
i++;
}
if (special > 0) {
i = 0;
while (i < ROOM_SIZE) {
Maze[(sx + ROOM_SIZE) - 1][sy + i] = TILE_FILLED;
i++;
}
if (((connections >> 0) % 2) != 0) {
Maze[sx + 4][sy + 2] = TILE_EW_DOOR;
}
i = 0;
while (i < ROOM_SIZE) {
Maze[sx + i][(sy + ROOM_SIZE) - 1] = TILE_FILLED;
i++;
}
if (((connections >> 1) % 2) != 0) {
Maze[sx + 2][sy + 4] = TILE_NS_DOOR;
}
i = 0;
while (i < ROOM_SIZE) {
Maze[sx][sy + i] = TILE_FILLED;
i++;
}
if (((connections >> 2) % 2) != 0) {
Maze[sx + 0][sy + 2] = TILE_EW_DOOR;
}
i = 1;
while (i < (ROOM_SIZE - 1)) {
Maze[sx + i][sy] = TILE_FILLED;
i++;
}
if (((connections >> 3) % 2) != 0) {
Maze[sx + 2][sy + 0] = TILE_NS_DOOR;
}
}
var LightType = (7 + random(2));
if (special == 1) {
Maze[sx + 1][sy + 1] = Maze[sx + 1][sy + 1] + LightType;
Maze[sx + 1][sy + 3] = Maze[sx + 1][sy + 3] + LightType;
Maze[sx + 3][sy + 1] = Maze[sx + 3][sy + 1] + LightType;
Maze[sx + 3][sy + 3] = Maze[sx + 3][sy + 3] + LightType;
} else if (special == 2) {
Maze[sx + 2][sy + 1] = Maze[sx + 2][sy + 1] + OBJ_MAT;
Maze[sx + 2][sy + 3] = Maze[sx + 2][sy + 3] + OBJ_MAT;
Maze[sx + 1][sy + 2] = Maze[sx + 1][sy + 2] + OBJ_MAT;
Maze[sx + 3][sy + 2] = Maze[sx + 3][sy + 2] + OBJ_MAT;
Maze[sx + 2][sy + 2] = Maze[sx + 2][sy + 2] + (OBJ_CHEST + FACING_WEST);
} else {
Maze[sx + 1][sy + 1] = GardenType();
Maze[sx + 1][sy + 2] = GardenType();
Maze[sx + 1][sy + 3] = GardenType();
Maze[sx + 2][sy + 1] = GardenType();
Maze[sx + 2][sy + 2] = GardenType();
Maze[sx + 2][sy + 3] = GardenType();
Maze[sx + 3][sy + 1] = GardenType();
Maze[sx + 3][sy + 2] = GardenType();
Maze[sx + 3][sy + 3] = GardenType();
Maze[sx + 2][sy + 2] = OBJ_GARDEN_LIGHT;
}
}
function createCorridor(x, y, connections) {
var sx = (x * ROOM_SIZE);
var sy = (y * ROOM_SIZE);
var i;
var j;
i = 0;
while (i < ROOM_SIZE) {
j = 0;
while (j < ROOM_SIZE) {
Maze[sx + i][sy + j] = TILE_FILLED;
j++;
}
i++;
}
if ((((connections >> 0) % 2) != 0) && (((connections >> 2) % 2) != 0)) {
i = 0;
while (i < ROOM_SIZE) {
Maze[sx + i][sy + 2] = TILE_EMPTY;
i++;
}
}
if ((((connections >> 1) % 2) != 0) && (((connections >> 3) % 2) != 0)) {
i = 0;
while (i < ROOM_SIZE) {
Maze[sx + 2][sy + i] = TILE_EMPTY;
i++;
}
}
}
function forceGridConnection(i, j, t) {
var k;
var l;
t = t >> 4;
switch (t) {
case 0 :
k = i + 1;
l = j;
break;
case 1 :
k = i;
l = j + 1;
break;
case 2 :
k = i - 1;
l = j;
break;
case 3 :
k = i;
l = j - 1;
}
MapGrid[i][j] = MapGrid[i][j] + (1 << t);
MapGrid[k][l] = MapGrid[k][l] + (1 << ((t + 2) % 4));
MapGrid[k][l] = (MapGrid[k][l] % 16) + ((MapGrid[i][j] >> 4) << 4);
RoomCount++;
}
function createTutorialMap(w, h) {
var i;
var j;
var k;
var l;
var t;
MapGrid = new Array(w);
i = 0;
while (i < w) {
MapGrid[i] = new Array(h);
j = 0;
while (j < h) {
MapGrid[i][j] = 0;
j++;
}
i++;
}
MapGrid[0][h - 1] = 16;
MapGrid[w - 1][0] = 16;
RoomCount = 2;
forceGridConnection(0, 4, FACING_EAST);
forceGridConnection(1, 4, FACING_EAST);
forceGridConnection(2, 4, FACING_NORTH);
forceGridConnection(2, 3, FACING_NORTH);
forceGridConnection(2, 2, FACING_EAST);
forceGridConnection(2, 2, FACING_NORTH);
forceGridConnection(2, 1, FACING_NORTH);
forceGridConnection(2, 0, FACING_EAST);
forceGridConnection(3, 0, FACING_EAST);
playerGrid = new Array(w);
i = 0;
while (i < w) {
playerGrid[i] = new Array(h);
j = 0;
while (j < h) {
playerGrid[i][j] = 0;
j++;
}
i++;
}
playerGrid[2][0] = playerGrid[2][0] + MAP_ENEMY;
playerGrid[2][0] = playerGrid[2][0] + 0;
playerGrid[2][2] = playerGrid[2][2] + MAP_TRAP;
playerGrid[2][2] = playerGrid[2][2] + 16;
playerGrid[2][4] = playerGrid[2][4] + MAP_TRAP;
playerGrid[2][4] = playerGrid[2][4] + 0;
}
function generateTutorialMap() {
var i;
var j;
scrollsFound = 0;
headsFound = 0;
GRID_WIDTH = 5;
GRID_HEIGHT = 5;
Maze = new Array(GRID_WIDTH * ROOM_SIZE);
i = 0;
while (i < (GRID_WIDTH * ROOM_SIZE)) {
Maze[i] = new Array(GRID_HEIGHT * ROOM_SIZE);
j = 0;
while (j < (GRID_HEIGHT * ROOM_SIZE)) {
Maze[i][j] = TILE_FILLED;
j++;
}
i++;
}
createTutorialMap(GRID_WIDTH, GRID_HEIGHT);
createSquareRoom(0, 4, MapGrid[0][4] % 16, 1);
createSquareRoom(2, 4, MapGrid[2][4] % 16, 1);
createSquareRoom(2, 2, MapGrid[2][2] % 16, 0);
createSquareRoom(3, 2, MapGrid[3][2] % 16, 2);
createSquareRoom(2, 0, MapGrid[2][0] % 16, 1);
createCorridor(1, 4, MapGrid[1][4] % 16);
createCorridor(2, 1, MapGrid[2][1] % 16);
createCorridor(2, 3, MapGrid[2][3] % 16);
createCorridor(3, 0, MapGrid[3][0] % 16);
createFinalRoom(GRID_WIDTH - 1, 0);
Maze[(4 * ROOM_SIZE) + 2][2] = TILE_GARDEN;
}
ROOM_SIZE = 5;
MISSION_TYPE = 0;
TREASURE_PCT = 1;
TRAP_DIFFICULTY = 1;
ENEMY_DIFFICULTY = 1;
ENEMY_PATROL_LEVEL = 1;
SCROLLS_HIDDEN = 0;
BOSSES_HIDDEN = 0;
IN_GAME_TUTORIAL = false;
GRID_WIDTH = 8;
GRID_HEIGHT = 8;
MIN_ROOM_COUNT = Math.floor((GRID_WIDTH * GRID_HEIGHT) / 2);
MIN_EXTRA_CONNECTIONS = 0;
MAX_EXTRA_CONNECTIONS = Math.floor((GRID_WIDTH * GRID_HEIGHT) / 50);
TILE_GARDEN = 0;
TILE_EW_DOOR = 1792;
TILE_NS_DOOR = 1280;
TILE_EMPTY = 1024;
TILE_FILLED = 1536;
TILE_SEARCHED = 64;
FACING_EAST = 0;
FACING_SOUTH = 16;
FACING_WEST = 32;
FACING_NORTH = 48;
OBJ_GARDEN_LIGHT = 9;
OBJ_MAT = 10;
OBJ_SCROLL_CHEST = 11;
OBJ_CHEST = 3;
OBJ_BISHOJO = 12;
MAP_ENEMY = 2;
MAP_TRAP = 4;
function Timer() {
this.startTime = getTimer();
this.timeOver = function (i) {
return(getTimer() > (this.startTime + i));
};
this.resetTimer = function () {
this.startTime = getTimer();
};
this.getTimeDifference = function () {
return(getTimer() - this.startTime);
};
}
function normalAngle(flashAngle) {
if (flashAngle < 0) {
flashAngle = 360 + flashAngle;
}
return(flashAngle);
}
function toX(angle, distance) {
return(Math.round(Math.cos(((angle - 90) / 180) * Math.PI) * distance));
}
function toY(angle, distance) {
return(Math.round(Math.sin(((angle - 90) / 180) * Math.PI) * distance));
}
function displacementAngle(xDisp, yDisp) {
if (xDisp == 0) {
xDisp = 0.1;
}
if (yDisp == 0) {
yDisp = 0.1;
}
return(normalAngle((Math.atan2(yDisp, xDisp) / (Math.PI/180)) + 90));
}
function diagonal(xDisp, yDisp) {
return(Math.sqrt((xDisp * xDisp) + (yDisp * yDisp)));
}
function scaledDistanceX(dispX, dispY, scale) {
if (dispY == 0) {
dispY = 0.001;
}
var slope = (dispY / dispX);
if (dispX > 0) {
return(Math.sqrt((scale * scale) / ((slope * slope) + 1)));
}
return(-Math.sqrt((scale * scale) / ((slope * slope) + 1)));
}
function scaledDistanceY(dispX, dispY, scale) {
if (dispX == 0) {
dispX = 0.001;
}
var slope = (dispX / dispY);
if (dispY > 0) {
return(Math.sqrt((scale * scale) / ((slope * slope) + 1)));
}
return(-Math.sqrt((scale * scale) / ((slope * slope) + 1)));
}
function angleDifference(A, B) {
var difference = Math.abs(normalAngle(A) - normalAngle(B));
if (difference > 180) {
return(360 - difference);
}
return(difference);
}
function angleApproach(src, dest) {
src = normalAngle(src);
dest = normalAngle(dest);
if (src < dest) {
if ((dest - src) < 180) {
return(1);
}
return(-1);
}
if ((src - dest) < 180) {
return(-1);
}
return(1);
}
function verticalLineIntersect(x1, y1, x2, y2, xi, yi1, yi2) {
if (x1 > x2) {
var t = x1;
x1 = x2;
x2 = t;
t = y1;
y1 = y2;
y2 = t;
}
if ((xi < x1) || (xi > x2)) {
return(false);
}
var m = ((y2 - y1) / (x2 - x1));
var y = ((m * (xi - x1)) + y1);
return((y > yi1) && (y < yi2));
}
function horizontalLineIntersect(x1, y1, x2, y2, xi1, xi2, yi) {
if (y1 > y2) {
var t = x1;
x1 = x2;
x2 = t;
t = y1;
y1 = y2;
y2 = t;
}
if ((yi < y1) || (yi > y2)) {
return(false);
}
var m = ((x2 - x1) / (y2 - y1));
var x = ((m * (yi - y1)) + x1);
return((x > xi1) && (x < xi2));
}
function lineIntersectBox(x1, y1, x2, y2, bx, by, w, h) {
if (horizontalLineIntersect(x1, y1, x2, y2, bx, bx + w, by)) {
return(true);
}
if (horizontalLineIntersect(x1, y1, x2, y2, bx, bx + w, by + h)) {
return(true);
}
if (verticalLineIntersect(x1, y1, x2, y2, bx, by, by + h)) {
return(true);
}
if (verticalLineIntersect(x1, y1, x2, y2, bx + h, by, by + h)) {
return(true);
}
return(false);
}
function pointIntersectBox(x1, y1, bx, by, w, h) {
return((((x1 > bx) && (x1 < (bx + w))) && (y1 > by)) && (y1 < (by + h)));
}
function circleIntersectBox(cx, cy, r, bx, by, w, h) {
var x1 = (bx - cx);
var y1 = (by - cy);
var x2 = ((bx + w) - cx);
var y2 = ((by + h) - cy);
r = r;
if (x2 < 0) {
if (y2 < 0) {
return((r * r) > ((x2 * x2) + (y2 * y2)));
}
if (y1 > 0) {
return((r * r) > ((x2 * x2) + (y1 * y1)));
}
return(r > (-x2));
}
if (x1 > 0) {
if (y2 < 0) {
return((r * r) > ((x1 * x1) + (y2 * y2)));
}
if (y1 > 0) {
return((r * r) > ((x1 * x1) + (y1 * y1)));
}
return(r > x1);
}
if (y2 < 0) {
return(r > (-y2));
}
if (y1 > 0) {
return(r > y1);
}
return(true);
}
function pointIntersectCircle(x1, y1, cx, cy, r) {
return(Math.sqrt(((x1 - cx) * (x1 - cx)) + ((y1 - cy) * (y1 - cy))) <= r);
}
smokeScreen = true;
autoQuality = true;
adultContent = true;
playerInventory = new Array(5);
i = 0;
while (i < 5) {
playerInventory[i] = 0;
i++;
}
playerMaxStats = new Array(4);
playerCurStats = new Array(4);
i = 0;
while (i < 3) {
playerMaxStats[i] = 20;
playerCurStats[i] = 20;
i++;
}
playerMaxStats[3] = 0;
playerMaxStats[3] = 0;
playerLevel = 0;
playerEpisode = 0;
openingLoopPlaying = false;
bishojoName = new Array(15);
bishojoName[0] = "Tutorial";
bishojoName[1] = "Makoto";
bishojoName[2] = "Mai";
bishojoName[3] = "Ayame";
bishojoName[4] = "Ryoko";
bishojoName[5] = "Zelda";
bishojoName[6] = "Yuri";
bishojoName[7] = "Ren";
bishojoName[8] = "Natsumi";
bishojoName[9] = "Akari";
bishojoName[10] = "Hitomi";
bishojoName[11] = "Kanako";
bishojoName[12] = "Lara";
bishojoName[13] = "Red Fox";
bishojoName[14] = "Rei";
playerPass = null;
Frame 2
stop();
Frame 653
previousScene = "sceneMainMenu";
Frame 654
openingLoop.startLoop();
Frame 674
stop();
Frame 686
if ((selectedItem != "sceneGraphicsOptions") && (selectedItem != "sceneNewAdventure")) {
openingLoop.fadeLoop();
stop();
}
Frame 691
_root.gotoAndPlay(selectedItem);
Instance of Symbol 283 MovieClip "objSmokeScreen" in Frame 692
onClipEvent (load) {
if (!_root.smokeScreen) {
gotoAndStop (693);
} else {
stop();
}
}
Instance of Symbol 283 MovieClip "objAutoQuality" in Frame 692
onClipEvent (load) {
if (!_root.autoQuality) {
gotoAndStop (693);
} else {
stop();
}
}
Instance of Symbol 291 MovieClip "objQuality" in Frame 692
onClipEvent (load) {
if (_quality == "MEDIUM") {
gotoAndStop (693);
} else if (_quality == "HIGH") {
gotoAndStop (694);
} else {
stop();
}
}
Instance of Symbol 283 MovieClip "objAdultContent" in Frame 692
onClipEvent (load) {
if (!_root.adultContent) {
gotoAndStop (693);
} else {
stop();
}
}
Frame 708
stop();
Frame 724
_root.gotoAndPlay(previousScene);
Frame 726
openingLoop.startLoop();
scoretable.HSTIME0 = "-100";
scoretable.filename = "scores/score.sco";
scoretable.scoresize = 8;
scoretable.seed = Math.round(Math.random() * 10000);
if (previousScene == "sceneEnterScore") {
scoretable.action = "INSERT";
scoretable.winname = _root.roninName;
scoretable.wintime = _root.roninTime;
scoretable.winwave = _root.roninWave;
} else {
scoretable.action = "VIEW";
}
scoretable.viewtype = "FLASH";
scoretable.loadVariables("http://kuiki.net/jamus_se/SamuraiHS/scores.php", "GET");
timeOutTimer = new Timer();
Frame 728
if (scoretable.HSTIME0 == "-100") {
if (timeOutTimer.timeOver(15000)) {
_root.gotoAndStop("scoreError");
} else {
prevFrame();
play();
}
} else {
scoretable.renameTime();
}
Frame 742
stop();
Frame 754
openingLoop.fadeLoop();
stop();
Frame 755
_root.gotoAndPlay("sceneMainMenu");
Frame 757
stop();
Frame 775
MISSION_TYPE = 0;
arenaMode = false;
playerInventory[0] = 1;
playerInventory[1] = 0;
playerInventory[2] = 0;
playerInventory[3] = 0;
playerInventory[4] = 0;
playerMaxStats[0] = 40;
playerMaxStats[1] = 40;
playerMaxStats[2] = 40;
playerMaxStats[3] = 15;
playerCurStats[0] = 40;
playerCurStats[1] = 40;
playerCurStats[2] = 40;
playerCurStats[3] = 15;
playerLevel = 3;
playerEpisode = 0;
GRID_WIDTH = 5;
GRID_HEIGHT = 5;
TREASURE_PCT = -1;
TRAP_DIFFICULTY = 0;
ENEMY_DIFFICULTY = 0;
ENEMY_PATROL_LEVEL = -1;
SCROLLS_HIDDEN = 0;
BOSSES_HIDDEN = 0;
TUTORIAL = true;
IN_GAME_TUTORIAL = false;
gotoScene = "sceneAdventure";
_root.gotoAndPlay(gotoScene);
Frame 789
MISSION_TYPE = 0;
arenaMode = true;
playerInventory[0] = 0;
playerInventory[1] = 0;
playerInventory[2] = 0;
playerInventory[3] = 0;
playerInventory[4] = 0;
playerMaxStats[0] = 60;
playerMaxStats[1] = 60;
playerMaxStats[2] = 60;
playerMaxStats[3] = 45;
playerCurStats[0] = 60;
playerCurStats[1] = 60;
playerCurStats[2] = 60;
playerCurStats[3] = 0;
playerLevel = 4;
playerEpisode = 0;
GRID_WIDTH = 1;
GRID_HEIGHT = 1;
TREASURE_PCT = 0;
TRAP_DIFFICULTY = 0;
ENEMY_DIFFICULTY = 0;
ENEMY_PATROL_LEVEL = 0;
SCROLLS_HIDDEN = 0;
BOSSES_HIDDEN = 0;
TUTORIAL = false;
IN_GAME_TUTORIAL = false;
gotoScene = "sceneAdventure";
_root.gotoAndPlay(gotoScene);
Frame 805
function addToPile() {
bCount++;
duplicateMovieClip ("oBishojo", "bishojo" + bcount, bCount);
bishojoPile[bishojoPile.length] = eval ("bishojo" + bcount);
updatePile();
}
function updatePile() {
var temp;
var i;
var j;
i = bishojoPile.length - 1;
while (i >= 0) {
j = 1;
while (j < i) {
if (bishojoPile[j]._y < bishojoPile[j + 1]._y) {
temp = bishojoPile[j];
bishojoPile[j] = bishojoPile[j + 1];
bishojoPile[j + 1] = temp;
}
j++;
}
i--;
}
i = bishojoPile.length - 1;
while (i >= 0) {
j = 0;
while (j < i) {
if (bishojoPile[j].getDepth() < bishojoPile[j + 1].getDepth()) {
bishojoPile[j].swapDepths(bishojoPile[j + 1]);
}
j++;
}
i--;
}
}
someHandler = new Object();
someHandler.onMouseDown = function () {
if (summonBox.hitTest(_xmouse, _ymouse, true)) {
return(undefined);
}
var i = 0;
while (i < bishojoPile.length) {
if (bishojoPile[i].sprites.box.hitTest(_xmouse, _ymouse)) {
bSelected = bishojoPile[i];
bOffsetX = bishojoPile[i]._x - _xmouse;
bOffsetY = bishojoPile[i]._y - _ymouse;
return(undefined);
}
i++;
}
if (bgPic._currentframe == bgPic._totalframes) {
bgPic.gotoAndStop(2);
} else {
bgPic.nextFrame();
}
};
someHandler.onMouseUp = function () {
if (((bSelected._x < 0) || (bSelected._x > 550)) || (bSelected._y < 200)) {
var i = 0;
while (i < bishojoPile.length) {
if (bishojoPile[i] == bSelected) {
bishojoPile.splice(i, 1);
removeMovieClip(bSelected._name);
bSelected = null;
return(undefined);
}
i++;
}
}
if (!bDouble) {
bDouble = true;
bDoubleTimer.resetTimer();
} else {
bSelected.play();
}
bSelected = null;
return(undefined);
};
Mouse.addListener(someHandler);
bishojoPile = new Array();
bDouble = false;
bDoubleTimer = new Timer();
bDisable = false;
bDisableTimer = new Timer();
bCount = 0;
bSelected = null;
bOffsetX = 0;
bOffsetY = 0;
gotoScene = null;
nextBishojo = -1;
Instance of Symbol 418 MovieClip "bgPic" in Frame 805
onClipEvent (load) {
gotoAndStop (806);
}
Frame 821
bCount++;
duplicateMovieClip ("sOriginal", "summonBox", 1);
bishojoPile[0] = summonBox;
sOriginal._visible = false;
Frame 823
if (summonBox.hitTest(_xmouse, _ymouse, true)) {
bDisable = false;
if (!summonBox.viewable) {
summonBox.play();
}
}
if (((!summonBox.hitTest(_xmouse, _ymouse, true)) && (summonBox.viewable)) && (!bDisable)) {
bDisable = true;
bDisableTimer.resetTimer();
}
if (bDisable && (bDisableTimer.timeOver(800))) {
bDisable = false;
summonBox.play();
}
if (bSelected != null) {
bSelected.moveTo(_xmouse + bOffsetX, _ymouse + bOffsetY);
updatePile();
}
if (bDouble && (bDoubleTimer.timeOver(400))) {
bDouble = false;
}
if (gotoScene == null) {
prevFrame();
play();
}
Frame 824
i = 0;
while (i < bishojoPile.length) {
bishojoPile[i].removeMovieClip("");
i++;
}
delete bishojoPile;
Frame 835
_root.gotoAndPlay(gotoScene);
Frame 840
function rerollStats() {
playerInventory[0] = 1;
playerInventory[1] = 0;
playerInventory[2] = 0;
playerInventory[3] = 0;
playerInventory[4] = 0;
playerMaxStats[0] = Math.floor(Math.random() * 15) + 20;
playerMaxStats[1] = Math.floor(Math.random() * 15) + 20;
playerMaxStats[2] = Math.floor(Math.random() * 15) + 20;
playerMaxStats[3] = 4;
playerLevel = 0;
playerEpisode = 0;
i = 0;
while (i < 3) {
playerCurStats[i] = playerMaxStats[i];
i++;
}
playerCurStats[3] = 0;
createEpisode();
}
function createEpisode() {
playerPass = objCustomSetup.playerCode;
levelDifficulty = Math.floor(playerEpisode / 3);
MISSION_TYPE = playerEpisode % 3;
updateEpisode();
}
function updateEpisode() {
if (levelDifficulty > Math.floor(playerEpisode / 3)) {
levelDifficulty = 0;
}
if ((playerEpisode - (levelDifficulty * 3)) < MISSION_TYPE) {
MISSION_TYPE = 0;
}
objDifficulty.update(levelDifficulty);
objEpisode.update(MISSION_TYPE);
}
mapDifficulty = 0;
levelDifficulty = 0;
character = 0;
GRID_WIDTH = 4;
GRID_HEIGHT = 4;
MISSION_TYPE = 0;
arenaMode = false;
Frame 842
if (playerPass == null) {
rerollStats();
objCustomSetup.update(0);
} else {
objCustomSetup.playerCode = playerPass;
DecodePlayer(playerPass);
createEpisode();
objCustomSetup.update(1);
character = 1;
objCharacter.update(character);
}
Frame 857
stop();
Frame 870
if (gotoScene != "sceneGraphicsOptions") {
fader.play();
stop();
}
Frame 872
if (MISSION_TYPE == 3) {
GRID_WIDTH = 6 + Math.floor(Math.random() * 18);
GRID_HEIGHT = 6 + Math.floor(Math.random() * 10);
MAX_BISHOJO = Math.min(8, Math.floor((GRID_WIDTH * GRID_HEIGHT) / 32));
} else {
switch (levelDifficulty) {
case 0 :
GRID_WIDTH = 8;
GRID_HEIGHT = 8;
MAX_BISHOJO = 3;
break;
case 1 :
GRID_WIDTH = 12;
GRID_HEIGHT = 12;
MAX_BISHOJO = 6;
break;
case 2 :
GRID_WIDTH = 24;
GRID_HEIGHT = 16;
MAX_BISHOJO = 8;
}
}
if (MISSION_TYPE == 3) {
switch (levelDifficulty) {
case 0 :
TREASURE_PCT = 3;
TRAP_DIFFICULTY = 2;
ENEMY_DIFFICULTY = 1;
ENEMY_PATROL_LEVEL = 4;
BEST_BISHOJO = 8;
break;
case 1 :
TREASURE_PCT = 2;
TRAP_DIFFICULTY = 3;
ENEMY_DIFFICULTY = 2;
ENEMY_PATROL_LEVEL = 4;
BEST_BISHOJO = 12;
break;
case 2 :
TREASURE_PCT = 2;
TRAP_DIFFICULTY = 4;
ENEMY_DIFFICULTY = 3;
ENEMY_PATROL_LEVEL = 4;
BEST_BISHOJO = 12;
}
} else {
switch (levelDifficulty + (MISSION_TYPE * 3)) {
case 0 :
TREASURE_PCT = 2;
TRAP_DIFFICULTY = 1;
ENEMY_DIFFICULTY = 1;
ENEMY_PATROL_LEVEL = 2;
BEST_BISHOJO = 3;
break;
case 3 :
TREASURE_PCT = 2;
TRAP_DIFFICULTY = 1;
ENEMY_DIFFICULTY = 1;
ENEMY_PATROL_LEVEL = 3;
BEST_BISHOJO = 6;
break;
case 6 :
TREASURE_PCT = 1;
TRAP_DIFFICULTY = 2;
ENEMY_DIFFICULTY = 1;
ENEMY_PATROL_LEVEL = 4;
BEST_BISHOJO = 9;
break;
case 1 :
TREASURE_PCT = 2;
TRAP_DIFFICULTY = 2;
ENEMY_DIFFICULTY = 2;
ENEMY_PATROL_LEVEL = 2;
BEST_BISHOJO = 6;
break;
case 4 :
TREASURE_PCT = 2;
TRAP_DIFFICULTY = 2;
ENEMY_DIFFICULTY = 2;
ENEMY_PATROL_LEVEL = 3;
BEST_BISHOJO = 9;
break;
case 7 :
TREASURE_PCT = 1;
TRAP_DIFFICULTY = 3;
ENEMY_DIFFICULTY = 2;
ENEMY_PATROL_LEVEL = 4;
BEST_BISHOJO = 12;
break;
case 2 :
TREASURE_PCT = 1;
TRAP_DIFFICULTY = 3;
ENEMY_DIFFICULTY = 3;
ENEMY_PATROL_LEVEL = 4;
BEST_BISHOJO = 12;
break;
case 5 :
TREASURE_PCT = 1;
TRAP_DIFFICULTY = 4;
ENEMY_DIFFICULTY = 3;
ENEMY_PATROL_LEVEL = 4;
BEST_BISHOJO = 12;
break;
case 8 :
TREASURE_PCT = 0;
TRAP_DIFFICULTY = 4;
ENEMY_DIFFICULTY = 3;
ENEMY_PATROL_LEVEL = 4;
BEST_BISHOJO = 12;
}
}
SCROLLS_HIDDEN = 0;
BOSSES_HIDDEN = 0;
switch (MISSION_TYPE) {
case 1 :
SCROLLS_HIDDEN = (levelDifficulty * 2) + 1;
break;
case 2 :
BOSSES_HIDDEN = 1;
break;
case 3 :
SCROLLS_HIDDEN = Math.floor(Math.random() * 3);
BOSSES_HIDDEN = Math.floor(Math.random() * 2);
}
_root.gotoAndPlay(gotoScene);
Frame 873
function advanceStory() {
aLock = false;
if (goForward) {
pages.nextFrame();
} else {
pages.prevFrame();
}
}
function endStory() {
if (goForward) {
fadeScreen.stop();
_root.play();
} else if (pages._currentframe != 1) {
pages.nextFrame();
}
}
goForward = true;
aLock = false;
Frame 874
openingLoop.startLoop();
if (MISSION_TYPE == 3) {
if (preMission) {
_root.gotoAndPlay("sceneAdventure");
} else {
_root.gotoAndPlay("sceneFinishLevel");
}
} else {
var gotoPage = new String();
if (preMission) {
gotoScene = "sceneAdventure";
gotoPage = ("m" + MISSION_TYPE) + "p";
} else {
gotoScene = "sceneFinishLevel";
gotoPage = "m" + MISSION_TYPE;
}
if (adultContent) {
gotoPage = gotoPage + "h";
}
pages.gotoAndStop(gotoPage);
}
Frame 890
stop();
Frame 903
openingLoop.fadeLoop();
stop();
Frame 904
TUTORIAL = false;
IN_GAME_TUTORIAL = false;
_root.gotoAndPlay(gotoScene);
Frame 905
function AddTreasure() {
return((Math.random() * 6) < TREASURE_PCT);
}
function TreasureType() {
var result = (1 + Math.floor(Math.random() * 3));
if (result == 3) {
result = 4;
}
if (Math.random() < 0.75) {
return(result);
}
return(3);
}
function GardenType() {
if (Math.random() < 0.4) {
return(TILE_GARDEN);
}
return((2 + random(2)) << 8);
}
function createOpeningRoom(x, y) {
var sx = (x * ROOM_SIZE);
var sy = (y * ROOM_SIZE);
var connections = (MapGrid[x][y] % 16);
var i;
var j;
i = 0;
while (i < ROOM_SIZE) {
j = 0;
while (j < ROOM_SIZE) {
Maze[sx + i][sy + j] = TILE_EMPTY;
j++;
}
i++;
}
i = 0;
while (i < ROOM_SIZE) {
Maze[sx + i][sy] = TILE_FILLED;
Maze[sx + i][sy + 1] = TILE_FILLED;
Maze[sx + 3][sy + i] = TILE_FILLED;
Maze[sx + 4][sy + i] = TILE_FILLED;
i++;
}
if (((connections >> 0) % 2) != 0) {
Maze[sx + 4][sy + 2] = TILE_EMPTY;
Maze[sx + 3][sy + 2] = TILE_EW_DOOR;
}
if (((connections >> 3) % 2) != 0) {
Maze[sx + 2][sy + 0] = TILE_EMPTY;
Maze[sx + 2][sy + 1] = TILE_NS_DOOR;
}
var LightType = (7 + random(2));
if (MISSION_TYPE == 0) {
Maze[sx + 1][sy + 3] = Maze[sx + 1][sy + 3] + LightType;
Maze[sx][sy + 2] = TILE_FILLED;
Maze[sx][sy + 3] = TILE_FILLED;
Maze[sx][sy + 4] = TILE_FILLED;
Maze[sx + 1][sy + 4] = TILE_FILLED;
Maze[sx + 2][sy + 4] = TILE_FILLED;
} else {
i = 0;
while (i < 2) {
j = 3;
while (j < ROOM_SIZE) {
Maze[sx + i][sy + j] = GardenType();
j++;
}
i++;
}
Maze[sx + 1][sy + 3] = OBJ_GARDEN_LIGHT;
}
}
function createFinalRoom(x, y) {
var sx = (x * ROOM_SIZE);
var sy = (y * ROOM_SIZE);
i = 0;
while (i < ROOM_SIZE) {
j = 0;
while (j < ROOM_SIZE) {
Maze[sx + i][sy + j] = GardenType();
j++;
}
i++;
}
i = 0;
while (i < ROOM_SIZE) {
Maze[sx + i][(sy + ROOM_SIZE) - 1] = TILE_EMPTY;
i++;
}
i = 0;
while (i < ROOM_SIZE) {
Maze[sx][sy + i] = TILE_EMPTY;
i++;
}
Maze[sx + 2][sy + 2] = (TILE_GARDEN + OBJ_BISHOJO) + TILE_SEARCHED;
}
function createRoom(x, y, connections, roomType) {
var sx = (x * ROOM_SIZE);
var sy = (y * ROOM_SIZE);
var wall = new Array(4);
var wallCount = 0;
var i;
var j;
i = 0;
while (i < ROOM_SIZE) {
j = 0;
while (j < ROOM_SIZE) {
Maze[sx + i][sy + j] = TILE_EMPTY;
j++;
}
i++;
}
if (((connections >> 0) % 2) == 0) {
wall[0] = true;
wallCount++;
i = 0;
while (i < ROOM_SIZE) {
Maze[(sx + ROOM_SIZE) - 1][sy + i] = TILE_FILLED;
i++;
}
}
if (((connections >> 1) % 2) == 0) {
wall[1] = true;
wallCount++;
i = 0;
while (i < ROOM_SIZE) {
Maze[sx + i][(sy + ROOM_SIZE) - 1] = TILE_FILLED;
i++;
}
}
if (((connections >> 2) % 2) == 0) {
wall[2] = true;
wallCount++;
i = 0;
while (i < ROOM_SIZE) {
Maze[sx][sy + i] = TILE_FILLED;
i++;
}
}
if (((connections >> 3) % 2) == 0) {
wall[3] = true;
wallCount++;
i = 0;
while (i < ROOM_SIZE) {
Maze[sx + i][sy] = TILE_FILLED;
i++;
}
}
var AddLight = (Math.random() < 0.33);
var AddGarden = (Math.random() < 0.33);
var AddGardenLight = (Math.random() < 0.33);
var CloseWalls = (Math.random() < 0.2);
var RoomStyle = Math.floor(Math.random() * 2);
var LightType = (7 + Math.floor(Math.random() * 2));
var StoveType = (5 + Math.floor(Math.random() * 2));
if (wallCount <= 1) {
Maze[sx][sy] = TILE_FILLED;
Maze[sx + 1][sy] = TILE_FILLED;
Maze[sx][sy + 1] = TILE_FILLED;
Maze[sx + 1][sy + 1] = TILE_FILLED;
Maze[sx + 3][sy] = TILE_FILLED;
Maze[sx + 4][sy] = TILE_FILLED;
Maze[sx + 3][sy + 1] = TILE_FILLED;
Maze[sx + 4][sy + 1] = TILE_FILLED;
Maze[sx][sy + 3] = TILE_FILLED;
Maze[sx][sy + 4] = TILE_FILLED;
Maze[sx + 1][sy + 3] = TILE_FILLED;
Maze[sx + 1][sy + 4] = TILE_FILLED;
Maze[sx + 3][sy + 3] = TILE_FILLED;
Maze[sx + 4][sy + 3] = TILE_FILLED;
Maze[sx + 3][sy + 4] = TILE_FILLED;
Maze[sx + 4][sy + 4] = TILE_FILLED;
if (RoomStyle == 0) {
if (wall[0]) {
if (AddLight) {
Maze[sx + 3][sy + 2] = Maze[sx + 3][sy + 2] + LightType;
} else if (AddTreasure()) {
Maze[sx + 3][sy + 2] = Maze[sx + 3][sy + 2] + (TreasureType() + FACING_WEST);
} else {
Maze[sx + 3][sy + 2] = TILE_FILLED;
}
}
if (wall[1]) {
if (AddLight) {
Maze[sx + 2][sy + 3] = Maze[sx + 2][sy + 3] + LightType;
} else if (AddTreasure()) {
Maze[sx + 2][sy + 3] = Maze[sx + 2][sy + 3] + (TreasureType() + FACING_NORTH);
} else {
Maze[sx + 2][sy + 3] = TILE_FILLED;
}
}
if (wall[2]) {
if (AddLight) {
Maze[sx + 1][sy + 2] = Maze[sx + 1][sy + 2] + LightType;
} else if (AddTreasure()) {
Maze[sx + 1][sy + 2] = Maze[sx + 1][sy + 2] + (TreasureType() + FACING_EAST);
} else {
Maze[sx + 1][sy + 2] = TILE_FILLED;
}
}
if (wall[3]) {
if (AddLight) {
Maze[sx + 2][sy + 1] = Maze[sx + 2][sy + 1] + LightType;
} else if (AddTreasure()) {
Maze[sx + 2][sy + 1] = Maze[sx + 2][sy + 1] + (TreasureType() + FACING_SOUTH);
} else {
Maze[sx + 2][sy + 1] = TILE_FILLED;
}
}
} else {
if (AddLight) {
if ((!wall[2]) && (!wall[3])) {
Maze[sx + 1][sy + 1] = TILE_EMPTY + LightType;
}
if ((!wall[3]) && (!wall[0])) {
Maze[sx + 3][sy + 1] = TILE_EMPTY + LightType;
}
if ((!wall[0]) && (!wall[1])) {
Maze[sx + 3][sy + 3] = TILE_EMPTY + LightType;
}
if ((!wall[1]) && (!wall[2])) {
Maze[sx + 1][sy + 3] = TILE_EMPTY + LightType;
}
}
if (wall[0]) {
Maze[sx + 3][sy + 2] = TILE_FILLED;
}
if (wall[1]) {
Maze[sx + 2][sy + 3] = TILE_FILLED;
}
if (wall[2]) {
Maze[sx + 1][sy + 2] = TILE_FILLED;
}
if (wall[3]) {
Maze[sx + 2][sy + 1] = TILE_FILLED;
}
}
}
if (wallCount == 2) {
if (wall[0] && (wall[2])) {
if (AddLight) {
if (((x + y) % 2) == 0) {
Maze[sx + 1][sy + 0] = Maze[sx + 1][sy + 0] + LightType;
Maze[sx + 1][sy + 2] = Maze[sx + 1][sy + 2] + LightType;
Maze[sx + 1][sy + 4] = Maze[sx + 1][sy + 4] + LightType;
Maze[sx + 3][sy + 0] = Maze[sx + 3][sy + 0] + LightType;
Maze[sx + 3][sy + 2] = Maze[sx + 3][sy + 2] + LightType;
Maze[sx + 3][sy + 4] = Maze[sx + 3][sy + 4] + LightType;
if (CloseWalls) {
Maze[sx + 1][sy + 1] = TILE_FILLED;
Maze[sx + 1][sy + 3] = TILE_FILLED;
Maze[sx + 3][sy + 1] = TILE_FILLED;
Maze[sx + 3][sy + 3] = TILE_FILLED;
}
} else {
Maze[sx + 1][sy + 1] = Maze[sx + 1][sy + 1] + LightType;
Maze[sx + 1][sy + 3] = Maze[sx + 1][sy + 3] + LightType;
Maze[sx + 3][sy + 1] = Maze[sx + 3][sy + 1] + LightType;
Maze[sx + 3][sy + 3] = Maze[sx + 3][sy + 3] + LightType;
if (CloseWalls) {
Maze[sx + 1][sy + 0] = TILE_FILLED;
Maze[sx + 1][sy + 2] = TILE_FILLED;
Maze[sx + 1][sy + 4] = TILE_FILLED;
Maze[sx + 3][sy + 0] = TILE_FILLED;
Maze[sx + 3][sy + 2] = TILE_FILLED;
Maze[sx + 3][sy + 4] = TILE_FILLED;
if (roomStyle == 0) {
Maze[sx + 2][sy + 2] = TILE_NS_DOOR;
}
} else if (AddTreasure()) {
if (random(2) == 0) {
Maze[sx + 1][sy + 2] = (TILE_EMPTY + TreasureType()) + FACING_EAST;
} else {
Maze[sx + 3][sy + 2] = (TILE_EMPTY + TreasureType()) + FACING_WEST;
}
}
}
} else if (CloseWalls) {
i = 0;
while (i < 5) {
Maze[sx + 1][sy + i] = TILE_FILLED;
Maze[sx + 3][sy + i] = TILE_FILLED;
i++;
}
if (roomStyle == 0) {
Maze[sx + 2][sy + 2] = TILE_NS_DOOR;
}
} else {
Maze[sx + 1][sy + 1] = Maze[sx + 1][sy + 1] + OBJ_MAT;
Maze[sx + 1][sy + 2] = Maze[sx + 1][sy + 2] + OBJ_MAT;
Maze[sx + 1][sy + 3] = Maze[sx + 1][sy + 3] + OBJ_MAT;
Maze[sx + 3][sy + 1] = Maze[sx + 3][sy + 1] + OBJ_MAT;
Maze[sx + 3][sy + 2] = Maze[sx + 3][sy + 2] + OBJ_MAT;
Maze[sx + 3][sy + 3] = Maze[sx + 3][sy + 3] + OBJ_MAT;
if (AddTreasure()) {
if (random(2) == 0) {
Maze[sx + 1][sy + 2] = (TILE_EMPTY + TreasureType()) + FACING_EAST;
} else {
Maze[sx + 3][sy + 2] = (TILE_EMPTY + TreasureType()) + FACING_WEST;
}
}
}
} else if (wall[1] && (wall[3])) {
if (AddLight) {
if (((x + y) % 2) == 0) {
Maze[sx + 0][sy + 1] = Maze[sx + 0][sy + 1] + LightType;
Maze[sx + 2][sy + 1] = Maze[sx + 2][sy + 1] + LightType;
Maze[sx + 4][sy + 1] = Maze[sx + 4][sy + 1] + LightType;
Maze[sx + 0][sy + 3] = Maze[sx + 0][sy + 3] + LightType;
Maze[sx + 2][sy + 3] = Maze[sx + 2][sy + 3] + LightType;
Maze[sx + 4][sy + 3] = Maze[sx + 4][sy + 3] + LightType;
if (CloseWalls) {
Maze[sx + 1][sy + 1] = TILE_FILLED;
Maze[sx + 3][sy + 1] = TILE_FILLED;
Maze[sx + 1][sy + 3] = TILE_FILLED;
Maze[sx + 3][sy + 3] = TILE_FILLED;
}
} else {
Maze[sx + 1][sy + 1] = Maze[sx + 1][sy + 1] + LightType;
Maze[sx + 3][sy + 1] = Maze[sx + 3][sy + 1] + LightType;
Maze[sx + 1][sy + 3] = Maze[sx + 1][sy + 3] + LightType;
Maze[sx + 3][sy + 3] = Maze[sx + 3][sy + 3] + LightType;
if (CloseWalls) {
Maze[sx + 0][sy + 1] = TILE_FILLED;
Maze[sx + 2][sy + 1] = TILE_FILLED;
Maze[sx + 4][sy + 1] = TILE_FILLED;
Maze[sx + 0][sy + 3] = TILE_FILLED;
Maze[sx + 2][sy + 3] = TILE_FILLED;
Maze[sx + 4][sy + 3] = TILE_FILLED;
if (roomStyle == 0) {
Maze[sx + 2][sy + 2] = TILE_EW_DOOR;
}
} else if (AddTreasure()) {
if (random(2) == 0) {
Maze[sx + 2][sy + 1] = (TILE_EMPTY + TreasureType()) + FACING_SOUTH;
} else {
Maze[sx + 2][sy + 3] = (TILE_EMPTY + TreasureType()) + FACING_NORTH;
}
}
}
} else if (CloseWalls) {
i = 0;
while (i < 5) {
Maze[sx + i][sy + 1] = TILE_FILLED;
Maze[sx + i][sy + 3] = TILE_FILLED;
i++;
}
if (roomStyle == 0) {
Maze[sx + 2][sy + 2] = TILE_EW_DOOR;
}
} else {
Maze[sx + 1][sy + 1] = Maze[sx + 1][sy + 1] + OBJ_MAT;
Maze[sx + 2][sy + 1] = Maze[sx + 2][sy + 1] + OBJ_MAT;
Maze[sx + 3][sy + 1] = Maze[sx + 3][sy + 1] + OBJ_MAT;
Maze[sx + 1][sy + 3] = Maze[sx + 1][sy + 3] + OBJ_MAT;
Maze[sx + 2][sy + 3] = Maze[sx + 2][sy + 3] + OBJ_MAT;
Maze[sx + 3][sy + 3] = Maze[sx + 3][sy + 3] + OBJ_MAT;
if (AddTreasure()) {
if (random(2) == 0) {
Maze[sx + 2][sy + 1] = (TILE_EMPTY + TreasureType()) + FACING_SOUTH;
} else {
Maze[sx + 2][sy + 3] = (TILE_EMPTY + TreasureType()) + FACING_NORTH;
}
}
}
} else {
if (AddLight) {
if (!(wall[0] && (wall[1]))) {
Maze[sx + 1][sy + 1] = Maze[sx + 1][sy + 1] + LightType;
}
if (!(wall[1] && (wall[2]))) {
Maze[sx + 3][sy + 1] = Maze[sx + 3][sy + 1] + LightType;
}
if (!(wall[2] && (wall[3]))) {
Maze[sx + 3][sy + 3] = Maze[sx + 3][sy + 3] + LightType;
}
if (!(wall[3] && (wall[0]))) {
Maze[sx + 1][sy + 3] = Maze[sx + 1][sy + 3] + LightType;
}
} else if (AddTreasure()) {
if (wall[0] && (wall[1])) {
Maze[sx + 3][sy + 3] = Maze[sx + 3][sy + 3] + (TreasureType() + FACING_NORTH);
Maze[sx + 2][sy + 3] = Maze[sx + 2][sy + 3] + OBJ_MAT;
Maze[sx + 3][sy + 2] = Maze[sx + 3][sy + 2] + OBJ_MAT;
}
if (wall[1] && (wall[2])) {
Maze[sx + 1][sy + 3] = Maze[sx + 1][sy + 3] + (TreasureType() + FACING_EAST);
Maze[sx + 1][sy + 2] = Maze[sx + 1][sy + 2] + OBJ_MAT;
Maze[sx + 2][sy + 3] = Maze[sx + 2][sy + 3] + OBJ_MAT;
}
if (wall[2] && (wall[3])) {
Maze[sx + 1][sy + 1] = Maze[sx + 1][sy + 1] + (TreasureType() + FACING_SOUTH);
Maze[sx + 1][sy + 2] = Maze[sx + 1][sy + 2] + OBJ_MAT;
Maze[sx + 2][sy + 1] = Maze[sx + 2][sy + 1] + OBJ_MAT;
}
if (wall[3] && (wall[0])) {
Maze[sx + 3][sy + 1] = Maze[sx + 3][sy + 1] + (TreasureType() + FACING_WEST);
Maze[sx + 2][sy + 1] = Maze[sx + 2][sy + 1] + OBJ_MAT;
Maze[sx + 3][sy + 2] = Maze[sx + 3][sy + 2] + OBJ_MAT;
}
}
if (wall[0] && (wall[1])) {
if (AddGarden) {
Maze[sx][sy] = GardenType();
Maze[sx + 1][sy] = GardenType();
Maze[sx][sy + 1] = GardenType();
Maze[sx + 1][sy + 1] = GardenType();
if (AddGardenLight) {
Maze[sx + 1][sy + 1] = OBJ_GARDEN_LIGHT;
} else if (AddTreasure()) {
Maze[sx + 1][sy + 1] = TreasureType() + FACING_EAST;
}
} else {
Maze[sx][sy] = TILE_FILLED;
Maze[sx + 1][sy] = TILE_FILLED;
Maze[sx][sy + 1] = TILE_FILLED;
if (AddTreasure()) {
Maze[sx + 1][sy + 1] = Maze[sx + 1][sy + 1] + (TreasureType() + FACING_EAST);
} else {
Maze[sx + 1][sy + 1] = TILE_FILLED;
}
}
}
if (wall[1] && (wall[2])) {
if (AddGarden) {
Maze[sx + 3][sy] = GardenType();
Maze[sx + 4][sy] = GardenType();
Maze[sx + 3][sy + 1] = GardenType();
Maze[sx + 4][sy + 1] = GardenType();
if (AddGardenLight) {
Maze[sx + 3][sy + 1] = OBJ_GARDEN_LIGHT;
} else if (AddTreasure()) {
Maze[sx + 3][sy + 1] = TreasureType() + FACING_SOUTH;
}
} else {
Maze[sx + 3][sy] = TILE_FILLED;
Maze[sx + 4][sy] = TILE_FILLED;
Maze[sx + 4][sy + 1] = TILE_FILLED;
if (AddTreasure()) {
Maze[sx + 3][sy + 1] = Maze[sx + 3][sy + 1] + (TreasureType() + FACING_SOUTH);
} else {
Maze[sx + 3][sy + 1] = TILE_FILLED;
}
}
}
if (wall[2] && (wall[3])) {
if (AddGarden) {
Maze[sx + 3][sy + 3] = GardenType();
Maze[sx + 4][sy + 3] = GardenType();
Maze[sx + 3][sy + 4] = GardenType();
Maze[sx + 4][sy + 4] = GardenType();
if (AddGardenLight) {
Maze[sx + 3][sy + 3] = OBJ_GARDEN_LIGHT;
} else if (AddTreasure()) {
Maze[sx + 3][sy + 3] = TreasureType() + FACING_WEST;
}
} else {
Maze[sx + 3][sy + 4] = TILE_FILLED;
Maze[sx + 4][sy + 3] = TILE_FILLED;
Maze[sx + 4][sy + 4] = TILE_FILLED;
if (AddTreasure()) {
Maze[sx + 3][sy + 3] = Maze[sx + 3][sy + 3] + (TreasureType() + FACING_WEST);
} else {
Maze[sx + 3][sy + 3] = TILE_FILLED;
}
}
}
if (wall[3] && (wall[0])) {
if (AddGarden) {
Maze[sx][sy + 3] = GardenType();
Maze[sx][sy + 4] = GardenType();
Maze[sx + 1][sy + 3] = GardenType();
Maze[sx + 1][sy + 4] = GardenType();
if (AddGardenLight) {
Maze[sx + 1][sy + 3] = OBJ_GARDEN_LIGHT;
} else if (AddTreasure()) {
Maze[sx + 1][sy + 3] = TreasureType() + FACING_NORTH;
}
} else {
Maze[sx][sy + 4] = TILE_FILLED;
Maze[sx + 1][sy + 4] = TILE_FILLED;
Maze[sx][sy + 3] = TILE_FILLED;
if (AddTreasure()) {
Maze[sx + 1][sy + 3] = Maze[sx + 1][sy + 3] + (TreasureType() + FACING_NORTH);
} else {
Maze[sx + 1][sy + 3] = TILE_FILLED;
}
}
}
if (CloseWalls) {
if (wall[0]) {
i = 0;
while (i < 5) {
Maze[sx + 3][sy + i] = TILE_FILLED;
i++;
}
}
if (wall[1]) {
i = 0;
while (i < 5) {
Maze[sx + i][sy + 3] = TILE_FILLED;
i++;
}
}
if (wall[2]) {
i = 0;
while (i < 5) {
Maze[sx + 1][sy + i] = TILE_FILLED;
i++;
}
}
if (wall[3]) {
i = 0;
while (i < 5) {
Maze[sx + i][sy + 1] = TILE_FILLED;
i++;
}
}
}
}
}
if (wallCount == 3) {
if (roomType == 3) {
if (!wall[0]) {
Maze[sx + 1][sy + 2] = Maze[sx + 1][sy + 2] + (OBJ_SCROLL_CHEST + FACING_EAST);
Maze[sx + 1][sy + 1] = Maze[sx + 1][sy + 1] + OBJ_MAT;
Maze[sx + 1][sy + 3] = Maze[sx + 1][sy + 3] + OBJ_MAT;
}
if (!wall[1]) {
Maze[sx + 2][sy + 1] = Maze[sx + 2][sy + 1] + (OBJ_SCROLL_CHEST + FACING_SOUTH);
Maze[sx + 1][sy + 1] = Maze[sx + 1][sy + 1] + OBJ_MAT;
Maze[sx + 3][sy + 1] = Maze[sx + 3][sy + 1] + OBJ_MAT;
}
if (!wall[2]) {
Maze[sx + 3][sy + 2] = Maze[sx + 3][sy + 2] + (OBJ_SCROLL_CHEST + FACING_WEST);
Maze[sx + 3][sy + 1] = Maze[sx + 3][sy + 1] + OBJ_MAT;
Maze[sx + 3][sy + 3] = Maze[sx + 3][sy + 3] + OBJ_MAT;
}
if (!wall[3]) {
Maze[sx + 2][sy + 3] = Maze[sx + 2][sy + 3] + (OBJ_SCROLL_CHEST + FACING_NORTH);
Maze[sx + 1][sy + 3] = Maze[sx + 1][sy + 3] + OBJ_MAT;
Maze[sx + 3][sy + 3] = Maze[sx + 3][sy + 3] + OBJ_MAT;
}
} else if (roomType == 4) {
if ((!wall[0]) || (!wall[2])) {
Maze[sx + 2][sy + 1] = Maze[sx + 2][sy + 1] + (OBJ_CHEST + FACING_SOUTH);
Maze[sx + 1][sy + 1] = Maze[sx + 1][sy + 1] + (OBJ_CHEST + FACING_SOUTH);
Maze[sx + 3][sy + 1] = Maze[sx + 3][sy + 1] + (OBJ_CHEST + FACING_SOUTH);
Maze[sx + 2][sy + 3] = Maze[sx + 2][sy + 3] + (OBJ_CHEST + FACING_NORTH);
Maze[sx + 1][sy + 3] = Maze[sx + 1][sy + 3] + (OBJ_CHEST + FACING_NORTH);
Maze[sx + 3][sy + 3] = Maze[sx + 3][sy + 3] + (OBJ_CHEST + FACING_NORTH);
}
if ((!wall[1]) || (!wall[3])) {
Maze[sx + 1][sy + 2] = Maze[sx + 1][sy + 2] + (OBJ_CHEST + FACING_EAST);
Maze[sx + 1][sy + 1] = Maze[sx + 1][sy + 1] + (OBJ_CHEST + FACING_EAST);
Maze[sx + 1][sy + 3] = Maze[sx + 1][sy + 3] + (OBJ_CHEST + FACING_EAST);
Maze[sx + 3][sy + 2] = Maze[sx + 3][sy + 2] + (OBJ_CHEST + FACING_WEST);
Maze[sx + 3][sy + 1] = Maze[sx + 3][sy + 1] + (OBJ_CHEST + FACING_WEST);
Maze[sx + 3][sy + 3] = Maze[sx + 3][sy + 3] + (OBJ_CHEST + FACING_WEST);
}
} else if (AddGarden) {
Maze[sx + 1][sy + 1] = GardenType();
Maze[sx + 1][sy + 2] = GardenType();
Maze[sx + 1][sy + 3] = GardenType();
Maze[sx + 2][sy + 1] = GardenType();
Maze[sx + 2][sy + 2] = GardenType();
Maze[sx + 2][sy + 3] = GardenType();
Maze[sx + 3][sy + 1] = GardenType();
Maze[sx + 3][sy + 2] = GardenType();
Maze[sx + 3][sy + 3] = GardenType();
if (AddGardenLight) {
Maze[(sx + 1) + random(3)][(sy + 1) + random(3)] = OBJ_GARDEN_LIGHT;
} else if (bishojoCount < MAX_BISHOJO) {
var objToAdd = (OBJ_BISHOJO + (bishojoCount % 4));
if (bishojoCount >= 4) {
objToAdd = objToAdd + 128;
}
bishojoCount++;
if (!wall[0]) {
Maze[sx + 1][sy + 2] = objToAdd;
}
if (!wall[1]) {
Maze[sx + 2][sy + 1] = objToAdd;
}
if (!wall[2]) {
Maze[sx + 3][sy + 2] = objToAdd;
}
if (!wall[3]) {
Maze[sx + 2][sy + 3] = objToAdd;
}
} else if (AddTreasure() || (AddTreasure())) {
if (!wall[0]) {
Maze[sx + 1][sy + 2] = TreasureType();
Maze[sx + 1][sy + 2] = Maze[sx + 1][sy + 2] + FACING_EAST;
}
if (!wall[1]) {
Maze[sx + 2][sy + 1] = TreasureType();
Maze[sx + 2][sy + 1] = Maze[sx + 2][sy + 1] + FACING_SOUTH;
}
if (!wall[2]) {
Maze[sx + 3][sy + 2] = TreasureType();
Maze[sx + 3][sy + 2] = Maze[sx + 3][sy + 2] + FACING_WEST;
}
if (!wall[3]) {
Maze[sx + 2][sy + 3] = TreasureType();
Maze[sx + 2][sy + 3] = Maze[sx + 2][sy + 3] + FACING_NORTH;
}
}
if (!wall[0]) {
Maze[sx + 3][sy + 2] = TILE_GARDEN;
}
if (!wall[1]) {
Maze[sx + 2][sy + 3] = TILE_GARDEN;
}
if (!wall[2]) {
Maze[sx + 1][sy + 2] = TILE_GARDEN;
}
if (!wall[3]) {
Maze[sx + 2][sy + 1] = TILE_GARDEN;
}
} else if (Math.random() < 0.7) {
if (AddLight) {
Maze[sx + 1][sy + 1] = Maze[sx + 1][sy + 1] + LightType;
Maze[sx + 1][sy + 3] = Maze[sx + 1][sy + 3] + LightType;
Maze[sx + 3][sy + 1] = Maze[sx + 3][sy + 1] + LightType;
Maze[sx + 3][sy + 3] = Maze[sx + 3][sy + 3] + LightType;
} else {
Maze[sx + 1][sy + 1] = Maze[sx + 1][sy + 1] + OBJ_MAT;
Maze[sx + 1][sy + 3] = Maze[sx + 1][sy + 3] + OBJ_MAT;
Maze[sx + 3][sy + 1] = Maze[sx + 3][sy + 1] + OBJ_MAT;
Maze[sx + 3][sy + 3] = Maze[sx + 3][sy + 3] + OBJ_MAT;
}
if (wall[2] && (AddTreasure() || (!wall[0]))) {
Maze[sx + 1][sy + 2] = Maze[sx + 1][sy + 2] + TreasureType();
Maze[sx + 1][sy + 2] = Maze[sx + 1][sy + 2] + FACING_EAST;
}
if (wall[3] && (AddTreasure() || (!wall[1]))) {
Maze[sx + 2][sy + 1] = Maze[sx + 2][sy + 1] + TreasureType();
Maze[sx + 2][sy + 1] = Maze[sx + 2][sy + 1] + FACING_SOUTH;
}
if (wall[0] && (AddTreasure() || (!wall[2]))) {
Maze[sx + 3][sy + 2] = Maze[sx + 3][sy + 2] + TreasureType();
Maze[sx + 3][sy + 2] = Maze[sx + 3][sy + 2] + FACING_WEST;
}
if (wall[1] && (AddTreasure() || (!wall[3]))) {
Maze[sx + 2][sy + 3] = Maze[sx + 2][sy + 3] + TreasureType();
Maze[sx + 2][sy + 3] = Maze[sx + 2][sy + 3] + FACING_NORTH;
}
} else {
Maze[sx + 2][sy + 2] = Maze[sx + 2][sy + 2] + (StoveType + (random(4) << 4));
Maze[sx + 1][sy + 2] = Maze[sx + 1][sy + 2] + OBJ_MAT;
Maze[sx + 2][sy + 1] = Maze[sx + 2][sy + 1] + OBJ_MAT;
Maze[sx + 3][sy + 2] = Maze[sx + 3][sy + 2] + OBJ_MAT;
Maze[sx + 2][sy + 3] = Maze[sx + 2][sy + 3] + OBJ_MAT;
}
if (!wall[0]) {
i = 0;
while (i < ROOM_SIZE) {
if (i != Math.floor(ROOM_SIZE / 2)) {
Maze[sx + 4][sy + i] = TILE_FILLED;
}
i++;
}
Maze[sx + 4][sy + 2] = TILE_EW_DOOR;
}
if (!wall[1]) {
i = 0;
while (i < ROOM_SIZE) {
if (i != Math.floor(ROOM_SIZE / 2)) {
Maze[sx + i][sy + 4] = TILE_FILLED;
}
i++;
}
Maze[sx + 2][sy + 4] = TILE_NS_DOOR;
}
if (!wall[2]) {
i = 0;
while (i < ROOM_SIZE) {
if (i != Math.floor(ROOM_SIZE / 2)) {
Maze[sx + 0][sy + i] = TILE_FILLED;
}
i++;
}
Maze[sx + 0][sy + 2] = TILE_EW_DOOR;
}
if (!wall[3]) {
i = 0;
while (i < ROOM_SIZE) {
if (i != Math.floor(ROOM_SIZE / 2)) {
Maze[sx + i][sy + 0] = TILE_FILLED;
}
i++;
}
Maze[sx + 2][sy + 0] = TILE_NS_DOOR;
}
}
}
function makeGridConnection(w, h) {
do {
i = Math.floor(Math.random() * w);
j = Math.floor(Math.random() * h);
} while ((MapGrid[i][j] >> 4) == 0);
t = random(4);
switch (t) {
case 0 :
k = i + 1;
l = j;
break;
case 1 :
k = i;
l = j + 1;
break;
case 2 :
k = i - 1;
l = j;
break;
case 3 :
k = i;
l = j - 1;
}
if ((((k < 0) || (k == w)) || (l < 0)) || (l == h)) {
return(undefined);
}
if (((MapGrid[i][j] >> 4) != (MapGrid[k][l] >> 4)) || (MapConnects && (ExtraConnections < MAX_EXTRA_CONNECTIONS))) {
if (((MapGrid[i][j] >> t) % 2) == 0) {
if ((MapGrid[i][j] >> 4) == (MapGrid[k][l] >> 4)) {
ExtraConnections++;
}
MapGrid[i][j] = MapGrid[i][j] + (1 << t);
MapGrid[k][l] = MapGrid[k][l] + (1 << ((t + 2) % 4));
if (((MapGrid[i][j] >> 4) > 0) && ((MapGrid[k][l] >> 4) > 0)) {
MapConnects = true;
} else {
MapGrid[k][l] = (MapGrid[k][l] % 16) + ((MapGrid[i][j] >> 4) << 4);
RoomCount++;
}
}
}
}
function findScrollRoom(w, h) {
var i;
var j;
i = Math.floor(((Math.random() * w) / 2) + (w / 2));
j = Math.floor((Math.random() * h) / 2);
if ((i == (w - 1)) && (j == 0)) {
return(undefined);
}
if ((((((MapGrid[i][j] % 16) == 1) || ((MapGrid[i][j] % 16) == 2)) || ((MapGrid[i][j] % 16) == 4)) || ((MapGrid[i][j] % 16) == 8)) && ((MapGrid[i][j] >> 4) < 3)) {
MapGrid[i][j] = (MapGrid[i][j] % 16) + 48;
scrollCount++;
}
}
function findBossRoom(w, h) {
var i;
var j;
i = Math.floor(((Math.random() * w) / 2) + (w / 2));
j = Math.floor((Math.random() * h) / 2);
if ((i == (w - 1)) && (j == 0)) {
return(undefined);
}
if ((((((MapGrid[i][j] % 16) == 1) || ((MapGrid[i][j] % 16) == 2)) || ((MapGrid[i][j] % 16) == 4)) || ((MapGrid[i][j] % 16) == 8)) && ((MapGrid[i][j] >> 4) < 3)) {
MapGrid[i][j] = (MapGrid[i][j] % 16) + 64;
headCount++;
}
}
function createMapGrid(w, h) {
var i;
var j;
var k;
var l;
var t;
MapGrid = new Array(w);
i = 0;
while (i < w) {
MapGrid[i] = new Array(h);
j = 0;
while (j < h) {
MapGrid[i][j] = 0;
j++;
}
i++;
}
MapGrid[0][h - 1] = 16;
MapGrid[w - 1][0] = 32;
MapConnects = false;
RoomCount = 2;
ExtraConnections = 0;
while (((!MapConnects) || (RoomCount < MIN_ROOM_COUNT)) || (ExtraConnections < MIN_EXTRA_CONNECTIONS)) {
makeGridConnection(w, h);
}
scrollCount = 0;
var trial = 0;
while ((scrollCount < SCROLLS_HIDDEN) && (trial < 10000)) {
findScrollRoom(w, h);
trial++;
}
SCROLLS_HIDDEN = scrollCount;
headCount = 0;
trial = 0;
while ((headCount < BOSSES_HIDDEN) && (trial < 10000)) {
findBossRoom(w, h);
trial++;
}
BOSSES_HIDDEN = headCount;
}
function createPlayerGrid(w, h) {
var i;
var j;
var n;
playerGrid = new Array(w);
i = 0;
while (i < w) {
playerGrid[i] = new Array(h);
j = 0;
while (j < h) {
n = 0;
if ((MapGrid[i][j] >> 4) == 3) {
n = n + (MAP_ENEMY + 48);
} else if ((MapGrid[i][j] >> 4) == 4) {
n = n + (MAP_ENEMY + 64);
} else if (Math.random() < 0.25) {
n = n + MAP_ENEMY;
n = n + (Math.floor(Math.random() * ENEMY_PATROL_LEVEL) << 4);
} else if (Math.random() < 0.25) {
n = n + MAP_TRAP;
n = n + ((Math.floor(Math.random() * TRAP_DIFFICULTY) + 1) << 4);
}
if ((i == (w - 1)) && (j == 0)) {
playerGrid[i][j] = 0;
} else {
playerGrid[i][j] = n;
}
j++;
}
i++;
}
}
function generateMap() {
var i;
var j;
scrollsFound = 0;
headsFound = 0;
Maze = new Array(GRID_WIDTH * ROOM_SIZE);
MIN_ROOM_COUNT = Math.floor((GRID_WIDTH * GRID_HEIGHT) / 2);
MIN_EXTRA_CONNECTIONS = 0;
MAX_EXTRA_CONNECTIONS = Math.floor((GRID_WIDTH * GRID_HEIGHT) / 50);
i = 0;
while (i < (GRID_WIDTH * ROOM_SIZE)) {
Maze[i] = new Array(GRID_HEIGHT * ROOM_SIZE);
j = 0;
while (j < (GRID_HEIGHT * ROOM_SIZE)) {
Maze[i][j] = TILE_FILLED;
j++;
}
i++;
}
createMapGrid(GRID_WIDTH, GRID_HEIGHT);
createPlayerGrid(GRID_WIDTH, GRID_HEIGHT);
if (!adultContent) {
MAX_BISHOJO = 0;
}
bishojoCount = 0;
bishojoStock = new Array(MAX_BISHOJO);
i = 0;
while (i < MAX_BISHOJO) {
do {
wasUsed = false;
bishojoStock[i] = Math.floor(Math.random() * BEST_BISHOJO);
j = 0;
while (j < i) {
if (bishojoStock[i] == bishojoStock[j]) {
wasUsed = true;
}
j++;
}
} while (wasUsed);
i++;
}
i = GRID_WIDTH - 1;
while (i >= 0) {
j = 0;
while (j < GRID_HEIGHT) {
if ((((MapGrid[i][j] >> 4) != 0) && (!((i == (GRID_WIDTH - 1)) && (j == 0)))) && (!((i == 0) && (j == (GRID_HEIGHT - 1))))) {
createRoom(i, j, MapGrid[i][j] % 16, MapGrid[i][j] >> 4);
}
j++;
}
i--;
}
createOpeningRoom(0, GRID_HEIGHT - 1);
createFinalRoom(GRID_WIDTH - 1, 0);
}
function continueTutorial(msgType) {
if (contType == CONTINUE_SELECT_TUTORIAL) {
}
if (msgType == contType) {
if ((msgType != CONTINUE_COORDINATE) || (((msgType == CONTINUE_COORDINATE) && (playerX == CONTINUE_X)) && (playerY == CONTINUE_Y))) {
nextTutorial();
}
}
}
function nextTutorial() {
var ReiAction = "talk";
var msg = null;
worldReiPointer.pointToNothing();
contType = CONTINUE_MESSAGE_END;
tutLevel++;
switch (tutLevel) {
case 1 :
msg = "Are you ready to go through this training level? ";
msg = msg + "Let's finish it together!";
break;
case 2 :
msg = "First of all, let's go over some basics on movement. ";
msg = msg + "Try moving your cursor around the screen.";
break;
case 3 :
msg = "The red arrow indicates the turn/move direction. ";
msg = msg + "Try turning around now.";
tutorialTurnLock = false;
tutLevel++;
break;
case 5 :
msg = "The mini-map to the upper left corner has a ";
msg = msg + "compass... and more. Click it now.";
worldReiPointer.pointToObject("worldAutoMap");
contType = CONTINUE_MAP_OPEN;
break;
case 6 :
msg = "The mini map displays details of the area around you. ";
msg = msg + "You can open or close the map by pressing 'M'.";
break;
case 7 :
msg = "Let's move on, shall we? Head toward the exit to the East. ";
msg = msg + "Use the mini-map to guide you if you're lost.";
contType = CONTINUE_COORDINATE;
ReiAction = "stand";
tutorialMoveLock = false;
CONTINUE_X = 3;
CONTINUE_Y = 22;
break;
case 8 :
msg = "You can walk through doors as if they are empty spaces. ";
msg = msg + "Keep going East.";
ReiAction = "stand";
contType = CONTINUE_ENTER_COMBAT;
tutLevel++;
break;
case 10 :
msg = "There's trouble ahead. Prepare yourself for combat!";
break;
case 11 :
msg = "Now is a good time to review the combat interface.";
msg = msg + "Take note on the three bars to the bottom right.";
worldCombatSpace.shurikenMachine.startChuck(1);
worldReiPointer.pointToLocation(440, 350);
contType = CONTINUE_PLAYER_DAMAGED;
break;
case 12 :
msg = "This is your health bar. Needless to say, you'd die ";
msg = msg + "if your health drops to or below zero.";
worldReiPointer.pointToLocation(400, 350);
break;
case 13 :
msg = "Now, let's learn how to block an attack. ";
msg = msg + "First, press and hold spacebar.";
ReiAction = "block";
combatActionLock = false;
contType = CONTINUE_PLAYER_BLOCKING;
break;
case 14 :
msg = "Now, hold the sword over the red attack icon ";
msg = msg + "when it fades out in order to block.";
ReiAction = "block";
worldCombatSpace.shurikenMachine.startChuck(9999);
contType = CONTINUE_ATTACK_BLOCKED;
break;
case 15 :
msg = "Your chi drops when you block. ";
msg = msg + "When chi runs out, even your blocks will take damage.";
ReiAction = "block";
worldReiPointer.pointToLocation(400, 365);
worldCombatSpace.shurikenMachine.stopChuck();
break;
case 16 :
msg = "Now try blocking these last few shuriken traps.";
worldCombatSpace.shurikenMachine.startChuck(5);
worldCombatSpace.shurikenMachine.destroyMachine();
ReiAction = "unblock";
contType = CONTINUE_EXIT_COMBAT;
break;
case 17 :
msg = "Oh no, you're hurt! To see a numerical version ";
msg = msg + "of your stats, left click at the stats.";
worldReiPointer.pointToLocation(440, 350);
tutorialMoveLock = true;
break;
case 18 :
msg = "Time to heal! Your riceball is the ";
msg = msg + "perfect remedy. Double click it to eat it.";
worldReiPointer.pointToLocation(180, 370);
tutorialItemLock = false;
contType = CONTINUE_USE_ITEM;
break;
case 19 :
msg = "Okay, let's move on! Let's head North. ";
msg = msg + "Summon the mini-map by pressing 'M' if you're lost.";
tutorialMoveLock = false;
contType = CONTINUE_ENTER_COMBAT;
ReiAction = "stand";
break;
case 20 :
msg = "How annoying... bamboo blockades! ";
msg = msg + "Let's slice our way through this mess!";
break;
case 21 :
msg = "First, let's learn how to do a slash attack. ";
msg = msg + "Keep your mouse still and hold down the left button.";
ReiAction = "slash";
contType = CONTINUE_START_SLASH;
break;
case 22 :
msg = "Your attack bar starts to drain in this position. ";
msg = msg + "Your slash becomes more powerful as the bar drains.";
worldReiPointer.pointToLocation(400, 332);
ReiAction = "slash";
break;
case 23 :
msg = "Finish the attack by continuing the hold ";
msg = msg + "and moving your mouse downward.";
reiHitTarget = 0;
ReiAction = "slashOut";
tutorialTraceHits = true;
contType = CONTINUE_END_SLASH;
break;
case 24 :
msg = "The location that I'm pointing to is the apex of ";
msg = msg + "your last attack. It's the midpoint of your entire slash.";
worldReiPointer.pointToObject("worldReiPointer");
break;
case 25 :
msg = "If you tried to hit the blockade, you'd notice that ";
msg = msg + "the apex is the only point that can damage your target.";
worldReiPointer.pointToObject("worldReiPointer");
break;
case 26 :
msg = "Okay, let's try out the more precise stab attack. ";
msg = msg + "From a ready position, double click and hold the second click.";
contType = CONTINUE_START_STAB;
break;
case 27 :
msg = "Release your mouse button to release the stab. ";
msg = msg + "The apex of a stab is its end point.";
contType = CONTINUE_END_STAB;
break;
case 28 :
msg = "Okay, let's take out these two blockades. ";
worldReiPointer.pointToObject("worldReiPointer");
ReiAction = "slash";
break;
case 29 :
msg = "Train yourself in both attack types. ";
msg = msg + "You'll need to stab and slash each target to destroy them.";
reiHitTarget = 1;
ReiAction = "slashOut";
contType = CONTINUE_EXIT_COMBAT;
break;
case 30 :
msg = "That was tedious! After all that action, I'm a little lost...";
tutorialMoveLock = true;
tutorialTraceHits = false;
break;
case 31 :
msg = "Fortunately, there's an automap to keep track of our progress.";
msg = msg + "Open it by pressing 'F'.";
contType = CONTINUE_FULL_MAP_OPEN;
break;
case 32 :
msg = "The dot indicates where we are. You can see unexplored passages ";
msg = msg + "to the North and East. Let's go East.";
tutorialMoveLock = false;
contType = CONTINUE_COORDINATE;
CONTINUE_X = 15;
CONTINUE_Y = 12;
break;
case 33 :
msg = "Look, a treasure chest! Let's search it! ";
msg = msg + "Move forward until you're next to the chest.";
contType = CONTINUE_COORDINATE;
CONTINUE_X = 16;
CONTINUE_Y = 12;
break;
case 34 :
msg = "Move your mouse over the chest and left click ";
msg = msg + "to open it.";
tutorialMoveLock = true;
worldReiPointer.pointToLocation(270, 265);
contType = CONTINUE_START_SEARCH;
break;
case 35 :
msg = "Remember, items like swords and armors are all ";
msg = msg + "searchable. Dig around everything you see!";
tutorialMoveLock = false;
break;
case 36 :
msg = "By the way, aren't you ";
msg = msg + "a little tired of using the mouse to move around?";
break;
case 37 :
msg = "There are two sets of keyboard shortcuts for movement: ";
msg = msg + "The keys WASD or the arrow keys.";
break;
case 38 :
msg = "All right, let's get out of this room and head North.";
tutorialLockSquare = false;
ReiAction = "stand";
contType = CONTINUE_ENTER_COMBAT;
break;
case 39 :
msg = "A monster... I know just the thing that can take it ";
msg = msg + "down. Let's use a spirit spell!";
combatActionLock = true;
break;
case 40 :
msg = "This is your spirit bar. It charges by absorbing ";
msg = msg + "spirit energy from slain enemies.";
worldReiPointer.pointToLocation(400, 382);
break;
case 41 :
msg = "The spells you learned are those with a shadow and the ";
msg = msg + "spells that you can cast are solid icons.";
break;
case 42 :
msg = "To cast a spell, press 'C', then left click on the ";
msg = msg + "symbol that appears and the subsequent ones until the spell is cast.";
ReiAction = "stand";
tutorialSpellLock = false;
contType = CONTINUE_CAST_SPELL;
break;
case 43 :
msg = "You are invincible when the spirit spell is in effect. ";
msg = msg + "Now finish up this zombie with your sword!";
ReiAction = "stand";
combatActionLock = false;
contType = CONTINUE_EXIT_COMBAT;
break;
case 44 :
msg = "Hang in there, the test is almost over! ";
msg = msg + "Let's head East.";
contType = CONTINUE_COORDINATE;
CONTINUE_X = 20;
CONTINUE_Y = 2;
break;
case 45 :
msg = "This is it! The exit is here!";
tutorialMoveLock = true;
tutorialTurnLock = true;
break;
case 46 :
msg = "Remember that each mission has a specific objective; ";
msg = msg + "for this test, we just need to find an exit.";
break;
case 47 :
msg = "Whenever you've completed the objective, find me, ";
msg = msg + "and then click on me to end the mission.";
break;
case 48 :
msg = "In this case, here I am. Talk to me when you're ";
msg = msg + "ready to end this training.";
ReiAction = "walkAway";
break;
case 49 :
tutorialMoveLock = false;
tutorialTurnLock = false;
ReiAction = "walkAway";
contType = -1;
}
if (msg != null) {
worldTutorial.noPriorityMessage(msg);
worldTutorial._visible = true;
worldRei.switchTo(ReiAction);
} else {
worldTutorial._visible = false;
worldRei.switchTo(ReiAction);
}
}
function tutorialReiAttacks() {
eval ("_root.worldCombatSpace." + reiTarget[reiHitTarget]).explosion(10);
}
function tutorialReiDeparts() {
Maze[22][2] = (TILE_GARDEN + OBJ_BISHOJO) + TILE_SEARCHED;
renderSpace(PlayerX, PlayerY, PlayerT);
}
CONTINUE_MESSAGE_END = 1;
CONTINUE_FACING_EAST = 2;
CONTINUE_COORDINATE = 3;
CONTINUE_MAP_OPEN = 4;
CONTINUE_FULL_MAP_OPEN = 10;
CONTINUE_ENTER_COMBAT = 5;
CONTINUE_PLAYER_DAMAGED = 6;
CONTINUE_PLAYER_BLOCKING = 7;
CONTINUE_ATTACK_BLOCKED = 8;
CONTINUE_USE_ITEM = 9;
CONTINUE_START_SLASH = 11;
CONTINUE_END_SLASH = 12;
CONTINUE_START_STAB = 13;
CONTINUE_END_STAB = 14;
CONTINUE_START_SEARCH = 15;
CONTINUE_CAST_SPELL = 16;
CONTINUE_X = 0;
CONTINUE_Y = 0;
tutLevel = 0;
contType = -1;
if (TUTORIAL) {
tutorialTurnLock = true;
tutorialMoveLock = true;
combatActionLock = true;
tutorialItemLock = true;
tutorialTraceHits = false;
tutorialLockSquare = true;
tutorialSpellLock = true;
} else {
tutorialTurnLock = false;
tutorialMoveLock = false;
combatActionLock = false;
tutorialItemLock = false;
tutorialTraceHits = false;
tutorialLockSquare = false;
tutorialSpellLock = false;
}
reiTarget = new Array();
function restoreStats() {
ATK_N_RESTORE = Math.ceil(playerMaxStats[0] / 30);
CHI_N_RESTORE = Math.ceil(playerMaxStats[2] / 30);
if (!(inCombat && (combatCursor.isAttacking()))) {
playerCurStats[0] = (((playerCurStats[0] + ATK_N_RESTORE) < playerMaxStats[0]) ? (playerCurStats[0] + ATK_N_RESTORE) : (playerMaxStats[0]));
}
if (!(inCombat && (combatCursor.isBlocking()))) {
playerCurStats[2] = (((playerCurStats[2] + CHI_N_RESTORE) < playerMaxStats[2]) ? (playerCurStats[2] + CHI_N_RESTORE) : (playerMaxStats[2]));
}
updateInterface();
}
function takeHandle() {
handleTaken = true;
}
function releaseHandle() {
handleTaken = false;
}
function updateCombatCursor() {
if (worldInterface.hitTest(combatCursor._x, combatCursor._y)) {
combatCursor.showHand();
} else {
combatCursor.hideHand();
}
}
function updateCursor() {
if (((!worldInterface.hitTest(cursor._x, cursor._y)) && (!worldAutoMap.hitTest(cursor._x, cursor._y))) && (!handleTaken)) {
if (cursor._y < TURN_OFFSET) {
cursor.gotoAndStop("Forward");
cursorAction = CA_FORWARD;
} else if (cursor._x < TURN_OFFSET) {
cursor.gotoAndStop("TurnLeft");
cursorAction = CA_TURNLEFT;
} else if (cursor._x > (SCREEN_WIDTH - TURN_OFFSET)) {
cursor.gotoAndStop("TurnRight");
cursorAction = CA_TURNRIGHT;
} else if (Obj10.hitTest(cursor._x, cursor._y, true) && (canSearch())) {
cursor.gotoAndStop("Search");
cursorAction = CA_SEARCH;
} else if (cursor._y > (SCREEN_HEIGHT - TURN_OFFSET)) {
cursor.gotoAndStop("Reverse");
cursorAction = CA_REVERSE;
} else {
cursor.gotoAndStop("Normal");
cursorAction = CA_NORMAL;
}
} else {
cursor.gotoAndStop("Normal");
cursorAction = CA_NORMAL;
}
}
function setCursorCommand(ca) {
cursorAction = ca;
}
function cursorClick() {
if ((cursorAction == CA_FULLMAP) && (FullMap._visible)) {
showOrHideFullMap();
return(undefined);
}
if (handleTaken) {
return(undefined);
}
switch (cursorAction) {
case CA_FORWARD :
move();
break;
case CA_TURNLEFT :
turnLeft();
break;
case CA_TURNRIGHT :
turnRight();
break;
case CA_REVERSE :
turnLeft();
turnLeft();
break;
case CA_SEARCH :
searchTile();
break;
case CA_FULLMAP :
if (inCombat) {
break;
}
showOrHideFullMap();
}
renderSpace(playerX, playerY, playerT);
if (playerT == 0) {
continueTutorial(CONTINUE_FACING_EAST);
}
}
SCREEN_WIDTH = 550;
SCREEN_HEIGHT = 400;
INTERFACE_HEIGHT = 80;
TURN_OFFSET = 120;
CA_NORMAL = 0;
CA_FORWARD = 1;
CA_TURNLEFT = 2;
CA_TURNRIGHT = 3;
CA_REVERSE = 4;
CA_SEARCH = 5;
CA_FULLMAP = 6;
function move() {
if (TUTORIAL && (tutorialMoveLock)) {
return(undefined);
}
if (lockKeys) {
return(undefined);
}
ox = playerX;
oy = playerY;
if (getAxis(playerT) == AXIS_X) {
playerX = playerX + getInc(playerT);
} else {
playerY = playerY + getInc(playerT);
}
if (isBlockTile(playerX, playerY)) {
playerX = ox;
playerY = oy;
} else if (((playerX == 12) && (playerY == 9)) && (tutorialLockSquare)) {
playerX = ox;
playerY = oy;
worldTutorial.noPriorityMessage("Let's explore the room to the east first.");
} else {
if (((Maze[playerX][playerY] & TILE_NS_DOOR) == TILE_NS_DOOR) || ((Maze[playerX][playerY] & TILE_EW_DOOR) == TILE_EW_DOOR)) {
sndWalk.gotoAndPlay("door");
} else if ((Maze[playerX][playerY] & TILE_EMPTY) == TILE_EMPTY) {
sndWalk.gotoAndPlay("floor");
} else {
sndWalk.gotoAndPlay("grass");
}
combatCheck();
}
continueTutorial(CONTINUE_COORDINATE);
if (((playerGrid[Math.floor(playerX / 5)][Math.floor(playerY / 5)] % 2) == 1) && (((playerX % 5) == 0) || ((playerY % 5) == 0))) {
if (Math.random() < 0.5) {
_root.worldTutorial.newMessage("If you are feeling lost, try pressing 'F' to open up the full map.", 10);
} else {
_root.worldTutorial.newMessage("If you are feeling lost, try pressing 'M' to open up the mini map.", 10);
}
}
}
function turnRight() {
if (TUTORIAL && (tutorialTurnLock)) {
return(undefined);
}
if (lockKeys) {
return(undefined);
}
playerT = (playerT + 1) % 4;
sndWalk.gotoAndPlay("turn");
combatCheck();
}
function turnLeft() {
if (TUTORIAL && (tutorialTurnLock)) {
return(undefined);
}
if (lockKeys) {
return(undefined);
}
playerT--;
if (playerT < 0) {
playerT = 3;
}
sndWalk.gotoAndPlay("turn");
combatCheck();
}
function canSearch() {
var o = getForward();
if ((Maze[o.x][o.y] % 16) == 0) {
return(false);
}
if (((Maze[o.x][o.y] & TILE_SEARCHED) != 0) && ((Maze[o.x][o.y] % 16) != OBJ_BISHOJO)) {
_root.worldTutorial.newMessage("This item has been searched before. It cannot be searched again.", 20);
return(false);
}
if ((Maze[o.x][o.y] % 16) <= 6) {
return(true);
}
if ((getReverse((Maze[o.x][o.y] >> 4) % 4) == playerT) && ((Maze[o.x][o.y] % 16) == 11)) {
return(true);
}
if ((Maze[o.x][o.y] % 16) >= OBJ_BISHOJO) {
return(true);
}
return(false);
}
function searchTile() {
var o = getForward();
if (canSearch()) {
treasureType = Maze[o.x][o.y] % 16;
switch (treasureType) {
case 1 :
sndSearch.gotoAndPlay("sword");
break;
case 2 :
sndSearch.gotoAndPlay("armor");
break;
case 3 :
sndSearch.gotoAndPlay("chest");
break;
case OBJ_BISHOJO :
if ((Maze[o.x][o.y] & TILE_SEARCHED) != 0) {
worldReiMessage.play();
return(undefined);
}
case OBJ_BISHOJO + 1 :
case OBJ_BISHOJO + 2 :
case OBJ_BISHOJO + 3 :
ox = playerX;
oy = playerY;
playerX = o.x;
playerY = o.y;
teaseBox.bName = bishojoName[bishojoStock[((((Maze[o.x][o.y] >> 7) % 2) * 4) + (Maze[o.x][o.y] % 16)) - OBJ_BISHOJO] + 1];
teaseBox.play();
return(undefined);
default :
sndSearch.gotoAndPlay("general");
}
continueTutorial(CONTINUE_START_SEARCH);
worldMessageBox.play();
}
}
function confirmSearch() {
var o = getForward();
Maze[o.x][o.y] = Maze[o.x][o.y] + TILE_SEARCHED;
renderSpace(playerX, playerY, playerT);
}
function autoConsumeItem() {
var i;
i = 0;
while ((i < 5) && (playerInventory[i] != 3)) {
i++;
}
if (i < 5) {
useItem(i);
}
}
function useItem(i) {
if (tutorialItemLock) {
return(undefined);
}
var RICEBALL_HEAL = 25;
var SUSHI_HEAL = 50;
var SAKE_HEAL = 100;
var SHURIKEN_AMOUNT = 10;
switch (playerInventory[i]) {
case 1 :
playerCurStats[1] = (((playerCurStats[1] + RICEBALL_HEAL) > playerMaxStats[1]) ? (playerMaxStats[1]) : (playerCurStats[1] + RICEBALL_HEAL));
sndUseItem.gotoAndPlay("food");
break;
case 2 :
playerCurStats[1] = (((playerCurStats[1] + SUSHI_HEAL) > playerMaxStats[1]) ? (playerMaxStats[1]) : (playerCurStats[1] + SUSHI_HEAL));
sndUseItem.gotoAndPlay("food");
break;
case 3 :
playerCurStats[2] = (((playerCurStats[2] + SAKE_HEAL) > playerMaxStats[2]) ? (playerMaxStats[2]) : (playerCurStats[2] + SAKE_HEAL));
playerCurStats[0] = (((playerCurStats[0] + SAKE_HEAL) > playerMaxStats[0]) ? (playerMaxStats[0]) : (playerCurStats[0] + SAKE_HEAL));
sndUseItem.gotoAndPlay("food");
break;
case 5 :
sndUseItem.gotoAndPlay("weapon");
if (inCombat) {
makeExplosiveAttack();
}
break;
case 6 :
sndUseItem.gotoAndPlay("weapon");
if (!inCombat) {
break;
}
var k = 0;
for(;;){
if (k >= SHURIKEN_AMOUNT) {
break;
}
makeShurikenAttack();
k++;
};
}
continueTutorial(CONTINUE_USE_ITEM);
playerInventory[i] = 0;
updateInterface();
}
function showOrHideFullMap() {
_root.sndPaper.play();
if (FullMap._visible) {
FullMap._visible = false;
releaseHandle();
if (autoMap) {
generateMapDisplay(ROOM_SIZE, ROOM_SIZE);
updateMapDisplay(playerX - Math.floor(ROOM_SIZE / 2), playerY - Math.floor(ROOM_SIZE / 2), ROOM_SIZE, ROOM_SIZE);
}
} else {
continueTutorial(CONTINUE_FULL_MAP_OPEN);
takeHandle();
if (autoMap) {
removeMapDisplay(ROOM_SIZE, ROOM_SIZE);
}
updateFullMapDisplay(Math.floor(playerX / ROOM_SIZE), Math.floor(playerY / ROOM_SIZE), GRID_WIDTH, GRID_HEIGHT);
FullMap.updateInterface();
FullMap._visible = true;
}
}
function showAutoMap() {
continueTutorial(CONTINUE_MAP_OPEN);
generateMapDisplay(ROOM_SIZE, ROOM_SIZE);
updateMapDisplay(playerX - 2, playerY - 2, ROOM_SIZE, ROOM_SIZE);
}
function updateAutoMap() {
updateMapDisplay(playerX - 2, playerY - 2, ROOM_SIZE, ROOM_SIZE);
}
function hideAutoMap() {
removeMapDisplay(ROOM_SIZE, ROOM_SIZE);
}
function playerDeath() {
worldBloodScreen.play();
gotoScene = "sceneFailLevel";
worldPainPortrait.startPain();
}
function playerDamage() {
continueTutorial(CONTINUE_PLAYER_DAMAGED);
worldPainPortrait.startPain();
}
function createSlashShadow() {
slashCount = getNextLevel(slashCount, SHADOW_LOWER_LIM, SHADOW_UPPER_LIM);
slashName = "_root.shadow" + slashCount;
duplicateMovieClip ("SlashShadow", "shadow" + slashCount, slashCount);
eval ("shadow" + slashCount)._visible = false;
}
function createStabShadow() {
slashCount = getNextLevel(slashCount, SHADOW_LOWER_LIM, SHADOW_UPPER_LIM);
slashName = "_root.shadow" + slashCount;
duplicateMovieClip ("StabShadow", "shadow" + slashCount, slashCount);
}
function createBlood(x, y) {
worldCombatSpace.createBlood(x, y);
}
function createDamage(x, y) {
worldCombatSpace.createDamage(x, y);
}
function createSparks(x, y) {
worldCombatSpace.createSparks(x, y);
}
function makeSmallSlashAttack(x, y, s, t, d) {
worldCombatSpace.createFlash(x, y);
worldCombatSpace.counterStrike(x, y);
worldCombatSpace.hitObject(x, y, s, t, d, "smallBlood");
if (tutorialTraceHits) {
worldReiPointer.pointToLocation(x, y);
}
}
function makeSlashAttack(x, y, s, t, d) {
worldCombatSpace.createFlash(x, y);
worldCombatSpace.counterStrike(x, y);
worldCombatSpace.hitObject(x, y, Math.floor(s * 1.35), t, d, null);
if (tutorialTraceHits) {
worldReiPointer.pointToLocation(x, y);
}
}
function makeStabAttack(x, y, s, t, d) {
worldCombatSpace.counterStrike(x, y);
worldCombatSpace.hitObject(x, y, Math.floor(s * 1.35), t, d, null);
if (tutorialTraceHits) {
worldReiPointer.pointToLocation(x, y);
}
}
function makeSpellAttack(x, y, s, d) {
worldCombatSpace.counterStrike(x, y);
worldCombatSpace.hitObject(x, y, Math.floor(s * 1.35), false, 1, d);
if (tutorialTraceHits) {
worldReiPointer.pointToLocation(x, y);
}
}
function makeExplosiveAttack() {
worldExplosion.play();
}
function makeShurikenAttack() {
var x = worldCombatSpace.getSAttackX();
var y = worldCombatSpace.getSAttackY();
worldCombatSpace.createShuriken(x, y);
}
function generateAttack(x, y, s, so, ft, dt, dl) {
return(worldCombatSpace.generateAttack(x, y, s, so, ft, dt, dl));
}
function causeDamage(x, y, s, dt, dl) {
worldCombatSpace.causeDamage(x, y, s, dt, dl);
}
function isCombatSpace(x, y) {
var s = Maze[x][y];
return(((s >> 8) <= 4) && (((s % 16) == 0) || ((s % 16) == OBJ_MAT)));
}
function combatCheck() {
var xi = 0;
var yi = 0;
if (getAxis(playerT) == AXIS_X) {
xi = getInc(playerT);
} else {
yi = getInc(playerT);
}
if ((playerGrid[Math.floor(playerX / ROOM_SIZE)][Math.floor(playerY / ROOM_SIZE)] & (MAP_ENEMY + MAP_TRAP)) > 0) {
if (isCombatSpace(playerX, playerY) && (!isBlockTile(playerX, playerY))) {
if (isCombatSpace(playerX + xi, playerY + yi) && (!isBlockTile(playerX + xi, playerY + yi))) {
if ((((Math.random() * ROOM_SIZE) < 2) || ((MapGrid[Math.floor(playerX / ROOM_SIZE)][Math.floor(playerY / ROOM_SIZE)] >> 4) > 3)) || (TUTORIAL)) {
lockKeys = true;
worldPreCombat.unsheath(MapGrid[Math.floor(playerX / ROOM_SIZE)][Math.floor(playerY / ROOM_SIZE)] >> 4);
}
}
}
}
}
function initCombat() {
if (TUTORIAL) {
continueTutorial(CONTINUE_ENTER_COMBAT);
if ((playerGrid[Math.floor(playerX / ROOM_SIZE)][Math.floor(playerY / ROOM_SIZE)] & MAP_ENEMY) > 0) {
worldCombatSpace.initEnemy((playerGrid[Math.floor(playerX / ROOM_SIZE)][Math.floor(playerY / ROOM_SIZE)] >> 4) % 16);
} else {
worldCombatSpace.initSpecial((playerGrid[Math.floor(playerX / ROOM_SIZE)][Math.floor(playerY / ROOM_SIZE)] >> 4) % 16);
}
} else {
shurikenCount = 0;
if ((playerGrid[Math.floor(playerX / ROOM_SIZE)][Math.floor(playerY / ROOM_SIZE)] & MAP_ENEMY) > 0) {
worldCombatSpace.initEnemy((playerGrid[Math.floor(playerX / ROOM_SIZE)][Math.floor(playerY / ROOM_SIZE)] >> 4) % 16);
} else {
worldCombatSpace.initTrap((playerGrid[Math.floor(playerX / ROOM_SIZE)][Math.floor(playerY / ROOM_SIZE)] >> 4) % 16, Math.floor(Math.random() * 2));
}
}
inCombat = true;
}
function isLegalSpace(x, y) {
return((((x >= 0) && (x < MAX_WIDTH)) && (y >= 0)) && (y < MAX_HEIGHT));
}
function isBlockTile(x, y) {
if (!isLegalSpace(x, y)) {
return(true);
}
if (((Maze[x][y] % 16) > 0) && ((Maze[x][y] % 16) != 10)) {
return(true);
}
var tileNumber = (Maze[x][y] >> 8);
return(tileNumber == 6);
}
function isBishojo(x, y) {
return((Maze[x][y] % 16) >= OBJ_BISHOJO);
}
function isFloorTile(x, y) {
if ((Maze[x][y] >> 8) <= 4) {
return(true);
}
return(false);
}
function getAxis(t) {
return(t % 2);
}
function getInc(t) {
if (t < 2) {
return(1);
}
return(-1);
}
function getReverse(t) {
return((t + 2) % 4);
}
function getForward() {
var o = new Object();
o.x = playerX;
o.y = playerY;
if (playerT == 0) {
o.x++;
} else if (playerT == 1) {
o.y++;
} else if (playerT == 2) {
o.x--;
} else {
o.y--;
}
return(o);
}
function resolveDirection(viewer, object) {
switch (viewer) {
case 0 :
switch (object) {
case 0 :
return(3);
case 1 :
return(2);
case 2 :
return(1);
case 3 :
return(4);
}
case 1 :
switch (object) {
case 0 :
return(4);
case 1 :
return(3);
case 2 :
return(2);
case 3 :
return(1);
}
case 2 :
switch (object) {
case 0 :
return(1);
case 1 :
return(4);
case 2 :
return(3);
case 3 :
return(2);
}
case 3 :
switch (object) {
case 0 :
return(2);
case 1 :
return(1);
case 2 :
return(4);
case 3 :
return(3);
}
}
}
function renderBlock(turn, name, tileAttributes) {
switch ((tileAttributes >> 8) % 16) {
case -1 :
if (eval ("Block" + name)._totalframes >= 7) {
eval ("Block" + name).gotoAndStop(7);
} else {
eval ("Block" + name).gotoAndStop(1);
}
break;
case 0 :
eval ("Block" + name).gotoAndStop(1);
break;
case TILE_EW_DOOR >> 8 :
if (getAxis(playerT) == AXIS_X) {
eval ("Block" + name).gotoAndStop(5);
} else {
eval ("Block" + name).gotoAndStop(4);
}
break;
case TILE_NS_DOOR >> 8 :
if (getAxis(playerT) == AXIS_Y) {
eval ("Block" + name).gotoAndStop(5);
} else {
eval ("Block" + name).gotoAndStop(4);
}
break;
default :
eval ("Block" + name)._visible = true;
eval ("Block" + name).gotoAndStop((tileAttributes >> 8) % 16);
}
var showObject = true;
if (isBlockTile((tileAttributes >> 8) % 16)) {
showObject = false;
}
if ((tileAttributes & (3840 == TILE_EW_DOOR)) || (attribues & (3840 == TILE_NS_DOOR))) {
showObject = false;
}
if (showObject) {
switch (tileAttributes % 16) {
case 0 :
eval ("Obj" + name)._visible = false;
eval ("Obj" + name).sprites._visible = false;
break;
default :
eval ("Obj" + name)._visible = true;
eval ("Obj" + name).sprites._visible = false;
if ((tileAttributes & TILE_SEARCHED) != 0) {
eval ("Obj" + name).gotoAndStop(((((tileAttributes % 16) - 1) * 4) + resolveDirection(turn, (tileAttributes >> 4) % 4)) + 80);
} else {
eval ("Obj" + name).gotoAndStop((((tileAttributes % 16) - 1) * 4) + resolveDirection(turn, (tileAttributes >> 4) % 4));
}
break;
case OBJ_BISHOJO :
case OBJ_BISHOJO + 1 :
case OBJ_BISHOJO + 2 :
case OBJ_BISHOJO + 3 :
if ((tileAttributes & TILE_SEARCHED) != 0) {
eval ("Obj" + name)._visible = true;
eval ("Obj" + name).sprites._visible = true;
eval ("Obj" + name).sprites.gotoAndPlay("gal0");
eval ("Obj" + name).gotoAndStop(((OBJ_BISHOJO - 1) * 4) + 1);
} else {
eval ("Obj" + name)._visible = true;
eval ("Obj" + name).sprites._visible = true;
eval ("Obj" + name).sprites.gotoAndPlay("gal" + (bishojoStock[((((tileAttributes >> 7) % 2) * 4) + (tileAttributes % 16)) - OBJ_BISHOJO] + 1));
eval ("Obj" + name).gotoAndStop(((OBJ_BISHOJO - 1) * 4) + 1);
}
}
} else {
eval ("Obj" + name)._visible = false;
}
}
function renderSpace(x, y, t) {
var i;
var j;
var k;
var l;
var m;
var axis = getAxis(t);
var inc = getInc(t);
var side;
if ((t == 0) || (t == 3)) {
side = 1;
} else {
side = -1;
}
i = 0;
while (Math.abs(i) <= 4) {
j = -4;
while (j <= 4) {
m = i;
do {
if (axis == AXIS_X) {
k = x + m;
l = y + j;
} else {
k = x + j;
l = y + m;
}
m = m + inc;
} while (((Math.abs(i) == 4) && (isLegalSpace(k, l))) && (isFloorTile(k, l)));
if (((m != i) && (isLegalSpace(k, l))) || (Math.abs(m - i) > ROOM_SIZE)) {
if (axis == AXIS_X) {
k = x + i;
l = y + j;
} else {
k = x + j;
l = y + i;
}
}
if (!isLegalSpace(k, l)) {
renderBlock(t, ("" + Math.abs(i)) + (j * side), -1);
} else {
renderBlock(t, ("" + Math.abs(i)) + (j * side), Maze[k][l]);
}
j++;
}
i = i + inc;
}
worldAutoMap.compass.gotoAndStop(playerT + 1);
if (autoMap) {
updateAutoMap();
}
updatePlayerGrid(PG_DISCOVER);
}
function hideSpace() {
var i = 0;
while (i <= 4) {
var j = -4;
while (j <= 4) {
eval (("Block" + i) + j)._visible = false;
eval (("Obj" + i) + j)._visible = false;
j++;
}
i++;
}
}
function showSpace() {
var i = 0;
while (i <= 4) {
var j = -4;
while (j <= 4) {
eval (("Block" + i) + j)._visible = true;
j++;
}
i++;
}
renderSpace(playerX, playerY, playerT);
}
function updatePlayerGrid(e) {
if (e == PG_DISCOVER) {
playerGrid[Math.floor(playerX / 5)][Math.floor(playerY / 5)] = playerGrid[Math.floor(playerX / 5)][Math.floor(playerY / 5)] | 1;
}
if (e == PG_CLEAR_DANGER) {
if ((playerGrid[Math.floor(playerX / ROOM_SIZE)][Math.floor(playerY / ROOM_SIZE)] & MAP_ENEMY) > 0) {
playerCurStats[3] = Math.min(playerMaxStats[3], playerCurStats[3] + Math.max(_root.worldSpellSpace.spiritGain[MapGrid[Math.floor(playerX / 5)][Math.floor(playerY / 5)] >> 4], ENEMY_DIFFICULTY));
updateInterface();
}
if ((MapGrid[Math.floor(playerX / 5)][Math.floor(playerY / 5)] >> 4) == 4) {
headsFound++;
}
playerGrid[Math.floor(playerX / 5)][Math.floor(playerY / 5)] = playerGrid[Math.floor(playerX / 5)][Math.floor(playerY / 5)] - (playerGrid[Math.floor(playerX / 5)][Math.floor(playerY / 5)] & (MAP_ENEMY + MAP_TRAP));
}
}
function updateInterface() {
var i = 0;
if ((!inCombat) && (worldPortrait._visible == false)) {
worldPortrait._visible = true;
worldPainPortrait.gotoAndStop(1);
}
if (teaseBox._visible) {
worldPortrait.gotoAndStop(15);
} else if (playerCurStats[1] == playerMaxStats[1]) {
worldPortrait.gotoAndStop(1);
} else {
worldPortrait.gotoAndStop(10 - Math.floor((playerCurStats[1] / playerMaxStats[1]) * 10));
}
i = 0;
while (i < 4) {
eval ("worldInterface.stat" + i).adjustMaximum(playerMaxStats[i]);
eval ("worldInterface.stat" + i).adjustCurrent(playerCurStats[i]);
if (showNumbers) {
eval ("worldInterface.stat" + i).adjustDisplayMode(1);
} else {
eval ("worldInterface.stat" + i).adjustDisplayMode(0);
}
i++;
}
i = 0;
while (i < 5) {
eval ("worldInterface.invSlot" + i).adjustIcon(playerInventory[i]);
i++;
}
}
PG_DISCOVER = 0;
PG_CLEAR_DANGER = 1;
Frame 906
AXIS_X = 0;
AXIS_Y = 1;
MAX_WIDTH = ROOM_SIZE * GRID_WIDTH;
MAX_HEIGHT = ROOM_SIZE * GRID_HEIGHT;
SCREEN_WIDTH = 550;
SCREEN_HEIGHT = 400;
MAX_NUMBER = 50;
slashCount = MAX_NUMBER;
splatOriginal._visible = false;
slashShadow._visible = false;
stabShadow._visible = false;
oStrikePoint._visible = false;
oSpark._visible = false;
if (TUTORIAL) {
generateTutorialMap();
} else if (!arenaMode) {
sh = SCROLLS_HIDDEN;
bh = BOSSES_HIDDEN;
do {
SCROLLS_HIDDEN = sh;
BOSSES_HIDDEN = bh;
generateMap();
} while (((MISSION_TYPE == 1) && (SCROLLS_HIDDEN == 0)) || ((MISSION_TYPE == 2) && (BOSSES_HIDDEN == 0)));
}
playerX = Math.round(ROOM_SIZE / 2) - 1;
playerY = ((ROOM_SIZE * (GRID_HEIGHT - 1)) + Math.round(ROOM_SIZE / 2)) - 1;
playerT = 0;
if (TUTORIAL) {
playerX--;
playerT = 2;
}
duplicateMovieClip ("oCursor", "cursor", 10000);
duplicateMovieClip ("oCombatCursor", "combatCursor", 10001);
oCursor._visible = false;
Mouse.hide();
cursor.startDrag(true);
if (!arenaMode) {
sndMusicLoops.gotoAndPlay("explore");
} else {
sndMusicLoops.gotoAndPlay("boss");
}
autoMap = false;
showNumbers = false;
handleTaken = false;
inCombat = false;
lockKeys = false;
restoreTimer = new Timer();
gotoScene = null;
Instance of Symbol 607 MovieClip "worldReiPointer" in Frame 906
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 620 MovieClip "FullMap" in Frame 906
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 633 MovieClip "oCombatCursor" in Frame 906
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 722 MovieClip "worldRei" in Frame 906
onClipEvent (load) {
if ((!_root.IN_GAME_TUTORIAL) && (!_root.TUTORIAL)) {
stop();
_visible = false;
}
}
Instance of Symbol 959 MovieClip "oMapIndicator" in Frame 906
onClipEvent (load) {
if (_name == "oMapIndicator") {
_visible = false;
}
}
Instance of Symbol 978 MovieClip "teaseBox" in Frame 906
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 981 MovieClip "worldReiMessage" in Frame 906
onClipEvent (load) {
_visible = false;
}
Frame 907
if (autoQuality) {
qualityTimer = new Timer();
}
if (arenaMode) {
gotoAndPlay (944);
} else {
generateFullMapDisplay(GRID_WIDTH, GRID_HEIGHT);
}
Frame 908
renderSpace(PlayerX, PlayerY, PlayerT);
Frame 922
if (TUTORIAL) {
nextTutorial();
}
Frame 925
updateCursor();
if (autoQuality && (inCombat)) {
frameCount++;
if (qualityTimer.timeOver(1000)) {
if (frameCount < 14) {
lagCount++;
} else {
lagCount = 0;
}
if (lagCount >= 3) {
if ((_quality == "BEST") || (_quality == "HIGH")) {
_quality = "MEDIUM";
} else if (_quality == "MEDIUM") {
_quality = "LOW";
}
lagCount = 0;
}
qualityTimer.resetTimer();
frameCount = 0;
}
}
if (inCombat && (!handleTaken)) {
updateCombatCursor();
if (worldCombatSpace.enemyObjectCount == 0) {
worldPreCombat.sheath();
}
if (restoreTimer.timeOver(350)) {
restoreStats();
restoreTimer.resetTimer();
}
} else if (restoreTimer.timeOver(250)) {
restoreStats();
restoreTimer.resetTimer();
}
if (worldTutorial._visible) {
if (!inCombat) {
o = getForward();
if ((Maze[o.x][o.y] == TILE_EW_DOOR) || (Maze[o.x][o.y] == TILE_NS_DOOR)) {
worldTutorial.newMessage("Doors open automatically when you walk through them.", 10);
}
if (canSearch()) {
worldTutorial.newMessage("The item in front of you is searchable. Click on it or press Spacebar to search it.", 10);
}
} else {
if (playerCurStats[0] < (playerMaxStats[0] / 3)) {
worldTutorial.newMessage("You are running low on attack power. Rest and block a bit.", 10);
}
if (playerCurStats[2] < (playerMaxStats[2] / 3)) {
worldTutorial.newMessage("You are running low on defensive Chi. Time to counter-attack.", 10);
}
}
}
if (gotoScene == null) {
prevFrame();
play();
}
Frame 927
if (inCombat) {
combatCursor.stopDrag();
combatCursor._visible = false;
} else {
cursor.stopDrag();
cursor._visible = false;
}
if (autoMap) {
worldAutoMap.play();
}
Mouse.show();
Frame 937
delete Maze;
delete MapGrid;
delete playerGrid;
fader.play();
stop();
Frame 940
_root.gotoAndPlay(gotoScene);
Frame 944
function initCombat() {
waveInitializer.nextWave();
}
worldPortrait._visible = false;
worldInterface._visible = false;
inCombat = true;
Frame 959
stop();
Frame 960
worldPortrait._visible = true;
worldInterface._visible = true;
worldPreCombat.arenaUnsheath();
_root.worldCombatSpace.enemyObjectCount = 1;
Frame 964
updateCursor();
if (autoQuality) {
frameCount++;
if (qualityTimer.timeOver(1000)) {
if (frameCount < 14) {
lagCount++;
} else {
lagCount = 0;
}
if (lagCount >= 3) {
if ((_quality == "BEST") || (_quality == "HIGH")) {
_quality = "MEDIUM";
} else if (_quality == "MEDIUM") {
_quality = "LOW";
}
lagCount = 0;
}
qualityTimer.resetTimer();
frameCount = 0;
}
}
if (!handleTaken) {
updateCombatCursor();
if (worldCombatSpace.enemyObjectCount == 0) {
playerCurStats[3] = Math.min(playerMaxStats[3], playerCurStats[3] + (worldSpellSpace.spiritGain[0] * waveInitializer.zombieCount));
playerCurStats[3] = Math.min(playerMaxStats[3], playerCurStats[3] + (worldSpellSpace.spiritGain[1] * waveInitializer.samuraiCount));
playerCurStats[3] = Math.min(playerMaxStats[3], playerCurStats[3] + (worldSpellSpace.spiritGain[2] * waveInitializer.wolfCount));
playerCurStats[3] = Math.min(playerMaxStats[3], playerCurStats[3] + (worldSpellSpace.spiritGain[3] * waveInitializer.ninjaCount));
playerCurStats[3] = Math.min(playerMaxStats[3], playerCurStats[3] + (worldSpellSpace.spiritGain[4] * waveInitializer.bossCount));
updateInterface();
waveInitializer.nextWave();
}
if (restoreTimer.timeOver(350)) {
restoreStats();
restoreTimer.resetTimer();
}
}
if (gotoScene == null) {
prevFrame();
play();
}
Frame 966
combatCursor.stopDrag();
combatCursor._visible = false;
roninTime = aTimer.timeDiff;
roninWave = waveInitializer.wave - 1;
roninModTime = aTimer.clickStopWatch();
Mouse.show();
Frame 967
inCombat = false;
Frame 978
fader.play();
stop();
Frame 981
_root.gotoAndPlay(gotoScene);
Frame 990
function invChange() {
var i = 0;
while (i < 5) {
eval ("stats.invSlot" + i).adjustIcon(_root.playerInventory[i]);
i++;
}
i = 1;
while (i <= 4) {
eval ("stats.cast" + i)._visible = false;
i++;
}
i = 1;
while (i <= playerLevel) {
eval ("stats.cast" + i)._visible = true;
i++;
}
}
function attChange() {
stats.att0 = _root.playerMaxStats[0];
stats.att1c = _root.playerCurStats[1];
stats.att1 = _root.playerMaxStats[1];
stats.att2 = _root.playerMaxStats[2];
stats.att3c = _root.playerCurStats[3];
stats.att3 = _root.playerMaxStats[3];
}
function createEpisode() {
levelDifficulty = Math.floor(playerEpisode / 3);
MISSION_TYPE = playerEpisode % 3;
updateEpisode();
}
function updateEpisode() {
if (levelDifficulty > Math.floor(playerEpisode / 3)) {
levelDifficulty = 0;
}
if ((playerEpisode - (levelDifficulty * 3)) < MISSION_TYPE) {
MISSION_TYPE = 0;
}
objDifficulty.update(levelDifficulty);
objEpisode.update(MISSION_TYPE);
}
Frame 991
openingLoop.startLoop();
if (MISSION_TYPE != 3) {
if (((levelDifficulty * 3) + MISSION_TYPE) == playerEpisode) {
if (((playerEpisode % 3) < 2) && (playerEpisode < 6)) {
playerLevel++;
newSpell.gotoAndStop(playerLevel);
} else {
gotoAndPlay (1023);
}
playerEpisode++;
} else {
gotoAndPlay (1023);
}
} else {
gotoAndPlay (1023);
}
Frame 1007
stop();
Frame 1024
playerMaxStats[3] = playerMaxStats[3] + (6 + (levelDifficulty * 3));
playerPass = _root.EncodePlayer();
if (MISSION_TYPE == 2) {
gotoScene = "sceneCredits";
} else {
gotoScene = "sceneMainMenu";
}
invChange();
attChange();
createEpisode();
Frame 1037
stop();
Frame 1049
if (gotoScene == "sceneCredits") {
openingLoop.fadeLoop();
stop();
}
Frame 1050
_root.gotoAndPlay(gotoScene);
Frame 1060
function invChange() {
var i = 0;
while (i < 5) {
eval ("stats.invSlot" + i).adjustIcon(_root.playerInventory[i]);
i++;
}
i = 1;
while (i <= 4) {
eval ("stats.cast" + i)._visible = false;
i++;
}
i = 1;
while (i <= playerLevel) {
eval ("stats.cast" + i)._visible = true;
i++;
}
}
function attChange() {
stats.att0 = _root.playerMaxStats[0];
stats.att1c = _root.playerCurStats[1];
stats.att1 = _root.playerMaxStats[1];
stats.att2 = _root.playerMaxStats[2];
stats.att3c = _root.playerCurStats[3];
stats.att3 = _root.playerMaxStats[3];
}
function createEpisode() {
levelDifficulty = Math.floor(playerEpisode / 3);
MISSION_TYPE = playerEpisode % 3;
updateEpisode();
}
function updateEpisode() {
if (levelDifficulty > Math.floor(playerEpisode / 3)) {
levelDifficulty = 0;
}
if ((playerEpisode - (levelDifficulty * 3)) < MISSION_TYPE) {
MISSION_TYPE = 0;
}
objDifficulty.update(levelDifficulty);
objEpisode.update(MISSION_TYPE);
}
Frame 1061
if (!arenaMode) {
gameHint = "HINT:\n\n";
hintNum = int(Math.floor(Math.random() * 18));
switch (hintNum) {
case 0 :
gameHint = "The following items are searchable:\n\n";
gameHint = gameHint + "Sword (increase Attack)\n";
gameHint = gameHint + "Armor (increase Health)\n";
gameHint = gameHint + "Wine (increase Chi)\n";
gameHint = gameHint + "Food (gives random food)\n";
gameHint = gameHint + "Chest (gives random item)\n";
break;
case 1 :
gameHint = gameHint + "Slashes are powerful but inaccurate; ";
gameHint = gameHint + "Stabs does the opposite. Therefore, the ";
gameHint = gameHint + "best combat strategy is to use stabs ";
gameHint = gameHint + "to break enemy attacks and use slashes ";
gameHint = gameHint + "when the enemy's guard is down.";
break;
case 2 :
gameHint = "Samurai:\n\n";
gameHint = gameHint + "The standard grunt unit. He uses the same ";
gameHint = gameHint + "types of attacks as the player. Advanced ";
gameHint = gameHint + "samurais anticipates your attacks and raises ";
gameHint = gameHint + "his sword in defense. Your best bet is to ";
gameHint = gameHint + "break him down after blocking his attacks. ";
break;
case 3 :
gameHint = "Wolf:\n\n";
gameHint = gameHint + "The utlimate melee bastard. At a distance, ";
gameHint = gameHint + "it is harmless, but once it gets into close ";
gameHint = gameHint + "range, it'll rip you a new one with its claws. ";
gameHint = gameHint + "To fend him off if it got close, stab it. ";
gameHint = gameHint + "Keep it out of close range at all costs. ";
break;
case 4 :
gameHint = "Ninja (1 of 2):\n\n";
gameHint = gameHint + "Annoying bugger, that he is. The ninja has ";
gameHint = gameHint + "two unique attacks. One of them is palm strike. ";
gameHint = gameHint + "Always remember that the strikes goes bottom left, ";
gameHint = gameHint + "top right, and the interval between the two ";
gameHint = gameHint + "attacks is always the same.";
break;
case 5 :
gameHint = "Ninja (2 of 2):\n\n";
gameHint = gameHint + "The ninja's second unique attack is the shuriken ";
gameHint = gameHint + "throw. To defeat it, time your block so that it ";
gameHint = gameHint + "moves along the throwing path at the same speed ";
gameHint = gameHint + "as the ninja did. One final hint: ninjas like to ";
gameHint = gameHint + "dodge, so aim low where it really hurts.";
break;
case 6 :
gameHint = gameHint + "Before you complete your spirit spell, you are ";
gameHint = gameHint + "helpless against your enemies, so time your spells ";
gameHint = gameHint + "such that they'd be cast before damages are done ";
gameHint = gameHint + "to you. ";
break;
case 7 :
gameHint = gameHint + "Every enemy has an alert state where it can ";
gameHint = gameHint + "effectively block your attacks and counter attack. ";
gameHint = gameHint + "On the other hand, they also have vulerable states ";
gameHint = gameHint + "that usually come in after they attack. ";
break;
case 8 :
gameHint = gameHint + "The player portrait is a very effective way to ";
gameHint = gameHint + "find out how well you're doing in a glance. ";
gameHint = gameHint + "While we're on the topic, stockpiling food never ";
gameHint = gameHint + "hurts, so don't use food until you need it. ";
break;
case 9 :
gameHint = gameHint + "Spirit spells are costly and hard to use, but ";
gameHint = gameHint + "they are extremely powerful. Save them as a ";
gameHint = gameHint + "last resort, when you're in real trouble... ";
gameHint = gameHint + "and be careful, you can still be hurt when ";
gameHint = gameHint + "you are still trying to complete the spell ";
gameHint = gameHint + "gesture. ";
break;
case 10 :
gameHint = gameHint + "Alternate between attack and defense. ";
gameHint = gameHint + "Life will not be good for you if you happen to exhaust ";
gameHint = gameHint + "the attack bar or the chi bar. Your attack bar ";
gameHint = gameHint + "replenishes once you let go of an attack, ";
gameHint = gameHint + "and chi bar starts restoring if you release your block. ";
break;
case 11 :
gameHint = "Traps:\n\n";
gameHint = gameHint + "The bamboo trap fires after a certain interval and ";
gameHint = gameHint + "the explosives cannot be blocked, so take them out ";
gameHint = gameHint + "as fast as you can. As for shurikens, block them. ";
gameHint = gameHint + "if you're unlucky enough to be low on chi, you can ";
gameHint = gameHint + "resort to trying to hit them with your sword.";
break;
case 12 :
gameHint = gameHint + "Just because you reached the end of a level doesn't ";
gameHint = gameHint + "mean you'll have to end it. search around some more,";
gameHint = gameHint + "and earn every item you can get out of the level. ";
gameHint = gameHint + "While you are at it, search for pleasent surprises... ";
gameHint = gameHint + "if you're playing with adult content on, anyway. ";
break;
case 13 :
gameHint = gameHint + "Please go and try out Dark Prophecy if you are looking ";
gameHint = gameHint + "for a more stealthy experience. For action packed shooting ";
gameHint = gameHint + "fun, try GunBlaze. This is my shameless advertisement. SHAMELESS!";
break;
case 14 :
gameHint = gameHint + "Use the mini-map to help you locate items that you; ";
gameHint = gameHint + "might otherwise miss. Speaking of items, don't ";
gameHint = gameHint + "hesitate to walk into a garden. Bushes have the tendency ";
gameHint = gameHint + "to block your view from potential treasures. ";
break;
case 15 :
gameHint = gameHint + "If you are stuck in a certain level, you can replay ";
gameHint = gameHint + "old episodes or try out random levels in lower difficulties, ";
gameHint = gameHint + "which usually contains more treasures. ";
break;
case 16 :
gameHint = gameHint + "The Normal difficulty can only give you two out of four ";
gameHint = gameHint + "spirit spells. Replay the game at Hard difficulty in order ";
gameHint = gameHint + "to discover more interesting treasures. As for Extreme... ";
gameHint = gameHint + "Well, if you want a challenge, you'll find it there. ";
break;
case 17 :
gameHint = gameHint + "Rooms containing scrolls are guarded by ninjas. You ";
gameHint = gameHint + "can identify those rooms by seeing the chests marked with ";
gameHint = gameHint + "the golden lotus flower. Boss rooms are filled with an ";
gameHint = gameHint + "unusual amount of treasure. ";
break;
}
} else {
gotoAndPlay (1089);
}
Frame 1077
stop();
Frame 1079
prevFrame();
play();
Frame 1105
stop();
Frame 1118
stopAllSounds();
previousScene = "sceneEnterScore";
_root.gotoAndPlay("sceneHighScore");
Frame 1145
stop();
Frame 1159
stopAllSounds();
previousScene = "sceneEnterScore";
_root.gotoAndPlay("sceneHighScore");
Frame 1160
function getBoundLeft() {
return(GameArea._x);
}
function getBoundRight() {
return(GameArea._x + GameArea._width);
}
function getBoundTop() {
return(GameArea._y);
}
function getBoundBottom() {
return(GameArea._y + GameArea._height);
}
function masterSubscribe(subscriberName) {
subscriber[totalSubscribers] = subscriberName;
totalSubscribers++;
}
function masterRemove(subscriberName) {
var i = 0;
while ((i < totalSubscribers) && (subscriberName != subscriber[i])) {
i++;
}
if (i < totalSubscribers) {
totalSubscribers--;
var j = i;
while (j < totalSubscribers) {
subscriber[j] = subscriber[j + 1];
j++;
}
}
}
function masterSort() {
var i = (totalSubscribers - 1);
while (i > 0) {
var j = 0;
while (j < i) {
if (eval (subscriber[j])._y > eval (subscriber[j + 1])._y) {
eval (subscriber[j]).swapDepths(eval (subscriber[j + 1]));
var temp = subscriber[j];
subscriber[j] = subscriber[j + 1];
subscriber[j + 1] = temp;
}
j++;
}
i--;
}
}
function villianSubscribe(subscriberName) {
villianSubscriber[totalVillianSubscribers] = subscriberName;
totalVillianSubscribers++;
}
function villianRemove(subscriberName) {
var i = 0;
while ((i < totalVillianSubscribers) && (subscriberName != villianSubscriber[i])) {
i++;
}
if (i < totalVillianSubscribers) {
totalVillianSubscribers--;
var j = i;
while (j < totalVillianSubscribers) {
villianSubscriber[j] = villianSubscriber[j + 1];
j++;
}
}
}
function villianCollisionBoardcast(collisionSource, collisionMessage, sourceDirection) {
var i = 0;
while (i < totalVillianSubscribers) {
if (eval (eval (villianSubscriber[i]).Sprite.getShadow()).hitTest(eval (collisionSource))) {
eval (villianSubscriber[i]).Command.recieveMessage(sourceDirection);
eval (villianSubscriber[i]).Command.recieveMessage(collisionMessage);
}
i++;
}
}
function heroSubscribe(subscriberName) {
heroSubscriber[totalheroSubscribers] = subscriberName;
totalheroSubscribers++;
}
function heroRemove(subscriberName) {
var i = 0;
while ((i < totalheroSubscribers) && (subscriberName != heroSubscriber[i])) {
i++;
}
if (i < totalheroSubscribers) {
totalheroSubscribers--;
var j = i;
while (j < totalheroSubscribers) {
heroSubscriber[j] = heroSubscriber[j + 1];
j++;
}
}
}
function heroCollisionBoardcast(collisionSource, collisionMessage, sourceDirection) {
var i = 0;
while (i < totalheroSubscribers) {
if (eval (eval (heroSubscriber[i]).Sprite.getShadow()).hitTest(eval (collisionSource))) {
eval (heroSubscriber[i]).Command.recieveMessage(sourceDirection);
eval (heroSubscriber[i]).Command.recieveMessage(collisionMessage);
}
i++;
}
}
maxSubscribers = 10;
totalSubscribers = 0;
subscriber = new Array();
totalVillianSubscribers = 0;
villianSubscriber = new Array();
totalHeroSubscribers = 0;
heroSubscriber = new Array();
respawnInterval = 2000;
respawnTimer = -3000;
respawnCounter = 1;
gotoScene = null;
Instance of Symbol 1181 MovieClip "GameArea" in Frame 1160
onClipEvent (load) {
}
Frame 1176
duplicateMovieClip ("oGenyu", "Genyu", 1);
Frame 1178
masterSort();
if ((respawnTimer + respawnInterval) < getTimer()) {
respawnTimer = getTimer();
if (totalVillianSubscribers < 3) {
duplicateMovieClip ("oZombie", "HOI" + respawnCounter, respawnCounter + totalHeroSubscribers);
with (eval ("HOI" + respawnCounter)) {
var pointSelect = random(4);
_x = eval ("_root.RespawnPoint" + pointSelect)._x;
_y = eval ("_root.RespawnPoint" + pointSelect)._y;
}
respawnCounter++;
}
}
Frame 1179
if (gotoScene == null) {
prevFrame();
play();
}
Frame 1180
var i = 0;
while (i < totalSubscribers) {
eval (subscriber[i]).removeMovieClip();
i++;
}
Frame 1190
_root.gotoAndPlay(gotoScene);
Symbol 15 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(arrow_mc, "arrow");
component.registerSkinElement(face_mc, "face");
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 25 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(arrow_mc, "arrow");
component.registerSkinElement(face_mc, "face");
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 34 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(arrow_mc, "foregroundDisabled");
component.registerSkinElement(face_mc, "face");
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 35 MovieClip [UpArrow] Frame 1
stop();
Symbol 35 MovieClip [UpArrow] Frame 2
stop();
Symbol 35 MovieClip [UpArrow] Frame 3
stop();
Symbol 41 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(highlight3D_mc, "highlight3D");
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
Symbol 48 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(face_mc, "face");
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 54 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 55 MovieClip [ScrollThumb] Frame 1
stop();
Symbol 63 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(arrow_mc, "arrow");
component.registerSkinElement(face_mc, "face");
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 71 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(arrow_mc, "arrow");
component.registerSkinElement(face_mc, "face");
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 79 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(arrow_mc, "foregroundDisabled");
component.registerSkinElement(face_mc, "face");
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 80 MovieClip [DownArrow] Frame 1
stop();
Symbol 80 MovieClip [DownArrow] Frame 2
stop();
Symbol 80 MovieClip [DownArrow] Frame 3
stop();
Symbol 83 MovieClip Frame 1
var component = _parent;
component.registerSkinElement(track_mc, "scrollTrack");
Symbol 84 MovieClip [FScrollBarSymbol] Frame 1
#initclip 4
FScrollBarClass = function () {
if (this._height == 4) {
return(undefined);
}
this.init();
this.minPos = (this.maxPos = (this.pageSize = (this.largeScroll = 0)));
this.smallScroll = 1;
this.width = (this.horizontal ? (this._width) : (this._height));
this._xscale = (this._yscale = 100);
this.setScrollPosition(0);
this.tabEnabled = false;
if (this._targetInstanceName.length > 0) {
this.setScrollTarget(this._parent[this._targetInstanceName]);
}
this.tabChildren = false;
this.setSize(this.width);
};
FScrollBarClass.prototype = new FUIComponentClass();
FScrollBarClass.prototype.setHorizontal = function (flag) {
if (this.horizontal && (!flag)) {
this._xscale = 100;
this._rotation = 0;
} else if (flag && (!this.horizontal)) {
this._xscale = -100;
this._rotation = -90;
}
this.horizontal = flag;
};
FScrollBarClass.prototype.setScrollProperties = function (pSize, mnPos, mxPos) {
if (!this.enable) {
return(undefined);
}
this.pageSize = pSize;
this.minPos = Math.max(mnPos, 0);
this.maxPos = Math.max(mxPos, 0);
this.scrollPosition = Math.max(this.minPos, this.scrollPosition);
this.scrollPosition = Math.min(this.maxPos, this.scrollPosition);
if ((this.maxPos - this.minPos) <= 0) {
this.scrollThumb_mc.removeMovieClip();
this.upArrow_mc.gotoAndStop(3);
this.downArrow_mc.gotoAndStop(3);
this.downArrow_mc.onPress = (this.downArrow_mc.onRelease = (this.downArrow_mc.onDragOut = null));
this.upArrow_mc.onPress = (this.upArrow_mc.onRelease = (this.upArrow_mc.onDragOut = null));
this.scrollTrack_mc.onPress = (this.scrollTrack_mc.onRelease = null);
this.scrollTrack_mc.onDragOut = (this.scrollTrack_mc.onRollOut = null);
this.scrollTrack_mc.useHandCursor = false;
} else {
var tmp = this.getScrollPosition();
this.upArrow_mc.gotoAndStop(1);
this.downArrow_mc.gotoAndStop(1);
this.upArrow_mc.onPress = (this.upArrow_mc.onDragOver = this.startUpScroller);
this.upArrow_mc.onRelease = (this.upArrow_mc.onDragOut = this.stopScrolling);
this.downArrow_mc.onPress = (this.downArrow_mc.onDragOver = this.startDownScroller);
this.downArrow_mc.onRelease = (this.downArrow_mc.onDragOut = this.stopScrolling);
this.scrollTrack_mc.onPress = (this.scrollTrack_mc.onDragOver = this.startTrackScroller);
this.scrollTrack_mc.onRelease = this.stopScrolling;
this.scrollTrack_mc.onDragOut = this.stopScrolling;
this.scrollTrack_mc.onRollOut = this.stopScrolling;
this.scrollTrack_mc.useHandCursor = false;
this.attachMovie("ScrollThumb", "scrollThumb_mc", 3);
this.scrollThumb_mc._x = 0;
this.scrollThumb_mc._y = this.upArrow_mc._height;
this.scrollThumb_mc.onPress = this.startDragThumb;
this.scrollThumb_mc.controller = this;
this.scrollThumb_mc.onRelease = (this.scrollThumb_mc.onReleaseOutside = this.stopDragThumb);
this.scrollThumb_mc.useHandCursor = false;
this.thumbHeight = (this.pageSize / ((this.maxPos - this.minPos) + this.pageSize)) * this.trackSize;
this.thumbMid_mc = this.scrollThumb_mc.mc_sliderMid;
this.thumbTop_mc = this.scrollThumb_mc.mc_sliderTop;
this.thumbBot_mc = this.scrollThumb_mc.mc_sliderBot;
this.thumbHeight = Math.max(this.thumbHeight, 6);
this.midHeight = (this.thumbHeight - this.thumbTop_mc._height) - this.thumbBot_mc._height;
this.thumbMid_mc._yScale = (this.midHeight * 100) / this.thumbMid_mc._height;
this.thumbMid_mc._y = this.thumbTop_mc._height;
this.thumbBot_mc._y = this.thumbTop_mc._height + this.midHeight;
this.scrollTop = this.scrollThumb_mc._y;
this.trackHeight = this.trackSize - this.thumbHeight;
this.scrollBot = this.trackHeight + this.scrollTop;
tmp = Math.min(tmp, this.maxPos);
this.setScrollPosition(Math.max(tmp, this.minPos));
}
};
FScrollBarClass.prototype.getScrollPosition = function () {
return(this.scrollPosition);
};
FScrollBarClass.prototype.setScrollPosition = function (pos) {
this.scrollPosition = pos;
if (this.scrollThumb_mc != undefined) {
pos = Math.min(pos, this.maxPos);
pos = Math.max(pos, this.minPos);
}
this.scrollThumb_mc._y = (((pos - this.minPos) * this.trackHeight) / (this.maxPos - this.minPos)) + this.scrollTop;
this.executeCallBack();
};
FScrollBarClass.prototype.setLargeScroll = function (lScroll) {
this.largeScroll = lScroll;
};
FScrollBarClass.prototype.setSmallScroll = function (sScroll) {
this.smallScroll = sScroll;
};
FScrollBarClass.prototype.setEnabled = function (enabledFlag) {
var wasEnabled = this.enable;
if (enabledFlag && (!wasEnabled)) {
this.enable = enabledFlag;
if (this.textField != undefined) {
this.setScrollTarget(this.textField);
} else {
this.setScrollProperties(this.pageSize, this.cachedMinPos, this.cachedMaxPos);
this.setScrollPosition(this.cachedPos);
}
this.clickFilter = undefined;
} else if ((!enabledFlag) && (wasEnabled)) {
this.textField.removeListener(this);
this.cachedPos = this.getScrollPosition();
this.cachedMinPos = this.minPos;
this.cachedMaxPos = this.maxPos;
if (this.clickFilter == undefined) {
this.setScrollProperties(this.pageSize, 0, 0);
} else {
this.clickFilter = true;
}
this.enable = enabledFlag;
}
};
FScrollBarClass.prototype.setSize = function (hgt) {
if (this._height == 1) {
return(undefined);
}
this.width = hgt;
this.scrollTrack_mc._yscale = 100;
this.scrollTrack_mc._yscale = (100 * this.width) / this.scrollTrack_mc._height;
if (this.upArrow_mc == undefined) {
this.attachMovie("UpArrow", "upArrow_mc", 1);
this.attachMovie("DownArrow", "downArrow_mc", 2);
this.downArrow_mc.controller = (this.upArrow_mc.controller = this);
this.upArrow_mc.useHandCursor = (this.downArrow_mc.useHandCursor = false);
this.upArrow_mc._x = (this.upArrow_mc._y = 0);
this.downArrow_mc._x = 0;
}
this.scrollTrack_mc.controller = this;
this.downArrow_mc._y = this.width - this.downArrow_mc._height;
this.trackSize = this.width - (2 * this.downArrow_mc._height);
if (this.textField != undefined) {
this.onTextChanged();
} else {
this.setScrollProperties(this.pageSize, this.minPos, this.maxPos);
}
};
FScrollBarClass.prototype.scrollIt = function (inc, mode) {
var delt = this.smallScroll;
if (inc != "one") {
delt = ((this.largeScroll == 0) ? (this.pageSize) : (this.largeScroll));
}
var newPos = (this.getScrollPosition() + (mode * delt));
if (newPos > this.maxPos) {
newPos = this.maxPos;
} else if (newPos < this.minPos) {
newPos = this.minPos;
}
this.setScrollPosition(newPos);
};
FScrollBarClass.prototype.startDragThumb = function () {
this.lastY = this._ymouse;
this.onMouseMove = this.controller.dragThumb;
};
FScrollBarClass.prototype.dragThumb = function () {
this.scrollMove = this._ymouse - this.lastY;
this.scrollMove = this.scrollMove + this._y;
if (this.scrollMove < this.controller.scrollTop) {
this.scrollMove = this.controller.scrollTop;
} else if (this.scrollMove > this.controller.scrollBot) {
this.scrollMove = this.controller.scrollBot;
}
this._y = this.scrollMove;
var c = this.controller;
c.scrollPosition = Math.round(((c.maxPos - c.minPos) * (this._y - c.scrollTop)) / c.trackHeight) + c.minPos;
this.controller.isScrolling = true;
updateAfterEvent();
this.controller.executeCallBack();
};
FScrollBarClass.prototype.stopDragThumb = function () {
this.controller.isScrolling = false;
this.onMouseMove = null;
};
FScrollBarClass.prototype.startTrackScroller = function () {
this.controller.trackScroller();
this.controller.scrolling = setInterval(this.controller, "scrollInterval", 500, "page", -1);
};
FScrollBarClass.prototype.scrollInterval = function (inc, mode) {
clearInterval(this.scrolling);
if (inc == "page") {
this.trackScroller();
} else {
this.scrollIt(inc, mode);
}
this.scrolling = setInterval(this, "scrollInterval", 35, inc, mode);
};
FScrollBarClass.prototype.trackScroller = function () {
if ((this.scrollThumb_mc._y + this.thumbHeight) < this._ymouse) {
this.scrollIt("page", 1);
} else if (this.scrollThumb_mc._y > this._ymouse) {
this.scrollIt("page", -1);
}
};
FScrollBarClass.prototype.stopScrolling = function () {
this.controller.downArrow_mc.gotoAndStop(1);
this.controller.upArrow_mc.gotoAndStop(1);
clearInterval(this.controller.scrolling);
};
FScrollBarClass.prototype.startUpScroller = function () {
this.controller.upArrow_mc.gotoAndStop(2);
this.controller.scrollIt("one", -1);
this.controller.scrolling = setInterval(this.controller, "scrollInterval", 500, "one", -1);
};
FScrollBarClass.prototype.startDownScroller = function () {
this.controller.downArrow_mc.gotoAndStop(2);
this.controller.scrollIt("one", 1);
this.controller.scrolling = setInterval(this.controller, "scrollInterval", 500, "one", 1);
};
FScrollBarClass.prototype.setScrollTarget = function (tF) {
if (tF == undefined) {
this.textField.removeListener(this);
delete this.textField[(this.horizontal ? "hScroller" : "vScroller")];
if ((this.textField.hScroller != undefined) && (this.textField.vScroller != undefined)) {
this.textField.unwatch("text");
this.textField.unwatch("htmltext");
}
}
this.textField = undefined;
if (!(tF instanceof TextField)) {
return(undefined);
}
this.textField = tF;
this.textField[(this.horizontal ? "hScroller" : "vScroller")] = this;
this.onTextChanged();
this.onChanged = function () {
this.onTextChanged();
};
this.onScroller = function () {
if (!this.isScrolling) {
if (!this.horizontal) {
this.setScrollPosition(this.textField.scroll);
} else {
this.setScrollPosition(this.textField.hscroll);
}
}
};
this.textField.addListener(this);
this.textField.watch("text", this.callback);
this.textField.watch("htmlText", this.callback);
};
FScrollBarClass.prototype.callback = function (prop, oldVal, newVal) {
clearInterval(this.hScroller.synchScroll);
clearInterval(this.vScroller.synchScroll);
this.hScroller.synchScroll = setInterval(this.hScroller, "onTextChanged", 50);
this.vScroller.synchScroll = setInterval(this.vScroller, "onTextChanged", 50);
return(newVal);
};
FScrollBarClass.prototype.onTextChanged = function () {
if ((!this.enable) || (this.textField == undefined)) {
return(undefined);
}
clearInterval(this.synchScroll);
if (this.horizontal) {
var pos = this.textField.hscroll;
this.setScrollProperties(this.textField._width, 0, this.textField.maxhscroll);
this.setScrollPosition(Math.min(pos, this.textField.maxhscroll));
} else {
var pos = this.textField.scroll;
var pageSize = (this.textField.bottomScroll - this.textField.scroll);
this.setScrollProperties(pageSize, 1, this.textField.maxscroll);
this.setScrollPosition(Math.min(pos, this.textField.maxscroll));
}
};
FScrollBarClass.prototype.executeCallBack = function () {
if (this.textField == undefined) {
super.executeCallBack();
} else if (this.horizontal) {
this.textField.hscroll = this.getScrollPosition();
} else {
this.textField.scroll = this.getScrollPosition();
}
};
Object.registerClass("FScrollBarSymbol", FScrollBarClass);
#endinitclip
Symbol 88 MovieClip [FLabelSymbol] Frame 1
#initclip 1
_global.FLabelClass = function () {
if (this.hostComponent == undefined) {
this.hostComponent = ((this._parent.controller == undefined) ? (this._parent) : (this._parent.controller));
}
if (this.customTextStyle == undefined) {
if (this.hostComponent.textStyle == undefined) {
this.hostComponent.textStyle = new TextFormat();
}
this.textStyle = this.hostComponent.textStyle;
this.enable = true;
}
};
FLabelClass.prototype = new MovieClip();
Object.registerClass("FLabelSymbol", FLabelClass);
FLabelClass.prototype.setLabel = function (label) {
var val = this.hostComponent.styleTable.embedFonts.value;
if (val != undefined) {
this.labelField.embedFonts = val;
}
this.labelField.setNewTextFormat(this.textStyle);
this.labelField.text = label;
this.labelField._height = this.labelField.textHeight + 2;
};
FLabelClass.prototype.setSize = function (width) {
this.labelField._width = width;
};
FLabelClass.prototype.setEnabled = function (enable) {
this.enable = enable;
var tmpColor = this.hostComponent.styleTable[(enable ? "textColor" : "textDisabled")].value;
if (tmpColor == undefined) {
tmpColor = (enable ? 0 : 8947848);
}
this.setColor(tmpColor);
};
FLabelClass.prototype.getLabel = function () {
return(this.labelField.text);
};
FLabelClass.prototype.setColor = function (col) {
this.labelField.textColor = col;
};
#endinitclip
Symbol 91 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(background_mc, "background");
Symbol 100 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 103 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(background_mc, "backgroundDisabled");
Symbol 105 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(background_mc, "backgroundDisabled");
Symbol 108 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(disabled_mc, "foregroundDisabled");
Symbol 111 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(dot_mc, "radioDot");
Symbol 112 MovieClip [frb_states] Frame 1
stop();
Symbol 112 MovieClip [frb_states] Frame 2
stop();
Symbol 112 MovieClip [frb_states] Frame 3
stop();
Symbol 112 MovieClip [frb_states] Frame 4
stop();
Symbol 112 MovieClip [frb_states] Frame 5
stop();
Symbol 113 MovieClip [FUIComponentSymbol] Frame 1
#initclip 2
function FUIComponentClass() {
this.init();
}
FUIComponentClass.prototype = new MovieClip();
FUIComponentClass.prototype.init = function () {
this.enable = true;
this.focused = false;
this.useHandCursor = false;
this._accImpl = new Object();
this._accImpl.stub = true;
this.styleTable = new Array();
if (_global.globalStyleFormat == undefined) {
_global.globalStyleFormat = new FStyleFormat();
globalStyleFormat.isGlobal = true;
_global._focusControl = new Object();
_global._focusControl.onSetFocus = function (oldFocus, newFocus) {
oldFocus.myOnKillFocus();
newFocus.myOnSetFocus();
};
Selection.addListener(_global._focusControl);
}
if (this._name != undefined) {
this._focusrect = false;
this.tabEnabled = true;
this.focusEnabled = true;
this.tabChildren = false;
this.tabFocused = true;
if (this.hostStyle == undefined) {
globalStyleFormat.addListener(this);
} else {
this.styleTable = this.hostStyle;
}
this.deadPreview._visible = false;
this.deadPreview._width = (this.deadPreview._height = 1);
this.methodTable = new Object();
this.keyListener = new Object();
this.keyListener.controller = this;
this.keyListener.onKeyDown = function () {
this.controller.myOnKeyDown();
};
this.keyListener.onKeyUp = function () {
this.controller.myOnKeyUp();
};
for (var i in this.styleFormat_prm) {
this.setStyleProperty(i, this.styleFormat_prm[i]);
}
}
};
FUIComponentClass.prototype.setEnabled = function (enabledFlag) {
this.enable = ((arguments.length > 0) ? (enabledFlag) : true);
this.tabEnabled = (this.focusEnabled = enabledFlag);
if ((!this.enable) && (this.focused)) {
Selection.setFocus(undefined);
}
};
FUIComponentClass.prototype.getEnabled = function () {
return(this.enable);
};
FUIComponentClass.prototype.setSize = function (w, h) {
this.width = w;
this.height = h;
this.focusRect.removeMovieClip();
};
FUIComponentClass.prototype.setChangeHandler = function (chng, obj) {
this.handlerObj = ((obj == undefined) ? (this._parent) : (obj));
this.changeHandler = chng;
};
FUIComponentClass.prototype.invalidate = function (methodName) {
this.methodTable[methodName] = true;
this.onEnterFrame = this.cleanUI;
};
FUIComponentClass.prototype.cleanUI = function () {
if (this.methodTable.setSize) {
this.setSize(this.width, this.height);
} else {
this.cleanUINotSize();
}
this.methodTable = new Object();
delete this.onEnterFrame;
};
FUIComponentClass.prototype.cleanUINotSize = function () {
for (var funct in this.methodTable) {
this[funct]();
}
};
FUIComponentClass.prototype.drawRect = function (x, y, w, h) {
var inner = this.styleTable.focusRectInner.value;
var outer = this.styleTable.focusRectOuter.value;
if (inner == undefined) {
inner = 16777215 /* 0xFFFFFF */;
}
if (outer == undefined) {
outer = 0;
}
this.createEmptyMovieClip("focusRect", 1000);
this.focusRect.controller = this;
this.focusRect.lineStyle(1, outer);
this.focusRect.moveTo(x, y);
this.focusRect.lineTo(x + w, y);
this.focusRect.lineTo(x + w, y + h);
this.focusRect.lineTo(x, y + h);
this.focusRect.lineTo(x, y);
this.focusRect.lineStyle(1, inner);
this.focusRect.moveTo(x + 1, y + 1);
this.focusRect.lineTo((x + w) - 1, y + 1);
this.focusRect.lineTo((x + w) - 1, (y + h) - 1);
this.focusRect.lineTo(x + 1, (y + h) - 1);
this.focusRect.lineTo(x + 1, y + 1);
};
FUIComponentClass.prototype.pressFocus = function () {
this.tabFocused = false;
this.focusRect.removeMovieClip();
Selection.setFocus(this);
};
FUIComponentClass.prototype.drawFocusRect = function () {
this.drawRect(-2, -2, this.width + 4, this.height + 4);
};
FUIComponentClass.prototype.myOnSetFocus = function () {
this.focused = true;
Key.addListener(this.keyListener);
if (this.tabFocused) {
this.drawFocusRect();
}
};
FUIComponentClass.prototype.myOnKillFocus = function () {
this.tabFocused = true;
this.focused = false;
this.focusRect.removeMovieClip();
Key.removeListener(this.keyListener);
};
FUIComponentClass.prototype.executeCallBack = function () {
this.handlerObj[this.changeHandler](this);
};
FUIComponentClass.prototype.updateStyleProperty = function (styleFormat, propName) {
this.setStyleProperty(propName, styleFormat[propName], styleFormat.isGlobal);
};
FUIComponentClass.prototype.setStyleProperty = function (propName, value, isGlobal) {
if (value == "") {
return(undefined);
}
var tmpValue = parseInt(value);
if (!isNaN(tmpValue)) {
value = tmpValue;
}
var global = ((arguments.length > 2) ? (isGlobal) : false);
if (this.styleTable[propName] == undefined) {
this.styleTable[propName] = new Object();
this.styleTable[propName].useGlobal = true;
}
if (this.styleTable[propName].useGlobal || (!global)) {
this.styleTable[propName].value = value;
if (this.setCustomStyleProperty(propName, value)) {
} else if (propName == "embedFonts") {
this.invalidate("setSize");
} else if (propName.subString(0, 4) == "text") {
if (this.textStyle == undefined) {
this.textStyle = new TextFormat();
}
var textProp = propName.subString(4, propName.length);
this.textStyle[textProp] = value;
this.invalidate("setSize");
} else {
for (var j in this.styleTable[propName].coloredMCs) {
var myColor = new Color(this.styleTable[propName].coloredMCs[j]);
if (this.styleTable[propName].value == undefined) {
var myTObj = {ra:"100", rb:"0", ga:"100", gb:"0", ba:"100", bb:"0", aa:"100", ab:"0"};
myColor.setTransform(myTObj);
} else {
myColor.setRGB(value);
}
}
}
this.styleTable[propName].useGlobal = global;
}
};
FUIComponentClass.prototype.registerSkinElement = function (skinMCRef, propName) {
if (this.styleTable[propName] == undefined) {
this.styleTable[propName] = new Object();
this.styleTable[propName].useGlobal = true;
}
if (this.styleTable[propName].coloredMCs == undefined) {
this.styleTable[propName].coloredMCs = new Object();
}
this.styleTable[propName].coloredMCs[skinMCRef] = skinMCRef;
if (this.styleTable[propName].value != undefined) {
var myColor = new Color(skinMCRef);
myColor.setRGB(this.styleTable[propName].value);
}
};
_global.FStyleFormat = function () {
this.nonStyles = {listeners:true, isGlobal:true, isAStyle:true, addListener:true, removeListener:true, nonStyles:true, applyChanges:true};
this.listeners = new Object();
this.isGlobal = false;
if (arguments.length > 0) {
for (var i in arguments[0]) {
this[i] = arguments[0][i];
}
}
};
_global.FStyleFormat.prototype = new Object();
FStyleFormat.prototype.addListener = function () {
var arg = 0;
while (arg < arguments.length) {
var mcRef = arguments[arg];
this.listeners[arguments[arg]] = mcRef;
for (var i in this) {
if (this.isAStyle(i)) {
mcRef.updateStyleProperty(this, i.toString());
}
}
arg++;
}
};
FStyleFormat.prototype.removeListener = function (component) {
this.listeners[component] = undefined;
for (var prop in this) {
if (this.isAStyle(prop)) {
if (component.styleTable[prop].useGlobal == this.isGlobal) {
component.styleTable[prop].useGlobal = true;
var value = (this.isGlobal ? undefined : (globalStyleFormat[prop]));
component.setStyleProperty(prop, value, true);
}
}
}
};
FStyleFormat.prototype.applyChanges = function () {
var count = 0;
for (var i in this.listeners) {
var component = this.listeners[i];
if (arguments.length > 0) {
var j = 0;
while (j < arguments.length) {
if (this.isAStyle(arguments[j])) {
component.updateStyleProperty(this, arguments[j]);
}
j++;
}
} else {
for (var j in this) {
if (this.isAStyle(j)) {
component.updateStyleProperty(this, j.toString());
}
}
}
}
};
FStyleFormat.prototype.isAStyle = function (name) {
return((this.nonStyles[name] ? false : true));
};
#endinitclip
Symbol 119 MovieClip [FBoundingBoxSymbol] Frame 1
var component = _parent;
component.registerSkinElement(boundingBox, "background");
stop();
Symbol 119 MovieClip [FBoundingBoxSymbol] Frame 2
component.registerSkinElement(boundingBox2, "backgroundDisabled");
stop();
Symbol 120 MovieClip [FRadioButtonSymbol] Frame 1
#initclip 3
function FRadioButtonClass() {
this.init();
}
function FRadioButtonGroupClass() {
this.radioInstances = new Array();
}
FRadioButtonClass.prototype = new FUIComponentClass();
FRadioButtonGroupClass.prototype = new FUIComponentClass();
Object.registerClass("FRadioButtonSymbol", FRadioButtonClass);
FRadioButtonClass.prototype.init = function () {
if (this.initialState == undefined) {
this.selected = false;
} else {
this.selected = this.initialState;
}
super.setSize(this._width, this._height);
this.boundingBox_mc.unloadMovie();
this.boundingBox_mc._width = 0;
this.boundingBox_mc._height = 0;
this.attachMovie("frb_hitArea", "frb_hitArea_mc", 1);
this.attachMovie("frb_states", "frb_states_mc", 2);
this.attachMovie("FLabelSymbol", "fLabel_mc", 3);
super.init();
this._xscale = 100;
this._yscale = 100;
this.setSize(this.width, this.height);
this.setChangeHandler(this.changeHandler);
if (this.label != undefined) {
this.setLabel(this.label);
}
if (this.initialState == undefined) {
this.setValue(false);
} else {
this.setValue(this.initialState);
}
if (this.data == "") {
this.data = undefined;
} else {
this.setData(this.data);
}
this.addToRadioGroup();
this.ROLE_SYSTEM_RADIOBUTTON = 45;
this.STATE_SYSTEM_SELECTED = 16;
this.EVENT_OBJECT_STATECHANGE = 32778;
this.EVENT_OBJECT_NAMECHANGE = 32780;
this._accImpl.master = this;
this._accImpl.stub = false;
this._accImpl.get_accRole = this.get_accRole;
this._accImpl.get_accName = this.get_accName;
this._accImpl.get_accState = this.get_accState;
this._accImpl.get_accDefaultAction = this.get_accDefaultAction;
this._accImpl.accDoDefaultAction = this.accDoDefaultAction;
};
FRadioButtonClass.prototype.setHitArea = function (w, h) {
var hit = this.frb_hitArea_mc;
this.hitArea = hit;
if (this.frb_states_mc._width > w) {
hit._width = this.frb_states_mc._width;
} else {
hit._width = w;
}
hit._visible = false;
if (arguments.length > 1) {
hit._height = h;
}
};
FRadioButtonClass.prototype.txtFormat = function (pos) {
var txtS = this.textStyle;
var sTbl = this.styleTable;
txtS.align = ((sTbl.textAlign.value == undefined) ? ((txtS.align = pos)) : undefined);
txtS.leftMargin = ((sTbl.textLeftMargin.value == undefined) ? ((txtS.leftMargin = 0)) : undefined);
txtS.rightMargin = ((sTbl.textRightMargin.value == undefined) ? ((txtS.rightMargin = 0)) : undefined);
if (this.flabel_mc._height > this.height) {
super.setSize(this.width, this.flabel_mc._height);
} else {
super.setSize(this.width, this.height);
}
this.setEnabled(this.enable);
};
FRadioButtonClass.prototype.setSize = function (w, h) {
this.setLabel(this.getLabel());
this.setLabelPlacement(this.labelPlacement);
if (this.frb_states_mc._height < this.flabel_mc.labelField._height) {
super.setSize(w, this.flabel_mc.labelField._height);
}
this.setHitArea(this.width, this.height);
this.setLabelPlacement(this.labelPlacement);
};
FRadioButtonClass.prototype.setLabelPlacement = function (pos) {
this.setLabel(this.getLabel());
this.txtFormat(pos);
var halfLabelH = (this.fLabel_mc._height / 2);
var halfFrameH = (this.frb_states_mc._height / 2);
var vertCenter = (halfFrameH - halfLabelH);
var radioWidth = this.frb_states_mc._width;
var frame = this.frb_states_mc;
var label = this.fLabel_mc;
var w = (this.width - frame._width);
if (frame._width > this.width) {
w = 0;
} else {
w = this.width - frame._width;
}
this.fLabel_mc.setSize(w);
if ((pos == "right") || (pos == undefined)) {
this.labelPlacement = "right";
this.frb_states_mc._x = 0;
this.fLabel_mc._x = radioWidth;
this.txtFormat("left");
} else if (pos == "left") {
this.labelPlacement = "left";
this.fLabel_mc._x = 0;
this.frb_states_mc._x = this.width - radioWidth;
this.txtFormat("right");
}
this.fLabel_mc._y = vertCenter;
this.frb_hitArea_mc._y = vertCenter;
this.setLabel(this.getLabel());
};
FRadioButtonClass.prototype.setData = function (dataValue) {
this.data = dataValue;
};
FRadioButtonClass.prototype.getData = function () {
return(this.data);
};
FRadioButtonClass.prototype.getState = function () {
return(this.selected);
};
FRadioButtonClass.prototype.getSize = function () {
return(this.width);
};
FRadioButtonClass.prototype.getGroupName = function () {
return(this.groupName);
};
FRadioButtonClass.prototype.setGroupName = function (groupName) {
var i = 0;
while (i < this._parent[this.groupName].radioInstances.length) {
if (this._parent[this.groupName].radioInstances[i] == this) {
delete this._parent[this.groupName].radioInstances[i];
}
i++;
}
this.groupName = groupName;
this.addToRadioGroup();
};
FRadioButtonClass.prototype.addToRadioGroup = function () {
if (this._parent[this.groupName] == undefined) {
this._parent[this.groupName] = new FRadioButtonGroupClass();
}
this._parent[this.groupName].addRadioInstance(this);
};
FRadioButtonClass.prototype.setValue = function (selected) {
if (selected || (selected == undefined)) {
this.setState(true);
this.focusRect.removeMovieClip();
this.executeCallBack();
} else if (selected == false) {
this.setState(false);
}
};
FRadioButtonClass.prototype.setTabState = function (selected) {
Selection.setFocus(this);
this.setState(selected);
this.drawFocusRect();
this.executeCallBack();
};
FRadioButtonClass.prototype.setState = function (selected) {
if (selected || (selected == undefined)) {
this.tabEnabled = true;
for (var i in this._parent) {
if ((this != this._parent[i]) && (this._parent[i].groupName == this.groupName)) {
this._parent[i].setState(false);
this._parent[i].tabEnabled = false;
}
}
}
if (this.enable) {
this.flabel_mc.setEnabled(true);
if (selected || (selected == undefined)) {
this.frb_states_mc.gotoAndStop("selectedEnabled");
this.enabled = false;
this.selected = true;
this.tabEnabled = true;
this.tabFocused = true;
} else {
this.frb_states_mc.gotoAndStop("unselectedEnabled");
this.enabled = true;
this.selected = false;
this.tabEnabled = false;
var enabTrue = this._parent[this.groupName].getEnabled();
var noneSelect = (this._parent[this.groupName].getValue() == undefined);
if (enabTrue && (noneSelect)) {
this._parent[this.groupName].radioInstances[0].tabEnabled = true;
}
}
} else {
this.flabel_mc.setEnabled(false);
if (selected || (selected == undefined)) {
this.frb_states_mc.gotoAndStop("selectedDisabled");
this.enabled = false;
this.selected = true;
this.tabEnabled = false;
} else {
this.frb_states_mc.gotoAndStop("unselectedDisabled");
this.enabled = false;
this.selected = false;
this.tabEnabled = false;
}
}
if (Accessibility.isActive()) {
Accessibility.sendEvent(this, 0, this.EVENT_OBJECT_STATECHANGE, true);
}
};
FRadioButtonClass.prototype.getValue = function () {
if (this.selected) {
if ((this.data == "") || (this.data == undefined)) {
return(this.getLabel());
}
return(this.data);
}
};
FRadioButtonClass.prototype.setEnabled = function (enable) {
if ((enable == true) || (enable == undefined)) {
this.enable = true;
super.setEnabled(true);
} else {
this.enable = false;
super.setEnabled(false);
}
this.setState(this.selected);
var cgn = (this._parent[this.groupName].getEnabled() == undefined);
var cgnez = (this._parent[this.groupName].radioInstances[0].getEnabled() == false);
if (cgn && (cgnez)) {
var i = 0;
while (i < this._parent[this.groupName].radioInstances.length) {
if (this._parent[this.groupName].radioInstances[i].getEnabled() == true) {
this._parent[this.groupName].radioInstances[i].tabEnabled = true;
return(undefined);
}
i++;
}
}
};
FRadioButtonClass.prototype.getEnabled = function () {
return(this.enable);
};
FRadioButtonClass.prototype.setLabel = function (label) {
this.fLabel_mc.setLabel(label);
this.txtFormat();
if (Accessibility.isActive()) {
Accessibility.sendEvent(this, 0, this.EVENT_OBJECT_NAMECHANGE);
}
};
FRadioButtonClass.prototype.getLabel = function () {
return(this.fLabel_mc.getLabel());
};
FRadioButtonClass.prototype.onPress = function () {
this.pressFocus();
this.frb_states_mc.gotoAndStop("press");
};
FRadioButtonClass.prototype.onRelease = function () {
this.frb_states_mc.gotoAndStop("unselectedDisabled");
this.setValue(!this.selected);
};
FRadioButtonClass.prototype.onReleaseOutside = function () {
this.frb_states_mc.gotoAndStop("unselectedEnabled");
};
FRadioButtonClass.prototype.onDragOut = function () {
this.frb_states_mc.gotoAndStop("unselectedEnabled");
};
FRadioButtonClass.prototype.onDragOver = function () {
this.frb_states_mc.gotoAndStop("press");
};
FRadioButtonClass.prototype.executeCallBack = function () {
this.handlerObj[this.changeHandler](this._parent[this.groupName]);
};
FRadioButtonGroupClass.prototype.addRadioInstance = function (instance) {
this.radioInstances.push(instance);
this.radioInstances[0].tabEnabled = true;
};
FRadioButtonGroupClass.prototype.setEnabled = function (enableFlag) {
var i = 0;
while (i < this.radioInstances.length) {
this.radioInstances[i].setEnabled(enableFlag);
i++;
}
};
FRadioButtonGroupClass.prototype.getEnabled = function () {
var i = 0;
while (i < this.radioInstances.length) {
if (this.radioInstances[i].getEnabled() != this.radioInstances[0].getEnabled()) {
return(undefined);
}
i++;
}
return(this.radioInstances[0].getEnabled());
};
FRadioButtonGroupClass.prototype.setChangeHandler = function (changeHandler, obj) {
var i = 0;
while (i < this.radioInstances.length) {
this.radioInstances[i].setChangeHandler(changeHandler, obj);
i++;
}
};
FRadioButtonGroupClass.prototype.getValue = function () {
var i = 0;
while (i < this.radioInstances.length) {
if (this.radioInstances[i].selected == true) {
if ((this.radioInstances[i].data == "") || (this.radioInstances[i].data == undefined)) {
return(this.radioInstances[i].getLabel());
}
return(this.radioInstances[i].data);
}
i++;
}
};
FRadioButtonGroupClass.prototype.getData = function () {
var i = 0;
while (i < this.radioInstances.length) {
if (this.radioInstances[i].selected) {
return(this.radioInstances[i].getData());
}
i++;
}
};
FRadioButtonGroupClass.prototype.getInstance = function () {
var i = 0;
while (i < this.radioInstances.length) {
if (this.radioInstances[i].selected == true) {
return(i);
}
i++;
}
};
FRadioButtonGroupClass.prototype.setValue = function (dataValue) {
var i = 0;
while (i < this.radioInstances.length) {
if (this.radioInstances[i].data == dataValue) {
this.radioInstances[i].setValue(true);
return(undefined);
}
i++;
}
var i = 0;
while (i < this.radioInstances.length) {
if (this.radioInstances[i].getLabel() == dataValue) {
this.radioInstances[i].setValue(true);
}
i++;
}
};
FRadioButtonGroupClass.prototype.setSize = function (w) {
var i = 0;
while (i < this.radioInstances.length) {
this.radioInstances[i].setSize(w);
i++;
}
};
FRadioButtonGroupClass.prototype.getSize = function () {
var widestRadio = 0;
var i = 0;
while (i < this.radioInstances.length) {
if (this.radioInstances[i].width >= widestRadio) {
widestRadio = this.radioInstances[i].width;
}
i++;
}
return(widestRadio);
};
FRadioButtonGroupClass.prototype.setGroupName = function (groupName) {
this.oldGroupName = this.radioInstances[0].groupName;
var i = 0;
while (i < this.radioInstances.length) {
this.radioInstances[i].groupName = groupName;
this.radioInstances[i].addToRadioGroup();
i++;
}
delete this._parent[this.oldGroupName];
};
FRadioButtonGroupClass.prototype.getGroupName = function () {
return(this.radioInstances[0].groupName);
};
FRadioButtonGroupClass.prototype.setLabelPlacement = function (pos) {
var i = 0;
while (i < this.radioInstances.length) {
this.radioInstances[i].setLabelPlacement(pos);
i++;
}
};
FRadioButtonGroupClass.prototype.setStyleProperty = function (propName, value, isGlobal) {
var i = 0;
while (i < this.radioInstances.length) {
this.radioInstances[i].setStyleProperty(propName, value, isGlobal);
i++;
}
};
FRadioButtonGroupClass.prototype.addListener = function () {
var i = 0;
while (i < this.radioInstances.length) {
this.radioInstances[i].addListener();
i++;
}
};
FRadioButtonGroupClass.prototype.applyChanges = function () {
var i = 0;
while (i < this.radioInstances.length) {
this.radioInstances[i].applyChanges();
i++;
}
};
FRadioButtonGroupClass.prototype.removeListener = function (component) {
var i = 0;
while (i < this.radioInstances.length) {
this.radioInstances[i].removeListener(component);
i++;
}
};
FRadioButtonClass.prototype.drawFocusRect = function () {
this.drawRect(-2, -2, this._width + 6, this._height - 3);
};
FRadioButtonClass.prototype.myOnKillFocus = function () {
Key.removeListener(this.keyListener);
this.focused = false;
this.focusRect.removeMovieClip();
this._parent[this.groupName].foobar = 0;
};
FRadioButtonClass.prototype.myOnKeyDown = function () {
if ((Key.getCode() == 32) && (this._parent[this.groupName].getValue() == undefined)) {
if (this._parent[this.groupName].radioInstances[0] == this) {
this.setTabState(true);
}
}
if ((Key.getCode() == 40) && (this.pressOnce == undefined)) {
this.foobar = this._parent[this.groupName].getInstance();
var i = this.foobar;
while (i < this._parent[this.groupName].radioInstances.length) {
var inc = (i + 1);
if (this._parent[this.groupName].radioInstances[inc].getEnabled()) {
this._parent[this.groupName].radioInstances[inc].setTabState(true);
return(undefined);
}
i++;
}
}
if ((Key.getCode() == 38) && (this.pressOnce == undefined)) {
this.foobar = this._parent[this.groupName].getInstance();
var i = this.foobar;
while (i >= 0) {
var inc = (i - 1);
if (this._parent[this.groupName].radioInstances[inc].getEnabled()) {
this._parent[this.groupName].radioInstances[inc].setTabState(true);
return(undefined);
}
i--;
}
}
};
FRadioButtonClass.prototype.get_accRole = function (childId) {
return(this.master.ROLE_SYSTEM_RADIOBUTTON);
};
FRadioButtonClass.prototype.get_accName = function (childId) {
return(this.master.getLabel());
};
FRadioButtonClass.prototype.get_accState = function (childId) {
if (this.master.getState()) {
return(this.master.STATE_SYSTEM_SELECTED);
}
return(0);
};
FRadioButtonClass.prototype.get_accDefaultAction = function (childId) {
if (this.master.getState()) {
return("UnCheck");
}
return("Check");
};
FRadioButtonClass.prototype.accDoDefaultAction = function (childId) {
this.master.setValue(!this.master.getValue());
};
#endinitclip
boundingBox_mc._visible = false;
deadPreview._visible = false;
Symbol 124 Button
on (rollOver) {
nextFrame();
}
on (rollOut) {
prevFrame();
}
Symbol 132 MovieClip Frame 1
stop();
Symbol 153 Button
on (release) {
_root.play();
}
Symbol 154 MovieClip Frame 2
if (_root.getBytesLoaded() < _root.getBytesTotal()) {
loadingText = ("Loading " + Math.round((_root.getBytesLoaded() / _root.getBytesTotal()) * 100)) + "%";
estimate = ("Complete in " + Math.round((_root.getBytesTotal() - _root.getBytesLoaded()) / ((_root.getBytesLoaded() / getTimer()) * 1000))) + " seconds";
prevFrame();
play();
}
Symbol 154 MovieClip Frame 4
stop();
Symbol 156 Button
on (press) {
_root.gotoAndPlay("sceneOpeningEnd");
}
Symbol 235 MovieClip Frame 1
volumeControl = new Sound();
stop();
Symbol 235 MovieClip Frame 4
if (volumeControl.getVolume() > 5) {
volumeControl.setVolume(volumeControl.getVolume() - 5);
prevFrame();
play();
} else {
stopAllSounds();
volumeControl.setVolume(100);
_root.openingLoopPlaying = false;
_root.play();
gotoAndStop (1);
}
Symbol 237 MovieClip Frame 1
function startLoop() {
if (!_root.openingLoopPlaying) {
_root.openingLoopPlaying = true;
play();
}
}
function fadeLoop() {
fader.play();
}
stop();
Symbol 237 MovieClip Frame 3
stop();
Symbol 248 Button
on (release) {
with (_root) {
if (adultContent) {
previousScene = "sceneMainMenu";
selectedItem = "sceneGallery";
play();
}
}
}
Symbol 249 Button
on (release) {
with (_root) {
selectedItem = "sceneGraphicsOptions";
play();
}
}
Symbol 250 Button
on (release) {
with (_root) {
selectedItem = "sceneNewArena";
play();
}
}
Symbol 251 Button
on (release) {
with (_root) {
previousScene = "sceneMainMenu";
selectedItem = "sceneHighScore";
play();
}
}
Symbol 252 Button
on (release) {
with (_root) {
selectedItem = "sceneTutorial";
play();
}
}
Symbol 253 Button
on (release) {
with (_root) {
selectedItem = "sceneNewAdventure";
play();
}
}
Symbol 262 MovieClip Frame 26
if (Math.random() < 0.5) {
gotoAndPlay (1);
}
Symbol 262 MovieClip Frame 53
if (Math.random() < 0.5) {
gotoAndPlay (27);
}
Symbol 263 MovieClip Frame 2
_rotation = (Math.random() * 360);
xTrans = (Math.random() * 4) + 1;
yTrans = (Math.random() * 4) + 1;
_xscale = (_xscale + (Math.random() * 20));
_yscale = _xscale;
if (Math.random() < 0.66) {
_x = (Math.random() * 550);
_y = ((-Math.random()) * 50);
} else {
_x = ((-Math.random()) * 50);
_y = (Math.random() * 400);
}
Symbol 263 MovieClip Frame 4
_x = (_x + xTrans);
_y = (_y + yTrans);
xTrans = xTrans + ((Math.random() - 0.5) / 3);
if ((_x > 550) || (_y > 400)) {
removeMovieClip("");
} else {
prevFrame();
play();
}
Symbol 264 MovieClip Frame 1
sakuraTimer = new _root.Timer();
nextSpawnTime = 100;
c = 1;
Instance of Symbol 263 MovieClip "oSakura" in Symbol 264 MovieClip Frame 1
onClipEvent (load) {
if (_name == "oSakura") {
stop();
_visible = false;
}
}
Symbol 264 MovieClip Frame 3
if ((!((_root.smokeScreen && (_root.arenaMode)) && (_root.inCombat))) && (sakuraTimer.timeOver(nextSpawnTime))) {
duplicateMovieClip ("oSakura", "saku" + c, c);
c = (c + 1) % 5000;
sakuraTimer.resetTimer();
nextSpawnTime = 200 + (Math.random() * 300);
}
prevFrame();
play();
Symbol 278 MovieClip Frame 1
function update(v) {
gotoAndStop(v + 1);
}
stop();
Symbol 280 Button
on (release) {
play();
}
Symbol 283 MovieClip Frame 1
function update(v) {
gotoAndStop(v + 1);
}
Symbol 284 Button
on (release) {
if (smokeScreen) {
objSmokeScreen.update(1);
smokeScreen = false;
} else {
objSmokeScreen.update(0);
smokeScreen = true;
}
}
on (rollOver) {
objHelpDisplay.update(3);
}
on (rollOut) {
objHelpDisplay.update(0);
}
Symbol 286 Button
on (release) {
if (autoQuality) {
objAutoQuality.update(1);
autoQuality = false;
} else {
objAutoQuality.update(0);
autoQuality = true;
}
}
on (rollOver) {
objHelpDisplay.update(2);
}
on (rollOut) {
objHelpDisplay.update(0);
}
Symbol 291 MovieClip Frame 1
function update(v) {
gotoAndStop(v + 1);
}
Symbol 292 Button
on (release) {
if (_quality == "LOW") {
objQuality.update(1);
_quality = "MEDIUM";
} else if (_quality == "MEDIUM") {
objQuality.update(2);
_quality = "HIGH";
} else {
objQuality.update(0);
_quality = "LOW";
}
}
on (rollOver) {
objHelpDisplay.update(1);
}
on (rollOut) {
objHelpDisplay.update(0);
}
Symbol 294 Button
on (release) {
if (adultContent) {
objAdultContent.update(1);
adultContent = false;
} else {
objAdultContent.update(0);
adultContent = true;
}
}
on (rollOver) {
objHelpDisplay.update(4);
}
on (rollOut) {
objHelpDisplay.update(0);
}
Symbol 300 MovieClip Frame 1
function startLoop() {
play();
}
function fadeLoop() {
fader.play();
}
stop();
Symbol 300 MovieClip Frame 3
stop();
Symbol 338 MovieClip Frame 1
function renameTime() {
var timeDiff;
var i = 0;
while (i < 8) {
timeDiff = int(eval ("timeObj" + i).text);
minu = Math.floor(timeDiff / 60000);
if (minu < 10) {
minu = "0" + minu;
}
sec = Math.floor((timeDiff % 60000) / 1000);
if (sec < 10) {
sec = "0" + sec;
}
milsec = Math.floor((timeDiff % 1000) / 10);
if (milsec < 10) {
milsec = "0" + milsec;
}
eval ("timeObj" + i).text = (((minu + ":") + sec) + ":") + milsec;
i++;
}
}
stop();
Symbol 341 MovieClip Frame 2
_xscale = (60 + (Math.random() * 50));
_yscale = _xscale;
xTrans = (Math.random() * 2) - 1;
yTrans = ((4 * _xscale) / 100) + Math.random();
if (Math.random() < 0.66) {
_x = (Math.random() * 550);
_y = ((-Math.random()) * 50);
} else {
if (_parent.wind >= 0) {
_x = ((-Math.random()) * 20);
} else {
_x = (550 + (Math.random() * 20));
}
_y = (Math.random() * 400);
}
_visible = true;
Symbol 341 MovieClip Frame 4
_x = (_x + (_parent.wind + xTrans));
_y = (_y + yTrans);
yTrans = yTrans + 0.01;
if (((_y > (180 + (_yscale * 2))) || (_x < -20)) || (_x > 570)) {
removeMovieClip("");
} else {
prevFrame();
play();
}
Symbol 342 MovieClip Frame 1
windTimer = new _root.Timer();
snowTimer = new _root.Timer();
nextSpawnTime = 100;
c = 1;
wind = 0;
Instance of Symbol 341 MovieClip "oSnow" in Symbol 342 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
if (_name == "oSnow") {
stop();
}
}
Symbol 342 MovieClip Frame 3
if (snowTimer.timeOver(nextSpawnTime)) {
duplicateMovieClip ("oSnow", "snow" + c, c);
c = (c + 1) % 5000;
snowTimer.resetTimer();
nextSpawnTime = 200 + (Math.random() * 100);
}
if (windTimer.timeOver(1000)) {
wind = wind + ((Math.random() * 2) - 1);
if (wind > 5) {
if (Math.random() < 0.2) {
wind = 0;
} else {
wind = 5;
}
}
if (wind < -5) {
if (Math.random() < 0.2) {
wind = 0;
} else {
wind = -5;
}
}
windTimer.resetTimer();
}
prevFrame();
play();
Symbol 346 Button
on (release) {
_root.gotoAndPlay("sceneHighScore");
}
Symbol 347 Button
on (release) {
_root.gotoAndPlay("sceneHSCancel");
}
Symbol 359 MovieClip Frame 2
stop();
Symbol 360 Button
on (rollOver, press) {
editHelp._xscale = 100;
editHelp._yscale = 100;
editHelp._visible = true;
}
on (rollOut, release, releaseOutside) {
editHelp._xscale = 0;
editHelp._yscale = 0;
editHelp._visible = false;
}
Symbol 362 Button
on (release) {
_root.gotoScene = "sceneMainMenu";
}
Symbol 364 Button
on (release) {
_root.nextBishojo = -1;
var i = 0;
while (i < _root.bishojoName.length) {
if (nextBishojo.toLowerCase() == _root.bishojoName[i].toLowerCase()) {
_root.nextBishojo = i;
}
i++;
}
if (_root.nextBishojo != -1) {
_root.addToPile();
}
}
Symbol 366 MovieClip Frame 1
stop();
viewable = true;
Instance of Symbol 359 MovieClip "editHelp" in Symbol 366 MovieClip Frame 1
onClipEvent (load) {
_xscale = 0;
_yscale = 0;
_visible = false;
}
Symbol 366 MovieClip Frame 2
viewable = false;
Symbol 366 MovieClip Frame 10
_visible = false;
stop();
Symbol 366 MovieClip Frame 11
_visible = true;
Symbol 414 MovieClip Frame 1
stop();
Instance of Symbol 385 MovieClip "box" in Symbol 414 MovieClip Frame 2
onClipEvent (load) {
stop();
_visible = false;
}
Symbol 414 MovieClip Frame 16
gotoAndPlay (2);
Symbol 414 MovieClip Frame 18
stop();
Symbol 414 MovieClip Frame 23
stop();
Symbol 414 MovieClip Frame 28
stop();
Symbol 414 MovieClip Frame 33
stop();
Symbol 414 MovieClip Frame 38
stop();
Symbol 414 MovieClip Frame 43
stop();
Symbol 414 MovieClip Frame 48
stop();
Symbol 414 MovieClip Frame 53
stop();
Symbol 414 MovieClip Frame 58
stop();
Symbol 414 MovieClip Frame 63
stop();
Symbol 414 MovieClip Frame 68
stop();
Symbol 414 MovieClip Frame 73
stop();
Symbol 414 MovieClip Frame 78
stop();
Symbol 414 MovieClip Frame 83
stop();
Symbol 415 MovieClip Frame 1
function moveTo(x, y) {
_x = x;
_y = y;
_xscale = ((((_y - 200) / 350) * 90) + 20);
_yscale = _xscale;
}
function flip() {
play();
}
if (_name == "oBishojo") {
stop();
}
Symbol 415 MovieClip Frame 2
moveTo(_x, _y);
sprites.gotoAndPlay("gal" + _root.nextBishojo);
stop();
Symbol 415 MovieClip Frame 14
stop();
Symbol 415 MovieClip Frame 26
gotoAndStop (3);
Symbol 418 MovieClip Frame 1
if (_root.MISSION_TYPE != 2) {
stop();
}
Symbol 418 MovieClip Frame 2
stop();
Symbol 418 MovieClip Frame 4
stop();
Symbol 421 MovieClip Frame 1
function update(v) {
gotoAndStop(v + 1);
}
stop();
Symbol 422 Button
on (release) {
character = 1 - character;
if (character == 0) {
_root.rerollStats();
objCustomSetup.update(character);
} else {
objCustomSetup.selectPanel(character);
}
objCharacter.update(character);
}
Symbol 426 MovieClip Frame 1
function update(v) {
gotoAndStop(v + 1);
}
stop();
Symbol 427 Button
on (release) {
levelDifficulty = (levelDifficulty + 1) % 3;
updateEpisode();
}
Symbol 432 MovieClip Frame 1
function update(v) {
gotoAndStop(v + 1);
}
stop();
Symbol 433 Button
on (release) {
MISSION_TYPE = (MISSION_TYPE + 1) % 4;
updateEpisode();
}
Symbol 435 Button
on (release) {
_root.gotoAndPlay("sceneMainMenu");
}
Symbol 436 Button
on (release) {
preMission = true;
gotoScene = "sceneStoryline";
play();
}
Symbol 438 Button
on (release) {
_root.rerollStats();
update(0);
}
Symbol 494 MovieClip Frame 1
stop();
Symbol 495 MovieClip Frame 1
function adjustIcon(i) {
if (i == 0) {
icon._visible = false;
} else {
icon._visible = true;
icon.gotoAndStop(i);
}
}
stop();
Symbol 500 Button
on (release) {
if (!_root.DecodePlayer(playerCode)) {
playerCode = "ERROR";
} else {
_root.createEpisode();
update(1);
}
}
Symbol 501 MovieClip Frame 1
function selectPanel(n) {
gotoAndStop((n + 1) * 3);
}
function update(n) {
invChange();
attChange();
selectPanel(n);
}
function invChange() {
var i = 0;
while (i < 5) {
eval ("stats.invSlot" + i).adjustIcon(_root.playerInventory[i]);
i++;
}
i = 1;
while (i <= 4) {
eval ("stats.cast" + i)._visible = false;
i++;
}
i = 1;
while (i <= _root.playerLevel) {
eval ("stats.cast" + i)._visible = true;
i++;
}
}
function attChange() {
stats.att0 = _root.playerMaxStats[0];
stats.att1c = _root.playerCurStats[1];
stats.att1 = _root.playerMaxStats[1];
stats.att2 = _root.playerMaxStats[2];
stats.att3c = _root.playerCurStats[3];
stats.att3 = _root.playerMaxStats[3];
}
function mapHeightChange() {
_root.GRID_HEIGHT = objMapHeight.getScrollPosition();
MAP_HEIGHT = objMapHeight.getScrollPosition();
}
function mapWidthChange() {
_root.GRID_WIDTH = objMapWidth.getScrollPosition();
MAP_WIDTH = objMapWidth.getScrollPosition();
}
function tdChange() {
_root.TRAP_DIFFICULTY = objTrapDifficulty.getScrollPosition();
}
function edChange() {
_root.ENEMY_DIFFICULTY = objEnemyDifficulty.getScrollPosition();
}
function tpChange() {
_root.TREASURE_PCT = objTreasureAmount.getScrollPosition();
}
function eplChange() {
_root.ENEMY_PATROL_LEVEL = objEnemyClass.getScrollPosition();
}
stop();
Symbol 501 MovieClip Frame 8
stop();
Symbol 510 Button
on (release) {
with (_root) {
if (!aLock) {
aLock = true;
goForward = false;
fadeScreen.play();
}
}
}
Symbol 511 Button
on (release) {
with (_root) {
if (!aLock) {
aLock = true;
goForward = true;
fadeScreen.play();
}
}
}
Symbol 513 MovieClip Frame 10
stop();
Symbol 513 MovieClip Frame 20
_root.advanceStory();
Symbol 558 MovieClip Frame 1
stop();
Symbol 558 MovieClip Frame 5
_root.endStory();
Symbol 558 MovieClip Frame 9
_root.endStory();
Symbol 558 MovieClip Frame 12
_root.endStory();
Symbol 558 MovieClip Frame 15
_root.endStory();
Symbol 558 MovieClip Frame 18
_root.endStory();
Symbol 558 MovieClip Frame 22
_root.endStory();
Symbol 558 MovieClip Frame 30
stop();
Symbol 558 MovieClip Frame 34
_root.endStory();
Symbol 558 MovieClip Frame 39
_root.endStory();
Symbol 558 MovieClip Frame 42
_root.endStory();
Symbol 558 MovieClip Frame 46
_root.endStory();
Symbol 558 MovieClip Frame 49
_root.endStory();
Symbol 558 MovieClip Frame 54
_root.endStory();
Symbol 559 MovieClip Frame 1
stop();
Symbol 563 MovieClip Frame 1
function changeLoopTo(newLoopLabel) {
targetLabel = newLoopLabel;
gotoAndPlay (5);
}
volumeControl = new Sound();
stop();
Symbol 563 MovieClip Frame 6
if (volumeControl.getVolume() > 5) {
volumeControl.setVolume(volumeControl.getVolume() - 5);
prevFrame();
play();
} else {
stopAllSounds();
volumeControl.setVolume(100);
gotoAndPlay(targetLabel);
}
Symbol 563 MovieClip Frame 16
stop();
Symbol 563 MovieClip Frame 26
stop();
Symbol 563 MovieClip Frame 36
stop();
Symbol 566 MovieClip Frame 1
stop();
Symbol 566 MovieClip Frame 12
gotoAndStop (1);
Symbol 566 MovieClip Frame 22
gotoAndStop (1);
Symbol 570 MovieClip Frame 1
stop();
Symbol 570 MovieClip Frame 12
gotoAndStop (1);
Symbol 570 MovieClip Frame 22
gotoAndStop (1);
Symbol 570 MovieClip Frame 32
gotoAndStop (1);
Symbol 570 MovieClip Frame 42
gotoAndStop (1);
Symbol 575 MovieClip Frame 1
stop();
Symbol 575 MovieClip Frame 12
gotoAndStop (1);
Symbol 575 MovieClip Frame 22
gotoAndStop (1);
Symbol 575 MovieClip Frame 32
gotoAndStop (1);
Symbol 575 MovieClip Frame 42
gotoAndStop (1);
Symbol 577 MovieClip Frame 1
stop();
Symbol 577 MovieClip Frame 18
stop();
Symbol 595 MovieClip Frame 1
stop();
Symbol 595 MovieClip Frame 13
_root.worldCombatSpace.explosiveAttack(60);
Symbol 596 MovieClip Frame 1
stop();
Symbol 596 MovieClip Frame 8
removeMovieClip("");
Symbol 599 MovieClip Frame 1
if (_name == "stabShadow") {
stop();
_visible = false;
}
Symbol 599 MovieClip Frame 7
removeMovieClip("");
Symbol 604 MovieClip Frame 1
function arenaUnsheath() {
musicLoop = "none";
with (_root) {
cursor.stopDrag();
cursor._visible = false;
cursor._x = -150;
}
_root.worldTutorial.newMessage("When your cursor switches, prepare for combat!", 20);
gotoAndPlay (5);
}
function unsheath(roomType) {
if (roomType > 2) {
musicLoop = "boss";
} else {
musicLoop = "combat";
}
if (_root.smokeScreen) {
_root.worldSmokeScreen.play();
}
with (_root) {
takeHandle();
if (autoMap) {
worldAutoMap.play();
}
cursor.stopDrag();
cursor._visible = false;
cursor._x = -150;
inCombat = true;
}
_root.worldTutorial.newMessage("When your cursor switches, prepare for combat!", 20);
gotoAndPlay (5);
}
function moveCursorTowardPoint() {
var xdiff = (swordPoint._x - cursor._x);
var ydiff = (swordPoint._y - cursor._y);
if (_root.diagonal(xdiff, ydiff) > (MOVE_SPEED * 1.5)) {
cursor._x = cursor._x + _root.scaledDistanceX(xdiff, ydiff, MOVE_SPEED);
cursor._y = cursor._y + _root.scaledDistanceY(xdiff, ydiff, MOVE_SPEED);
} else {
moveFinished = true;
}
}
function moveCursorTowardMouse() {
var xdiff = ((_root._xmouse - _x) - cursor._x);
var ydiff = ((_root._ymouse - _y) - cursor._y);
if (_root.diagonal(xdiff, ydiff) > (MOVE_SPEED * 1.5)) {
cursor._x = cursor._x + _root.scaledDistanceX(xdiff, ydiff, MOVE_SPEED);
cursor._y = cursor._y + _root.scaledDistanceY(xdiff, ydiff, MOVE_SPEED);
} else {
prepareCombat();
gotoAndStop (1);
}
}
function prepareCombat() {
with (_root) {
releaseHandle();
initCombat();
combatCursor._visible = true;
combatCursor.px = _xmouse;
combatCursor.py = _ymouse;
combatCursor.startDrag(true);
}
stop();
}
function sheath() {
if (_root.smokeScreen) {
_root.worldSmokeScreen.play();
}
with (_root) {
takeHandle();
combatCursor.cancelAllSpells();
combatCursor.stopDrag();
combatCursor._visible = false;
combatCursor._x = -150;
}
_root.worldTutorial.newMessage("Remember, the icon change back only when the last hostile obstacle is taken out.", 20);
gotoAndPlay (41);
}
function restoreToNormal() {
with (_root) {
inCombat = false;
releaseHandle();
cursor._visible = true;
cursor.startDrag(true);
if (autoMap && (!worldAutoMap.isOpen)) {
worldAutoMap.play();
}
updatePlayerGrid(PG_CLEAR_DANGER);
continueTutorial(CONTINUE_EXIT_COMBAT);
}
}
MOVE_SPEED = 70;
stop();
Symbol 604 MovieClip Frame 12
_root.lockKeys = false;
Symbol 604 MovieClip Frame 21
if (musicLoop != "none") {
_root.sndMusicLoops.changeLoopTo(musicLoop);
}
Symbol 604 MovieClip Frame 32
moveCursorTowardMouse();
Symbol 604 MovieClip Frame 33
prevFrame();
play();
Symbol 604 MovieClip Frame 41
moveFinished = false;
Instance of Symbol 603 MovieClip "cursor" in Symbol 604 MovieClip Frame 41
onClipEvent (load) {
o = new Object();
o.x = _root._xmouse;
o.y = _root._ymouse;
globalToLocal(o);
_x = o.x;
_y = o.y;
}
Symbol 604 MovieClip Frame 42
moveCursorTowardPoint();
Symbol 604 MovieClip Frame 43
if (!moveFinished) {
prevFrame();
play();
}
Symbol 604 MovieClip Frame 60
_root.sndMusicLoops.changeLoopTo("explore");
Symbol 604 MovieClip Frame 72
restoreToNormal();
stop();
Symbol 607 MovieClip Frame 1
function pointToLocation(x, y) {
_x = x;
_y = y;
_visible = true;
gotoAndPlay (2);
}
function pointToObject(objName) {
_x = eval ("_root." + objName)._x;
_y = eval ("_root." + objName)._y;
_visible = true;
gotoAndPlay (2);
}
function pointToNothing() {
_visible = false;
stop();
}
stop();
Symbol 607 MovieClip Frame 20
gotoAndPlay (2);
Symbol 610 MovieClip Frame 1
function newMessage(msg, priority) {
if (!IN_GAME_TUTORIAL) {
return(undefined);
}
if ((!hasMessage) || (priority >= currentPriority)) {
messageDelay = (90 * msg.length) + 2000;
tutorialTimer.resetTimer();
hasMessage = true;
_visible = true;
_root.worldRei.switchTo("talk");
messageText = msg;
currentPriority = priority;
}
}
function noPriorityMessage(msg) {
messageDelay = (90 * msg.length) + 2000;
tutorialTimer.resetTimer();
hasMessage = true;
_visible = true;
messageText = msg;
}
tutorialTimer = new _root.Timer();
hasMessage = true;
currentPriority = 0;
Symbol 610 MovieClip Frame 3
if (hasMessage && (tutorialTimer.timeOver(messageDelay))) {
hasMessage = false;
if (!_root.TUTORIAL) {
messageText = "";
_visible = false;
}
if (_root.IN_GAME_TUTORIAL) {
_root.worldRei.switchTo("stand");
}
if (_root.TUTORIAL) {
_root.continueTutorial(_root.CONTINUE_MESSAGE_END);
}
}
prevFrame();
play();
Symbol 613 MovieClip Frame 1
stop();
Symbol 613 MovieClip Frame 2
stop();
Symbol 615 MovieClip Frame 1
stop();
Symbol 615 MovieClip Frame 2
stop();
Symbol 619 MovieClip Frame 1
stop();
Symbol 620 MovieClip Frame 1
function generateMapDisplay(w, h) {
WIDTH = w;
HEIGHT = h;
var i;
var j;
c = 1;
i = 0;
while (i < w) {
j = 0;
while (j < h) {
c++;
duplicateMovieClip ("oMapIndicator", (("Grid" + i) + "-") + j, c);
eval ((("Grid" + i) + "-") + j)._x = (FULL_MAP_OFFSET * i) + DISPLAY_OFFSET_X;
eval ((("Grid" + i) + "-") + j)._y = (FULL_MAP_OFFSET * j) + DISPLAY_OFFSET_Y;
j++;
}
i++;
}
}
function setPlayerIcon(x, y) {
if ((((x < 0) || (x >= WIDTH)) || (y < 0)) || (y >= HEIGHT)) {
playerIcon._visible = false;
} else {
playerIcon._visible = true;
}
playerIcon._x = DISPLAY_OFFSET_X + (FULL_MAP_OFFSET * x);
playerIcon._y = DISPLAY_OFFSET_Y + (FULL_MAP_OFFSET * y);
}
function updateInterface() {
var i;
i = 0;
while (i < 5) {
eval ("scroll" + i)._visible = false;
i++;
}
i = 0;
while (i < _root.SCROLLS_HIDDEN) {
eval ("scroll" + i)._visible = true;
eval ("scroll" + i).gotoAndStop(1);
i++;
}
i = 0;
while (i < _root.scrollsFound) {
eval ("scroll" + i).gotoAndStop(2);
i++;
}
i = 0;
while (i < 3) {
eval ("head" + i)._visible = false;
i++;
}
i = 0;
while (i < _root.BOSSES_HIDDEN) {
eval ("head" + i)._visible = true;
eval ("head" + i).gotoAndStop(1);
i++;
}
i = 0;
while (i < _root.headsFound) {
eval ("head" + i).gotoAndStop(2);
i++;
}
_root.worldTutorial.newMessage("Unexplored passages are shown as short lines connected one way.", 30);
}
DISPLAY_OFFSET_X = 35;
DISPLAY_OFFSET_Y = 15;
FULL_MAP_OFFSET = 20;
Instance of Symbol 619 MovieClip "oMapIndicator" in Symbol 620 MovieClip Frame 1
onClipEvent (load) {
if (_name == "oMapIndicator") {
_visible = false;
}
}
Symbol 620 MovieClip Frame 2
duplicateMovieClip ("oPlayerIcon", "playerIcon", 10000);
oPlayerIcon._visible = false;
stop();
Symbol 621 Button
on (press) {
_parent.startSwing();
}
on (release, releaseOutside) {
_parent.startRelease();
}
on (keyPress "c") {
_parent.startSpell();
}
on (keyPress "C") {
_parent.startSpell();
}
Symbol 632 MovieClip Frame 30
gotoAndPlay (1);
Symbol 632 MovieClip Frame 40
stop();
_parent.startBlock();
Symbol 632 MovieClip Frame 42
with (_parent) {
attackState = ST_GUARD;
}
Symbol 632 MovieClip Frame 44
_parent.stopAttack();
Symbol 632 MovieClip Frame 55
gotoAndPlay (1);
Symbol 632 MovieClip Frame 75
_parent.startHold();
stop();
Symbol 632 MovieClip Frame 79
stop();
Symbol 632 MovieClip Frame 92
if (_parent.mousePressed) {
prevFrame();
play();
}
Symbol 632 MovieClip Frame 94
_parent.endStab();
Symbol 632 MovieClip Frame 102
_parent.stopAttack();
Symbol 632 MovieClip Frame 117
_parent.stopAttack();
Symbol 632 MovieClip Frame 127
_parent.stopAttack();
Symbol 632 MovieClip Frame 136
stop();
Symbol 632 MovieClip Frame 146
stop();
Symbol 632 MovieClip Frame 157
stop();
Symbol 633 MovieClip Frame 1
function showHand() {
if (attackState == ST_GUARD) {
animation.gotoAndStop("normal");
showingHand = true;
}
}
function hideHand() {
if (showingHand) {
showingHand = false;
stopAttack();
}
}
function getStatus() {
return(attackState);
}
function isBlocking() {
return(attackState == ST_BLOCK);
}
function isAttackPulsing() {
return(((attackState == ST_ATTACK) || (attackState == ST_ATTACKPAUSE)) || (attackState == ST_STABBING));
}
function canAttack() {
return(_root.playerCurStats[0] > Math.ceil(_root.playerMaxStats[0] / 5));
}
function isAttacking() {
return(((((attackState == ST_RAISEARM) || (attackState == ST_ATTACK)) || (attackState == ST_ATTACKPAUSE)) || (attackState == ST_STABBING)) || (attackState == ST_PRESTAB));
}
function resolveBlock(x, y, r) {
if (_root.circleIntersectBox(x, y, r, (_x - 60) + animation._x, (_y - 15) + animation._y, 140, 30)) {
return(true);
}
_root.worldTutorial.newMessage("You just missed a block. You must move the cursor directly over a strike point to block an attack.", 30);
return(false);
}
function startSwing() {
if (_root.combatActionLock) {
return(undefined);
}
if (attackState == ST_RAISINGARM) {
startStab();
} else if (attackState == ST_GUARD) {
if (_root.playerCurStats[0] < Math.ceil(_root.playerMaxStats[0] / 5)) {
_root.worldTutorial.newMessage("You don't have enough attack power to start an attack.", 30);
var i = 0;
while (i < 5) {
if (_root.playerInventory[i] == 5) {
_root.worldTutorial.newMessage("Now is a good time to use your bomb. Double click it in the inventory.", 30);
}
if (_root.playerInventory[i] == 6) {
_root.worldTutorial.newMessage("Now is a good time to use your shurikens. Double click it in the inventory.", 30);
}
i++;
}
animation.gotoAndPlay("outOfEnergy");
} else {
ax = null;
attackState = ST_RAISINGARM;
attackStrength = Math.ceil(_root.playerMaxStats[0] / 5);
_root.playerCurStats[0] = _root.playerCurStats[0] - attackStrength;
animation.gotoAndPlay("swing");
}
}
mousePressed = true;
}
function startHold() {
if (!mousePressed) {
stopAttack();
} else {
_root.continueTutorial(_root.CONTINUE_START_SLASH);
attackState = ST_RAISEARM;
flameTimer = new _root.Timer();
}
}
function startRelease() {
if (attackState == ST_RAISEARM) {
attackState = ST_GUARD;
animation.gotoAndPlay("swingCancel");
_root.playerCurStats[0] = _root.playerCurStats[0] + Math.ceil(_root.playerMaxStats[0] / 5);
} else if ((attackState == ST_ATTACK) || (attackState == ST_ATTACKPAUSE)) {
startPause();
}
mousePressed = false;
}
function startAttack() {
if (attackState == ST_ATTACK) {
return(undefined);
}
if (attackState == ST_RAISINGARM) {
minorAttack = true;
} else {
minorAttack = false;
}
attackTimer.resetTimer();
attackState = ST_ATTACK;
tx = _x;
ty = _y;
_root.createSlashShadow();
animation.gotoAndPlay("swingDown");
}
function startBlock() {
attackState = ST_BLOCK;
with (_root) {
continueTutorial(CONTINUE_PLAYER_BLOCKING);
}
}
function startPause() {
if (attackState == ST_ATTACKPAUSE) {
return(undefined);
}
var dispx = (px - _x);
var dispy = (-Math.abs(py - _y));
var slashDist = _root.diagonal(dispx, dispy);
attackTimer.resetTimer();
attackState = ST_ATTACKPAUSE;
if (eval (_root.slashName)._visible) {
attackStrength = Math.floor(attackStrength * (1 + (_root.diagonal(_x - px, _y - py) / _root.diagonal(_root.SCREEN_WIDTH, _root.SCREEN_HEIGHT))));
if (minorAttack) {
_root.makeSmallSlashAttack((_x + px) / 2, (_y + py) / 2, attackStrength, false, _rotation);
} else {
_root.makeSlashAttack((_x + px) / 2, (_y + py) / 2, attackStrength, true, _rotation);
}
_root.continueTutorial(_root.CONTINUE_END_SLASH);
} else {
_root.worldTutorial.newMessage("You need to move your mouse farther when you try to complete an attack.", 30);
startRecover();
}
}
function startStab() {
_rotation = 0;
attackState = ST_PRESTAB;
_root.continueTutorial(_root.CONTINUE_START_STAB);
animation.gotoAndPlay("stab");
}
function endStab() {
attackState = ST_STABBING;
_root.createStabShadow();
eval (_root.slashName)._x = _x;
eval (_root.slashName)._y = _y;
_root.continueTutorial(_root.CONTINUE_END_STAB);
_root.makeStabAttack(_x, _y, attackStrength, false, _rotation);
}
function startRecover() {
if ((attackState == ST_ATTACK) || (attackState == ST_ATTACKPAUSE)) {
animation.gotoAndPlay("recover");
attackState = ST_RECOVER;
eval (_root.slashName).play();
}
px = _x;
py = _y;
}
function stopAttack() {
attackState = ST_GUARD;
animation.gotoAndPlay("guard");
}
function startSpell() {
if (attackState == ST_GUARD) {
if (_root.worldSpellSpace.initSpell()) {
animation.gotoAndStop("spirit");
attackState = ST_PREPARE_SPELL;
}
}
}
function stopSpell() {
if (attackState == ST_WRAITHBEAM) {
_root.combatCursor.startDrag(true);
_root.worldSpellSpace.beamSpell.stopAttack();
}
stopAttack();
}
function castSpell(s) {
spellTimer.resetTimer();
animation.gotoAndStop("spell");
attackState = ST_PREPARE_SPELL + s;
attackCount = 0;
if (attackState == ST_WRAITHBEAM) {
moveCount = 0;
px = (_x + ((Math.random() * BEAM_REPELL) * 2)) - BEAM_REPELL;
py = (_y + ((Math.random() * BEAM_REPELL) * 2)) - BEAM_REPELL;
_root.combatCursor.stopDrag();
_root.worldSpellSpace.beamSpell.startAttack();
}
}
function cancelAllSpells() {
if (attackState >= ST_PREPARE_SPELLS) {
stopSpell();
}
}
px = null;
py = null;
ST_GUARD = 0;
ST_RAISEARM = 1;
ST_ATTACK = 2;
ST_ATTACKPAUSE = 3;
ST_RECOVER = 4;
ST_STARTBLOCK = 5;
ST_BLOCK = 6;
ST_RAISINGARM = 7;
ST_PRESTAB = 8;
ST_STABBING = 9;
ST_PREPARE_SPELL = 10;
ST_GHOSTFLAME = 13;
ST_WINDBLADE = 12;
ST_SOULRAIN = 11;
ST_WRAITHBEAM = 14;
ATTACK_TIME = 600;
ATTACK_PAUSE = 50;
ATTACK_MIN_DISTANCE = 5;
ATTACK_MIN_SLASH_DISTANCE = 10;
GHOST_COUNT = 20;
GHOST_DAMAGE = 15;
GHOST_DELAY = 200;
GHOST_DURATION = 6000;
BLADE_COUNT = 15;
BLADE_DAMAGE = 25;
BLADE_DELAY = 200;
SOUL_COUNT = 12;
SOUL_HEAL = 4;
SOUL_DELAY = 60;
SOUL_DURATION = 4000;
BEAM_DURATION = 8000;
BEAM_DAMAGE = 600;
BEAM_REPELL = 4;
spellTimer = new _root.Timer();
attackTimer = new _root.Timer();
attackState = 0;
showingHand = false;
mousePressed = false;
o = new Object();
Symbol 633 MovieClip Frame 3
if ((((attackState == ST_GUARD) || (attackState == ST_RECOVER)) && (Key.isDown(32))) && (!_root.combatActionLock)) {
_rotation = 0;
attackState = ST_STARTBLOCK;
animation.gotoAndPlay("block");
}
switch (attackState) {
case ST_RAISINGARM :
case ST_RAISEARM :
var dispx = (_x - px);
var dispy = (_y - py);
var diag = _root.diagonal(dispx, dispy);
var ang = _root.displacementAngle(dispx, dispy);
if (flameTimer.timeOver(800 / Math.ceil(_root.playerMaxStats[0] / 20))) {
_root.worldTutorial.newMessage("Remember, charge attacks are more powerful, but it drains your attack power!", 20);
var n = 0;
while (n < 2) {
if (_root.playerCurStats[0] > 0) {
_root.playerCurStats[0]--;
attackStrength++;
}
n++;
}
flameTimer.resetTimer();
}
ax = _x;
ay = _y;
if (((diag > ATTACK_MIN_DISTANCE) && (ang > 120)) && (ang < 240)) {
startAttack();
}
case ST_GUARD :
if ((px != null) && (!showingHand)) {
_rotation = (((_x - px) / _root.SCREEN_WIDTH) * (-90));
}
px = _x;
py = _y;
break;
case ST_ATTACK :
var dispx;
var dispy;
var slashDistance;
var moveDistance;
px = ax;
py = ay;
dispx = px - _x;
dispy = py - _y;
slashDistance = _root.diagonal(dispx, dispy);
dispx = tx - _x;
dispy = ty - _y;
moveDistance = _root.diagonal(dispx, dispy);
tx = _x;
ty = _y;
dispx = px - _x;
dispy = -Math.abs(py - _y);
if (((_y - py) >= 0) && (slashDistance > ATTACK_MIN_SLASH_DISTANCE)) {
_rotation = _root.displacementAngle(dispx, dispy);
if (py > _y) {
_rotation = (-_rotation);
}
eval (_root.slashName)._visible = true;
eval (_root.slashName)._x = _x;
eval (_root.slashName)._y = _y;
eval (_root.slashName)._yscale = slashDistance;
eval (_root.slashName)._rotation = _rotation;
} else {
eval (_root.slashName)._visible = false;
}
if ((moveDistance < ATTACK_MIN_DISTANCE) || (attackTimer.timeOver(ATTACK_TIME))) {
startPause();
}
break;
case ST_ATTACKPAUSE :
if (attackTimer.timeOver(_root.ATTACK_PAUSE)) {
startRecover();
}
break;
case ST_PRESTAB :
case ST_STABBING :
break;
case ST_RECOVER :
_rotation = (_rotation / 2);
break;
case ST_STARTBLOCK :
case ST_BLOCK :
_root.worldTutorial.newMessage("Remember that your Chi doesn't recover while you are blocking.");
if (!Key.isDown(32)) {
animation.play();
}
px = _x;
py = _y;
break;
case ST_PREPARE_SPELL :
_rotation = 0;
break;
case ST_GHOSTFLAME :
if (attackTimer.timeOver(GHOST_DELAY) && (mousePressed)) {
attackTimer.resetTimer();
_root.worldSpellSpace.create("oGhostFlame", (_x - 60) + Math.floor(Math.random() * 10), (_y - 50) + Math.floor(Math.random() * 10));
attackCount++;
if (attackCount > GHOST_COUNT) {
stopSpell();
}
}
animation.spellFlame._alpha = Math.min(100, (1.2 - (spellTimer.getTimeDifference() / GHOST_DURATION)) * 100);
if (spellTimer.timeOver(GHOST_DURATION)) {
stopSpell();
}
break;
case ST_SOULRAIN :
if (attackTimer.timeOver(SOUL_DELAY) && (attackCount < SOUL_COUNT)) {
attackTimer.resetTimer();
_root.worldSpellSpace.create("oHealingSoul", _root.worldCombatSpace.getAttackX(), _root.worldCombatSpace.getAttackY());
attackCount++;
}
animation.spellFlame._alpha = Math.min(100, (1.2 - (spellTimer.getTimeDifference() / GHOST_DURATION)) * 100);
if (spellTimer.timeOver(SOUL_DURATION)) {
stopSpell();
}
break;
case ST_WINDBLADE :
if (attackTimer.timeOver(BLADE_DELAY)) {
attackTimer.resetTimer();
_root.worldSpellSpace.create("oWindBlade", _root.worldCombatSpace.getFloorSpawnX(), _root.worldCombatSpace.getFloorSpawnY());
attackCount++;
if (attackCount > BLADE_COUNT) {
stopSpell();
}
}
break;
case ST_WRAITHBEAM :
if ((attackCount == 0) || (attackCount == 2)) {
_x = ((_x + px) / 2);
_y = ((_y + py) / 2);
moveCount++;
if (moveCount >= 4) {
attackCount++;
}
if (attackCount == 3) {
stopSpell();
} else if (attackCount == 1) {
spellTimer.resetTimer();
px = _root._xmouse;
py = _root._ymouse;
mx = 0;
my = 0;
}
} else {
if (spellTimer.timeOver(BEAM_DURATION)) {
moveCount = 0;
attackCount++;
}
mx = (((_x - 275) / 275) * (-1)) * BEAM_REPELL;
my = (((_y - 200) / 200) * (-1)) * BEAM_REPELL;
var r = ((_root._xmouse - px) + mx);
_x = (_x + r);
var r = ((_root._ymouse - py) + my);
_y = (_y + r);
px = _root._xmouse;
py = _root._ymouse;
animation.spellFlame._alpha = Math.min(100, (1.2 - (spellTimer.getTimeDifference() / BEAM_DURATION)) * 100);
_root.worldSpellSpace.beamSpell.adjust(mx * 10, my * 10, Math.min(100, (1 - (spellTimer.getTimeDifference() / BEAM_DURATION)) * 100));
}
}
prevFrame();
play();
Symbol 634 Button
on (keyPress "<Left>") {
with (_root) {
setCursorCommand(CA_TURNLEFT);
cursorClick();
}
}
on (keyPress "<Right>") {
with (_root) {
setCursorCommand(CA_TURNRIGHT);
cursorClick();
}
}
on (keyPress "<Up>") {
with (_root) {
setCursorCommand(CA_FORWARD);
cursorClick();
}
}
on (keyPress "<Down>") {
with (_root) {
setCursorCommand(CA_REVERSE);
cursorClick();
}
}
on (keyPress "a") {
with (_root) {
setCursorCommand(CA_TURNLEFT);
cursorClick();
}
}
on (keyPress "d") {
with (_root) {
setCursorCommand(CA_TURNRIGHT);
cursorClick();
}
}
on (keyPress "w") {
with (_root) {
setCursorCommand(CA_FORWARD);
cursorClick();
}
}
on (keyPress "s") {
with (_root) {
setCursorCommand(CA_REVERSE);
cursorClick();
}
}
on (keyPress "A") {
with (_root) {
setCursorCommand(CA_TURNLEFT);
cursorClick();
}
}
on (keyPress "D") {
with (_root) {
setCursorCommand(CA_TURNRIGHT);
cursorClick();
}
}
on (keyPress "W") {
with (_root) {
setCursorCommand(CA_FORWARD);
cursorClick();
}
}
on (keyPress "S") {
with (_root) {
setCursorCommand(CA_REVERSE);
cursorClick();
}
}
on (keyPress "<Space>") {
with (_root) {
setCursorCommand(CA_SEARCH);
cursorClick();
}
}
on (keyPress "f") {
with (_root) {
setCursorCommand(CA_FULLMAP);
cursorClick();
}
}
on (keyPress "F") {
with (_root) {
setCursorCommand(CA_FULLMAP);
cursorClick();
}
}
Symbol 635 Button
on (press) {
_root.cursorClick();
}
Symbol 640 MovieClip Frame 1
stop();
Symbol 645 MovieClip Frame 1
function startPain() {
_root.worldPortrait._visible = false;
animation = false;
gotoAndPlay (2);
}
stop();
Symbol 645 MovieClip Frame 2
animation = true;
Symbol 645 MovieClip Frame 11
if (animation) {
_root.worldPortrait._visible = true;
}
Symbol 665 MovieClip Frame 1
stop();
Symbol 670 Button
on (release, keyPress "<Enter>") {
if (!incStats) {
takeItem();
}
}
Symbol 671 Button
on (release, keyPress "<Space>") {
message = messageText[treasureType];
}
Symbol 672 MovieClip Frame 1
function takeItem() {
incStats = true;
if (treasureType == -1) {
play();
return(undefined);
}
switch (treasureType) {
case 4 :
_root.playerMaxStats[2] = _root.playerMaxStats[2] + 2;
break;
case 7 :
_root.playerMaxStats[0] = _root.playerMaxStats[0] + 2;
break;
case 8 :
var p = (_root.playerCurStats[1] / _root.playerMaxStats[1]);
_root.playerMaxStats[1] = _root.playerMaxStats[1] + 2;
_root.playerCurStats[1] = Math.ceil(_root.playerMaxStats[1] * p);
treasureType = -1;
break;
case 9 :
_root.scrollsFound++;
break;
default :
var i = 0;
for(;;){
if (i >= 5) {
break;
}
if ((_root.playerInventory[i] == 0) && (treasureType > 0)) {
_root.playerInventory[i] = treasureType;
treasureType = -1;
}
i++;
};
}
_root.confirmSearch();
_root.updateInterface();
play();
}
function setupTreasure() {
treasureType = -1;
var i = 0;
while (i < 5) {
if (_root.playerInventory[i] == 0) {
treasureType = 0;
}
i++;
}
if ((treasureType == -1) && (((_root.treasureType > 4) && (_root.treasureType != 11)) || (_root.treasureType == 3))) {
_root.worldTutorial.newMessage("Use or discard items in your inventory by double clicking it.", 30);
message = "Inventory full. Cannot accept item.";
icon.adjustIcon(0);
} else {
if (_root.TreasureType == 11) {
treasureType = 9;
} else if (_root.treasureType == 1) {
treasureType = 8;
} else if (_root.treasureType == 2) {
treasureType = 7;
} else if (_root.treasureType == 3) {
treasureType = 1 + random(8);
} else if (_root.treasureType == 4) {
treasureType = 4;
} else {
treasureType = 1 + random(3);
}
if ((treasureType < 7) && (treasureType != 4)) {
_root.worldTutorial.newMessage("To use this item, double click it when it appears in your inventory.", 30);
}
message = "You have found:\n" + description[treasureType];
icon.adjustIcon(treasureType);
}
}
messageText = new Array(9);
messageText[1] = "Riceball\nRestores 25 health points";
messageText[2] = "Sushi\nRestores 50 health points";
messageText[3] = "Sake\nRestores all Chi and power points";
messageText[4] = "Wineskin\nIncreases maximum Chi by 2";
messageText[5] = "Bomb\nCauses 60 points of damage";
messageText[6] = "Shurikens\nSet of 10, 20 points damage each";
messageText[7] = "Katana\nIncreases maximum power by 2";
messageText[8] = "Armor\nIncreases maximum health by 2";
messageText[9] = "Scroll\nContains secrets of a powerful sword technique";
description = new Array(9);
description[1] = "riceball";
description[2] = "sushi";
description[3] = "sake";
description[4] = "wineskin";
description[5] = "bomb";
description[6] = "shurikens";
description[7] = "katana";
description[8] = "armor";
description[9] = "scroll";
Symbol 672 MovieClip Frame 2
stop();
incStats = false;
Symbol 672 MovieClip Frame 3
_root.takeHandle();
Symbol 672 MovieClip Frame 7
setupTreasure();
Symbol 672 MovieClip Frame 9
stop();
Symbol 672 MovieClip Frame 14
_root.releaseHandle();
gotoAndStop (2);
Symbol 674 MovieClip Frame 1
function updateLocation() {
convert = new object();
convert.x = _root._xmouse;
convert.y = _root._ymouse;
_parent.globalToLocal(convert);
_x = convert.x;
_y = convert.y;
}
function startCustomDrag() {
drag = true;
updateLocation();
_visible = true;
}
function stopCustomDrag() {
drag = false;
_visible = false;
}
drag = false;
Symbol 674 MovieClip Frame 3
if (drag) {
updateLocation();
}
prevFrame();
play();
Symbol 675 Button
on (rollOver) {
traceMouseMsg("SPIRIT");
_root.worldTutorial.newMessage("Kill enemies to charge bar, use to release powerful attacks.", 10);
}
on (rollOut, dragOut) {
untraceMouse();
}
Symbol 676 Button
on (rollOver) {
traceMouseMsg("CHI");
_root.worldTutorial.newMessage("Chi points determines the amount of damages you can block.", 10);
}
on (rollOut, dragOut) {
untraceMouse();
}
Symbol 677 Button
on (rollOver) {
traceMouseMsg("HP");
_root.worldTutorial.newMessage("Needless to say, when your health goes below zero, you'd die.", 10);
}
on (rollOut, dragOut) {
untraceMouse();
}
Symbol 678 Button
on (rollOver) {
traceMouseMsg("ATTACK");
_root.worldTutorial.newMessage("Your attack power charge time and damage of your attacks.", 10);
}
on (rollOut, dragOut) {
untraceMouse();
}
Symbol 679 Button
on (rollOver) {
_root.worldTutorial.newMessage("Click here or press Tab to switch between number and bar style stats display.", 10);
}
on (press, keyPress "<Tab>") {
if (_root.showNumbers) {
_root.showNumbers = false;
} else {
_root.showNumbers = true;
}
_root.updateInterface();
}
Symbol 680 Button
on (rollOver) {
_root.worldTutorial.newMessage("Click here or press 'I' to show this interface.", 25);
}
on (press, keyPress "i") {
play();
}
on (keyPress "I") {
play();
}
Symbol 685 MovieClip Frame 1
function adjustDisplayMode(m) {
displayMode = m;
if (displayMode == 0) {
gotoAndStop (2);
adjustMaximum(barMaximum);
adjustCurrent(barCurrent);
} else {
gotoAndStop (3);
_xscale = 100;
}
}
function adjustCurrent(p) {
barCurrent = p;
if (displayMode == 0) {
var i = 1;
while (i <= 4) {
if (_root.worldSpellSpace.spellCost[i] <= p) {
eval ("cast" + i)._visible = true;
} else {
eval ("cast" + i)._visible = false;
}
eval ("canCast" + i)._visible = false;
i++;
}
var i = 1;
while (i <= _root.playerLevel) {
eval ("canCast" + i)._visible = true;
i++;
}
}
}
function adjustMaximum(p) {
barMaximum = p;
}
barMaximum = 100;
displayMode = 0;
Symbol 685 MovieClip Frame 2
stop();
Symbol 690 MovieClip Frame 1
function adjustDisplayMode(m) {
displayMode = m;
if (displayMode == 0) {
gotoAndStop (2);
adjustMaximum(barMaximum);
adjustCurrent(barCurrent);
} else {
gotoAndStop (3);
_xscale = 100;
}
}
function adjustCurrent(p) {
barCurrent = p;
if (displayMode == 0) {
current._xscale = (int(barCurrent) / int(barMaximum)) * 100;
}
}
function adjustMaximum(p) {
barMaximum = p;
if (displayMode == 0) {
if (p > 100) {
_xscale = 100;
} else {
_xscale = p;
}
}
}
barMaximum = 100;
displayMode = 0;
Symbol 690 MovieClip Frame 2
stop();
Symbol 699 Button
on (rollOver) {
_root.worldTutorial.newMessage("Click here or press 'I' to hide this interface.", 25);
}
on (press, keyPress "i") {
play();
}
on (keyPress "I") {
play();
}
Symbol 700 Button
on (rollOver) {
traceMouseMsg("INVENTORY");
_root.worldTutorial.newMessage("To check the scrolls that you collected, check the full map by pressing 'F'.", 10);
}
on (rollOut, dragOut) {
untraceMouse();
}
Symbol 701 Button
on (rollOver) {
traceMouse(4);
_root.worldTutorial.newMessage("Double-click on an item to use it. Alternately, press the number of the item twice.", 10);
}
on (rollOut, dragOut) {
untraceMouse();
}
on (release) {
clickItem(4);
}
on (keyPress "5") {
useItem(4);
}
Symbol 702 Button
on (rollOver) {
traceMouse(3);
_root.worldTutorial.newMessage("Double-click on an item to use it. Alternately, press the number of the item twice.", 10);
}
on (rollOut, dragOut) {
untraceMouse();
}
on (release) {
clickItem(3);
}
on (keyPress "4") {
useItem(3);
}
Symbol 703 Button
on (rollOver) {
traceMouse(2);
_root.worldTutorial.newMessage("Double-click on an item to use it. Alternately, press the number of the item twice.", 10);
}
on (rollOut, dragOut) {
untraceMouse();
}
on (release) {
clickItem(2);
}
on (keyPress "3") {
useItem(2);
}
Symbol 704 Button
on (rollOver) {
traceMouse(1);
_root.worldTutorial.newMessage("Double-click on an item to use it. Alternately, press the number of the item twice.", 10);
}
on (rollOut, dragOut) {
untraceMouse();
}
on (release) {
clickItem(1);
}
on (keyPress "2") {
useItem(1);
}
Symbol 705 Button
on (rollOver) {
traceMouse(0);
_root.worldTutorial.newMessage("Double-click on an item to use it. Alternately, press the number of the item twice.", 10);
}
on (rollOut, dragOut) {
untraceMouse();
}
on (release) {
clickItem(0);
}
on (keyPress "1") {
useItem(0);
}
Symbol 706 MovieClip Frame 1
function traceMouseMsg(m) {
if (_root.inCombat) {
return(undefined);
}
tooltips.tooltips = m;
tooltips.startCustomDrag(true);
}
function traceMouse(i) {
if (_root.playerInventory[i] != 0) {
tooltips.tooltips = itemTips[_root.playerInventory[i]];
tooltips.startCustomDrag(true);
}
}
function untraceMouse() {
tooltips.stopCustomDrag();
}
function clickItem(i) {
untraceMouse();
if ((getTimer() - lastClickTime) > DBL_CLICK_TOLERANCE) {
lastClickTime = getTimer();
} else {
_root.useItem(i);
}
}
function useItem(i) {
_root.useItem(i);
}
DBL_CLICK_TOLERANCE = 325;
lastClickTime = 0;
itemTips = new Array(6);
itemTips[1] = "HP+25";
itemTips[2] = "HP+50";
itemTips[3] = "+CHI/ATK";
itemTips[5] = "DMG 60";
itemTips[6] = "DMG 10x20";
Instance of Symbol 674 MovieClip "tooltips" in Symbol 706 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 706 MovieClip Frame 16
_root.updateInterface();
Symbol 706 MovieClip Frame 18
stop();
Symbol 706 MovieClip Frame 35
gotoAndStop (2);
Symbol 722 MovieClip Frame 1
function switchTo(newSt) {
if (st != newSt) {
st = newSt;
gotoAndPlay(newSt);
}
}
Symbol 722 MovieClip Frame 5
st = "stand";
Symbol 722 MovieClip Frame 20
gotoAndPlay(st);
Symbol 722 MovieClip Frame 41
stop();
Symbol 722 MovieClip Frame 45
_root.tutorialReiAttacks();
Symbol 722 MovieClip Frame 60
gotoAndPlay (5);
Symbol 722 MovieClip Frame 80
stop();
Symbol 722 MovieClip Frame 90
gotoAndPlay (5);
Symbol 722 MovieClip Frame 115
gotoAndPlay(st);
Symbol 722 MovieClip Frame 166
_root.tutorialReiDeparts();
stop();
Symbol 723 MovieClip Frame 40
gotoAndPlay (10);
Symbol 729 MovieClip Frame 1
function startAttack() {
alive = true;
Mouse.addListener(someListener);
resetAttack();
}
function resetAttack() {
if (alive) {
_x = _root.combatCursor._x;
_y = _root.combatCursor._y;
attacking = false;
_rotation = 0;
gotoAndPlay (3);
} else {
gotoAndStop (2);
}
}
function stopAttack() {
alive = false;
Mouse.removeListener(someListener);
if (!attacking) {
gotoAndStop (2);
}
}
function adjust(x, y, a) {
if (!attacking) {
_x = (_root.combatCursor._x + x);
_y = (_root.combatCursor._y + y);
_alpha = a;
}
}
someListener = new Object();
someListener.onMouseDown = function () {
if (attacking) {
return(undefined);
}
attacking = true;
_rotation = ((Math.random() * 100) - 50);
_alpha = 100;
_root.makeStabAttack(_x, _y, _root.combatCursor.BEAM_DAMAGE, true, _rotation);
_root.combatCursor.attackCount = 2;
};
alive = false;
Symbol 729 MovieClip Frame 2
attacking = false;
stop();
Symbol 729 MovieClip Frame 5
if (!attacking) {
prevFrame();
play();
}
Symbol 729 MovieClip Frame 16
resetAttack();
Symbol 731 MovieClip Frame 40
_parent.destroy();
Symbol 732 MovieClip Frame 1
function destroy() {
removeMovieClip("");
}
Instance of Symbol 731 MovieClip "soul" in Symbol 732 MovieClip Frame 1
onClipEvent (load) {
s = Math.floor(Math.random() * 30) + 80;
_xscale = s;
_yscale = s;
}
Symbol 732 MovieClip Frame 3
if (hitTest(_root.combatCursor._x, _root.combatCursor._y, false)) {
_root.worldCombatSpace.createThing(_root.combatCursor._x, _root.combatCursor._y, "ghostSplatOriginal");
_root.playerCurStats[1] = Math.min(_root.playerCurStats[1] + _root.combatCursor.SOUL_HEAL, _root.playerMaxStats[1]);
destroy();
}
prevFrame();
play();
Symbol 736 MovieClip Frame 7
x = _x;
y = (_y - 80) - Math.floor(Math.random() * 120);
_root.worldCombatSpace.hitObjectSpecial(x, Math.floor(_root.combatCursor.BLADE_DAMAGE), "ghostSplatOriginal");
Symbol 736 MovieClip Frame 14
removeMovieClip("");
Symbol 738 MovieClip Frame 5
_root.makeSpellAttack(_x, _y, _root.combatCursor.GHOST_DAMAGE, "ghostSplatOriginal");
Symbol 738 MovieClip Frame 12
removeMovieClip("");
Symbol 739 Button
on (press) {
_parent.play();
gotoAndPlay (1);
}
on (keyPress "c") {
_parent.destroy();
}
on (keyPress "C") {
_parent.destroy();
}
Symbol 740 MovieClip Frame 20
_parent.destroy();
Symbol 750 MovieClip Frame 1
function reset() {
gotoAndStop (1);
}
function destroy() {
_parent.spellFailure(3);
reset();
}
stop();
Symbol 750 MovieClip Frame 2
stop();
Symbol 750 MovieClip Frame 3
_parent.clearSpellsBut(3);
Symbol 750 MovieClip Frame 6
stop();
Symbol 750 MovieClip Frame 10
stop();
Symbol 750 MovieClip Frame 14
stop();
Symbol 750 MovieClip Frame 23
_parent.launchAttack(3);
Symbol 751 Button
on (press) {
_parent.play();
gotoAndPlay (1);
}
on (keyPress "c") {
_parent.destroy();
}
on (keyPress "C") {
_parent.destroy();
}
Symbol 752 MovieClip Frame 20
_parent.destroy();
Symbol 760 MovieClip Frame 1
function reset() {
gotoAndStop (1);
}
function destroy() {
_parent.spellFailure(4);
reset();
}
stop();
Symbol 760 MovieClip Frame 2
stop();
Symbol 760 MovieClip Frame 3
_parent.clearSpellsBut(4);
Symbol 760 MovieClip Frame 6
stop();
Symbol 760 MovieClip Frame 10
stop();
Symbol 760 MovieClip Frame 14
stop();
Symbol 760 MovieClip Frame 23
_parent.launchAttack(4);
Symbol 761 Button
on (press) {
_parent.play();
gotoAndPlay (1);
}
on (keyPress "c") {
_parent.destroy();
}
on (keyPress "C") {
_parent.destroy();
}
Symbol 762 MovieClip Frame 20
_parent.destroy();
Symbol 770 MovieClip Frame 1
function reset() {
gotoAndStop (1);
}
function destroy() {
_parent.spellFailure(2);
reset();
}
stop();
Symbol 770 MovieClip Frame 2
stop();
Symbol 770 MovieClip Frame 3
_parent.clearSpellsBut(2);
Symbol 770 MovieClip Frame 6
stop();
Symbol 770 MovieClip Frame 10
stop();
Symbol 770 MovieClip Frame 14
stop();
Symbol 770 MovieClip Frame 23
_parent.launchAttack(2);
Symbol 771 Button
on (press) {
_parent.play();
gotoAndPlay (1);
}
on (keyPress "c") {
_parent.destroy();
}
on (keyPress "C") {
_parent.destroy();
}
Symbol 772 MovieClip Frame 20
_parent.destroy();
Symbol 781 MovieClip Frame 1
function reset() {
gotoAndStop (1);
}
function destroy() {
_parent.spellFailure(1);
reset();
}
stop();
Symbol 781 MovieClip Frame 2
stop();
Symbol 781 MovieClip Frame 3
_parent.clearSpellsBut(1);
Symbol 781 MovieClip Frame 6
stop();
Symbol 781 MovieClip Frame 10
stop();
Symbol 781 MovieClip Frame 14
stop();
Symbol 781 MovieClip Frame 23
_parent.launchAttack(1);
Symbol 784 MovieClip Frame 1
function initSpell() {
if (_root.tutorialSpellLock) {
return(undefined);
}
currentSpell = -1;
casting = false;
if (_root.TUTORIAL) {
casting = true;
spell2.gotoAndStop(2);
} else {
var i = 1;
while (i <= 4) {
if (spellCost[i] <= _root.playerCurStats[3]) {
casting = true;
eval ("spell" + i).gotoAndStop(2);
}
i++;
}
}
if (casting) {
gotoAndStop (3);
}
return(casting);
}
function spellFailure(s) {
if ((currentSpell == -1) && (casting)) {
casting = false;
clearSpellsBut(s);
_root.CombatCursor.stopSpell();
gotoAndStop (2);
} else if (currentSpell == s) {
_root.CombatCursor.stopSpell();
gotoAndStop (2);
}
}
function clearSpellsBut(s) {
currentSpell = s;
var i = 1;
while (i <= 4) {
if (i != s) {
eval ("spell" + i).reset();
}
i++;
}
}
function launchAttack(s) {
_root.continueTutorial(_root.CONTINUE_CAST_SPELL);
_root.playerCurStats[3] = _root.playerCurStats[3] - spellCost[s];
_root.updateInterface();
_root.CombatCursor.castSpell(s);
if (s == 1) {
gotoAndPlay (5);
} else {
gotoAndStop (2);
}
}
function create(thing, x, y) {
duplicateMovieClip (thing, "thing" + createCount, createCount);
eval ("thing" + createCount)._x = x;
eval ("thing" + createCount)._y = y;
createCount++;
}
spellCost = new Array(5);
spellCost[1] = 8;
spellCost[2] = 12;
spellCost[3] = 24;
spellCost[4] = 36;
spiritGain = new Array(5);
spiritGain[0] = 1;
spiritGain[1] = 2;
spiritGain[2] = 2;
spiritGain[3] = 3;
spiritGain[4] = 10;
Instance of Symbol 732 MovieClip "oHealingSoul" in Symbol 784 MovieClip Frame 1
onClipEvent (load) {
if (_name == "oHealingSoul") {
stop();
_visible = false;
}
}
Instance of Symbol 736 MovieClip "oWindBlade" in Symbol 784 MovieClip Frame 1
onClipEvent (load) {
if (_name == "oWindBlade") {
stop();
_visible = false;
}
}
Instance of Symbol 738 MovieClip "oGhostFlame" in Symbol 784 MovieClip Frame 1
onClipEvent (load) {
if (_name == "oGhostFlame") {
stop();
_visible = false;
}
}
Symbol 784 MovieClip Frame 2
createCount = 1;
stop();
Symbol 784 MovieClip Frame 4
gotoAndStop (2);
Symbol 785 MovieClip Frame 1
if ((_name == "splatOriginal") || (_name == "smallBlood")) {
stop();
_visible = false;
}
Symbol 785 MovieClip Frame 12
removeMovieClip("");
Symbol 788 MovieClip Frame 1
if (_name == "ghostSplatOriginal") {
stop();
_visible = false;
}
Symbol 788 MovieClip Frame 9
removeMovieClip("");
Symbol 791 MovieClip Frame 1
function getRandomX() {
var o = new Object();
o.x = 0;
o.y = 0;
localToGlobal(o);
return(o.x + ((random(_width) * _parent._xscale) / 100));
}
function getRandomY() {
var o = new Object();
o.x = 0;
o.y = 0;
localToGlobal(o);
return(o.y + ((random(_height) * _parent._xscale) / 100));
}
function customHitTest(x, y) {
return((((x > _x) && (x < (_x + _width))) && (y > _y)) && (y < (_y + _height)));
}
Symbol 791 MovieClip Frame 2
stop();
Symbol 801 MovieClip Frame 1
function explosion(d) {
trapHP--;
gotoAndPlay("explode" + trapHP);
}
function customHitTest(x, y, d, t, s) {
o.x = x;
o.y = y;
globalToLocal(o);
if (hitBox.hitTest(x, y, false)) {
if (t && (tHit)) {
_parent.createSparks(x, y);
return(undefined);
}
if (t) {
tHit = true;
}
if ((!t) && (ntHit)) {
_parent.createSparks(x, y);
return(undefined);
}
if (!t) {
ntHit = true;
}
explosion();
}
}
if (_name == "oBlockade") {
stop();
_visible = false;
}
stdHeight = _height / 2;
Symbol 801 MovieClip Frame 5
_parent.registerObject(_name);
ntHit = false;
tHit = false;
trapHP = 3;
Symbol 801 MovieClip Frame 17
stop();
Symbol 801 MovieClip Frame 20
immune = true;
Symbol 801 MovieClip Frame 31
immune = false;
stop();
Symbol 801 MovieClip Frame 32
immune = true;
Symbol 801 MovieClip Frame 43
immune = false;
stop();
Symbol 801 MovieClip Frame 57
_parent.enemyObjectCount--;
_parent.unregisterObject(_name);
removeMovieClip("");
Symbol 803 MovieClip Frame 1
function attack() {
_parent.enemyObjectCount++;
_parent.generateShurikenAttack(_parent.getAttackX(), _parent.getAttackY());
}
function startChuck(c) {
chuckCount = c;
gotoAndPlay (2);
}
function stopChuck() {
chucking = false;
}
function destroyMachine() {
alive = false;
}
chuckCount = 0;
alive = true;
stop();
Symbol 803 MovieClip Frame 2
trapTimer = new _root.Timer();
chucking = true;
Symbol 803 MovieClip Frame 4
if (chucking && (chuckCount > 0)) {
if (trapTimer.timeOver(4500)) {
trapTimer.resetTimer();
attack();
chuckCount--;
}
prevFrame();
play();
} else {
chucking = false;
if (!alive) {
_parent.enemyObjectCount--;
alive = true;
}
stop();
}
Symbol 805 MovieClip Frame 1
function canMoveLeft() {
return((_parent._x - _parent._width) > _root.worldESpawnFloor._x);
}
function canMoveRight() {
return((_parent._x + _parent._width) < (_root.worldESpawnFloor._x + _root.worldESpawnFloor._width));
}
function canMoveUp() {
return(_parent._y > _root.worldESpawnFloor._y);
}
function canMoveDown() {
return(_parent._y < (_root.worldESpawnFloor._y + _root.worldESpawnFloor._height));
}
function translate() {
_parent._x = _parent._x + ((_x * _parent._xscale) / 100);
_parent._y = _parent._y + ((_y * _parent._xscale) / 100);
}
function getCoord() {
o = new Object();
o.x = _x;
o.y = _y;
_parent.localToGlobal(o);
return(o);
}
Symbol 805 MovieClip Frame 2
stop();
Symbol 831 MovieClip Frame 1
function explosion(d) {
health = health - d;
if (health <= 0) {
death(false, LOCATION_TORSO, 1);
}
}
function death(t, l, s) {
immune = true;
tracer.translate();
if (t) {
if (s <= 0) {
_xscale = (-_xscale);
}
if (forward) {
gotoAndPlay (440);
} else {
gotoAndPlay (340);
}
} else if (forward) {
gotoAndPlay (490);
} else {
gotoAndPlay (390);
}
}
function cleanUp() {
_parent.enemyObjectCount--;
_parent.unregisterObject(_name);
removeMovieClip("");
}
function customHitTest(x, y, d, t, s, cn) {
var hh = false;
var o = new Object();
o.x = x;
o.y = y;
globalToLocal(o);
if (hitBoxHead.customHitTest(o.x, o.y) && (t)) {
hh = true;
d = d + 10;
}
if ((!immune) && (hitTest(x, y, true))) {
if ((health - d) <= 0) {
health = 0;
if (attacking) {
removeMovieClip("_parent." + attackSource);
}
if (hitBoxHead.customHitTest(o.x, o.y)) {
death(t, LOCATION_HEAD, s);
} else {
death(t, LOCATION_TORSO, s);
}
} else if (hitBoxHead.customHitTest(o.x, o.y) || (hitBoxTorso.customHitTest(o.x, o.y))) {
health = health - d;
if (attacking) {
attacking = false;
removeMovieClip("_parent." + attackSource);
gotoAndPlay (300);
} else if (forward) {
gotoAndPlay (310);
}
if (hh) {
_parent.createPainBlood(x, y);
} else if (cn != null) {
_parent.createThing(x, y, cn);
} else {
_parent.createBlood(x, y);
}
}
}
}
function defaultEvent() {
if (health > 0) {
if (!forward) {
gotoAndPlay (50);
}
} else {
death(false, 0, -1);
}
}
function randomClaw() {
if (Math.floor(Math.random() * 2) == 0) {
gotoAndPlay (240);
} else {
gotoAndPlay (265);
}
}
function randomJump() {
switch (Math.floor(Math.random() * 3)) {
case 0 :
if (tracer.canMoveLeft()) {
gotoAndPlay (190);
}
return;
case 1 :
if (tracer.canMoveRight()) {
gotoAndPlay (215);
}
return;
case 2 :
gotoAndPlay (155);
}
}
function AIEvent() {
if (health > 0) {
var actionTaken = Math.floor(Math.random() * 100);
if (!forward) {
if (actionTaken < MOVE_PCT) {
if (random(2) == 0) {
if (tracer.canMoveLeft()) {
gotoAndPlay (85);
}
} else if (tracer.canMoveRight()) {
gotoAndPlay (115);
}
} else if (actionTaken < BITE_PCT) {
randomJump();
}
} else if (actionTaken < CLAW_PCT) {
randomClaw();
} else {
gotoAndPlay (310);
}
} else {
death(false, 0, -1);
}
}
LOCATION_HEAD = 0;
LOCATION_TORSO = 1;
LOCATION_FEET = 2;
if (_name == "oWolf") {
stop();
_visible = false;
}
Symbol 831 MovieClip Frame 2
_parent.registerObject(_name);
_y = (_y - 50);
stdHeight = 30;
switch (_root.ENEMY_DIFFICULTY) {
case 1 :
MOVE_PCT = 30;
BITE_PCT = 75;
BITE_DELAY = 800;
BITE_DAMAGE = 10;
CLAW_PCT = 30;
CLAW_DAMAGE = 3;
health = 150;
break;
case 2 :
MOVE_PCT = 25;
BITE_PCT = 85;
BITE_DELAY = 450;
BITE_DAMAGE = 14;
CLAW_PCT = 60;
CLAW_DAMAGE = 4;
health = 280;
break;
case 3 :
MOVE_PCT = 20;
BITE_PCT = 100;
BITE_DELAY = 200;
BITE_DAMAGE = 25;
CLAW_PCT = 100;
CLAW_DAMAGE = 5;
health = 450;
}
immune = true;
attacking = false;
forward = false;
Symbol 831 MovieClip Frame 20
immune = false;
gotoAndPlay (50);
Symbol 831 MovieClip Frame 55
AIEvent();
Symbol 831 MovieClip Frame 60
AIEvent();
Symbol 831 MovieClip Frame 65
AIEvent();
Symbol 831 MovieClip Frame 70
defaultEvent();
AIEvent();
Symbol 831 MovieClip Frame 104
tracer.translate();
defaultEvent();
AIEvent();
Symbol 831 MovieClip Frame 134
tracer.translate();
defaultEvent();
AIEvent();
Symbol 831 MovieClip Frame 156
biteTimer = new _root.Timer();
o = biteTracer.getCoord();
attackSource = _parent.generateAttack(o.x, o.y, 110, _name, 222.222222222222 + BITE_DELAY, _parent.DAMAGE_TYPE_BLOCKABLE, BITE_DAMAGE);
attacking = true;
biteTimer.resetTimer();
Symbol 831 MovieClip Frame 159
if (!biteTimer.timeOver(111.111111111111 + BITE_DELAY)) {
prevFrame();
play();
}
Symbol 831 MovieClip Frame 160
forward = true;
Symbol 831 MovieClip Frame 167
attacking = false;
Symbol 831 MovieClip Frame 179
tracer.translate();
defaultEvent();
AIEvent();
Symbol 831 MovieClip Frame 191
biteTimer = new _root.Timer();
o = biteTracer.getCoord();
attackSource = _parent.generateAttack(o.x, o.y, 100, _name, 166.666666666667 + BITE_DELAY, _parent.DAMAGE_TYPE_BLOCKABLE, BITE_DAMAGE);
attacking = true;
biteTimer.resetTimer();
Symbol 831 MovieClip Frame 194
if (!biteTimer.timeOver(111.111111111111 + BITE_DELAY)) {
prevFrame();
play();
}
Symbol 831 MovieClip Frame 195
forward = true;
Symbol 831 MovieClip Frame 201
attacking = false;
Symbol 831 MovieClip Frame 209
tracer.translate();
defaultEvent();
AIEvent();
Symbol 831 MovieClip Frame 216
biteTimer = new _root.Timer();
o = biteTracer.getCoord();
attackSource = _parent.generateAttack(o.x, o.y, 100, _name, 166.666666666667 + BITE_DELAY, _parent.DAMAGE_TYPE_BLOCKABLE, BITE_DAMAGE);
attacking = true;
biteTimer.resetTimer();
Symbol 831 MovieClip Frame 219
if (!biteTimer.timeOver(111.111111111111 + BITE_DELAY)) {
prevFrame();
play();
}
Symbol 831 MovieClip Frame 220
forward = true;
Symbol 831 MovieClip Frame 225
attacking = false;
Symbol 831 MovieClip Frame 234
tracer.translate();
defaultEvent();
AIEvent();
Symbol 831 MovieClip Frame 241
o = biteTracer.getCoord();
attackSource = _parent.generateAttack(o.x, o.y, 160, _name, 55.5555555555556, _parent.DAMAGE_TYPE_BLOCKABLE, CLAW_DAMAGE);
attacking = true;
Symbol 831 MovieClip Frame 249
attacking = false;
Symbol 831 MovieClip Frame 259
tracer.translate();
AIEvent();
Symbol 831 MovieClip Frame 266
o = biteTracer.getCoord();
attackSource = _parent.generateAttack(o.x, o.y, 160, _name, 55.5555555555556, _parent.DAMAGE_TYPE_BLOCKABLE, CLAW_DAMAGE);
attacking = true;
Symbol 831 MovieClip Frame 274
attacking = false;
Symbol 831 MovieClip Frame 284
tracer.translate();
AIEvent();
Symbol 831 MovieClip Frame 323
forward = false;
Symbol 831 MovieClip Frame 328
tracer.translate();
defaultEvent();
AIEvent();
Symbol 831 MovieClip Frame 379
cleanUp();
Symbol 831 MovieClip Frame 429
cleanUp();
Symbol 831 MovieClip Frame 478
cleanUp();
Symbol 831 MovieClip Frame 529
cleanUp();
Symbol 836 MovieClip Frame 1
if (_name == "painSplatOriginal") {
stop();
_visible = false;
}
Symbol 836 MovieClip Frame 15
removeMovieClip("");
Symbol 837 MovieClip Frame 1
function violentReaction() {
removeMovieClip("");
}
function endAttack() {
violentReaction();
}
if (_name == "oGhostFlame") {
_visible = false;
}
Symbol 837 MovieClip Frame 2
stop();
Symbol 861 MovieClip Frame 1
function explosion(d) {
if (!immune) {
health = health - d;
if (health <= 0) {
death(true, LOCATION_HEAD, 1);
}
}
}
function death(t, l, s) {
immune = true;
tracer.translate();
gotoAndPlay (290);
}
function cleanUp() {
_parent.enemyObjectCount--;
_parent.unregisterObject(_name);
removeMovieClip("");
}
function customHitTest(x, y, d, t, s, cn) {
var o = new Object();
o.x = x;
o.y = y;
globalToLocal(o);
if (hitBoxHead.customHitTest(o.x, o.y) && (t)) {
hh = true;
d = d + 20;
} else {
hh = false;
}
if ((!immune) && (hitTest(x, y, true))) {
if ((health - d) <= 0) {
_parent.createBlood(x, y);
health = 0;
if (attacking) {
var c = 0;
while (c < outstandingAttacks) {
removeMovieClip("_parent." + attackSource[c]);
c++;
}
var c = 0;
while (c < 5) {
removeMovieClip("_parent." + ghostArray[c]);
c++;
}
}
if (hitBoxHead.customHitTest(o.x, o.y)) {
death(t, LOCATION_HEAD, s);
} else if (hitBoxTorso.customHitTest(o.x, o.y)) {
death(t, LOCATION_TORSO, s);
} else if (hitBoxFeet.customHitTest(o.x, o.y)) {
death(t, LOCATION_FEET, s);
} else {
death(false, 0, -1);
}
} else if ((hitBoxHead.customHitTest(o.x, o.y) || (hitBoxTorso.customHitTest(o.x, o.y))) || (hitBoxFeet.customHitTest(o.x, o.y))) {
if (hh) {
_parent.createPainBlood(x, y);
} else if (cn != null) {
_parent.createThing(x, y, cn);
} else {
_parent.createBlood(x, y);
}
health = health - d;
} else {
_parent.createSparks(x, y);
}
}
}
function flameAttack(minFlameReq) {
if (MAX_FLAME_ATTACK >= minFlameReq) {
o = eval ("flameTrace" + i).getCoord();
ghostArray[i] = _parent.createGhostFlame(o.x, o.y, (i * 20) + 80);
attackSource[i] = _parent.generateAttack(o.x, o.y, 120 + (i * 6), ghostArray[i], -333.333333333333 + (FLAME_DELAY * (1 + (i * 0.2))), _parent.DAMAGE_TYPE_BLOCKABLE + _parent.DAMAGE_TYPE_SLASHABLE, ATTACK_DAMAGE);
outstandingAttacks++;
}
i++;
}
function defaultEvent() {
if (health > 0) {
gotoAndPlay (23);
} else {
death(false, 0, -1);
}
}
function AIEvent() {
if (health > 0) {
var actionTaken = (Math.random() * 100);
if (actionTaken < FLAME_ATTACK_PCT) {
gotoAndPlay (40);
} else if (actionTaken < CHARGE_PCT) {
if (_x < (_root.SCREEN_WIDTH / 2)) {
gotoAndPlay (250);
} else {
gotoAndPlay (210);
}
} else if (actionTaken < TELEPORT_PCT) {
gotoAndPlay (160);
}
if (((Math.random() * 100) < COUNTER_ATTACK_PCT) && (_root.combatCursor.isAttackPulsing())) {
if (_root.combatCursor._y < (_root.SCREEN_WIDTH / 2)) {
gotoAndPlay (100);
} else {
gotoAndPlay (130);
}
}
} else {
death(false, 0, -1);
}
}
LOCATION_HEAD = 0;
LOCATION_TORSO = 1;
LOCATION_FEET = 2;
if (_name == "oFNinja") {
stop();
_visible = false;
}
Symbol 861 MovieClip Frame 2
_parent.registerObject(_name);
stdHeight = 140;
switch (_root.ENEMY_DIFFICULTY) {
case 1 :
FLAME_ATTACK_PCT = 20;
CHARGE_PCT = 50;
TELEPORT_PCT = 70;
COUNTER_ATTACK_PCT = 50;
ATTACK_DELAY = 700;
JUMP_DELAY = 2500;
MAX_FLAME_ATTACK = 3;
MAX_CHARGE_ATTACK = 2;
FLAME_DELAY = 1000;
CHARGE_BASE = 300;
CHARGE_DELAY = 300;
ATTACK_DAMAGE = 5;
health = 620;
break;
case 2 :
FLAME_ATTACK_PCT = 30;
CHARGE_PCT = 60;
TELEPORT_PCT = 70;
COUNTER_ATTACK_PCT = 75;
ATTACK_DELAY = 400;
JUMP_DELAY = 2500;
MAX_FLAME_ATTACK = 4;
MAX_CHARGE_ATTACK = 3;
FLAME_DELAY = 750;
CHARGE_BASE = 0;
CHARGE_DELAY = 250;
ATTACK_DAMAGE = 8;
if (_root.arenaMode) {
health = 900;
} else {
health = 1500;
}
break;
case 3 :
FLAME_ATTACK_PCT = 30;
CHARGE_PCT = 80;
TELEPORT_PCT = 100;
COUNTER_ATTACK_PCT = 90;
ATTACK_DELAY = 200;
JUMP_DELAY = 2500;
MAX_FLAME_ATTACK = 5;
MAX_CHARGE_ATTACK = 3;
FLAME_DELAY = 500;
CHARGE_BASE = 0;
CHARGE_DELAY = 200;
ATTACK_DAMAGE = 12;
health = 2600;
}
immune = true;
attacking = false;
leftSide = _x < (_root.SCREEN_WIDTH / 2);
ninjaTimer = new _root.Timer();
outstandingAttacks = 0;
attackSource = new Array(50);
ghostArray = new Array(5);
Symbol 861 MovieClip Frame 18
immune = false;
defaultEvent();
Symbol 861 MovieClip Frame 25
AIEvent();
Symbol 861 MovieClip Frame 28
AIEvent();
Symbol 861 MovieClip Frame 31
AIEvent();
Symbol 861 MovieClip Frame 34
defaultEvent();
AIEvent();
Symbol 861 MovieClip Frame 50
i = 0;
attacking = true;
Symbol 861 MovieClip Frame 61
flameAttack(3);
Symbol 861 MovieClip Frame 66
flameAttack(5);
Symbol 861 MovieClip Frame 71
flameAttack(2);
Symbol 861 MovieClip Frame 76
flameAttack(4);
Symbol 861 MovieClip Frame 81
flameAttack(1);
Symbol 861 MovieClip Frame 93
gotoAndPlay (160);
Symbol 861 MovieClip Frame 101
frameDelay = 333.333333333333 + ATTACK_DELAY;
outstandingAttacks = 1;
attacking = true;
o = attackTrace.getCoord();
attackSource[0] = _parent.generateAttack(o.x, o.y, 125, _name, frameDelay, _parent.DAMAGE_TYPE_BLOCKABLE, ATTACK_DAMAGE);
Symbol 861 MovieClip Frame 104
ninjaTimer.resetTimer();
Symbol 861 MovieClip Frame 106
if (!ninjaTimer.TimeOver(ATTACK_DELAY)) {
prevFrame();
play();
}
Symbol 861 MovieClip Frame 121
attacking = false;
defaultEvent();
AIEvent();
Symbol 861 MovieClip Frame 131
frameDelay = 333.333333333333 + ATTACK_DELAY;
outstandingAttacks = 1;
attacking = true;
o = attackTrace.getCoord();
attackSource[0] = _parent.generateAttack(o.x, o.y, 125, _name, frameDelay, _parent.DAMAGE_TYPE_BLOCKABLE, ATTACK_DAMAGE);
Symbol 861 MovieClip Frame 133
ninjaTimer.resetTimer();
Symbol 861 MovieClip Frame 135
if (!ninjaTimer.TimeOver(ATTACK_DELAY)) {
prevFrame();
play();
}
Symbol 861 MovieClip Frame 151
attacking = false;
defaultEvent();
AIEvent();
Symbol 861 MovieClip Frame 181
_x = _parent.getFloorSpawnX();
Symbol 861 MovieClip Frame 201
defaultEvent();
Symbol 861 MovieClip Frame 211
i = 0;
while (i < MAX_CHARGE_ATTACK) {
o = eval ("attackTrace" + i).getCoord();
attackSource[i] = _parent.generateAttack(o.x, o.y, 150 + (i * 25), _name, (611.111111111111 + CHARGE_BASE) + (i * CHARGE_DELAY), _parent.DAMAGE_TYPE_BLOCKABLE, ATTACK_DAMAGE);
i++;
}
outstandingAttacks = MAX_CHARGE_ATTACK;
attacking = true;
Symbol 861 MovieClip Frame 241
tracer.translate();
attacking = false;
if (!tracer.canMoveLeft()) {
gotoAndPlay (160);
} else {
defaultEvent();
AIEvent();
}
Symbol 861 MovieClip Frame 251
i = 0;
while (i < MAX_CHARGE_ATTACK) {
o = eval ("attackTrace" + i).getCoord();
attackSource[i] = _parent.generateAttack(o.x, o.y, 150 + (i * 25), _name, (611.111111111111 + CHARGE_BASE) + (i * CHARGE_DELAY), _parent.DAMAGE_TYPE_BLOCKABLE, ATTACK_DAMAGE);
i++;
}
outstandingAttacks = MAX_CHARGE_ATTACK;
attacking = true;
Symbol 861 MovieClip Frame 281
tracer.translate();
attacking = false;
if (!tracer.canMoveRight()) {
gotoAndPlay (160);
} else {
defaultEvent();
AIEvent();
}
Symbol 861 MovieClip Frame 378
cleanUp();
Symbol 866 MovieClip Frame 1
function explosion(d) {
violentReaction();
}
function violentReaction() {
_parent.createSparks(_x, _y);
_parent.enemyObjectCount--;
removeMovieClip("");
}
function endAttack() {
_parent.enemyObjectCount--;
removeMovieClip("");
}
attackDelay = 1500;
stdHeight = _height / 2;
_rotation = (_rotation + (random(40) - 20));
if (_name == "oShurikenAttack") {
stop();
_visible = false;
}
Symbol 866 MovieClip Frame 3
startTime = getTimer();
_xscale = 50;
_yscale = 50;
_parent.generateAttack(_x, _y, 120, _name, attackDelay, _parent.DAMAGE_TYPE_BLOCKABLE + _parent.DAMAGE_TYPE_SLASHABLE, 2 + (2 * _root.ENEMY_DIFFICULTY));
Symbol 866 MovieClip Frame 5
_xscale = (50 + (Math.pow((getTimer() - startTime) / attackDelay, 4) * 100));
if (_xscale > 300) {
_xscale = 300;
}
_yscale = _xscale;
prevFrame();
play();
Symbol 866 MovieClip Frame 6
stop();
Symbol 886 MovieClip Frame 1
function explosion(d) {
if (!immune) {
health = health - d;
if (health <= 0) {
death(true, LOCATION_HEAD, 1);
}
}
}
function death(t, l, s) {
immune = true;
tracer.translate();
if (t) {
if (s <= 0) {
_xscale = (-_xscale);
}
if (l == LOCATION_HEAD) {
gotoAndPlay (190);
} else if (l == LOCATION_TORSO) {
gotoAndPlay (235);
} else {
gotoAndPlay (280);
}
} else if (Math.random() > 0.5) {
if (Math.random() > 0.5) {
_xscale = (-_xscale);
}
gotoAndPlay (370);
} else {
gotoAndPlay (325);
}
}
function cleanUp() {
_parent.enemyObjectCount--;
_parent.unregisterObject(_name);
removeMovieClip("");
}
function shurikenAttack(x, y) {
if ((shurikensInHand > 0) && (random(3) == 0)) {
shurikensInHand--;
_parent.generateShurikenAttack(x, y);
_parent.enemyObjectCount++;
}
}
function customHitTest(x, y, d, t, s, cn) {
var o = new Object();
o.x = x;
o.y = y;
globalToLocal(o);
if (hitBoxHead.customHitTest(o.x, o.y) && (t)) {
hh = true;
d = d + 20;
} else {
hh = false;
}
if ((!immune) && (hitTest(x, y, true))) {
if ((health - d) <= 0) {
health = 0;
if (attacking) {
removeMovieClip("_parent." + attackSource1);
removeMovieClip("_parent." + attackSource2);
}
if (hitBoxHead.customHitTest(o.x, o.y)) {
death(t, LOCATION_HEAD, s);
} else if (hitBoxTorso.customHitTest(o.x, o.y)) {
death(t, LOCATION_TORSO, s);
} else if (hitBoxFeet.customHitTest(o.x, o.y)) {
death(t, LOCATION_FEET, s);
} else {
death(false, 0, -1);
}
} else if ((hitBoxHead.customHitTest(o.x, o.y) || (hitBoxTorso.customHitTest(o.x, o.y))) || (hitBoxFeet.customHitTest(o.x, o.y))) {
health = health - d;
if (attacking) {
attacking = false;
removeMovieClip("_parent." + attackSource1);
removeMovieClip("_parent." + attackSource2);
gotoAndPlay (170);
}
if (hh) {
_parent.createPainBlood(x, y);
} else if (cn != null) {
_parent.createThing(x, y, cn);
} else {
_parent.createBlood(x, y);
}
}
}
}
function defaultEvent() {
if (health > 0) {
gotoAndPlay (20);
} else {
death(false, 0, -1);
}
}
function AIEvent() {
if (health > 0) {
var actionTaken = (Math.random() * 100);
if (actionTaken < DODGE_PCT) {
if (_root.combatCursor.isAttackPulsing()) {
if (random(3) == 0) {
gotoAndPlay (75);
} else if (random(2) == 0) {
gotoAndPlay (45);
} else {
gotoAndPlay (60);
}
}
} else if (actionTaken < JUMP_ATTACK_PCT) {
if (leftSide) {
leftSide = false;
gotoAndPlay (115);
} else {
leftSide = true;
gotoAndPlay (90);
}
} else if (actionTaken < STAND_ATTACK_PCT) {
gotoAndPlay (140);
}
} else {
death(false, 0, -1);
}
}
LOCATION_HEAD = 0;
LOCATION_TORSO = 1;
LOCATION_FEET = 2;
if (_name == "oNinja") {
stop();
_visible = false;
}
Symbol 886 MovieClip Frame 2
_parent.registerObject(_name);
stdHeight = 140;
switch (_root.ENEMY_DIFFICULTY) {
case 1 :
DODGE_PCT = 40;
JUMP_ATTACK_PCT = 60;
STAND_ATTACK_PCT = 70;
ATTACK_DELAY = 1000;
JUMP_DELAY = 2500;
ATTACK_DAMAGE = 5;
MAX_SHURIKENS = 2;
health = 120;
break;
case 2 :
DODGE_PCT = 50;
JUMP_ATTACK_PCT = 70;
STAND_ATTACK_PCT = 85;
ATTACK_DELAY = 800;
JUMP_DELAY = 1800;
ATTACK_DAMAGE = 12;
MAX_SHURIKENS = 3;
health = 450;
break;
case 3 :
DODGE_PCT = 30;
JUMP_ATTACK_PCT = 55;
STAND_ATTACK_PCT = 90;
ATTACK_DELAY = 350;
JUMP_DELAY = 1000;
ATTACK_DAMAGE = 20;
MAX_SHURIKENS = 5;
health = 700;
}
immune = true;
attacking = false;
leftSide = _x < (_root.SCREEN_WIDTH / 2);
ninjaTimer = new _root.Timer();
Symbol 886 MovieClip Frame 16
immune = false;
defaultEvent();
Symbol 886 MovieClip Frame 23
AIEvent();
Symbol 886 MovieClip Frame 27
AIEvent();
Symbol 886 MovieClip Frame 31
AIEvent();
Symbol 886 MovieClip Frame 35
AIEvent();
Symbol 886 MovieClip Frame 39
defaultEvent();
AIEvent();
Symbol 886 MovieClip Frame 54
defaultEvent();
Symbol 886 MovieClip Frame 69
defaultEvent();
Symbol 886 MovieClip Frame 84
defaultEvent();
Symbol 886 MovieClip Frame 90
shurikensInHand = MAX_SHURIKENS;
Symbol 886 MovieClip Frame 95
o = handTracer.getCoord();
shurikenAttack(o.x, o.y);
Symbol 886 MovieClip Frame 96
o = handTracer.getCoord();
shurikenAttack(o.x, o.y);
Symbol 886 MovieClip Frame 97
o = handTracer.getCoord();
shurikenAttack(o.x, o.y);
Symbol 886 MovieClip Frame 98
o = handTracer.getCoord();
shurikenAttack(o.x, o.y);
Symbol 886 MovieClip Frame 99
o = handTracer.getCoord();
shurikenAttack(o.x, o.y);
Symbol 886 MovieClip Frame 100
o = handTracer.getCoord();
shurikenAttack(o.x, o.y);
Symbol 886 MovieClip Frame 101
o = handTracer.getCoord();
shurikenAttack(o.x, o.y);
Symbol 886 MovieClip Frame 108
ninjaTimer.resetTimer();
Symbol 886 MovieClip Frame 110
if (ninjaTimer.timeOver(JUMP_DELAY)) {
tracer.translate();
defaultEvent();
} else {
prevFrame();
play();
}
Symbol 886 MovieClip Frame 115
shurikensInHand = MAX_SHURIKENS;
Symbol 886 MovieClip Frame 121
o = handTracer.getCoord();
shurikenAttack(o.x, o.y);
Symbol 886 MovieClip Frame 122
o = handTracer.getCoord();
shurikenAttack(o.x, o.y);
Symbol 886 MovieClip Frame 123
o = handTracer.getCoord();
shurikenAttack(o.x, o.y);
Symbol 886 MovieClip Frame 124
o = handTracer.getCoord();
shurikenAttack(o.x, o.y);
Symbol 886 MovieClip Frame 125
o = handTracer.getCoord();
shurikenAttack(o.x, o.y);
Symbol 886 MovieClip Frame 126
o = handTracer.getCoord();
shurikenAttack(o.x, o.y);
Symbol 886 MovieClip Frame 127
o = handTracer.getCoord();
shurikenAttack(o.x, o.y);
Symbol 886 MovieClip Frame 133
ninjaTimer.resetTimer();
Symbol 886 MovieClip Frame 135
if (ninjaTimer.timeOver(JUMP_DELAY)) {
tracer.translate();
defaultEvent();
} else {
prevFrame();
play();
}
Symbol 886 MovieClip Frame 141
frameDelay1 = 111.111111111111;
frameDelay2 = 777.777777777778;
attackSource1 = _parent.generateAttack(attackBoundBox1.getRandomX(), attackBoundBox1.getRandomY(), random(40) + 80, _name, ATTACK_DELAY + frameDelay1, _parent.DAMAGE_TYPE_BLOCKABLE, ATTACK_DAMAGE);
attackSource2 = _parent.generateAttack(attackBoundBox2.getRandomX(), attackBoundBox2.getRandomY(), random(40) + 80, _name, ATTACK_DELAY + frameDelay2, _parent.DAMAGE_TYPE_BLOCKABLE, ATTACK_DAMAGE);
ninjaTimer.resetTimer();
attacking = true;
Symbol 886 MovieClip Frame 145
if (!ninjaTimer.timeOver(ATTACK_DELAY)) {
prevFrame();
play();
}
Symbol 886 MovieClip Frame 167
attacking = false;
defaultEvent();
Symbol 886 MovieClip Frame 181
defaultEvent();
Symbol 886 MovieClip Frame 229
cleanUp();
Symbol 886 MovieClip Frame 273
cleanUp();
Symbol 886 MovieClip Frame 319
cleanUp();
Symbol 886 MovieClip Frame 364
cleanUp();
Symbol 886 MovieClip Frame 409
cleanUp();
Symbol 887 MovieClip Frame 1
startDelay = random(20) * 25;
startTimer = new _root.Timer();
if (_name == "oShuriken") {
stop();
_visible = false;
} else {
_rotation = (random(30) - 15);
}
Symbol 887 MovieClip Frame 3
if (!startTimer.timeOver(startDelay)) {
prevFrame();
play();
}
Symbol 887 MovieClip Frame 15
_root.makeStabAttack(_x, _y, 20, false, 1);
removeMovieClip("");
Symbol 897 MovieClip Frame 1
function explosion(d) {
if (!immune) {
health = health - d;
if (health <= 0) {
death(true, LOCATION_HEAD, 1);
}
}
}
function death(t, l, s) {
immune = true;
tracer.translate();
if (t) {
if (s <= 0) {
_xscale = (-_xscale);
}
if (l == LOCATION_HEAD) {
gotoAndPlay (220);
} else if (l == LOCATION_TORSO) {
gotoAndPlay (265);
} else {
gotoAndPlay (310);
}
} else if (Math.random() > 0.5) {
if (Math.random() > 0.5) {
_xscale = (-_xscale);
}
gotoAndPlay (400);
} else {
gotoAndPlay (355);
}
}
function cleanUp() {
_parent.enemyObjectCount--;
_parent.unregisterObject(_name);
removeMovieClip("");
}
function customHitTest(x, y, d, t, s, cn) {
var hh = false;
var o = new Object();
o.x = x;
o.y = y;
globalToLocal(o);
if (hitBoxHead.customHitTest(o.x, o.y) && (t)) {
hh = true;
d = d + 20;
}
if ((!immune) && (hitTest(x, y, true))) {
if ((health - d) <= 0) {
health = 0;
if (attacking) {
removeMovieClip("_parent." + attackSource);
}
if (hitBoxHead.customHitTest(o.x, o.y)) {
death(t, LOCATION_HEAD, s);
} else if (hitBoxTorso.customHitTest(o.x, o.y)) {
death(t, LOCATION_TORSO, s);
} else if (hitBoxFeet.customHitTest(o.x, o.y)) {
death(t, LOCATION_FEET, s);
} else {
death(false, 0, -1);
}
} else if ((hitBoxHead.customHitTest(o.x, o.y) || (hitBoxTorso.customHitTest(o.x, o.y))) || (hitBoxFeet.customHitTest(o.x, o.y))) {
health = health - d;
if (attacking) {
attacking = false;
removeMovieClip("_parent." + attackSource);
gotoAndPlay (200);
}
if (hh) {
_parent.createPainBlood(x, y);
} else if (cn != null) {
_parent.createThing(x, y, cn);
} else {
_parent.createBlood(x, y);
}
} else {
_parent.createSparks(x, y);
}
}
}
function startAttack(sa) {
shortAttack = sa;
gotoAndPlay (170);
}
function startBlock(location) {
if (location == 0) {
gotoAndPlay (100);
} else {
gotoAndPlay (125);
}
}
function defaultEvent() {
if (health > 0) {
alert = false;
gotoAndPlay (40);
} else {
death(false, 0, -1);
}
}
function counterEvent() {
if (_root.combatCursor.isAttacking()) {
var actionTaken = (Math.random() * 100);
if (actionTaken < COUNTER_ATTACK_PCT) {
startAttack(true);
return(true);
}
if (actionTaken < ALERT_PCT) {
gotoAndPlay (150);
return(true);
}
} else if (_root.combatCursor.isBlocking() || (!_root.combatCursor.canAttack())) {
var actionTaken = (Math.random() * 100);
if (actionTaken < COUNTER_ATTACK_PCT) {
startAttack(false);
return(true);
}
}
return(false);
}
function AIEvent() {
if (health > 0) {
var actionTaken = (Math.random() * 100);
var hasCounter = false;
if (actionTaken < COUNTER_PCT) {
hasCounter = counterEvent();
}
if (!hasCounter) {
actionTaken = Math.random() * 100;
if (actionTaken < MOVE_PCT) {
if (random(2) == 0) {
if (tracer.canMoveLeft()) {
gotoAndPlay (70);
}
} else if (tracer.canMoveRight()) {
gotoAndPlay (85);
}
} else if (actionTaken < ATTACK_PCT) {
startAttack(false);
}
}
} else {
death(false, 0, -1);
}
}
LOCATION_HEAD = 0;
LOCATION_TORSO = 1;
LOCATION_FEET = 2;
if (_name == "oSamurai") {
stop();
_visible = false;
}
Symbol 897 MovieClip Frame 2
_parent.registerObject(_name);
stdHeight = 160;
switch (_root.ENEMY_DIFFICULTY) {
case 1 :
COUNTER_PCT = 50;
MOVE_PCT = 50;
ATTACK_PCT = 80;
COUNTER_ATTACK_PCT = 20;
ALERT_PCT = 70;
BLOCK_PCT = 30;
DODGE_PCT = 70;
BLOCK_DELAY = 600;
MAX_INCREMENT = 4;
ATTACK_INCREMENT = 200;
MIN_ATTACK_DELAY = 1000;
ATTACK_DAMAGE = 6;
health = 80;
break;
case 2 :
COUNTER_PCT = 80;
MOVE_PCT = 60;
ATTACK_PCT = 80;
COUNTER_ATTACK_PCT = 30;
ALERT_PCT = 90;
BLOCK_PCT = 60;
DODGE_PCT = 100;
BLOCK_DELAY = 200;
MAX_INCREMENT = 6;
ATTACK_INCREMENT = 100;
MIN_ATTACK_DELAY = 600;
ATTACK_DAMAGE = 10;
health = 160;
break;
case 3 :
COUNTER_PCT = 100;
MOVE_PCT = 50;
ATTACK_PCT = 100;
COUNTER_ATTACK_PCT = 50;
ALERT_PCT = 100;
BLOCK_PCT = 80;
DODGE_PCT = 100;
BLOCK_DELAY = 0;
MAX_INCREMENT = 15;
ATTACK_INCREMENT = 50;
MIN_ATTACK_DELAY = 500;
ATTACK_DAMAGE = 8;
health = 320;
}
immune = true;
alert = false;
attacking = false;
Symbol 897 MovieClip Frame 30
immune = false;
defaultEvent();
Symbol 897 MovieClip Frame 45
AIEvent();
Symbol 897 MovieClip Frame 50
AIEvent();
Symbol 897 MovieClip Frame 55
AIEvent();
Symbol 897 MovieClip Frame 60
AIEvent();
Symbol 897 MovieClip Frame 65
defaultEvent();
AIEvent();
Symbol 897 MovieClip Frame 81
tracer.translate();
defaultEvent();
AIEvent();
Symbol 897 MovieClip Frame 96
tracer.translate();
defaultEvent();
AIEvent();
Symbol 897 MovieClip Frame 103
blockTimer = new _root.Timer();
Symbol 897 MovieClip Frame 105
if (!blockTimer.timeOver(BLOCK_DELAY)) {
prevFrame();
play();
}
Symbol 897 MovieClip Frame 116
defaultEvent();
AIEvent();
Symbol 897 MovieClip Frame 129
blockTimer = new _root.Timer();
Symbol 897 MovieClip Frame 131
if (!blockTimer.timeOver(BLOCK_DELAY)) {
prevFrame();
play();
}
Symbol 897 MovieClip Frame 142
defaultEvent();
AIEvent();
Symbol 897 MovieClip Frame 150
alert = true;
alertTimer = new _root.Timer();
Symbol 897 MovieClip Frame 157
if (_root.combatCursor.isAttackPulsing() || (alertTimer.timeOver(2500))) {
alert = false;
var actionTaken = (Math.random() * 100);
if (actionTaken < BLOCK_PCT) {
if (_root.combatCursor._y < (_root.SCREEN_HEIGHT / 2)) {
startBlock(0);
} else {
startBlock(1);
}
} else if (actionTaken < DODGE_PCT) {
if (random(2) == 0) {
if (tracer.canMoveLeft()) {
gotoAndPlay (70);
} else {
gotoAndPlay (85);
}
} else if (tracer.canMoveRight()) {
gotoAndPlay (85);
} else {
gotoAndPlay (70);
}
} else {
defaultEvent();
AIEvent();
}
} else {
prevFrame();
play();
}
Instance of Symbol 205 MovieClip "evilFlame" in Symbol 897 MovieClip Frame 170
onClipEvent (load) {
_visible = false;
}
Symbol 897 MovieClip Frame 171
attackDelay = MIN_ATTACK_DELAY;
frameDelay = 111.111111111111;
if (!shortAttack) {
attackDelay = attackDelay + (ATTACK_INCREMENT * Math.floor(Math.random() * MAX_INCREMENT));
}
attackSource = _parent.generateAttack(attackBoundBox.getRandomX(), attackBoundBox.getRandomY(), random(60) + 100, _name, attackDelay + frameDelay, _parent.DAMAGE_TYPE_BLOCKABLE, Math.floor((ATTACK_DAMAGE * attackDelay) / MIN_ATTACK_DELAY));
attackTimer = new _root.Timer();
attacking = true;
Symbol 897 MovieClip Frame 175
if (((!evilFlame._visible) && (!shortAttack)) && (attackTimer.timeOver(MIN_ATTACK_DELAY / 2))) {
evilFlame._visible = true;
}
if (!attackTimer.timeOver(attackDelay)) {
prevFrame();
play();
}
Symbol 897 MovieClip Frame 176
evilFlame._visible = false;
Symbol 897 MovieClip Frame 189
attacking = false;
defaultEvent();
Symbol 897 MovieClip Frame 211
defaultEvent();
Symbol 897 MovieClip Frame 259
cleanUp();
Symbol 897 MovieClip Frame 304
cleanUp();
Symbol 897 MovieClip Frame 349
cleanUp();
Symbol 897 MovieClip Frame 394
cleanUp();
Symbol 897 MovieClip Frame 439
cleanUp();
Symbol 917 MovieClip Frame 1
function explosion(d) {
health = health - d;
if (health <= 0) {
death(false, LOCATION_TORSO, 1);
}
}
function death(t, l, s) {
immune = true;
tracer.translate();
if (t) {
if (s <= 0) {
_xscale = (-_xscale);
}
if (l == LOCATION_HEAD) {
gotoAndPlay (230);
} else if (l == LOCATION_TORSO) {
gotoAndPlay (275);
} else {
gotoAndPlay (320);
}
} else if (Math.abs(s) > 45) {
if (s > 0) {
_xscale = (-_xscale);
}
gotoAndPlay (366);
} else {
gotoAndPlay (365);
}
}
function cleanUp() {
_parent.enemyObjectCount--;
_parent.unregisterObject(_name);
removeMovieClip("");
}
function customHitTest(x, y, d, t, s, cn) {
var hh = false;
var o = new Object();
o.x = x;
o.y = y;
globalToLocal(o);
if (hitBoxHead.customHitTest(o.x, o.y) && (t)) {
hh = true;
d = d + 20;
}
if ((!immune) && (hitTest(x, y, true))) {
if ((health - d) <= 0) {
health = 0;
if (biting) {
removeMovieClip("_parent." + biteSource);
}
if (hitBoxHead.customHitTest(o.x, o.y)) {
death(t, LOCATION_HEAD, s);
} else if (hitBoxTorso.customHitTest(o.x, o.y)) {
death(t, LOCATION_TORSO, s);
} else if (hitBoxFeet.customHitTest(o.x, o.y)) {
death(t, LOCATION_FEET, s);
} else {
death(false, 0, -1);
}
} else if ((hitBoxHead.customHitTest(o.x, o.y) || (hitBoxTorso.customHitTest(o.x, o.y))) || (hitBoxFeet.customHitTest(o.x, o.y))) {
health = health - d;
if (biting) {
biting = false;
removeMovieClip("_parent." + biteSource);
gotoAndPlay (210);
}
if (hh) {
_parent.createPainBlood(x, y);
} else if (cn != null) {
_parent.createThing(x, y, cn);
} else {
_parent.createBlood(x, y);
}
}
}
}
function defaultEvent() {
if (health > 0) {
gotoAndPlay (50);
} else {
death(false, 0, -1);
}
}
function AIEvent() {
if (health > 0) {
var actionTaken = Math.floor(Math.random() * 100);
if (actionTaken < MOVE_PCT) {
if (random(2) == 0) {
if (tracer.canMoveLeft()) {
gotoAndPlay (85);
}
} else if (tracer.canMoveRight()) {
gotoAndPlay (115);
}
} else if (actionTaken < BITE_PCT) {
gotoAndPlay (155);
}
} else {
death(false, 0, -1);
}
}
LOCATION_HEAD = 0;
LOCATION_TORSO = 1;
LOCATION_FEET = 2;
if (_name == "oZombie") {
stop();
_visible = false;
}
Symbol 917 MovieClip Frame 2
_parent.registerObject(_name);
stdHeight = 130;
switch (_root.ENEMY_DIFFICULTY) {
case 0 :
MOVE_PCT = 50;
BITE_PCT = 0;
BITE_DELAY = 2800;
BITE_DAMAGE = 3;
health = 80;
break;
case 1 :
MOVE_PCT = 40;
BITE_PCT = 70;
BITE_DELAY = 1500;
BITE_DAMAGE = 5;
health = 60;
break;
case 2 :
MOVE_PCT = 40;
BITE_PCT = 80;
BITE_DELAY = 800;
BITE_DAMAGE = 10;
health = 60;
break;
case 3 :
MOVE_PCT = 20;
BITE_PCT = 100;
BITE_DELAY = 400;
BITE_DAMAGE = 15;
health = 150;
}
immune = true;
biting = false;
Symbol 917 MovieClip Frame 40
immune = false;
gotoAndPlay (50);
Symbol 917 MovieClip Frame 64
AIEvent();
Symbol 917 MovieClip Frame 79
defaultEvent();
AIEvent();
Symbol 917 MovieClip Frame 109
tracer.translate();
defaultEvent();
AIEvent();
Symbol 917 MovieClip Frame 139
tracer.translate();
defaultEvent();
AIEvent();
Symbol 917 MovieClip Frame 156
biteTimer = new _root.Timer();
o = biteTracer.getCoord();
biteSource = _parent.generateAttack(o.x, o.y, 160, _name, 888.888888888889 + BITE_DELAY, _parent.DAMAGE_TYPE_BLOCKABLE, BITE_DAMAGE);
biting = true;
biteTimer.resetTimer();
Symbol 917 MovieClip Frame 169
if (!biteTimer.timeOver(1000 + BITE_DELAY)) {
prevFrame();
play();
}
Symbol 917 MovieClip Frame 200
biting = false;
defaultEvent();
Symbol 917 MovieClip Frame 222
defaultEvent();
AIEvent();
Symbol 917 MovieClip Frame 269
cleanUp();
Symbol 917 MovieClip Frame 314
cleanUp();
Symbol 917 MovieClip Frame 359
cleanUp();
Symbol 917 MovieClip Frame 404
cleanUp();
Symbol 919 MovieClip Frame 1
if (_name == "oFlash") {
stop();
_visible = false;
}
Symbol 919 MovieClip Frame 10
removeMovieClip("");
Symbol 920 MovieClip Frame 1
if (_name == "dmgOriginal") {
stop();
_visible = false;
}
Symbol 920 MovieClip Frame 6
removeMovieClip("");
Symbol 922 MovieClip Frame 1
FADE_TIME = _parent.StrikePointProp[int(_name.subString(11, _name.length))][0];
DAMAGE_TYPE = _parent.StrikePointProp[int(_name.subString(11, _name.length))][1];
DAMAGE_LEVEL = _parent.StrikePointProp[int(_name.subString(11, _name.length))][2];
SOURCE = _parent.StrikePointProp[int(_name.subString(11, _name.length))][3];
_rotation = random(360);
if (_name == "oStrikePoint") {
stop();
_visible = false;
}
Symbol 922 MovieClip Frame 6
startTime = getTimer();
Symbol 922 MovieClip Frame 8
if ((startTime + FADE_TIME) > getTimer()) {
_alpha = ((1 - ((getTimer() - startTime) / FADE_TIME)) * 100);
prevFrame();
play();
}
Symbol 922 MovieClip Frame 9
eval ("_parent." + SOURCE).endAttack();
_parent.causeDamage(_x, _y, _xscale / 100, DAMAGE_TYPE, DAMAGE_LEVEL);
removeMovieClip("");
Symbol 924 MovieClip Frame 1
if (_name == "oSpark") {
stop();
_visible = false;
}
Symbol 924 MovieClip Frame 13
removeMovieClip("");
Symbol 925 MovieClip Frame 1
if ((_name == "splatOriginal") || (_name == "smallBlood")) {
stop();
_visible = false;
}
Symbol 925 MovieClip Frame 12
removeMovieClip("");
Symbol 930 MovieClip Frame 1
function explosion(d) {
destroyTrap();
}
function customHitTest(x, y, d, t, s) {
if (hitTest(x, y, false)) {
trapHP = trapHP - d;
if (trapHP <= 0) {
destroyTrap();
} else {
_parent.createSparks(x, y);
}
}
}
function destroyTrap() {
if (immune) {
return(undefined);
}
removeMovieClip("_parent." + attackIcon);
gotoAndPlay (56);
}
function endAttack() {
play();
}
trapTimer = new _root.Timer();
trapTimer.resetTimer();
stdHeight = _height / 2;
startDelay = (Math.random() * 40) * 250;
_parent.challengeDelay(startDelay);
attackDelay = 4000 + ((Math.random() * 20) * 100);
trapHP = 1;
if (_name == "oBambooTrap") {
stop();
_visible = false;
}
immune = false;
Symbol 930 MovieClip Frame 2
startDelay = _parent.getMinDelay(startDelay);
Symbol 930 MovieClip Frame 4
if (!trapTimer.timeOver(startDelay)) {
prevFrame();
play();
}
Symbol 930 MovieClip Frame 6
_parent.registerObject(_name);
Symbol 930 MovieClip Frame 28
if (Math.abs(_rotation) < 90) {
attackIcon = _parent.generateAttack(_x, _y - 45, 80, _name, attackDelay, 0, 2 * _root.TRAP_DIFFICULTY);
} else {
attackIcon = _parent.generateAttack(_x, _y + 45, 80, _name, attackDelay, 0, 2 * _root.TRAP_DIFFICULTY);
}
Symbol 930 MovieClip Frame 30
stop();
Symbol 930 MovieClip Frame 51
gotoAndPlay (17);
Symbol 930 MovieClip Frame 56
immune = true;
Symbol 930 MovieClip Frame 68
_parent.enemyObjectCount--;
_parent.unregisterObject(_name);
removeMovieClip("");
Symbol 931 MovieClip Frame 1
function explosion(d) {
violentReaction();
}
function violentReaction() {
_parent.createSparks(_x, _y);
_parent.enemyObjectCount--;
removeMovieClip("");
}
function endAttack() {
_parent.enemyObjectCount--;
removeMovieClip("");
}
_root.shurikenCount++;
startTime = getTimer();
startDelay = ((_root.shurikenCount % 12) * 800) + (Math.random() * 700);
_parent.challengeDelay(startDelay);
attackDelay = ((Math.random() * 100) + 1200) - ((_root.TRAP_DIFFICULTY - 1) * 200);
stdHeight = _height / 2;
_rotation = (_rotation + ((Math.random() * 40) - 20));
if (_name == "oShurikenTrap") {
stop();
_visible = false;
}
Symbol 931 MovieClip Frame 2
startDelay = _parent.getMinDelay(startDelay);
Symbol 931 MovieClip Frame 4
if ((startTime + startDelay) > getTimer()) {
prevFrame();
play();
} else {
startTime = getTimer();
_xscale = 50;
_yscale = 50;
_parent.generateAttack(_x, _y, 120, _name, attackDelay, _parent.DAMAGE_TYPE_BLOCKABLE + _parent.DAMAGE_TYPE_SLASHABLE, 1 + (_root.TRAP_DIFFICULTY * 2));
}
Symbol 931 MovieClip Frame 7
_xscale = (50 + (Math.pow((getTimer() - startTime) / attackDelay, 4) * 100));
if (_xscale > 300) {
_xscale = 300;
}
_yscale = _xscale;
prevFrame();
play();
Symbol 931 MovieClip Frame 8
stop();
Symbol 932 MovieClip Frame 1
function createThing(x, y, Thing) {
fxCount = _root.getNextLevel(fxCount, _root.FX_LOWER_LIM, _root.FX_UPPER_LIM);
duplicateMovieClip (Thing, "splat" + fxCount, fxCount);
eval ("splat" + fxCount)._x = x;
eval ("splat" + fxCount)._y = y;
}
function createBlood(x, y) {
fxCount = _root.getNextLevel(fxCount, _root.FX_LOWER_LIM, _root.FX_UPPER_LIM);
duplicateMovieClip ("splatOriginal", "splat" + fxCount, fxCount);
eval ("splat" + fxCount)._x = x;
eval ("splat" + fxCount)._y = y;
}
function createPainBlood(x, y) {
fxCount = _root.getNextLevel(fxCount, _root.FX_LOWER_LIM, _root.FX_UPPER_LIM);
duplicateMovieClip ("painSplatOriginal", "splat" + fxCount, fxCount);
eval ("splat" + fxCount)._x = x;
eval ("splat" + fxCount)._y = y;
}
function createDamage(x, y, s) {
fxCount = _root.getNextLevel(fxCount, _root.FX_LOWER_LIM, _root.FX_UPPER_LIM);
duplicateMovieClip ("dmgOriginal", "splat" + fxCount, fxCount);
eval ("splat" + fxCount)._x = x;
eval ("splat" + fxCount)._y = y;
eval ("splat" + fxCount)._xscale = s;
eval ("splat" + fxCount)._yscale = s;
}
function createSparks(x, y) {
fxCount = _root.getNextLevel(fxCount, _root.FX_LOWER_LIM, _root.FX_UPPER_LIM);
duplicateMovieClip ("oSpark", "Spark" + fxCount, fxCount);
eval ("Spark" + fxCount)._x = x;
eval ("Spark" + fxCount)._y = y;
}
function createFlash(x, y) {
fxCount = _root.getNextLevel(fxCount, _root.FX_LOWER_LIM, _root.FX_UPPER_LIM);
duplicateMovieClip ("oFlash", "Spark" + fxCount, fxCount);
eval ("Spark" + fxCount)._x = x;
eval ("Spark" + fxCount)._y = y;
}
function createShuriken(x, y) {
fxCount = _root.getNextLevel(fxCount, _root.FX_LOWER_LIM, _root.FX_UPPER_LIM);
duplicateMovieClip ("oShuriken", "Spark" + fxCount, fxCount);
eval ("Spark" + fxCount)._x = x;
eval ("Spark" + fxCount)._y = y;
}
function createGhostFlame(x, y, s) {
fxCount = _root.getNextLevel(fxCount, _root.FX_LOWER_LIM, _root.FX_UPPER_LIM);
duplicateMovieClip ("oGhostFlame", "Spark" + fxCount, fxCount);
eval ("Spark" + fxCount)._x = x;
eval ("Spark" + fxCount)._y = y;
eval ("Spark" + fxCount)._xscale = s;
eval ("Spark" + fxCount)._yscale = s;
return("Spark" + fxCount);
}
function generateAttack(x, y, s, so, ft, dt, dl) {
_root.worldTutorial.newMessage("An attack is coming up. You can try blocking it, or counter attack the source of the attack.", 15);
attackLevel = _root.getNextLevel(attackLevel, _root.ATTACK_LOWER_LIM, _root.ATTACK_UPPER_LIM);
duplicateMovieClip ("oStrikePoint", "StrikePoint" + attackLevel, attackLevel);
eval ("StrikePoint" + attackLevel)._x = x;
eval ("StrikePoint" + attackLevel)._y = y;
eval ("StrikePoint" + attackLevel)._xscale = s;
eval ("StrikePoint" + attackLevel)._yscale = s;
StrikePointProp[attackLevel][0] = ft;
StrikePointProp[attackLevel][1] = dt;
StrikePointProp[attackLevel][2] = dl;
StrikePointProp[attackLevel][3] = so;
return("StrikePoint" + attackLevel);
}
function counterStrike(x, y) {
var i = _root.ATTACK_LOWER_LIM;
while (i < _root.ATTACK_UPPER_LIM) {
if ((eval ("StrikePoint" + i)._visible && ((eval ("StrikePoint" + i).DAMAGE_TYPE & DAMAGE_TYPE_SLASHABLE) > 0)) && (_root.pointIntersectCircle(x, y, eval ("StrikePoint" + i)._x, eval ("StrikePoint" + i)._y, STRIKE_POINT_BASE_WIDTH * 2))) {
eval (eval ("StrikePoint" + i).SOURCE).violentReaction();
removeMovieClip("StrikePoint" + i);
}
i++;
}
}
function causeDamage(x, y, s, dt, dl) {
if (_root.combatCursor.getStatus() > _root.combatCursor.ST_PREPARE_SPELL) {
createThing(x, y, "ghostSplatOriginal");
return(undefined);
}
if (((dt & (DAMAGE_TYPE_BLOCKABLE > 0)) && (_root.combatCursor.isBlocking())) && (_root.combatCursor.resolveBlock(x, y, STRIKE_POINT_BASE_WIDTH * s))) {
with (_root) {
continueTutorial(CONTINUE_ATTACK_BLOCKED);
}
createSparks(x, y);
if (Math.floor(dl * 1.5) > _root.playerCurStats[2]) {
_root.autoConsumeItem();
}
if (Math.floor(dl * 1.5) <= _root.playerCurStats[2]) {
_root.playerCurStats[2] = _root.playerCurStats[2] - Math.floor(dl * 1.5);
_root.updateInterface();
return(undefined);
}
dl = dl - _root.playerCurStats[2];
_root.playerCurStats[2] = 0;
_root.worldTutorial.newMessage("Your last block blew through your Chi and you took damage. Keep your Chi high!", 30);
}
createDamage(x, y, s * 100);
_root.playerCurStats[1] = _root.playerCurStats[1] - dl;
if (_root.playerCurStats[1] <= 0) {
_root.playerCurStats[1] = 0;
_root.playerDeath();
} else {
_root.playerDamage();
}
_root.updateInterface();
}
SPARK_BASE_LEVEL = 20;
SPARK_MAX_LEVEL = 10;
sparkLevel = SPARK_BASE_LEVEL;
ATTACK_BASE_LEVEL = 10;
ATTACK_MAX_LEVEL = 10;
attackLevel = ATTACK_BASE_LEVEL;
DAMAGE_TYPE_BLOCKABLE = 1;
DAMAGE_TYPE_SLASHABLE = 2;
STRIKE_POINT_BASE_WIDTH = 20;
StrikePointProp = new Array();
i = _root.ATTACK_LOWER_LIM;
while (i < _root.ATTACK_UPPER_LIM) {
StrikePointProp[i] = new Array(4);
i++;
}
function registerObject(objName) {
objCount++;
objRec[objCount - 1] = objName;
}
function unregisterObject(objName) {
var i = 0;
while (i < objCount) {
if (objRec[i] == objName) {
objCount--;
objRec[i] = objRec[objCount];
}
i++;
}
}
function hitObject(x, y, d, t, s, custName) {
var i = 0;
while (i < objCount) {
eval (objRec[i]).customHitTest(x, y, d, t, s, custName);
i++;
}
}
function hitObjectSpecial(x, d, custName) {
var i = 0;
while (i < objCount) {
if (eval (objRec[i])._y > 200) {
eval (objRec[i]).customHitTest(x, eval (objRec[i])._y - eval (objRec[i]).stdHeight, d, false, 1, custName);
}
i++;
}
}
function explosiveAttack(d) {
var i = 0;
while (i < objCount) {
eval (objRec[i]).explosion(d);
i++;
}
var i = _root.ATTACK_LOWER_LIM;
while (i < _root.ATTACK_UPPER_LIM) {
if (eval ("StrikePoint" + i)._visible) {
eval (eval ("StrikePoint" + i).SOURCE).explosion(d);
removeMovieClip("StrikePoint" + i);
}
i++;
}
}
function crandom(n) {
return(Math.floor(Math.random() * n));
}
function getAttackX() {
return(crandom(450) + 50);
}
function getAttackY() {
return(crandom(260) + 20);
}
function getSAttackX() {
return(crandom(_root.worldESpawnFloor._width) + _root.worldESpawnFloor._x);
}
function getSAttackY() {
return(crandom((_root.worldESpawnFloor._y - _root.worldESpawnCeil._y) + _root.worldESpawnFloor._height) + _root.worldESpawnCeil._y);
}
function getCeilSpawnX() {
return(crandom(_root.worldESpawnCeil._width) + _root.worldESpawnCeil._x);
}
function getCeilSpawnY() {
return(crandom(_root.worldESpawnCeil._height) + _root.worldESpawnCeil._y);
}
function getFloorSpawnX() {
return(crandom(_root.worldESpawnFloor._width) + _root.worldESpawnFloor._x);
}
function getFloorSpawnY() {
return(crandom(_root.worldESpawnFloor._height) + _root.worldESpawnFloor._y);
}
function generateShurikenAttack(x, y) {
fxCount = _root.getNextLevel(fxCount, _root.FX_LOWER_LIM, _root.FX_UPPER_LIM);
duplicateMovieClip ("oShurikenAttack", "trap" + fxCount, fxCount);
eval ("trap" + fxCount)._x = x;
eval ("trap" + fxCount)._y = y;
}
function initSpecial(typ) {
if (typ == 0) {
enemyObjectCount = 1;
_root.ENEMY_DIFFICULTY = 1;
} else {
enemyObjectCount = 2;
_root.ENEMY_DIFFICULTY = 0;
eobjCount = _root.getNextLevel(eobjCount, _root.EOBJ_LOWER_LIM, _root.EOBJ_UPPER_LIM);
duplicateMovieClip ("oBlockade", "trap" + eobjCount, eobjCount);
eval ("trap" + eobjCount)._x = 205;
eval ("trap" + eobjCount)._y = 310;
_root.reiTarget[0] = "trap" + eobjCount;
eobjCount = _root.getNextLevel(eobjCount, _root.EOBJ_LOWER_LIM, _root.EOBJ_UPPER_LIM);
duplicateMovieClip ("oBlockade", "trap" + eobjCount, eobjCount);
eval ("trap" + eobjCount)._x = 345;
eval ("trap" + eobjCount)._y = 310;
_root.reiTarget[1] = "trap" + eobjCount;
}
}
function challengeDelay(t) {
bareMinimumDelay = Math.min(t, bareMinimumDelay);
}
function getMinDelay(sd) {
return((sd - bareMinimumDelay) + 500);
}
function initTrap(lev, typ) {
var eoc = ((crandom(lev * 2) + lev) + 1);
enemyObjectCount = enemyObjectCount + eoc;
bareMinimumDelay = 50000;
if (typ == 0) {
var i = 0;
while (i < eoc) {
eobjCount = _root.getNextLevel(eobjCount, _root.EOBJ_LOWER_LIM, _root.EOBJ_UPPER_LIM);
duplicateMovieClip ("oShurikenTrap", "trap" + eobjCount, eobjCount);
eval ("trap" + eobjCount)._x = getAttackX();
eval ("trap" + eobjCount)._y = getAttackY();
i++;
}
} else {
var trapRemoval = 0;
var i = 0;
while (i < eoc) {
if ((Math.random() < 0.5) || (_root.arenaMode)) {
eobjCount = _root.getNextLevel(eobjCount, _root.EOBJ_LOWER_LIM, _root.EOBJ_UPPER_LIM);
duplicateMovieClip ("oBambooTrap", "trap" + eobjCount, eobjCount);
eval ("trap" + eobjCount)._x = getFloorSpawnX();
eval ("trap" + eobjCount)._y = getFloorSpawnY() - 40;
} else if ((_root.Maze[_root.playerX][_root.playerY] >> 8) == 4) {
eobjCount = _root.getNextLevel(eobjCount, _root.EOBJ_LOWER_LIM, _root.EOBJ_UPPER_LIM);
duplicateMovieClip ("oBambooTrap", "trap" + eobjCount, eobjCount);
eval ("trap" + eobjCount)._x = getCeilSpawnX();
eval ("trap" + eobjCount)._y = getCeilSpawnY() + 20;
eval ("trap" + eobjCount)._rotation = 180;
} else {
trapRemoval++;
}
i++;
}
enemyObjectCount = enemyObjectCount - trapRemoval;
}
}
function initEnemy(lev) {
enemyObjectCount = enemyObjectCount + 1;
eobjCount = _root.getNextLevel(eobjCount, _root.EOBJ_LOWER_LIM, _root.EOBJ_UPPER_LIM);
if (lev == 4) {
duplicateMovieClip ("oFNinja", "enemy" + eobjCount, eobjCount);
eval ("enemy" + eobjCount)._x = getFloorSpawnX();
eval ("enemy" + eobjCount)._y = getFloorSpawnY();
} else if (lev == 2) {
duplicateMovieClip ("oWolf", "enemy" + eobjCount, eobjCount);
eval ("enemy" + eobjCount)._x = getFloorSpawnX();
eval ("enemy" + eobjCount)._y = getFloorSpawnY();
} else if (lev == 1) {
duplicateMovieClip ("oSamurai", "enemy" + eobjCount, eobjCount);
eval ("enemy" + eobjCount)._x = getFloorSpawnX();
eval ("enemy" + eobjCount)._y = getFloorSpawnY();
} else if (lev == 0) {
duplicateMovieClip ("oZombie", "enemy" + eobjCount, eobjCount);
eval ("enemy" + eobjCount)._x = getFloorSpawnX();
eval ("enemy" + eobjCount)._y = getFloorSpawnY();
if ((!_root.arenaMode) && (_root.ENEMY_DIFFICULTY > 1)) {
enemyObjectCount++;
eobjCount = _root.getNextLevel(eobjCount, _root.EOBJ_LOWER_LIM, _root.EOBJ_UPPER_LIM);
duplicateMovieClip ("oZombie", "enemy" + eobjCount, eobjCount);
eval ("enemy" + eobjCount)._x = getFloorSpawnX();
eval ("enemy" + eobjCount)._y = getFloorSpawnY();
}
} else {
duplicateMovieClip ("oNinja", "enemy" + eobjCount, eobjCount);
if (Math.random() < 0.5) {
eval ("enemy" + eobjCount)._x = _root.worldESpawnCeil._x + ((Math.random() * _root.worldESpawnCeil._width) / 5);
} else {
eval ("enemy" + eobjCount)._x = (_root.worldESpawnCeil._x + _root.worldESpawnCeil._width) - ((Math.random() * _root.worldESpawnCeil._width) / 5);
}
eval ("enemy" + eobjCount)._y = getFloorSpawnY();
}
}
objRec = new Array(EOBJ_UPPER_LIM - EOBJ_LOWER_LIM);
objCount = 0;
Instance of Symbol 803 MovieClip "shurikenMachine" in Symbol 932 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 932 MovieClip Frame 2
enemyObjectCount = 0;
stop();
Symbol 939 MovieClip Frame 1
stop();
Symbol 939 MovieClip Frame 10
_root.hideSpace();
stop();
Symbol 939 MovieClip Frame 11
_root.showSpace();
Symbol 945 MovieClip Frame 1
stop();
Symbol 946 Button
on (rollOver) {
_root.worldTutorial.newMessage("Click here or press 'M' to show the mini-map.", 25);
}
on (press, keyPress "m") {
if (!_root.inCombat) {
_root.autoMap = true;
play();
}
}
on (keyPress "M") {
if (!_root.inCombat) {
_root.autoMap = true;
play();
}
}
Symbol 947 Button
on (rollOver) {
_root.worldTutorial.newMessage("Click here or press 'M' to hide the mini-map. Press 'F' to show the full map.", 25);
}
on (press, keyPress "m") {
_root.autoMap = false;
play();
}
on (keyPress "M") {
_root.autoMap = false;
play();
}
Symbol 948 MovieClip Frame 1
isOpen = false;
stop();
Symbol 948 MovieClip Frame 15
if (!_root.inCombat) {
_root.showAutoMap();
isOpen = true;
stop();
}
Symbol 948 MovieClip Frame 16
_root.hideAutoMap();
Symbol 959 MovieClip Frame 1
stop();
Symbol 964 MovieClip Frame 1
stop();
Symbol 964 MovieClip Frame 2
gotoAndPlay("tease" + Math.floor(Math.random() * 3));
Symbol 964 MovieClip Frame 12
gotoAndStop (1);
Symbol 964 MovieClip Frame 22
gotoAndStop (1);
Symbol 964 MovieClip Frame 32
gotoAndStop (1);
Symbol 976 MovieClip Frame 1
stop();
Symbol 978 MovieClip Frame 1
function stopTease() {
_visible = false;
with (_root) {
releaseHandle();
playerX = ox;
playerY = oy;
worldPortrait.gotoAndStop(10 - Math.floor((playerCurStats[1] / playerMaxStats[1]) * 10));
renderSpace(PlayerX, PlayerY, PlayerT);
}
gotoAndStop (1);
}
stop();
Symbol 978 MovieClip Frame 2
_visible = true;
_root.takeHandle();
teaseTimer = new _root.Timer();
teaseSound.play();
teaseText.gotoAndStop(Math.ceil(Math.random() * 4));
if (_root.playerEpisode == 0) {
newbieNote._visible = true;
} else {
newbieNote._visible = false;
}
Symbol 978 MovieClip Frame 4
if (teaseTimer.timeOver(3500)) {
stopTease();
} else {
prevFrame();
play();
}
Symbol 981 MovieClip Frame 1
function stopTease() {
_visible = false;
with (_root) {
releaseHandle();
}
gotoAndStop (1);
}
stop();
Symbol 981 MovieClip Frame 2
if ((_root.scrollsFound < _root.SCROLLS_HIDDEN) || (_root.headsFound < _root.BOSSES_HIDDEN)) {
_visible = true;
_root.takeHandle();
teaseTimer = new _root.Timer();
} else {
if (_root.TUTORIAL) {
_root.gotoScene = "sceneMainMenu";
} else {
_root.gotoScene = "sceneStoryline";
}
_root.preMission = false;
}
Symbol 981 MovieClip Frame 4
if (teaseTimer.timeOver(6000)) {
stopTease();
} else {
prevFrame();
play();
}
Symbol 1033 MovieClip Frame 1
lastBishojo = 0;
stop();
Instance of Symbol 414 MovieClip "sprites" in Symbol 1033 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 1041 MovieClip Frame 1
stop();
Symbol 1047 MovieClip Frame 1
stop();
Symbol 1051 MovieClip Frame 1
stop();
Symbol 1054 MovieClip Frame 1
stop();
Symbol 1058 MovieClip Frame 1
stop();
Symbol 1061 MovieClip Frame 1
stop();
Symbol 1062 MovieClip Frame 1
stop();
Symbol 1065 Button
on (release) {
_root.gotoScene = "sceneMainMenu";
_root.gotoAndPlay("sceneCancel");
}
Symbol 1079 MovieClip Frame 1
function nextWave() {
wave++;
_root.shurikenCount = 0;
_root.TRAP_DIFFICULTY = 1;
_root.ENEMY_DIFFICULTY = Math.min(3, Math.floor((wave - 1) / 20) + 1);
bambooDelay = -1;
bambooWaves = 0;
shurikenDelay = -1;
shurikenWaves = 0;
zombieCount = 0;
samuraiCount = 0;
wolfCount = 0;
ninjaCount = 0;
bossCount = 0;
title = "Wave " + wave;
subtitle = "";
switch (wave) {
case 1 :
subtitle = "Target Practice";
zombieCount = 1;
break;
case 2 :
subtitle = "Danger Room";
shurikenDelay = 1000;
shurikenWaves = 1;
bambooDelay = 0;
bambooWaves = 1;
break;
case 3 :
subtitle = "The Samurai";
samuraiCount = 1;
break;
case 4 :
subtitle = "The Wolf";
wolfCount = 1;
break;
case 5 :
subtitle = "The Ninja";
ninjaCount = 1;
break;
case 6 :
subtitle = "Swords and Traps";
samuraiCount = 1;
bambooDelay = 3000;
bambooWaves = 1;
break;
case 7 :
subtitle = "Resident Evil Time";
zombieCount = 3;
break;
case 8 :
subtitle = "Ninja and His Slave";
ninjaCount = 1;
zombieCount = 1;
break;
case 9 :
subtitle = "Shuriken Fever";
shurikenDelay = 0;
shurikenWaves = 3;
break;
case 10 :
subtitle = "The Hidden Ninja";
shurikenDelay = 6000;
shurikenWaves = 3;
samuraiCount = 1;
break;
case 11 :
subtitle = "One Ninja, Lots of Shurikens";
ninjaCount = 1;
shurikenDelay = 6000;
shurikenWaves = 8;
break;
case 12 :
subtitle = "The Companions";
samuraiCount = 1;
wolfCount = 1;
break;
case 13 :
subtitle = "Samurai Rush";
samuraiCount = 2;
break;
case 14 :
subtitle = "Wolf Pack";
wolfCount = 2;
break;
case 15 :
subtitle = "Red Fox";
bossCount = 1;
break;
case 16 :
subtitle = "The Undead Gang";
samuraiCount = 1;
zombieCount = 2;
break;
case 17 :
subtitle = "Hmm, Ninjas";
ninjaCount = 2;
break;
case 18 :
subtitle = "Gotta Catch Em All";
shurikenDelay = 0;
shurikenWaves = 5;
break;
case 19 :
subtitle = "Deadly Combo";
samuraiCount = 1;
ninjaCount = 1;
bambooDelay = 6000;
bambooWaves = 6;
break;
case 20 :
subtitle = "Two Animals And A Funeral";
wolfCount = 2;
zombieCount = 1;
break;
case 21 :
subtitle = "Undead Premium";
zombieCount = 2;
break;
case 22 :
subtitle = "Samurai Boss";
samuraiCount = 1;
bambooDelay = 12000;
bambooWaves = 6;
break;
case 23 :
subtitle = "Alpha Wolf";
wolfCount = 1;
shurikenDelay = 12000;
shurikenWaves = 6;
break;
case 24 :
subtitle = "Ninja Boss";
ninjaCount = 1;
bambooDelay = 12000;
bambooWaves = 6;
break;
case 25 :
subtitle = "Blood Fang";
bossCount = 1;
break;
case 26 :
_root.gotoScene = "sceneFinishArena";
}
if (subtitle.length > 0) {
countingDown = true;
_root.worldCombatSpace.enemyObjectCount = 1;
gotoAndPlay (3);
}
}
wave = 0;
bambooTimer = new _root.Timer();
shurikenTimer = new _root.Timer();
stop();
Symbol 1079 MovieClip Frame 64
countingDown = false;
_root.worldCombatSpace.enemyObjectCount = 0;
bambooTimer.resetTimer();
shurikenTimer.resetTimer();
if (bambooDelay == 0) {
while (bambooWaves > 0) {
bambooWaves--;
_root.worldCombatSpace.initTrap(_root.TRAP_DIFFICULTY, 1);
}
}
if (shurikenDelay == 0) {
while (shurikenWaves > 0) {
shurikenWaves--;
_root.worldCombatSpace.initTrap(_root.TRAP_DIFFICULTY, 0);
}
}
i = 0;
while (i < wolfCount) {
_root.worldCombatSpace.initEnemy(2);
i++;
}
i = 0;
while (i < zombieCount) {
_root.worldCombatSpace.initEnemy(0);
i++;
}
i = 0;
while (i < samuraiCount) {
_root.worldCombatSpace.initEnemy(1);
i++;
}
i = 0;
while (i < ninjaCount) {
_root.worldCombatSpace.initEnemy(3);
i++;
}
i = 0;
while (i < bossCount) {
_root.worldCombatSpace.initEnemy(4);
i++;
}
Symbol 1079 MovieClip Frame 67
if (!countingDown) {
if (((bambooDelay != -1) && (bambooWaves > 0)) && (bambooTimer.timeOver(bambooDelay))) {
bambooWaves--;
bambooTimer.resetTimer();
_root.worldCombatSpace.initTrap(_root.TRAP_DIFFICULTY, 1);
}
if (((shurikenDelay != -1) && (shurikenWaves > 0)) && (shurikenTimer.timeOver(shurikenDelay))) {
shurikenWaves--;
shurikenTimer.resetTimer();
_root.shurikenCount = 0;
_root.worldCombatSpace.initTrap(_root.TRAP_DIFFICULTY, 0);
}
prevFrame();
play();
} else {
gotoAndPlay (3);
}
Symbol 1084 MovieClip Frame 1
function clickStopWatch() {
stopTime = true;
return((((minu + ":") + sec) + ":") + milsec);
}
gameTimer = new _root.Timer();
stopTime = false;
Symbol 1084 MovieClip Frame 3
if (!stopTime) {
timeDiff = gameTimer.getTimeDifference();
minu = Math.floor(timeDiff / 60000);
if (minu < 10) {
minu = "0" + minu;
}
sec = Math.floor((timeDiff % 60000) / 1000);
if (sec < 10) {
sec = "0" + sec;
}
milsec = Math.floor((timeDiff % 1000) / 10);
if (milsec < 10) {
milsec = "0" + milsec;
}
prevFrame();
play();
} else {
stop();
}
Symbol 1111 Button
on (release) {
nextFrame();
}
Symbol 1114 MovieClip Frame 1
if (_root.playerEpisode == 1) {
stop();
}
Symbol 1114 MovieClip Frame 2
stop();
Symbol 1115 Button
on (release) {
_root.play();
}
Symbol 1123 Button
on (release) {
stopAllSounds();
_root.gotoAndPlay("sceneMainMenu");
}
Symbol 1143 MovieClip Frame 70
stop();
Symbol 1144 Button
on (release) {
_root.gotoScene = "sceneMainMenu";
}
Symbol 1155 MovieClip Frame 619
stop();
Symbol 1157 MovieClip Frame 1
function cleanBuffer() {
var i = 0;
while (i < bufferSize) {
buffer[i] = 0;
i++;
}
bufferCleared = true;
}
function pushBuffer(keyCode) {
var i = (bufferSize - 1);
while (i > 0) {
buffer[i] = buffer[i - 1];
i--;
}
buffer[0] = keyCode;
}
function popBuffer() {
return(buffer[0]);
}
function checkBuffer(move3, move2, move1, move0) {
return((((move0 == buffer[0]) && (move1 == buffer[1])) && (move2 == buffer[2])) && (move3 == buffer[3]));
}
function sendCommandMessage(msg) {
_parent.Command.recieveMessage(msg);
}
disabled = false;
bodyWidth = 50;
attackOffset = 50;
walkingOffset = 15;
verticalOffset = 15;
standByInterval = 200;
target = "Nothing";
approach = "Nothing";
strategy = "StandBy";
xDiff = 0;
yDiff = 0;
distance = 0;
standByTimer = 0;
Symbol 1157 MovieClip Frame 3
if (!disabled) {
if ((_parent.Command.getState() == "recovering") || (target == "Nothing")) {
target = _root.heroSubscriber[random(_root.heroTotalSubscribers)];
if (random(100) < 50) {
approach = "Left";
} else {
approach = "Right";
}
strategy = "StandBy";
}
xDiff = _parent._x - eval ("_root." + target)._x;
yDiff = _parent._y - eval ("_root." + target)._y;
distance = parseInt(Math.sqrt((xDiff * xDiff) + (yDiff * yDiff)));
if ((Math.abs(yDiff) <= verticalOffset) && (Math.abs(xDiff) <= ((bodyWidth * 2) + attackOffset))) {
if ((_parent.Sprite.getDirection() == "Left") && (xDiff < 0)) {
sendCommandMessage("Right");
} else if ((_parent.Sprite.getDirection() == "Right") && (xDiff > 0)) {
sendCommandMessage("Left");
} else {
sendCommandMessage("Punch");
}
} else if (strategy == "VerticalApproach") {
if (yDiff > verticalOffset) {
sendCommandMessage("Up");
} else if (yDiff < (-verticalOffset)) {
sendCommandMessage("Down");
} else if (random(100) < 25) {
strategy = "StandBy";
} else {
strategy = "HorizontalApproach";
}
} else if (strategy == "HorizontalApproach") {
if (approach == "Left") {
if (math.random() < 0.005) {
strategy = "StandBy";
} else if (((xDiff + bodyWidth) + attackOffset) > walkingOffset) {
sendCommandMessage("Left");
} else if (((xDiff + bodyWidth) + attackOffset) < (-walkingOffset)) {
sendCommandMessage("Right");
} else {
strategy = "VerticalApproach";
}
} else if (approach == "Right") {
if (math.random() < 0.005) {
strategy = "StandBy";
} else if (((xDiff - bodyWidth) - attackOffset) > walkingOffset) {
sendCommandMessage("Left");
} else if (((xDiff - bodyWidth) - attackOffset) < (-walkingOffset)) {
sendCommandMessage("Right");
} else {
strategy = "VerticalApproach";
}
}
} else if (strategy == "StandBy") {
strategy = "StandByWaiting";
standByTimer = getTimer();
} else if ((strategy == "StandByWaiting") && ((standByTimer + standByInterval) < getTimer())) {
if (Distance < (bodyWidth * 2)) {
strategy = "HorizontalApproach";
} else if (random(4) == 0) {
strategy = "HorizontalApproach";
} else {
strategy = "StandBy";
}
}
}
Symbol 1157 MovieClip Frame 4
prevFrame();
play();
Symbol 1158 MovieClip Frame 1
function recieveMessage(msg) {
var i = (bufferSize - 1);
while (i > 0) {
buffer[i] = buffer[i - 1];
i--;
}
buffer[0] = msg;
}
function processMessage() {
var msg = buffer[0];
var i = 0;
while (i < (bufferSize - 1)) {
buffer[i] = buffer[i + 1];
i++;
}
buffer[bufferSize - 1] = "";
return(msg);
}
function messageEmpty() {
return(buffer[0] == "");
}
function cleanBuffer() {
var i = 0;
while (i < bufferSize) {
buffer[i] = "";
i++;
}
}
function getState() {
return(state);
}
function sendSpriteMessage(msg) {
_parent.Sprite.recieveMessage(msg);
}
function sendSpriteState(frame) {
_parent.Sprite.Set.gotoAndPlay(frame);
}
function spriteTranslate(x, y) {
_parent._x = _parent._x + x;
if ((_parent._y + y) > _root.getBoundBottom()) {
_parent._y = _root.getBoundBottom();
} else if ((_parent._y + y) < _root.getBoundTop()) {
_parent._y = _root.getBoundTop();
} else {
_parent._y = _parent._y + y;
}
}
function spriteTakesDamage(amount) {
health = health - amount;
}
function spriteWalk(x, y) {
if (x < 0) {
sendSpriteMessage("Left");
} else if (x > 0) {
sendSpriteMessage("Right");
}
if (state != "walking") {
sendSpriteState("Movement");
state = "walking";
}
attackState = "Nothing";
spriteTranslate(x, y);
}
function spriteStand() {
if (state != "standing") {
sendSpriteState("StandStill");
state = "standing";
ready = true;
conscious = true;
}
attackState = "Nothing";
}
function spriteAttack(newState) {
state = "attacking";
attackState = newState;
ready = false;
sendSpriteState(newState);
}
function spriteAttackComboWait() {
state = "waiting";
ready = true;
waitTimer = getTimer();
}
function spritePain(painState) {
state = "hurting";
ready = false;
conscious = false;
spriteTakesDamage(1);
if ((health <= 0) && (painState == "Punch2")) {
spriteFall();
} else if (painState == "Punch1") {
sendSpriteState("Pain1");
} else if (painState == "Punch2") {
sendSpriteState("Pain2");
}
}
function spriteFall() {
state = "fallen";
ready = false;
conscious = false;
spriteTakesDamage(2);
sendSpriteState("Fall");
}
function spriteRecover() {
state = "recovering";
sendSpriteState("Recover");
}
function spriteFade() {
state = "fading";
_root.masterRemove(_parent._name);
_root.villianRemove(_parent._name);
}
function spriteFallBack(x) {
if (_parent.Sprite.getDirection() == "Left") {
spriteTranslate(x, 0);
} else {
spriteTranslate(-x, 0);
}
}
function spriteContinuousFallBack() {
state = "falling";
}
function spriteStopFallBack() {
state = "fallen";
}
if (_parent._name == "oZombie") {
stop();
disabled = true;
_parent._visible = false;
} else {
disabled = false;
_root.masterSubscribe(_parent._name);
_root.villianSubscribe(_parent._name);
}
state = "standing";
attackState = "Nothing";
ready = true;
conscious = true;
health = 6;
buffer = new Array();
bufferSize = 4;
waitTimer = 0;
attackWait = 500;
Symbol 1158 MovieClip Frame 2
cleanBuffer();
Symbol 1158 MovieClip Frame 3
if (!disabled) {
if ((state == "waiting") && ((waitTimer + attackWait) < getTimer())) {
spriteStand();
}
if (state == "falling") {
spriteFallBack(15);
}
if (state == "fading") {
if (_parent._alpha > 0) {
_parent._alpha = _parent._alpha - 10;
} else {
_root.masterRemove(_parent._name);
_root.villianRemove(_parent._name);
_parent.removeMovieClip("");
}
}
if (messageEmpty()) {
if (ready) {
if (state == "walking") {
spriteStand();
}
}
} else {
while (!messageEmpty()) {
var incoming = processMessage();
if (conscious) {
if (((incoming == "Punch1") || (incoming == "Punch2")) || (incoming == "Punch3")) {
sendSpriteMessage(processMessage());
spriteFall();
}
}
if (ready && (conscious)) {
if (incoming == "Left") {
spriteWalk(-5, 0);
}
if (incoming == "Right") {
spriteWalk(5, 0);
}
if (incoming == "Up") {
spriteWalk(0, -5);
}
if (incoming == "Down") {
spriteWalk(0, 5);
}
if (incoming == "Punch") {
if (attackState == "Nothing") {
spriteAttack("Punch1");
} else if (attackState == "Punch1") {
spriteAttack("Punch2");
} else if (attackState == "Punch2") {
spriteAttack("Punch3");
}
}
}
if (incoming == "Strike") {
if (_parent.Sprite.getDirection() == "Left") {
_root.heroCollisionBoardcast(_parent.Sprite.getAttackShadow(), attackState, "Right");
} else {
_root.heroCollisionBoardcast(_parent.Sprite.getAttackShadow(), attackState, "Left");
}
}
if (incoming == "FallBack") {
spriteFallBack(15);
}
if (incoming == "ContinuousFallBack") {
spriteContinuousFallBack();
}
if (incoming == "StopFallBack") {
spriteStopFallBack();
}
if (incoming == "Ready") {
if (state == "attacking") {
spriteAttackComboWait();
} else if (state == "hurting") {
spriteStand();
} else if (state == "fallen") {
spriteFade();
} else if (state == "recovering") {
spriteStand();
}
}
}
}
}
Symbol 1158 MovieClip Frame 4
prevFrame();
play();
Symbol 1166 MovieClip Frame 24
gotoAndPlay (1);
Symbol 1166 MovieClip Frame 44
gotoAndPlay (25);
Symbol 1166 MovieClip Frame 54
_parent.sendCommandMessage("Strike");
Symbol 1166 MovieClip Frame 59
_parent.sendCommandMessage("Ready");
stop();
Symbol 1166 MovieClip Frame 68
_parent.sendCommandMessage("Strike");
Symbol 1166 MovieClip Frame 77
_parent.sendCommandMessage("Ready");
stop();
Symbol 1166 MovieClip Frame 84
_parent.sendCommandMessage("Strike");
Symbol 1166 MovieClip Frame 92
_parent.sendCommandMessage("Ready");
stop();
Symbol 1166 MovieClip Frame 115
_parent.sendCommandMessage("Ready");
stop();
Symbol 1169 MovieClip Frame 1
function recieveMessage(msg) {
var frameSwitch;
if ((msg == "Left") && (facing == "Right")) {
_parent._xscale = 100;
facing = "Left";
}
if ((msg == "Right") && (facing == "Left")) {
_parent._xscale = -100;
facing = "Right";
}
}
function getDirection() {
return(facing);
}
function sendCommandMessage(msg) {
_parent.Command.recieveMessage(msg);
}
function getShadow() {
return(("_root." + _parent._name) + ".Sprite.Shadow");
}
function getAttackShadow() {
return(("_root." + _parent._name) + ".Sprite.Set.AttackShadow");
}
facing = "Left";
Symbol 1169 MovieClip Frame 2
stop();
Symbol 1171 MovieClip Frame 1
function cleanBuffer() {
var i = 0;
while (i < bufferSize) {
buffer[i] = 0;
i++;
}
bufferCleared = true;
}
function pushBuffer(keyCode) {
var i = (bufferSize - 1);
while (i > 0) {
buffer[i] = buffer[i - 1];
i--;
}
buffer[0] = keyCode;
}
function popBuffer() {
return(buffer[0]);
}
function checkBuffer(move3, move2, move1, move0) {
return((((move0 == buffer[0]) && (move1 == buffer[1])) && (move2 == buffer[2])) && (move3 == buffer[3]));
}
function sendCommandMessage(msg) {
_parent.Command.recieveMessage(msg);
}
disabled = false;
buffer = new Array();
bufferSize = 4;
bufferCleared = true;
bufferClearTimer = 0;
bufferClearDelay = 300;
keyMoveLeft = 37;
keyMoveUp = 38;
keyMoveRight = 39;
keyMoveDown = 40;
keyPunch = 32;
keyKick = 88;
Symbol 1171 MovieClip Frame 3
if (!disabled) {
if ((!bufferCleared) && ((bufferClearTimer + bufferClearDelay) < getTimer())) {
cleanBuffer();
}
var inputKey = 0;
if (Key.isDown(keyMoveLeft)) {
inputKey = keyMoveLeft;
sendCommandMessage("Left");
} else if (Key.isDown(keyMoveRight)) {
inputKey = keyMoveRight;
sendCommandMessage("Right");
}
if (Key.isDown(keyMoveUp)) {
inputKey = keyMoveUp;
sendCommandMessage("Up");
} else if (Key.isDown(keyMoveDown)) {
inputKey = keyMoveDown;
sendCommandMessage("Down");
}
if (Key.isDown(keyPunch)) {
inputKey = keyPunch;
}
if (Key.isDown(keyKick)) {
inputKey = keyKick;
}
if ((inputKey != 0) && (popBuffer() != inputKey)) {
if (bufferCleared) {
bufferCleared = false;
}
bufferClearTimer = getTimer();
pushBuffer(inputKey);
}
if (checkBuffer(keyMoveLeft, keyMoveDown, keyMoveRight, keyPunch) || (checkBuffer(keyMoveRight, keyMoveDown, keyMoveLeft, keyPunch))) {
sendCommandMessage("Dragon Blade");
} else if ((inputKey == keyPunch) && (popBuffer() == keyPunch)) {
sendCommandMessage("Punch");
} else if ((inputKey == keyKick) && (popBuffer() == keyKick)) {
sendCommandMessage("Kick");
}
}
Symbol 1171 MovieClip Frame 4
prevFrame();
play();
Symbol 1172 MovieClip Frame 1
function recieveMessage(msg) {
var i = (bufferSize - 1);
while (i > 0) {
buffer[i] = buffer[i - 1];
i--;
}
buffer[0] = msg;
}
function processMessage() {
var msg = buffer[0];
var i = 0;
while (i < (bufferSize - 1)) {
buffer[i] = buffer[i + 1];
i++;
}
buffer[bufferSize - 1] = "";
return(msg);
}
function messageEmpty() {
return(buffer[0] == "");
}
function cleanBuffer() {
var i = 0;
while (i < bufferSize) {
buffer[i] = "";
i++;
}
}
function sendSpriteMessage(msg) {
_parent.Sprite.recieveMessage(msg);
}
function sendSpriteState(frame) {
_parent.Sprite.Set.gotoAndPlay(frame);
}
function spriteTranslate(x, y) {
if ((_parent._x + x) > _root.getBoundRight()) {
_parent._x = _root.getBoundRight();
} else if ((_parent._x + x) < _root.getBoundLeft()) {
_parent._x = _root.getBoundLeft();
} else {
_parent._x = _parent._x + x;
}
if ((_parent._y + y) > _root.getBoundBottom()) {
_parent._y = _root.getBoundBottom();
} else if ((_parent._y + y) < _root.getBoundTop()) {
_parent._y = _root.getBoundTop();
} else {
_parent._y = _parent._y + y;
}
}
function spriteTakesDamage(amount) {
}
function spriteWalk(x, y) {
if (x < 0) {
sendSpriteMessage("Left");
} else if (x > 0) {
sendSpriteMessage("Right");
}
if (state != "walking") {
sendSpriteState("Movement");
state = "walking";
}
attackState = "Nothing";
spriteTranslate(x, y);
}
function spriteStand() {
if (state != "standing") {
sendSpriteState("StandStill");
ready = true;
conscious = true;
state = "standing";
}
attackState = "Nothing";
}
function spriteAttack(newState) {
state = "attacking";
attackState = newState;
ready = false;
sendSpriteState(newState);
}
function spriteAttackComboWait() {
state = "waiting";
ready = true;
waitTimer = getTimer();
}
function spritePain(painState) {
state = "hurting";
ready = false;
conscious = false;
spriteTakesDamage(1);
if ((health <= 0) && (painState == "Punch2")) {
spriteFall();
}
if (painState == "Punch1") {
sendSpriteState("Pain2");
} else if (painState == "Punch2") {
sendSpriteState("Pain1");
}
}
function spriteFall() {
state = "hurting";
ready = false;
conscious = false;
spriteTakesDamage(2);
sendSpriteState("Fall");
}
function spriteRecover() {
state = "recovering";
sendSpriteState("Recover");
}
function spriteFade() {
state = "fading";
_root.masterRemove(_parent._name);
_root.heroRemove(_parent._name);
}
function spriteFallBack(x) {
if (_parent.Sprite.getDirection() == "Left") {
spriteTranslate(x, 0);
} else {
spriteTranslate(-x, 0);
}
}
function spriteContinuousFallBack() {
state = "falling";
}
function spriteStopFallBack() {
state = "fallen";
}
if (_parent._name == "oGenyu") {
stop();
_parent._visible = false;
disabled = true;
} else {
disabled = false;
_root.masterSubscribe(_parent._name);
_root.heroSubscribe(_parent._name);
}
state = "standing";
attackState = "Nothing";
ready = true;
conscious = true;
health = 25;
buffer = new Array();
bufferSize = 10;
waitTimer = 0;
attackWait = 222.222222222222;
Symbol 1172 MovieClip Frame 2
cleanBuffer();
Symbol 1172 MovieClip Frame 3
if (!disabled) {
if ((state == "waiting") && ((waitTimer + attackWait) < getTimer())) {
spriteStand();
}
if (state == "falling") {
spriteFallBack(20);
}
if (state == "fading") {
if (_parent._alpha > 0) {
_parent._alpha = _parent._alpha - 10;
} else {
disabled = true;
}
}
if (messageEmpty()) {
if (ready) {
if (state == "walking") {
spriteStand();
}
}
} else {
while (!messageEmpty()) {
var incoming = processMessage();
if (conscious) {
if ((incoming == "Punch1") || (incoming == "Punch2")) {
sendSpriteMessage(processMessage());
spritePain(incoming);
}
if (incoming == "Punch3") {
sendSpriteMessage(processMessage());
spriteFall();
}
}
if (ready && (conscious)) {
if (incoming == "Left") {
spriteWalk(-10, 0);
}
if (incoming == "Right") {
spriteWalk(10, 0);
}
if (incoming == "Up") {
spriteWalk(0, -10);
}
if (incoming == "Down") {
spriteWalk(0, 10);
}
if (incoming == "Punch") {
if (attackState == "Nothing") {
spriteAttack("Punch1");
} else if (attackState == "Punch1") {
spriteAttack("Punch2");
} else if (attackState == "Punch2") {
spriteAttack("Punch3");
}
}
}
if (incoming == "Strike") {
if (_parent.Sprite.getDirection() == "Left") {
_root.villianCollisionBoardcast(_parent.Sprite.getAttackShadow(), attackState, "Right");
} else {
_root.villianCollisionBoardcast(_parent.Sprite.getAttackShadow(), attackState, "Left");
}
}
if (incoming == "FallBack") {
spriteFallBack(3);
}
if (incoming == "ContinuousFallBack") {
spriteContinuousFallBack();
}
if (incoming == "StopFallBack") {
spriteStopFallBack();
}
if (incoming == "Ready") {
if (state == "attacking") {
spriteAttackComboWait();
} else if (state == "hurting") {
spriteStand();
} else if (state == "fallen") {
if (health > 0) {
spriteRecover();
} else {
spriteFade();
}
} else if (state == "recovering") {
spriteStand();
}
}
}
}
}
Symbol 1172 MovieClip Frame 4
prevFrame();
play();
Symbol 1177 MovieClip Frame 16
gotoAndPlay (1);
Symbol 1177 MovieClip Frame 43
gotoAndPlay (20);
Symbol 1177 MovieClip Frame 49
_parent.sendCommandMessage("Strike");
Symbol 1177 MovieClip Frame 53
_parent.sendCommandMessage("Ready");
Symbol 1177 MovieClip Frame 64
_parent.sendCommandMessage("Strike");
Symbol 1177 MovieClip Frame 68
_parent.sendCommandMessage("Ready");
Symbol 1177 MovieClip Frame 73
_parent.recieveMessage("turnAround");
Symbol 1177 MovieClip Frame 80
_parent.sendCommandMessage("Strike");
Symbol 1177 MovieClip Frame 83
_parent.sendCommandMessage("Ready");
Symbol 1177 MovieClip Frame 87
stop();
Symbol 1177 MovieClip Frame 90
_parent.sendCommandMessage("FallBack");
Symbol 1177 MovieClip Frame 98
_parent.sendCommandMessage("Ready");
stop();
Symbol 1177 MovieClip Frame 124
_parent.sendCommandMessage("ContinuousFallBack");
Symbol 1177 MovieClip Frame 125
_parent.sendCommandMessage("StopFallBack");
Symbol 1177 MovieClip Frame 126
_parent.sendCommandMessage("Ready");
stop();
Symbol 1177 MovieClip Frame 138
_parent.sendCommandMessage("Ready");
stop();
Symbol 1178 MovieClip Frame 1
function recieveMessage(msg) {
var frameSwitch;
if ((msg == "Left") && (facing == "Right")) {
_parent._xscale = 100;
facing = "Left";
}
if ((msg == "Right") && (facing == "Left")) {
_parent._xscale = -100;
facing = "Right";
}
if ((msg == "turnAround") && (facing == "Right")) {
_parent._xscale = 100;
facing = "Left";
} else if ((msg == "turnAround") && (facing == "Left")) {
_parent._xscale = -100;
facing = "Right";
}
}
function getDirection() {
return(facing);
}
function sendCommandMessage(msg) {
_parent.Command.recieveMessage(msg);
}
function getShadow() {
return(("_root." + _parent._name) + ".Sprite.Shadow");
}
function getAttackShadow() {
return(("_root." + _parent._name) + ".Sprite.Set.AttackShadow");
}
facing = "Left";
Symbol 1178 MovieClip Frame 2
stop();