Frame 3
stop();
Main.main(this);
Symbol 13 MovieClip Frame 12
gotoAndPlay (1);
Symbol 25 MovieClip Frame 30
gotoAndPlay (1);
Symbol 28 MovieClip [lib_preloader] Frame 1
stop();
this.onEnterFrame = function () {
var _local3 = 0;
if (_root.getBytesTotal() > 0) {
_local3 = _root.getBytesLoaded() / _root.getBytesTotal();
}
var _local4 = Math.round(_local3 * 100);
done_txt.text = ("" + _local4) + "%";
if (_local3 == 1) {
this.onEnterFrame = null;
gotoAndPlay (2);
}
};
Symbol 28 MovieClip [lib_preloader] Frame 40
MainPreloader.onFullLoaded(this);
Symbol 30 MovieClip [__Packages.MainPreloader] Frame 0
class MainPreloader
{
function MainPreloader () {
}
static function init() {
_root.stop();
_root.onEnterFrame = init_update;
return(true);
}
static function init_update() {
_root.onEnterFrame = null;
var _local2 = _root.attachMovie("lib_preloader", "preloader", _root.getNextHighestDepth());
}
static function onFullLoaded(preloader) {
preloader.removeMovieClip();
_root.play();
}
//ASSetPropFlags(_local1, null, 1);
static var initDone = init();
}
Symbol 34 MovieClip Frame 1
this._visible = false;
Symbol 44 MovieClip [obj_torch] Frame 1
stop();
Symbol 140 MovieClip Frame 31
stop();
Symbol 143 MovieClip Frame 31
stop();
Symbol 146 MovieClip Frame 31
stop();
Symbol 149 MovieClip Frame 31
stop();
Symbol 157 MovieClip Frame 8
stop();
Symbol 166 MovieClip Frame 31
stop();
Symbol 175 MovieClip Frame 7
stop();
Symbol 185 MovieClip Frame 29
stop();
Symbol 189 MovieClip [lib_extreme_death] Frame 31
stop();
Symbol 191 MovieClip [lib_blood_pool] Frame 1
stop();
Symbol 191 MovieClip [lib_blood_pool] Frame 36
stop();
Symbol 279 MovieClip Frame 41
stop();
Symbol 281 MovieClip Frame 1
_visible = false;
Symbol 282 MovieClip [lib_smoke] Frame 1
mSound = "weapons_smokegrenade.aif";
Symbol 282 MovieClip [lib_smoke] Frame 41
stop();
Symbol 288 MovieClip [lib_windmill] Frame 1
mSound = "weapons_smokegrenade.aif";
Symbol 288 MovieClip [lib_windmill] Frame 4
stop();
Symbol 291 MovieClip Frame 12
stop();
Symbol 292 MovieClip [lib_senbon_multi] Frame 1
mSound = "weapons_senbon.aif";
Symbol 292 MovieClip [lib_senbon_multi] Frame 13
stop();
Symbol 298 MovieClip [lib_shuriken] Frame 1
mSound = "weapons_shuriken.aif";
Symbol 298 MovieClip [lib_shuriken] Frame 24
stop();
Symbol 301 MovieClip Frame 15
stop();
Symbol 302 MovieClip [lib_kunai_multi] Frame 1
mSound = "weapons_kunai.aif";
Symbol 302 MovieClip [lib_kunai_multi] Frame 15
stop();
Symbol 304 MovieClip [lib_knife] Frame 24
stop();
Symbol 306 MovieClip [lib_crossarrow] Frame 18
stop();
Symbol 340 MovieClip Frame 1
stop();
Symbol 349 MovieClip Frame 1
mWalkSound = "naruto_run.aif";
Symbol 352 MovieClip Frame 1
this.moveX = 0;
Symbol 352 MovieClip Frame 2
this.moveX = 5;
Symbol 352 MovieClip Frame 3
this.moveX = 3;
Symbol 352 MovieClip Frame 4
this.moveX = 1;
Symbol 352 MovieClip Frame 5
this.moveX = 0;
Symbol 355 MovieClip Frame 8
stop();
Symbol 362 MovieClip Frame 1
mSound = "naruto_fall.aif";
Symbol 362 MovieClip Frame 19
stop();
Symbol 380 MovieClip Frame 5
stop();
Symbol 381 MovieClip Frame 1
mSound = "naruto_spinning_hookkick.aif";
Symbol 395 MovieClip Frame 4
this.moveX = 19;
mSound = "new_naruto_1000hits.aif";
Symbol 395 MovieClip Frame 14
this.moveX = 12;
Symbol 395 MovieClip Frame 19
this.moveX = 6;
Symbol 395 MovieClip Frame 22
this.moveX = 19;
Symbol 395 MovieClip Frame 27
this.moveX = 14;
Symbol 395 MovieClip Frame 31
this.moveX = 5;
Symbol 395 MovieClip Frame 33
this.moveX = 2;
Symbol 395 MovieClip Frame 34
this.moveX = 1;
Symbol 416 MovieClip Frame 5
mSound = "naruto_ninetails.aif";
Symbol 416 MovieClip Frame 20
this.moveX = 19;
Symbol 416 MovieClip Frame 24
this.moveX = 14;
Symbol 416 MovieClip Frame 28
this.moveX = 9;
Symbol 416 MovieClip Frame 30
this.moveX = 5;
Symbol 416 MovieClip Frame 31
this.moveX = 0;
Symbol 416 MovieClip Frame 35
stop();
Symbol 429 MovieClip Frame 5
stop();
Symbol 430 MovieClip Frame 6
mSound = "naruto_throw.aif";
Symbol 436 MovieClip Frame 14
stop();
Symbol 440 MovieClip Frame 1
mSound = "naruto_ninjitsu_stance.aif";
Symbol 440 MovieClip Frame 30
stop();
Symbol 476 MovieClip Frame 7
stop();
Symbol 480 MovieClip Frame 50
stop();
Symbol 482 MovieClip Frame 3
var body = this._parent;
mLevelup._xscale = body._xscale;
Symbol 484 MovieClip Frame 34
stop();
Symbol 503 MovieClip Frame 1
mWalkSound = "ninja_run.aif";
Symbol 517 MovieClip Frame 5
stop();
Symbol 519 MovieClip Frame 1
_visible = false;
Symbol 520 MovieClip Frame 4
mSound = "ninja_punch.aif";
Symbol 520 MovieClip Frame 5
this.moveX = 13;
Symbol 520 MovieClip Frame 6
this.moveX = 2;
Symbol 520 MovieClip Frame 7
this.moveX = 0;
Symbol 521 MovieClip Frame 1
mSound = "ninja_hit_male.aif";
Symbol 526 MovieClip Frame 1
mSound = "ninja_die_male.aif";
Symbol 526 MovieClip Frame 6
mSound = "ninja_fall.aif";
Symbol 526 MovieClip Frame 10
stop();
Symbol 534 MovieClip Frame 5
stop();
Symbol 539 MovieClip Frame 1
mWalkSound = "ninja_run.aif";
Symbol 550 MovieClip Frame 4
stop();
Symbol 552 MovieClip Frame 1
_visible = false;
Symbol 553 MovieClip Frame 1
this.moveX = 5;
Symbol 553 MovieClip Frame 2
this.moveX = 14;
Symbol 553 MovieClip Frame 7
this.moveX = 7;
mSound = "ninja_kick.aif";
Symbol 553 MovieClip Frame 10
this.moveX = 1;
Symbol 553 MovieClip Frame 14
this.moveX = 0;
Symbol 556 MovieClip Frame 1
mSound = "ninja_hit_male.aif";
Symbol 561 MovieClip Frame 1
mSound = "ninja_die_male.aif";
Symbol 561 MovieClip Frame 6
mSound = "ninja_fall.aif";
Symbol 561 MovieClip Frame 10
stop();
Symbol 573 MovieClip Frame 1
mWalkSound = "ninja_walk.aif";
Symbol 593 MovieClip Frame 1
_visible = false;
Symbol 617 MovieClip Frame 1
mSound = "ninja_hit_female.aif";
Symbol 624 MovieClip Frame 1
Symbol 624 MovieClip Frame 7
mSound = "ninja_fall.aif";
Symbol 624 MovieClip Frame 10
stop();
Symbol 636 MovieClip Frame 1
mWalkSound = "ninja_walk.aif";
Symbol 647 MovieClip Frame 4
stop();
Symbol 649 MovieClip Frame 1
_visible = false;
Symbol 652 MovieClip Frame 7
mSound = "ninja_kick.aif";
Symbol 655 MovieClip Frame 1
mSound = "ninja_hit_male.aif";
Symbol 660 MovieClip Frame 1
mSound = "ninja_die_male.aif";
Symbol 660 MovieClip Frame 6
mSound = "ninja_fall.aif";
Symbol 660 MovieClip Frame 10
stop();
Symbol 667 MovieClip [lib_sword1] Frame 13
stop();
Symbol 678 MovieClip Frame 1
mWalkSound = "ninja_walk.aif";
Symbol 682 MovieClip Frame 1
_visible = false;
Symbol 683 MovieClip Frame 1
this.moveX = 0;
Symbol 683 MovieClip Frame 4
this.moveX = 5;
mSound = "ninja_punch.aif";
Symbol 683 MovieClip Frame 5
this.moveX = 4;
Symbol 683 MovieClip Frame 6
this.moveX = 3;
Symbol 683 MovieClip Frame 7
this.moveX = 2;
Symbol 683 MovieClip Frame 8
this.moveX = 1;
Symbol 683 MovieClip Frame 9
this.moveX = 0;
Symbol 696 MovieClip Frame 5
stop();
Symbol 697 MovieClip Frame 5
mSound = "ninja_throw.aif";
Symbol 700 MovieClip Frame 1
mSound = "ninja_hit_male.aif";
Symbol 705 MovieClip Frame 1
mSound = "ninja_die_male.aif";
Symbol 705 MovieClip Frame 7
mSound = "ninja_fall.aif";
Symbol 705 MovieClip Frame 10
stop();
Symbol 712 MovieClip [lib_sword1] Frame 13
stop();
Symbol 723 MovieClip Frame 1
mSound = "ninja_walk.aif";
Symbol 729 MovieClip Frame 1
_visible = false;
Symbol 736 MovieClip Frame 4
stop();
Symbol 737 MovieClip Frame 5
mSound = "ninja_kick.aif";
Symbol 750 MovieClip Frame 5
stop();
Symbol 751 MovieClip Frame 5
mSound = "ninja_throw.aif";
Symbol 754 MovieClip Frame 1
mSound = "ninja_hit_male.aif";
Symbol 759 MovieClip Frame 1
mSound = "ninja_die_male.aif";
Symbol 759 MovieClip Frame 6
mSound = "ninja_fall.aif";
Symbol 759 MovieClip Frame 10
stop();
Symbol 764 MovieClip [lib_sword1] Frame 13
stop();
Symbol 775 MovieClip Frame 1
mWalkSound = "ninja_walk.aif";
Symbol 788 MovieClip Frame 5
stop();
Symbol 789 MovieClip Frame 5
mSound = "ninja_throw.aif";
Symbol 792 MovieClip Frame 1
mSound = "ninja_hit_male.aif";
Symbol 797 MovieClip Frame 1
mSound = "ninja_die_male.aif";
Symbol 797 MovieClip Frame 6
mSound = "ninja_fall.aif";
Symbol 797 MovieClip Frame 10
stop();
Instance of Symbol 798 MovieClip [lib_sand_ninja4] in Symbol 761 MovieClip [library.sand_ninja4.swf] Frame 1
onClipEvent (load) {
this._quality = "MEDIUM";
}
Symbol 1032 MovieClip Frame 1
this._parent.onGround = false;
this._parent.body.mSound = "ninja_teleport.aif";
Symbol 1032 MovieClip Frame 8
stop();
Symbol 1038 MovieClip Frame 6
stop();
Symbol 1051 MovieClip Frame 5
stop();
Symbol 1052 MovieClip Frame 1
if (this.parent.onGround) {
gotoAndPlay ("attack");
}
this.parent.onGround = true;
Symbol 1052 MovieClip Frame 45
mSound = "ninja_throw.aif";
Symbol 1052 MovieClip Frame 51
stop();
Symbol 1055 MovieClip Frame 1
mSound = "ninja_hit_female.aif";
Symbol 1060 MovieClip Frame 1
Symbol 1060 MovieClip Frame 7
mSound = "ninja_fall.aif";
Symbol 1060 MovieClip Frame 10
stop();
Symbol 1079 MovieClip Frame 21
stop();
Symbol 1080 MovieClip Frame 54
stop();
Symbol 1081 MovieClip [lib_sandwave] Frame 54
stop();
Symbol 1089 MovieClip Frame 5
stop();
Symbol 1090 MovieClip Frame 19
stop();
Symbol 1091 MovieClip [lib_mudbullet_multi] Frame 23
stop();
Symbol 1128 MovieClip Frame 1
mWalkSound = "gaara_walk.aif";
Symbol 1136 MovieClip Frame 1
_visible = false;
Symbol 1143 MovieClip Frame 10
mSound = "gaara_swing.aif";
Symbol 1148 MovieClip Frame 9
mSound = "gaara_shuriken.aif";
Symbol 1161 MovieClip Frame 6
stop();
Symbol 1164 MovieClip Frame 8
mSound = "gaara_poundground.aif";
Symbol 1164 MovieClip Frame 19
mSound = "gaara_sandwave.aif";
Symbol 1169 MovieClip Frame 1
mSound = "gaara_hit.aif";
Symbol 1178 MovieClip Frame 1
mSound = "gaara_fall.aif";
Symbol 1178 MovieClip Frame 25
stop();
Symbol 1186 MovieClip Frame 1
Symbol 1190 MovieClip Frame 1
_visible = false;
Symbol 1193 MovieClip Frame 5
mSound = "snake_bite.aif";
Symbol 1193 MovieClip Frame 17
stop();
Symbol 1196 MovieClip Frame 1
mSound = "snake_hit.aif";
Symbol 1201 MovieClip Frame 1
mSound = "snake_fall.aif";
Symbol 1201 MovieClip Frame 13
stop();
Symbol 1219 MovieClip Frame 33
stop();
Symbol 1241 MovieClip Frame 28
stop();
Symbol 1242 MovieClip [lib_venom_multi] Frame 31
stop();
Symbol 1249 MovieClip Frame 1
Symbol 1254 MovieClip Frame 5
mSound = "snake_bite.aif";
Symbol 1257 MovieClip Frame 1
mSound = "snake_hit.aif";
Symbol 1262 MovieClip Frame 6
mSound = "snake_fall.aif";
Symbol 1262 MovieClip Frame 14
stop();
Symbol 1263 MovieClip Frame 33
stop();
Symbol 1271 MovieClip Frame 1
Symbol 1277 MovieClip Frame 1
_visible = false;
Symbol 1284 MovieClip Frame 5
mSound = "snake_twobites.aif";
Symbol 1287 MovieClip Frame 1
mSound = "snake_hit.aif";
Symbol 1292 MovieClip Frame 7
mSound = "snake_fall.aif";
Symbol 1292 MovieClip Frame 16
stop();
Symbol 1300 MovieClip Frame 1
Symbol 1315 MovieClip Frame 5
mSound = "snake_raise.aif";
Symbol 1315 MovieClip Frame 18
stop();
_root.dead.gotoAndPlay("go");
_root.dead1.gotoAndPlay("go");
_root.dead2.gotoAndPlay("go");
Symbol 1318 MovieClip Frame 1
mSound = "snake_hit.aif";
Symbol 1323 MovieClip Frame 4
mSound = "snake_fall.aif";
Symbol 1323 MovieClip Frame 13
stop();
Symbol 1426 MovieClip Frame 1
Symbol 1543 MovieClip Frame 1
cRect._visible = false;
stop();
Symbol 1549 MovieClip Frame 1
_visible = false;
Symbol 1550 MovieClip Frame 1
stop();
Symbol 1572 MovieClip [lib_score_letters] Frame 1
stop();
cRect._visible = false;
Symbol 1578 Button
on (release) {
GameOverScreen.singleton.onContinue("");
}
Instance of Symbol 1585 MovieClip "callCalcFPS" in Symbol 1586 MovieClip [lib_fpsmeter] Frame 1
onClipEvent (enterFrame) {
_parent.calcFPS();
}
Symbol 1593 MovieClip Frame 1
stop();
Symbol 1593 MovieClip Frame 2
stop();
Symbol 1593 MovieClip Frame 3
stop();
Symbol 1596 Button
on (release) {
LevelMap.singleton.onBackToGame();
}
Symbol 1601 Button
on (release) {
LevelMap.singleton.onPlayPressed();
}
Symbol 1606 Button
on (release) {
LevelMap.singleton.onBackToGame();
}
Symbol 1607 MovieClip Frame 1
stop();
Symbol 1611 MovieClip Frame 6
stop();
Symbol 1612 Button
on (release) {
LevelMap.singleton.onDotPressed(this);
}
Instance of Symbol 1632 MovieClip [lib_black_rect] in Symbol 1633 MovieClip Frame 1
onClipEvent (load) {
this._alpha = 0;
}
Symbol 1649 MovieClip Frame 15
stop();
LevelMap.singleton.beatening_done(_parent);
_parent.gotoAndStop("beaten");
Symbol 1654 MovieClip Frame 33
stop();
LevelMap.singleton.unlocking_done(_parent);
_parent.gotoAndStop("unlocked");
Symbol 1655 MovieClip Frame 1
mButton.enabled = true;
Instance of Symbol 1637 MovieClip "mNaruto" in Symbol 1655 MovieClip Frame 1
on (release) {
Main.button_press();
LevelMap.singleton.onNarutoPressed(this._parent);
}
Symbol 1655 MovieClip Frame 8
mButton.enabled = false;
Symbol 1655 MovieClip Frame 17
mButton.enabled = true;
Symbol 1655 MovieClip Frame 25
mButton.enabled = false;
Symbol 1655 MovieClip Frame 32
mButton.enabled = false;
Symbol 1665 MovieClip Frame 1
stop();
Symbol 1665 MovieClip Frame 8
stop();
Symbol 1665 MovieClip Frame 15
gotoAndStop (1);
Symbol 1665 MovieClip Frame 16
stop();
Symbol 1670 MovieClip Frame 1
stop();
Symbol 1670 MovieClip Frame 8
stop();
Symbol 1670 MovieClip Frame 15
gotoAndStop (1);
Symbol 1670 MovieClip Frame 16
stop();
Symbol 1673 Button
on (rollOver) {
this.onEnterFrame = function () {
if (this._currentframe < 7) {
this.gotoAndStop(this._currentframe + 1);
}
};
}
on (rollOut) {
this.onEnterFrame = function () {
if (this._currentframe > 2) {
this.gotoAndStop(this._currentframe - 1);
}
};
}
Symbol 1676 MovieClip Frame 1
stop();
Symbol 1676 MovieClip Frame 8
stop();
Symbol 1676 MovieClip Frame 15
gotoAndStop (1);
Symbol 1676 MovieClip Frame 16
stop();
Symbol 1682 MovieClip Frame 14
stop();
Symbol 1683 MovieClip Frame 1
stop();
Symbol 1683 MovieClip Frame 20
stop();
Symbol 1694 MovieClip Frame 1
this.onEnterFrame = function () {
if (this._currentFrame >= 10) {
levelNumber.text = this._currentFrame;
}
if (this._currentFrame <= 9) {
levelNumber.text = "0" + this._currentFrame;
}
};
Symbol 1721 MovieClip Frame 6
stop();
Symbol 1721 MovieClip Frame 12
stop();
Symbol 1721 MovieClip Frame 18
stop();
Symbol 1721 MovieClip Frame 24
stop();
Symbol 1721 MovieClip Frame 30
stop();
Symbol 1721 MovieClip Frame 36
stop();
Symbol 1721 MovieClip Frame 42
stop();
Symbol 1721 MovieClip Frame 48
stop();
Symbol 1721 MovieClip Frame 54
stop();
Symbol 1741 Button
on (release) {
Main.button_help_pressed();
}
Symbol 1744 Button
on (release) {
Main.button_map_pressed();
}
Symbol 1747 Button
on (release) {
Main.button_mute_pressed(true);
gotoAndStop (2);
}
Symbol 1750 Button
on (release) {
Main.button_mute_pressed(false);
gotoAndStop (1);
}
Symbol 1751 MovieClip Frame 1
stop();
Symbol 1752 MovieClip Frame 1
stop();
Symbol 1752 MovieClip Frame 7
stop();
Symbol 1752 MovieClip Frame 12
gotoAndStop (1);
Symbol 1755 MovieClip Frame 46
this._parent.gotoAndStop("none");
Symbol 1756 MovieClip Frame 1
stop();
Symbol 1758 MovieClip Frame 1
stop();
Symbol 1758 MovieClip Frame 11
stop();
Symbol 1766 MovieClip Frame 73
_parent.gotoAndStop("none");
Symbol 1769 MovieClip Frame 64
_parent.gotoAndStop("none");
Symbol 1776 MovieClip Frame 76
_parent.gotoAndStop("none");
Symbol 1786 Button
on (release) {
play();
}
Symbol 1787 MovieClip Frame 13
stop();
Key.addListener(this);
this.onKeyDown = function () {
if (this.mButton != undefined) {
Main.button_press();
play();
}
};
Symbol 1787 MovieClip Frame 14
Key.removeListener(this);
Symbol 1787 MovieClip Frame 26
Game.singleton.gameCompleteMessageCallback();
_parent.gotoAndStop("none");
Symbol 1790 MovieClip Frame 62
_parent.gotoAndStop("none");
Symbol 1803 Button
on (release) {
this.choose_yes();
}
Symbol 1804 Button
on (release) {
this.choose_no();
}
Symbol 1805 MovieClip Frame 1
function choose_yes() {
play();
}
function choose_no() {
this.onEnterFrame = function () {
if (this._currentframe > 2) {
this.gotoAndStop(this._currentframe - 1);
} else {
Key.removeListener(this);
LevelMap.singleton.setEnabled(true);
_parent.gotoAndStop("none");
}
};
}
LevelMap.singleton.setEnabled(false);
Symbol 1805 MovieClip Frame 10
stop();
Key.addListener(this);
this.onKeyDown = function () {
switch (Key.getCode()) {
case 89 :
Main.button_press();
choose_yes();
return;
case 78 :
Main.button_press();
choose_no();
}
};
Symbol 1805 MovieClip Frame 20
LevelMap.singleton.setEnabled(true);
Key.removeListener(this);
LevelMap.singleton.onForcePlay();
_parent.gotoAndStop("none");
Symbol 1806 MovieClip Frame 1
stop();
Symbol 1816 Button
on (release) {
new_game = true;
gotoAndPlay(_currentframe + 1);
}
Symbol 1821 Button
on (release) {
_parent.new_game = false;
_parent.gotoAndPlay(_parent._currentframe + 1);
}
Symbol 1824 MovieClip Frame 1
stop();
if (!Main.hasSavedGame()) {
gotoAndStop ("disabled");
}
Symbol 1828 MovieClip Frame 1
stop();
Symbol 1831 MovieClip Frame 1
stop();
Symbol 1850 Button
on (release) {
gotoAndPlay(_currentframe + 1);
}
Symbol 1863 Button
on (release) {
gotoAndPlay(_currentframe + 1);
}
on (keyPress "<Space>") {
Main.button_press();
gotoAndPlay(_currentframe + 1);
}
Symbol 1874 MovieClip [lib_start_screen] Frame 1
new_game = !Main.hasSavedGame();
Key.addListener(this);
this.onKeyDown = function () {
if (Key.getCode() == 32) {
if (this.mButton != undefined) {
Main.button_press();
play();
}
}
};
Symbol 1874 MovieClip [lib_start_screen] Frame 2
if (this._name == "ingame_screen") {
mWhite._visible = false;
}
Symbol 1874 MovieClip [lib_start_screen] Frame 3
if (this._name == "ingame_screen") {
mBackground._visible = false;
mGrass._visible = false;
}
Symbol 1874 MovieClip [lib_start_screen] Frame 58
stop();
Symbol 1874 MovieClip [lib_start_screen] Frame 89
stop();
Symbol 1874 MovieClip [lib_start_screen] Frame 113
stop();
Symbol 1874 MovieClip [lib_start_screen] Frame 128
if (this._name == "ingame_screen") {
mBlack._visible = false;
}
Symbol 1874 MovieClip [lib_start_screen] Frame 141
stop();
Key.removeListener(this);
Main.startGame(new_game);
Symbol 1520 MovieClip [library.game.swf] Frame 1
stop();
Symbol 20480 MovieClip [__Packages.tinymantis.GameObject] Frame 0
class tinymantis.GameObject
{
function GameObject (className) {
mClassName = className;
}
function gotoState(inState) {
if (inState == null) {
throw new Error("Error: cannot goto a 'null' State");
}
if (mStateMachineMap == null) {
mStateMachineMap = new Array();
}
var _local3 = sStateMap[mClassName][inState];
if (!mStateMachineMap[_local3]) {
mStateMachineMap[_local3] = new tinymantis.StateMachine(this);
}
mStateMachineMap[_local3].setState(inState);
return(_local3);
}
function isInState(inState, channel) {
return(mStateMachineMap[channel].isState(inState));
}
function update() {
var _local2 = 0;
var _local3 = mStateMachineMap.length;
for ( ; _local2 < _local3 ; _local2++) {
if (mStateMachineMap[_local2]) {
mStateMachineMap[_local2].update();
}
}
}
function run(yes) {
var _local3 = 0;
var _local4 = mStateMachineMap.length;
for ( ; _local3 < _local4 ; _local3++) {
if (mStateMachineMap[_local3]) {
mStateMachineMap[_local3].run(yes);
}
}
}
static function buildStateGroup(inClassName, inStateGroup, inGroupIndex) {
if (typeof(sStateMap[inClassName]) == "undefined") {
sStateMap[inClassName] = new Object();
}
var _local5 = 0;
for ( ; _local5 < inStateGroup.length ; _local5++) {
sStateMap[inClassName][inStateGroup[_local5]] = inGroupIndex;
}
}
var mStateMachineMap = null;
var mClassName = "";
var mStateParam = null;
static var sStateMap = new Object();
}
Symbol 20481 MovieClip [__Packages.SceneObject] Frame 0
#initclip
if (!SceneObject) {
//(_global.SceneObject = function (classname, type) {
super(classname);
this.pType = type;
this.pDead = false;
this.pX = (this.pY = -1);
this.pTile = null;
}) extends tinymantis.GameObject
var _local1 = (_global.SceneObject /* register */).prototype;
_local1.isCharacter = function () {
return(false);
};
_local1.isCaligula = function () {
return(false);
};
_local1.isThrowObject = function () {
return(false);
};
_local1.getTileSpace = function () {
return(0);
};
_local1.__get__party = function () {
return(1);
};
_local1.isBlockable = function () {
return(true);
};
_local1.isInCamera = function (diff) {
return(Game.singleton.getCamera().isPositionInScreen(this.pX, this.pY, diff));
};
_local1.getDistance = function (obj) {
return(Math.abs(obj.X - this.X) + (Math.abs(obj.Y - this.Y) * 0.7));
};
_local1.recycle = function () {
};
_local1.getType = function () {
return(this.pType);
};
_local1.__get__clip = function () {
return(this.pMovieClip);
};
_local1.initPosition = function (inx, iny) {
this.setPosition(inx, iny);
this.updatePosition(true);
};
_local1.getDirection = function () {
return(((this.pMovieClip._xscale > 0) ? -1 : 1));
};
_local1.initDirection = function (indir) {
if (indir != 0) {
var _local3 = Math.abs(this.pMovieClip._xscale);
this.pMovieClip._xscale = ((indir > 0) ? (-_local3) : (_local3));
}
};
_local1.isDead = function () {
return(this.pDead);
};
_local1.destroy = function () {
if (this.pMovieClip) {
this.pMovieClip.removeMovieClip();
this.pMovieClip = null;
}
};
_local1.setMovieClip = function (clip) {
this.pMovieClip = clip;
this.pX = this.pMovieClip._x;
this.pY = this.pMovieClip._y;
this.pMovieClip.cacheAsBitmap = true;
};
_local1.getMovieClip = function () {
return(this.pMovieClip);
};
_local1.__get__X = function () {
return(this.pX);
};
_local1.__get__Y = function () {
return(this.pY);
};
_local1.getTile = function () {
return(this.pTile);
};
_local1.update = function () {
super.update();
this.updatePosition(false);
};
_local1.updatePosition = function (instantly) {
if (instantly) {
this.pMovieClip._x = Math.round(this.pX);
this.pMovieClip._y = Math.round(this.pY);
} else {
this.pMovieClip._x = Math.round(this.pMovieClip._x + ((this.pX - this.pMovieClip._x) * 0.5));
this.pMovieClip._y = Math.round(this.pMovieClip._y + ((this.pY - this.pMovieClip._y) * 0.5));
}
};
_local1.setPosition = function (x, y) {
var _local4 = x;
var _local5 = y;
var _local6 = Game.singleton.getSceneMap();
var _local7 = _local6.getTileFromLocation(_local4, _local5);
if ((this.pTile != null) && (!_local6.isTileWalkable(_local7.mI, _local7.mJ))) {
var _local8 = this.pTile.getCenterY();
if (y > this.pY) {
_local8 = _local8 + this.getTileSpace();
} else {
_local8 = _local8 - this.getTileSpace();
}
this.setPosition(x, _local8);
return(false);
}
this.pTile = _local7;
var _local9 = this.pTile.getCenterX();
var _local10 = this.pTile.getCenterY();
if (((_local4 > _local9) && (!_local6.isTileWalkable(this.pTile.mI + 1, this.pTile.mJ))) || ((_local4 < _local9) && (!_local6.isTileWalkable(this.pTile.mI - 1, this.pTile.mJ)))) {
_local4 = _local9;
}
if ((_local5 > (_local10 + this.getTileSpace())) && (!_local6.isTileWalkable(this.pTile.mI, this.pTile.mJ + 1))) {
_local5 = _local10 + this.getTileSpace();
} else if ((_local5 < (_local10 - this.getTileSpace())) && (!_local6.isTileWalkable(this.pTile.mI, this.pTile.mJ - 1))) {
_local5 = _local10 - this.getTileSpace();
}
var _local11 = this.pX - _local4;
var _local12 = this.pY - _local5;
if (Math.abs(_local11) > Math.abs(_local12)) {
_local5 = this.adjustY(_local4, _local5, _local6, this.pTile, _local9, _local10);
_local4 = this.adjustX(_local4, _local5, _local6, this.pTile, _local9, _local10);
} else {
_local4 = this.adjustX(_local4, _local5, _local6, this.pTile, _local9, _local10);
_local5 = this.adjustY(_local4, _local5, _local6, this.pTile, _local9, _local10);
}
if (this.pY != _local5) {
this.updateDepth(_local4, _local5);
}
this.pX = _local4;
this.pY = _local5;
return((x == _local4) && (y == _local5));
};
_local1.updateDepth = function (inx, iny) {
var _local4 = Game.singleton.getSceneMap().getDepth(inx, iny);
if (_local4 != this.pMovieClip.getDepth()) {
var _local5 = this.pMovieClip._parent;
do {
_local4++;
var _local6 = _local5.getInstanceAtDepth(_local4);
} while (_local6 != undefined);
this.pMovieClip.swapDepths(_local4);
}
};
_local1.adjustX = function (x, y, map, tile, tileCenterX, tileCenterY) {
if (y > (tileCenterY + this.getTileSpace())) {
if (((x > tileCenterX) && (!map.isTileWalkable(tile.mI + 1, tile.mJ + 1))) || ((x < tileCenterX) && (!map.isTileWalkable(tile.mI - 1, tile.mJ + 1)))) {
x = tileCenterX;
}
} else if (y < (tileCenterY - this.getTileSpace())) {
if (((x > tileCenterX) && (!map.isTileWalkable(tile.mI + 1, tile.mJ - 1))) || ((x < tileCenterX) && (!map.isTileWalkable(tile.mI - 1, tile.mJ - 1)))) {
x = tileCenterX;
}
}
return(x);
};
_local1.adjustY = function (x, y, map, tile, tileCenterX, tileCenterY) {
if (x > tileCenterX) {
if ((y > (tileCenterY + this.getTileSpace())) && (!map.isTileWalkable(tile.mI + 1, tile.mJ + 1))) {
y = tileCenterY + this.getTileSpace();
} else if ((y < (tileCenterY - this.getTileSpace())) && (!map.isTileWalkable(tile.mI + 1, tile.mJ - 1))) {
y = tileCenterY - this.getTileSpace();
}
} else if (x < tileCenterX) {
if ((y > (tileCenterY + this.getTileSpace())) && (!map.isTileWalkable(tile.mI - 1, tile.mJ + 1))) {
y = tileCenterY + this.getTileSpace();
} else if ((y < (tileCenterY - this.getTileSpace())) && (!map.isTileWalkable(tile.mI - 1, tile.mJ - 1))) {
y = tileCenterY - this.getTileSpace();
}
}
return(y);
};
_local1.addProperty("Y", _local1.__get__Y, function () {
});
_local1.addProperty("party", _local1.__get__party, function () {
});
_local1.addProperty("X", _local1.__get__X, function () {
});
_local1.addProperty("clip", _local1.__get__clip, function () {
});
ASSetPropFlags(_local1, null, 1);
}
#endinitclip
Symbol 20482 MovieClip [__Packages.ThrowObject] Frame 0
#initclip
if (!ThrowObject) {
//(_global.ThrowObject = function (weapon) {
super("ThrowObject", weapon);
this.pMovieClip = ThrowObject._sClipParent.attachMovie(weapon, "throwobj" + ThrowObject._sIndex, ThrowObject._sClipParent.getNextHighestDepth());
ThrowObject._sIndex++;
this.pLastPosition = new flash.geom.Point();
}) extends SceneObject
var _local1 = (_global.ThrowObject /* register */).prototype;
(_global.ThrowObject /* register */).initPool = function (p) {
ThrowObject._sIndex = 0;
ThrowObject._sClipParent = p;
ThrowObject._sWeaponPool = new Object();
};
(_global.ThrowObject /* register */).getWeaponFromPool = function (owner, attackdata) {
var _local4 = null;
var _local5 = ThrowObject._sWeaponPool[attackdata.weapon];
if (_local5 == null) {
_local5 = new Array();
ThrowObject._sWeaponPool[attackdata.weapon] = _local5;
}
var _local6 = 0;
for ( ; _local6 < _local5.length ; _local6++) {
var _local7 = _local5[_local6];
if (_local7.isDead()) {
_local4 = _local7;
break;
}
}
if (_local4 == null) {
switch (attackdata.weapon) {
case "lib_lion" :
_local4 = new Lion(attackdata.weapon);
break;
case "lib_hatchet" :
case "lib_windmill" :
_local4 = new Frisbee(attackdata.weapon);
break;
case "lib_vespriay" :
_local4 = new Vespriay(attackdata.weapon);
break;
case "lib_eagle" :
_local4 = new Eagle(attackdata.weapon);
break;
default :
if (attackdata.weapon.indexOf("_multi") > 0) {
_local4 = new Iaculum(attackdata.weapon);
} else {
_local4 = new ThrowObject(attackdata.weapon);
}
}
_local5.push(_local4);
}
_local4.initialize(owner, attackdata);
return(_local4);
};
_local1.isThrowObject = function () {
return(true);
};
_local1.getBodyClip = function () {
return(this.pMovieClip);
};
_local1.__get__party = function () {
return(this.pOwner.party);
};
_local1.initialize = function (owner, attackdata) {
this.pDead = false;
this.pMovieClip._visible = true;
this.pMovieClip._alpha = 100;
this.getBodyClip().gotoAndPlay(1);
this.pOwner = owner;
this.pBaseY = this.pOwner.Y;
this.pAttackData = attackdata;
this.pInWater = false;
this.pPassBase = false;
if (attackdata.weapon == "lib_smoke") {
this.pPassBase = true;
}
};
_local1.__get__attackData = function () {
return(this.pAttackData);
};
_local1.initStartPosition = function (inx, iny) {
super.initPosition(inx, iny);
this.updateDepth(0, this.pBaseY);
this.pTile = Game.singleton.getSceneMap().getTileFromLocation(this.pX, this.pBaseY);
};
_local1.setPosition = function (inx, iny) {
this.pX = inx;
this.pY = iny;
};
_local1.getOwner = function () {
return(this.pOwner);
};
_local1.setOwner = function (owner) {
this.pOwner = owner;
};
_local1.isUnique = function () {
return(false);
};
_local1.destroy = function () {
this.pDead = true;
this.pMovieClip._visible = false;
var _local2 = this.getBodyClip();
_local2.gotoAndStop(_local2._totalframes);
this.pMovieClip.swapDepths(this.pMovieClip._parent.getNextHighestDepth());
if (this.pOwner) {
if (this.isUnique() && (this.pOwner.health > 0)) {
this.pOwner.gotoState("idle");
}
this.pOwner = null;
}
};
_local1.getAttackDamage = function (target) {
if (this.pOwner) {
return(this.pOwner.getAttackDamage(this.pAttackData, target));
}
return(this.pAttackData.damage);
};
_local1.play_ani_sound = function () {
var _local2 = this.pMovieClip.mSound;
if ((_local2 != null) && (_local2.length > 4)) {
tinymantis.SoundManager.sSingleton.playSound(_local2, false, 100);
delete this.pMovieClip.mSound;
}
};
_local1.update = function () {
if (this.pDead) {
return(undefined);
}
if (this.pMovieClip._currentframe == this.pMovieClip._totalframes) {
this.pDead = true;
}
this.play_ani_sound();
var _local2 = this.pMovieClip.cHitArea;
this.hit_update(_local2, this.pPassBase);
this.water_update(_local2);
};
_local1.water_update = function (hitarea) {
if (hitarea != undefined) {
var _local3 = hitarea;
var _local4 = 0;
var _local5 = 0;
while (_local3 != this.pMovieClip) {
_local4 = _local4 + _local3._x;
_local5 = _local5 + _local3._y;
_local3 = _local3._parent;
}
this.pLastPosition.x = ((-_local4) * this.getDirection()) + this.pMovieClip._x;
this.pLastPosition.y = _local5 + this.pMovieClip._y;
} else {
var _local6 = Game.singleton.getSceneMap();
if (_local6.getTileFromLocation(this.pLastPosition.x, this.pLastPosition.y).water) {
this.pInWater = true;
var _local7 = "other_splash_small.aif";
switch (this.getType()) {
case "lib_vespriay" :
case "lib_qudrel" :
_local7 = "other_splash_lrg.aif";
break;
case "lib_brick1" :
case "lib_javline" :
case "lib_smallrock" :
_local7 = "other_splash_med.aif";
}
var _local8 = new WaterEffect(_local7, this.pLastPosition.x, this.pLastPosition.y);
this.pDead = true;
}
}
};
_local1.hit_update = function (hitarea, passbase) {
if (hitarea != undefined) {
var _local4 = Game.singleton.getCharacters();
var _local5 = this.pAttackData.pushpower * this.getDirection();
var _local6 = 0;
for ( ; _local6 < _local4.length ; _local6++) {
var _local7 = _local4[_local6];
if ((_local7 != this.pOwner) && ((_local7.health > 0) && ((_local7.party != this.pOwner.party) && (hitarea.hitTest(_local7.getBodyClip()))))) {
if (passbase || (Math.abs(_local7.Y - this.pBaseY) < Constant.HIT_Y_RANGE)) {
if (this.pAttackData.weapon == "lib_smoke") {
var _local8 = this.pMovieClip._x + ((hitarea._x + (hitarea._width / 2)) * ((this.pMovieClip._xscale > 0) ? 1 : -1));
_local5 = this.pAttackData.pushpower * ((_local7.X > _local8) ? 1 : -1);
}
if (_local7.isInState("hit", 0) || (_local7.hit(this, this.getAttackDamage(_local7), _local5))) {
if (!this.pAttackData.hit_multiple) {
this.pDead = true;
break;
}
}
}
}
}
if (this.pOwner == Game.singleton.getCaligula()) {
var _local9 = Game.singleton.getBreakableObjects();
var _local10 = 0;
for ( ; _local10 < _local9.length ; _local10++) {
var _local11 = _local9[_local10];
if (!_local11.broken) {
_local11.hit((passbase ? null : (this.pTile)), hitarea);
}
}
}
}
};
_local1.addProperty("attackData", _local1.__get__attackData, function () {
});
_local1.addProperty("party", _local1.__get__party, function () {
});
ASSetPropFlags(_local1, null, 1);
(_global.ThrowObject /* register */)._sIndex = 0;
}
#endinitclip
Symbol 20483 MovieClip [__Packages.Eagle] Frame 0
#initclip
if (!Eagle) {
//(_global.Eagle = function (weapon) {
super(weapon);
this.mClassName = "Eagle";
this.mStateParam = new Object();
}) extends ThrowObject
var _local1 = (_global.Eagle /* register */).prototype;
(_global.Eagle /* register */).initStateMachine = function () {
tinymantis.GameObject.buildStateGroup("Eagle", new Array("forward", "attack", "back"), 0);
};
_local1.initialize = function (owner, attackdata) {
super.initialize(owner, attackdata);
this.pTimer = 0;
this.pIgnoreTargets = new Array();
this.gotoState("forward");
tinymantis.SoundManager.sSingleton.playSound("caligula_eagle1.aif", false, 100);
};
_local1.isUnique = function () {
return(true);
};
_local1.update = function () {
var _local2 = 0;
var _local3 = this.mStateMachineMap.length;
for ( ; _local2 < _local3 ; _local2++) {
if (this.mStateMachineMap[_local2]) {
this.mStateMachineMap[_local2].update();
}
}
};
_local1.attack_enter = function () {
this.pMovieClip.gotoAndPlay("attack");
this.pIgnoreTargets.push(this.pTarget);
tinymantis.SoundManager.sSingleton.playSound("caligula_eagle2.aif", false, 100);
};
_local1.attack_update = function () {
var _local2 = this.pMovieClip.body;
if (_local2._currentframe == _local2._totalframes) {
this.gotoState("forward");
}
if (this.pTarget.health > 0) {
var _local3 = _local2.cHitArea;
if (_local3 != undefined) {
this.pTarget.hit(this, this.getAttackDamage(this.pTarget), this.pAttackData.pushpower * this.getDirection());
}
var _local4 = 0.2;
this.pX = this.pX + ((this.pTarget.X - this.pX) * _local4);
this.pY = this.pY + (((this.pTarget.Y - 100) - this.pY) * _local4);
this.updatePosition(true);
}
};
_local1.forward_enter = function () {
this.pMovieClip.gotoAndPlay("fly");
this.pRouteY = this.pY;
this.pTarget = null;
this.mStateParam.speed = 20;
};
_local1.forward_update = function () {
var _local2 = this.pMovieClip.body;
var _local3 = Game.singleton.getCharacters();
var _local4 = 0;
for ( ; _local4 < _local3.length ; _local4++) {
var _local5 = _local3[_local4];
if ((_local5.health > 0) && ((_local5.party != this.pOwner.party) && (_local5.getMovieClip().hitTest(_local2)))) {
if (tinymantis.Utils.arrayIndexOf(this.pIgnoreTargets, _local5) < 0) {
this.pTarget = _local5;
this.gotoState("attack");
break;
}
}
}
if (this.pTarget == null) {
this.pTimer++;
this.pX = this.pX + (this.getDirection() * this.mStateParam.speed);
this.pY = this.pRouteY - ((Math.sin(this.pTimer * 0.24) * this.mStateParam.speed) * 2);
this.updatePosition(true);
this.updateDepth(this.pX, this.pY + 150);
if (this.pTimer > 20) {
this.mStateParam.speed = this.mStateParam.speed - 2;
if (this.mStateParam.speed <= 0) {
this.gotoState("back");
}
}
}
};
_local1.back_enter = function () {
this.pMovieClip.gotoAndPlay("fly");
this.initDirection(this.pOwner.X - this.X);
this.mStateParam.speed = 0;
};
_local1.back_update = function () {
this.pTimer++;
var _local2 = Math.abs(this.pOwner.X - this.X);
this.pX = this.pX + (this.getDirection() * this.mStateParam.speed);
this.pY = this.pRouteY - (Math.sin(this.pTimer * 0.24) * Math.min(this.mStateParam.speed, _local2 / 10));
this.pRouteY = this.pRouteY + (((this.pOwner.Y - 80) - this.pRouteY) * 0.5);
this.updatePosition(true);
this.updateDepth(this.pX, this.pY + 150);
var _local3 = _local2 * 0.15;
if (this.pOwner.isInState("walk", 0) && ((this.pOwner.getDirection() * this.getDirection()) > 0)) {
_local3 = _local3 + this.pOwner.getSpeed();
}
this.mStateParam.speed = Math.min(Math.min(30, _local3), this.mStateParam.speed + 2);
if ((_local2 < 35) || (this.pTimer > 200)) {
this.pDead = true;
}
};
ASSetPropFlags(_local1, null, 1);
}
#endinitclip
Symbol 20484 MovieClip [__Packages.Character] Frame 0
#initclip
if (!Character) {
//(_global.Character = function (type) {
super("Character", type);
this.pCurrentForm = "";
this.pCanStun = false;
}) extends SceneObject
var _local1 = (_global.Character /* register */).prototype;
(_global.Character /* register */).resetIndex = function () {
Character._sIndex = 0;
};
(_global.Character /* register */).initStateMachine = function () {
tinymantis.GameObject.buildStateGroup("Character", new Array("init", "standup", "chargeup", "idle", "walk", "levelup", "flee", "defend", "attack", "hit", "stun", "popoff", "disappear", "death", "explosive_death", "decay", "ghost", "recycle"), 0);
tinymantis.GameObject.buildStateGroup("Character", new Array("null", "stupid", "think", "melee", "throw", "summon", "ocarina", "zampogna", "manhood", "necromancer"), 1);
};
_local1.getValue = function () {
return(0);
};
_local1.getSpeed = function () {
return(this.pSpeed);
};
_local1.canStun = function () {
return(this.pCanStun);
};
_local1.initialize = function () {
this.pCurrentAttack = null;
this.mStateParam = new Object();
this.pParty = 1;
this.gotoState("init");
var _local2 = CharacterInfo.singleton.getCharacterInfo(this.pType);
this.pWeight = Math.min(1, Math.max(0, _global.parseInt(_local2.weight) / 100));
this.pSpeedRandom = (this.pSpeed = _global.parseInt(_local2.speed));
this.pHealthMax = _global.parseInt(_local2.max_health);
this.pCanStun = _global.parseInt(_local2.stun) != 0;
this.mStateParam.mWalkSoundChannel = -1;
this.initWeapons();
};
_local1.isSkeleton = function () {
return(false);
};
_local1.isCharacter = function () {
return(true);
};
_local1.initWeapons = function () {
var _local2 = CharacterInfo.singleton.getCharacterInfo(this.pType);
this.pAttackData = new Array();
var _local3 = _local2.weapons;
var _local4 = 0;
for ( ; _local4 < _local3.length ; _local4++) {
this.addAttackData(new AttackData(_local3[_local4]));
}
};
_local1.getAttackDamage = function (attackdata, target) {
return(attackdata.damage);
};
_local1.__get__currentAttack = function () {
return(this.pCurrentAttack);
};
_local1.addAttackData = function (data) {
var _local3 = 0;
for ( ; _local3 < this.pAttackData.length ; _local3++) {
var _local4 = this.pAttackData[_local3];
if (_local4.keyCode == data.keyCode) {
return(null);
}
}
this.pAttackData.push(data);
return(data);
};
_local1.__get__type = function () {
return(this.pType);
};
_local1.getDefaultWeapon = function () {
if (this.pAttackData.length) {
return(this.pAttackData[0]);
}
return(null);
};
_local1.getBodyClip = function () {
if (this.pMovieClip.body == undefined) {
return(this.pMovieClip);
}
return(this.pMovieClip.body);
};
_local1.init_update = function () {
this.gotoState("idle");
this.pHealth = this.pHealthMax;
this.pCurrentAttack = this.getDefaultWeapon();
this.pCurrentForm = (this.pCurrentAttack ? (this.pCurrentAttack.transform) : "");
this.pUniqueThrowObject = null;
};
_local1.recycle_enter = function () {
this.pMovieClip._visible = false;
this.gotoState("think");
this.gotoState("nofire");
};
_local1.recycle_update = function () {
if (this.pDead) {
return(undefined);
}
this.pMovieClip.removeMovieClip();
this.pMovieClip = null;
this.pDead = true;
};
_local1.createAttackData = function () {
this.pAttackData = new Array();
};
_local1.__get__party = function () {
return(this.pParty);
};
_local1.__set__party = function (p) {
this.pParty = p;
return(this.__get__party());
};
_local1.initTile = function (tx, ty) {
this.initPosition((tx + 0.5) * SceneMap.TILE_SIZE, (ty + 0.5) * SceneMap.TILE_SIZE);
};
_local1.__get__health = function () {
return(this.pHealth);
};
_local1.__set__health = function (h) {
this.pHealth = Math.min(this.pHealthMax, Math.max(0, h));
return(this.__get__health());
};
_local1.__get__health_max = function () {
return(this.pHealthMax);
};
_local1.__set__health_max = function (hp) {
this.pHealthMax = hp;
this.health = this.pHealth;
return(this.__get__health_max());
};
_local1.initClip = function (parent, libname) {
this.pMovieClip = parent.attachMovie(libname, libname + Character._sIndex, parent.getNextHighestDepth());
this.pMovieClip.gotoAndStop("idle");
Character._sIndex++;
this.pMovieClip.mCharacter = this;
};
_local1.move = function (dx, dy, speed) {
if (dx != 0) {
this.initDirection(dx);
}
if (dy == 0) {
dx = ((dx > 0) ? (speed) : (-speed));
} else if (dx == 0) {
dy = ((dy > 0) ? (speed) : (-speed));
} else {
speed = speed / Math.SQRT2;
dx = ((dx > 0) ? (speed) : (-speed));
dy = ((dy > 0) ? (speed) : (-speed));
}
return(this.setPosition(this.X + dx, this.Y + dy));
};
_local1.hit = function (attacker, damage, pushpower) {
if ((this.health == 0) || (this.party == attacker.party)) {
return(false);
}
if (damage > 0) {
this.health = this.health - damage;
this.mStateParam.push_power = Math.abs(pushpower);
this.mStateParam.push_speed = (20 * ((pushpower > 0) ? 1 : -1)) * (1 - this.pWeight);
this.gotoState("hit");
}
return(true);
};
_local1.idle_enter = function () {
this.pMovieClip._alpha = 100;
if (this.pUniqueThrowObject) {
if (this.pUniqueThrowObject.getOwner() != this) {
this.pUniqueThrowObject = null;
}
}
if (this.pUniqueThrowObject) {
this.pMovieClip.mWeapon = "";
} else {
this.pMovieClip.mWeapon = this.pCurrentAttack.key;
}
this.pMovieClip.gotoAndStop("idle");
};
_local1.setGamePause = function (pause) {
if (this.mStateParam.mWalkSoundChannel >= 0) {
tinymantis.SoundManager.sSingleton.setVolume(this.mStateParam.mWalkSoundChannel, (pause ? 0 : 100));
}
};
_local1.walk_enter = function () {
this.pMovieClip.gotoAndStop("walk");
this.pSpeedRandom = this.pSpeed + Math.random();
this.mStateParam.mWalkSoundChannel = -1;
};
_local1.character_walk_update = function (dx, dy) {
if (this.mStateParam.mWalkSoundChannel < 0) {
var _local4 = this.pMovieClip.body.mWalkSound;
if (_local4 && (_local4.length > 4)) {
if (Game.singleton.isInState("run", 0)) {
this.mStateParam.mWalkSoundChannel = tinymantis.SoundManager.sSingleton.playSound(_local4, true, 100);
}
delete this.pMovieClip.body.mWalkSound;
}
}
if (dx || (dy)) {
return(this.move(dx, dy, this.pSpeedRandom));
}
if (this.isInState("walk", 0)) {
this.gotoState("idle");
}
return(true);
};
_local1.walk_exit = function () {
this.mStateParam.mWalkSoundChannel = tinymantis.SoundManager.sSingleton.stopSound(this.mStateParam.mWalkSoundChannel);
};
_local1.hit_enter = function () {
this.pMovieClip.gotoAndStop("hit");
this.pMovieClip.body.gotoAndPlay(1);
};
_local1.hit_update = function () {
this.setPosition(this.pX + this.mStateParam.push_speed, this.pY);
this.mStateParam.push_speed = this.mStateParam.push_speed * this.mStateParam.push_power;
var _local2 = this.pMovieClip.body;
if (_local2._currentframe == _local2._totalframes) {
if (this.health == 0) {
this.gotoState("death");
} else {
this.gotoState("idle");
}
}
};
_local1.stun_enter = function () {
this.pMovieClip.gotoAndStop("stun");
this.mStateParam.stun_timer = 150 * AttackData.getAttackEffective("M", this.getType());
};
_local1.stun_update = function () {
if ((--this.mStateParam.stun_timer) < 0) {
this.gotoState("idle");
}
};
_local1.death_enter = function () {
this.pMovieClip.gotoAndStop("death");
this.mStateParam.death_timer = 0;
};
_local1.death_update = function () {
var _local2 = this.pMovieClip.body;
if (_local2._currentframe == _local2._totalframes) {
_local2.stop();
this.mStateParam.death_timer++;
if (this.mStateParam.death_timer > 10) {
this.gotoState("decay");
}
}
};
_local1.decay_enter = function () {
this.mStateParam.death_timer = 0;
};
_local1.decay_update = function () {
this.mStateParam.death_timer++;
if (this.mStateParam.death_timer > 24) {
this.gotoState("ghost");
}
var _local2 = this.pMovieClip.body;
_local2._visible = (Math.floor(this.mStateParam.death_timer / 1) % 2) == 0;
};
_local1.decay_exit = function () {
var _local2 = this.pMovieClip.body;
_local2._visible = true;
};
_local1.defend_enter = function () {
this.pMovieClip.gotoAndStop("defend");
tinymantis.SoundManager.sSingleton.playSound("soldier_shield.aif", false, 100);
this.mStateParam.push_power = -7 * this.getDirection();
};
_local1.defend_update = function () {
var _local2 = this.pMovieClip.body;
if (_local2._currentframe == _local2._totalframes) {
this.gotoState("idle");
} else {
this.setPosition(this.pX + this.mStateParam.push_power, this.pY);
this.mStateParam.push_power = this.mStateParam.push_power * 0.3;
}
};
_local1.attack_enter = function () {
var _local2 = false;
if (this.pCurrentForm != this.pCurrentAttack.transform) {
this.pCurrentForm = this.pCurrentAttack.transform;
if (this.pCurrentForm.length > 0) {
_local2 = true;
}
}
if (_local2) {
this.pMovieClip.gotoAndStop("transform_" + this.pCurrentAttack.key);
} else {
this.pMovieClip.gotoAndStop("attack_" + this.pCurrentAttack.key);
this.gotoState(this.pCurrentAttack.type);
}
};
_local1.play_ani_sound = function (clip) {
var _local3 = clip.mSound;
if ((_local3 != null) && (_local3.length > 4)) {
tinymantis.SoundManager.sSingleton.playSound(_local3, false, 100);
delete clip.mSound;
}
};
_local1.update = function () {
super.update();
if (this.pMovieClip.body) {
this.play_ani_sound(this.pMovieClip.body);
}
};
_local1.attack_update = function () {
var _local2 = this.pMovieClip.body;
if (_local2.moveX == undefined) {
_local2.moveX = 0;
}
this.move(this.getDirection(), 0, _local2.moveX);
if (_local2._currentframe == _local2._totalframes) {
this.gotoState("idle");
_local2.moveX = 0;
}
};
_local1.melee_check = function (hitarea, char) {
return(hitarea.hitTest(char.getBodyClip()) && (Math.abs(char.Y - this.Y) < Constant.HIT_Y_RANGE));
};
_local1.melee_update = function () {
if (!this.isInState("attack", 0)) {
this.gotoState("think");
}
var _local2 = false;
var _local3 = this.pMovieClip.body.cHitArea;
if (_local3 != null) {
var _local4 = Game.singleton.getCharacters();
var _local5 = 0;
for ( ; _local5 < _local4.length ; _local5++) {
var _local6 = _local4[_local5];
if ((_local6 != this) && (this.melee_check(_local3, _local6))) {
if (_local6.hit(this, this.getAttackDamage(this.pCurrentAttack, _local6), this.pCurrentAttack.pushpower * this.getDirection())) {
_local2 = true;
}
}
}
}
return(_local2);
};
_local1.throw_update = function () {
var _local2 = this.pMovieClip.body.cThrowPoint;
if (_local2 != null) {
var _local3 = Game.singleton.createThrowObject(this, this.pCurrentAttack);
var _local4 = tinymantis.Utils.getClipRelatedPosition(_local2, this.pMovieClip._parent);
_local3.initStartPosition(_local4.x, _local4.y);
_local3.initDirection(this.getDirection());
if (_local3.isUnique()) {
this.pUniqueThrowObject = _local3;
}
}
if (!this.isInState("attack", 0)) {
this.gotoState("think");
}
};
_local1.necromancer_enter = function () {
this.mStateParam.necromancer_totalamount = this.getAttackDamage(this.pCurrentAttack, null);
var _local2 = Game.singleton.getCharacters();
this.mStateParam.necromancer_amount = 0;
var _local3 = 0;
for ( ; _local3 < _local2.length ; _local3++) {
var _local4 = _local2[_local3];
if (_local4.isSkeleton()) {
var _local5 = Skeleton(_local4);
if ((!_local5.isDead()) && (_local5.getOwner() == this)) {
this.mStateParam.necromancer_amount++;
}
}
}
this.mStateParam.necromancer_timer = 10;
this.mStateParam.necromancer_range = Math.round(this.pCurrentAttack.pushpower * 100);
};
_local1.necromancer_update = function () {
if ((--this.mStateParam.necromancer_timer) < 0) {
if ((this.mStateParam.necromancer_timer % 3) == 0) {
var _local2 = Game.singleton;
var _local3 = this.pCurrentAttack.weapon;
if (this.isCaligula()) {
_local3 = "NarutoDup";
}
var _local4 = _local2.getSceneMap().getRandomWalkableTile(this.pTile.mI, this.pTile.mJ, this.mStateParam.necromancer_range);
var _local5 = Skeleton(_local2.createCharacter(this.pMovieClip._parent, _local3));
_local5.setOwner(_local4.getCenterX(), _local4.getCenterY(), this.getDirection() * ((Math.random() > 0.5) ? 1 : -1), this);
this.mStateParam.necromancer_amount++;
}
}
if (this.mStateParam.necromancer_amount >= this.mStateParam.necromancer_totalamount) {
this.gotoState("think");
}
};
_local1.stupid_update = function () {
this.gotoState("idle");
};
_local1.addProperty("health", _local1.__get__health, _local1.__set__health);
_local1.addProperty("party", _local1.__get__party, _local1.__set__party);
_local1.addProperty("type", _local1.__get__type, function () {
});
_local1.addProperty("health_max", _local1.__get__health_max, _local1.__set__health_max);
_local1.addProperty("currentAttack", _local1.__get__currentAttack, function () {
});
ASSetPropFlags(_local1, null, 1);
(_global.Character /* register */)._sIndex = 0;
}
#endinitclip
Symbol 20485 MovieClip [__Packages.NPC] Frame 0
#initclip
if (!NPC) {
//(_global.NPC = function (type) {
super(type);
this.pStartTile = new flash.geom.Point();
this.pConfuseEffect = null;
this.pCurrentTarget = null;
this.pAwareOfCaligula = false;
this.pAIDistance = 5;
this.pDecayed = false;
}) extends Character
var _local1 = (_global.NPC /* register */).prototype;
_local1.setAwareOfCaligula = function (aware) {
this.pAwareOfCaligula = aware;
};
_local1.getAwareOfCaligula = function () {
return(this.pAwareOfCaligula);
};
_local1.isGladiator = function () {
return(false);
};
_local1.loadData = function (data) {
this.pData = data;
var _local3 = Game.singleton.getSceneMap();
this.pID = data.id;
this.pStartTile.x = data.i;
this.pStartTile.y = data.j;
if (!_local3.isTileWalkable(this.pStartTile.x, this.pStartTile.y)) {
var _local4 = (("Bad Start Point: '" + this.getType()) + "' id=") + this.pID;
throw new Error(_local4);
}
this.pWayPoints = new Array();
if (data.path) {
var _local5 = data.path;
var _local6 = 0;
for ( ; _local6 < _local5.length ; _local6++) {
var _local7 = _local3.levelData.getWayPoint(_local5[_local6]);
this.pWayPoints.push(_local7);
}
}
};
_local1.getValue = function () {
return(this.pValue);
};
_local1.getID = function () {
return(this.pID);
};
_local1.extremeDeath = function () {
super.hit(Game.singleton.getCaligula(), 1000, 0);
switch (this.getType()) {
case "Skeleton" :
case "Rat" :
break;
default :
if (!this.isCloseToWater()) {
this.gotoState("explosive_death");
} else {
this.pMovieClip.mDeathMode = "medium";
}
}
this.pValueCombo = true;
};
_local1.findNextWayPointIndex = function () {
var _local2 = -1;
var _local3 = 10000;
var _local5 = 0;
for ( ; _local5 < this.pWayPoints.length ; _local5++) {
var _local4 = this.pWayPoints[_local5];
var _local6 = Math.abs(_local4.x - this.pTile.mI) + Math.abs(_local4.y - this.pTile.mJ);
if (_local6 < _local3) {
_local3 = _local6;
_local2 = _local5;
}
}
var _local4 = this.pWayPoints[_local2];
if ((Math.abs(_local4.x - this.pTile.mI) < 2) && (Math.abs(_local4.y - this.pTile.mJ) < 2)) {
_local2 = (_local2 + 1) % this.pWayPoints.length;
}
return(_local2);
};
_local1.initialize = function () {
super.initialize();
this.pAttackDistanceMin = 0;
this.pAttackDistanceMax = 100;
this.pFirstRun = true;
var _local3 = CharacterInfo.singleton.getCharacterInfo(this.pType);
this.pAiDefend = ((_local3.defend == "true") ? true : false);
this.pAiIdle = ((_local3.idle == "false") ? false : true);
this.pAiWalk = ((_local3.walk == "false") ? false : true);
this.pAIDistance = ((_local3.aidistance == undefined) ? 5 : (_global.parseInt(_local3.aidistance)));
this.pExp = ((_local3.exp == undefined) ? 0 : (_global.parseInt(_local3.exp)));
this.setConfuseEffect(null);
this.gotoState("init");
};
_local1.getExp = function () {
return(this.pExp);
};
_local1.resetValue = function () {
var _local2 = CharacterInfo.singleton.getCharacterInfo(this.pType);
this.pValue = _global.parseInt(_local2.value);
};
_local1.melee_check = function (hitarea, char) {
return((this.party != char.party) && (super.melee_check(hitarea, char)));
};
_local1.hit_burn = function () {
if (!(this.isInState("burning", 2) || (this.isInState("decay", 0) || (this.isInState("ghost", 0))))) {
this.gotoState("burning");
}
};
_local1.isCloseToWater = function () {
var _local2 = Game.singleton.getSceneMap();
var _local3 = _local2.getTile(this.pTile.mI + 1, this.pTile.mJ);
var _local4 = _local2.getTile(this.pTile.mI - 1, this.pTile.mJ);
return(((_local3 != null) && (_local3.water)) || ((_local4 != null) && (_local4.water)));
};
_local1.hit = function (attacker, damage, pushpower) {
if ((!this.pAiDefend) || ((!attacker.isBlockable()) || ((attacker.getDirection() == this.getDirection()) || (this.isInState("attack", 0) && (damage > 0))))) {
var _local6 = Game.singleton.getCaligula();
var _local7 = attacker.party == _local6.party;
var _local8 = _local7 && (Game.singleton.isMaxGore());
if (_local8) {
damage = damage * 100;
}
if (super.hit(attacker, damage, pushpower)) {
if (attacker.isThrowObject()) {
var _local10 = ThrowObject(attacker);
if (_local10.getOwner() == _local6) {
_local7 = true;
}
var _local9 = _local10.attackData;
} else {
var _local11 = Character(attacker);
var _local9 = _local11.currentAttack;
}
if (_local7) {
var _local12 = new PopScore(Math.abs(damage), 1, this);
if (this.health == 0) {
switch (this.getType()) {
case "Skeleton" :
break;
case "Rat" :
Game.singleton.mRatsKilled++;
break;
default :
if (_local6.isChargedMode() || (_local8)) {
if ((_local9.gore || (_local8)) && (!this.isCloseToWater())) {
this.gotoState("explosive_death");
} else {
this.pMovieClip.mDeathMode = "medium";
}
} else {
this.pMovieClip.mDeathMode = (_local9.gore ? "medium" : "mild");
}
}
this.pValueCombo = true;
} else {
this.setConfuseEffect(null);
}
if (_local6.currentAttack.key == "F") {
this.hit_burn();
}
}
return(true);
}
if ((this.health == 0) && (_local7)) {
if (_local6.currentAttack.key == "F") {
this.hit_burn();
}
}
return(false);
}
if (this.health == 0) {
return(false);
}
if (!this.isInState("defend", 0)) {
this.gotoState("defend");
}
return(true);
};
_local1.walk_path_update = function () {
if (this.pWalkPath) {
if (this.pWalkPath.length) {
var _local2 = this.pWalkPath[0];
var _local3 = Game.singleton.getSceneMap().getTile(_local2.x, _local2.y);
var _local4 = _local3.getCenterX();
var _local5 = _local3.getCenterY();
var _local6 = _local4 - this.pX;
var _local7 = _local5 - this.pY;
if (Math.abs(_local6) < 5) {
_local6 = 0;
}
if (Math.abs(_local7) < 5) {
_local7 = 0;
}
if (_local6 || (_local7)) {
this.character_walk_update(_local6, _local7);
// unexpected jump
}
this.pWalkPath.shift();
return(this.walk_path_update());
}
this.pWalkPath = null;
}
return(this.pWalkPath != null);
};
_local1.npc_initialize = function () {
};
_local1.init_update = function () {
if (this.pX == -1) {
this.initTile(this.pStartTile.x, this.pStartTile.y);
}
if (this.isInState("init", 0)) {
super.init_update();
this.pHateCaligula = 10;
this.pWayPointIndex = -1;
this.resetValue();
this.pValueCombo = false;
this.gotoState("think");
this.think_enter();
this.pThinkTimer = 100;
this.think_update();
}
};
_local1.idle_enter = function () {
super.idle_enter();
this.pWayPointIndex = this.findNextWayPointIndex();
this.mStateParam.idle_timer = 0;
this.mStateParam.search_range = 80;
};
_local1.idle_update = function () {
this.pMovieClip.body.stop();
if (this.health == 0) {
this.health = 1;
}
if (this.pAwareOfCaligula) {
var _local2 = Game.singleton.getCaligula().getTile();
var _local3 = Game.singleton.getSceneMap().getRandomWalkableTile(_local2.mI, _local2.mJ, this.pAIDistance);
var _local4 = new tinymantis.AStar(Game.singleton.getSceneMap());
var _local5 = _local4.findPathLimited(this.pTile.mI, this.pTile.mJ, _local3.mI, _local3.mJ, this.mStateParam.search_range);
this.mStateParam.search_range = this.mStateParam.search_range + 20;
if (_local5 && (_local5.length)) {
this.pWalkPath = _local5;
this.gotoState("walk");
}
} else if ((this.pConfuseEffect == null) && (this.pAwareOfCaligula && (!this.pHateCaligula))) {
this.gotoState("flee");
}
};
_local1.updateAttackRange = function () {
if (this.pCurrentAttack) {
this.pAttackDistanceMin = this.pCurrentAttack.min_range;
this.pAttackDistanceMax = this.pCurrentAttack.max_range;
} else {
this.pAttackDistanceMin = 5;
this.pAttackDistanceMax = 100;
}
};
_local1.walk_enter = function () {
super.walk_enter();
this.pMovieClip.body.play();
this.updateAttackRange();
};
_local1.walk_update = function () {
if (!this.walk_path_update()) {
var _local2 = null;
var _local3 = 0;
var _local4 = 0;
if (this.pCurrentTarget) {
var _local5 = this.pCurrentTarget;
_local2 = this.findTargetAttackTile(_local5);
if (_local2 != null) {
_local3 = _local5.X - this.pX;
_local4 = _local5.Y - this.pY;
var _local6 = Math.abs(_local3);
var _local7 = Math.abs(_local4);
if ((_local6 >= this.pAttackDistanceMin) && ((_local6 < this.pAttackDistanceMax) && (_local7 < (Constant.HIT_Y_RANGE / 2)))) {
this.initDirection(_local3);
this.gotoState("attack");
}
if (_local6 < this.pAttackDistanceMin) {
_local3 = ((_local3 == 0) ? (this.pSpeed) : (-_local3));
} else if (_local6 < this.pAttackDistanceMax) {
_local3 = 0;
}
if (_local7 < 5) {
_local4 = 0;
}
} else {
var _local8 = Game.singleton.getSceneMap();
var _local9 = this.pWayPoints[this.pWayPointIndex];
_local2 = _local8.getTile(_local9.x, _local9.y);
_local3 = _local2.getCenterX() - this.X;
_local4 = _local2.getCenterY() - this.Y;
if (Math.abs(_local3) < 30) {
_local3 = 0;
}
if (Math.abs(_local4) < 30) {
_local4 = 0;
}
if (_local2 == this.pTile) {
this.gotoState("idle");
}
}
} else if (this.pConfuseEffect) {
this.gotoState("idle");
} else if (this.pAwareOfCaligula && (!this.pHateCaligula)) {
this.gotoState("flee");
} else {
var _local10 = Game.singleton.getSceneMap();
var _local11 = this.pWayPoints[this.pWayPointIndex];
_local2 = _local10.getTile(_local11.x, _local11.y);
_local3 = _local2.getCenterX() - this.X;
_local4 = _local2.getCenterY() - this.Y;
if (Math.abs(_local3) < 30) {
_local3 = 0;
}
if (Math.abs(_local4) < 30) {
_local4 = 0;
}
if (((--this.mStateParam.stroll_timer) < 0) || (_local2 == this.pTile)) {
this.gotoState("idle");
}
}
if ((!this.character_walk_update(_local3, _local4)) && (!this.isInState("attack", 0))) {
if ((_local2 == null) || (!this.findNextTile(_local2.mI, _local2.mJ))) {
this.pCurrentTarget = null;
this.gotoState("idle");
}
}
}
};
_local1.findNextTile = function (ti, tj) {
var _local4 = new tinymantis.AStar(Game.singleton.getSceneMap());
var _local5 = _local4.findPath(this.pTile.mI, this.pTile.mJ, ti, tj);
this.pWalkPath = _local5.slice(0, 3);
return(this.pWalkPath.length > 0);
};
_local1.attack_exit = function () {
this.gotoState("think");
if ((this.pCurrentTarget.health == 0) || ((this.pCurrentTarget.party == this.party) || ((Math.random() < 0.7) || (this.pType == "SoundNinja4")))) {
this.pCurrentTarget = null;
}
};
_local1.flee_enter = function () {
if (Math.random() < 0.5) {
this.pWayPoints.reverse();
}
this.pMovieClip.gotoAndStop("flee");
this.mStateParam.flee_timer = 0;
this.mStateParam.flee_direction = new flash.geom.Point(1, 0);
};
_local1.flee_update = function () {
if (this.pHateCaligula || (this.pConfuseEffect)) {
this.gotoState("idle");
} else if (this.pAwareOfCaligula) {
if (!this.walk_path_update()) {
var _local2 = Game.singleton.getCaligula();
var _local3 = this.X;
var _local4 = this.Y;
var _local5 = 0;
var _local6 = 0;
this.mStateParam.flee_timer--;
if (this.mStateParam.flee_timer < 0) {
_local5 = _local3 - _local2.X;
_local6 = _local4 - _local2.Y;
if ((_local5 == 0) && (_local6 == 0)) {
_local5 = Math.random() - 0.5;
_local6 = Math.random() - 0.5;
}
if (_local5 != 0) {
var _local7 = Math.abs(_local6 / _local5);
if (_local7 < 0.2) {
_local6 = 0;
} else if (_local7 > 5) {
_local5 = 0;
}
}
this.mStateParam.flee_direction.x = _local5;
this.mStateParam.flee_direction.y = _local6;
this.mStateParam.flee_timer = 90;
} else {
_local5 = this.mStateParam.flee_direction.x;
_local6 = this.mStateParam.flee_direction.y;
}
if (!this.character_walk_update(_local5, _local6)) {
this.mStateParam.flee_timer = 0;
if ((Math.abs(this.pX - _local3) + Math.abs(this.pY - _local4)) < 4) {
var _local8 = Game.singleton.getSceneMap().getRandomWalkableTile(this.pTile.mI, this.pTile.mJ, 7);
var _local9 = Math.abs(_local8.mI - this.pTile.mI) + Math.abs(_local8.mJ - this.pTile.mJ);
if (_local9 > 2) {
if ((((_local8.mI - _local2.getTile().mJ) * _local5) > 0) || (((_local8.mJ - _local2.getTile().mJ) * _local6) > 0)) {
var _local10 = new tinymantis.AStar(Game.singleton.getSceneMap());
var _local11 = _local10.findPathLimited(this.pTile.mI, this.pTile.mJ, _local8.mI, _local8.mJ, 100);
this.pWalkPath = _local11;
}
}
}
}
}
} else {
this.gotoState("idle");
}
};
_local1.flee_exit = function () {
this.mStateParam.mWalkSoundChannel = tinymantis.SoundManager.sSingleton.stopSound(this.mStateParam.mWalkSoundChannel);
};
_local1.ghost_enter = function () {
this.pMovieClip._visible = false;
this.pHealth = 0;
this.pFirstRun = false;
};
_local1.ghost_update = function () {
this.gotoState("recycle");
};
_local1.ghost_exit = function () {
this.pMovieClip._visible = true;
};
_local1.setConfuseEffect = function (effect) {
if (effect && (effect.length)) {
if (this.pConfuseEffect == null) {
this.pConfuseEffect = new Object();
this.gotoState("idle");
this.pHateCaligula = 10;
if (this.pMovieClip.effect == undefined) {
var _local3 = this.pMovieClip.attachMovie("lib_effect_" + effect, "effect", this.pMovieClip.getNextHighestDepth());
_local3._x = 6;
_local3._y = ((this.getType() == "Rat") ? -26 : -90);
}
}
this.pConfuseEffect.timer = 300;
} else if (this.pConfuseEffect) {
this.pConfuseEffect = null;
if (this.pMovieClip.effect != undefined) {
this.pMovieClip.effect.removeMovieClip();
}
}
this.pCurrentTarget = null;
};
_local1.think_enter = function () {
this.pThinkTimer = 0;
this.pWalkPath = null;
this.pCurrentAttack = this.pAttackData[Math.floor(Math.random() * this.pAttackData.length)];
};
_local1.think_update = function () {
if (this.pConfuseEffect) {
if ((this.pConfuseEffect.timer != undefined) && ((--this.pConfuseEffect.timer) < 0)) {
this.setConfuseEffect(null);
}
}
if ((this.health > 0) && ((++this.pThinkTimer) > 30)) {
this.pThinkTimer = Math.min(25, Math.floor((Math.random() * Game.singleton.getLevelInfo().level) * 1.5));
var _local2 = Game.singleton.getCaligula();
var _local3 = this.getDistance(_local2);
if ((_local2.health == 0) || (!Game.singleton.isInState("run", 0))) {
this.pHateCaligula = 0;
}
var _local4 = this.pAwareOfCaligula;
if (!this.pAwareOfCaligula) {
this.pAwareOfCaligula = this.isInCamera(140) && ((_local2.health > 0) || (this.pHateCaligula > 0));
}
if (this.pAwareOfCaligula) {
if ((!_local4) && (this.pConfuseEffect == null)) {
this.pWalkPath = null;
}
if (_local3 < 240) {
var _local5 = "";
switch (this.getType()) {
case "Skeleton" :
case "Gladiator1" :
case "Gladiator2" :
case "GladiatorRed" :
break;
case "Rat" :
_local5 = "ocarina";
break;
default :
_local5 = "zampogna";
}
if ((_local5.length > 0) && (_local2.isInState(_local5, 1))) {
this.setConfuseEffect(_local5);
}
}
} else if (_local4 && (this.pConfuseEffect == null)) {
this.pWalkPath = null;
this.pCurrentTarget = null;
}
if (this.pCurrentTarget == null) {
if (this.pConfuseEffect || (this.pHateCaligula)) {
this.pCurrentTarget = this.findClosestEnermy();
if (this.pCurrentTarget != null) {
var _local6 = this.findTargetAttackTile(this.pCurrentTarget);
if (_local6 != this.pCurrentTarget.getTile()) {
var _local7 = new tinymantis.AStar(Game.singleton.getSceneMap());
var _local8 = _local7.findPathLimited(this.pCurrentTarget.getTile().mI, this.pCurrentTarget.getTile().mJ, _local6.mI, _local6.mJ, 70);
if ((_local8 == null) || (_local8.length == 0)) {
this.pCurrentTarget = null;
}
}
}
}
}
}
};
_local1.findTargetAttackTile = function (target) {
var _local3 = null;
if (target) {
if (this.pCurrentAttack.min_range > 0) {
var _local4 = ((target.X > this.X) ? -1 : 1);
var _local5 = Game.singleton.getSceneMap();
var _local6 = 0;
for ( ; (_local3 == null) && (_local6 < 2) ; _local6++) {
var _local7 = Math.floor((target.X + (this.pCurrentAttack.min_range * _local4)) / SceneMap.TILE_SIZE);
var _local8 = Math.floor((target.X + (this.pCurrentAttack.max_range * _local4)) / SceneMap.TILE_SIZE);
var _local9 = true;
var _local10 = target.getTile().mJ;
var _local11 = target.getTile().mI;
// unexpected jump
do {
_local11 = _local11 + _local4;
if (!_local9) {
break;
}
if (_local5.isTileWalkable(_local11, _local10)) {
if (((_local11 - _local7) * (_local11 - _local8)) <= 0) {
_local3 = _local5.getTile(_local11, _local10);
}
} else {
_local9 = false;
}
} while (_local11 != _local8);
_local4 = -_local4;
}
} else {
_local3 = target.getTile();
}
}
return(_local3);
};
_local1.findClosestEnermy = function () {
var _local2 = null;
var _local3 = 100000 /* 0x0186A0 */;
var _local4 = Game.singleton.getCharacters();
var _local5 = 0;
for ( ; _local5 < _local4.length ; _local5++) {
var _local6 = _local4[_local5];
if (((_local6.health > 0) || (_local6.isCaligula())) && (_local6.party != this.party)) {
var _local7 = this.getDistance(_local6);
if (_local7 < _local3) {
_local2 = _local6;
_local3 = _local7;
}
}
}
if (_local2 && (_local3 < 300)) {
return(_local2);
}
return(null);
};
_local1.death_enter = function () {
var _local3 = Game.singleton;
if ((this.pMovieClip.mDeathMode != "mild") && (this.isCloseToWater())) {
this.pMovieClip.mDeathMode = "mild";
}
super.death_enter();
this.setConfuseEffect(null);
var _local4 = _local3.getCaligula();
if ((_local4.health > 0) && (this.party != _local4.party)) {
_local3.addKill(this);
Game.singleton.addExp(this.pExp);
}
if (this.isInState("burning", 2)) {
this.gotoState("burning");
}
};
_local1.explosive_death_enter = function () {
this.death_enter();
this.pMovieClip.body._visible = false;
var _local2 = this.pMovieClip.attachMovie("lib_extreme_death", "extreme_death", this.pMovieClip.getNextHighestDepth());
_local2._y = -20;
this.mStateParam.death_timer = 0;
};
_local1.explosive_death_update = function () {
this.mStateParam.death_timer++;
if (this.mStateParam.death_timer > 150) {
this.gotoState("decay");
}
};
_local1.isDecayed = function () {
return(this.pDecayed);
};
_local1.decay_enter = function () {
super.decay_enter();
this.pDecayed = true;
};
_local1.decay_exit = function () {
this.pMovieClip.body._visible = true;
if (this.pMovieClip.extreme_death != undefined) {
this.pMovieClip.extreme_death.removeMovieClip();
}
this.pAwareOfCaligula = false;
var _local2 = Game.singleton.getCaligula();
if (this.party != _local2.party) {
var _local3 = Math.random();
if ((_local2.health / _local2.health_max) < 0.3) {
if (_local3 < 0.15) {
Game.singleton.dropRamen(RamenIcon.BLUE, this.X, this.Y);
} else if (_local3 < 0.22) {
Game.singleton.dropRamen(RamenIcon.GREEN, this.X, this.Y);
} else if (_local3 < 0.25) {
Game.singleton.dropRamen(RamenIcon.RED, this.X, this.Y);
}
} else if (_local3 < 0.03) {
Game.singleton.dropWeapon("kunai", this.X, this.Y, 0, 0);
} else if (_local3 < 0.06) {
Game.singleton.dropWeapon("senbon", this.X, this.Y, 0, 0);
} else if (_local3 < 0.09) {
Game.singleton.dropWeapon("shuriken", this.X, this.Y, 0, 0);
} else if (_local3 < 0.12) {
Game.singleton.dropWeapon("smoke", this.X, this.Y, 0, 0);
} else if (_local3 < 0.15) {
Game.singleton.dropWeapon("windmill", this.X, this.Y, 0, 0);
} else if (_local3 < 0.2) {
Game.singleton.dropRamen(RamenIcon.BLUE, this.X, this.Y);
} else if (_local3 < 0.23) {
Game.singleton.dropRamen(RamenIcon.GREEN, this.X, this.Y);
} else if (_local3 < 0.24) {
Game.singleton.dropRamen(RamenIcon.RED, this.X, this.Y);
}
}
};
_local1.burning_enter = function () {
var _local2 = this.pMovieClip.attachMovie("lib_fireflames", "fireflame" + Math.floor(Math.random() * 100), this.pMovieClip.getNextHighestDepth());
if (this.getType() == "Rat") {
if (this.health == 0) {
_local2._x = 60;
} else {
_local2._x = 0;
}
} else if (this.health > 0) {
_local2._y = (-this.pMovieClip._height) * 0.3;
} else {
_local2._x = 35;
_local2._y = 0;
var _local3 = _local2.attachMovie("lib_fireflames", "secondfire", _local2.getNextHighestDepth());
_local3._xscale = (_local3._yscale = 80);
_local3._x = -50;
}
this.mStateParam.mFireFlame = _local2;
this.mStateParam.mFireTimer = 0;
this.mStateParam.mFireCheck = 0;
};
_local1.burning_update = function () {
this.mStateParam.mFireTimer++;
if (this.mStateParam.mFireTimer > 30) {
this.mStateParam.mFireTimer = 0;
if (this.health > 0) {
this.health = this.health - (15 * AttackData.getAttackEffective("F", this.getType()));
if (this.health <= 0) {
this.pMovieClip.mDeathMode = "mild";
this.gotoState("death");
}
}
}
this.mStateParam.mFireCheck++;
if (this.mStateParam.mFireCheck > 10) {
this.mStateParam.mFireCheck = 0;
var _local2 = Game.singleton.getCaligula();
var _local3 = Game.singleton.getCharacters();
var _local4 = 0;
for ( ; _local4 < _local3.length ; _local4++) {
var _local5 = _local3[_local4];
if ((_local5 != this) && (_local5 != _local2)) {
if (!(_local5.isInState("burning", 2) || (_local5.isInState("decay", 0) || (_local5.isInState("ghost", 0))))) {
if ((_local5.getTile().mJ == this.pTile.mJ) && (_local5.getMovieClip().hitTest(this.mStateParam.mFireFlame))) {
_local5.gotoState("burning");
}
}
}
}
}
};
_local1.burning_exit = function () {
this.mStateParam.mFireFlame.removeMovieClip();
delete this.mStateParam.mFireFlame;
};
_local1.popoff_enter = function () {
this.pMovieClip.gotoAndStop("idle");
this.mStateParam.timer = -1 - Math.floor(Math.random() * 5);
};
_local1.popoff_update = function () {
this.mStateParam.timer++;
if (this.mStateParam.timer == 0) {
this.mStateParam.popsmoke = this.pMovieClip.attachMovie("lib_popsmoke", "popsmoke", this.pMovieClip.getNextHighestDepth());
} else if (this.mStateParam.timer > 5) {
this.pMovieClip.body._alpha = this.pMovieClip.body._alpha - 5;
}
};
_local1.popoff_exit = function () {
this.mStateParam.popsmoke.removeMovieClip();
};
ASSetPropFlags(_local1, null, 1);
}
#endinitclip
Symbol 20486 MovieClip [__Packages.Gladiator] Frame 0
#initclip
if (!Gladiator) {
//(_global.Gladiator = function (parent, libname, type) {
super(type);
this.initClip(parent, libname);
}) extends NPC
var _local1 = (_global.Gladiator /* register */).prototype;
_local1.isGladiator = function () {
return(true);
};
_local1.initialize = function () {
super.initialize();
};
_local1.init_update = function () {
super.init_update();
this.pHateCaligula = 10;
};
ASSetPropFlags(_local1, null, 1);
}
#endinitclip
Symbol 20487 MovieClip [__Packages.Necromancer] Frame 0
#initclip
if (!Necromancer) {
//(_global.Necromancer = function (parent, libname, type) {
super(parent, libname, type);
}) extends Gladiator
var _local1 = (_global.Necromancer /* register */).prototype;
_local1.isDecayed = function () {
if (this.pDecayed) {
var _local2 = Game.singleton.getCharacters();
var _local3 = 0;
for ( ; _local3 < _local2.length ; _local3++) {
var _local4 = _local2[_local3];
if (_local4.isSkeleton()) {
var _local5 = Skeleton(_local4);
if ((!_local5.isDead()) && (_local5.getOwner() == this)) {
return(false);
}
}
}
}
return(this.pDecayed);
};
ASSetPropFlags(_local1, null, 1);
}
#endinitclip
Symbol 20488 MovieClip [__Packages.SkyRegion] Frame 0
class SkyRegion
{
var pRect, mTiles;
function SkyRegion (inx, iny, inw, inh) {
pRect = new flash.geom.Rectangle(inx, iny, inw, inh);
}
function getBaseY() {
return(pRect.y + pRect.height);
}
function hitTest(inx, iny) {
return(pRect.contains(inx, iny));
}
function setTilesAlpha(alpha) {
var _local3 = 0;
for ( ; _local3 < mTiles.length ; _local3++) {
mTiles[_local3]._alpha = alpha;
}
}
//ASSetPropFlags(_local1, null, 1);
}
Symbol 20489 MovieClip [__Packages.Game] Frame 0
#initclip
if (!Game) {
//(_global.Game = function (root, firstRun) {
super("Game");
Game.singleton = this;
this.pFirstRun = firstRun;
this.pLevelDataMap = new Object();
this.pCurrentLevel = null;
this.pPrevLevel = null;
this.pNewGameMessages = null;
this.mEnergyTimer = 0;
this.pMicrophone = null;
this.pGameRankBase = 0;
this.mStartTime = null;
this.mTimePassed = 0;
this.pPrevLevelData = null;
this.pMapsVisited = new Object();
this.pMaxGore = false;
this.pLevelCompleted = new Array();
this.pWeaponPreparingFrame = 0;
this.pLevelJustCompleted = -1;
this.pCaligulaExp = 0;
this.pCaligulaLevel = null;
this.addExp(0);
this.pCaligulaStartPoint = new flash.geom.Point(0, 0);
this.pGameRoot = root.attachMovie("lib_game", "gameroot", root.getNextHighestDepth());
this.pGameRoot.onEnterFrame = tinymantis.Delegate.create(this, this.update);
this.pGameUI = new GameUI(this.pGameRoot.cGameUI);
this.pSceneMap = new SceneMap(this.pGameRoot.cSceneNode);
this.pMessageClip = this.pGameRoot.mMessages;
this.pCamera = new GameCamera();
this.pCamera.setRoot(this.pSceneMap.getRoot(""));
this.pCamera.setMap(this.pSceneMap);
this.pCurrentMusicChannel = -1;
this.pCaligulaWeaponStates = new Object();
var _local5 = CharacterInfo.singleton.getCharacterInfo("Caligula");
var _local6 = _local5.weapons;
var _local7 = 0;
for ( ; _local7 < _local6.length ; _local7++) {
var _local8 = new Object();
_local8.attackData = new AttackData(_local6[_local7]);
_local8.state = false;
this.pCaligulaWeaponStates[_local8.attackData.key] = _local8;
}
this.pInstructions = null;
this.gotoState("init");
this.pCaligulaHealth = 10000;
this.pCaligulaEnergy = 100;
this.mNumKills = 0;
this.mNumVisitedWorlds = 0;
this.mSkeletonResurrected = 0;
this.mTimesKilledByBee = 0;
this.mRatsKilled = 0;
this.mCheated = false;
this.pDimMask = this.pGameRoot.cDimMask;
this.enable_all_weapon(true);
this.pickWeapon("");
AS2_Tracker.singleton.trackNewEvent("new_game");
}) extends tinymantis.GameObject
var _local1 = (_global.Game /* register */).prototype;
_local1.showDimMask = function (showIcon, alpha) {
this.pDimMask._visible = true;
this.pDimMask._alpha = alpha;
this.pDimMask.mLoadingIcon._visible = showIcon;
};
_local1.addExp = function (exp) {
this.pCaligulaExp = this.pCaligulaExp + exp;
var _local3 = this.pCaligulaLevel;
this.pCaligulaLevel = CharacterInfo.singleton.getLevel(this.pCaligulaExp);
if ((_local3 != null) && (_local3.level != this.pCaligulaLevel.level)) {
this.showLevelUpMessage();
this.pCaligula.updateAttackData(this.pCaligulaLevel);
}
var _local4 = CharacterInfo.singleton.getNextLevel(this.pCaligulaLevel);
if (_local4 == this.pCaligulaLevel) {
this.pGameUI.updateExp(0, 0);
} else {
this.pGameUI.updateExp(this.pCaligulaExp - this.pCaligulaLevel.getExp(), _local4.getExp() - this.pCaligulaLevel.getExp());
}
};
_local1.cheatLevelup = function () {
var _local2 = CharacterInfo.singleton.getExp(CharacterInfo.singleton.getLevel(this.pCaligulaExp).level + 1);
this.addExp(_local2 - this.pCaligulaExp);
};
_local1.getLevelInfo = function () {
return(this.pCaligulaLevel);
};
_local1.getExp = function () {
return(this.pCaligulaExp);
};
_local1.getMapRoot = function () {
return(this.pGameRoot.mMapRoot);
};
_local1.getLevelNumber = function (inLevel) {
var _local3 = inLevel.split("-");
var _local4 = _global.parseInt(_local3[0]);
return(_local4);
};
_local1.levelCompleted = function () {
this.pLevelJustCompleted = this.getLevelNumber(this.pCurrentLevel);
if (tinymantis.Utils.arrayIndexOf(this.pLevelCompleted, this.pLevelJustCompleted) >= 0) {
this.pLevelJustCompleted = -1;
} else {
this.pLevelCompleted.push(this.pLevelJustCompleted);
}
this.gotoState("complete");
this.saveGame();
};
_local1.getLevelJustCompleted = function () {
return(this.pLevelJustCompleted);
};
_local1.levelFailed = function () {
this.gotoState("failed");
};
_local1.isMaxGore = function () {
return(this.pMaxGore);
};
_local1.isInOrgyRoom = function () {
return(this.pSceneMap.levelData.isOrgyRoom());
};
_local1.getCaligulaHealth = function () {
return(this.pCaligulaHealth);
};
_local1.getCaligulaEnergy = function () {
return(this.pCaligulaEnergy);
};
_local1.showGoMessage = function () {
this.pMessageClip.gotoAndStop("go");
};
_local1.showLevelUpMessage = function () {
this.pCaligula.gotoState("levelup");
};
_local1.getTimePassed = function () {
var _local2 = this.mTimePassed;
if (this.mStartTime) {
var _local3 = new Date();
_local2 = _local2 + (_local3.getTime() - this.mStartTime.getTime());
}
return(_local2);
};
_local1.getMinutesPassed = function () {
var _local2 = this.getTimePassed();
return(Math.floor(_local2 / 60000));
};
_local1.getNumSkulls = function () {
var _local2 = 0;
for (var mapname in this.pMapsVisited) {
var _local3 = this.pMapsVisited[mapname];
if (_local3.skull == true) {
_local2++;
}
}
return(_local2);
};
_local1.addKill = function (char) {
if (char.getValue() > 0) {
this.mNumKills++;
var _local3 = this.pSceneMap.levelData;
if ((++_local3.mNumKills) == _local3.getSkullKills()) {
this.saveGame();
}
}
};
_local1.getPopScoreRoot = function () {
return(this.pGameRoot.cSceneNode.cPopScores);
};
_local1.loadSavedGame = function () {
var _local2 = Constant.getCookie();
if (_local2.data.saved == "yes") {
this.pLevelCompleted = _local2.data.levelsCompleted;
this.addExp(_local2.data.narutoExp);
}
};
_local1.saveGame = function () {
var _local2 = Constant.getCookie();
_local2.data.saved = "yes";
_local2.data.levelsCompleted = this.pLevelCompleted;
_local2.data.narutoExp = this.pCaligulaExp;
_local2.flush();
};
_local1.initLevel = function (map, startx, starty) {
this.setStartWeapon("D");
this.pStartMap = map;
this.pCaligulaStartPoint.x = startx;
this.pCaligulaStartPoint.y = starty;
};
_local1.getNumActivatedWeapons = function () {
var _local2 = 0;
for (var key in this.pCaligulaWeaponStates) {
if (this.pCaligulaWeaponStates[key].state) {
_local2++;
}
}
return(_local2);
};
_local1.getTotalWeapons = function () {
var _local2 = 0;
for (var key in this.pCaligulaWeaponStates) {
_local2++;
}
return(_local2);
};
_local1.enable_all_weapon = function (enableManhood) {
this.earnWeapon("A");
this.earnWeapon("B");
this.earnWeapon("C");
this.earnWeapon("D");
this.earnWeapon("E");
this.earnWeapon("F");
this.earnWeapon("G");
this.earnWeapon("H");
this.earnWeapon("I");
this.earnWeapon("J");
this.earnWeapon("K");
this.earnWeapon("L");
if (enableManhood) {
this.earnWeapon("M");
}
this.earnWeapon("N");
this.earnWeapon("O");
this.earnWeapon("P");
this.earnWeapon("Q");
this.earnWeapon("R");
this.earnWeapon("S");
this.earnWeapon("T");
this.earnWeapon("U");
this.earnWeapon("V");
this.earnWeapon("W");
this.earnWeapon("X");
this.earnWeapon("Y");
this.earnWeapon("Z");
this.pStartNumWeapons = this.getNumActivatedWeapons();
};
_local1.init_update = function () {
this.loadLevel(this.pStartMap, this.pCaligulaStartPoint.x, this.pCaligulaStartPoint.y);
this.pGameUI.setEnabled(false);
this.pStartNumWeapons = this.getNumActivatedWeapons();
};
_local1.getStartNumWeapons = function () {
return(this.pStartNumWeapons);
};
_local1.earnWeapon = function (key) {
var _local3 = this.pCaligulaWeaponStates[key];
if (_local3.state == false) {
_local3.state = true;
if (this.pCaligula) {
this.pCaligula.addAttackData(_local3.attackData);
}
var _local4 = 0;
for ( ; _local4 < this.pWeaponIcons.length ; _local4++) {
var _local5 = WeaponIcon(this.pWeaponIcons[_local4]);
if (_local5.getKey() == key) {
_local5.recycle();
}
}
}
};
_local1.pickWeapon = function (key) {
if (!this.pJustPickedWeapon) {
this.pCaligula.setWeaponAttack(key);
this.pJustPickedWeapon = true;
return(true);
}
return(false);
};
_local1.getWeaponStates = function () {
return(this.pCaligulaWeaponStates);
};
_local1.getStartPoint = function () {
return(this.pCaligulaStartPoint);
};
_local1.setStartWeapon = function (w) {
this.earnWeapon(w);
this.pCaligulaStartWeapon = w;
};
_local1.getStartWeapon = function () {
return(this.pCaligulaStartWeapon);
};
_local1.getCamera = function () {
return(this.pCamera);
};
_local1.getCharacters = function () {
return(this.pCharacters);
};
_local1.getCaligula = function () {
return(this.pCaligula);
};
_local1.getGameUI = function () {
return(this.pGameUI);
};
_local1.getSceneMap = function () {
return(this.pSceneMap);
};
_local1.update_triggers = function () {
var _local2 = this.pCaligula.getTile();
if (_local2) {
var _local3 = this.pSceneMap.levelData.getTriggers();
var _local4 = 0;
for ( ; _local4 < _local3.length ; _local4++) {
var _local5 = _local3[_local4];
_local5.update();
if ((_local5.getTileI() == _local2.mI) && (_local5.getTileJ() == _local2.mJ)) {
_local5.activate();
}
}
}
};
_local1.stop_triggers = function () {
var _local2 = this.pSceneMap.levelData.getTriggers();
var _local3 = 0;
for ( ; _local3 < _local2.length ; _local3++) {
var _local4 = _local2[_local3];
_local4.stopScript();
}
};
_local1.isLevelVisited = function (inLevel) {
for (var levelStr in this.pLevelDataMap) {
var _local3 = this.getLevelNumber(levelStr);
if (inLevel == _local3) {
return(true);
}
}
return(false);
};
_local1.isLevelLocked = function (inLevel) {
if (tinymantis.Utils.arrayIndexOf(this.pLevelCompleted, inLevel) < 0) {
if ((inLevel > 1) && (tinymantis.Utils.arrayIndexOf(this.pLevelCompleted, inLevel - 1) < 0)) {
return(true);
}
}
return(false);
};
_local1.isLevelComplete = function (inLevel) {
return(tinymantis.Utils.arrayIndexOf(this.pLevelCompleted, inLevel) >= 0);
};
_local1.getPrevLevelNumber = function () {
if (this.pPrevLevel) {
return(this.getLevelNumber(this.pPrevLevel));
}
return(-1);
};
_local1.getCurrentLevel = function () {
return(this.pCurrentLevel);
};
_local1.loadLevel = function (level, startI, startJ) {
this.pMessageClip.gotoAndStop("none");
if (this.pCurrentLevel != null) {
this.pPrevLevel = this.pCurrentLevel;
}
this.pPrevLevelData = this.getLevelData(this.pPrevLevel);
this.pCurrentLevel = level;
if (this.pCurrentLevel == null) {
for (var mapname in this.pLevelDataMap) {
this.getLevelData(mapname).reset();
}
this.pFirstRun = true;
this.pCaligulaStartPoint.x = -1;
this.pCaligulaStartPoint.y = -1;
this.pWeaponPreparingFrame = 1000000 /* 0x0F4240 */;
} else {
this.pCaligulaStartPoint.x = startI;
this.pCaligulaStartPoint.y = startJ;
this.saveGame();
}
this.gotoState("recycle");
this.getLevelData(this.pCurrentLevel);
};
_local1.getLevelData = function (level) {
if (level && (level.length > 0)) {
var _local3 = this.pLevelDataMap[level];
if ((_local3 == null) || (_local3 == undefined)) {
_local3 = new LevelData(level);
this.pLevelDataMap[level] = _local3;
}
_local3.load();
return(_local3);
}
return(null);
};
_local1.getMapVisited = function (level) {
if (this.pMapsVisited[level] == undefined) {
return(null);
}
return(this.pMapsVisited[level]);
};
_local1.createCharacter = function (parent, type) {
var _local4 = null;
if (type == "Caligula") {
_local4 = new Caligula(parent);
} else {
var _local5 = CharacterInfo.singleton.getCharacterInfo(type);
switch (_local5.ai) {
case "plebs" :
_local4 = new Plebian(parent, _local5.lib, type);
break;
case "jumper" :
_local4 = new Jumper(parent, _local5.lib, type);
break;
case "fighter" :
_local4 = new Gladiator(parent, _local5.lib, type);
break;
case "necromancer" :
_local4 = new Necromancer(parent, _local5.lib, type);
break;
case "skeleton" :
_local4 = new Skeleton(parent, _local5.lib, type);
break;
case "orgy" :
_local4 = new Orgy(parent, _local5.lib, type);
break;
case "gaarr" :
_local4 = new Gaarr(parent, _local5.lib, type);
}
}
if (_local4) {
_local4.initialize();
this.pCharacters.push(_local4);
}
return(_local4);
};
_local1.loadCharacters = function () {
ThrowObject.initPool(this.pSceneMap.getRoot("chars"));
var _local2 = this.pSceneMap.getRoot("chars");
var _local4 = this.pSceneMap.levelData.mMobs;
var _local5 = 0;
for ( ; _local5 < _local4.length ; _local5++) {
var _local6 = _local4[_local5];
if (_local6.type == "Naruto") {
if ((this.pCaligulaStartPoint.x < 0) || (this.pCaligulaStartPoint.y < 0)) {
this.pCaligulaStartPoint = new flash.geom.Point(_local6.i, _local6.j);
this.pFirstRun = true;
}
} else {
var _local7 = NPC(this.createCharacter(_local2, _local6.type));
_local7.loadData(_local6);
}
}
this.pCaligula = Caligula(this.createCharacter(_local2, "Caligula"));
var _local8 = this.pSceneMap.levelData.mWeaponIcons;
var _local9 = 0;
for ( ; _local9 < _local8.length ; _local9++) {
var _local10 = _local8[_local9];
if (!_local10.picked) {
var _local11 = new WeaponIcon(_local10.type, _local10);
_local11.initialize(_local2, (_local10.i + 0.5) * SceneMap.TILE_SIZE, (_local10.j + 0.5) * SceneMap.TILE_SIZE);
this.pWeaponIcons.push(_local11);
}
}
_local8 = this.pSceneMap.levelData.mBreakableObjects;
var _local12 = 0;
for ( ; _local12 < _local8.length ; _local12++) {
var _local13 = _local8[_local12];
var _local14 = new BreakableObject(_local2, "obj_" + _local13.type, _local13.i, _local13.j);
_local14.fixCanwalkArray(this.pSceneMap.levelData.mWidth, this.pSceneMap.getCanWalkArray(), false);
this.pBreakableObjects.push(_local14);
}
};
_local1.dropWeapon = function (weaponType, inx, iny, vx, vy) {
if (this.pCurrentWeaponKey != this.pCaligula.getAttackDataByType(weaponType).key) {
var _local7 = this.pSceneMap.getRoot("chars");
var _local8 = new WeaponIcon(weaponType, null);
_local8.initialize(_local7, inx, iny);
_local8.drop(vx, vy);
_local8.fadeout();
this.pWeaponIcons.push(_local8);
}
};
_local1.dropRamen = function (ramenType, inx, iny) {
var _local5 = this.pSceneMap.getRoot("chars");
var _local6 = new RamenIcon(ramenType);
_local6.initialize(_local5, inx, iny);
_local6.fadeout();
this.pRamenIcons.push(_local6);
};
_local1.getBreakableObjects = function () {
return(this.pBreakableObjects);
};
_local1.__get__mCaligula = function () {
return(this.pCaligula);
};
_local1.createThrowObject = function (owner, attackdata) {
var _local4 = this.pSceneMap.getRoot("chars");
var _local5 = ThrowObject.getWeaponFromPool(owner, attackdata);
this.pThrowObjects.push(_local5);
return(_local5);
};
_local1.setLoadingStep = function (step) {
};
_local1.loaddata_enter = function () {
this.pThrowObjects = new Array();
this.pCharacters = new Array();
this.pWeaponIcons = new Array();
this.pRamenIcons = new Array();
this.pBreakableObjects = new Array();
this.pCaligula = null;
this.setLoadingStep("load data:" + this.pCurrentLevel);
};
_local1.loaddata_update = function () {
var _local2 = this.getLevelData(this.pCurrentLevel);
if (_local2.loaded) {
if ((this.pSceneMap.levelData == null) || (_local2.mTileset != this.pSceneMap.levelData.mTileset)) {
if (!(_local2.isOrgyRoom() || (this.pSceneMap.levelData && (this.pSceneMap.levelData.isOrgyRoom() && (_local2.mTileset == "forum"))))) {
this.pGameRoot.cMapLoading.tileset = _local2.mTileset;
this.pGameRoot.cMapLoading.gotoAndPlay(2);
}
}
this.pSceneMap.levelData = _local2;
if (this.pSceneMap.tilesetLoaded) {
this.gotoState("loadmap");
} else {
this.pSceneMap.getRoot("").gotoAndPlay("loading");
this.gotoState("loadtileset");
}
}
};
_local1.hideSceneNode = function () {
this.pGameRoot.cSceneNode._visible = false;
};
_local1.setMusicVolume = function (vol) {
if (this.pCurrentMusicChannel >= 0) {
tinymantis.SoundManager.sSingleton.setVolume(this.pCurrentMusicChannel, vol);
}
};
_local1.startMusic = function () {
if (this.pCurrentMusicChannel < 0) {
if (this.pCurrentLevel.indexOf("9-") == -1) {
this.pCurrentMusicChannel = tinymantis.SoundManager.sSingleton.playSound("new_level_music.aif", true, 100);
}
}
Main.stopSplashMusic();
};
_local1.stopMusic = function () {
if (this.pCurrentMusicChannel >= 0) {
this.pCurrentMusicChannel = tinymantis.SoundManager.sSingleton.stopSound(this.pCurrentMusicChannel);
}
};
_local1.loadtileset_update = function () {
this.setLoadingStep("load tileset");
if (this.pSceneMap.tilesetLoaded || (this.pSceneMap.loadTileset())) {
this.gotoState("loadmap");
}
};
_local1.loadmap_enter = function () {
this.setLoadingStep("load map");
this.pGameRoot.cSceneNode._visible = false;
var _local2 = new Array();
for (var mapname in this.pLevelDataMap) {
var _local3 = this.pLevelDataMap[mapname];
if (tinymantis.Utils.arrayIndexOf(_local2, _local3.mTileset) < 0) {
_local2.push(_local3.mTileset);
}
}
this.mNumVisitedWorlds = _local2.length;
};
_local1.loadmap_update = function () {
if (this.pGameRoot.cMapLoading._currentframe < this.pGameRoot.cMapLoading._totalframes) {
var _local2 = 2;
var _local3 = 9;
if (this.pGameRoot.cMapLoading._currentframe > _local2) {
var _local4 = this.pSceneMap.getBytesLoaded() / this.pSceneMap.getBytesTotal();
if ((_local4 < 1) || (this.pGameRoot.cMapLoading._currentframe < _local3)) {
var _local5 = _local2 + Math.round((_local3 - _local2) * _local4);
this.pGameRoot.cMapLoading.gotoAndPlay(_local5);
}
}
} else if (this.pSceneMap.loaded) {
this.gotoState("run");
this.pSceneMap.buildMap();
this.pSceneMap.buildObjects();
this.loadCharacters();
this.run_update();
this.pickWeapon(this.pCurrentBackupKey);
this.pJustPickedWeapon = false;
this.pickWeapon(this.pCurrentWeaponKey);
}
};
_local1.loadmap_exit = function () {
this.pCamera.initScreen(this.pCaligula);
this.pCamera.update();
this.pGameRoot.cSceneNode._visible = true;
if (this.isInOrgyRoom()) {
this.pCurrentMusicChannel = tinymantis.SoundManager.sSingleton.stopSound(this.pCurrentMusicChannel);
}
Main.mFpsMeter.setExtra(this.pSceneMap.levelData.mName);
};
_local1.update_DimMask = function () {
if (this.pDimMask._visible) {
this.pDimMask._alpha = this.pDimMask._alpha - 15;
if (this.pDimMask._alpha <= 0) {
this.pDimMask._visible = false;
}
}
return(this.pDimMask._visible);
};
_local1.run_enter = function () {
if (this.pFirstRun) {
this.pMessageClip.gotoAndStop("readygo");
this.pFirstRun = false;
this.pWaitSeconds = 75;
} else {
this.pWaitSeconds = 0;
}
this.startMusic();
this.mStartTime = new Date();
tinymantis.SoundManager.sSingleton.sfxon = true;
this.pCaligula.updateAttackData(this.pCaligulaLevel);
this.pGameUI.gotoState("show");
this.pGameUI.setWeaponPreparingFrame(this.pWeaponPreparingFrame);
this.pLevelJustCompleted = -1;
_root._quality = "BEST";
};
_local1.getWaitSeconds = function () {
return(this.pWaitSeconds);
};
_local1.update_throw_objects = function () {
var _local2 = 0;
for ( ; _local2 < this.pThrowObjects.length ; _local2++) {
var _local3 = ThrowObject(this.pThrowObjects[_local2]);
_local3.update();
if (_local3.isDead()) {
_local3.destroy();
this.pThrowObjects[_local2] = this.pThrowObjects[this.pThrowObjects.length - 1];
this.pThrowObjects.pop();
_local2--;
}
}
};
_local1.run_update = function () {
var _local2 = this.pSceneMap.getRoot("chars");
if (_local2._quality != "LOW") {
_local2._quality = "LOW";
}
this.pJustPickedWeapon = false;
this.update_DimMask();
this.update_triggers();
if (this.pWaitSeconds > 0) {
this.pWaitSeconds--;
this.pGameUI.setEnabled(this.pWaitSeconds <= 0);
} else {
var _local3 = 0;
for ( ; _local3 < this.pCharacters.length ; _local3++) {
var _local4 = Character(this.pCharacters[_local3]);
_local4.update();
if (_local4.isDead()) {
this.pCharacters[_local3] = this.pCharacters[this.pCharacters.length - 1];
this.pCharacters.pop();
_local3--;
}
}
}
this.update_throw_objects();
var _local5 = 0;
for ( ; _local5 < this.pWeaponIcons.length ; _local5++) {
var _local6 = WeaponIcon(this.pWeaponIcons[_local5]);
_local6.update();
if (_local6.isDead()) {
_local6.destroy();
this.pWeaponIcons[_local5] = this.pWeaponIcons[this.pWeaponIcons.length - 1];
this.pWeaponIcons.pop();
_local5--;
}
}
var _local7 = 0;
for ( ; _local7 < this.pRamenIcons.length ; _local7++) {
var _local8 = RamenIcon(this.pRamenIcons[_local7]);
_local8.update();
if (_local8.isDead()) {
_local8.destroy();
this.pRamenIcons[_local7] = this.pRamenIcons[this.pRamenIcons.length - 1];
this.pRamenIcons.pop();
_local7--;
}
}
if (this.pCaligula.health > 0) {
if (this.mEnergyTimer > 0) {
if ((--this.mEnergyTimer) == 0) {
this.pCaligula.energy = 0;
}
}
if (Constant.MICROPHONE) {
if (this.pMicrophone == null) {
this.pMicrophone = new tinymantis.GameMicrophone(this.pGameRoot.cSceneNode);
}
this.pMicrophone.update();
if ((this.pCaligula.energy < this.pCaligula.energy_max) && ((this.pCaligula.health > 0) && (this.pMicrophone.getNormalizedLevel() > 0.7))) {
this.pCaligula.energy = this.pCaligula.energy + 0.5;
}
}
}
this.pCamera.update();
this.pGameUI.update();
};
_local1.run_exit = function () {
this.mTimePassed = this.getTimePassed();
this.mStartTime = null;
this.pGameUI.setEnabled(false);
this.pWeaponPreparingFrame = this.pGameUI.getWeaponPreparingFrame();
this.pCurrentBackupKey = this.pCaligula.getBackupWeaponKey();
this.pCurrentWeaponKey = this.pCaligula.getCurrentWeaponKey();
this.pCaligulaHealth = this.pCaligula.health;
this.pCaligulaEnergy = this.pCaligula.energy;
this.setStartWeapon(this.pCaligula.currentAttack.key);
this.pGameUI.gotoState("hide");
this.pGameUI.update();
this.pCaligula.playRagedSound(false);
tinymantis.SoundManager.sSingleton.sfxon = false;
};
_local1.messages_enter = function () {
this.pMessageClip.gotoAndStop("readygo");
this.pFirstRun = false;
};
_local1.messages_update = function () {
this.gotoState("run");
};
_local1.setupMinimapBase = function () {
var _local2 = this.pSceneMap.levelData;
this.pMinimap.cMapLabel.gotoAndStop(_local2.mTileset);
this.pMinimap.cMapBody.gotoAndStop(_local2.mTileset);
};
_local1.setupMinimapDetail = function () {
var _local2 = this.pSceneMap.levelData;
var _local3 = this.pMinimap.cMapBody;
for (var mapname in this.pMapsVisited) {
var _local4 = this.pMapsVisited[mapname];
if (_local4.tileset == _local2.mTileset) {
var _local5 = 2;
if (_local4.skull) {
_local5 = 1;
}
var _local6 = _local3.body[mapname];
_local6.gotoAndStop(_local5);
if (_local2.mName == mapname) {
_local3.cCaligula._x = (_local6._x + _local6._parent._x) + (_local6._width / 2);
_local3.cCaligula._y = (_local6._y + _local6._parent._y) + (_local6._height / 2);
}
}
}
};
_local1.playMenuSound = function () {
if (this.pCurrentMusicChannel >= 0) {
tinymantis.SoundManager.sSingleton.stopSound(this.pCurrentMusicChannel);
}
this.pCurrentMusicChannel = tinymantis.SoundManager.sSingleton.playSound("menu.wav", true, 100);
Main.stopSplashMusic();
};
_local1.pause_enter = function () {
var _local2 = 0;
for ( ; _local2 < this.pCharacters.length ; _local2++) {
var _local3 = this.pCharacters[_local2];
_local3.setGamePause(true);
}
tinymantis.SoundManager.sSingleton.sfxon = true;
};
_local1.pause_update = function () {
if (_root._quality != "BEST") {
_root._quality = "BEST";
}
};
_local1.pause_exit = function () {
var _local2 = 0;
for ( ; _local2 < this.pCharacters.length ; _local2++) {
var _local3 = this.pCharacters[_local2];
_local3.setGamePause(false);
}
};
_local1.recycle_enter = function () {
if (_root._quality != "BEST") {
_root._quality = "BEST";
}
this.showDimMask(true, 0);
this.pGameUI.gotoState("hide");
this.pGameUI.setScreenLock(false);
};
_local1.recycle_update = function () {
if (this.pDimMask._alpha < 100) {
this.pDimMask._alpha = this.pDimMask._alpha + 20;
this.pGameUI.update();
} else {
this.pGameRoot.cSceneNode._visible = false;
this.stop_triggers();
if (this.pCharacters) {
var _local2 = 0;
for ( ; _local2 < this.pCharacters.length ; _local2++) {
var _local3 = this.pCharacters[_local2];
_local3.gotoState("recycle");
_local3.update();
_local3.update();
}
this.pCharacters = null;
}
this.pCaligula = null;
if (this.pThrowObjects) {
var _local4 = 0;
for ( ; _local4 < this.pThrowObjects.length ; _local4++) {
this.pThrowObjects[_local4].destroy();
}
this.pThrowObjects = null;
}
this.pSceneMap.clean();
if (this.pCurrentLevel) {
this.gotoState("loaddata");
}
}
};
_local1.gameover_enter = function () {
this.saveGame();
if (this.pCurrentMusicChannel >= 0) {
this.pCurrentMusicChannel = tinymantis.SoundManager.sSingleton.stopSound(this.pCurrentMusicChannel);
}
Main.gameOverScreen();
};
_local1.gameover_update = function () {
this.run_update();
};
_local1.gameover_exit = function () {
if (this.pCurrentMusicChannel >= 0) {
this.pCurrentMusicChannel = tinymantis.SoundManager.sSingleton.stopSound(this.pCurrentMusicChannel);
}
this.recycle_update();
this.pGameRoot.removeMovieClip();
this.pGameRoot = null;
};
_local1.allGotoIdle = function () {
var _local2 = 0;
for ( ; _local2 < this.pCharacters.length ; _local2++) {
var _local3 = this.pCharacters[_local2];
if ((!_local3.isCaligula()) && (_local3.health > 0)) {
_local3.gotoState("idle");
_local3.update();
}
}
};
_local1.complete_enter = function () {
this.pWeaponPreparingFrame = 0;
this.stop_triggers();
this.pMessageClip.gotoAndStop("levelcomplete");
if (this.pCurrentMusicChannel >= 0) {
this.pCurrentMusicChannel = tinymantis.SoundManager.sSingleton.stopSound(this.pCurrentMusicChannel);
}
tinymantis.SoundManager.sSingleton.sfxon = true;
this.pCurrentMusicChannel = tinymantis.SoundManager.sSingleton.playSound("interface_level_complete.aif", false, 100);
this.pCaligula.clip.gotoAndStop("level_complete");
this.pCaligula.setGamePause(true);
var _local2 = 0;
for ( ; _local2 < this.pCharacters.length ; _local2++) {
var _local3 = this.pCharacters[_local2];
if ((!_local3.isCaligula()) && (_local3.health > 0)) {
_local3.gotoState("popoff");
_local3.gotoState("null");
}
}
this.showDimMask(false, 0);
};
_local1.complete_update = function () {
this.update_throw_objects();
var _local2 = 0;
for ( ; _local2 < this.pCharacters.length ; _local2++) {
var _local3 = this.pCharacters[_local2];
if ((!_local3.isCaligula()) && (_local3.health > 0)) {
_local3.update();
}
}
if (!tinymantis.SoundManager.sSingleton.isChannelPlaying(this.pCurrentMusicChannel)) {
var _local4 = this.getLevelNumber(this.pCurrentLevel);
if (_local4 == 9) {
this.pDimMask._visible = false;
this.allGotoIdle();
this.pCurrentMusicChannel = -1;
this.pCaligulaHealth = this.pCaligula.health_max;
this.loadLevel(null, 0, 0);
this.stopMusic();
this.gotoState("gamecomplete");
} else {
this.pDimMask._alpha = this.pDimMask._alpha + 5;
if (this.pDimMask._alpha >= 100) {
this.allGotoIdle();
this.pCurrentMusicChannel = -1;
this.pCaligulaHealth = this.pCaligula.health_max;
this.loadLevel(null, 0, 0);
this.stopMusic();
LevelMap.singleton.initialize();
}
}
}
};
_local1.gameCompleteMessageCallback = function () {
LevelMap.singleton.initialize();
this.gotoState("recycle");
};
_local1.gamecomplete_enter = function () {
this.pMessageClip.gotoAndStop("gamecomplete");
};
_local1.failed_enter = function () {
this.stop_triggers();
this.pMessageClip.gotoAndStop("death");
this.pWeaponPreparingFrame = 0;
if (this.pCurrentMusicChannel >= 0) {
this.pCurrentMusicChannel = tinymantis.SoundManager.sSingleton.stopSound(this.pCurrentMusicChannel);
}
tinymantis.SoundManager.sSingleton.sfxon = true;
this.pCurrentMusicChannel = tinymantis.SoundManager.sSingleton.playSound("interface_level_complete.aif", false, 100);
this.showDimMask(false, 0);
};
_local1.gameoverupdate = function () {
var _local2 = 0;
for ( ; _local2 < this.pCharacters.length ; _local2++) {
var _local3 = Character(this.pCharacters[_local2]);
if (!_local3.isCaligula()) {
_local3.update();
if (_local3.isDead()) {
this.pCharacters[_local2] = this.pCharacters[this.pCharacters.length - 1];
this.pCharacters.pop();
_local2--;
}
}
}
this.update_throw_objects();
};
_local1.failed_update = function () {
this.update_throw_objects();
if ((!tinymantis.SoundManager.sSingleton.isChannelPlaying(this.pCurrentMusicChannel)) && (this.pMessageClip._currentframe == 1)) {
this.pDimMask._alpha = this.pDimMask._alpha + 10;
if (this.pDimMask._alpha >= 100) {
this.allGotoIdle();
this.pCurrentMusicChannel = -1;
this.pCaligulaHealth = this.pCaligula.health_max;
this.loadLevel(null, 0, 0);
this.stopMusic();
LevelMap.singleton.initialize();
}
} else {
this.gameoverupdate();
}
};
(_global.Game /* register */).initStateMachine = function () {
tinymantis.GameObject.buildStateGroup("Game", new Array("init", "loaddata", "loadtileset", "loadmap", "run", "complete", "gamecomplete", "failed", "pause", "messages", "recycle", "gameover", "none"), 0);
};
_local1.addProperty("mCaligula", _local1.__get__mCaligula, function () {
});
ASSetPropFlags(_local1, null, 1);
}
#endinitclip
Symbol 20490 MovieClip [__Packages.tinymantis.GameMicrophone] Frame 0
class tinymantis.GameMicrophone
{
var pMicrophone, pMinLevel, pMaxLevel, pNormalizedLevel;
function GameMicrophone (clip) {
pMicrophone = Microphone.get();
if (pMicrophone) {
clip.attachAudio(pMicrophone);
var _local3 = new Sound(clip);
_local3.setVolume(0);
}
pMinLevel = 100;
pMaxLevel = 0;
pNormalizedLevel = 0;
}
function update() {
if (pMicrophone && (pMicrophone.activityLevel >= 0)) {
var _local2 = 5;
var _local3 = Math.round(pMicrophone.activityLevel / _local2) * _local2;
pMinLevel = Math.min(pMinLevel, _local3);
pMaxLevel = Math.max(pMaxLevel, _local3);
if (pMinLevel < (pMaxLevel - 10)) {
pNormalizedLevel = (_local3 - pMinLevel) / (pMaxLevel - pMinLevel);
}
}
}
function getNormalizedLevel() {
return(pNormalizedLevel);
}
}
Symbol 20491 MovieClip [__Packages.tinymantis.StateMachine] Frame 0
class tinymantis.StateMachine
{
var mNextState, mCurrState, mParent;
function StateMachine (inParent) {
mNextState = null;
mCurrState = null;
if (inParent == null) {
throw new Error("StateMachine : cannot initialize: inParent is null");
}
mParent = inParent;
}
function resetState() {
mParent[mCurrState + "_exit"]();
mCurrState = (mNextState = null);
}
function setState(inState) {
if (inState == null) {
throw new Error("StateMachine : cannot setState: inState is null; Use resetState instead.");
}
mNextState = inState;
}
function isState(inState) {
if (mNextState) {
return(mNextState == inState);
}
return(mCurrState == inState);
}
function update() {
if (mNextState) {
if (mCurrState) {
mParent[mCurrState + "_exit"]();
}
mCurrState = mNextState;
mNextState = null;
mParent[mCurrState + "_enter"]();
}
if (mCurrState != null) {
mParent[mCurrState + "_update"]();
}
}
function run(yes) {
mParent[mCurrState + "_run"](yes);
}
}
Symbol 20492 MovieClip [__Packages.LevelInfo] Frame 0
class LevelInfo
{
var pValues;
function LevelInfo () {
pValues = new Object();
}
function parseXML(node) {
for (var key in node.attributes) {
pValues[key] = _global.parseInt(node.attributes[key]);
}
}
function getValue(key) {
return(pValues[key]);
}
function __get__level() {
return(getValue("lvl"));
}
function getExp() {
return(getValue("exp"));
}
function getPunch() {
return(getValue("punch"));
}
function getKick() {
return(getValue("kick"));
}
function enoughExp(exp) {
return(exp >= getValue("exp"));
}
//_local1.addProperty("level", _local1.__get__level, function () {
});
//ASSetPropFlags(_local1, null, 1);
}
Symbol 20493 MovieClip [__Packages.Caligula] Frame 0
#initclip
if (!Caligula) {
//(_global.Caligula = function (parent) {
super("Caligula");
this.initClip(parent, "lib_caligula");
this.setInControl(true);
this.pVespiarySound = -1;
this.pRagedSound = -1;
this.pEnergyRefillTimer = 0;
this.pCurrentWeaponAttack = null;
this.pCurrentBackupWeapon = null;
this.pKeyDownMap = new Object();
this.pKeyPressed = new Object();
this.pKeyCodes = new Array();
this.pKeyCodes.push(Key.SPACE);
this.pKeyCodes.push(tinymantis.Utils.getKeyCode("X"));
this.pKeyCodes.push(tinymantis.Utils.getKeyCode("1"));
this.pKeyCodes.push(tinymantis.Utils.getKeyCode("2"));
this.pKeyCodes.push(tinymantis.Utils.getKeyCode("3"));
this.pKeyCodes.push(tinymantis.Utils.getKeyCode("4"));
this.pKeyCodes.push(tinymantis.Utils.getKeyCode("5"));
this.pKeyCodes.push(tinymantis.Utils.getKeyCode("6"));
this.pKeyCodes.push(tinymantis.Utils.getKeyCode("7"));
}) extends Character
var _local1 = (_global.Caligula /* register */).prototype;
_local1.setInControl = function (yes) {
this.pInControl = yes;
};
_local1.checkVespiarySound = function () {
if ((this.pCurrentAttack.key == "V") && (this.health > 0)) {
if (this.pVespiarySound < 0) {
this.pVespiarySound = tinymantis.SoundManager.sSingleton.playSound("caligula_bees.aif", true, 80);
}
} else if (this.pVespiarySound >= 0) {
this.pVespiarySound = tinymantis.SoundManager.sSingleton.stopSound(this.pVespiarySound);
}
};
_local1.recycle_enter = function () {
super.recycle_enter();
if (this.pVespiarySound >= 0) {
this.pVespiarySound = tinymantis.SoundManager.sSingleton.stopSound(this.pVespiarySound);
}
this.playRagedSound(false);
};
_local1.initialize = function () {
super.initialize();
this.pParty = 0;
this.pEnergyMax = 100;
this.pEnergy = this.pEnergyMax;
this.pSaveTimer = 0;
};
_local1.initWeapons = function () {
this.pAttackData = new Array();
var _local2 = Game.singleton.getWeaponStates();
for (var key in _local2) {
var _local3 = _local2[key];
if (_local3.state != false) {
this.addAttackData(_local3.attackData);
}
}
};
_local1.getTileSpace = function () {
return(12);
};
_local1.isChargedMode = function () {
return(false);
};
_local1.getDefaultWeapon = function () {
var _local3 = Game.singleton.getStartWeapon();
var _local4 = 0;
for ( ; _local4 < this.pAttackData.length ; _local4++) {
var _local5 = this.pAttackData[_local4];
if (_local5.key == _local3) {
return(_local5);
}
}
return(super.getDefaultWeapon());
};
_local1.gotoState = function (inState) {
var _local4 = super.gotoState(inState);
if (_local4 == 0) {
this.pMovieClip.mState = inState;
}
return(_local4);
};
_local1.isCaligula = function () {
return(true);
};
_local1.__set__energy = function (e) {
var _local3 = this.pEnergy;
this.pEnergy = Math.min(this.pEnergyMax, Math.max(0, e));
if ((_local3 < this.pEnergyMax) && (this.pEnergy == this.pEnergyMax)) {
tinymantis.SoundManager.sSingleton.playSound("weapons_chakrafull.aif", false, 100);
}
return(this.__get__energy());
};
_local1.__get__energy = function () {
return(this.pEnergy);
};
_local1.__get__energy_max = function () {
return(this.pEnergyMax);
};
_local1.eatRamen = function (ramen) {
tinymantis.SoundManager.sSingleton.playSound("powerup3.wav", false, 100);
switch (ramen.getType()) {
case RamenIcon.RED :
this.health = this.health_max;
break;
case RamenIcon.BLUE :
this.health = this.health + 20;
break;
case RamenIcon.GREEN :
this.health = this.health + 50;
}
};
_local1.playRagedSound = function (play) {
};
_local1.updateAttackData = function (levelInfo) {
var _local3 = 0;
for ( ; _local3 < this.pAttackData.length ; _local3++) {
var _local4 = this.pAttackData[_local3];
switch (_local4.key) {
case "A" :
case "B" :
_local4.setDamage(levelInfo.getPunch());
break;
case "C" :
_local4.setDamage(levelInfo.getKick());
}
}
this.health_max = levelInfo.getValue("hp");
Game.singleton.getGameUI().setWeaponIcon(this.pCurrentWeaponAttack, this.pCurrentBackupWeapon);
};
_local1.getAttackDataByKey = function (key) {
var _local3 = 0;
for ( ; _local3 < this.pAttackData.length ; _local3++) {
var _local4 = this.pAttackData[_local3];
if (_local4.key == key) {
return(_local4);
}
}
return(null);
};
_local1.getAttackDataByType = function (type) {
var _local3 = 0;
for ( ; _local3 < this.pAttackData.length ; _local3++) {
var _local4 = this.pAttackData[_local3];
if (_local4.weapon.indexOf(type) >= 0) {
return(_local4);
}
}
return(null);
};
_local1.check_attack_energy = function (attack) {
if ((attack.energy == 0) || (this.energy >= attack.energy)) {
this.energy = this.energy - attack.energy;
return(true);
}
tinymantis.SoundManager.sSingleton.playSound("weapons_no_chakra.aif", false, 100);
return(false);
};
_local1.cheatWeapon = function () {
var _local2 = CharacterInfo.singleton.getCharacterInfo("Caligula");
var _local3 = _local2.weapons;
var _local4 = new Array();
var _local5 = 0;
for ( ; _local5 < _local3.length ; _local5++) {
var _local6 = _local3[_local5];
if (_local6.nameOnMap && (_local6.nameOnMap.length > 0)) {
_local4.push(_local6);
}
}
var _local7 = _local4[0].key;
var _local8 = 0;
for ( ; _local8 < _local4.length ; _local8++) {
if (_local4[_local8].key == this.pCurrentWeaponAttack.key) {
var _local9 = (_local8 + 1) % _local4.length;
_local7 = _local4[_local9].key;
break;
}
}
Game.singleton.pickWeapon(_local7);
};
_local1.check_attack = function () {
var _local2 = Game.singleton;
if (Key.isDown(Key.SHIFT) && (Main.sCheatEnabled)) {
if (this.pKeyPressed[tinymantis.Utils.getKeyCode("1")]) {
this.health = this.health_max;
} else if (this.pKeyPressed[tinymantis.Utils.getKeyCode("2")]) {
_local2.cheatLevelup();
} else if (this.pKeyPressed[tinymantis.Utils.getKeyCode("3")]) {
Trigger.sIgnore = !Trigger.sIgnore;
} else if (this.pKeyPressed[tinymantis.Utils.getKeyCode("4")]) {
LevelMap.unlockAll();
} else if (this.pKeyPressed[tinymantis.Utils.getKeyCode("5")]) {
this.cheatWeapon();
} else if (this.pKeyPressed[tinymantis.Utils.getKeyCode("6")]) {
_local2.stop_triggers();
} else if (this.pKeyPressed[tinymantis.Utils.getKeyCode("7")]) {
_local2.getSceneMap().showExitTiles(true);
}
} else {
if (this.pKeyPressed[Key.SPACE]) {
this.pCurrentAttack = this.getAttackDataByKey("A");
Game.singleton.setStartWeapon(this.pCurrentAttack.key);
return(this.check_attack_energy(this.pCurrentAttack));
}
if (this.pKeyPressed[tinymantis.Utils.getKeyCode("X")]) {
if (this.pCurrentWeaponAttack && (_local2.getGameUI().isWeaponReady())) {
this.pCurrentAttack = this.pCurrentWeaponAttack;
if (this.check_attack_energy(this.pCurrentAttack)) {
if (this.pCurrentAttack.isScroll()) {
this.pCurrentWeaponAttack = this.pCurrentBackupWeapon;
_local2.getGameUI().setWeaponIcon(this.pCurrentWeaponAttack, this.pCurrentBackupWeapon);
_local2.pickWeapon(((this.pCurrentBackupWeapon == null) ? "" : (this.pCurrentBackupWeapon.key)));
if (this.pCurrentAttack.nameOnMap == "scroll_blue04") {
_local2.getCamera().shake(30, 10);
}
} else {
_local2.getGameUI().setWeaponPreparingFrame(0);
}
return(true);
}
}
}
}
return(false);
};
_local1.getCurrentWeaponKey = function () {
if (this.pCurrentWeaponAttack) {
return(this.pCurrentWeaponAttack.key);
}
return("");
};
_local1.getBackupWeaponKey = function () {
if (this.pCurrentBackupWeapon) {
return(this.pCurrentBackupWeapon.key);
}
return("");
};
_local1.setWeaponAttack = function (key) {
var _local3 = this.getAttackDataByKey(key);
if (_local3.isScroll()) {
this.pCurrentWeaponAttack = _local3;
} else {
this.pCurrentBackupWeapon = _local3;
if (!this.pCurrentWeaponAttack.isScroll()) {
this.pCurrentWeaponAttack = _local3;
}
}
Game.singleton.getGameUI().setWeaponIcon(this.pCurrentWeaponAttack, this.pCurrentBackupWeapon);
};
_local1.getAttackDamage = function (attackdata, target) {
var _local4 = attackdata.damage;
if (attackdata.nameOnMap.length) {
_local4 = Game.singleton.getLevelInfo().getValue(attackdata.nameOnMap);
}
return(_local4);
};
_local1.update = function () {
super.update();
var _local3 = 0;
for ( ; _local3 < this.pKeyCodes.length ; _local3++) {
var _local4 = this.pKeyCodes[_local3];
this.pKeyPressed[_local4] = false;
if (Key.isDown(_local4)) {
if (this.pKeyDownMap[_local4]) {
} else {
this.pKeyPressed[_local4] = true;
}
this.pKeyDownMap[_local4] = true;
} else {
this.pKeyDownMap[_local4] = false;
}
}
};
_local1.setPosition = function (x, y) {
var _local5 = this.pTile;
var _local6 = Game.singleton.getCamera();
Game.singleton.getSceneMap().setScreenLocked(_local6.isLocked());
var _local7 = super.setPosition(x, y);
Game.singleton.getSceneMap().setScreenLocked(false);
if (this.pTile != _local5) {
if (this.pTile.getExitMap() && (this.health > 0)) {
if (this.isInState("walk", 0) || (this.isInState("idle", 0) || (this.isInState("attack", 0)))) {
var _local8 = this.pTile.getExitDestPoint();
Game.singleton.loadLevel(this.pTile.getExitMap(), _local8.x, _local8.y);
}
}
}
if (_local7) {
if (_local6.isLocked()) {
var _local9 = _local6.getPositionOnScreen(this.X, this.Y);
if (_local9.x < 0) {
super.setPosition(this.X - _local9.x, this.Y);
} else if (_local9.x > Constant.GAME_WIDTH) {
super.setPosition(this.X - (_local9.x - Constant.GAME_WIDTH), this.Y);
}
if (_local9.y < 0) {
super.setPosition(this.X, this.Y - _local9.y);
} else if (_local9.y > Constant.GAME_HEIGHT) {
super.setPosition(this.X, this.Y - (_local9.y - Constant.GAME_HEIGHT));
}
}
}
return(_local7);
};
_local1.init_update = function () {
var _local3 = Game.singleton;
var _local4 = _local3.getStartPoint();
this.initTile(_local4.x, _local4.y);
if (this.pTile.mI < (_local3.getSceneMap().levelData.mWidth / 2)) {
this.initDirection(1);
} else {
this.initDirection(-1);
}
super.init_update();
this.pHealth = _local3.getCaligulaHealth();
this.pEnergy = _local3.getCaligulaEnergy();
this.pMovieClip.mWeapon = this.pCurrentAttack.key;
this.pRemindFindWeapons = _local3.getSceneMap().levelData.mName == "forum0";
this.checkVespiarySound();
this.playRagedSound(this.pEnergy == this.pEnergyMax);
};
_local1.levelup_enter = function () {
this.pMovieClip.gotoAndStop("levelup");
tinymantis.SoundManager.sSingleton.playSound("naruto_levelup.aif", false, 100);
this.health = this.health_max;
this.energy = this.energy_max;
};
_local1.levelup_update = function () {
if (this.getBodyClip()._totalframes == this.getBodyClip()._currentframe) {
this.gotoState("idle");
} else {
var _local2 = Game.singleton.getCharacters();
var _local3 = 0;
for ( ; _local3 < _local2.length ; _local3++) {
var _local4 = _local2[_local3];
if ((_local4 != this) && ((_local4.health > 0) && ((!_local4.isInState("stupid", 1)) && ((!_local4.isInState("init", 0)) && ((!_local4.isInState("standup", 0)) && (!_local4.isInState("hit", 0))))))) {
_local4.gotoState("stupid");
}
}
}
};
_local1.levelup_exit = function () {
var _local2 = Game.singleton.getCharacters();
var _local3 = 0;
for ( ; _local3 < _local2.length ; _local3++) {
var _local4 = _local2[_local3];
if ((_local4 != this) && (_local4.health > 0)) {
_local4.gotoState("think");
}
}
};
_local1.isAttackChargeable = function () {
return(false);
};
_local1.idle_enter = function () {
super.idle_enter();
if (Game.singleton.isInOrgyRoom()) {
this.gotoState("think");
this.pMovieClip.mWeapon = "M";
} else if (((this.pMovieClip.mWeapon == "Z") && (!this.isInState("zampogna", 1))) || ((this.pMovieClip.mWeapon == "O") && (!this.isInState("ocarina", 1)))) {
this.pMovieClip.mWeapon = "";
}
};
_local1.idle_update = function () {
if (this.check_attack()) {
if (this.isAttackChargeable()) {
this.gotoState("chargeup");
} else {
this.gotoState("attack");
}
} else {
var _local2 = 0;
var _local3 = 0;
if (Key.isDown(Key.RIGHT)) {
_local2 = 1;
} else if (Key.isDown(Key.LEFT)) {
_local2 = -1;
}
if (Key.isDown(Key.DOWN)) {
_local3 = 1;
} else if (Key.isDown(Key.UP)) {
_local3 = -1;
}
if (_local2 || (_local3)) {
if (_local2) {
this.initDirection(_local2);
}
this.gotoState("walk");
}
}
};
_local1.idle_exit = function () {
this.checkVespiarySound();
};
_local1.hit_enter = function () {
super.hit_enter();
this.pInvincibleTimer = 10000;
tinymantis.SoundManager.sSingleton.playSound("naruto_hit.aif", false, 100);
if (this.pCurrentAttack.key == "U") {
this.pMovieClip.gotoAndStop("hit_U");
}
};
_local1.hit_exit = function () {
if (this.health > 0) {
this.pInvincibleTimer = 10;
this.gotoState("think");
} else {
this.pInvincibleTimer = 0;
}
};
_local1.think_update = function () {
if (this.pInvincibleTimer > 0) {
this.pInvincibleTimer--;
if (!this.isInState("hit", 0)) {
var _local2 = this.pInvincibleTimer % 3;
}
if (this.pInvincibleTimer == 0) {
this.gotoState("think");
}
}
if (Game.singleton.isInOrgyRoom()) {
this.health = this.health + 2;
this.energy = this.energy + 5;
}
this.pEnergyRefillTimer++;
if (this.pEnergyRefillTimer > 30) {
this.energy = this.energy + 2;
this.pEnergyRefillTimer = 0;
}
};
_local1.think_exit = function () {
this.pMovieClip._alpha = 100;
};
_local1.walk_enter = function () {
super.walk_enter();
};
_local1.walk_update = function () {
if (this.check_attack()) {
if (this.isAttackChargeable()) {
this.gotoState("chargeup");
} else {
this.gotoState("attack");
}
} else {
var _local2 = Game.singleton.getSceneMap();
var _local3 = 0;
var _local4 = 0;
if (Key.isDown(Key.RIGHT)) {
_local3 = this.pSpeed;
} else if (Key.isDown(Key.LEFT)) {
_local3 = -this.pSpeed;
}
if (Key.isDown(Key.DOWN)) {
_local4 = this.pSpeed;
} else if (Key.isDown(Key.UP)) {
_local4 = -this.pSpeed;
}
this.character_walk_update(_local3, _local4);
}
};
_local1.character_walk_update_bak = function (dx, dy) {
var _local5 = super.character_walk_update(dx, dy);
var _local6 = Game.singleton.getCamera();
if (_local6.isLocked()) {
var _local7 = _local6.getPositionOnScreen(this.X, this.Y);
if ((_local7.x < 0) || ((_local7.x > Constant.GAME_WIDTH) || ((_local7.y < 0) || (_local7.y > Constant.GAME_HEIGHT)))) {
this.move(-dx, -dy, this.pSpeedRandom + 1);
this.move(dx, dy, 1);
_local5 = false;
}
}
return(_local5);
};
_local1.attack_enter = function () {
this.pInvincibleTimer = 0;
super.attack_enter();
this.mStateParam.combo = false;
this.mStateParam.key_released = false;
};
_local1.attack_update = function () {
super.attack_update();
var _local3 = this.pMovieClip.body;
if (_local3._currentframe > (_local3._totalframes * 0.2)) {
if (this.pKeyPressed[Key.SPACE]) {
switch (this.pCurrentAttack.key) {
case "A" :
this.mStateParam.combo = "B";
break;
case "B" :
this.mStateParam.combo = "C";
}
}
}
if (_local3._currentframe == _local3._totalframes) {
if (this.mStateParam.combo) {
this.pCurrentAttack = this.getAttackDataByKey(this.mStateParam.combo);
Game.singleton.setStartWeapon(this.pCurrentAttack.key);
this.gotoState("attack");
}
}
if (this.pCurrentAttack.canWalk) {
var _local4 = Game.singleton.getSceneMap();
var _local5 = 0;
var _local6 = 0;
if (Key.isDown(Key.RIGHT)) {
_local5 = this.pSpeed;
} else if (Key.isDown(Key.LEFT)) {
_local5 = -this.pSpeed;
}
if (Key.isDown(Key.DOWN)) {
_local6 = this.pSpeed;
} else if (Key.isDown(Key.UP)) {
_local6 = -this.pSpeed;
}
if ((this.pCurrentAttack.type == "melee") && ((_local5 * this.getDirection()) < 0)) {
_local5 = 0;
}
this.character_walk_update(_local5, _local6);
}
};
_local1.decay_enter = function () {
Game.singleton.levelFailed();
};
_local1.decay_update = function () {
};
_local1.ghost_update = function () {
this.gotoState("init");
};
_local1.ghost_exit = function () {
Game.singleton.setStartWeapon("D");
this.pEnergy = this.pEnergyMax;
};
_local1.chargeup_enter = function () {
this.pMovieClip.mWeapon = this.pCurrentAttack.key;
this.pMovieClip.gotoAndStop("attack_" + this.pCurrentAttack.key);
this.mStateParam.charge_timer = 0;
this.mStateParam.mChargeSoundChannel = tinymantis.SoundManager.sSingleton.playSound("caligula_weapon_charge_loop.aif", true, 100);
};
_local1.chargeup_update = function () {
this.mStateParam.charge_timer++;
var _local2 = this.pMovieClip.cChargeEffect;
if (_local2._currentframe == 1) {
_local2.gotoAndPlay(2);
}
this.pMovieClip.body.gotoAndStop(1);
var _local3 = ((-Math.cos(this.mStateParam.charge_timer * 0.2)) * 0.3) + 0.7;
var _local4 = this.pMovieClip.body;
var _local5 = new flash.geom.ColorTransform();
_local5.blueMultiplier = 1 - _local3;
_local5.blueOffset = Math.round(255 * _local3);
_local5.redMultiplier = (_local5.greenMultiplier = _local5.blueMultiplier);
_local5.redOffset = (_local5.greenOffset = _local5.blueOffset);
_local4.transform.colorTransform = _local5;
if (!Key.isDown(this.pCurrentAttack.keyCode)) {
this.pMovieClip.body.play();
this.gotoState("attack");
}
};
_local1.chargeup_exit = function () {
this.mStateParam.mChargeSoundChannel = tinymantis.SoundManager.sSingleton.stopSound(this.mStateParam.mChargeSoundChannel);
var _local2 = this.pMovieClip.body;
var _local3 = new flash.geom.ColorTransform();
_local3.blueMultiplier = 1;
_local3.blueOffset = 0;
_local3.redMultiplier = (_local3.greenMultiplier = _local3.blueMultiplier);
_local3.redOffset = (_local3.greenOffset = _local3.blueOffset);
_local2.transform.colorTransform = _local3;
};
_local1.hit = function (attacker, damage, pushpower) {
if (this.isInState("throw", 1)) {
return(false);
}
if (this.isInState("levelup", 0) || (!Game.singleton.isInState("run", 0))) {
return(false);
}
if (this.isInState("attack", 0) && (this.pCurrentAttack.isScroll())) {
return(false);
}
return(super.hit(attacker, damage, pushpower));
};
_local1.melee_update = function () {
if (!this.isInState("attack", 0)) {
this.gotoState("think");
}
var _local3 = this.pMovieClip.body.cHitArea;
if (_local3 != null) {
var _local4 = Game.singleton.getBreakableObjects();
var _local5 = 0;
for ( ; _local5 < _local4.length ; _local5++) {
var _local6 = _local4[_local5];
if (!_local6.broken) {
if (_local6.hit(this.getTile(), _local3)) {
return(undefined);
}
}
}
if (super.melee_update()) {
switch (this.pCurrentAttack.key) {
case "A" :
case "B" :
tinymantis.SoundManager.sSingleton.playSound("naruto_jab.aif", false, 100);
break;
}
} else {
switch (this.pCurrentAttack.key) {
case "A" :
case "B" :
tinymantis.SoundManager.sSingleton.playSound("naruto_jab_miss.wav", false, 100);
}
}
}
};
_local1.move = function (dx, dy, speed) {
super.move(dx, dy, speed);
var _local6 = Game.singleton.getBreakableObjects();
var _local7 = 0;
for ( ; _local7 < _local6.length ; _local7++) {
var _local8 = _local6[_local7];
if (_local8.broken && ((_local8.getTile().mI == this.pTile.mI) && (_local8.getTile().mJ == this.pTile.mJ))) {
switch (_local8.getTreasure()) {
case "meat" :
tinymantis.SoundManager.sSingleton.playSound("caligula_impolite_gobbling.aif", false, 100);
this.health = this.health + 30;
break;
case "wine" :
tinymantis.SoundManager.sSingleton.playSound("caligula_drinking.wav", false, 100);
this.energy = this.energy + 20;
}
}
}
};
_local1.death_enter = function () {
super.death_enter();
this.playRagedSound(false);
Game.singleton.pickWeapon("");
};
_local1.death_update = function () {
super.death_update();
var _local3 = this.pMovieClip.body;
if (this.mStateParam.death_timer > 30) {
this.gotoState("decay");
}
};
_local1.ocarina_enter = function () {
this.mStateParam.mOcarinaSong = "caligula_ocarina.aif";
this.mStateParam.mOcarinaChannel = tinymantis.SoundManager.sSingleton.playSound(this.mStateParam.mOcarinaSong, true, 100);
this.mStateParam.mOcarinaTimer = 0;
};
_local1.ocarina_update = function () {
this.zampogna_update();
};
_local1.ocarina_exit = function () {
this.zampogna_exit();
};
_local1.zampogna_enter = function () {
this.mStateParam.mOcarinaSong = "caligula_zampogna.aif";
this.mStateParam.mOcarinaChannel = tinymantis.SoundManager.sSingleton.playSound(this.mStateParam.mOcarinaSong, true, 100);
this.mStateParam.mOcarinaTimer = 0;
};
_local1.zampogna_update = function () {
if (!Key.isDown(this.pCurrentAttack.keyCode)) {
if (this.mStateParam.mOcarinaTimer > 0) {
if ((--this.mStateParam.mOcarinaTimer) <= 0) {
this.gotoState("think");
}
} else {
var _local2 = tinymantis.SoundManager.sSingleton.getSound(this.mStateParam.mOcarinaChannel);
var _local3 = _local2.position / _local2.duration;
if (_local3 > 0.9) {
this.mStateParam.mOcarinaTimer = Math.max(1, Math.ceil(((_local2.duration - _local2.position) / 1000) * 31));
tinymantis.SoundManager.sSingleton.setVolume(this.mStateParam.mOcarinaChannel, 0);
tinymantis.SoundManager.sSingleton.playSoundAt(this.mStateParam.mOcarinaSong, _local2.position / 1000, 100);
}
}
}
};
_local1.zampogna_exit = function () {
if (this.isInState("idle", 0) || (this.isInState("walk", 0))) {
this.pMovieClip.mWeapon = "";
this.pMovieClip.body.gotoAndPlay(1);
}
if (this.mStateParam.mOcarinaChannel >= 0) {
this.mStateParam.mOcarinaChannel = tinymantis.SoundManager.sSingleton.stopSound(this.mStateParam.mOcarinaChannel);
}
};
_local1.summon_update = function () {
var _local2 = this.pMovieClip.body.cHitArea;
if (_local2 != null) {
var _local3 = null;
var _local4 = 100000000 /* 0x5F5E100 */;
var _local5 = Game.singleton.getCharacters();
var _local6 = 0;
for ( ; _local6 < _local5.length ; _local6++) {
var _local7 = _local5[_local6];
if ((_local7.health > 0) && (_local7.party != this.party)) {
var _local8 = Math.abs(_local7.X - this.X) + Math.abs(_local7.Y - this.Y);
if ((_local8 < _local4) && (_local2.hitTest(_local7.getMovieClip()))) {
_local4 = _local8;
_local3 = _local7;
}
}
}
var _local9 = Lion(Game.singleton.createThrowObject(this, this.pCurrentAttack));
if (_local3) {
_local9.initStartPosition(_local3.X - (this.getDirection() * 80), _local3.Y);
} else {
var _local10 = Game.singleton.getSceneMap();
var _local11 = null;
var _local12 = 4;
for ( ; (_local12 > 0) && (_local11 == null) ; _local12--) {
_local11 = _local10.getTile(this.pTile.mI + (_local12 * this.getDirection()), this.pTile.mJ);
if (_local11.water) {
_local11 = null;
}
}
var _local13 = 2;
for ( ; (_local13 < 5) && (_local11 == null) ; _local13++) {
_local11 = _local10.getTile(this.pTile.mI - (_local13 * this.getDirection()), this.pTile.mJ);
if (_local11.water) {
_local11 = null;
}
}
if (_local11 == null) {
_local11 = this.pTile;
}
_local9.initStartPosition(_local11.getCenterX(), _local11.getCenterY());
}
_local9.initDirection(this.getDirection());
}
if ((_local2 != null) || (!this.isInState("attack", 0))) {
this.gotoState("think");
}
};
_local1.manhood_update = function () {
if (!this.isInState("attack", 0)) {
this.gotoState("think");
}
var _local2 = this.pMovieClip.body.cHitArea;
if (_local2 != null) {
var _local3 = Game.singleton.getCharacters();
var _local4 = 0;
for ( ; _local4 < _local3.length ; _local4++) {
var _local5 = _local3[_local4];
if ((_local5 != this) && ((_local5.health > 0) && (_local5.canStun() && ((!_local5.isInState("stun", 0)) && (_local2.hitTest(_local5.getMovieClip())))))) {
_local5.gotoState("stun");
}
}
}
};
_local1.addProperty("energy", _local1.__get__energy, _local1.__set__energy);
_local1.addProperty("energy_max", _local1.__get__energy_max, function () {
});
ASSetPropFlags(_local1, null, 1);
}
#endinitclip
Symbol 20494 MovieClip [__Packages.TiledObject] Frame 0
#initclip
if (!TiledObject) {
//(_global.TiledObject = function (parent, libname, inI, inJ) {
super("TiledObject", libname);
this.pMovieClip = parent.attachMovie(libname, "tiledobj" + TiledObject._sIndex, parent.getNextHighestDepth());
TiledObject._sIndex++;
this.pX = inI * SceneMap.TILE_SIZE;
this.pY = inJ * SceneMap.TILE_SIZE;
this.pTile = new SceneTile(inI, (inJ + Math.round(this.pMovieClip._height / SceneMap.TILE_SIZE)) - 1);
this.updatePosition(true);
this.updateDepth(this.pTile.getCenterX(), this.pTile.getCenterY());
this.pOccupyTile = true;
}) extends SceneObject
var _local1 = (_global.TiledObject /* register */).prototype;
_local1.setOccupyTile = function (yes) {
this.pOccupyTile = yes;
};
_local1.fixCanwalkArray = function (width, canwalkArray, canwalk) {
if (this.pOccupyTile) {
var _local5 = Math.round(this.pMovieClip._width / SceneMap.TILE_SIZE);
var _local6 = Math.max(2, Math.round(this.pMovieClip._height / SceneMap.TILE_SIZE));
if (this.pMovieClip.bbb != undefined) {
_local5 = 1;
_local6 = _local6 - 2;
} else if (this.pMovieClip.aaa == undefined) {
_local6--;
}
var _local7 = 0;
for ( ; _local7 < _local5 ; _local7++) {
var _local8 = 0;
for ( ; _local8 < _local6 ; _local8++) {
var _local9 = (this.pTile.mI + _local7) + ((this.pTile.mJ - _local8) * width);
canwalkArray[_local9] = (canwalk ? 1 : 0);
}
}
}
};
ASSetPropFlags(_local1, null, 1);
(_global.TiledObject /* register */)._sIndex = 0;
}
#endinitclip
Symbol 20495 MovieClip [__Packages.NewGameMessages] Frame 0
class NewGameMessages
{
var pMovieClip;
function NewGameMessages (parent) {
pMovieClip = parent.attachMovie("lib_messages", "messages", parent.getNextHighestDepth());
pMovieClip._x = Stage.width / 2;
pMovieClip._y = Stage.height / 2;
pMovieClip.onEnterFrame = tinymantis.Delegate.create(this, update);
}
function update() {
if (pMovieClip._totalframes == pMovieClip._currentframe) {
pMovieClip.onEnterFrame = null;
pMovieClip.removeMovieClip();
pMovieClip = null;
Game.singleton.gotoState("run");
}
}
function isFinished() {
return(pMovieClip == null);
}
//ASSetPropFlags(_local1, null, 1);
}
Symbol 20496 MovieClip [__Packages.Lion] Frame 0
#initclip
if (!Lion) {
//(_global.Lion = function (weapon) {
super(weapon);
}) extends ThrowObject
var _local1 = (_global.Lion /* register */).prototype;
_local1.initialize = function (owner, attackdata) {
super.initialize(owner, attackdata);
this.pAttackTarget = null;
tinymantis.SoundManager.sSingleton.playSound("caligula_lion.aif", false, 100);
};
_local1.initStartPosition = function (inx, iny) {
this.pBaseY = iny;
super.initStartPosition(inx, iny);
};
_local1.getBodyClip = function () {
return(this.pMovieClip.body);
};
_local1.update = function () {
if (this.pDead) {
return(undefined);
}
var _local2 = this.pMovieClip.body;
if (_local2._currentframe == _local2._totalframes) {
this.pDead = true;
} else if (_local2._currentframe == 12) {
Game.singleton.getCamera().shake(14, 8);
} else {
var _local3 = _local2.cHitArea;
if (_local3 != undefined) {
if (this.pAttackTarget) {
this.pAttackTarget.hit(this, this.getAttackDamage(this.pAttackTarget), this.pAttackData.pushpower);
} else {
var _local4 = _local2.cHitArea2;
var _local5 = Game.singleton.getCharacters();
var _local6 = 0;
for ( ; (_local6 < _local5.length) && (this.pAttackTarget == null) ; _local6++) {
var _local7 = _local5[_local6];
if ((_local7 != this.pOwner) && ((_local7.health > 0) && (Math.abs(_local7.Y - this.pBaseY) < Constant.HIT_Y_RANGE))) {
if (_local3.hitTest(_local7.getMovieClip())) {
this.pAttackTarget = _local7;
} else if (_local4.hitTest(_local7.getMovieClip())) {
this.initDirection(this.getDirection() * -1);
this.pAttackTarget = _local7;
}
}
}
if (this.pAttackTarget == null) {
this.getBodyClip().gotoAndPlay("back");
}
}
}
}
};
ASSetPropFlags(_local1, null, 1);
}
#endinitclip
Symbol 20497 MovieClip [__Packages.ForumDoor] Frame 0
#initclip
if (!ForumDoor) {
//(_global.ForumDoor = function (parent, inI, inJ) {
super(parent, "obj_glowinglock", inI, inJ);
}) extends TiledObject
var _local1 = (_global.ForumDoor /* register */).prototype;
_local1.setDoorOpen = function (open) {
this.pMovieClip.cOpenedDoor._visible = open;
var _local3 = Game.singleton.getSceneMap();
this.fixCanwalkArray(_local3.levelData.mWidth, _local3.getCanWalkArray(), open);
};
_local1.fixCanwalkArray = function (width, canwalkArray, canwalk) {
if (this.pOccupyTile) {
var _local5 = Math.round(this.pMovieClip._width / SceneMap.TILE_SIZE);
var _local6 = 0;
for ( ; _local6 < 1 ; _local6++) {
var _local7 = (this.pTile.mI + _local6) + (this.pTile.mJ * width);
canwalkArray[_local7] = (canwalk ? 1 : 0);
}
}
};
ASSetPropFlags(_local1, null, 1);
}
#endinitclip
Symbol 20498 MovieClip [__Packages.BreakableObject] Frame 0
#initclip
if (!BreakableObject) {
//(_global.BreakableObject = function (parent, libname, inI, inJ) {
super(parent, libname, inI, inJ);
this.pBroken = false;
this.pMovieClip.body.mTreasure = "";
}) extends TiledObject
var _local1 = (_global.BreakableObject /* register */).prototype;
_local1.__get__broken = function () {
return(this.pBroken);
};
_local1.getTreasure = function () {
if ((this.pMovieClip.body.cTreasure != undefined) && (this.pMovieClip.body.cTreasure._visible)) {
this.pMovieClip.body.cTreasure._visible = false;
return(this.pMovieClip.body.mTreasure);
}
return("");
};
_local1.hit = function (tile, hitArea) {
if (((tile == null) || (tile.mJ == this.pTile.mJ)) && (hitArea.hitTest(this.pMovieClip))) {
tinymantis.SoundManager.sSingleton.playSound("other_urn_break.wav", false, 100);
var _local4 = Game.singleton.getSceneMap();
this.fixCanwalkArray(_local4.levelData.mWidth, _local4.getCanWalkArray(), true);
this.pBroken = true;
this.pMovieClip.body.gotoAndPlay("break");
return(true);
}
return(false);
};
_local1.addProperty("broken", _local1.__get__broken, function () {
});
ASSetPropFlags(_local1, null, 1);
}
#endinitclip
Symbol 20499 MovieClip [__Packages.SceneTile] Frame 0
class SceneTile
{
var pI, pJ, pCenterX, pCenterY, pMapExitTo, pExitDestPoint, pWater;
function SceneTile (i, j) {
pI = i;
pJ = j;
pCenterX = (pI + 0.5) * SceneMap.TILE_SIZE;
pCenterY = (pJ + 0.5) * SceneMap.TILE_SIZE;
pMapExitTo = null;
pExitDestPoint = null;
pWater = false;
}
function setExit(mapname, destI, destJ) {
pMapExitTo = mapname;
pExitDestPoint = new flash.geom.Point(destI, destJ);
}
function __set__water(yes) {
pWater = yes;
return(__get__water());
}
function __get__water() {
return(pWater);
}
function __get__mI() {
return(pI);
}
function __get__mJ() {
return(pJ);
}
function getCenterX() {
return(pCenterX);
}
function getCenterY() {
return(pCenterY);
}
function getExitMap() {
if (pMapExitTo) {
return(pMapExitTo);
}
}
function getExitDestPoint() {
if (pExitDestPoint) {
return(pExitDestPoint);
}
}
//_local1.addProperty("mI", _local1.__get__mI, function () {
});
//_local1.addProperty("water", _local1.__get__water, _local1.__set__water);
//_local1.addProperty("mJ", _local1.__get__mJ, function () {
});
//ASSetPropFlags(_local1, null, 1);
}
Symbol 20500 MovieClip [__Packages.LevelMap] Frame 0
class LevelMap
{
static var singleton;
var pMovieClip, pTransferTimer, pHighestLevel, pSelectedLevel;
function LevelMap (parent) {
pMovieClip = Game.singleton.getMapRoot();
singleton = this;
initialize();
}
static function unlockAll() {
if (!sUnlockedAll) {
sUnlockedAll = true;
if (singleton && (singleton.pMovieClip._visible)) {
singleton.initialize();
}
}
}
function isInGame() {
return(Game.singleton.isInState("pause", 0));
}
function initialize() {
var _local2 = Game.singleton;
var _local3 = isInGame();
if (_local3) {
var _local4 = getCurrentGameLevel();
} else {
var _local4 = _local2.getPrevLevelNumber();
}
var _local5 = -1;
if (!_local3) {
_local5 = _local2.getLevelJustCompleted();
}
pMovieClip._visible = true;
pMovieClip.mButtonX._visible = _local3;
pTransferTimer = -1;
pHighestLevel = 1;
var _local7 = 1;
for ( ; _local7 <= 9 ; _local7++) {
var _local8 = pMovieClip["dot" + _local7];
_local8.level = _local7;
_local8.mNumber.gotoAndStop(_local7);
_local8.mNaruto._visible = false;
_local8.mNaruto.mHead._visible = true;
_local8.mNaruto.mFrame._visible = true;
if (Game.singleton.isLevelLocked(_local7) && (!sUnlockedAll)) {
_local8.gotoAndStop("locked");
} else if (_local5 == _local7) {
_local8.gotoAndStop("beatening");
pTransferTimer = 0;
} else if ((_local5 + 1) == _local7) {
_local8.gotoAndStop("locked");
pHighestLevel = Math.max(pHighestLevel, _local7);
} else if (Game.singleton.isLevelComplete(_local7)) {
_local8.gotoAndStop("beaten");
if ((!_local3) && (pTransferTimer < 0)) {
pTransferTimer = 1;
}
pHighestLevel = Math.max(pHighestLevel, _local7);
} else {
_local8.gotoAndStop("unlocked");
pHighestLevel = Math.max(pHighestLevel, _local7);
}
}
if (_local4 < 0) {
var _local4 = pHighestLevel;
}
pMovieClip.path.gotoAndStop((sUnlockedAll ? 3 : (getAreaNumber(pHighestLevel))));
if (!_local3) {
Main.startSplashMusic();
}
Key.addListener(this);
pMovieClip.onEnterFrame = tinymantis.Delegate.create(this, init_update);
pSelectedLevel = -1;
var _local9 = getLevelDotClip(_local4);
onDotPressed(_local9);
var _local10 = getAreaNumber(_local4);
var _local11 = 1;
for ( ; _local11 <= 3 ; _local11++) {
var _local12 = pMovieClip["scroll_" + _local11];
if (_local11 == _local10) {
_local12.gotoAndStop("scroll_open");
} else {
_local12.gotoAndStop("scroll_closed");
}
}
}
function transferNaruto() {
var _local2 = getLevelDotClip(pSelectedLevel);
if (_local2) {
if ((++pTransferTimer) > 7) {
onDotPressed(getLevelDotClip(pHighestLevel));
_local2.onEnterFrame = null;
pTransferTimer = -1;
}
} else {
_local2.onEnterFrame = null;
}
}
function onKeyUp() {
var _local2 = pSelectedLevel;
switch (Key.getCode()) {
case Key.RIGHT :
_local2++;
if (Game.singleton.isLevelLocked(_local2) && (!sUnlockedAll)) {
return(undefined);
}
if (_local2 > 9) {
return(undefined);
}
onDotPressed(getLevelDotClip(_local2));
break;
case Key.LEFT :
_local2--;
if (_local2 < 1) {
return(undefined);
}
onDotPressed(getLevelDotClip(_local2));
break;
case Key.SPACE :
if (pTransferTimer < 0) {
Main.button_press();
onPlayPressed();
}
break;
case 88 :
if (!isInGame()) {
break;
}
onBackToGame();
}
}
function getAreaNumber(lvl) {
if (lvl < 1) {
return(0);
}
if (lvl < 4) {
return(1);
}
if (lvl < 7) {
return(2);
}
return(3);
}
function init_update() {
if (!sUnlockedAll) {
if (Main.sCheatEnabled) {
if (Key.isDown(Key.SHIFT) && (Key.isDown(tinymantis.Utils.getKeyCode("4")))) {
unlockAll();
}
}
}
if (pTransferTimer > 0) {
if ((++pTransferTimer) > 10) {
if ((pSelectedLevel + 1) == pHighestLevel) {
onDotPressed(getLevelDotClip(pHighestLevel));
}
pTransferTimer = -1;
}
}
}
function getCurrentGameLevel() {
return(Game.singleton.getLevelNumber(Game.singleton.getCurrentLevel()));
}
function getLevelDotClip(lvl) {
return(pMovieClip["dot" + lvl]);
}
function onDotPressed(dotClip) {
var _local3 = _global.parseInt(dotClip._name.substr(3));
var _local4 = pSelectedLevel;
pSelectedLevel = _local3;
if (pSelectedLevel != _local4) {
if (_local4 > 0) {
if ((!isInGame()) || (_local4 != getCurrentGameLevel())) {
getLevelDotClip(_local4).mNaruto._visible = false;
} else {
getLevelDotClip(_local4).mNaruto.mFrame._visible = false;
}
}
pSelectedLevel = _local3;
getLevelDotClip(pSelectedLevel).mNaruto._visible = true;
if (isInGame()) {
if (pSelectedLevel != getCurrentGameLevel()) {
getLevelDotClip(pSelectedLevel).mNaruto.mHead._visible = false;
} else {
getLevelDotClip(pSelectedLevel).mNaruto.mFrame._visible = true;
}
}
var _local5 = getAreaNumber(_local4);
var _local6 = getAreaNumber(pSelectedLevel);
if (_local5 != _local6) {
if (_local5 > 0) {
pMovieClip["scroll_" + _local5].gotoAndPlay("scroll_closing");
}
if (_local6 > 0) {
pMovieClip["scroll_" + _local6].gotoAndPlay("scroll_opening");
}
}
}
}
function onNarutoPressed(dotClip) {
if (getLevelDotClip(pSelectedLevel) != dotClip) {
onDotPressed(dotClip);
} else {
onPlayPressed();
}
}
function disable() {
pMovieClip._visible = false;
pMovieClip.onEnterFrame = null;
Key.removeListener(this);
}
function onPlayPressed() {
if (isInGame() && (pSelectedLevel != getCurrentGameLevel())) {
pMovieClip._parent.mMessages.gotoAndStop("confirmLeaveLevel");
} else {
disable();
if (isInGame() && (pSelectedLevel == getCurrentGameLevel())) {
onBackToGame();
} else {
Game.singleton.loadLevel(("" + pSelectedLevel) + "-1", -1, -1);
}
}
}
function onForcePlay() {
disable();
Game.singleton.loadLevel(null, -1, -1);
Game.singleton.loadLevel(("" + pSelectedLevel) + "-1", -1, -1);
Game.singleton.hideSceneNode();
}
function onBackToGame() {
disable();
if (isInGame()) {
Game.singleton.gotoState("run");
}
}
function setEnabled(enable) {
if (enable) {
Key.addListener(this);
} else {
Key.removeListener(this);
}
var _local3 = 1;
for ( ; _local3 <= 9 ; _local3++) {
var _local4 = pMovieClip["dot" + _local3];
_local4.mNaruto.enabled = enable;
}
pMovieClip.mButtonX.enabled = enable;
pMovieClip.mPlayBackButtons.mButtonPlay.enabled = enable;
}
function unlocking_done(dotClip) {
onDotPressed(dotClip);
pTransferTimer = -1;
}
function beatening_done(dotClip) {
var _local3 = _global.parseInt(dotClip._name.substr(3));
if (_local3 < 9) {
getLevelDotClip(_local3 + 1).gotoAndStop("unlocking");
tinymantis.SoundManager.sSingleton.playSound("level_unlock.wav", false, 100);
}
}
//ASSetPropFlags(_local1, null, 1);
static var sUnlockedAll = false;
}
Symbol 20501 MovieClip [__Packages.AttackData] Frame 0
class AttackData
{
var pKey, pKeyCode, pType, pDamage, pPushPower, pWeapon, pMinRange, pMaxRange, pWalk, pTransform, pHitMultiple, pChargeable, pGore, pNameOnMap, pEnergy;
function AttackData (weapon) {
pKey = weapon.key;
pKeyCode = pKey.charCodeAt(0);
pType = weapon.type;
pDamage = _global.parseInt(weapon.damage);
pPushPower = Math.min(1, Math.max(0.001, _global.parseInt(weapon.push) / 100));
pWeapon = weapon.name;
pMinRange = ((weapon.min_range == undefined) ? 0 : (_global.parseInt(weapon.min_range)));
pMaxRange = ((weapon.max_range == undefined) ? 100 : (_global.parseInt(weapon.max_range)));
pWalk = ((weapon.walk == "true") ? true : false);
pTransform = ((weapon.transform == undefined) ? "" : (weapon.transform));
pHitMultiple = ((weapon.hit_multiple == "true") ? true : false);
pChargeable = ((weapon.charge == "true") ? true : false);
pGore = ((weapon.gore == "true") ? true : false);
pNameOnMap = ((weapon.nameOnMap == undefined) ? "" : (weapon.nameOnMap));
pEnergy = ((weapon.energy == undefined) ? 0 : (_global.parseInt(weapon.energy)));
}
function isScroll() {
return(pNameOnMap.indexOf("scroll") != -1);
}
function __get__nameOnMap() {
return(pNameOnMap);
}
function __get__gore() {
return(pGore);
}
function __get__energy() {
return(pEnergy);
}
function __get__chargeable() {
return(pChargeable);
}
function __get__hit_multiple() {
return(pHitMultiple);
}
function __get__transform() {
return(pTransform);
}
function __get__canWalk() {
return(pWalk);
}
function __get__min_range() {
return(pMinRange);
}
function __get__max_range() {
return(pMaxRange);
}
function __get__pushpower() {
return(pPushPower);
}
function __get__keyCode() {
return(pKeyCode);
}
function __get__key() {
return(pKey);
}
function __get__type() {
return(pType);
}
function __get__damage() {
return(pDamage);
}
function __get__weapon() {
return(pWeapon);
}
function setDamage(dmg) {
pDamage = dmg;
}
static function getAttackEffective(key, type) {
if (sAttackEffectiveMap == null) {
buildAttackEffectiveMap();
}
var _local4 = getAttackEffectiveMapName(key, type);
if (sAttackEffectiveMap[_local4] == undefined) {
return(1);
}
return(sAttackEffectiveMap[_local4]);
}
static function getAttackEffectiveMapName(key, type) {
return((key + "-") + type);
}
static function buildAttackEffectiveMap() {
sAttackEffectiveMap = new Object();
sAttackEffectiveMap[getAttackEffectiveMapName("B", "Soldier1")] = 0.5;
sAttackEffectiveMap[getAttackEffectiveMapName("I", "Soldier1")] = 0.5;
sAttackEffectiveMap[getAttackEffectiveMapName("K", "Soldier1")] = 0.5;
sAttackEffectiveMap[getAttackEffectiveMapName("R", "Soldier1")] = 0.5;
sAttackEffectiveMap[getAttackEffectiveMapName("V", "Soldier1")] = 0.5;
sAttackEffectiveMap[getAttackEffectiveMapName("K", "Soldier2")] = 0.5;
sAttackEffectiveMap[getAttackEffectiveMapName("R", "Soldier2")] = 0.5;
sAttackEffectiveMap[getAttackEffectiveMapName("V", "Soldier2")] = 0.5;
sAttackEffectiveMap[getAttackEffectiveMapName("K", "Soldier3")] = 0.5;
sAttackEffectiveMap[getAttackEffectiveMapName("R", "Soldier3")] = 0.5;
sAttackEffectiveMap[getAttackEffectiveMapName("V", "Soldier3")] = 0.5;
sAttackEffectiveMap[getAttackEffectiveMapName("E", "Stateman")] = 2;
sAttackEffectiveMap[getAttackEffectiveMapName("C", "Plebian")] = 2;
sAttackEffectiveMap[getAttackEffectiveMapName("V", "Plebian")] = 2;
sAttackEffectiveMap[getAttackEffectiveMapName("C", "PlebianFemale")] = 2;
sAttackEffectiveMap[getAttackEffectiveMapName("V", "PlebianFemale")] = 2;
sAttackEffectiveMap[getAttackEffectiveMapName("B", "Gladiator1")] = 0.5;
sAttackEffectiveMap[getAttackEffectiveMapName("C", "Gladiator1")] = 2;
sAttackEffectiveMap[getAttackEffectiveMapName("D", "Gladiator1")] = 0.5;
sAttackEffectiveMap[getAttackEffectiveMapName("F", "Gladiator1")] = 0.5;
sAttackEffectiveMap[getAttackEffectiveMapName("I", "Gladiator1")] = 0.5;
sAttackEffectiveMap[getAttackEffectiveMapName("J", "Gladiator1")] = 0.5;
sAttackEffectiveMap[getAttackEffectiveMapName("K", "Gladiator1")] = 0.5;
sAttackEffectiveMap[getAttackEffectiveMapName("R", "Gladiator1")] = 0.5;
sAttackEffectiveMap[getAttackEffectiveMapName("V", "Gladiator1")] = 0.5;
sAttackEffectiveMap[getAttackEffectiveMapName("W", "Gladiator1")] = 2;
sAttackEffectiveMap[getAttackEffectiveMapName("Y", "Gladiator1")] = 2;
sAttackEffectiveMap[getAttackEffectiveMapName("B", "Gladiator2")] = 0.5;
sAttackEffectiveMap[getAttackEffectiveMapName("C", "Gladiator2")] = 2;
sAttackEffectiveMap[getAttackEffectiveMapName("D", "Gladiator2")] = 0.5;
sAttackEffectiveMap[getAttackEffectiveMapName("F", "Gladiator2")] = 0.5;
sAttackEffectiveMap[getAttackEffectiveMapName("I", "Gladiator2")] = 0.5;
sAttackEffectiveMap[getAttackEffectiveMapName("J", "Gladiator2")] = 0.5;
sAttackEffectiveMap[getAttackEffectiveMapName("K", "Gladiator2")] = 0.5;
sAttackEffectiveMap[getAttackEffectiveMapName("R", "Gladiator2")] = 0.5;
sAttackEffectiveMap[getAttackEffectiveMapName("V", "Gladiator2")] = 0.5;
sAttackEffectiveMap[getAttackEffectiveMapName("W", "Gladiator2")] = 2;
sAttackEffectiveMap[getAttackEffectiveMapName("Y", "Gladiator2")] = 2;
sAttackEffectiveMap[getAttackEffectiveMapName("B", "GladiatorRed")] = 0.5;
sAttackEffectiveMap[getAttackEffectiveMapName("C", "GladiatorRed")] = 2;
sAttackEffectiveMap[getAttackEffectiveMapName("D", "GladiatorRed")] = 0.5;
sAttackEffectiveMap[getAttackEffectiveMapName("F", "GladiatorRed")] = 0.5;
sAttackEffectiveMap[getAttackEffectiveMapName("I", "GladiatorRed")] = 0.5;
sAttackEffectiveMap[getAttackEffectiveMapName("J", "GladiatorRed")] = 0.5;
sAttackEffectiveMap[getAttackEffectiveMapName("K", "GladiatorRed")] = 0.5;
sAttackEffectiveMap[getAttackEffectiveMapName("R", "GladiatorRed")] = 0.5;
sAttackEffectiveMap[getAttackEffectiveMapName("V", "GladiatorRed")] = 0.5;
sAttackEffectiveMap[getAttackEffectiveMapName("W", "GladiatorRed")] = 2;
sAttackEffectiveMap[getAttackEffectiveMapName("Y", "GladiatorRed")] = 2;
sAttackEffectiveMap[getAttackEffectiveMapName("M", "VestalVirgin")] = 2;
sAttackEffectiveMap[getAttackEffectiveMapName("W", "Prostitue")] = 0.5;
sAttackEffectiveMap[getAttackEffectiveMapName("F", "Drunk")] = 2;
sAttackEffectiveMap[getAttackEffectiveMapName("F", "Rat")] = 2;
sAttackEffectiveMap[getAttackEffectiveMapName("F", "Skeleton")] = 0;
sAttackEffectiveMap[getAttackEffectiveMapName("U", "Skeleton")] = 2;
sAttackEffectiveMap[getAttackEffectiveMapName("V", "Skeleton")] = 0;
}
//_local1.addProperty("gore", _local1.__get__gore, function () {
});
//_local1.addProperty("max_range", _local1.__get__max_range, function () {
});
//_local1.addProperty("pushpower", _local1.__get__pushpower, function () {
});
//_local1.addProperty("canWalk", _local1.__get__canWalk, function () {
});
//_local1.addProperty("key", _local1.__get__key, function () {
});
//_local1.addProperty("energy", _local1.__get__energy, function () {
});
//_local1.addProperty("transform", _local1.__get__transform, function () {
});
//_local1.addProperty("min_range", _local1.__get__min_range, function () {
});
//_local1.addProperty("type", _local1.__get__type, function () {
});
//_local1.addProperty("keyCode", _local1.__get__keyCode, function () {
});
//_local1.addProperty("nameOnMap", _local1.__get__nameOnMap, function () {
});
//_local1.addProperty("weapon", _local1.__get__weapon, function () {
});
//_local1.addProperty("hit_multiple", _local1.__get__hit_multiple, function () {
});
//_local1.addProperty("chargeable", _local1.__get__chargeable, function () {
});
//_local1.addProperty("damage", _local1.__get__damage, function () {
});
//ASSetPropFlags(_local1, null, 1);
static var sAttackEffectiveMap = null;
}
Symbol 20502 MovieClip [__Packages.tinymantis.FpsMeter] Frame 0
class tinymantis.FpsMeter
{
var pMovieClip, pRecentFrames, pBeginTime;
function FpsMeter (ver) {
pMovieClip = _root.attachMovie("lib_fpsmeter", "fpsmeter", _root.getNextHighestDepth());
pMovieClip.mVersion = ver;
_root.gExtraInfo = "";
pMovieClip._visible = false;
}
function activate() {
pMovieClip.onEnterFrame = tinymantis.Delegate.create(this, update);
Key.addListener(this);
reset();
}
function setExtra(extraInfo) {
_root.gExtraInfo = extraInfo;
}
function reset() {
pRecentFrames = 0;
pBeginTime = getTimer();
}
function onKeyDown() {
if (Key.isDown(49) && (pMovieClip.onEnterFrame)) {
pMovieClip._visible = !pMovieClip._visible;
}
}
function update() {
if ((++pRecentFrames) == pFramesToUpdate) {
var _local2 = getTimer() - pBeginTime;
var _local3 = (1000 * pFramesToUpdate) / _local2;
var _local4 = "" + Math.round(_local3);
if (_local4.length == 1) {
_local4 = "0" + _local4;
}
pMovieClip.mRecentFPS = _local4;
reset();
if (pMovieClip.getDepth() != (_root.getNextHighestDepth() - 1)) {
pMovieClip.swapDepths(_root.getNextHighestDepth());
}
pMovieClip.mExtra = _root.gExtraInfo;
}
}
var pFramesToUpdate = 10;
}
Symbol 20503 MovieClip [__Packages.CharacterInfo] Frame 0
class CharacterInfo
{
var pCharacterInfo, pLoader;
function CharacterInfo () {
pCharacterInfo = null;
}
static function __get__singleton() {
if (_singleton == null) {
_singleton = new CharacterInfo();
}
return(_singleton);
}
function loadInfo(url) {
pLoader = new XML();
pLoader.onLoad = tinymantis.Delegate.create(this, onLoad);
pLoader.ignoreWhite = true;
pLoader.load(url);
}
function onLoad(success) {
if (success) {
parseXML(pLoader);
}
}
function __get__loaded() {
return(pCharacterInfo != null);
}
function parseXML(xml) {
var _local3 = xml.firstChild;
while ((_local3 != null) && (_local3.nodeName != "root")) {
_local3 = _local3.nextSibling;
}
if (_local3.attributes.cheat == "true") {
Main.sCheatEnabled = true;
}
var _local4 = _local3.firstChild;
pCharacterInfo = new Object();
while (_local4 != null) {
if ((_local4.nodeType == 1) && (_local4.nodeName.length > 0)) {
switch (_local4.nodeName) {
case "levels" :
parseLevels(_local4);
break;
case "Naruto" :
_local4.nodeName = "Caligula";
Constant.DEFAULT_MAP = _local4.attributes.defaultMap;
Constant.DEFAULT_TILE = new flash.geom.Point(_global.parseInt(_local4.attributes.defaultX), _global.parseInt(_local4.attributes.defaultY));
default :
var _local5 = _local4.attributes;
var _local6 = new Array();
var _local7 = _local4.firstChild;
while (_local7 != null) {
if (!(_local7.nodeName === "weapon")) {
} else {
_local6.push(_local7.attributes);
}
_local7 = _local7.nextSibling;
}
_local5.weapons = _local6;
pCharacterInfo[_local4.nodeName] = _local5;
}
}
_local4 = _local4.nextSibling;
}
}
function getCharacterInfo(chartype) {
if (pCharacterInfo.hasOwnProperty(chartype)) {
return(pCharacterInfo[chartype]);
}
return(null);
}
function parseLevels(root) {
var _local3 = root.firstChild;
while (_local3) {
var _local4 = new LevelInfo();
_local4.parseXML(_local3);
pLevels.push(_local4);
_local3 = _local3.nextSibling;
}
pLevels.sortOn("level", Array.NUMERIC);
var _local5 = 0;
for ( ; _local5 < pLevels.length ; _local5++) {
var _local6 = pLevels[_local5];
}
}
function getLevel(exp) {
var _local3 = pLevels.length - 1;
for ( ; _local3 >= 0 ; _local3--) {
var _local4 = pLevels[_local3];
if (_local4.enoughExp(exp)) {
return(_local4);
}
}
return(pLevels[0]);
}
function getNextLevel(levelInfo) {
var _local3 = pLevels.length - 1;
for ( ; _local3 >= 0 ; _local3--) {
var _local4 = pLevels[_local3];
if (_local4.level == (levelInfo.level + 1)) {
return(_local4);
}
}
return(levelInfo);
}
function getExp(level) {
var _local3 = pLevels[pLevels.length - 1];
var _local4 = pLevels.length - 1;
for ( ; _local4 >= 0 ; _local4--) {
var _local5 = pLevels[_local4];
if (_local5.level == level) {
_local3 = _local5;
break;
}
}
return(_local3.getExp());
}
//_local1.addProperty("loaded", _local1.__get__loaded, function () {
});
//(_global.CharacterInfo /* register */).addProperty("singleton", (_global.CharacterInfo /* register */).__get__singleton, function () {
});
//ASSetPropFlags(_local1, null, 1);
static var _singleton = null;
var pLevels = new Array();
}
Symbol 20504 MovieClip [__Packages.tinymantis.Utils] Frame 0
class tinymantis.Utils
{
function Utils () {
}
static function getClipRelatedPosition(clip, relClip) {
var _local4 = new flash.geom.Point(0, 0);
while ((clip != relClip) && (clip != _root)) {
_local4.x = _local4.x + clip._x;
if (clip._parent._xscale < 0) {
_local4.x = -_local4.x;
}
_local4.y = _local4.y + clip._y;
if (clip._parent._yscale < 0) {
_local4.y = -_local4.y;
}
clip = clip._parent;
}
return(_local4);
}
static function getKeyCode(key) {
return(key.charCodeAt(0));
}
static function arrayIndexOf(array, element) {
var _local4 = 0;
for ( ; _local4 < array.length ; _local4++) {
if (array[_local4] == element) {
return(_local4);
}
}
return(-1);
}
}
Symbol 20505 MovieClip [__Packages.SceneMap] Frame 0
class SceneMap
{
static var TILE_SIZE;
var pRoot, pTilesetLoaded, pLevelData, pScreenLocked, pTiles, pCanWalk, pNeedControlNpcs, pPixelWidth, pPixelHeight, pForumDoor, levelData;
function SceneMap (maproot) {
pRoot = maproot;
pTilesetLoaded = false;
pLevelData = null;
pScreenLocked = false;
}
static function __get__TILE_SIZE() {
return(sTileSize);
}
function clean() {
if (pTiles) {
pTiles = null;
pRoot._x = 0;
pRoot._y = 0;
cleanNode("sky");
cleanNode("ground");
getRoot("chars").removeMovieClip();
getRoot("bloods").removeMovieClip();
Character.resetIndex();
}
}
function getRoot(type) {
switch (type) {
case "ground" :
case "sky" :
if (pRoot[type] == undefined) {
return(null);
}
return(pRoot[type]);
case "bloods" :
case "chars" :
var _local3 = pRoot.chars;
if ((_local3 == undefined) || (_local3 == null)) {
return(null);
}
var _local4 = _local3[type];
if ((_local4 == undefined) || (_local4 == null)) {
_local4 = _local3.createEmptyMovieClip("bloods", _local3.getNextHighestDepth());
_local4 = _local3.createEmptyMovieClip("chars", _local3.getNextHighestDepth());
}
return(_local3[type]);
}
return(pRoot);
}
function getSkullKills() {
return(pLevelData.getSkullKills());
}
function getSkyRegion(x, y) {
return(getSkyRegionFromTile(Math.floor(x / sTileSize), Math.floor(y / sTileSize)));
}
function getSkyRegionFromTile(i, j) {
var _local4 = pLevelData.mSkyRegions;
var _local5 = 0;
for ( ; _local5 < _local4.length ; _local5++) {
if (_local4[_local5].hitTest(i, j)) {
return(_local4[_local5]);
}
}
return(null);
}
function __get__levelData() {
return(pLevelData);
}
function __set__levelData(ld) {
if (!ld.loaded) {
throw new Error("setLevelData(): unloaded levelData");
}
if ((pLevelData == null) || (pLevelData.mTileset != ld.mTileset)) {
pTilesetLoaded = false;
}
pLevelData = ld;
pCanWalk = pLevelData.mTiles.canWalk;
pLevelData.clearSkyRegionTiles();
pNeedControlNpcs = pLevelData.mNumKills < pLevelData.getSkullKills();
return(__get__levelData());
}
function needControlNpcs() {
return(pNeedControlNpcs);
}
function getCanWalkArray() {
return(pCanWalk);
}
function __get__tilesetLoaded() {
return(pTilesetLoaded);
}
function cleanNode(type) {
var _local3 = getRoot(type);
for (var name in _local3) {
if (typeof(_local3[name]) == "movieclip") {
_local3[name].removeMovieClip();
if (_local3[name] != undefined) {
}
}
}
}
function loadTileset() {
var _local2 = getRoot("ground");
var _local3 = getRoot("sky");
if ((_local2 == null) || (_local3 == null)) {
return(false);
}
var _local4 = ("zones/" + pLevelData.mTileset) + ".swf";
_local2.loadMovie(_local4);
_local3.loadMovie(_local4);
return(true);
}
function __get__loaded() {
if (!pTilesetLoaded) {
var _local2 = getRoot("ground");
if ((_local2 == null) || ((_local2.getBytesTotal() <= 0) || (_local2.getBytesLoaded() < _local2.getBytesTotal()))) {
return(false);
}
_local2 = getRoot("sky");
if ((_local2 == null) || ((_local2.getBytesTotal() <= 0) || (_local2.getBytesLoaded() < _local2.getBytesTotal()))) {
return(false);
}
}
pTilesetLoaded = true;
return(true);
}
function getBytesTotal() {
return(Math.max(getRoot("ground").getBytesTotal(), getRoot("sky").getBytesTotal()));
}
function getBytesLoaded() {
return(Math.max(getRoot("ground").getBytesLoaded(), getRoot("sky").getBytesLoaded()));
}
function buildMap() {
buildLayer("ground");
buildLayer("sky");
buildTiles();
pPixelWidth = sTileSize * pLevelData.mWidth;
pPixelHeight = sTileSize * pLevelData.mHeight;
}
function buildObjects() {
var _local2 = getRoot("chars");
var _local3 = pLevelData.mObjects;
var _local4 = 0;
for ( ; _local4 < _local3.length ; _local4++) {
var _local5 = _local3[_local4];
var _local6 = new TiledObject(_local2, "obj_" + _local5.type, _local5.i, _local5.j);
_local6.fixCanwalkArray(pLevelData.mWidth, pCanWalk, false);
}
pForumDoor = null;
if (levelData.mName == "forum0") {
pForumDoor = new ForumDoor(_local2, 10, 9);
pForumDoor.setDoorOpen(Game.singleton.getNumActivatedWeapons() >= 26);
}
}
function getForumDoor() {
return(pForumDoor);
}
function getTileName(i, j) {
return((("" + i) + "-") + j);
}
function buildTiles() {
pTiles = new Array();
var _local2 = 0;
for ( ; _local2 < pLevelData.mHeight ; _local2++) {
var _local3 = 0;
for ( ; _local3 < pLevelData.mWidth ; _local3++) {
var _local4 = new SceneTile(_local3, _local2);
if (pLevelData.isWaterTile(convertTileIndex(_local3, _local2))) {
_local4.water = true;
}
pTiles.push(_local4);
}
}
var _local5 = 0;
for ( ; _local5 < pLevelData.mExits.length ; _local5++) {
var _local6 = pLevelData.mExits[_local5];
var _local7 = getTile(_local6.x, _local6.y);
if (_local7) {
_local7.setExit(_local6.dMap, _local6.dX, _local6.dY);
}
}
}
function buildLayer(layername) {
var _local3 = getRoot(layername);
_local3.cacheAsBitmap = true;
var _local4 = pLevelData.mTiles[layername];
var _local5 = 0;
for ( ; _local5 < _local4.length ; _local5++) {
var _local6 = _local5 % pLevelData.mWidth;
var _local7 = Math.floor(_local5 / pLevelData.mWidth);
var _local8 = _local4[_local5];
if (_local8 >= 0) {
var _local9 = _local3.attachMovie("tileset", getTileName(_local6, _local7), _local3.getNextHighestDepth());
_local9.gotoAndStop(_local8 + 1);
_local9._x = _local6 * sTileSize;
_local9._y = _local7 * sTileSize;
if (layername == "sky") {
var _local10 = getSkyRegionFromTile(_local6, _local7);
if (_local10) {
_local10.mTiles.push(_local9);
}
}
}
}
}
function showExitTiles(vis) {
var _local3 = 0;
for ( ; _local3 < pTiles.length ; _local3++) {
var _local4 = _local3 % pLevelData.mWidth;
var _local5 = Math.floor(_local3 / pLevelData.mWidth);
if (getTile(_local4, _local5).getExitMap() != null) {
if (vis) {
createDarkZone(_local4, _local5);
} else {
removeDarkZone(_local4, _local5);
}
}
}
}
function showUnwalkableTiles(vis) {
var _local3 = 0;
for ( ; _local3 < pTiles.length ; _local3++) {
var _local4 = _local3 % pLevelData.mWidth;
var _local5 = Math.floor(_local3 / pLevelData.mWidth);
if (!isTileWalkable(_local4, _local5)) {
if (vis) {
createDarkZone(_local4, _local5);
} else {
removeDarkZone(_local4, _local5);
}
}
}
}
function getTileClip(inI, inJ) {
var _local4 = getRoot("ground");
var _local5 = _local4[getTileName(inI, inJ)];
if (_local5 == undefined) {
return(null);
}
return(_local5);
}
function showWaterTiles(vis) {
var _local3 = 0;
for ( ; _local3 < pTiles.length ; _local3++) {
var _local4 = _local3 % pLevelData.mWidth;
var _local5 = Math.floor(_local3 / pLevelData.mWidth);
if (getTile(_local4, _local5).water) {
if (vis) {
createDarkZone(_local4, _local5);
} else {
removeDarkZone(_local4, _local5);
}
}
}
}
function createDarkZone(inI, inJ) {
var _local4 = getRoot("bloods")[(("rect" + inI) + "_") + inJ];
if (_local4 == undefined) {
_local4 = getRoot("bloods").attachMovie("lib_black_rect", (("rect" + inI) + "_") + inJ, getRoot("bloods").getNextHighestDepth());
_local4._width = (_local4._height = TILE_SIZE);
_local4._alpha = 50;
_local4._x = inI * TILE_SIZE;
_local4._y = inJ * TILE_SIZE;
}
}
function removeDarkZone(inI, inJ) {
var _local4 = getRoot("bloods")[(("rect" + inI) + "_") + inJ];
if (_local4 != undefined) {
_local4.removeMovieClip();
}
}
function getDepth(inx, iny) {
return(Math.round((inx + (iny * pPixelWidth)) * 0.01));
}
function getRandomWalkableTile(centerI, centerJ, range) {
var _local5 = null;
while (_local5 == null) {
var _local6 = Math.floor((Math.random() * range) * 2) - range;
var _local7 = range - Math.abs(_local6);
var _local8 = Math.floor((Math.random() * _local7) * 2) - _local7;
var _local9 = centerI + _local6;
var _local10 = centerJ + _local8;
if (isTileWalkable(_local9, _local10)) {
_local5 = getTile(_local9, _local10);
}
}
return(_local5);
}
function getTileFromLocation(x, y) {
var _local4 = Math.floor(x / sTileSize);
var _local5 = Math.floor(y / sTileSize);
return(getTile(_local4, _local5));
}
function getTile(i, j) {
var _local4 = convertTileIndex(i, j);
if (_local4 < 0) {
return(null);
}
return(pTiles[_local4]);
}
function convertTileIndex(i, j) {
if ((i < 0) || ((i >= pLevelData.mWidth) || ((j < 0) || (j >= pLevelData.mHeight)))) {
return(-1);
}
return((j * pLevelData.mWidth) + i);
}
function setScreenLocked(locked) {
pScreenLocked = locked;
}
function isTileWalkable(i, j) {
var _local4 = convertTileIndex(i, j);
if ((_local4 < 0) || (pCanWalk[_local4] == 0)) {
return(false);
}
if (pScreenLocked) {
var _local5 = pTiles[_local4];
var _local6 = Game.singleton.getCamera();
var _local7 = _local6.getPositionOnScreen(_local5.getCenterX(), _local5.getCenterY());
var _local8 = TILE_SIZE / 2;
if ((_local7.x > (Constant.GAME_WIDTH + _local8)) || ((_local7.x < (-_local8)) || ((_local7.y > (Constant.GAME_HEIGHT + _local8)) || (_local7.y < (-_local8))))) {
return(false);
}
}
return(true);
}
function getTileCost(i, j) {
if (isTileWalkable(i, j)) {
return(1);
}
return(1000);
}
function getPixelWidth() {
return(pPixelWidth);
}
function getPixelHeight() {
return(pPixelHeight);
}
//_local1.addProperty("loaded", _local1.__get__loaded, function () {
});
//_local1.addProperty("levelData", _local1.__get__levelData, _local1.__set__levelData);
//_local1.addProperty("tilesetLoaded", _local1.__get__tilesetLoaded, function () {
});
//(_global.SceneMap /* register */).addProperty("TILE_SIZE", (_global.SceneMap /* register */).__get__TILE_SIZE, function () {
});
//ASSetPropFlags(_local1, null, 1);
static var sTileSize = 40;
}
Symbol 20506 MovieClip [__Packages.Constant] Frame 0
class Constant
{
function Constant () {
}
static function getCookie() {
return(SharedObject.getLocal("haska-naruto3"));
}
static function hasSavedGame() {
return(getCookie().data.saved == "yes");
}
//ASSetPropFlags(_local1, null, 1);
static var GAME_WIDTH = 600;
static var GAME_HEIGHT = 400;
static var HIT_Y_RANGE = 30;
static var DEFAULT_MAP = "2-1";
static var DEFAULT_TILE = new flash.geom.Point(3, 14);
static var SKULL_NUM_KILLS = 100;
static var MICROPHONE = false;
}
Symbol 20507 MovieClip [__Packages.WaterEffect] Frame 0
class WaterEffect
{
var pMovieClip;
function WaterEffect (snd, x, y) {
var _local5 = Game.singleton.getSceneMap().getRoot("bloods");
pMovieClip = _local5.attachMovie("lib_watereffect", "water" + sIndex, _local5.getNextHighestDepth());
sIndex++;
pMovieClip._x = x;
pMovieClip._y = y;
tinymantis.SoundManager.sSingleton.playSound(snd, false, 100);
pMovieClip.onEnterFrame = tinymantis.Delegate.create(this, update);
}
function update() {
if (pMovieClip._currentframe == pMovieClip._totalframes) {
pMovieClip.onEnterFrame = null;
pMovieClip.removeMovieClip();
}
}
//ASSetPropFlags(_local1, null, 1);
static var sIndex = 0;
}
Symbol 20508 MovieClip [__Packages.Jumper] Frame 0
#initclip
if (!Jumper) {
//(_global.Jumper = function (parent, libname, type) {
super(parent, libname, type);
}) extends Gladiator
var _local1 = (_global.Jumper /* register */).prototype;
_local1.hit = function (attacker, damage, pushpower) {
if (this.isInState("attack", 0)) {
if (this.pMovieClip.body._currentframe < 35) {
return(false);
}
}
return(super.hit(attacker, damage, pushpower));
};
_local1.throw_update = function () {
super.throw_update();
if (this.pUniqueThrowObject != null) {
if (this.pUniqueThrowObject.isDead()) {
this.pUniqueThrowObject = null;
this.getBodyClip().gotoAndStop(this.getBodyClip()._totalframes);
}
}
};
_local1.walk_enter = function () {
super.walk_enter();
if (this.pUniqueThrowObject && (!this.pUniqueThrowObject.isDead())) {
this.pUniqueThrowObject.setOwner(null);
}
this.pUniqueThrowObject = null;
};
ASSetPropFlags(_local1, null, 1);
}
#endinitclip
Symbol 20509 MovieClip [__Packages.Script] Frame 0
class Script
{
var pExecutedTimes, pOccasionTimes, pRunning, pName, pType, pExit, pTimer;
function Script () {
pExecutedTimes = 0;
pOccasionTimes = 1;
pRunning = false;
}
function __get__name() {
return(pName);
}
function __get__type() {
return(pType);
}
function __get__exit() {
return(pExit);
}
function reset() {
pExecutedTimes = 0;
pTimer = 0;
pRunning = false;
}
function isRunning() {
return(pRunning);
}
function parseXML(node) {
pName = node.attributes.name;
pType = node.attributes.type;
pExit = node.attributes.exit == "true";
}
function start() {
if (pExecutedTimes < pOccasionTimes) {
pExecutedTimes++;
pTimer = 0;
pRunning = true;
return(true);
}
return(false);
}
function stop() {
if (pRunning) {
pRunning = false;
if (pExit) {
if (Game.singleton.isInState("run", 0) && (Game.singleton.getCaligula().health > 0)) {
Game.singleton.levelCompleted();
}
}
}
}
function update() {
pTimer++;
return(true);
}
//_local1.addProperty("type", _local1.__get__type, function () {
});
//_local1.addProperty("name", _local1.__get__name, function () {
});
//_local1.addProperty("exit", _local1.__get__exit, function () {
});
//ASSetPropFlags(_local1, null, 1);
}
Symbol 20510 MovieClip [__Packages.tinymantis.SoundManager] Frame 0
class tinymantis.SoundManager
{
static var _sSingleton;
var mSoundController, mSfxOn;
function SoundManager (inNumChannels) {
var _local3 = 0;
for ( ; _local3 < inNumChannels ; _local3++) {
addSound();
}
mSoundController = new Sound(_root);
mSfxOn = true;
}
static function __get__sSingleton() {
if (_sSingleton == undefined) {
_sSingleton = new tinymantis.SoundManager(20);
}
return(_sSingleton);
}
function set sfxon(isOn) {
mSfxOn = isOn;
//return(sfxon);
}
function get sfxon() {
return(mSfxOn);
}
function isChannelPlaying(index) {
if ((index >= 0) && (index < mSoundIsPlaying.length)) {
return(mSoundIsPlaying[index]);
}
return(false);
}
function playSoundAt(inSoundName, position, vol) {
var _local5 = -1;
var _local6 = 0;
for ( ; _local6 < mSoundIsPlaying.length ; _local6++) {
if (!mSoundIsPlaying[_local6]) {
mSoundIsPlaying[_local6] = true;
_local5 = _local6;
break;
}
}
if (_local5 != -1) {
var _local7 = mSoundPool[_local5];
_local7.attachSound(inSoundName);
if (_local7 == undefined) {
throw new Error("there is no sound at index" + _local5);
}
_local7.start(position, 0);
_local7.setVolume(vol);
} else {
throw new Error("Not enough sound channels!!! Increase the number of channels");
}
return(_local5);
}
function playSound(inSoundName, loop, vol) {
var _local5 = -1;
var _local6 = 0;
for ( ; _local6 < mSoundIsPlaying.length ; _local6++) {
if (!mSoundIsPlaying[_local6]) {
mSoundIsPlaying[_local6] = true;
_local5 = _local6;
break;
}
}
if (_local5 != -1) {
var _local7 = mSoundPool[_local5];
if (_local7 == undefined) {
throw new Error("there is no sound at index" + _local5);
}
_local7.attachSound(inSoundName);
if (loop) {
_local7.start(0, 100000);
} else {
if (!mSfxOn) {
vol = 0;
}
_local7.start(0, 0);
}
_local7.setVolume(vol);
} else {
throw new Error("Not enough sound channels!!! Increase the number of channels");
}
return(_local5);
}
function stopSound(inIndex) {
var _local3 = mSoundPool[inIndex];
if (_local3 != undefined) {
_local3.stop();
freeSound(inIndex);
}
return(-1);
}
function freeSound(inIndex) {
mSoundIsPlaying[inIndex] = false;
}
function setVolume(inIndex, inVolume) {
var _local4 = mSoundPool[inIndex];
if (_local4 == undefined) {
throw new Error("there is no sound at index" + inIndex);
}
_local4.setVolume(inVolume);
}
function getSound(inIndex) {
var _local3 = mSoundPool[inIndex];
if (_local3 == undefined) {
throw new Error("there is no sound at index" + inIndex);
}
return(_local3);
}
function addSound() {
var _local2 = _root.createEmptyMovieClip("sndobj" + mCounter, _root.getNextHighestDepth());
var _local3 = new Sound(_local2);
_local3.index = mSoundPool.length;
_local3.onSoundComplete = function () {
tinymantis.SoundManager.sSingleton.freeSound(this.index);
};
mSoundPool.push(_local3);
mSoundParentPool.push(_local2);
mSoundIsPlaying.push(false);
mCounter++;
}
function setGlobalVolume(vol) {
mSoundController.setVolume(vol);
}
function getGlobalVolume() {
return(mSoundController.getVolume());
}
var mSoundPool = new Array();
var mSoundParentPool = new Array();
var mSoundIsPlaying = new Array();
var mCounter = 100000;
}
Symbol 20511 MovieClip [__Packages.Orgy] Frame 0
#initclip
if (!Orgy) {
//(_global.Orgy = function (parent, libname, type) {
super(type);
this.initClip(parent, libname);
}) extends NPC
var _local1 = (_global.Orgy /* register */).prototype;
(_global.Orgy /* register */).resetOrgyState = function () {
Orgy.sOrgyState = new Object();
};
(_global.Orgy /* register */).getOrgyTouched = function (id) {
if (Orgy.sOrgyState[id] == undefined) {
return(false);
}
return(true);
};
(_global.Orgy /* register */).setOrgyTouched = function (id) {
Orgy.sOrgyState[id] = "touched";
};
_local1.npc_initialize = function () {
};
_local1.init_update = function () {
super.init_update();
this.pHateCaligula = 0;
this.pAwareOfCaligula = false;
var _local3 = 0.8;
var _local4 = new Array();
_local4 = _local4.concat([_local3, 0, 0, 0, 0]);
_local4 = _local4.concat([0, _local3, 0, 0, 0]);
_local4 = _local4.concat([0, 0, _local3, 0, 0]);
_local4 = _local4.concat([0, 0, 0, 1, 0]);
var _local5 = new flash.filters.ColorMatrixFilter(_local4);
this.clip.filters = [_local5];
};
_local1.idle_update = function () {
};
_local1.think_enter = function () {
if (Orgy.getOrgyTouched(this.pID)) {
this.setTouched();
}
};
_local1.think_update = function () {
if (!this.pAwareOfCaligula) {
var _local2 = Game.singleton.getCaligula();
if (_local2.clip.hitTest(this.clip)) {
tinymantis.SoundManager.sSingleton.playSound("you_scored.wav", false, 50);
this.setTouched();
}
}
};
_local1.setTouched = function () {
this.pAwareOfCaligula = true;
this.clip.filters = null;
Orgy.setOrgyTouched(this.pID);
};
ASSetPropFlags(_local1, null, 1);
(_global.Orgy /* register */).sOrgyState = new Object();
}
#endinitclip
Symbol 20512 MovieClip [__Packages.LevelData] Frame 0
class LevelData
{
var mName, mNumKills, pOrgyRoom, pTriggers, pScripts, mXMLName, mTiles, pXML, mWeaponIcons, mSkyRegions, mExits, mObjects, mMobs, mBreakableObjects, mWayPoints, mWaterTileIds, mWidth, mHeight, mSize, mTileset;
function LevelData (name) {
mName = name;
mNumKills = 0;
pOrgyRoom = false;
pTriggers = new Array();
pScripts = new Object();
}
function load() {
var _local2 = mName;
if (mXMLName != _local2) {
mTiles = null;
pXML = new XML();
pXML.ignoreWhite = true;
pXML.onLoad = tinymantis.Delegate.create(this, onLoad);
mXMLName = _local2;
pXML.load(("zones/" + mXMLName) + ".xml");
}
}
function reset() {
var _local2 = 0;
for ( ; _local2 < pTriggers.length ; _local2++) {
var _local3 = pTriggers[_local2];
_local3.reset();
}
var _local4 = 0;
for ( ; _local4 < mWeaponIcons.length ; _local4++) {
var _local5 = mWeaponIcons[_local4];
_local5.picked = false;
}
}
function onLoad(success) {
var _local3 = pXML.firstChild;
while (_local3 && (_local3.nodeName != "gameLevel")) {
_local3 = _local3.nextSibling;
}
if (_local3 == null) {
throw new Error("Bad XML format: " + mName);
}
mTiles = new Object();
mSkyRegions = new Array();
mExits = new Array();
mObjects = new Array();
mMobs = new Array();
mWeaponIcons = new Array();
mBreakableObjects = new Array();
mWayPoints = new Object();
mWaterTileIds = new Array();
var _local4 = _local3.firstChild;
while (_local4) {
switch (_local4.nodeName) {
case "level" :
mWidth = _global.parseInt(_local4.attributes.width);
mHeight = _global.parseInt(_local4.attributes.height);
mSize = mWidth * mHeight;
mTileset = _local4.attributes.set;
break;
case "ground" :
case "sky" :
case "canWalk" :
mTiles[_local4.nodeName] = parseNumbericArray(_local4.attributes.tiles);
break;
case "skyRegion" :
addSkyRegion(_local4);
break;
case "exit" :
addExit(_local4);
break;
case "object" :
addObject(_local4);
break;
case "mob" :
addMob(_local4);
break;
case "weapon" :
addWeaponIcon(_local4);
break;
case "waypoint" :
addWayPoint(_local4);
break;
case "trigger" :
addTrigger(_local4);
break;
case "scripts" :
addScripts(_local4);
}
_local4 = _local4.nextSibling;
}
var _local5 = null;
if (_local5) {
var _local6 = 0;
for ( ; _local6 < _local5.length ; _local6++) {
var _local7 = _local5[_local6];
if (_local7.length) {
mWaterTileIds.push(_global.parseInt(_local7));
}
}
}
var _local8 = Game.singleton.getMapVisited(mName);
if (_local8 && (_local8.skull)) {
mNumKills = getSkullKills();
}
for (var layerName in mTiles) {
var _local9 = mTiles[layerName];
}
}
function getTriggers() {
return(pTriggers);
}
function isOrgyRoom() {
return(pOrgyRoom);
}
function getSkullKills() {
return(Math.min(100, mMobs.length * 5));
}
function isWaterTile(index) {
var _local3 = mTiles.ground[index];
return(tinymantis.Utils.arrayIndexOf(mWaterTileIds, _local3) >= 0);
}
function getWayPoint(id) {
return(mWayPoints[id]);
}
function addWayPoint(node) {
var _local3 = node.attributes.id;
var _local4 = new flash.geom.Point(_global.parseInt(node.attributes.x), _global.parseInt(node.attributes.y));
mWayPoints[_local3] = _local4;
}
function addTrigger(node) {
var _local3 = new Trigger(this, _global.parseInt(node.attributes.x), _global.parseInt(node.attributes.y), node.attributes.script);
pTriggers.push(_local3);
}
function addScripts(node) {
var _local3 = node.firstChild;
while (_local3) {
if (!(_local3.nodeName === "script")) {
} else {
addScript(_local3);
}
_local3 = _local3.nextSibling;
}
}
function addScript(node) {
var _local3 = null;
var _local4 = node.attributes.type;
if (!(_local4 === "screen lock")) {
} else {
_local3 = new ScreenLockScript();
}
if (_local3) {
_local3.parseXML(node);
pScripts[_local3.name] = _local3;
}
}
function getScript(scriptname) {
return(pScripts[scriptname]);
}
function addWeaponIcon(node) {
var _local3 = new Object();
_local3.type = node.attributes.mType;
_local3.i = _global.parseInt(node.attributes.x);
_local3.j = _global.parseInt(node.attributes.y);
_local3.picked = false;
mWeaponIcons.push(_local3);
}
function addMob(node) {
var _local3 = new Object();
_local3.type = convertTypeName(node.attributes.mType);
_local3.i = _global.parseInt(node.attributes.x);
_local3.j = _global.parseInt(node.attributes.y);
_local3.id = node.attributes.id;
if (_local3.type != "Naruto") {
var _local4 = new Array();
var _local5 = node.attributes.path;
var _local6 = _local5.split(",");
var _local7 = 0;
for ( ; _local7 < _local6.length ; _local7++) {
if (_local6[_local7].length > 0) {
_local4.push(_local6[_local7]);
}
}
_local3.path = _local4;
}
if (_local3.type != "") {
mMobs.push(_local3);
if (_local3.type.indexOf("Orgy") == 0) {
pOrgyRoom = true;
}
}
}
static function convertTypeName(typename) {
switch (typename) {
case "sand_ninja_1" :
return("SandNinja1");
case "sand_ninja_2" :
return("SandNinja2");
case "sand_ninja_3" :
return("SandNinja3");
case "sand_ninja_4" :
return("SandNinja4");
case "sound_ninja_1" :
return("SoundNinja1");
case "sound_ninja_2" :
return("SoundNinja2");
case "sound_ninja_3" :
return("SoundNinja3");
case "sound_ninja_4" :
return("SoundNinja4");
case "sand_gaarr" :
return("Gaarr");
case "green_snake" :
return("GreenSnake");
case "snake_poison" :
return("SnakePoison");
case "twoheaded" :
return("Twoheaded");
case "snake_death" :
return("SnakeDeath");
case "Naruto" :
return("Naruto");
}
return("");
}
function addObject(node) {
var _local3 = new Object();
_local3.type = node.attributes.oType;
_local3.i = _global.parseInt(node.attributes.x);
_local3.j = _global.parseInt(node.attributes.y);
switch (_local3.type) {
case "amphora" :
mBreakableObjects.push(_local3);
break;
default :
mObjects.push(_local3);
}
}
function addExit(node) {
var _local3 = new Object();
_local3.dMap = node.attributes.map;
_local3.x = _global.parseInt(node.attributes.x);
_local3.y = _global.parseInt(node.attributes.y);
_local3.dX = _global.parseInt(node.attributes.dX);
_local3.dY = _global.parseInt(node.attributes.dY);
mExits.push(_local3);
}
function addSkyRegion(node) {
var _local3 = node.attributes;
var _local4 = new SkyRegion(_global.parseInt(_local3.x), _global.parseInt(_local3.y), _global.parseInt(_local3.w), _global.parseInt(_local3.h));
mSkyRegions.push(_local4);
}
function clearSkyRegionTiles() {
var _local2 = 0;
for ( ; _local2 < mSkyRegions.length ; _local2++) {
mSkyRegions[_local2].mTiles = new Array();
}
}
function parseNumbericArray(src) {
var _local3 = src.split(",");
var _local4 = new Array();
var _local5 = 0;
for ( ; _local5 < _local3.length ; _local5++) {
_local4.push(_global.parseInt(_local3[_local5]));
}
return(_local4);
}
function __get__loaded() {
return(mTiles != null);
}
//_local1.addProperty("loaded", _local1.__get__loaded, function () {
});
//ASSetPropFlags(_local1, null, 1);
}
Symbol 20513 MovieClip [__Packages.GameUI] Frame 0
#initclip
if (!GameUI) {
//(_global.GameUI = function (clip) {
super("GameUI");
this.pMovieClip = clip;
this.pHealthBar = this.pMovieClip.cHud.cHealthBar;
this.pEnergyBar = this.pMovieClip.cHud.cEnergyBar;
this.pLevelBar = this.pMovieClip.cHud.cLevelBar;
this.pMovieClip.cHud.mHealthField.autoSize = true;
this.pScreenLocked = false;
this.pExpNeeded = (this.pExpSofar = 0);
this.pFirstWeaonUI = new WeaponUI(this.pMovieClip.cHud, true);
this.pSecondWeaponUI = new WeaponUI(this.pMovieClip.cHud.cSecondWeapon, false);
this.gotoState("run");
}) extends tinymantis.GameObject
var _local1 = (_global.GameUI /* register */).prototype;
_local1.setEnabled = function (enable) {
this.pMovieClip.cHud.mSoundButtonSet._visible = enable;
this.pMovieClip.cHud.mHelpButton._visible = enable;
this.pMovieClip.cHud.mMapButton._visible = enable;
};
_local1.setScreenLock = function (lock) {
this.pScreenLocked = lock;
this.pMovieClip.cScreenLock.gotoAndPlay((lock ? "in" : "out"));
};
_local1.showArrows = function (direction) {
Game.singleton.showGoMessage();
};
_local1.setWeaponIcon = function (attackData, backupAttackData) {
var _local4 = this.pFirstWeaonUI.hasWeapon();
this.pFirstWeaonUI.setWeaponIcon(backupAttackData);
if (attackData == backupAttackData) {
if (this.pSecondWeaponUI.visible) {
this.pSecondWeaponUI.setVisible(false, true);
}
} else if (attackData != null) {
this.pSecondWeaponUI.setWeaponIcon(attackData);
if ((!this.pSecondWeaponUI.visible) || (!_local4)) {
this.pSecondWeaponUI.setVisible(true, this.pFirstWeaonUI.hasWeapon());
}
}
};
_local1.isWeaponReady = function () {
if (this.pSecondWeaponUI.visible) {
return(this.pSecondWeaponUI.isWeaponReady());
}
return(this.pFirstWeaonUI.isWeaponReady());
};
_local1.setWeaponPreparingFrame = function (frame) {
this.pFirstWeaonUI.setWeaponPreparingFrame(frame);
};
_local1.getWeaponPreparingFrame = function () {
return(this.pFirstWeaonUI.getWeaponPreparingFrame());
};
_local1.onKeyUp = function () {
switch (Key.getCode()) {
case 77 :
Main.button_map_pressed();
break;
case 81 :
Main.button_mute_pressed(!Main.isMute());
break;
case 72 :
Main.button_help_pressed();
}
};
_local1.updateExp = function (expsofar, expneeded) {
this.pExpSofar = expsofar;
this.pExpNeeded = expneeded;
};
_local1.run_enter = function () {
Key.addListener(this);
};
_local1.run_exit = function () {
Key.removeListener(this);
};
_local1.run_update = function () {
var _local2 = Game.singleton.getCaligula();
if (_local2) {
var _local3 = 0.5;
var _local4 = _local2.health / _local2.health_max;
var _local5 = this.pHealthBar._totalframes - Math.floor(_local4 * (this.pHealthBar._totalframes - 1));
if (_local5 != this.pHealthBar._currentframe) {
var _local6 = (_local5 - this.pHealthBar._currentframe) * _local3;
if (Math.abs(_local6) < 1) {
_local6 = ((_local6 > 0) ? 1 : -1);
} else {
_local6 = Math.round(_local6);
}
this.pHealthBar.gotoAndStop(this.pHealthBar._currentframe + _local6);
}
this.pMovieClip.cHud.mHealthField.text = "" + _local2.health;
this.pMovieClip.cHud.mHealthMaxField.text = "/" + _local2.health_max;
this.pMovieClip.cHud.mHealthMaxField._x = (this.pMovieClip.cHud.mHealthField._x + this.pMovieClip.cHud.mHealthField.textWidth) + 1;
_local4 = 0;
if (this.pExpNeeded > 0) {
_local4 = this.pExpSofar / this.pExpNeeded;
}
_local4 = 1 - _local4;
_local5 = this.pLevelBar._totalframes - Math.floor(_local4 * (this.pLevelBar._totalframes - 1));
if (_local5 != this.pLevelBar._currentframe) {
var _local7 = (_local5 - this.pLevelBar._currentframe) * _local3;
if (Math.abs(_local7) < 1) {
_local7 = ((_local7 > 0) ? 1 : -1);
} else {
_local7 = Math.round(_local7);
}
this.pLevelBar.gotoAndStop(this.pLevelBar._currentframe + _local7);
}
var _local8 = "" + Game.singleton.getLevelInfo().level;
if (_local8.length == 1) {
_local8 = "0" + _local8;
}
this.pMovieClip.cHud.mLevelField.text = _local8;
}
this.pFirstWeaonUI.update();
this.pSecondWeaponUI.update();
};
_local1.hide_enter = function () {
this.setEnabled(false);
this.pMovieClip.cHud._visible = false;
};
_local1.hide_update = function () {
};
_local1.show_enter = function () {
this.pMovieClip.cHud._visible = true;
this.setScreenLock(this.pScreenLocked);
this.setEnabled(true);
};
_local1.show_update = function () {
this.gotoState("run");
};
(_global.GameUI /* register */).initStateMachine = function () {
tinymantis.GameObject.buildStateGroup("GameUI", new Array("run", "hide", "show"), 0);
};
ASSetPropFlags(_local1, null, 1);
}
#endinitclip
Symbol 20514 MovieClip [__Packages.Skeleton] Frame 0
#initclip
if (!Skeleton) {
//(_global.Skeleton = function (parent, libname, type) {
super(parent, libname, type);
this.pOwner = null;
}) extends Gladiator
var _local1 = (_global.Skeleton /* register */).prototype;
_local1.setOwner = function (inx, iny, indirection, owner) {
this.pMovieClip._alpha = 0;
this.pOwner = owner;
this.initPosition(inx, iny);
this.initDirection(indirection);
};
_local1.isSkeleton = function () {
return(true);
};
_local1.getOwner = function () {
return(this.pOwner);
};
_local1.npc_initialize = function () {
};
_local1.hit = function (attacker, damage, pushpower) {
if (this.isInState("standup", 0)) {
return(false);
}
return(super.hit(attacker, damage, pushpower));
};
_local1.init_update = function () {
super.init_update();
if (this.pOwner) {
this.gotoState("standup");
this.pConfuseEffect = new Object();
this.pValue = 0;
this.party = this.pOwner.party;
}
};
_local1.standup_enter = function () {
this.pMovieClip._alpha = 100;
this.pMovieClip.gotoAndStop("standing");
};
_local1.standup_update = function () {
if (this.pMovieClip.body._currentframe == this.pMovieClip.body._totalframes) {
this.gotoState("idle");
}
};
_local1.ghost_update = function () {
if (this.pOwner) {
this.gotoState("recycle");
} else {
super.ghost_update();
}
};
_local1.findTargetAttackTile = function (target) {
var _local4 = Math.abs(this.pCurrentTarget.X - this.X);
var _local5 = 0;
for ( ; _local5 < this.pAttackData.length ; _local5++) {
var _local6 = this.pAttackData[_local5];
if ((_local4 >= _local6.min_range) && (_local4 < _local6.max_range)) {
this.pCurrentAttack = _local6;
break;
}
}
var _local7 = super.findTargetAttackTile(target);
if ((_local7 == null) && (this.pCurrentAttack != this.pAttackData[0])) {
this.pCurrentAttack = this.pAttackData[0];
_local7 = super.findTargetAttackTile(target);
}
return(_local7);
};
_local1.think_update = function () {
if ((this.pThinkTimer == 30) && (this.health > 0)) {
if (this.pOwner == Game.singleton.getCaligula()) {
if (this.pOwner.health <= 0) {
this.gotoState("null");
this.gotoState("disappear");
return(undefined);
}
}
}
super.think_update();
};
_local1.disappear_enter = function () {
this.pMovieClip.gotoAndStop("disappear");
this.health = 0;
};
_local1.disappear_update = function () {
if (this.pMovieClip.body._currentframe == this.pMovieClip.body._totalframes) {
this.gotoState("recycle");
}
};
ASSetPropFlags(_local1, null, 1);
}
#endinitclip
Symbol 20515 MovieClip [__Packages.GameOverScreen] Frame 0
class GameOverScreen
{
static var singleton;
var pMovieClip;
function GameOverScreen (parent) {
singleton = this;
pMovieClip = parent.attachMovie("lib_gameover_screen", "gameoverscreen", parent.getNextHighestDepth());
}
function setupInfoBoard(root) {
var _local3 = new tinymantis.DigiNumber(root.cScores, 12, "n");
_local3.setCommaSpace(5);
var _local4 = Game.singleton.getTimePassed();
var _local5 = Math.round(_local4 / 1000);
var _local6 = Math.floor(_local5 / 60);
_local5 = _local5 - (_local6 * 60);
_local3 = new tinymantis.DigiNumber(root.cMinutes, 3, "n");
_local3.setAlign("none");
_local3.setNumber(_local6);
_local3 = new tinymantis.DigiNumber(root.cSeconds, 2, "n");
_local3.setAlign("left");
_local3.setAddZero(true);
_local3.setNumber(_local5);
_local3 = new tinymantis.DigiNumber(root.cNumKills, 5, "n");
_local3.setAlign("center");
_local3.setCommaSpace(3);
_local3.setNumber(Game.singleton.mNumKills);
_local3 = new tinymantis.DigiNumber(root.cWeaponsOwn, 2, "n");
_local3.setAlign("none");
_local3.setNumber(Game.singleton.getNumActivatedWeapons());
_local3 = new tinymantis.DigiNumber(root.cWeaponsTotal, 2, "n");
_local3.setAlign("none");
_local3.setNumber(Game.singleton.getTotalWeapons());
}
function onContinue(param) {
pMovieClip.removeMovieClip();
pMovieClip = null;
singleton = null;
if (param == "submit") {
Main.startSplash();
} else {
Game.singleton.gotoState("none");
Game.singleton.update();
Main.startGame();
}
}
//ASSetPropFlags(_local1, null, 1);
}
Symbol 20516 MovieClip [__Packages.tinymantis.AStar] Frame 0
class tinymantis.AStar
{
var _mMap;
function AStar (inMap) {
_mMap = inMap;
}
function findPath(inSrcX, inSrcY, inDstX, inDstY) {
return(findPathLimited(inSrcX, inSrcY, inDstX, inDstY, 1000));
}
function findPathLimited(inSrcX, inSrcY, inDstX, inDstY, limit) {
var _local7 = new Array();
var _local8 = new Object();
var _local9 = 0;
var _local10 = new Object();
var _local11 = new tinymantis.AStarNode(inSrcX, inSrcY);
var _local12 = false;
var _local13 = true;
var _local14 = new Array(new Array(1, 1), new Array(1, -1), new Array(-1, 1), new Array(-1, -1), new Array(1, 0), new Array(-1, 0), new Array(0, 1), new Array(0, -1));
_local10[_local11.mName] = _local11;
var _local15 = 0;
var _local16 = _mMap.getTileCost(inDstX, inDstY);
if ((_local16 == undefined) || (_local16 >= 1000)) {
return(_local7);
}
var _local17 = null;
for ( ; (!_local12) && (_local13) ; for ( ; _local20 < _local14.length ; _local20++) {
var _local21 = _local11.mX + _local14[_local20][0]var _local22 = _local11.mY + _local14[_local20][1]var _local23 = _mMap.getTileCost(_local21, _local22)for ( ; _local23 >= 1000 ; _local20++) {
}
for ( ; _local20 < 4 ; _local20++) {
for ( ; _mMap.getTileCost(_local21, _local11.mY) >= 1000 ; _local20++) {
}
if (_mMap.getTileCost(_local11.mX, _local22) < 1000) {
break;
}
}
var _local24 = new tinymantis.AStarNode(_local21, _local22)_local24.mParent = _local11.mNameif ((_local24.mX == inDstX) && (_local24.mY == inDstY)) {
_local11 = _local24_local12 = truebreak;
}
for ( ; _local10[_local24.mName] != undefined ; _local20++) {
}
_local24.mGCost = _local11.mGCost + _local23_local24.mFCost = _local24.mGCost + ((Math.abs(_local24.mX - inDstX) + Math.abs(_local24.mY - inDstY)) * 10)for ( ; _local24.mFCost > limit ; _local20++) {
}
if (_local8[_local24.mName] == undefined) {
_local8[_local24.mName] = _local24_local9++} else if (_local24.mGCost < _local8[_local24.mName].mGCost) {
_local8[_local24.mName] = _local24} else {
_local24 = null}
if (_local24 && (_local24.mFCost < _local17.mFCost)) {
_local17 = _local24}
}
, if (_local9 == 0) {
_local13 = false}
, if (!_local12) {
_local11 = null}
) {
if (_local9 > 0) {
if (_local17) {
if (_local8[_local17.mName] != undefined) {
_local11 = _local8[_local17.mName];
}
}
if (_local11 == null) {
var _local18 = 100000 /* 0x0186A0 */;
for (var it in _local8) {
var _local19 = _local8[it].mFCost;
if (_local19 < _local18) {
_local18 = _local19;
_local11 = _local8[it];
}
}
}
_local17 = _local11;
_local10[_local11.mName] = _local11;
delete _local8[_local11.mName];
_local9--;
}
var _local20 = 0;
}
if (_local12) {
var _local25 = _local11;
while (!((_local25.mX == inSrcX) && (_local25.mY == inSrcY))) {
var _local26 = new Object();
_local26.x = _local25.mX;
_local26.y = _local25.mY;
_local7.push(_local26);
_local25 = _local10[_local25.mParent];
}
_local7.reverse();
}
return(_local7);
}
}
Symbol 20517 MovieClip [__Packages.RamenIcon] Frame 0
#initclip
if (!RamenIcon) {
//(_global.RamenIcon = function (inType) {
super("RamenIcon", "RamenIcon");
this.pType = inType;
this.pFading = false;
}) extends SceneObject
var _local1 = (_global.RamenIcon /* register */).prototype;
(_global.RamenIcon /* register */).initStateMachine = function () {
tinymantis.GameObject.buildStateGroup("RamenIcon", new Array("drop", "idle"), 0);
};
_local1.initialize = function (parent, inx, iny) {
this.pMovieClip = parent.attachMovie(this.pType, "ramen" + (RamenIcon._sIndex++), this.pMovieClip.getNextHighestDepth());
this.initPosition(inx, iny);
this.gotoState("idle");
this.mStateParam = new Object();
};
_local1.fadeout = function () {
this.pFading = true;
};
_local1.idle_enter = function () {
this.mStateParam.flash_timer = 150;
};
_local1.idle_update = function () {
if (this.pDead) {
return(undefined);
}
if (this.pType) {
var _local2 = Game.singleton.getCaligula();
if (_local2.health > 0) {
var _local3 = _local2.X - this.X;
var _local4 = _local2.Y - this.Y;
if ((Math.abs(_local3) < 20) && (Math.abs(_local4) < 15)) {
_local2.eatRamen(this);
this.pDead = true;
}
}
if (this.pFading) {
if ((--this.mStateParam.flash_timer) < 0) {
this.pDead = true;
} else if (this.mStateParam.flash_timer < 60) {
this.pMovieClip._visible = (this.mStateParam.flash_timer % 2) == 0;
}
}
}
};
ASSetPropFlags(_local1, null, 1);
(_global.RamenIcon /* register */)._sIndex = 0;
(_global.RamenIcon /* register */).RED = "ramen_red";
(_global.RamenIcon /* register */).BLUE = "ramen_blue";
(_global.RamenIcon /* register */).GREEN = "ramen_green";
}
#endinitclip
Symbol 20518 MovieClip [__Packages.tinymantis.DigiNumber] Frame 0
class tinymantis.DigiNumber
{
var pMovieClip, pNumDigits, pPrefix, pAlign, pAddZero, pX, pWidth, pSpace, pCommaSpace, pNumber;
function DigiNumber (clip, numDigits, prefix) {
pMovieClip = clip;
pNumDigits = numDigits;
pPrefix = prefix;
pAlign = "center";
pAddZero = false;
pX = pMovieClip._x;
pWidth = pMovieClip._width;
pSpace = pWidth / pNumDigits;
pCommaSpace = 0;
}
function getNumDigits() {
return(pNumDigits);
}
function setCommaSpace(space) {
pCommaSpace = space;
}
function setAddZero(add) {
pAddZero = add;
}
function setAlign(align) {
pAlign = align;
}
function getNumber() {
return(pNumber);
}
function setNumber(num) {
pNumber = num;
var _local3 = 0;
var _local4 = pNumber;
var _local5 = 0;
for ( ; _local5 < pNumDigits ; _local5++) {
var _local6 = _local4 % 10;
var _local7 = _local6 + 2;
_local4 = Math.floor(_local4 / 10);
if ((_local6 == 0) && ((!pAddZero) && ((_local5 > 0) && (_local4 == 0)))) {
_local7 = 1;
}
if (_local7 > 1) {
_local3++;
}
pMovieClip[pPrefix + _local5].gotoAndStop(_local7);
}
if (pCommaSpace > 0) {
_local4 = pNumber;
var _local8 = Math.floor((pNumDigits - 1) / 3);
var _local9 = 0;
for ( ; _local9 < _local8 ; _local9++) {
pMovieClip[(pPrefix + "c") + _local9]._visible = ((_local4 > 999) ? true : false);
_local4 = Math.floor(_local4 / 1000);
}
}
var _local10 = pSpace * _local3;
switch (pAlign) {
case "center" :
pMovieClip._x = pX - ((pWidth - _local10) / 2);
break;
case "right" :
pMovieClip._x = pX - pWidth;
break;
case "left" :
pMovieClip._x = pX;
}
}
}
Symbol 20519 MovieClip [__Packages.Plebian] Frame 0
#initclip
if (!Plebian) {
//(_global.Plebian = function (parent, libname, type) {
super(type);
this.initClip(parent, libname);
}) extends NPC
var _local1 = (_global.Plebian /* register */).prototype;
_local1.hit = function (attacker, dmg, pushpower) {
if (super.hit(attacker, dmg, pushpower)) {
this.pHateCaligula = 10;
return(true);
}
return(false);
};
_local1.idle_update = function () {
if (this.isInState("burning", 2)) {
this.gotoState("flee");
} else {
super.idle_update();
}
};
_local1.flee_update = function () {
if (this.isInState("burning", 2)) {
if (!this.walk_path_update()) {
var _local3 = null;
while (_local3 == null) {
_local3 = Game.singleton.getSceneMap().getRandomWalkableTile(this.pTile.mI, this.pTile.mJ, 5);
var _local4 = Math.abs(_local3.mI - this.pTile.mI) + Math.abs(_local3.mJ - this.pTile.mJ);
if (_local4 < 2) {
_local3 = null;
}
}
var _local5 = new tinymantis.AStar(Game.singleton.getSceneMap());
var _local6 = _local5.findPathLimited(this.pTile.mI, this.pTile.mJ, _local3.mI, _local3.mJ, 80);
this.pWalkPath = _local6;
}
} else {
super.flee_update();
}
};
_local1.think_update = function () {
super.think_update();
if ((this.health > 0) && ((this.pHateCaligula > 0) && (this.pThinkTimer == 10))) {
var _local3 = Game.singleton.getCharacters();
var _local4 = 0;
for ( ; _local4 < _local3.length ; _local4++) {
var _local5 = _local3[_local4];
if ((_local5.health > 0) && ((_local5.pHateCaligula <= 0) && ((_local5.type == this.type) && ((_local5.party == this.party) && (this.getDistance(_local5) < 300))))) {
_local5.pHateCaligula = 10;
}
}
}
};
ASSetPropFlags(_local1, null, 1);
}
#endinitclip
Symbol 20520 MovieClip [__Packages.PopScore] Frame 0
class PopScore
{
var pMovieClip, pValue, pComboLevel;
function PopScore (value, comboLevel, obj) {
var _local5 = Game.singleton.getPopScoreRoot();
pMovieClip = _local5.attachMovie("lib_pop_score", "popscore" + sIndex, _local5.getNextHighestDepth());
sIndex++;
pMovieClip._x = obj.X;
pMovieClip._y = obj.Y - (obj.clip._height * 0.85);
if (obj.isCharacter()) {
var _local6 = Character(obj);
if (_local6.health > 0) {
pMovieClip._x = pMovieClip._x + 0;
} else {
pMovieClip._x = pMovieClip._x - (obj.getDirection() * 30);
}
}
pValue = value * comboLevel;
pComboLevel = comboLevel;
init();
pMovieClip.onEnterFrame = tinymantis.Delegate.create(this, update);
}
function init() {
var _local2 = new tinymantis.DigiNumber(pMovieClip.cScore, 10, "n");
_local2.setAlign("none");
_local2.setNumber(pValue);
var _local3 = 1;
var _local4 = pValue;
while (_local4 >= 10) {
_local4 = _local4 / 10;
_local3++;
}
pMovieClip.cScore.cPlus._x = pMovieClip.cScore.cPlus._x + ((_local2.getNumDigits() - _local3) * 10);
if (_local3 > 3) {
pMovieClip._x = pMovieClip._x + ((_local3 - 3) * 5);
}
pMovieClip.cCombo.gotoAndStop(pComboLevel);
}
function update() {
if (pMovieClip._totalframes == pMovieClip._currentframe) {
delete pMovieClip.onEnterFrame;
pMovieClip.removeMovieClip();
}
}
//ASSetPropFlags(_local1, null, 1);
static var sIndex = 0;
}
Symbol 20521 MovieClip [__Packages.AS2_Tracker] Frame 0
class AS2_Tracker
{
var trkConnection;
function AS2_Tracker () {
trkConnection = null;
var _local2 = _root.createEmptyMovieClip("as2tracker", _root.getNextHighestDepth());
var _local3 = new MovieClipLoader();
_local3.addListener(this);
_local3.loadClip("tracker.swf", _local2);
}
function onLoadInit(targetclip) {
trkConnection = new LocalConnection();
while (eventQueue.length) {
trackNewEvent(String(eventQueue.shift()));
}
targetclip._visible = false;
}
function trackNewEvent(eventName) {
if (trkConnection) {
trkConnection.send("trkConnection", "sendTracking", eventName);
} else {
eventQueue.push(eventName);
}
}
//ASSetPropFlags(_local1, null, 1);
static var singleton = new AS2_Tracker();
var eventQueue = new Array();
}
Symbol 20522 MovieClip [__Packages.Gaarr] Frame 0
#initclip
if (!Gaarr) {
//(_global.Gaarr = function (parent, libname, type) {
super(parent, libname, type);
}) extends Gladiator
var _local1 = (_global.Gaarr /* register */).prototype;
_local1.hit = function (attacker, damage, pushpower) {
if (this.isInState("attack", 0)) {
return(false);
}
return(super.hit(attacker, damage, pushpower));
};
_local1.attack_enter = function () {
super.attack_enter();
this.mStateParam.timer = 0;
};
_local1.attack_update = function () {
var _local3 = 15;
if (this.mStateParam.timer < _local3) {
if ((++this.mStateParam.timer) == _local3) {
this.pMovieClip.filters = null;
this.pMovieClip.body.gotoAndPlay(1);
} else {
if ((this.mStateParam.timer % 2) == 0) {
if (this.pMovieClip.filters && (this.pMovieClip.filters.length > 0)) {
this.pMovieClip.filters = null;
} else {
var _local4 = new Array();
_local4 = _local4.concat([0, 0, 0, 0, 255]);
_local4 = _local4.concat([0, 0, 0, 0, 255]);
_local4 = _local4.concat([0, 0, 0, 0, 255]);
_local4 = _local4.concat([0, 0, 0, 1, 0]);
this.pMovieClip.filters = [new flash.filters.ColorMatrixFilter(_local4)];
}
}
this.pMovieClip.body.gotoAndStop(1);
}
} else {
if ((++this.mStateParam.timer) == (_local3 + 10)) {
if (this.pCurrentAttack.weapon == "lib_sandwave") {
Game.singleton.getCamera().shake(30, 10);
}
}
super.attack_update();
}
};
_local1.attack_exit = function () {
this.pMovieClip.filters = null;
super.attack_exit();
};
_local1.decay_enter = function () {
super.decay_enter();
Game.singleton.levelCompleted();
};
_local1.decay_update = function () {
};
ASSetPropFlags(_local1, null, 1);
}
#endinitclip
Symbol 20523 MovieClip [__Packages.tinymantis.AStarNode] Frame 0
class tinymantis.AStarNode
{
var _mX, _mY, mName, mGCost, mFCost;
function AStarNode (inX, inY) {
_mX = inX;
_mY = inY;
mName = (("" + inX) + "_") + inY;
mGCost = (mFCost = 0);
}
function get mX() {
return(_mX);
}
function get mY() {
return(_mY);
}
}
Symbol 20524 MovieClip [__Packages.Iaculum] Frame 0
#initclip
if (!Iaculum) {
//(_global.Iaculum = function (weapon) {
super(weapon);
}) extends ThrowObject
var _local1 = (_global.Iaculum /* register */).prototype;
_local1.initialize = function (owner, attackdata) {
super.initialize(owner, attackdata);
var _local5 = 0;
for ( ; this.pMovieClip["cHitArea" + _local5] != undefined ; _local5++) {
var _local6 = this.pMovieClip["cHitArea" + _local5];
_local6.gotoAndPlay(1);
_local6._visible = true;
}
};
_local1.update = function () {
if (this.pDead) {
return(undefined);
}
if (this.pMovieClip._currentframe == this.pMovieClip._totalframes) {
this.pDead = true;
} else {
this.play_ani_sound();
var _local2 = 0;
for ( ; this.pMovieClip["cHitArea" + _local2] != undefined ; _local2++) {
var _local3 = this.pMovieClip["cHitArea" + _local2];
if (_local3._visible) {
var _local4 = Game.singleton.getCharacters();
var _local5 = 0;
for ( ; _local5 < _local4.length ; _local5++) {
var _local6 = _local4[_local5];
if ((_local6.health > 0) && ((_local6.party != this.pOwner.party) && (_local3.hitTest(_local6.getMovieClip())))) {
if (_local6.isInState("hit", 0) || (_local6.hit(this, this.getAttackDamage(_local6), this.pAttackData.pushpower * this.getDirection()))) {
_local3._visible = false;
break;
}
}
}
if (_local3._visible) {
var _local7 = Game.singleton.getBreakableObjects();
var _local8 = 0;
for ( ; _local8 < _local7.length ; _local8++) {
var _local9 = _local7[_local8];
if (!_local9.broken) {
if (_local9.hit(null, _local3)) {
_local3._visible = false;
break;
}
}
}
}
}
}
}
};
ASSetPropFlags(_local1, null, 1);
}
#endinitclip
Symbol 20525 MovieClip [__Packages.Main] Frame 0
class Main
{
static var mFpsMeter;
function Main () {
}
static function getGameID() {
return(3);
}
static function setupLeaderboardObject(obj) {
obj.gameId = getGameID();
obj.time_played = Math.round(Game.singleton.getTimePassed() / 1000);
obj.enemy_killed = Game.singleton.mNumKills;
obj.skeletons_resurrected = Game.singleton.mSkeletonResurrected;
obj.times_killed_by_bee = Game.singleton.mTimesKilledByBee;
obj.rooms_purged = Game.singleton.getNumSkulls();
obj.rats_killed = Game.singleton.mRatsKilled;
}
static function main() {
_root._focusrect = false;
_root.tabEnabled = false;
_root.tabChildren = false;
Button.prototype.onRollOver = button_rollover;
Button.prototype.onPress = button_press;
if (_root.preloader != undefined) {
_root.preloader.removeMovieClip();
}
_root.attachMovie("lib_black_rect", "bg", _root.getNextHighestDepth());
CharacterInfo.singleton.loadInfo("characters.xml");
initStateMachines();
startSplash();
_root.onEnterFrame = loading_update;
mFpsMeter = new tinymantis.FpsMeter("2.0.3.G");
}
static function loading_update() {
if (CharacterInfo.singleton.loaded) {
if (sCheatEnabled) {
mFpsMeter.activate();
}
_root.onEnterFrame = null;
}
}
static function setMicrophone(activate) {
Constant.MICROPHONE = activate;
}
static function closeSplashScreen() {
if (_root.screen != undefined) {
_root.screen.removeMovieClip();
}
if (_root.ingame_screen != undefined) {
_root.ingame_screen.removeMovieClip();
}
}
static function stopSplashMusic() {
if (spIntroSoundChannel >= 0) {
spIntroSoundChannel = tinymantis.SoundManager.sSingleton.stopSound(spIntroSoundChannel);
}
}
static function startSplashMusic() {
if (spIntroSoundChannel < 0) {
spIntroSoundChannel = tinymantis.SoundManager.sSingleton.playSound("music_intro_loop.aif", true, 100);
}
}
static function startSplash() {
var _local2 = _root.attachMovie("lib_start_screen", "screen", 1);
_local2._x = 300;
_local2._y = 200;
_local2.stop();
startSplashMusic();
return(_local2);
}
static function hasSavedGame() {
var _local2 = Constant.getCookie();
if (_local2.data.saved == "yes") {
return(true);
}
return(false);
}
static function startGame(newGame) {
if (CharacterInfo.singleton.loaded) {
closeSplashScreen();
if (Game.singleton) {
Game.singleton.gotoState("run");
} else {
var _local3 = new Game(_root, true);
if (!newGame) {
_local3.loadSavedGame();
}
var _local4 = new LevelMap(_root);
}
}
}
static function initStateMachines() {
Game.initStateMachine();
Character.initStateMachine();
GameUI.initStateMachine();
Eagle.initStateMachine();
WeaponIcon.initStateMachine();
RamenIcon.initStateMachine();
}
static function setGlobalVolume(vol) {
tinymantis.SoundManager.sSingleton.setGlobalVolume(vol);
}
static function getGlobalVolume() {
return(tinymantis.SoundManager.sSingleton.getGlobalVolume());
}
static function getCharacter(clip) {
while (clip && (clip._name != "body")) {
clip = clip._parent;
}
return(clip._parent.mCharacter);
}
static function gameOverScreen() {
var _local2 = new GameOverScreen(_root);
}
static function button_rollover() {
tinymantis.SoundManager.sSingleton.playSound("interface_button_rollover.wav", false, 100);
}
static function button_press() {
tinymantis.SoundManager.sSingleton.playSound("interface_button_press.wav", false, 100);
}
static function button_map_pressed() {
if (Game.singleton.isInState("run", 0) && (Game.singleton.getWaitSeconds() <= 0)) {
Game.singleton.gotoState("pause");
LevelMap.singleton.initialize();
}
}
static function button_mute_pressed(mute) {
tinymantis.SoundManager.sSingleton.setGlobalVolume((mute ? 0 : 100));
}
static function isMute() {
return(tinymantis.SoundManager.sSingleton.getGlobalVolume() == 0);
}
static function button_help_pressed() {
if (Game.singleton.isInState("run", 0) && (Game.singleton.getWaitSeconds() <= 0)) {
var _local2 = _root.attachMovie("lib_start_screen", "ingame_screen", _root.getNextHighestDepth());
_local2._x = 300;
_local2._y = 200;
_local2.gotoAndPlay(2);
Game.singleton.gotoState("pause");
}
}
//ASSetPropFlags(_local1, null, 1);
static var spIntroSoundChannel = -1;
static var sCheatEnabled = false;
}
Symbol 20526 MovieClip [__Packages.ScreenLockScript] Frame 0
#initclip
if (!ScreenLockScript) {
//(_global.ScreenLockScript = function () {
super();
}) extends Script
var _local1 = (_global.ScreenLockScript /* register */).prototype;
_local1.parseXML = function (node) {
this.pMusic = "level_music_xtra.aif";
this.pEnemyInfo = new Array();
super.parseXML(node);
node = node.firstChild;
while (node != null) {
switch (node.nodeName) {
case "screen" :
this.pWidth = _global.parseInt(node.attributes.width);
this.pHeight = _global.parseInt(node.attributes.height);
this.pExitDirection = node.attributes.exit;
if (!this.pExitDirection) {
this.pExitDirection = "east";
}
if (node.attributes.music) {
this.pMusic = node.attributes.music;
}
break;
case "enemy" :
this.addEnemy(node);
}
node = node.nextSibling;
}
};
_local1.addEnemy = function (node) {
var _local3 = new Object();
_local3.type = LevelData.convertTypeName(node.attributes.mType);
_local3.from = node.attributes.from;
_local3.delay = _global.parseInt(node.attributes.delay);
this.pEnemyInfo.push(_local3);
};
_local1.start = function () {
if (super.start()) {
Game.singleton.getCamera().lock(this.pWidth, this.pHeight);
Game.singleton.getGameUI().setScreenLock(true);
this.pEnemies = new Array(this.pEnemyInfo.length);
this.pMusicChannel = tinymantis.SoundManager.sSingleton.playSound(this.pMusic, true, 100);
Game.singleton.setMusicVolume(60);
return(true);
}
return(false);
};
_local1.stop = function () {
if (this.pRunning) {
super.stop();
Game.singleton.setMusicVolume(100);
this.pMusicChannel = tinymantis.SoundManager.sSingleton.stopSound(this.pMusicChannel);
if (!this.pExit) {
Game.singleton.getGameUI().setScreenLock(false);
}
Game.singleton.getCamera().release();
if ((Game.singleton.getCaligula().health > 0) && (!this.pExit)) {
Game.singleton.getGameUI().showArrows(this.pExitDirection);
}
}
};
_local1.update = function () {
super.update();
var _local3 = true;
var _local4 = 0;
for ( ; _local4 < this.pEnemyInfo.length ; _local4++) {
var _local5 = this.pEnemyInfo[_local4];
if (this.pTimer < _local5.delay) {
_local3 = false;
} else {
var _local6 = this.pEnemies[_local4];
if ((_local6 == undefined) || (_local6 == null)) {
_local6 = this.createEnemyInstance(_local5);
this.pEnemies[_local4] = _local6;
_local3 = false;
} else if (!_local6.isDecayed()) {
_local3 = false;
}
}
}
if (_local3) {
return(false);
}
return(true);
};
_local1.createEnemyInstance = function (enemyInfo) {
var _local3 = Game.singleton.getCamera();
var _local4 = Game.singleton.getSceneMap();
var _local5 = NPC(Game.singleton.createCharacter(_local4.getRoot("chars"), enemyInfo.type));
if (_local5 == null) {
throw new Error("Failed to create charater : " + enemyInfo.type);
}
var _local6 = 0;
var _local7 = Math.floor(_local3.getCameraY() / SceneMap.TILE_SIZE);
var _local8 = _local7 + Math.ceil(Constant.GAME_HEIGHT / SceneMap.TILE_SIZE);
if (enemyInfo.from == "west") {
_local6 = Math.floor(_local3.getCameraX() / SceneMap.TILE_SIZE) - 1;
} else {
_local6 = Math.ceil((_local3.getCameraX() + Constant.GAME_WIDTH) / SceneMap.TILE_SIZE);
}
var _local9 = new Array();
var _local10 = _local7;
for ( ; _local10 <= _local8 ; _local10++) {
_local9.push(_local10);
}
var _local11 = -1;
while (_local11 < 0) {
var _local12 = Math.floor(Math.random() * _local9.length);
var _local13 = _local9[_local12];
_local9[_local12] = _local9[_local9.length - 1];
_local9.pop();
if (_local4.isTileWalkable(_local6, _local13)) {
_local11 = _local13;
}
}
if (_local11 >= 0) {
var _local14 = new Object();
_local14.type = enemyInfo.type;
_local14.i = _local6;
_local14.j = _local11;
_local14.id = 0;
_local5.loadData(_local14);
_local5.setAwareOfCaligula(true);
}
return(_local5);
};
ASSetPropFlags(_local1, null, 1);
}
#endinitclip
Symbol 20527 MovieClip [__Packages.Frisbee] Frame 0
#initclip
if (!Frisbee) {
//(_global.Frisbee = function (weapon) {
super(weapon);
this.pSpeed = new flash.geom.Point();
this.pTimerToComeBack = 30;
}) extends ThrowObject
var _local1 = (_global.Frisbee /* register */).prototype;
_local1.isUnique = function () {
return(true);
};
_local1.destroy = function () {
super.destroy();
};
_local1.initialize = function (owner, attackdata) {
super.initialize(owner, attackdata);
this.pSpeed.x = owner.getDirection() * 28;
this.pSpeed.y = -7;
this.pTimer = 0;
};
_local1.getDirection = function () {
var _local3 = super.getDirection();
if (this.pTimer > this.pTimerToComeBack) {
_local3 = -_local3;
}
return(_local3);
};
_local1.update = function () {
if (this.pDead) {
return(undefined);
}
this.pTimer++;
if ((this.pOwner == null) || (this.pOwner.health <= 0)) {
this.pOwner = null;
this.pMovieClip._alpha = this.pMovieClip._alpha - 5;
if (this.pMovieClip._alpha <= 0) {
this.pDead = true;
}
this.pX = this.pX + this.pSpeed.x;
this.pY = this.pY + this.pSpeed.y;
this.pMovieClip._x = this.pX;
this.pMovieClip._y = this.pY;
this.updateDepth(this.pX, this.pY);
return(undefined);
}
var _local2 = 38;
var _local3 = new flash.geom.Point(this.pOwner.X - this.pX, (this.pOwner.Y - _local2) - this.pY);
if (this.pTimer < this.pTimerToComeBack) {
this.pSpeed.y = this.pSpeed.y + 0.5;
_local3.normalize(1.5);
this.pSpeed.x = this.pSpeed.x + _local3.x;
this.pSpeed.y = this.pSpeed.y + _local3.y;
this.pX = this.X + this.pSpeed.x;
this.pY = this.Y + this.pSpeed.y;
} else {
var _local4 = _local3.length;
var _local5 = 1;
if (_local4 > 30) {
_local5 = 30 / _local4;
}
this.pSpeed.x = _local3.x * _local5;
this.pSpeed.y = _local3.y * _local5;
this.pX = this.pX + this.pSpeed.x;
this.pY = this.pY + this.pSpeed.y;
}
this.pMovieClip._x = this.pX;
this.pMovieClip._y = this.pY;
this.updateDepth(this.pX, this.pY);
if (!Game.singleton.getCaligula().isInState("levelup", 0)) {
this.hit_update(this.pMovieClip, true);
}
if ((this.pTimer > this.pTimerToComeBack) && (this.pMovieClip.hitTest(this.pOwner.getMovieClip()))) {
this.pDead = true;
}
};
_local1.updateDepth = function (inx, iny) {
super.updateDepth(inx, iny + 300);
};
ASSetPropFlags(_local1, null, 1);
_local1.pSoundChannel = -1;
}
#endinitclip
Symbol 20528 MovieClip [__Packages.WeaponIcon] Frame 0
#initclip
if (!WeaponIcon) {
//(_global.WeaponIcon = function (weaponType, info) {
super("WeaponIcon", "WeaponIcon");
this.pWeaponInfo = info;
this.pType = weaponType;
var _local5 = Game.singleton.getCaligula().getAttackDataByType(this.pType);
this.pKey = _local5.key;
this.pFading = false;
}) extends SceneObject
var _local1 = (_global.WeaponIcon /* register */).prototype;
(_global.WeaponIcon /* register */).initStateMachine = function () {
tinymantis.GameObject.buildStateGroup("WeaponIcon", new Array("drop", "idle", "picked"), 0);
};
_local1.fadeout = function () {
this.pFading = true;
};
_local1.initialize = function (parent, inx, iny) {
this.pMovieClip = parent.createEmptyMovieClip("weapon_" + this.pType, parent.getNextHighestDepth());
var _local5 = this.pMovieClip.attachMovie("item_" + this.pType, "body", this.pMovieClip.getNextHighestDepth());
_local5._y = -35;
var _local6 = this.pMovieClip.attachMovie("weapon_shadow", "shadow", this.pMovieClip.getNextHighestDepth());
this.initPosition(inx, iny);
this.gotoState("idle");
this.mStateParam = new Object();
};
_local1.drop = function (vx, vy) {
var _local4 = new flash.geom.Point(vx, vy);
if (vx || (vy)) {
_local4.normalize(7);
}
this.mStateParam.drop_velocity = _local4;
this.gotoState("drop");
};
_local1.getType = function () {
return(this.pType);
};
_local1.getKey = function () {
return(this.pKey);
};
_local1.destroy = function () {
this.pMovieClip.removeMovieClip();
this.pMovieClip = null;
};
_local1.recycle = function () {
this.pDead = true;
};
_local1.brighten = function (percent) {
percent = Math.max(0, Math.min(1, percent));
var _local3 = 1 - percent;
var _local4 = Math.round(255 * percent);
var _local5 = this.pMovieClip.transform;
var _local6 = _local5.colorTransform;
_local6.blueMultiplier = _local3;
_local6.redMultiplier = _local3;
_local6.greenMultiplier = _local3;
_local6.blueOffset = _local4;
_local6.redOffset = _local4;
_local6.greenOffset = _local4;
_local5.colorTransform = _local6;
this.pMovieClip.transform = _local5;
};
_local1.drop_enter = function () {
var _local2 = this.pMovieClip.body;
_local2._y = -70;
this.mStateParam.drop_vv = -3;
this.mStateParam.drop_gravity = 1.5;
this.mStateParam.drop_ground = -35;
this.mStateParam.brighten = 1;
};
_local1.drop_update = function () {
var _local2 = this.mStateParam.drop_velocity;
this.setPosition(this.X + _local2.x, this.Y + _local2.y);
var _local3 = this.pMovieClip.body;
_local3._y = _local3._y + this.mStateParam.drop_vv;
this.mStateParam.drop_vv = this.mStateParam.drop_vv + this.mStateParam.drop_gravity;
if (_local3._y >= this.mStateParam.drop_ground) {
_local3._y = this.mStateParam.drop_ground;
this.gotoState("idle");
}
this.brighten(this.mStateParam.brighten);
this.mStateParam.brighten = this.mStateParam.brighten - 0.1;
};
_local1.idle_enter = function () {
this.mStateParam.flash_timer = 150;
};
_local1.idle_update = function () {
if (this.pDead) {
return(undefined);
}
var _local2 = Game.singleton.getCaligula();
if (_local2.health > 0) {
var _local3 = _local2.X - this.X;
var _local4 = _local2.Y - this.Y;
if ((Math.abs(_local3) < 20) && (Math.abs(_local4) < 15)) {
var _local5 = Game.singleton;
var _local6 = this.pKey;
this.pKey = "";
if (_local5.pickWeapon(_local6)) {
tinymantis.SoundManager.sSingleton.playSound("interface_pickup_drop_weapon.aif", false, 100);
_local5.saveGame();
this.gotoState("picked");
} else {
this.pKey = _local6;
}
}
}
if (this.pFading) {
if ((--this.mStateParam.flash_timer) < 0) {
this.pMovieClip._visible = false;
this.pDead = true;
} else if (this.mStateParam.flash_timer < 60) {
this.pMovieClip._visible = (this.mStateParam.flash_timer % 2) == 0;
}
}
};
_local1.picked_enter = function () {
this.mStateParam.brighten = 1;
if (this.pWeaponInfo) {
this.pWeaponInfo.picked = true;
}
};
_local1.picked_update = function () {
if (this.pMovieClip._alpha <= 0) {
this.pDead = true;
} else {
this.brighten(this.mStateParam.brighten);
this.mStateParam.brighten = this.mStateParam.brighten - 0.07;
this.pMovieClip._alpha = this.pMovieClip._alpha - 7;
this.pMovieClip.body.gotoAndPlay(this.pMovieClip.body._currentframe + 2);
var _local2 = this.pMovieClip.body;
_local2._y = _local2._y - 3;
}
};
ASSetPropFlags(_local1, null, 1);
}
#endinitclip
Symbol 20529 MovieClip [__Packages.GameCamera] Frame 0
class GameCamera
{
var pLockRect, pUpdateRate, pShakeTimer, pFocus, pMap, pRootX, pRoot, pRootY, pShakePower;
function GameCamera () {
}
function initScreen(focus) {
pLockRect = null;
pUpdateRate = 0.5;
setFocus(focus);
pShakeTimer = 0;
var _local3 = pFocus.X - (Constant.GAME_WIDTH / 2);
var _local4 = pFocus.Y - (Constant.GAME_HEIGHT / 2);
_local3 = Math.max(0, Math.min(pMap.getPixelWidth() - Constant.GAME_WIDTH, _local3));
_local4 = Math.max(0, Math.min(pMap.getPixelHeight() - Constant.GAME_HEIGHT, _local4));
pRootX = (pRoot._x = -Math.round(_local3));
pRootY = (pRoot._y = -Math.round(_local4));
}
function setRoot(root) {
pRoot = root;
}
function setMap(map) {
pMap = map;
}
function setFocus(focus) {
pFocus = focus;
}
function shake(duration, power) {
pShakeTimer = duration;
pShakePower = power;
}
function lock(w, h) {
if (pFocus) {
pLockRect = new flash.geom.Rectangle(pFocus.X - (w / 2), pFocus.Y - (h / 2), w - Constant.GAME_WIDTH, h - Constant.GAME_HEIGHT);
}
}
function isLocked() {
return(pLockRect != null);
}
function release() {
pLockRect = null;
pUpdateRate = 0.01;
}
function update() {
if (pFocus) {
var _local2 = pFocus.X - (Constant.GAME_WIDTH / 2);
var _local3 = pFocus.Y - (Constant.GAME_HEIGHT / 2);
if (pLockRect) {
_local2 = Math.max(pLockRect.left, Math.min(pLockRect.right, _local2));
_local3 = Math.max(pLockRect.top, Math.min(pLockRect.bottom, _local3));
} else {
pUpdateRate = Math.min(0.5, pUpdateRate + 0.02);
}
_local2 = Math.max(1, Math.min(pMap.getPixelWidth() - Constant.GAME_WIDTH, _local2));
_local3 = Math.max(1, Math.min(pMap.getPixelHeight() - Constant.GAME_HEIGHT, _local3));
pRootX = pRootX + (((-_local2) - pRootX) * pUpdateRate);
pRootY = pRootY + (((-_local3) - pRootY) * pUpdateRate);
pRoot._x = Math.round(pRootX);
pRoot._y = Math.round(pRootY);
if (pShakeTimer > 0) {
pShakeTimer--;
_local2 = Math.min(1, Math.max(Constant.GAME_WIDTH - pMap.getPixelWidth(), pRoot._x + ((Math.random() - 0.5) * pShakePower)));
_local3 = Math.min(1, Math.max(Constant.GAME_HEIGHT - pMap.getPixelHeight(), pRoot._y + ((Math.random() - 0.5) * pShakePower)));
pRoot._x = Math.round(_local2);
pRoot._y = Math.round(_local3);
}
}
}
function isPositionInScreen(inx, iny, diff) {
var _local5 = pRoot._x + inx;
if ((_local5 < ((-SceneMap.TILE_SIZE) - diff)) || (_local5 > ((Constant.GAME_WIDTH + SceneMap.TILE_SIZE) + diff))) {
return(false);
}
var _local6 = pRoot._y + iny;
if ((_local6 < ((-SceneMap.TILE_SIZE) - diff)) || (_local6 > ((Constant.GAME_HEIGHT + SceneMap.TILE_SIZE) + diff))) {
return(false);
}
return(true);
}
function getPositionOnScreen(inx, iny) {
var _local4 = new flash.geom.Point();
_local4.x = inx + pRoot._x;
_local4.y = iny + pRoot._y;
return(_local4);
}
function getPositionFromScreen(screenx, screeny) {
var _local4 = new flash.geom.Point();
_local4.x = screenx - pRoot._x;
_local4.y = screeny - pRoot._y;
return(_local4);
}
function getCameraX() {
return(-pRootX);
}
function getCameraY() {
return(-pRootY);
}
//ASSetPropFlags(_local1, null, 1);
}
Symbol 20530 MovieClip [__Packages.Trigger] Frame 0
class Trigger
{
var pLevelData, pI, pJ, pScriptName, pActivated;
function Trigger (levelData, ini, inj, inscript) {
pLevelData = levelData;
pI = ini;
pJ = inj;
pScriptName = inscript;
pActivated = false;
}
function reset() {
getScript().reset();
pActivated = false;
}
function getTileI() {
return(pI);
}
function getTileJ() {
return(pJ);
}
function activate() {
if (sIgnore) {
return(undefined);
}
if (getScript().start()) {
pActivated = true;
}
}
function getScript() {
if (pScript == null) {
pScript = pLevelData.getScript(pScriptName);
}
return(pScript);
}
function stopScript() {
if (pActivated) {
if (getScript().isRunning()) {
getScript().stop();
pActivated = false;
}
}
}
function update() {
if (pActivated) {
if (!getScript().update()) {
stopScript();
}
}
}
//ASSetPropFlags(_local1, null, 1);
static var sIgnore = false;
var pScript = null;
}
Symbol 20531 MovieClip [__Packages.tinymantis.Delegate] Frame 0
class tinymantis.Delegate
{
function Delegate () {
}
static function create(target, handler) {
var extraArgs = arguments.slice(2);
var delegate;
delegate = function () {
var _local2 = arguments.concat(extraArgs, [delegate]);
return(handler.apply(target, _local2));
};
return(delegate);
}
}
Symbol 20532 MovieClip [__Packages.WeaponUI] Frame 0
class WeaponUI
{
var pRoot, pPrepareFrames, pPreparingFrame, pCurrentWeaponKey, pWeaponIcon, pVisible, pRechargeMask, pPreviousWeaponKey;
function WeaponUI (uiroot, initVisible) {
pRoot = uiroot;
pPrepareFrames = (pPreparingFrame = 0);
pCurrentWeaponKey = null;
pWeaponIcon = null;
pVisible = initVisible;
}
function setVisible(visible, shifted) {
pVisible = visible;
if (shifted) {
pRoot._parent.gotoAndPlay((pVisible ? "fadein" : "fadeout"));
} else {
pRoot._parent.gotoAndStop((pVisible ? "normal" : "none"));
}
}
function setWeaponIcon(attackData) {
if (pWeaponIcon == null) {
pWeaponIcon = pRoot.mWeaponIcon;
pRechargeMask = pRoot.mRechargeMask;
pRechargeMask.gotoAndStop(pRechargeMask._totalframes);
}
if (attackData) {
pPrepareFrames = Game.singleton.getLevelInfo().getValue(attackData.nameOnMap + "_prepare") * 30;
pPreparingFrame = pPrepareFrames;
pCurrentWeaponKey = attackData.key;
} else {
pPrepareFrames = 0;
pPreparingFrame = 0;
pCurrentWeaponKey = null;
}
}
function __get__visible() {
return(pVisible);
}
function isWeaponReady() {
return((pPrepareFrames == 0) || (pPreparingFrame >= pPrepareFrames));
}
function setWeaponPreparingFrame(frame) {
pPreparingFrame = Math.min(pPrepareFrames, frame);
}
function getWeaponPreparingFrame() {
return(pPreparingFrame);
}
function hasWeapon() {
return((pCurrentWeaponKey != null) && (pCurrentWeaponKey.length > 0));
}
function update() {
if ((pPrepareFrames > 0) && (pPreparingFrame <= pPrepareFrames)) {
var _local2 = pRechargeMask._totalframes;
if (pPreparingFrame < pPrepareFrames) {
var _local3 = 1 - ((pPrepareFrames - pPreparingFrame) / pPrepareFrames);
_local2 = Math.floor(_local3 * pRechargeMask._totalframes) + 1;
} else {
_local2 = pRechargeMask._totalframes;
}
pRechargeMask.gotoAndStop(_local2);
pPreparingFrame++;
}
if (pPreviousWeaponKey != pCurrentWeaponKey) {
pPreviousWeaponKey = pCurrentWeaponKey;
var _local4 = "none";
if (pCurrentWeaponKey) {
_local4 = pCurrentWeaponKey;
}
pWeaponIcon.gotoAndPlay(_local4);
pRechargeMask.gotoAndStop(pRechargeMask._totalframes);
}
}
//_local1.addProperty("visible", _local1.__get__visible, function () {
});
//ASSetPropFlags(_local1, null, 1);
}
Symbol 20533 MovieClip [__Packages.Vespriay] Frame 0
#initclip
if (!Vespriay) {
//(_global.Vespriay = function (weapon) {
super(weapon);
}) extends ThrowObject
var _local1 = (_global.Vespriay /* register */).prototype;
_local1.initialize = function (owner, attackdata) {
super.initialize(owner, attackdata);
this.pSwarm = null;
this.pMovieClip._alpha = 100;
this.pSoundChannel = -1;
};
_local1.destroy = function () {
super.destroy();
if (this.pSoundChannel >= 0) {
this.pSoundChannel = tinymantis.SoundManager.sSingleton.stopSound(this.pSoundChannel);
}
};
_local1.getVolume = function () {
var _local2 = Game.singleton.getCaligula();
if (_local2.health > 0) {
var _local3 = Math.abs((_local2.X - this.X) + (this.pSwarm._x * this.getDirection())) + (Math.abs((_local2.Y - this.Y) - this.pSwarm._y) * 0.7);
var _local4 = Math.round(Math.min(100, Math.max(0, 150 - (_local3 * 0.38))));
return(_local4);
}
return(0);
};
_local1.getAttackDamage = function (target) {
if (this.pSwarm) {
return(super.getAttackDamage(target));
}
return(this.pAttackData.damage);
};
_local1.isBlockable = function () {
return(((this.pSwarm == null) ? true : false));
};
_local1.update = function () {
if (this.pDead) {
return(undefined);
}
if (this.pSwarm) {
this.pTimer++;
if (this.pTimer > 180) {
this.pMovieClip._alpha = this.pMovieClip._alpha - 10;
if (this.pMovieClip._alpha <= 0) {
this.pDead = true;
}
} else {
var _local3 = Game.singleton.getCharacters();
var _local4 = 0;
for ( ; _local4 < _local3.length ; _local4++) {
var _local5 = _local3[_local4];
if ((!_local5.isInState("hit", 0)) && ((_local5.health > 0) && ((_local5.getType() != "Skeleton") && (this.pMovieClip.hitTest(_local5.getMovieClip()) && (Math.abs(_local5.Y - this.pBaseY) < Constant.HIT_Y_RANGE))))) {
for ( ; _local5.isCaligula() && (!(_local5.isInState("walk", 0) || (_local5.isInState("idle", 0)))) ; _local4++) {
}
_local5.hit(this, this.getAttackDamage(_local5), this.pAttackData.pushpower * ((Math.random() > 0.5) ? 1 : -1));
if ((_local5.health <= 0) && (_local5.isCaligula())) {
Game.singleton.mTimesKilledByBee++;
}
}
}
}
if (this.pSoundChannel >= 0) {
tinymantis.SoundManager.sSingleton.setVolume(this.pSoundChannel, this.getVolume());
}
} else {
super.update();
if (this.pDead && (!this.pInWater)) {
this.pDead = false;
this.pSwarm = this.pMovieClip.swarm;
this.pTimer = 0;
this.pSoundChannel = tinymantis.SoundManager.sSingleton.playSound("caligula_bees.aif", true, this.getVolume());
}
}
};
ASSetPropFlags(_local1, null, 1);
}
#endinitclip