Frame 1
_fglv = new LoadVars();
_fglv.gid = 265;
_fglv.url = _root._url;
_fglv.sendAndLoad("http://www.freegamesforyourwebsite.com/stats.php", _fglv, "POST");
delete _fglv;
stopAllSounds();
var debug = true;
var gameID = 278;
var gameName = "pyramid_adventures";
stop();
fscommand ("showmenu", "false");
prel.onEnterFrame = function () {
prel.procent.text = Math.floor((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
prel.gotoAndStop(prel.procent.text);
if (Number(prel.procent.text) > 99) {
play();
delete this.onEnterFrame;
}
};
Frame 2
stop();
Frame 3
if (!okToPlay) {
gotoAndStop (2);
}
Frame 4
var sound = new Sound(_root);
sound.setVolume(100);
_quality = "medium";
Frame 5
stop();
Frame 17
stop();
Frame 25
stop();
stopAllSounds();
Instance of Symbol 1631 MovieClip [TMP6ojzjuzm8i] in Frame 25
//component parameters
onClipEvent (construct) {
gameID = 278;
}
Instance of Symbol 1636 MovieClip [TMP6pbk6uzm9i] in Frame 25
//component parameters
onClipEvent (construct) {
gameID = 278;
}
Symbol 2 Button
on (release) {
getURL ("http://www.freegamesforyourwebsite.com/click.php?gid=265&area=loader", "_blank");
}
Symbol 63 MovieClip Frame 1
stop();
var tagctr = (random(55) + 1);
gotoAndStop(tagctr);
Symbol 64 MovieClip Frame 105
stop();
Symbol 70 MovieClip Frame 1
_root.earl223 = function (val) {
var _local3 = new Array("_", "Z", "y", "x", "W", "v", "u", "T", "s", "r", "Q", "P", "O", "n", "m", "L", "K", "j", "i", "H", "g", "F", "e", "d", "C", "B", "a");
var _local2 = "";
val1 = 0;
while (val1 < val.length) {
if (val.substr(val1, 1) == ":") {
_local2 = _local2 + ":";
} else if (Number(val.substr(val1, 2)) > 26) {
_local2 = _local2 + _local3[Number(val.substr(val1, 1))];
} else if (Number(val.substr(val1, 1)) == 0) {
_local2 = _local2 + "_";
} else {
_local2 = _local2 + _local3[Number(val.substr(val1, 2))];
val1++;
}
val1++;
}
return(_local2);
};
Symbol 77 MovieClip Frame 1
stop();
Symbol 1643 MovieClip [__Packages.GameBoard] Frame 0
class GameBoard extends MovieClip
{
var _boundsList, _parent, _quality, _paused, _enemyGrabSide, _cheatKeys, _keyListener, _scrollInterval, _levelData, _screensMC, _scorePopMC, _calloutMC, _noGrenadeMC, _time, _msgRoute, attachMovie, _hero, _lineMC, _enemyList, _levelIndex, _nextLevelIndex, _totalScore, _bulletMachine, soundMC, createEmptyMovieClip, _soundModule, _playField, _fleeField, onMouseUp, _bg, _grenadeTimerMC, _START_ENEMIES, _START_OPS, _nodeMap, _doors, _levelOver, _allMCs, _levelScore, _levelStartTime, onEnterFrame, _markerX, _markerY, _operativeList, _levelBonus, _prevEnemyList, _newBG, _scrollVX, _scrollVY, _bgRect, _pickupX, _pickupY;
function GameBoard () {
super();
trace("gameboard......this : " + this);
loadTracker();
_boundsList = [_parent.bounds_n, _parent.bounds_e, _parent.bounds_s, _parent.bounds_w];
_quality = "low";
_paused = false;
_enemyGrabSide = 0;
_cheatKeys = false;
if (_cheatKeys == true) {
Key.addListener(this);
}
_keyListener = {};
_scrollInterval = {};
_global.finalscore = 0;
_global.MSG_Run = 0;
_global.MSG_ThrowStart = 1;
_global.MSG_BulletHit = 2;
_global.MSG_Stop = 3;
_global.MSG_Hit = 4;
_global.MSG_TargetCaught = 5;
_global.MSG_Run2 = 6;
_global.MSG_Run3 = 7;
_global.MSG_Unzombify = 8;
_global.MSG_Zombify = 9;
_global.MSG_ThrowEnd = 10;
_global.MSG_NextState = 11;
_levelData = [];
_levelData[0] = {type:"zombie", numEnemies:8, numOps:4, bg:0, pickup:0, marker:0};
_levelData[1] = {type:"zombie", numEnemies:9, numOps:4, bg:0, pickup:0, marker:0};
_levelData[2] = {type:"cooldown", numEnemies:0, numOps:0, bg:0, pickup:1, marker:0};
_levelData[3] = {type:"zombie", numEnemies:10, numOps:5, bg:1, pickup:0, marker:0};
_levelData[4] = {type:"zombie", numEnemies:11, numOps:5, bg:1, pickup:0, marker:0};
_levelData[5] = {type:"hamsters", numEnemies:0, numOps:0, bg:0, pickup:0, marker:0};
_levelData[6] = {type:"zombie", numEnemies:12, numOps:5, bg:2, pickup:0, marker:0};
_levelData[7] = {type:"zombie", numEnemies:14, numOps:6, bg:2, pickup:0, marker:0};
_levelData[8] = {type:"cooldown", numEnemies:0, numOps:0, bg:2, pickup:1, marker:3};
_levelData[9] = {type:"toilenator", numEnemies:0, numOps:0, bg:2, pickup:0, marker:0};
_levelData[10] = {type:"zombie", numEnemies:15, numOps:6, bg:3, pickup:0, marker:0};
_levelData[11] = {type:"zombie", numEnemies:16, numOps:6, bg:3, pickup:0, marker:0};
_levelData[12] = {type:"hamsters", numEnemies:0, numOps:0, bg:0, pickup:0, marker:0};
_levelData[13] = {type:"cooldown", numEnemies:0, numOps:0, bg:4, pickup:1, marker:0};
_levelData[14] = {type:"zombie", numEnemies:17, numOps:4, bg:4, pickup:0, marker:0};
_levelData[15] = {type:"zombie", numEnemies:18, numOps:4, bg:4, pickup:0, marker:0};
_levelData[16] = {type:"cooldown", numEnemies:0, numOps:0, bg:4, pickup:1, marker:2};
_levelData[17] = {type:"362", numEnemies:0, numOps:0, bg:4, pickup:0, marker:0};
_screensMC = _parent.screens_mc;
_screensMC.swapDepths(1000000);
_scorePopMC = _parent.attachMovie("scorePop", "scorePop", 999900);
_calloutMC = _parent.attachMovie("callout", "callout", 999950);
_noGrenadeMC = _parent.attachMovie("noGrenade", "noGrenade", 999940);
initUIButtons();
_time = new Standard.Time();
_msgRoute = new Standard.Message.MsgRoute(_time);
var _local9 = attachMovie("hero", "hero_mc", 200);
_hero = new Hero(this, _local9);
_lineMC = _parent.createEmptyMovieClip("lineMC", _parent.getNextHighestDepth());
_enemyList = [];
_levelIndex = 0;
_nextLevelIndex = 0;
_totalScore = 0;
_bulletMachine = new BulletMachine(this, _hero, _root, 1000);
soundMC = createEmptyMovieClip("sound_mc", 12000);
_soundModule = new Standard.SoundModule(soundMC);
_global.MUSIC_MUTE = false;
_global.MUSIC_VOL = 50;
var _local6 = ["music_boss", "music_cooldown", "music_lose", "music_win", "music_game0", "music_game0", "music_game0", "music_theme", "footstep1.wav", "footstep2.wav", "footstep3.wav", "footstep4.wav", "footstep5.wav", "footstep6.wav", "numbuh1_shoot1.wav", "numbuh1_shoot2.wav", "numbuh1_shoot3.wav", "break_free_of_zombie.wav", "gets_hit.wav", "grenade_miss_explode.wav", "numbuh1_throw_grenade.wav", "pickup_item1.wav", "grenade_no_ammo.wav", "transform_into_operative.wav", "transform_into_zombie.wav", "toilet_paper_loops.wav", "toilenator_jump.wav", "toilenator_drop_from_top.wav", "zombie_groan1.wav", "zombie_groan2.wav", "zombie_groan3.wav", "zombie_groan4.wav", "zombie_grabs_you1.wav", "zombie_grabs_you2.wav", "zombie_grabs_you3.wav", "boss_death_snds.wav", "hamster_hurt1.wav", "hamster_hurt2.wav", "hamster_hurt3.wav", "hamster_hurt4.wav", "door_unlock_open.wav", "transform_sequence_zombie.wav", "transform_sequence_operative.wav", "362_swing_weapon.wav", "362_wind_loop.wav", "grenade_reload_meter.wav", "button_over.wav", "button_press2.wav"];
var _local5 = 0;
while (_local5 < _local6.length) {
var _local7 = _soundModule.LoadSound(_local6[_local5]);
_local7.attachSound(_local6[_local5]);
_local5++;
}
_playField = new Standard.Geometry.Rect(30, 100, 570, 380);
_fleeField = new Standard.Geometry.Rect(110, 190, 460, 300);
Key.addListener(_hero);
onMouseUp = null;
_soundModule.StopAll();
_global.stopAllSounds();
_bg = _parent._bg;
_bg._y = 0;
var _local8 = _bg.attachMovie("bg" + _levelIndex, "bg" + _levelIndex, _levelIndex);
_local8._y = 0;
_local8.cacheAsBitmap = true;
initDoors(0, 0);
_grenadeTimerMC = _parent.ui.grenadeTimerMC;
initNodeMap();
_START_ENEMIES = _levelData[_levelIndex].numEnemies;
trace("\u521D\u59CB\u5316\u4EBA\u6570111111111111 : " + _START_ENEMIES);
_START_OPS = _levelData[_levelIndex].numOps;
_parent.ui.lives.text = "3";
_parent.ui.score.text = "0";
init();
}
function initNodeMap() {
trace("gameboard.initNodeMap");
_nodeMap = new Standard.Map.NodeMap();
var _local11 = "0|n|1|1|n|2|2|n|3|3|n|4|4|n|5|5|n|6|6|n|7|7|n|8|8|n|9|";
_local11 = _local11 + "9|n|10|10|n|11|11|n|12|12|n|13|13|n|14|14|e|15|15|e|16|16|e|17|17|h|18|18|h|19|19|h|20|20|n|21|21|n|22|22|n|23|";
_local11 = _local11 + "23|n|24|24|n|25|25|n|26|26|e|27|27|e|28|28|h|29|29|h|30|30|h|31|31|n|32|";
_local11 = _local11 + "32|n|33|33|n|34|34|n|35|35|n|36|36|n|37|37|e|38|38|e|39|39|e|40|40|h|41|41|h|42|42|h|43|43|n|44|44|n|45|45|n|46|";
var _local5 = _local11.split("|");
var _local12 = _local5.length;
var _local4 = 0;
while (_local4 < _local12) {
var _local7 = _local5[_local4];
var _local6 = _local5[_local4 + 1];
var _local3 = _local5[_local4 + 2].split(",");
var _local2 = 0;
while (_local2 < _local3.length) {
_local3[_local2] = parseInt(_local3[_local2]);
_local2++;
}
_nodeMap.addNode({id:_local7, diff:_local6, links:_local3});
_local4 = _local4 + 3;
}
}
function initDoors(x, y) {
var _local2;
var _local7 = _levelData[_nextLevelIndex];
if (_local7.type == "hamsters") {
_local2 = _bg.attachMovie("door_hamster", "door_n" + _nextLevelIndex, 50000 + _levelIndex);
} else if (_nextLevelIndex <= 2) {
_local2 = _bg.attachMovie("door_n1", "door_n" + _nextLevelIndex, 50000 + _levelIndex);
} else if (_nextLevelIndex < 6) {
_local2 = _bg.attachMovie("door_n2", "door_n" + _nextLevelIndex, 50000 + _levelIndex);
} else if (_nextLevelIndex < 10) {
_local2 = _bg.attachMovie("door_n3", "door_n" + _nextLevelIndex, 50000 + _levelIndex);
} else if (_nextLevelIndex < 13) {
_local2 = _bg.attachMovie("door_n4", "door_n" + _nextLevelIndex, 50000 + _levelIndex);
} else {
_local2 = _bg.attachMovie("door_n5", "door_n" + _nextLevelIndex, 50000 + _levelIndex);
}
var _local10 = _bg.attachMovie("door_e", "door_e" + _nextLevelIndex, 50001 + _levelIndex);
var _local5 = _bg.attachMovie("door_s", "door_s" + _nextLevelIndex, 50002 + _levelIndex);
if (_nextLevelIndex == 0) {
trace("555555555 " + _local5);
_local5.gotoAndStop(5);
}
var _local11 = _bg.attachMovie("door_w", "door_w" + _nextLevelIndex, 50003 + _levelIndex);
var _local9 = _local7.bg;
var _local8 = _parent.attachMovie("roomblock" + _local9, "roomblock" + _nextLevelIndex, 200000 + _nextLevelIndex);
_local8._x = x;
_local8._y = y;
if (_scrollDir != "n") {
_local5.gotoAndStop(5);
}
_doors = [_local2, _local10, _local11, _local5];
for (var _local6 in _doors) {
_doors[_local6].cacheAsBitmap = true;
_doors[_local6]._x = x;
_doors[_local6]._y = y;
}
}
function onKeyUp() {
var _local2 = _nodeMap.getNodeDiff(_levelIndex);
if (Key.getCode() == 50) {
convertAllEnemies();
endLevel("pass", "n");
}
if (Key.getCode() == 49) {
convertAllEnemies();
if (_local2 != "h") {
endLevel("pass", "e");
} else {
endLevel("pass", "n");
}
}
if (Key.getCode() == 51) {
trace("gameboard.onKeyUp51");
convertAllEnemies();
if (_local2 != "e") {
endLevel("pass", "h");
} else {
endLevel("pass", "n");
}
}
}
function convertAllEnemies() {
trace("gameboard.convertAllEnemies");
var _local3 = _enemyList.length;
while (_local3--) {
_msgRoute.SendMsg(0, _global.MSG_Unzombify, this, _enemyList[_local3], 0, null);
}
}
function init() {
_quality = "low";
_parent["roomblock" + _levelIndex]._visible = false;
_levelOver = false;
playGameMusic();
_screensMC.swapDepths(750000);
_allMCs = [];
_allMCs.push(_hero._mc);
_hero._mc.swapDepths(100);
if (_levelIndex == 0) {
initEnemies(_START_OPS);
}
_levelScore = 0;
if ((_levelIndex == 0) || (_restart == true)) {
getReadyPause();
_restart = false;
startLevelTimer();
} else {
startGameEngine();
startLevelTimer();
}
}
function playGameMusic() {
_soundModule.PlayMusic("game0");
}
function startLevelTimer() {
_levelStartTime = _time.GetCurTime();
updateLevelTimer();
}
function getReadyPause() {
update();
_calloutMC.gotoAndPlay("getready");
_global.setTimeout(this, "startGameEngine", 3700);
_global.setTimeout(this, "startLevelTimer", 3700);
}
function loadTracker() {
trace("gameboard.loadTracker");
var _local1 = new Date();
var _local2 = _local1.getTime();
}
function loadVideoTracker() {
trace("gameboard.loadVideoTracker");
var _local1 = new Date();
var _local2 = _local1.getTime();
}
function restart() {
trace("\u65B0\u751F\u547D");
stopGameEngine();
_levelOver = false;
_hero.resetHealth();
_restart = true;
_hero.unzombify();
var _local2 = _enemyList.length;
while (_local2--) {
_enemyList[_local2].getNewTarget();
}
getReadyPause();
_parent.ui.timerMC.time.text = "3:00";
}
function getRestarted() {
return(_restart);
}
function setRestarted(toSet) {
_restart = toSet;
}
function startFromZero() {
loadTracker();
_levelIndex = 0;
_nextLevelIndex = 0;
_totalScore = 0;
_parent.ui.score.text = _totalScore;
cleanUp();
var _local2 = _bg.attachMovie("bg" + _levelIndex, "bg" + _levelIndex, _levelIndex);
_local2._y = 0;
_local2.cacheAsBitmap = true;
initDoors(0, 0);
initNodeMap();
_START_ENEMIES = _levelData[_levelIndex].numEnemies;
trace("playagain\u521D\u59CB\u5316\u4EBA\u6570 : " + _START_ENEMIES);
_START_OPS = _levelData[_levelIndex].numOps;
_hero._lives = 3;
_parent.ui.lives.text = _hero._lives;
_hero.resetHealth();
_hero.init();
_hero.moveTo(300, 220);
}
function continueFromHere() {
trace("gameboard.continueFromHere");
loadTracker();
stopGameEngine();
_totalScore = 0;
_parent.ui.score.text = _totalScore;
_hero._lives = 3;
_parent.ui.lives.text = _hero._lives;
_levelOver = false;
_hero.resetHealth();
_restart = true;
_hero.unzombify();
var _local2 = _enemyList.length;
while (_local2--) {
_enemyList[_local2].getNewTarget();
}
playGameMusic();
getReadyPause();
}
function initUIButtons() {
trace("gameboard.initUIButtons");
var _local5 = _parent.ui;
var _local4 = _local5.instructionsBtn;
var _loc4 = _local5.musicBtn;
_local4.owner = this;
_local4.onRollOver = function () {
this._parent.instructions_mc.gotoAndStop("over");
this.owner._soundModule.PlaySound("button_over.wav");
};
_local4.onRollOut = function () {
this._parent.instructions_mc.gotoAndStop("idle");
};
_local4.onRelease = function () {
this.getURL("http://www.freegamesforyourwebsite.com/click.php?gid=265&area=paused", "_blank");
var _local3 = new Sound(_root);
_local3.setVolume(0);
this.owner.showInstructions();
this.owner._soundModule.PlaySound("button_press2.wav");
this.enabled = false;
_loc4.enabled = false;
};
_loc4.owner = this;
_loc4.onRollOver = function () {
if (_global.MUSIC_MUTE) {
this._parent.music_mc.gotoAndStop("musicOff_RO");
} else {
this._parent.music_mc.gotoAndStop("musicOn_RO");
}
this.owner._soundModule.PlaySound("button_over.wav");
};
_loc4.onRollOut = function () {
if (_global.MUSIC_MUTE) {
this._parent.music_mc.gotoAndStop("musicOff");
} else {
this._parent.music_mc.gotoAndStop("musicOn");
}
};
_loc4.onRelease = function () {
this.owner.muteMusic(!_global.MUSIC_MUTE);
if (_global.MUSIC_MUTE) {
this._parent.music_mc.gotoAndStop("musicOff_RO");
} else {
this._parent.music_mc.gotoAndStop("musicOn_RO");
}
this.owner._soundModule.PlaySound("button_press2.wav");
};
}
function showInstructions() {
stopGameEngine();
_screensMC.gotoAndPlay("instructions_game");
}
function muteMusic(bMute) {
var _local5 = new Sound(_root);
_global.MUSIC_MUTE = bMute;
if (bMute) {
_local5.setVolume(0);
} else {
_local5.setVolume(100);
}
_soundModule.SetMusicMute(bMute);
if (bMute) {
_parent.ui.musicMC.gotoAndStop("musicOff");
} else {
_parent.ui.musicMC.gotoAndStop("musicOn");
}
}
function startGameEngine() {
onEnterFrame = update;
}
function stopGameEngine() {
onEnterFrame = null;
}
function setNumEnemiesAtStart(n) {
_START_ENEMIES = n;
}
function initMarkers(dir) {
var _local3 = 0;
var _local4 = 0;
if (_nextLevelIndex != 0) {
switch (dir) {
case "n" :
_local3 = 0;
_local4 = -365;
break;
case "w" :
_local3 = -600;
_local4 = 0;
break;
case "e" :
_local3 = 600;
_local4 = 0;
}
}
_markerX = 500;
_markerY = 150;
var _local5;
var _local2 = _levelData[_nextLevelIndex];
if (_local2.marker == 0) {
return(undefined);
}
if (_local2.marker == 1) {
_local5 = "hamster";
} else if (_local2.marker == 2) {
_local5 = "362";
} else if (_local2.marker == 3) {
_local5 = "toilenator";
}
}
function initPickups(dir) {
var _local3 = 0;
var _local4 = 0;
if (_nextLevelIndex != 0) {
switch (dir) {
case "n" :
_local3 = 0;
_local4 = -365;
break;
case "w" :
_local3 = -600;
_local4 = 0;
break;
case "e" :
_local3 = 600;
_local4 = 0;
}
}
var _local5 = _levelData[_nextLevelIndex];
if (_local5.pickup == 0) {
var _local2 = 0;
while (_local2 <= 5) {
_bg["pickup" + _local2].removeMovieClip();
_local2++;
}
pick_up_array = new Array();
} else if (_local5.pickup == 1) {
pick_up_array = new Array();
var _local2 = 0;
while (_local2 <= 5) {
pick_up_array.push(random(13));
_bg.attachMovie("pickup_health" + pick_up_array[_local2], "pickup" + _local2, 990 + _local2);
switch (_local2) {
case 0 :
_bg["pickup" + _local2]._x = random(20) + 50;
_bg["pickup" + _local2]._y = 120 + random(250);
break;
default :
_bg["pickup" + _local2]._x = (random(50) + Math.ceil(_bg["pickup" + (_local2 - 1)]._x)) + Math.ceil(_bg["pickup" + (_local2 - 1)]._width);
_bg["pickup" + _local2]._y = 100 + random(250);
}
trace("qqqqqqqqqqqqqqqq " + [_bg["pickup" + _local2]._x, _bg["pickup" + _local2]._y]);
_local2++;
}
trace("pick_up_array ----------- " + pick_up_array);
}
}
function initEnemies(n, dir) {
trace("\u521D\u59CB\u5316\u602A");
_enemyList = [];
_operativeList = [];
var _local12 = 0;
var _local13 = 0;
if (_nextLevelIndex != 0) {
switch (dir) {
case "n" :
_local12 = 0;
_local13 = -365;
break;
case "w" :
_local12 = -600;
_local13 = 0;
break;
case "e" :
_local12 = 600;
_local13 = 0;
}
}
var _local14 = _levelData[_nextLevelIndex];
trace("\u6DFB\u52A0\u4EBA\u4ED4 ----- \u5173\u6570 : " + _nextLevelIndex);
if (_local14.type == "zombie") {
var _local11 = new Array();
if (_nextLevelIndex < 2) {
var _local6 = 0;
while (_local6 < _START_ENEMIES) {
_local11.push(0);
_local6++;
}
} else if (_nextLevelIndex < 9) {
var _local6 = 0;
while (_local6 < _START_ENEMIES) {
_local11.push(Math.floor(random(2)));
_local6++;
}
} else if (_nextLevelIndex < 13) {
var _local6 = 0;
while (_local6 < _START_ENEMIES) {
_local11.push(Math.floor(random(3)));
_local6++;
}
} else {
var _local6 = 0;
while (_local6 < _START_ENEMIES) {
_local11.push(Math.floor(random(4)));
_local6++;
}
}
trace("enemy_array " + _local11);
var _local6 = 0;
while (_local6 < _START_ENEMIES) {
var _local5 = attachMovie("Enemy" + _local11[_local6], ("enemy" + _nextLevelIndex) + _local6, (2000 + (10 * _levelIndex)) + _local6);
var _local2 = new Zombie(this, _local5, _hero._mc, _local6, _enemyList);
var _local9 = 0;
var _local8;
var _local10;
while (_local9 < 100) {
_local8 = 50 + random(500);
_local10 = 100 + random(250);
var _local3 = 300 - _local8;
var _local4 = 200 - _local10;
_local9 = Math.sqrt((_local3 * _local3) + (_local4 * _local4));
}
_local2.init(_local12 + _local8, _local13 + _local10);
if (_local6 < n) {
_local2.initAsOperative();
_operativeList.push(_local2);
} else {
_local2.getNewTarget();
}
_enemyList.push(_local2);
_local6++;
}
} else if (_local14.type == "hamsters") {
_hamsterCount = 0;
var _local6 = 0;
while (_local6 < 20) {
var _local5 = attachMovie("hamster" + random(2), ("hamster1" + _nextLevelIndex) + _local6, 100 + _local6);
var _local2 = new Hamster(this, _local5);
_local2.init((24 + _local12) + (29 * _local6), _local13 + 80, true);
_enemyList.push(_local2);
_local6++;
}
var _local7 = 0;
while (_local7 < 20) {
var _local5 = attachMovie("hamster" + random(2), ("hamster2" + _nextLevelIndex) + _local7, 150 + _local7);
var _local2 = new Hamster(this, _local5);
_local2.init((24 + _local12) + (29 * _local7), _local13 + 200, false);
_enemyList.push(_local2);
_local7++;
}
} else if (_local14.type == "362") {
var _local5 = attachMovie("boss362", "boss362", 100);
var _local2 = new Boss_362(this, _local5);
_local2.init(300 + _local12, 200 + _local13);
_enemyList.push(_local2);
} else if (_local14.type == "toilenator") {
var _local5 = attachMovie("toilenator", "toilenator", 100);
_quality = "low";
var _local2 = new Boss_Toilenator(this, _local5);
_local2.init(400 + _local12, 110 + _local13);
_enemyList.push(_local2);
}
}
function update() {
if (_paused == true) {
return(undefined);
}
_lineMC.clear();
_time.MarkTimeThisTick();
_msgRoute.Update();
var _local2 = _enemyList.length;
while (_local2--) {
_enemyList[_local2].update();
}
checkCollisionPickup();
checkCollisions();
if (!_levelOver) {
updateEnemyProximity();
checkLevel();
} else if (_bg[("door_" + _scrollDir) + _levelIndex].hitBox.hitTest(_hero._mc._x, _hero._mc._y, true)) {
if (!_hero.isDead()) {
nextLevel();
}
}
updateGrenadeTimer();
if (!_levelOver) {
updateLevelTimer();
}
_bulletMachine.update();
_hero.update();
}
function updateLevelTimer() {
var _local2 = 180 - Math.floor(_time.GetCurTime() - _levelStartTime);
if (_local2 < 0) {
trace("\u5065\u5EB7\u503C : " + _hero._health);
_hero.loseHealth(_hero._health);
trace("FP UD66666666666666666666666666666");
endLevel("fail");
_local2 = 0;
}
var _local5 = Math.floor(_local2 / 60);
var _local3 = _local2 % 60;
if (_local3 < 10) {
_local3 = "0" + _local3;
}
_parent.ui.timerMC.time.text = (_local5 + ":") + _local3;
if (_local2 < 120) {
_levelBonus = (_bonusMax * _local2) / 120;
} else {
_levelBonus = _bonusMax;
}
if (_levelData[_levelIndex].type == "cooldown") {
_levelBonus = 0;
_parent.ui.timerMC.time.text = "-:--";
_local2 = 180;
} else if (_levelData[_levelIndex].type == "hamsters") {
_hero.resetHealth();
}
var _local4;
if (_local2 < 30) {
_local4 = new flash.geom.ColorTransform(1, 1, 1, 1, 0, -200, -200, 0);
} else {
_local4 = new flash.geom.ColorTransform(1, 1, 1, 1, 0, 0, 0, 0);
}
var _local6 = new flash.geom.Transform(_parent.ui.timerMC);
_local6.colorTransform = _local4;
}
function updateGrenadeTimer() {
var _local2 = _bulletMachine.getGrenadeTimer();
_grenadeTimerMC.gotoAndStop(Math.floor((10 * (100 - _local2)) / 100));
}
function flashGrenadeIcon() {
_parent.ui.grenadeIcon.gotoAndPlay("chargeAlert");
_soundModule.PlaySound("grenade_reload_meter.wav");
}
function checkCollisionPickup() {
if (_levelData[_levelIndex].pickup != 0) {
var _local2 = 0;
while (_local2 <= 5) {
if (_hero._mc.hitArea.hitTest(_bg["pickup" + _local2].hitBox)) {
_soundModule.PlaySound("pickup_item1.wav");
if (_levelData[_levelIndex].pickup == 1) {
switch (pick_up_array[_local2]) {
case 0 :
_hero.addHealth(50);
break;
case 1 :
addScore(100);
break;
case 2 :
addScore(200);
_hero.addHealth(20);
break;
case 3 :
addScore(300);
_hero.addHealth(20);
break;
case 4 :
_hero.addHealth(50);
break;
case 5 :
_hero.addHealth(80);
break;
case 6 :
addScore(350);
break;
case 7 :
addScore(400);
_hero.addHealth(20);
break;
case 8 :
addScore(400);
break;
case 9 :
addScore(380);
_hero.addHealth(20);
break;
case 10 :
addScore(1000);
break;
case 11 :
addScore(1000);
_hero.addHealth(20);
break;
default :
addScore(1000);
_hero.addHealth(20);
}
_bg["pickup" + _local2].gotoAndPlay("pickup");
_scorePopMC._x = _bg["pickup" + _local2]._x;
_scorePopMC._y = _bg["pickup" + _local2]._y + 20;
}
}
_local2++;
}
}
}
function checkCollisions() {
var _local9 = new Array();
_local9 = _bulletMachine.getBullets();
var _local8 = _enemyList.length;
var _local10 = _local9.length;
var _local6 = 0;
var _local7 = 0;
while (_local7 < _local10) {
var _local4 = _local9[_local7];
var _local5 = 0;
while (_local5 < _local8) {
if (!_local4.getCollActive()) {
} else {
var _local3 = _enemyList[_local5];
if (_local4.getCollObject().circleCollision(_local3.getCollObject())) {
if (_local4 instanceof Grenade) {
if ((_local3 instanceof Hamster) && (_local3._ZOMBIE)) {
_local6++;
_scorePopMC._x = _local4._mc._x;
_scorePopMC._y = _local4._mc._y;
} else if (_local3.isZombie()) {
_local6++;
_scorePopMC._x = _local4._mc._x;
_scorePopMC._y = _local4._mc._y;
}
_msgRoute.SendMsg(0, _global.MSG_Unzombify, null, _local3, 0, null);
} else if (((_local3.isZombie() || (_local3 instanceof Hamster)) || (_local3 instanceof Boss_362)) || (_local3 instanceof Boss_Toilenator)) {
if (_local3 instanceof Hamster) {
if (_local3._ZOMBIE == true) {
_soundModule.PlaySound(("hamster_hurt" + (1 + random(5))) + ".wav", 40);
} else {
return(undefined);
}
}
_msgRoute.SendMsg(0, _global.MSG_BulletHit, null, _local3, 0, _local4.getAngle());
_bulletMachine.recycle(_local4);
}
}
}
_local5++;
}
if ((_local4 instanceof Grenade) && (_local4.getCollActive())) {
_local4.setCollActive(false);
_bulletMachine.remove(_local4);
if (_local6 == 0) {
_soundModule.PlaySound("grenade_miss_explode.wav");
}
}
_local7++;
}
if (_local6 > 0) {
addScore((_local6 * _local6) * 10);
}
}
function updateHamsterMeters() {
var _local2 = 1 + Math.floor((10 * _hamsterCount) / _hamsterQuota);
var _local3 = _bg["door_n" + _levelIndex].meterL;
var _local4 = _bg["door_n" + _levelIndex].meterR;
_local3.gotoAndStop(_local2);
_local4.gotoAndStop(_local2);
}
function addScore(n) {
if (n == 0) {
return(undefined);
}
_totalScore = _totalScore + n;
_parent.ui.score.text = _totalScore;
_global.finalscore = _totalScore;
popUpScore(n);
}
function getScore() {
return(_totalScore);
}
function popUpScore(n) {
if ((_levelData[_levelIndex].type == "toilenator") || (_levelData[_levelIndex].type == "362")) {
_scorePopMC._x = _hero._mc._x;
_scorePopMC._y = _hero._mc._y;
}
_scorePopMC.gotoAndPlay(2);
_scorePopMC.points.point_txt.text = "+" + n;
}
function updateHealthBar(h) {
_parent.ui.healthMC.gotoAndStop(1 + Math.floor((20 * (100 - h)) / 100));
}
function setHealthToZero() {
_parent.ui.healthMC.gotoAndStop(22);
}
function updateEnemyProximity() {
_operativeList = [];
var _local3 = _enemyList.length;
while (_local3--) {
var _local2 = _enemyList[_local3];
_local2.setCentroid();
_local2.updateProximity();
}
}
function updateOpList() {
_operativeList = [];
var _local2 = _enemyList.length;
while (_local2--) {
if (!_enemyList[_local2].isZombie()) {
_operativeList.push(_enemyList[_local2]);
}
}
}
function checkLevel() {
var _local3 = true;
if (_hero.isDead()) {
trace("FP UD777777777777777777777777777");
endLevel("fail");
}
if (_levelData[_levelIndex].type == "zombie") {
var _local2 = _enemyList.length;
while (_local2--) {
if (_enemyList[_local2].isZombie()) {
_local3 = false;
break;
}
}
} else if (_levelData[_levelIndex].type == "hamsters") {
if (_hamsterCount < _hamsterQuota) {
_local3 = false;
} else {
_levelOver = true;
convertHamsters();
}
} else if ((_levelData[_levelIndex].type == "362") || (_levelData[_levelIndex].type == "toilenator")) {
if (!_enemyList[0].isDead()) {
_local3 = false;
}
}
if (_local3) {
var _local4 = _nodeMap.getNodeDiff(_levelIndex);
if (_levelBonus > 3000) {
if (_local4 != "e") {
trace("FP UD88888888888888888888888888888");
endLevel("pass", "h");
} else {
trace("FP UD99999999999999999999999");
endLevel("pass", "n");
}
} else if (_levelBonus > 1000) {
trace("FP UD10101010101010101010");
endLevel("pass", _local4);
} else if (_local4 != "h") {
trace("FP UD12121212121212121212");
endLevel("pass", "e");
} else {
trace("FP UD13131313131313131313131313");
endLevel("pass", "n");
}
}
}
function convertHamsters() {
var _local3 = _enemyList.length;
while (_local3--) {
_msgRoute.SendMsg(0, _global.MSG_Unzombify, null, _enemyList[_local3], 0);
}
}
function endLevel(stat, diff) {
_levelOver = true;
if (stat == "fail") {
_hero._lives--;
_parent.ui.lives.text = _hero._lives;
if (_hero._lives == 0) {
loseGame();
} else {
_global.setTimeout(this, "restart", 4000);
}
} else {
_nextLevelIndex++;
if (_levelData[_nextLevelIndex].type == "hamsters") {
_scrollDir = "n";
} else {
var _local4;
if (_scrollDir == "e") {
_local4 = ["n", "e"];
} else if (_scrollDir == "w") {
_local4 = ["n", "w"];
} else {
_local4 = ["e", "w"];
}
_scrollDir = _local4[random(_local4.length)];
}
if (_totalScore != _prevScore) {
if (_levelBonus > 3000) {
_calloutMC.gotoAndPlay("great");
} else if (_levelBonus > 1000) {
_calloutMC.gotoAndPlay("soso");
} else {
_calloutMC.gotoAndPlay("poor");
}
}
addScore(Math.floor(_levelBonus));
_bg[("door_" + _scrollDir) + _levelIndex].gotoAndPlay("open");
_soundModule.PlaySound("door_unlock_open.wav", 50);
var _local3 = _prevEnemyList.length;
while (_local3--) {
_prevEnemyList[_local3]._mc.removeMovieClip();
}
}
}
function nextLevel() {
trace("\u8FC7\u5173");
if (_levelData[_levelIndex].type == "hamsters") {
}
if ((_levelIndex + 1) == _levelData.length) {
winGame();
return(undefined);
}
var _local5 = _bulletMachine.getBullets();
var _local4 = _local5.length;
while (_local4--) {
_bulletMachine.recycle(_local5[_local4]);
}
_prevEnemyList = [];
var _local2 = 0;
while (_local2 < _enemyList.length) {
var _local3 = _enemyList[_local2];
_prevEnemyList.push(_local3);
_local2++;
}
_START_ENEMIES = _levelData[_nextLevelIndex].numEnemies;
trace("\u521D\u59CB\u5316\u4EBA\u6570_nextLevelIndex " + _nextLevelIndex);
trace("\u521D\u59CB\u5316\u4EBA\u6570 : " + _START_ENEMIES);
_START_OPS = _levelData[_nextLevelIndex].numOps;
initEnemies(_START_OPS, _scrollDir);
_doors[0].swapDepths(100);
_doors[1].swapDepths(120);
_doors[2].swapDepths(130);
_doors[3].swapDepths(140);
_scorePopMC._x = _hero._mc._x;
_scorePopMC._y = _hero._mc._y;
_prevScore = _totalScore;
scrollBG(_scrollDir);
}
function winGamePause() {
_global.setTimeout(this, "winGame", 2000);
}
function winGame() {
trace("gameboard.winGame");
addScore(Math.floor(_levelBonus));
_screensMC.gotoAndPlay("win_in");
_soundModule.StopAll();
stopGameEngine();
cleanUp();
}
function loseGame() {
trace("gb.\u5931\u8D25");
_global.setTimeout(this, "showLoseScreen", 3000);
}
function showLoseScreen() {
trace("gb.continue");
stopGameEngine();
_screensMC.gotoAndPlay("lose_in");
_soundModule.StopAll();
_soundModule.PlaySound("music_lose");
}
function killKeyListener() {
Key.removeListener(_keyListener);
}
function scrollBG(_scrollDir) {
trace("\u6362\u5730\u56FE");
_hero.run(_scrollDir);
_bg["bg" + _levelIndex].swapDepths(1);
_newBG = _bg.attachMovie("bg" + _levelData[_nextLevelIndex].bg, "bg" + _nextLevelIndex, 2);
_newBG.cacheAsBitmap = true;
_parent["roomblock" + _levelIndex]._visible = true;
var _local2;
switch (_scrollDir) {
case "n" :
_scrollVX = 0;
_scrollVY = 10;
_newBG._x = 0;
_newBG._y = -365;
initDoors(0, -365);
_local2 = "s";
break;
case "e" :
_scrollVX = -10;
_scrollVY = 0;
_newBG._x = 600;
_newBG._y = 0;
initDoors(600, 0);
_local2 = "w";
break;
case "w" :
_scrollVX = 10;
_scrollVY = 0;
_newBG._x = -600;
_newBG._y = 0;
initDoors(-600, 0);
_local2 = "e";
}
_bg[("door_" + _local2) + _nextLevelIndex].gotoAndPlay("open");
_bgRect = new flash.geom.Rectangle(0, 0, 600, 400);
_bg.scrollRect = _bgRect;
onEnterFrame = scrollBGInterval;
}
function scrollBGInterval() {
_time.MarkTimeThisTick();
_hero.updateSprite();
var _local7 = false;
if (_scrollDir == "n") {
if (_bgRect.y <= -365) {
_local7 = true;
}
} else if (_scrollDir == "e") {
if (_bgRect.x == 600) {
_local7 = true;
}
} else if (_scrollDir == "w") {
if (_bgRect.x == -600) {
_local7 = true;
}
}
var _local5 = _parent["roomblock" + _levelIndex];
var _local4 = _parent["roomblock" + _nextLevelIndex];
if (_local7) {
onEnterFrame = null;
_bg["door_n" + _levelIndex].removeMovieClip();
_bg["door_e" + _levelIndex].removeMovieClip();
_bg["door_w" + _levelIndex].removeMovieClip();
_bg["door_s" + _levelIndex].removeMovieClip();
_bg["bg" + _levelIndex].removeMovieClip();
_bg["bg" + _nextLevelIndex]._x = 0;
_bg["bg" + _nextLevelIndex]._y = 0;
_bg["door_n" + _nextLevelIndex]._x = (_bg["door_n" + _nextLevelIndex]._y = 0);
_bg["door_e" + _nextLevelIndex]._x = (_bg["door_e" + _nextLevelIndex]._y = 0);
_bg["door_s" + _nextLevelIndex]._x = (_bg["door_s" + _nextLevelIndex]._y = 0);
_bg["door_w" + _nextLevelIndex]._x = (_bg["door_w" + _nextLevelIndex]._y = 0);
_bgRect.x = 0;
_bgRect.y = 0;
_bg.scrollRect = _bgRect;
_local4._x = (_local4._y = 0);
if (_levelData[_nextLevelIndex].pickup != 0) {
var _local3 = 0;
while (_local3 <= 5) {
_bg["pickup" + _local3]._x = _pickupX;
_bg["pickup" + _local3]._y = _pickupY;
_local3++;
}
}
_levelIndex = _nextLevelIndex;
var _local2 = _prevEnemyList.length;
while (_local2--) {
_prevEnemyList[_local2]._mc.removeMovieClip();
_prevEnemyList.pop();
}
var _local6;
switch (_scrollDir) {
case "n" :
_local6 = "s";
break;
case "e" :
_local6 = "w";
break;
case "w" :
_local6 = "e";
}
trace("dddddddddddd " + _bg[("door_" + _local6) + _nextLevelIndex]);
_bg[("door_" + _local6) + _nextLevelIndex].gotoAndPlay("close");
_soundModule.PlaySound("door_unlock_open.wav");
init();
initPickups(_scrollDir);
} else {
_hero._mc._x = _hero._mc._x + (_scrollVX / 2);
_hero._mc._y = _hero._mc._y + (_scrollVY / 2);
_hero.updateSprite();
_bgRect.x = _bgRect.x - _scrollVX;
_bgRect.y = _bgRect.y - _scrollVY;
_bg.scrollRect = _bgRect;
_local5._x = _local5._x + _scrollVX;
_local5._y = _local5._y + _scrollVY;
_local4._x = _local4._x + _scrollVX;
_local4._y = _local4._y + _scrollVY;
var _local2 = _enemyList.length;
while (_local2--) {
_enemyList[_local2]._mc._x = _enemyList[_local2]._mc._x + _scrollVX;
_enemyList[_local2]._mc._y = _enemyList[_local2]._mc._y + _scrollVY;
}
_local2 = _prevEnemyList.length;
while (_local2--) {
_prevEnemyList[_local2]._mc._x = _prevEnemyList[_local2]._mc._x + _scrollVX;
_prevEnemyList[_local2]._mc._y = _prevEnemyList[_local2]._mc._y + _scrollVY;
}
}
}
function cleanUp() {
trace("gameboard.cleanUp");
clearEnemies();
for (var _local2 in _bg) {
_bg[_local2].removeMovieClip();
}
_parent["roomblock" + _levelIndex].removeMovieClip();
}
function clearEnemies() {
trace("gameboard.clearEnemies");
_prevEnemyList = [];
_operativeList = [];
var _local3 = _enemyList.length;
while (_local3--) {
var _local2 = _enemyList.pop();
_local2.setTarget(null);
_local2._mc.removeMovieClip();
}
_enemyList = [];
}
var pick_up_array = new Array();
var _scrollDir = "s";
var _bonusMax = 5000;
var _hamsterCount = 0;
var _hamsterQuota = 30;
var _restart = false;
var _prevScore = 0;
}
Symbol 1644 MovieClip [__Packages.Standard.Time] Frame 0
class Standard.Time
{
var _currentTime, _fakeGetTimer, _timeLastTick, _gameSpeed, _startTime;
function Time (Void) {
_currentTime = 0;
_fakeGetTimer = 0;
_timeLastTick = 0.001;
_gameSpeed = INITIAL_GAME_SPEED;
_startTime = (getTimer() * INITIAL_GAME_SPEED) / 1000;
}
function GetElapsedTime(Void) {
return(_timeLastTick);
}
function GetCurTime(Void) {
return(_currentTime);
}
function GetGameSpeed(Void) {
return(_gameSpeed);
}
function MarkTimeThisTick(Void) {
_fakeGetTimer = _fakeGetTimer + 0.03225806;
var _local2 = _fakeGetTimer - _startTime;
_timeLastTick = _local2 - _currentTime;
_currentTime = _local2;
if (_timeLastTick <= 0) {
_timeLastTick = 0.001;
}
}
function SetGameSpeed(value) {
_gameSpeed = value;
if (_gameSpeed < MIN_GAME_SPEED) {
_gameSpeed = MIN_GAME_SPEED;
} else if (_gameSpeed > MAX_GAME_SPEED) {
_gameSpeed = MAX_GAME_SPEED;
}
}
function toString(Void) {
return("Time()");
}
static var INITIAL_GAME_SPEED = 2;
static var MIN_GAME_SPEED = 0.001;
static var MAX_GAME_SPEED = 100;
}
Symbol 1645 MovieClip [__Packages.Standard.Message.MsgRoute] Frame 0
class Standard.Message.MsgRoute
{
var _time, _delayedMessages;
function MsgRoute (time) {
_time = time;
_delayedMessages = [];
}
function Update() {
DeliverDelayedMessages();
}
function SendMsg(delay, name, sender, receiver, state, data) {
if (delay <= 0) {
var _local9;
if (data != null) {
_local9 = new Standard.Message.Extended_MsgObject(_time.GetCurTime(), name, sender, receiver, state, data);
} else {
_local9 = new Standard.Message.MsgObject(_time.GetCurTime(), name, sender, receiver, state);
}
RouteMsg(_local9);
} else {
var _local2;
var _local3 = 0;
while (_local3 <= _delayedMessages.length) {
_local2 = _delayedMessages[_local3];
if (((((_local2.IsDelivered() == false) && (_local2.GetMsgName() == name)) && (_local2.GetReceiver() == receiver)) && (_local2.GetSender() == sender)) && (_local2.GetMsgState() == state)) {
return(undefined);
}
_local3++;
}
var _local6 = delay + _time.GetCurTime();
if (data != null) {
var _local9 = new Standard.Message.Extended_MsgObject(_local6, name, sender, receiver, state, data);
} else {
var _local9 = new Standard.Message.MsgObject(_local6, name, sender, receiver, state);
}
_local3 = 0;
while ((_local3 < _delayedMessages.length) && (_local6 >= _delayedMessages[_local3].GetDeliveryTime())) {
_local3++;
}
_delayedMessages.splice(_local3, 0, _local9);
}
}
function DeliverDelayedMessages(Void) {
var _local2;
while ((_delayedMessages.length > 0) && (_delayedMessages[0].GetDeliveryTime() <= _time.GetCurTime())) {
_local2 = _delayedMessages.shift();
RouteMsg(_local2);
}
}
function RouteMsg(msg) {
var _local2 = msg.GetReceiver();
if (_local2) {
if ((msg.GetMsgState() == Standard.StateMachine.STATE_Global) || (msg.GetMsgState() == _local2.GetStateMachine().GetState())) {
msg.SetDelivered(true);
_local2.GetStateMachine().Process(Standard.StateMachine.EVENT_Message, msg);
}
}
}
function Flush(Void) {
while (_delayedMessages.length > 0) {
_delayedMessages.shift();
}
}
function toString() {
return("MsgRoute()");
}
}
Symbol 1646 MovieClip [__Packages.Standard.Message.MsgObject] Frame 0
class Standard.Message.MsgObject
{
var _name, _sender, _receiver, _state, _deliveryTime, _delivered;
function MsgObject (deliveryTime, name, sender, receiver, state) {
if (state == null) {
state = -1;
}
SetDeliveryTime(deliveryTime);
SetMsgName(name);
SetSender(sender);
SetReceiver(receiver);
SetMsgState(state);
SetDelivered(false);
}
function GetMsgName(Void) {
return(_name);
}
function SetMsgName(name) {
_name = name;
}
function GetSender(Void) {
return(_sender);
}
function SetSender(sender) {
_sender = sender;
}
function GetReceiver(Void) {
return(_receiver);
}
function SetReceiver(receiver) {
_receiver = receiver;
}
function GetMsgState(Void) {
return(_state);
}
function SetMsgState(state) {
_state = state;
}
function GetDeliveryTime(Void) {
return(_deliveryTime);
}
function SetDeliveryTime(time) {
_deliveryTime = time;
}
function IsDelivered(Void) {
return(_delivered);
}
function SetDelivered(value) {
_delivered = value;
}
function toString(Void) {
return(((((((("Message(" + _name) + ",") + _sender) + ",") + _receiver) + ",") + _deliveryTime) + ")");
}
}
Symbol 1647 MovieClip [__Packages.Standard.Message.Extended_MsgObject] Frame 0
class Standard.Message.Extended_MsgObject extends Standard.Message.MsgObject
{
var SetDeliveryTime, SetMsgName, SetSender, SetReceiver, SetMsgState, SetDelivered, _data, _deliveryTime, _receiver, _sender, _name;
function Extended_MsgObject (deliveryTime, name, sender, receiver, state, data) {
super();
SetDeliveryTime(deliveryTime);
SetMsgName(name);
SetSender(sender);
SetReceiver(receiver);
SetMsgState(state);
SetDelivered(false);
SetData(data);
}
function SetData(data) {
_data = data;
}
function GetData() {
return(_data);
}
function toString() {
return(((((((("E_Message(" + _name) + ",") + _sender) + ",") + _receiver) + ",") + _deliveryTime) + ")");
}
}
Symbol 1648 MovieClip [__Packages.Standard.StateMachine] Frame 0
class Standard.StateMachine
{
var _Owner, _time, _msgRoute, _currentState, _stateChange, _nextState, _timeOnEnter, _ccMessagesToGameObject;
function StateMachine (obj, time, msgRoute) {
_Owner = obj;
_time = time;
_msgRoute = msgRoute;
_currentState = 1;
_stateChange = false;
_nextState = false;
_timeOnEnter = 0;
_ccMessagesToGameObject = 0;
}
function Initialize(Void) {
_currentState = STATE_Initialize;
_stateChange = false;
_nextState = false;
_timeOnEnter = 0;
_ccMessagesToGameObject = 0;
Process(EVENT_Enter, null);
}
function Process(event, msg) {
if (((event == EVENT_Message) && (msg != null)) && (GetCCReceiver() > 0)) {
}
if (States(event, msg, _currentState) == false) {
States(event, msg, STATE_Global);
}
var _local2 = 50;
while (_stateChange && ((_local2--) >= 0)) {
_stateChange = false;
States(EVENT_Exit, 0, _currentState);
_currentState = _nextState;
_timeOnEnter = _time.GetCurTime();
States(EVENT_Enter, 0, _currentState);
}
}
function States() {
return({});
}
function Update(Void) {
Process(EVENT_Update, null);
}
function SetState(newState) {
_stateChange = true;
_nextState = newState;
}
function GetState(Void) {
return(_currentState);
}
function GetStateChange(Void) {
return(_stateChange);
}
function GetTimeInState(Void) {
return(_time.GetCurTime() - _timeOnEnter);
}
function GetCurTime(Void) {
return(_time.GetCurTime());
}
function SendMsg(name, receiver, data) {
_msgRoute.SendMsg(0, name, _Owner, receiver, STATE_Global, data);
}
function SendDelayedMsg(delay, name, receiver, data) {
_msgRoute.SendMsg(delay, name, _Owner, receiver, STATE_Global, data);
}
function SendDelayedMsgToMe(delay, name, scope, data) {
if (scope == SCOPE_TO_THIS_STATE) {
_msgRoute.SendMsg(delay, name, _Owner, _Owner, _currentState, data);
} else {
_msgRoute.SendMsg(delay, name, _Owner, _Owner, STATE_Global, data);
}
}
function SetCCReceiver(obj) {
_ccMessagesToGameObject = obj;
}
function ClearCCReceiver(Void) {
_ccMessagesToGameObject = 0;
}
function GetCCReceiver(Void) {
return(_ccMessagesToGameObject);
}
function toString(Void) {
return("StateMachine(), _Owner: " + _Owner._mc);
}
static var EVENT_INVALID = 0;
static var EVENT_Enter = 1;
static var EVENT_Message = 2;
static var EVENT_Update = 3;
static var EVENT_Exit = 4;
static var STATE_Global = 0;
static var STATE_Initialize = 1;
static var NO_MSG_SCOPING = 0;
static var SCOPE_TO_THIS_STATE = 1;
}
Symbol 1649 MovieClip [__Packages.Hero] Frame 0
class Hero
{
var _gb, _mc, _frameCounter, _spriteController_body, _spriteController_feet, _states, _fsm, _colorList, _currentColor, _speed, _health, _vx, _vy, _dir, _shootDir, _shooting, _strafe, _collisionEnabled, _grenadeKey, _struggle, _struggleKeyCount, _struggleKeysRequired, _struggleTimeDuration, _struggleTimeStart, _endLevelX, _endLevelY, _grenadeSight, _grenadeTicker, _collObj, _struggleTimer;
function Hero (gb, mc) {
trace("Class.............hero");
_gb = gb;
_mc = mc;
_frameCounter = 0;
_spriteController_body = new Standard.SpriteController();
_spriteController_body.SetKey(_animKey_body);
_spriteController_feet = new Standard.SpriteController();
_spriteController_feet.SetKey(_animKey_feet);
_states = ["STATE_Global", "STATE_Init", "STATE_Idle", "STATE_Running", "STATE_Throwing", "STATE_LevelFail", "STATE_LevelPass", "STATE_Caught", "STATE_Hit", "STATE_Breakout", "STATE_Dead"];
_fsm = new Standard.Simple_FSM(this, _states, _gb._time, _gb._msgRoute);
_colorList = ["purple", "green", "blue", "orange"];
moveTo(_spawnX, _spawnY);
init();
}
function init(Void) {
trace("hero........init");
_currentColor = _colorList[_gb._levelIndex % 4];
_speed = 0;
_health = _healthMax;
_vx = 0;
_vy = 0;
_dir = "s";
_shootDir = "s";
_shooting = false;
_strafe = false;
_collisionEnabled = true;
_grenadeKey = false;
var _local2 = _spriteController_body.PlayAnimation(_dir + "_idle");
_mc.body__mc.gotoAndStop(_local2);
_local2 = _spriteController_feet.PlayAnimation(_dir + "_idle");
_mc.feet_mc.gotoAndStop(_local2);
_fsm.SetState(STATE_INIT);
}
function update(Void) {
_fsm.Update();
}
function onKeyUp() {
if (_struggle) {
if ((Key.getCode() == 37) || (Key.getCode() == 39)) {
_struggleKeyCount++;
}
return(undefined);
}
}
function unzombify() {
if (_gb._enemyGrabSide == 0) {
_collisionEnabled = true;
_fsm.SetState(STATE_IDLE);
} else {
_fsm.SetState(STATE_CAUGHT);
}
}
function getCollEnabled() {
return(_collisionEnabled);
}
function resetHealth() {
_health = _healthMax;
_parent.ui.healthMC.gotoAndStop(1);
_gb.updateHealthBar(_health);
}
function addHealth(n) {
_health = _health + n;
if (_health > 100) {
_health = 100;
}
_gb.updateHealthBar(_health);
}
function loseHealth(n) {
_health = _health - n;
_gb.updateHealthBar(_health);
if (_health <= 0) {
_health = 0;
_gb.setHealthToZero();
_fsm.SetState(STATE_DEAD);
}
}
function isDead() {
return(Boolean(_health <= 0));
}
function beginStruggle() {
_struggle = true;
_struggleKeysRequired = 10;
_struggleKeyCount = 0;
_struggleTimeDuration = 2000;
_struggleTimeStart = _gb._time.GetCurTime();
}
function checkStruggle() {
var _local3 = _gb._time.GetCurTime() - _struggleTimeStart;
if (_struggleKeyCount >= _struggleKeysRequired) {
_gb._enemyGrabSide = 0;
_fsm.SendMsg(_global.MSG_Stop, this);
knockBackEnemies();
}
}
function knockBackEnemies() {
trace("\u89E3\u5F00");
var _local9 = _gb._enemyList;
var _local8 = _local9.length;
while (_local8--) {
var _local3 = _local9[_local8];
if (_local3.isZombie()) {
var _local4 = _local3._mc._x - _mc._x;
var _local5 = _local3._mc._y - _mc._y;
var _local6 = Math.atan2(_local5, _local4);
var _local7 = Math.sqrt((_local4 * _local4) + (_local5 * _local5));
if (_local7 < _knockBackRadius) {
_fsm.SendMsg(_global.MSG_Run, _local3);
_local3.knockback(_local6);
}
}
}
}
function setEndLevelCoords() {
trace("hero.......setEndLevelCoords");
_endLevelX = _mc._x;
_endLevelY = _mc._y;
}
function moveTowardSpawnPoint() {
var _local3 = (_spawnX - _endLevelX) / 40;
var _local4 = (_spawnY - _endLevelY) / 40;
_mc._x = _mc._x + _local3;
_mc._y = _mc._y + _local4;
var _local2 = 200 + (_mc._y * 1000);
_mc.swapDepths(_local2);
}
function dirToAngle(dir) {
var _local1;
switch (dir) {
case "w" :
_local1 = 180;
break;
case "n" :
_local1 = 270;
break;
case "e" :
_local1 = 0;
break;
case "s" :
_local1 = 90;
break;
case "nw" :
_local1 = 225;
break;
case "ne" :
_local1 = 315;
break;
case "se" :
_local1 = 45;
break;
case "sw" :
_local1 = 135;
}
return(_local1);
}
function getKeys() {
if (Key.isDown(80) || (Key.isDown(112))) {
_root.ui.pauseGame = true;
_root.ui.instructionsBtn.onRelease();
}
if (Key.isDown(88)) {
if (!_grenadeKey) {
if (_gb._bulletMachine.isCharging()) {
_gb._noGrenadeMC.gotoAndPlay("show");
_gb._soundModule.PlaySound("grenade_no_ammo.wav");
_grenadeKey = false;
} else {
_grenadeKey = true;
_grenadeSight = _gb._bg.attachMovie("grenade_radius", "grenade_radius", 90000);
}
} else {
var _local5 = (3.14159 * dirToAngle(_shootDir)) / 180;
_grenadeSight._x = _mc._x + ((_grenadeTicker * 20) * Math.cos(_local5));
_grenadeSight._y = (_mc._y - 30) + ((_grenadeTicker * 20) * Math.sin(_local5));
}
} else if (_grenadeKey) {
shoot("grenade", _grenadeTicker);
_grenadeKey = false;
_grenadeSight.removeMovieClip();
}
if (((((Key.isDown(88) || (Key.isDown(90))) || (Key.isDown(37))) || (Key.isDown(38))) || (Key.isDown(39))) || (Key.isDown(40))) {
if (Key.isDown(90)) {
if (((Key.isDown(37) || (Key.isDown(38))) || (Key.isDown(39))) || (Key.isDown(40))) {
_root.gb.hero_mc.body_mc.feet.play();
} else {
_root.gb.hero_mc.body_mc.feet.gotoAndStop(1);
}
_strafe = true;
shoot("bullet");
} else if (Key.isDown(88)) {
if (((Key.isDown(37) || (Key.isDown(38))) || (Key.isDown(39))) || (Key.isDown(40))) {
_root.gb.hero_mc.body_mc.feet.play();
} else {
_root.gb.hero_mc.body_mc.feet.gotoAndStop(1);
}
_strafe = true;
} else {
_root.gb.hero_mc.body_mc.feet.play();
_strafe = false;
_gb._bulletMachine.resetTimer();
}
var _local6 = Number(Key.isDown(37));
var _local8 = 2 * Number(Key.isDown(38));
var _local9 = 4 * Number(Key.isDown(39));
var _local10 = 8 * Number(Key.isDown(40));
var _local7 = ((_local6 + _local8) + _local9) + _local10;
var _local4;
switch (_local7) {
case 0 :
return(undefined);
case 1 :
_local4 = "w";
break;
case 2 :
_local4 = "n";
break;
case 4 :
_local4 = "e";
break;
case 5 :
_local4 = _dir;
return(undefined);
case 8 :
_local4 = "s";
break;
case 10 :
_local4 = _dir;
break;
case 3 :
_local4 = "nw";
break;
case 6 :
_local4 = "ne";
break;
case 12 :
_local4 = "se";
break;
case 9 :
_local4 = "sw";
break;
default :
return(undefined);
}
_shootDir = _local4;
moveDir(_local4);
_fsm.SendMsg(_global.MSG_Run, this);
} else {
_root.gb.hero_mc.body_mc.feet.gotoAndStop(1);
_root.gb.hero_mc.body_mc.gotoAndStop(_shootDir + "shoot");
_fsm.SendMsg(_global.MSG_Stop, this);
}
}
function moveDir(d) {
if (_speed < _speedMax) {
_speed++;
}
if (d != _dir) {
_dir = d;
var _local4;
if (!_strafe) {
_local4 = _spriteController_body.PlayAnimation(d + "_shoot");
_mc.body_mc.gotoAndStop(_local4);
}
_local4 = _spriteController_feet.PlayAnimation(d + "_run");
_mc.feet_mc.gotoAndStop(_local4);
}
if (!_strafe) {
_shootDir = _dir;
}
var _local2;
var _local3;
switch (_dir) {
case "w" :
_local2 = -_speed;
_local3 = 0;
break;
case "n" :
_local2 = 0;
_local3 = -_speed;
break;
case "e" :
_local2 = _speed;
_local3 = 0;
break;
case "s" :
_local2 = 0;
_local3 = _speed;
break;
case "nw" :
_local2 = (-_speed) / 1.4;
_local3 = (-_speed) / 1.4;
break;
case "ne" :
_local2 = _speed / 1.4;
_local3 = (-_speed) / 1.4;
break;
case "se" :
_local2 = _speed / 1.4;
_local3 = _speed / 1.4;
break;
case "sw" :
_local2 = (-_speed) / 1.4;
_local3 = _speed / 1.4;
break;
default :
_local2 = 0;
_local3 = 0;
}
_vx = _local2;
_vy = _local3;
var _local6 = _mc._x + _vx;
var _local7 = _mc._y + _vy;
if (!Standard.Geometry.Rect.pointWithin(_local6, _local7, _gb._playField)) {
return(undefined);
}
moveTo(_local6, _local7);
}
function moveTo(x, y) {
_mc._x = x;
_mc._y = y;
_collObj.setPos(x, y);
var _local2 = 200 + (_mc._y * 1000);
_mc.swapDepths(_local2);
_gb._noGrenadeMC._x = x;
_gb._noGrenadeMC._y = y;
}
function run(dir) {
trace("hero.......run");
var _local2 = _spriteController_body.PlayAnimation(dir + "_shoot");
_mc.body_mc.gotoAndStop(_local2);
_local2 = _spriteController_feet.PlayAnimation(dir + "_run");
_mc.feet_mc.gotoAndStop(_local2);
}
function updateSprite() {
var _local2 = _spriteController_body.Update();
_mc.body_mc.gotoAndStop(_local2);
_local2 = _spriteController_feet.Update();
_mc.feet_mc.gotoAndStop(_local2);
}
function throwStart() {
_fsm.SetState(STATE_THROWING);
}
function updateGrenadeTicker() {
if (_grenadeKey) {
_grenadeTicker = _grenadeTicker + 1;
if (_grenadeTicker > 25) {
_grenadeTicker = 25;
}
} else {
_grenadeTicker = 3;
}
}
function shoot(typ, dist) {
_spriteController_body.PlayAnimation(_shootDir + "_shoot");
var _local2 = dirToAngle(_shootDir);
_gb._bulletMachine.createBullet(typ, _mc._x, _mc._y, _local2, dist);
}
function GetStateMachine(Void) {
return(_fsm);
}
function STATE_Global_Message(oMsg) {
trace("hero.......STATE_Global_Message");
if (!(oMsg.GetMsgName() === _global.MSG_Die)) {
} else {
_fsm.SetState(STATE_DEAD);
}
}
function STATE_Init_Update(Void) {
trace("hero.......STATE_Init_Update");
_fsm.SetState(STATE_IDLE);
}
function STATE_Init_Exit(Void) {
}
function STATE_Idle_Enter(Void) {
var _local2 = _spriteController_body.PlayAnimation(_dir + "_idle");
_mc.body_mc.gotoAndStop(_local2);
_local2 = _spriteController_feet.PlayAnimation(_dir + "_idle");
_mc.feet_mc.gotoAndStop(_local2);
if (_gb.getRestarted() == true) {
_gb.setRestarted(false);
}
}
function STATE_Idle_Update(Void) {
_mc.body_mc.gotoAndStop(_spriteController_body.Update());
_mc.feet_mc.gotoAndStop(_spriteController_feet.Update());
getKeys();
updateGrenadeTicker();
}
function STATE_Idle_Message(oMsg) {
switch (oMsg.GetMsgName()) {
case _global.MSG_Hit :
_fsm.SetState(STATE_HIT);
break;
case _global.MSG_ThrowStart :
_fsm.SetState(STATE_THROWING);
break;
case _global.MSG_TargetCaught :
_fsm.SetState(STATE_CAUGHT);
break;
case _global.MSG_Run :
_fsm.SetState(STATE_RUNNING);
}
}
function STATE_Idle_Exit(Void) {
}
function STATE_Running_Enter(Void) {
var _local2 = _spriteController_body.PlayAnimation(_dir + "_shoot");
_mc.body_mc.gotoAndStop(_local2);
_local2 = _spriteController_feet.PlayAnimation(_dir + "_run");
_mc.feet_mc.gotoAndStop(_local2);
}
function STATE_Running_Update(Void) {
getKeys();
updateGrenadeTicker();
var _local2 = _spriteController_body.Update();
_mc.body_mc.gotoAndStop(_local2);
_local2 = _spriteController_feet.Update();
_mc.feet_mc.gotoAndStop(_local2);
_frameCounter++;
if ((_frameCounter % 8) == 0) {
var _local3 = random(6);
switch (_local3) {
case 0 :
_gb._soundModule.PlaySound("footstep1.wav", 50, 0, 0, 0);
case 1 :
_gb._soundModule.PlaySound("footstep2.wav", 50, 0, 0, 0);
case 2 :
_gb._soundModule.PlaySound("footstep3.wav", 50, 0, 0, 0);
case 3 :
_gb._soundModule.PlaySound("footstep4.wav", 50, 0, 0, 0);
case 4 :
_gb._soundModule.PlaySound("footstep5.wav", 50, 0, 0, 0);
case 5 :
_gb._soundModule.PlaySound("footstep6.wav", 50, 0, 0, 0);
}
}
}
function STATE_Running_Message(oMsg) {
switch (oMsg.GetMsgName()) {
case _global.MSG_ThrowStart :
_fsm.SetState(STATE_THROWING);
break;
case _global.MSG_TargetCaught :
_fsm.SetState(STATE_CAUGHT);
break;
case _global.MSG_Stop :
_fsm.SetState(STATE_IDLE);
break;
case _global.MSG_Hit :
_fsm.SetState(STATE_HIT);
}
}
function STATE_Running_Exit(Void) {
}
function STATE_Throwing_Enter(Void) {
var _local2 = _spriteController_body.PlayAnimation(_dir + "_throw");
_mc.body_mc.gotoAndStop(_local2);
_local2 = _spriteController_feet.PlayAnimation(_dir + "_run");
_mc.feet_mc.gotoAndStop(_local2);
_gb._soundModule.PlaySound("numbuh1_throw_grenade.wav", 150);
}
function STATE_Throwing_Update(Void) {
getKeys();
var _local2 = _spriteController_body.Update();
if (_spriteController_body.AnimationComplete()) {
_fsm.SetState(STATE_RUNNING);
} else {
_mc.body_mc.gotoAndStop(_local2);
}
_local2 = _spriteController_feet.Update();
_mc.feet_mc.gotoAndStop(_local2);
_frameCounter++;
if ((_frameCounter % 8) == 0) {
var _local3 = random(6);
switch (_local3) {
case 0 :
_gb._soundModule.PlaySound("footstep1", 50, 0, 0, 0);
case 1 :
_gb._soundModule.PlaySound("footstep2", 50, 0, 0, 0);
case 2 :
_gb._soundModule.PlaySound("footstep3", 50, 0, 0, 0);
case 3 :
_gb._soundModule.PlaySound("footstep4", 50, 0, 0, 0);
case 4 :
_gb._soundModule.PlaySound("footstep5", 50, 0, 0, 0);
case 5 :
_gb._soundModule.PlaySound("footstep6", 50, 0, 0, 0);
}
}
}
function STATE_Throwing_Message(oMsg) {
switch (oMsg.GetMsgName()) {
case _global.MSG_Throw :
break;
case _global.MSG_TargetCaught :
_fsm.SetState(STATE_CAUGHT);
break;
case _global.MSG_Stop :
break;
case _global.MSG_Hit :
_fsm.SetState(STATE_HIT);
}
}
function STATE_Throwing_Exit(Void) {
}
function STATE_Hit_Enter(Void) {
trace("hero.......STATE_Hit_Enter");
_collisionEnabled = false;
var _local2 = _spriteController_body.PlayAnimation("hit");
_mc.body_mc.gotoAndStop(_local2);
_local2 = _spriteController_feet.PlayAnimation("hit");
_mc.feet_mc.gotoAndStop(_local2);
_gb._soundModule.PlaySound("gets_hit.wav");
loseHealth(10);
}
function STATE_Hit_Update(Void) {
var _local2 = _spriteController_body.Update();
if (_spriteController_body.AnimationComplete()) {
_fsm.SetState(STATE_IDLE);
} else {
_mc.body_mc.gotoAndStop(_local2);
}
_mc.feet_mc.gotoAndStop(_spriteController_feet.Update());
}
function STATE_Hit_Message(oMsg) {
trace("hero.......STATE_Hit_Message");
if (!(oMsg.GetMsgName() === _global.MSG_Run)) {
} else {
_fsm.SetState(STATE_IDLE);
}
}
function STATE_Hit_Exit(Void) {
_collisionEnabled = true;
_struggle = false;
}
function STATE_Caught_Enter(Void) {
_grenadeKey = false;
_grenadeSight._x = (_grenadeSight._y = -200);
_collisionEnabled = false;
var _local2 = _spriteController_body.PlayAnimation("struggle");
_mc.body_mc.gotoAndStop(_local2);
_local2 = _spriteController_feet.PlayAnimation("struggle");
_mc.feet_mc.gotoAndStop(_local2);
beginStruggle();
if (_gb.getRestarted() == true) {
_struggleTimer = 20;
}
}
function STATE_Caught_Update(Void) {
checkStruggle();
_mc.body_mc.gotoAndStop(_spriteController_body.Update());
_mc.feet_mc.gotoAndStop(_spriteController_feet.Update());
if (_gb.getRestarted() == true) {
if ((_struggleTimer--) <= 0) {
_fsm.SetState(STATE_BREAKOUT);
_gb._enemyGrabSide = 0;
knockBackEnemies();
_gb.setRestarted(false);
}
} else {
loseHealth(0.3);
}
}
function STATE_Caught_Message(oMsg) {
if (!(oMsg.GetMsgName() === _global.MSG_Stop)) {
} else {
_fsm.SetState(STATE_BREAKOUT);
}
}
function STATE_Caught_Exit(Void) {
}
function STATE_Breakout_Enter(Void) {
var _local2 = _spriteController_body.PlayAnimation("breakout");
_mc.body_mc.gotoAndStop(_local2);
_local2 = _spriteController_feet.PlayAnimation("struggle");
_mc.feet_mc.gotoAndStop(_local2);
_gb._soundModule.PlaySound("break_free_of_zombie.wav", 50);
}
function STATE_Breakout_Update(Void) {
_mc.body_mc.gotoAndStop(_spriteController_body.Update());
if (_spriteController_body.AnimationComplete()) {
_fsm.SetState(STATE_IDLE);
}
}
function STATE_Breakout_Message(oMsg) {
trace("hero.......STATE_Breakout_Message");
if (!(oMsg.GetMsgName() === _global.MSG_TargetCaught)) {
}
}
function STATE_Breakout_Exit(Void) {
trace("hero.......\u89E3\u5F00");
_collisionEnabled = true;
_struggle = false;
}
function STATE_Dead_Enter(Void) {
_collisionEnabled = false;
var _local2 = _spriteController_body.PlayAnimation("dead");
_mc.body_mc.gotoAndStop(_local2);
_local2 = _spriteController_feet.PlayAnimation("struggle");
_mc.feet_mc.gotoAndStop(_local2);
_gb._soundModule.PlaySound("transform_sequence_zombie.wav");
var _local3 = _mc.getDepth();
_mc.swapDepths(_local3 + 800000);
}
function STATE_Dead_Update(Void) {
_mc.body_mc.gotoAndStop(_spriteController_body.Update());
}
function STATE_Dead_Message(oMsg) {
}
function STATE_Dead_Exit(Void) {
var _local2 = _mc.getDepth();
_mc.swapDepths(_local2 - 800000);
}
function toString() {
return("Hero()");
}
var _speedMax = 7;
var _spawnX = 300;
var _spawnY = 220;
var _cRad = 10;
var _collOffsetX = 0;
var _collOffsetY = 0;
var STATE_GLOBAL = 0;
var STATE_INIT = 1;
var STATE_IDLE = 2;
var STATE_RUNNING = 3;
var STATE_THROWING = 4;
var STATE_LEVELFAIL = 5;
var STATE_LEVELPASS = 6;
var STATE_CAUGHT = 7;
var STATE_HIT = 8;
var STATE_BREAKOUT = 9;
var STATE_DEAD = 10;
var _knockBackRadius = 75;
var _healthMax = 100;
var _lives = 3;
static var _animKey_body = {w_idle:{frames:[80], loop:false}, e_idle:{frames:[200], loop:false}, n_idle:{frames:[280], loop:false}, s_idle:{frames:[1], loop:false}, ne_idle:{frames:[240], loop:false}, se_idle:{frames:[40], loop:false}, nw_idle:{frames:[120], loop:false}, sw_idle:{frames:[160], loop:false}, w_throw:{frames:[100, 101, 102, 103, 104], loop:false}, e_throw:{frames:[220, 221, 222, 223, 224], loop:false}, n_throw:{frames:[300, 301, 302, 303, 304], loop:false}, s_throw:{frames:[20, 21, 22, 23, 24], loop:false}, ne_throw:{frames:[260, 261, 262, 263, 264], loop:false}, se_throw:{frames:[60, 61, 62, 63, 64], loop:false}, nw_throw:{frames:[140, 141, 142, 143, 144], loop:false}, sw_throw:{frames:[180, 181, 182, 183, 184], loop:false}, w_shoot:{frames:[80], loop:false}, e_shoot:{frames:[200], loop:false}, n_shoot:{frames:[280], loop:false}, s_shoot:{frames:[1], loop:false}, ne_shoot:{frames:[240], loop:false}, se_shoot:{frames:[40], loop:false}, nw_shoot:{frames:[120], loop:false}, sw_shoot:{frames:[160], loop:false}, struggle:{frames:[340, 341, 342, 343], loop:true}, breakout:{frames:[360, 360, 361, 361, 362, 362, 362, 362, 362, 362], loop:false}, hit:{frames:[400, 400, 400, 401, 401, 401, 402, 402, 402, 403, 403, 403, 404, 404, 404, 405, 405, 405, 406, 406, 406, 407, 407, 407], loop:false}, dead:{frames:[400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449], loop:false}};
static var _animKey_feet = {w_idle:{frames:[220], loop:true}, e_idle:{frames:[160], loop:true}, n_idle:{frames:[180], loop:false}, s_idle:{frames:[160], loop:true}, ne_idle:{frames:[160], loop:true}, se_idle:{frames:[160], loop:true}, nw_idle:{frames:[220], loop:true}, sw_idle:{frames:[220], loop:true}, w_run:{frames:[120, 121, 122, 123, 124, 125, 126, 127], loop:true}, e_run:{frames:[40, 41, 42, 43, 44, 45, 46, 47], loop:true}, n_run:{frames:[60, 61, 62, 63, 64, 65, 66, 67], loop:true}, s_run:{frames:[1, 2, 3, 4, 5, 6, 7, 8], loop:true}, ne_run:{frames:[80, 81, 82, 83, 84, 85, 86, 87], loop:true}, se_run:{frames:[20, 21, 22, 23, 24, 25, 26, 27], loop:true}, nw_run:{frames:[140, 141, 142, 143, 144, 145, 146, 147], loop:true}, sw_run:{frames:[100, 101, 102, 103, 104, 105, 106, 107], loop:true}, struggle:{frames:[260], loop:false}, hit:{frames:[260], loop:false}};
}
Symbol 1650 MovieClip [__Packages.Standard.SpriteController] Frame 0
class Standard.SpriteController
{
var _animation_key, _isAnimationFinished, _curFrame, _curAnimation, _isAnimationLooping, _curFrameIndex;
function SpriteController () {
_animation_key = {};
_isAnimationFinished = false;
}
function SetKey(oKey) {
_animation_key = oKey;
}
function AnimationComplete(Void) {
return(_isAnimationFinished);
}
function GetCurrentFrame(Void) {
return(_curFrame);
}
function PlayAnimation(sName) {
_isAnimationFinished = false;
_curAnimation = _animation_key[sName].frames;
_isAnimationLooping = _animation_key[sName].loop;
_curFrameIndex = 0;
_curFrame = _curAnimation[0];
return(_curFrame);
}
function PlayAnimation_sync(sName) {
_curAnimation = _animation_key[sName].frames;
_isAnimationLooping = _animation_key[sName].loop;
_curFrame = _curAnimation[_curFrameIndex];
return(_curFrame);
}
function Update(Void) {
if (_curFrameIndex < (_curAnimation.length - 1)) {
_curFrameIndex++;
_curFrame = _curAnimation[_curFrameIndex];
} else {
_isAnimationFinished = true;
if (_isAnimationLooping) {
_curFrameIndex = 0;
_curFrame = _curAnimation[_curFrameIndex];
}
}
return(_curFrame);
}
function toString(Void) {
return("SpriteController()");
}
}
Symbol 1651 MovieClip [__Packages.Standard.Simple_FSM] Frame 0
class Standard.Simple_FSM extends Standard.StateMachine
{
var _states, _event_key, _Owner;
function Simple_FSM (obj, states, time, msgRoute) {
super(obj, time, msgRoute);
_states = states;
_event_key = ["_INVALID", "_Enter", "_Message", "_Update", "_Exit"];
}
function States(event, msg, state) {
if (state < _states.length) {
var _local2 = _states[state] + _event_key[event];
if (_Owner instanceof Hamster) {
}
if (_Owner[_local2] != null) {
_Owner[_local2](msg);
return(true);
}
return(false);
}
return(false);
}
function toString(Void) {
return("Simple_FSM()");
}
}
Symbol 1652 MovieClip [__Packages.Hamster] Frame 0
class Hamster
{
var _gb, _mc, _spriteController, _animKey, _states, _fsm, _collObj, _x0, _y0, _goalX, _vx;
function Hamster (gb, mc, idx) {
_gb = gb;
_mc = mc;
_spriteController = new Standard.SpriteController();
_animKey = {idle:{frames:[1], loop:false}, jump:{frames:[41, 42, 43, 44, 45, 46, 47], loop:false}, zombiewalk:{frames:[2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9], loop:true}, hit:{frames:[11], loop:false}, unzombify:{frames:[13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26], loop:false}, leave:{frames:[28, 28, 29, 29, 30, 30, 31, 31], loop:true}};
_spriteController.SetKey(_animKey);
_states = ["STATE_Global", "STATE_Init", "STATE_Idle", "STATE_Drop", "STATE_Running", "STATE_Unzombify", "STATE_Leaving"];
_fsm = new Standard.Simple_FSM(this, _states, _gb._time, _gb._msgRoute);
_collObj = new Standard.Geometry.Circle(_mc._x + _collOffsetX, _mc._y + _collOffsetY, _cRad);
}
function init(x0, y0, bStart) {
_fsm.SetState(STATE_INIT);
_x0 = x0;
_y0 = y0;
moveTo(x0, y0);
var _local2 = 200 + (_mc._y * 1000);
_mc.swapDepths(_local2);
_fsm.SetState(STATE_IDLE);
}
function update() {
var _local2 = 200 + (_mc._y * 1000);
_mc.swapDepths(_local2);
_fsm.Update();
}
function GetStateMachine(Void) {
return(_fsm);
}
function getCollObject() {
return(_collObj);
}
function knockback() {
_vy = -1;
}
function moveXY(dx, dy) {
moveTo(_mc._x + dx, _mc._y + dy);
}
function moveTo(x, y) {
_mc._x = x;
_mc._y = y;
_collObj.setPos(_mc._x + _collOffsetX, _mc._y + _collOffsetY);
}
function seek() {
var _local2 = Math.atan2(_goalY - _mc._y, _goalX - _mc._x);
_vx = _vmax * Math.cos(_local2);
_vy = _vmax * Math.sin(_local2);
}
function checkCollision() {
if (!_gb._hero.getCollEnabled()) {
return(undefined);
}
var _local5 = _gb._hero._mc;
var _local3 = _mc._x - _local5._x;
var _local4 = _mc._y - _local5._y;
if (((_local3 * _local3) + (_local4 * _local4)) < 400) {
_fsm.SendMsg(_global.MSG_Hit, _gb._hero);
}
}
function STATE_Global_Message(oMsg) {
if (!(oMsg.GetMsgName() === _global.MSG_Run)) {
} else {
_fsm.SetState(STATE_DROP);
}
}
function STATE_Init_Update(Void) {
_fsm.SetState(_INIT_STATE);
}
function STATE_Init_Exit(Void) {
}
function STATE_Idle_Enter() {
var _local2 = _spriteController.PlayAnimation("idle");
_mc.gotoAndStop(_local2);
_ZOMBIE = true;
}
function STATE_Idle_Update() {
_fsm.SetState(STATE_DROP);
}
function STATE_Idle_Message(oMsg) {
if (!(oMsg.GetMsgName() === _global.MSG_Run)) {
} else {
_fsm.SetState(STATE_DROP);
}
}
function STATE_Idle_Exit() {
}
function STATE_Drop_Enter() {
_ZOMBIE = true;
var _local2 = _spriteController.PlayAnimation("jump");
_mc.gotoAndStop(_local2);
_vmax = 3;
}
function STATE_Drop_Update() {
_mc.gotoAndStop(_spriteController.Update());
if (_spriteController.AnimationComplete()) {
_fsm.SetState(STATE_RUNNING);
}
}
function STATE_Drop_Message(oMsg) {
if (!(oMsg.GetMsgName() === _global.MSG_Unzombify)) {
} else {
_fsm.SetState(STATE_UNZOMBIFY);
}
}
function STATE_Drop_Exit() {
}
function STATE_Running_Enter() {
var _local2 = _spriteController.PlayAnimation("zombiewalk");
_mc.gotoAndStop(_local2);
}
function STATE_Running_Update() {
_vy = _vy + 0.1;
if (_vy >= _vmax) {
_vy = _vmax;
}
moveXY(0, _vy);
if (_mc._y > 395) {
_mc._y = 100;
_fsm.SetState(STATE_DROP);
}
checkCollision();
_mc.gotoAndStop(_spriteController.Update());
}
function STATE_Running_Message(oMsg) {
switch (oMsg.GetMsgName()) {
case _global.MSG_BulletHit :
knockback();
break;
case _global.MSG_Unzombify :
_fsm.SetState(STATE_UNZOMBIFY);
}
}
function STATE_Running_Exit() {
}
function STATE_Unzombify_Enter(oMsg) {
var _local2 = _spriteController.PlayAnimation("unzombify");
_gb._soundModule.PlaySound("transform_sequence_operative.wav");
_ZOMBIE = false;
}
function STATE_Unzombify_Update(oMsg) {
_mc.gotoAndStop(_spriteController.Update());
if (_spriteController.AnimationComplete()) {
_fsm.SetState(STATE_LEAVING);
}
}
function STATE_Unzombify_Message(oMsg) {
}
function STATE_Unzombify_Exit(oMsg) {
}
function STATE_Leaving_Enter() {
_vmax = 5;
_goalX = _goalListX[random(2)];
seek();
var _local2 = _spriteController.PlayAnimation("leave");
_mc.gotoAndStop(_local2);
}
function STATE_Leaving_Update() {
_mc.gotoAndStop(_spriteController.Update());
moveXY(_vx, _vy);
var _local2 = _goalX - _mc._x;
var _local3 = _goalY - _mc._y;
if (_mc._y < 80) {
_gb._hamsterCount++;
_gb.updateHamsterMeters();
_vx = (_vy = 0);
if (!_gb._levelOver) {
moveTo(_x0, 100);
_fsm.SetState(STATE_DROP);
} else {
moveTo(-200, -200);
_mc._visible = false;
}
}
}
function STATE_Leaving_Message(oMsg) {
}
function STATE_Leaving_Exit() {
}
function toString() {
return("Hamster()");
}
var STATE_GLOBAL = 0;
var STATE_INIT = 1;
var STATE_IDLE = 2;
var STATE_DROP = 3;
var STATE_RUNNING = 4;
var STATE_UNZOMBIFY = 5;
var STATE_LEAVING = 6;
var _INIT_STATE = Hamster.prototype.STATE_IDLE;
var _vy = 0;
var _vmax = 3;
var _cRad = 10;
var _collOffsetX = 0;
var _collOffsetY = -20;
var _goalListX = [274, 326];
var _goalY = 80;
var _ZOMBIE = true;
}
Symbol 1653 MovieClip [__Packages.Standard.Geometry.Circle] Frame 0
class Standard.Geometry.Circle
{
var _x, _y, _radius, _radiusSqr;
function Circle (x, y, rad) {
_x = x;
_y = y;
_radius = rad;
_radiusSqr = rad * rad;
}
function setPos(x, y) {
_x = x;
_y = y;
}
function isPointWithin(px, py) {
var _local2 = px - _x;
var _local3 = py - _y;
if (_radiusSqr > ((_local2 * _local2) + (_local3 * _local3))) {
return(true);
}
return(false);
}
function getPos() {
return(new flash.geom.Point(_x, _y));
}
function getRadius() {
return(_radius);
}
function circleCollision(circ2) {
var _local3 = circ2.getRadius();
var _local2 = circ2.getPos();
var _local6 = (_radius + _local3) * (_radius + _local3);
var _local4 = _local2.x - _x;
var _local5 = _local2.y - _y;
if (((_local4 * _local4) + (_local5 * _local5)) < _local6) {
return(true);
}
return(false);
}
function toString() {
return(("Circle(" + [_x, _y, _radius]) + ")");
}
}
Symbol 1654 MovieClip [__Packages.Standard.Geometry.Rect] Frame 0
class Standard.Geometry.Rect
{
var xMin, yMin, xMax, yMax, xCenter, yCenter, width, height;
function Rect (ixMin, iyMin, ixMax, iyMax) {
trace("Class........................Rect");
xMin = ixMin;
yMin = iyMin;
xMax = ixMax;
yMax = iyMax;
xCenter = xMin + ((xMax - xMin) / 2);
yCenter = yMin + ((yMax - yMin) / 2);
width = xMax - xMin;
height = yMax - yMin;
}
function moveTo(x, y) {
var _local2 = x - xCenter;
var _local3 = y - yCenter;
xMin = xMin + _local2;
yMin = yMin + _local3;
xMax = xMax + _local2;
yMax = yMax + _local3;
xCenter = xCenter + _local2;
yCenter = yCenter + _local3;
}
function toString() {
return(((((((("Rect(" + xMin) + ", ") + yMin) + ", ") + xMax) + ", ") + yMax) + ")");
}
static function pointWithin(x, y, r1) {
if (x < r1.xMin) {
return(false);
}
if (x > r1.xMax) {
return(false);
}
if (y < r1.yMin) {
return(false);
}
if (y > r1.yMax) {
return(false);
}
return(true);
}
static function boundsIntersect(r1, r2) {
if (r1.xMax < r2.xMin) {
return(false);
}
if (r2.xMax < r1.xMin) {
return(false);
}
if (r1.yMax < r2.yMin) {
return(false);
}
if (r2.yMax < r1.yMin) {
return(false);
}
return(true);
}
static function getClosestNormal(x, y, rect) {
var _local4 = y - rect.yMin;
var _local6 = x - rect.xMin;
var _local5 = rect.yMax - y;
var _local3 = rect.xMax - x;
var _local2 = [_local4, _local6, _local5, _local3];
_local2.sort(compare);
return(_local2[0]);
}
static function compare(a, b) {
if (a < b) {
return(-1);
}
if (a > b) {
return(1);
}
return(0);
}
static function GetOutcode(point, rect) {
var _local1 = 0;
if (point.y <= rect.yMin) {
_local1 = _local1 | 1;
}
if (point.x >= rect.xMax) {
_local1 = _local1 | 2;
}
if (point.y >= rect.yMax) {
_local1 = _local1 | 4;
}
if (point.x <= rect.xMin) {
_local1 = _local1 | 8;
}
return(_local1);
}
static function Get_Ray_Exit(start_pos, end_pos, rect) {
var _local10 = GetOutcode(start_pos, rect);
var _local7 = GetOutcode(end_pos, rect);
if (_local7 == 0) {
return(false);
}
if ((_local10 & _local7) == 0) {
var _local5 = 0;
var _local4 = 1;
var _local8 = end_pos.x - start_pos.x;
var _local9 = end_pos.y - start_pos.y;
var _local3 = 8;
if ((_local10 & _local3) != 0) {
var _local1 = ((-start_pos.x) - rect.xMin) / _local8;
if (_local1 > _local5) {
_local5 = _local1;
}
} else if ((_local7 & _local3) != 0) {
var _local1 = (rect.xMin - start_pos.x) / _local8;
if (_local1 < _local4) {
_local4 = _local1;
}
}
_local3 = 2;
if ((_local10 & _local3) != 0) {
var _local1 = ((-start_pos.x) + rect.xMax) / _local8;
if (_local1 > _local5) {
_local5 = _local1;
}
} else if ((_local7 & _local3) != 0) {
var _local1 = ((-start_pos.x) + rect.xMax) / _local8;
if (_local1 < _local4) {
_local4 = _local1;
}
}
_local3 = 1;
if ((_local10 & _local3) != 0) {
var _local1 = ((-start_pos.y) - rect.yMin) / _local9;
if (_local1 > _local5) {
_local5 = _local1;
}
} else if ((_local7 & _local3) != 0) {
var _local1 = (rect.yMin - start_pos.y) / _local9;
if (_local1 < _local4) {
_local4 = _local1;
}
}
_local3 = 4;
if ((_local10 & _local3) != 0) {
var _local1 = ((-start_pos.y) + rect.yMax) / _local9;
if (_local1 > _local5) {
_local5 = _local1;
}
} else if ((_local7 & _local3) != 0) {
var _local1 = ((-start_pos.y) + rect.yMax) / _local9;
if (_local1 < _local4) {
_local4 = _local1;
}
}
if (_local5 <= _local4) {
return({x:start_pos.x + (_local4 * _local8), y:start_pos.y + (_local4 * _local9)});
}
}
return(false);
}
}
Symbol 1655 MovieClip [__Packages.BulletMachine] Frame 0
class BulletMachine
{
var _mc, _bullets, _recycleBin, _hero, _gb, _charging;
function BulletMachine (gb, hero, mc, dp) {
_mc = mc.createEmptyMovieClip("bulletContainer", dp);
_bullets = new Array();
_recycleBin = new Array();
_hero = hero;
_gb = gb;
_charging = false;
}
function createBullet(typ, x, y, ang, dist) {
if (typ == "bullet") {
y = y + 25;
if (_frameCount < _fireRate) {
return(undefined);
}
_frameCount = 0;
}
var _local3;
if (typ == "grenade") {
y = y - 35;
if (!_charging) {
_local3 = new Grenade(this, _mc, _count, x, y, ang, dist);
_hero.throwStart();
_grenadeTimerStart = _timer;
_charging = true;
}
} else {
var _local4 = 1 + random(3);
_gb._soundModule.PlaySound(("numbuh1_shoot" + _local4) + ".wav", 60);
if (_recycleBin.length == 0) {
_local3 = new Bullet(this, _mc, _count, x, y, ang);
} else {
_local3 = _recycleBin.pop();
_local3.init(x, y, ang);
}
}
_bullets.push(_local3);
_count++;
}
function getGrenadeTimer() {
var _local2 = (_timer - _grenadeTimerStart) / _grenadeTimerDuration;
if (_local2 > 1) {
_local2 = 1;
}
return(_local2 * 100);
}
function isCharging() {
return(_charging);
}
function update() {
_frameCount++;
_timer++;
var _local2 = _bullets.length;
while (_local2--) {
_bullets[_local2].update();
}
var _local3 = Boolean((_timer - _grenadeTimerStart) < _grenadeTimerDuration);
if ((!_local3) && (_charging)) {
_gb.flashGrenadeIcon();
_charging = false;
}
}
function recycle(bul) {
var _local2 = _bullets.length;
while (_local2--) {
if (bul == _bullets[_local2]) {
_bullets[_local2].moveTo(-500, -500);
_bullets.setCollActive(false);
_bullets.splice(_local2, 1);
return(undefined);
}
}
}
function remove(bul) {
var _local2 = _bullets.length;
while (_local2--) {
if (bul == _bullets[_local2]) {
_bullets[_local2]._mc.removeMovieClip();
delete _bullets[_local2];
_bullets.splice(_local2, 1);
return(undefined);
}
}
}
function getBullets() {
return(_bullets);
}
function resetTimer() {
_frameCount = _fireRate;
}
function explosion(typ, x, y) {
if ((x == undefined) || (y == undefined)) {
return(undefined);
}
var _local2 = _mc.attachMovie(typ, "explosion", 999999);
_local2._x = x;
_local2._y = y;
}
var _count = 0;
var _fireRate = 8;
var _frameCount = 8;
var _grenadeTimerStart = -150;
var _grenadeTimerDuration = 90;
var _timer = 0;
}
Symbol 1656 MovieClip [__Packages.Bullet] Frame 0
class Bullet
{
var _bounds, _bulletMachine, _id, _mcParent, _collObj, _collActive, _mc, _ang, _vx, _vy;
function Bullet (bMachine, mc, count, x, y, ang) {
_bounds = new flash.geom.Rectangle(0, 35, 600, 400);
_bulletMachine = bMachine;
_id = count;
_mcParent = mc;
_collObj = new Standard.Geometry.Circle(x, y, _cRad);
_collActive = true;
init(x, y, ang);
}
function init(x, y, ang) {
_mc = _mcParent.attachMovie("bullet", "bullet" + _id, _id);
var _local2 = "";
switch (ang) {
case 0 :
_local2 = "e";
y = y - 5;
break;
case 45 :
_local2 = "se";
break;
case 90 :
_local2 = "s";
x = x - 5;
y = y - 15;
break;
case 135 :
_local2 = "sw";
break;
case 180 :
_local2 = "w";
y = y - 5;
break;
case 225 :
_local2 = "nw";
break;
case 270 :
_local2 = "n";
break;
case 315 :
_local2 = "ne";
}
_mc.gotoAndStop(_local2);
_ang = ang;
_mc._x = x;
_mc._y = y - 20;
_vx = _vel * Math.cos((ang * 3.14159) / 180);
_vy = _vel * Math.sin((ang * 3.14159) / 180);
}
function setCollActive(b) {
_collActive = b;
}
function getCollActive() {
return(_collActive);
}
function getCollObject() {
return(_collObj);
}
function moveTo(x, y) {
_mc._x = x;
_mc._y = y;
_collObj.setPos(x + _collOffsetX, y + _collOffsetY);
var _local2 = 200 + (_mc._y * 1000);
_mc.swapDepths(_local2);
}
function update() {
_collOffsetX = _mc.cPoint._x;
_collOffsetY = _mc.cPoint._y;
moveTo(_mc._x + _vx, _mc._y + _vy);
var _local2 = new flash.geom.Point(_mc._x + _collOffsetX, _mc._y + _collOffsetY);
if (!_bounds.containsPoint(_local2)) {
_bulletMachine.recycle(this);
}
}
function toString() {
return("Bullet() #" + _id);
}
function getAngle() {
return(_ang);
}
var _vel = 20;
var _cRad = 10;
var _collOffsetX = 0;
var _collOffsetY = 0;
}
Symbol 1657 MovieClip [__Packages.Grenade] Frame 0
class Grenade extends Bullet
{
var _dist, _vz, _bounds, _z, _ang, _mc, _vx, _vy, _cRad, _collObj, _collActive, _mcParent, _id, _bulletMachine;
function Grenade (bMachine, mc, count, x, y, ang, dist) {
super(bMachine, mc, count, x, y, ang);
_dist = 20 * dist;
_vz = (_dist * _grav) / (2 * _vel);
_bounds = new flash.geom.Rectangle(30, 40, 570, 370);
_z = 0.1;
_ang = ang;
_mc._x = x;
_mc._y = y;
_vx = _vel * Math.cos((_ang * 3.14159) / 180);
_vy = _vel * Math.sin((_ang * 3.14159) / 180);
_cRad = 50;
_collObj = new Standard.Geometry.Circle(x, y, _cRad);
_collActive = false;
}
function init(x, y, ang) {
_mc = _mcParent.attachMovie("grenade", "grenade" + _id, _id);
_ang = ang;
_mc._x = x;
_mc._y = y;
_vx = _vel * Math.cos((ang * 3.14159) / 180);
_vy = _vel * Math.sin((ang * 3.14159) / 180);
}
function update() {
_vz = _vz - _grav;
_z = _z + _vz;
_timer++;
if (_z < 0) {
_bulletMachine.explosion("explosion", _mc._x, _mc._y);
_collActive = true;
_timer = 0;
return(undefined);
}
_mc._x = _mc._x + _vx;
_mc._y = _mc._y + (_vy - _vz);
_collObj.setPos(_mc._x, _mc._y);
}
function toString() {
return("Grenade()");
}
var _grav = 3;
var _timer = 0;
var _vel = 20;
}
Symbol 1658 MovieClip [__Packages.Standard.SoundModule] Frame 0
class Standard.SoundModule
{
var _mc, _hash, _num, _active_sounds, _fade_interval, _music_mute, _defaultVol, _curr_music, _fade_interval2;
function SoundModule (mc) {
_mc = mc;
_hash = {};
_num = 0;
_active_sounds = [];
_fade_interval = null;
_music_mute = _global.MUSIC_MUTE;
_defaultVol = 100;
}
function SoundAvailable() {
return(_active_sounds.length < 8);
}
function LoadSound(sound_name) {
_num++;
var _local3 = "mySound" + _num;
_mc.createEmptyMovieClip(_local3, _num);
var _local2 = new Sound(_mc[_local3]);
_local2.parent = this;
_local2.lastStart = 0;
_local2.onSoundComplete = function () {
this.parent.DeactivateSound(sound_name);
};
_hash[sound_name] = _local2;
return(_local2);
}
function SetMusicMute(oBool) {
_music_mute = oBool;
if (_music_mute == true) {
_hash["music_" + _curr_music].setVolume(0);
} else {
_hash["music_" + _curr_music].setVolume(_global.MUSIC_VOL);
}
}
function GetMusicMute() {
return(_music_mute);
}
function StopMusic() {
var _local2 = _active_sounds.length;
while (_local2--) {
if (_active_sounds[_local2].indexOf("music") != -1) {
StopSound(_active_sounds[_local2]);
break;
}
}
_curr_music = "none";
}
function GetCurMusic(Void) {
return(_curr_music);
}
function PlayMusic(str) {
if (str == _curr_music) {
return(undefined);
}
if (str == "none") {
FadeSound("music_" + _curr_music, _global.MUSIC_VOL, 0, 0.5);
} else {
CrossFade("music_" + _curr_music, "music_" + str, 0.5);
_curr_music = str;
}
}
function DeactivateSound(snd) {
var _local2 = _active_sounds.length;
while (_local2--) {
if (snd == _active_sounds[_local2]) {
_active_sounds.splice(_local2, 1);
break;
}
}
}
function DeactivateAllSounds() {
_active_sounds = [];
}
function StopSound(snd) {
var _local2 = _hash[snd];
_local2.stop();
DeactivateSound(snd);
}
function StopAll() {
for (var _local2 in _active_sounds) {
StopSound(_active_sounds[_local2]);
}
_curr_music = "none";
}
function soundIsPlaying(snd) {
for (var _local3 in _active_sounds) {
if (_active_sounds[_local3] == snd) {
return(true);
}
}
return(false);
}
function PlaySound(snd, vol, pan, offset, loop) {
for (var _local4 in _active_sounds) {
if (_active_sounds[_local4] == snd) {
if (snd.indexof("footstep") != -1) {
return(undefined);
}
}
}
if (_active_sounds.length < MAX_SOUNDS) {
var _local3 = _hash[snd];
if (vol == null) {
_local3.setVolume(_defaultVol);
} else {
_local3.setVolume(vol);
}
if (pan != null) {
_local3.setPan(pan);
}
if (offset == null) {
offset = 0;
}
if (loop == null) {
loop = 0;
}
_local3.start(offset, loop);
_active_sounds.push(snd);
}
}
function CrossFade(snd1, snd2, dur) {
FadeSound(snd1, _global.MUSIC_VOL, 0, dur);
PlaySound(snd2, 0, 0, 0, 9999);
FadeSound2(snd2, 0, _global.MUSIC_VOL, dur);
}
function FadeSound(snd, startVol, endVol, duration) {
if (_fade_interval != null) {
clearInterval(_fade_interval);
}
_hash[snd].setVolume(startVol);
var _local2;
if (endVol < startVol) {
_local2 = -1;
} else {
_local2 = 1;
}
var _local5 = (duration / Math.abs(endVol - startVol)) * 1000;
_fade_interval = setInterval(this, "Fade_Sound_Update", _local5, [snd, endVol, _local2]);
}
function FadeSound2(snd, startVol, endVol, duration) {
if (_fade_interval2 != null) {
clearInterval(_fade_interval2);
}
_hash[snd].setVolume(startVol);
var _local2;
if (endVol < startVol) {
_local2 = -1;
} else {
_local2 = 1;
}
var _local5 = (duration / Math.abs(endVol - startVol)) * 1000;
_fade_interval2 = setInterval(this, "Fade_Sound_Update2", _local5, [snd, endVol, _local2]);
}
function Fade_Sound_Update(sndAr) {
var _local4 = sndAr[0];
var _local5 = sndAr[1];
var _local3 = sndAr[2];
var _local2 = _hash[_local4].getVolume() + _local3;
if (((_local3 > 0) && (_local2 <= _local5)) || ((_local3 < 0) && (_local2 >= _local5))) {
_hash[_local4].setVolume(_local2);
if (_local2 <= 0) {
StopSound(_local4);
}
} else {
clearInterval(_fade_interval);
}
}
function Fade_Sound_Update2(sndAr) {
var _local4 = sndAr[0];
var _local5 = sndAr[1];
var _local3 = sndAr[2];
var _local2 = _hash[_local4].getVolume() + _local3;
if (((_local3 > 0) && (_local2 <= _local5)) || ((_local3 < 0) && (_local2 >= _local5))) {
_hash[_local4].setVolume(_local2);
if (_local2 <= 0) {
StopSound(_local4);
}
} else {
clearInterval(_fade_interval2);
}
}
function getSound(snd) {
return(_hash[snd]);
}
function toString() {
return("SoundModule()");
}
function unload() {
for (var _local3 in _hash) {
delete _hash[_local3];
}
var _local2 = 0;
while (_local2 < _num) {
_mc["mySound" + _num].removeMovieClip();
_local2++;
}
delete _hash;
}
static var MAX_SOUNDS = 32;
}
Symbol 1659 MovieClip [__Packages.Standard.Map.NodeMap] Frame 0
class Standard.Map.NodeMap
{
var _nodeList, _historyList;
function NodeMap () {
trace("Class........................NodeMap");
_nodeList = [];
_historyList = [];
}
function addNode(newNode) {
_nodeList.push(newNode);
}
function getNodeDiff(n) {
return(_nodeList[n].diff);
}
function getNodeID(n) {
return(_nodeList[n].id);
}
function getNodeLinks(n) {
trace("NodeMap n :" + n);
trace("_nodeList[n].links : " + _nodeList[n].links);
return(_nodeList[n].links);
}
function addToHistoryList(n) {
trace("NodeMap ..........addToHistoryList");
var _local3 = false;
var _local2 = _historyList.length;
while (_local2--) {
if (_historyList[_local2] == n) {
_local3 = true;
}
}
if (!_local3) {
_historyList.push(n);
}
}
}
Symbol 1660 MovieClip [__Packages.Enemy] Frame 0
class Enemy
{
var _gb, _targ, _mc, _idx, _ZOMBIE, _maxChaseSpeed, _maxTurnSpeed, _enemyList, _spriteController, _states, _fsm, _seekTimer, _collObj, _targetSpotX, _targetSpotY, _moveTimer, _angle, _speedMax, _agil, _xc, _yc, _targDX, _targDY, _proximity, _enemyIsClose, _speed, _vx, _vy, _knockbackFrameCount, _wanderTime;
function Enemy (gb, mc, seekTarget, idx, enemyList) {
_gb = gb;
_targ = seekTarget;
_mc = mc;
_idx = idx;
_ZOMBIE = true;
_maxChaseSpeed = 2 + (Math.random() * 1.25);
_maxTurnSpeed = 0.001 + (Math.random() * 0.2);
_enemyList = enemyList;
_spriteController = new Standard.SpriteController();
_states = ["STATE_Global", "STATE_Init", "STATE_Idle", "STATE_Chasing", "STATE_TargetCaught", "STATE_Stun1", "STATE_Stun2", "STATE_Stun3", "STATE_Unzombify", "STATE_Zombify", "STATE_OperativeFlee", "STATE_Knockback", "STATE_Wander"];
_fsm = new Standard.Simple_FSM(this, _states, _gb._time, _gb._msgRoute);
_seekTimer = 0;
_collObj = new Standard.Geometry.Circle(_mc._x + _collOffsetX, _mc._y + _collOffsetY, _cRad);
_mc.feelers._visible = false;
_targetSpotX = -100 + (Math.random() * 200);
_targetSpotY = -100 + (Math.random() * 200);
_moveTimer = 0;
}
function getAngle() {
return(_angle);
}
function init() {
}
function initAsOperative() {
_ZOMBIE = false;
_INIT_STATE = STATE_OPERATIVE_FLEE;
_mc.gotoAndStop(1);
}
function update() {
_collObj.setPos(_mc._x + _collOffsetX, _mc._y + _collOffsetY);
_fsm.Update();
}
function moveTo(x, y) {
_mc._x = x;
_mc._y = y;
_collObj.setPos(x + _collOffsetX, y + _collOffsetY);
var _local2 = 200 + (_mc._y * 1000);
_mc.swapDepths(_local2);
}
function setCollOffset(dx, dy) {
_collOffsetX = dx;
_collOffsetY = dy;
}
function getCollObject() {
return(_collObj);
}
function setSpeedMax(n) {
_speedMax = n;
}
function setAgility(n) {
_agil = n;
}
function isZombie() {
return(_ZOMBIE);
}
function setTarget(o) {
_targ = o;
}
function setCentroid(x, y) {
if ((!x) && (!y)) {
_xc = _mc._x;
_yc = _mc._y;
} else {
_xc = x;
_yc = y;
}
}
function addCentroid(dx, dy) {
_xc = _xc + dx;
_yc = _yc + dy;
}
function updateProximity() {
if (_ZOMBIE) {
_targDX = _targ._mc._x - _mc._x;
_targDY = _targ._mc._y - _mc._y;
var _local4 = Math.sqrt((_targDX * _targDX) + (_targDY * _targDY));
_proximity = Boolean(_local4 < _proximityRange);
_targ.setEnemyIsClose(_proximity);
if (_local4 >= 100) {
var _local2 = _targ._mc._x;
var _local3 = _targ._mc._y;
_local3 = _local3 + _targetSpotY;
_local2 = _local2 + _targetSpotX;
if (_local2 < _gb._playField.xMin) {
_local2 = _gb._playField.xMin;
}
if (_local2 > _gb._playField.xMax) {
_local2 = _gb._playField.xMax;
}
if (_local3 < _gb._playField.yMin) {
_local3 = _gb._playField.yMin;
}
if (_local3 > _gb._playField.yMax) {
_local3 = _gb._playField.yMax;
}
_targDX = _local2 - _mc._x;
_targDY = _local3 - _mc._y;
if (_targ._mc._x < _mc._x) {
if ((_targ._mc._x + _targetSpotX) > _mc._x) {
_targDX = _targ._mc._x - _mc._x;
}
} else if ((_targ._mc._x + _targetSpotX) < _mc._x) {
_targDX = _targ._mc._x - _mc._x;
}
}
}
}
function setEnemyIsClose(bClose) {
_enemyIsClose = bClose;
}
function getNewTarget() {
var _local3 = Math.random();
var _local2 = _gb._operativeList.length;
if (_local3 < (1 / (1 + _local2))) {
_targ = _gb._hero;
} else {
_targ = _gb._operativeList[random(_local2)];
}
_gb._soundModule.PlaySound(("zombie_groan" + (1 + random(5))) + ".wav", 40);
}
function targetOperative() {
var _local3 = Math.random();
var _local2 = _gb._operativeList.length;
if (_local3 < (1 / (1 + _local2))) {
_targ = _gb._hero;
return(false);
}
_targ = _gb._operativeList[random(_local2)];
_gb._soundModule.PlaySound(("zombie_groan" + (1 + random(4))) + ".wav", 40);
return(true);
}
function canGrabHero(mcX, targX) {
if (mcX < targX) {
if (!(_gb._enemyGrabSide & 1)) {
_gb._enemyGrabSide = _gb._enemyGrabSide ^ 1;
return(true);
}
} else if (!(_gb._enemyGrabSide & 16)) {
_gb._enemyGrabSide = _gb._enemyGrabSide ^ 16;
return(true);
}
return(false);
}
function chase() {
_speed = _speed + _acc;
if (_speed > _maxChaseSpeed) {
_speed = _maxChaseSpeed;
}
var _local5 = Math.atan2(_targDY, _targDX);
var _local10 = ((_local5 * 180) / 3.14) + 90;
_local10 = (_local10 + 360) % 360;
var _local11 = ((_angle * 180) / 3.14) + 90;
var _local6 = _angle - _local5;
if (_local6 < 0) {
if (_local6 < _maxTurnSpeed) {
_angle = _local5 - _maxTurnSpeed;
}
} else if (_local6 > _maxTurnSpeed) {
_angle = _local5 + _maxTurnSpeed;
}
_vx = _speed * Math.cos(_angle);
_vy = _speed * Math.sin(_angle);
if (_proximity) {
var _local8 = _targ._mc._x - _mc._x;
var _local9 = _targ._mc._y - _mc._y;
var _local7 = Math.sqrt((_local8 * _local8) + (_local9 * _local9));
if (_local7 < _cRad) {
_fsm.SendMsg(_global.MSG_TargetCaught, _targ);
if (_targ instanceof Hero) {
if (canGrabHero(_mc._x, _targ._mc._x)) {
_fsm.SetState(STATE_TARGET_CAUGHT);
} else if (!targetOperative()) {
_fsm.SetState(STATE_WANDER);
}
} else {
getNewTarget();
}
}
_targ.addCentroid((10000 / _local7) * Math.cos(_angle), (10000 / _local7) * Math.sin(_angle));
} else if (outOfBounds(_mc._x + _vx, _mc._y + _vy)) {
_targetSpotX = -100 + (Math.random() * 200);
_targetSpotY = -100 + (Math.random() * 200);
}
var _local3 = _mc._x + _vx;
var _local4 = _mc._y + _vy;
if (_local3 < _gb._playField.xMin) {
_local3 = _gb._playField.xMin;
}
if (_local3 > _gb._playField.xMax) {
_local3 = _gb._playField.xMax;
}
if (_local4 < _gb._playField.yMin) {
_local4 = _gb._playField.yMin;
}
if (_local4 > _gb._playField.yMax) {
_local4 = _gb._playField.yMax;
}
moveTo(_local3, _local4);
}
function handleBounds(angle, mcX, mcY) {
if (mcX < _gb._fleeField.xMin) {
if (angle >= 270) {
angle = angle + 90;
} else if (angle > 180) {
angle = angle - 90;
}
} else if (mcX > _gb._fleeField.xMax) {
if (angle < 90) {
angle = angle - 90;
}
if ((angle < 180) && (angle >= 90)) {
angle = angle + 90;
}
} else if (mcY < _gb._fleeField.yMin) {
if (angle > 270) {
angle = angle - 90;
}
if (angle < 90) {
angle = angle + 90;
}
} else if (mcY > _gb._fleeField.yMax) {
if ((angle > 90) && (angle <= 180)) {
angle = angle - 90;
}
if ((angle > 180) && (angle <= 270)) {
angle = angle + 90;
}
}
return(angle);
}
function flee() {
var _local8 = 0;
var _local9 = 0;
var _local16 = _mc._x;
var _local17 = _mc._y;
var _local13 = _gb._enemyList.length;
var _local12 = false;
if (_moveTimer > 0) {
_moveTimer = _moveTimer - 1;
_speed = _speed + _acc;
if (_speed > _maxFleeSpeed) {
_speed = _maxFleeSpeed;
}
_vx = _speed * Math.cos(_angle);
_vy = _speed * Math.sin(_angle);
var _local10 = _mc._x + _vx;
var _local11 = _mc._y + _vy;
if (_local10 < _gb._playField.xMin) {
_local10 = _gb._playField.xMin;
}
if (_local10 > _gb._playField.xMax) {
_local10 = _gb._playField.xMax;
}
if (_local11 < _gb._playField.yMin) {
_local11 = _gb._playField.yMin;
}
if (_local11 > _gb._playField.yMax) {
_local11 = _gb._playField.yMax;
}
moveTo(_local10, _local11);
_enemyIsClose = false;
return(undefined);
}
var _local3 = 0;
while (_local3 < _local13) {
var _local5 = _gb._enemyList[_local3];
var _local2 = _mc._x - _local5._mc._x;
var _local4 = _mc._y - _local5._mc._y;
if (!_local5.isZombie()) {
} else {
var _local6 = Math.sqrt(_local2 * _local2, _local4 * _local4);
var _local7 = 100;
if (_local6 < _local7) {
_local8 = _local8 + _local2;
_local9 = _local9 + _local4;
_local12 = true;
}
}
_local3++;
}
if (_local12) {
_speed = _speed + _acc;
if (_speed > _maxFleeSpeed) {
_speed = _maxFleeSpeed;
}
var _local15 = Math.atan2(_local9, _local8);
var _local14 = ((_local15 * 180) / 3.14) + 90;
_local14 = (_local14 + 360) % 360;
_local14 = handleBounds(_local14, _local16, _local17);
_angle = (_local14 - 90) * 0.01744444;
_moveTimer = 20;
} else {
_speed = _speed - _acc;
if (_speed < 0) {
_speed = 0;
}
}
_vx = _speed * Math.cos(_angle);
_vy = _speed * Math.sin(_angle);
var _local10 = _mc._x + _vx;
var _local11 = _mc._y + _vy;
if (_local10 < _gb._playField.xMin) {
_local10 = _gb._playField.xMin;
}
if (_local10 > _gb._playField.xMax) {
_local10 = _gb._playField.xMax;
}
if (_local11 < _gb._playField.yMin) {
_local11 = _gb._playField.yMin;
}
if (_local11 > _gb._playField.yMax) {
_local11 = _gb._playField.yMax;
}
moveTo(_local10, _local11);
if ((_mc._x < 0) || (_mc._x > 600)) {
moveTo(_mc._x - _vx, _mc._y);
_speed = 0.5;
}
if ((_mc._y < 0) || (_mc._y > 400)) {
moveTo(_mc._x, _mc._y - _vy);
_speed = 0.5;
}
_enemyIsClose = false;
}
function fixBounds() {
var _local2 = {};
_local2.x = _mc._x;
_local2.y = _mc._y;
switch (Standard.Geometry.Rect.GetOutcode(_local2, _gb._playField)) {
case 1 :
_vy = 2;
break;
case 2 :
_vx = -2;
break;
case 4 :
_vy = -2;
break;
case 8 :
_vx = 2;
}
}
function outOfBounds(x, y) {
var _local2 = Standard.Geometry.Rect.pointWithin(x, y, _gb._playField);
if (_local2 == false) {
return(true);
}
return(false);
}
function updateDirection(animkey) {
var _local3;
var _local2 = 90 + (57.29583 * _angle);
if (_local2 < 0) {
_local2 = _local2 + 360;
}
_local2 = _local2 % 360;
if (_local2 < 25) {
_local3 = "n";
} else if (_local2 < 65) {
_local3 = "ne";
} else if (_local2 < 115) {
_local3 = "e";
} else if (_local2 < 160) {
_local3 = "se";
} else if (_local2 < 205) {
_local3 = "s";
} else if (_local2 < 250) {
_local3 = "sw";
} else if (_local2 < 295) {
_local3 = "w";
} else if (_local2 < 335) {
_local3 = "nw";
} else {
_local3 = "n";
}
if (_local3 != _dir) {
_dir = _local3;
var _local4 = _spriteController.PlayAnimation(_dir + animkey);
_mc.gotoAndStop(_local4);
}
}
function getPos() {
return({x:_mc._x, y:_mc._y});
}
function GetStateMachine(Void) {
return(_fsm);
}
function knockback(ang) {
_vx = _speed * Math.cos(ang);
_vy = _speed * Math.cos(ang);
var _local2 = _mc._x + _vx;
var _local3 = _mc._y + _vy;
if (_local2 < _gb._playField.xMin) {
_local2 = _gb._playField.xMin;
_speed = 0;
}
if (_local2 > _gb._playField.xMax) {
_local2 = _gb._playField.xMax;
_speed = 0;
}
if (_local3 < _gb._playField.yMin) {
_local3 = _gb._playField.yMin;
_speed = 0;
}
if (_local3 > _gb._playField.yMax) {
_local3 = _gb._playField.yMax;
_speed = 0;
}
moveTo(_local2, _local3);
}
function checkTarget() {
var _local6 = _targ._mc._x - _mc._x;
var _local7 = _targ._mc._y - _mc._y;
if (((_local6 * _local6) + (_local7 * _local7)) > 40000) {
var _local5 = _gb._enemyList.length;
while (_local5--) {
var _local2 = _gb._enemyList[_local5];
var _local3 = _local2._mc._x - _mc._x;
var _local4 = _local2._mc._y - _mc._y;
if (((_local3 * _local3) + (_local4 * _local4)) > 40000) {
_targ = _local2;
return(undefined);
}
}
}
}
function STATE_Global_Message(oMsg) {
}
function STATE_Init_Update(Void) {
_fsm.SetState(_INIT_STATE);
}
function STATE_Init_Exit(Void) {
}
function STATE_Idle_Enter(Void) {
_spriteController.PlayAnimation("idle");
_mc.gotoAndStop(_spriteController.Update());
}
function STATE_Idle_Update(Void) {
_mc.gotoAndStop(_spriteController.Update());
}
function STATE_Idle_Message(oMsg) {
}
function STATE_Idle_Exit(Void) {
}
function STATE_Chasing_Enter(Void) {
_ZOMBIE = true;
_angle = 0;
updateDirection("_run");
var _local2 = _spriteController.PlayAnimation(_dir + "_run");
_mc.gotoAndStop(_local2);
_seekTimer = 0;
}
function STATE_Chasing_Update(Void) {
_seekTimer++;
if (_seekTimer > 100) {
checkTarget();
_seekTimer = 0;
}
chase();
updateDirection("_run");
_mc.gotoAndStop(_spriteController.Update());
}
function STATE_Chasing_Message(oMsg) {
switch (oMsg.GetMsgName()) {
case _global.MSG_BulletHit :
_fsm.SetState(STATE_STUN1);
break;
case _global.MSG_Unzombify :
_fsm.SetState(STATE_UNZOMBIFY);
break;
case _global.MSG_Run :
_targ = _gb._hero;
_fsm.SetState(STATE_KNOCKBACK);
}
}
function STATE_Chasing_Exit(Void) {
}
function STATE_TargetCaught_Enter(Void) {
if (_mc._x < _targ._mc._x) {
moveTo(_targ._mc._x - 40, _targ._mc._y);
_mc._xscale = 100;
} else {
moveTo(_targ._mc._x + 40, _targ._mc._y);
_mc._xscale = -100;
}
var _local2 = 1 + random(3);
_gb._soundModule.PlaySound(("zombie_grabs_you" + _local2) + ".wav", 70);
var _local3 = _spriteController.PlayAnimation("struggle");
_mc.gotoAndStop(_local3);
}
function STATE_TargetCaught_Update(Void) {
_mc.gotoAndStop(_spriteController.Update());
}
function STATE_TargetCaught_Message(oMsg) {
if (!(oMsg.GetMsgName() === _global.MSG_Run)) {
} else {
_targ = _gb._hero;
_fsm.SetState(STATE_KNOCKBACK);
}
}
function STATE_TargetCaught_Exit(Void) {
_mc._xscale = 100;
}
function STATE_Knockback_Enter(Void) {
_ZOMBIE = true;
_angle = 0;
updateDirection("_run");
var _local2 = _spriteController.PlayAnimation(_dir + "_run");
_mc.gotoAndStop(_local2);
_knockbackFrameCount = 0;
_speed = -7;
}
function STATE_Knockback_Update(Void) {
var _local2 = _targ._mc._x - _mc._x;
var _local3 = _targ._mc._y - _mc._y;
var _local4 = Math.atan2(_local3, _local2);
var _local5 = Math.sqrt((_local2 * _local2) + (_local3 * _local3));
if ((_local5 < 75) && (_knockbackFrameCount < 18)) {
knockback(_local4);
_knockbackFrameCount++;
} else {
_targ = _gb._hero;
_fsm.SetState(STATE_CHASING);
return(undefined);
}
if (_speed == 0) {
_fsm.SetState(STATE_STUN3);
_angle = _local4;
return(undefined);
}
updateDirection("_run");
_mc.gotoAndStop(_spriteController.Update());
}
function STATE_Knockback_Message(oMsg) {
}
function STATE_Knockback_Exit(Void) {
}
function STATE_Stun1_Enter(Void) {
_spriteController.PlayAnimation("daze1");
_mc.gotoAndStop(_spriteController.Update());
if (_mc._x > _gb._hero._mc._x) {
_mc._xscale = -100;
} else {
_mc._xscale = 100;
}
_stunTimer = 20;
_speed = -5;
var _local2 = _gb._hero._mc._x - _mc._x;
var _local3 = _gb._hero._mc._y - _mc._y;
_angle = Math.atan2(_local3, _local2);
}
function STATE_Stun1_Update(Void) {
_vx = _speed * Math.cos(_angle);
_vy = _speed * Math.sin(_angle);
var _local2 = _mc._x + _vx;
var _local3 = _mc._y + _vy;
if (_local2 < _gb._playField.xMin) {
_local2 = _gb._playField.xMin;
}
if (_local2 > _gb._playField.xMax) {
_local2 = _gb._playField.xMax;
}
if (_local3 < _gb._playField.yMin) {
_local3 = _gb._playField.yMin;
}
if (_local3 > _gb._playField.yMax) {
_local3 = _gb._playField.yMax;
}
moveTo(_local2, _local3);
_mc.gotoAndStop(_spriteController.Update());
_stunTimer--;
if (_stunTimer <= 0) {
_speed = 0;
_targ = _gb._hero;
var _local4 = _gb._hero._mc._x - _mc._x;
var _local5 = _gb._hero._mc._y - _mc._y;
_angle = Math.atan2(_local5, _local4);
_fsm.SetState(STATE_CHASING);
return(undefined);
}
}
function STATE_Stun1_Message(oMsg) {
switch (oMsg.GetMsgName()) {
case _global.MSG_Run :
_targ = _gb._hero;
_fsm.SetState(STATE_CHASING);
break;
case _global.MSG_BulletHit :
_fsm.SetState(STATE_STUN2);
break;
case _global.MSG_Unzombify :
_fsm.SetState(STATE_UNZOMBIFY);
}
}
function STATE_Stun1_Exit(Void) {
_mc._xscale = 100;
}
function STATE_Stun2_Enter(Void) {
_speed = 0;
_fsm.SendDelayedMsg(3, _global.MSG_Run2, this);
_spriteController.PlayAnimation("daze2");
_mc.gotoAndStop(_spriteController.Update());
if (_mc._x > _gb._hero._mc._x) {
_mc._xscale = -100;
} else {
_mc._xscale = 100;
}
}
function STATE_Stun2_Update(Void) {
_mc.gotoAndStop(_spriteController.Update());
}
function STATE_Stun2_Message(oMsg) {
switch (oMsg.GetMsgName()) {
case _global.MSG_Run2 :
_fsm.SetState(STATE_CHASING);
break;
case _global.MSG_BulletHit :
_fsm.SetState(STATE_STUN3);
break;
case _global.MSG_Unzombify :
_fsm.SetState(STATE_UNZOMBIFY);
}
}
function STATE_Stun2_Exit(Void) {
_mc._xscale = 100;
}
function STATE_Stun3_Enter(Void) {
_fsm.SendDelayedMsg(2, _global.MSG_Run3, this);
_spriteController.PlayAnimation("daze3_loop");
_mc.gotoAndStop(_spriteController.Update());
if (_mc._x > _gb._hero._mc._x) {
_mc._xscale = -100;
} else {
_mc._xscale = 100;
}
}
function STATE_Stun3_Update(Void) {
_mc.gotoAndStop(_spriteController.Update());
}
function STATE_Stun3_Message(oMsg) {
switch (oMsg.GetMsgName()) {
case _global.MSG_Run3 :
_fsm.SetState(STATE_CHASING);
break;
case _global.MSG_Unzombify :
_fsm.SetState(STATE_UNZOMBIFY);
}
}
function STATE_Stun3_Exit(Void) {
_mc._xscale = 100;
}
function STATE_Unzombify_Enter(oMsg) {
var _local2 = _spriteController.PlayAnimation("unzombify");
_ZOMBIE = false;
_vx = (_vy = (_speed = 0));
_gb.updateOpList();
_gb._soundModule.PlaySound("transform_sequence_operative.wav");
}
function STATE_Unzombify_Update(oMsg) {
_mc.gotoAndStop(_spriteController.Update());
if (_spriteController.AnimationComplete()) {
_fsm.SetState(STATE_OPERATIVE_FLEE);
}
}
function STATE_Unzombify_Message(oMsg) {
}
function STATE_Unzombify_Exit(oMsg) {
_gb._soundModule.PlaySound("transform_into_operative.wav");
}
function STATE_Zombify_Enter(oMsg) {
var _local2 = _spriteController.PlayAnimation("zombify");
_ZOMBIE = true;
_vx = (_vy = (_speed = 0));
_gb.updateOpList();
getNewTarget();
_gb._soundModule.PlaySound("transform_sequence_zombie.wav");
}
function STATE_Zombify_Update(oMsg) {
_mc.gotoAndStop(_spriteController.Update());
if (_spriteController.AnimationComplete()) {
_fsm.SetState(STATE_CHASING);
}
}
function STATE_Zombify_Message(oMsg) {
}
function STATE_Zombify_Exit(oMsg) {
_gb._soundModule.PlaySound("transform_into_zombie.wav");
}
function STATE_OperativeFlee_Enter(Void) {
_speed = 0;
_angle = 90;
flee();
updateDirection("_run_op");
_mc.gotoAndStop(_spriteController.Update());
}
function STATE_OperativeFlee_Update(Void) {
flee();
if (_speed > 0) {
updateDirection("_run_op");
_mc._xscale = 100;
} else {
_angle = _angle - 3.14159;
updateDirection("_idle");
if (_mc._x < 300) {
_mc._xscale = 100;
} else {
_mc._xscale = -100;
}
}
_mc.gotoAndStop(_spriteController.Update());
}
function STATE_OperativeFlee_Message(oMsg) {
if (!(oMsg.GetMsgName() === _global.MSG_TargetCaught)) {
} else {
_fsm.SetState(STATE_ZOMBIFY);
}
}
function STATE_OperativeFlee_Exit(Void) {
}
function STATE_Wander_Enter(Void) {
_wanderTime = 20;
_angle = Math.floor(Math.random() * 360);
_angle = (_angle - 90) * 0.01744444;
}
function STATE_Wander_Update(Void) {
if (_wanderTime > 0) {
_wanderTime = _wanderTime - 1;
_speed = _speed + _acc;
if (_speed > _maxFleeSpeed) {
_speed = _maxFleeSpeed;
}
_vx = _speed * Math.cos(_angle);
_vy = _speed * Math.sin(_angle);
var _local2 = _mc._x + _vx;
var _local3 = _mc._y + _vy;
if (_local2 < _gb._playField.xMin) {
_local2 = _gb._playField.xMin;
}
if (_local2 > _gb._playField.xMax) {
_local2 = _gb._playField.xMax;
}
if (_local3 < _gb._playField.yMin) {
_local3 = _gb._playField.yMin;
}
if (_local3 > _gb._playField.yMax) {
_local3 = _gb._playField.yMax;
}
moveTo(_local2, _local3);
updateDirection("_run");
_mc.gotoAndStop(_spriteController.Update());
return(undefined);
}
if (_gb._enemyGrabSide == 3) {
_wanderTime = 20;
_angle = Math.floor(Math.random() * 360);
_angle = (_angle - 90) * 0.01744444;
return(undefined);
}
_fsm.SetState(STATE_CHASING);
}
function STATE_Wander_Message(oMsg) {
if (!(oMsg.GetMsgName() === _global.MSG_Run)) {
} else {
_targ = _gb._hero;
_fsm.SetState(STATE_KNOCKBACK);
}
}
function STATE_Wander_Exit(Void) {
}
function toString() {
return("Enemy()");
}
var _acc = 0.3;
var _maxFleeSpeed = 4;
var _proximityRange = 200;
var _dir = "e";
var STATE_GLOBAL = 0;
var STATE_INIT = 1;
var STATE_IDLE = 2;
var STATE_CHASING = 3;
var STATE_TARGET_CAUGHT = 4;
var STATE_STUN1 = 5;
var STATE_STUN2 = 6;
var STATE_STUN3 = 7;
var STATE_UNZOMBIFY = 8;
var STATE_ZOMBIFY = 9;
var STATE_OPERATIVE_FLEE = 10;
var STATE_KNOCKBACK = 11;
var STATE_WANDER = 12;
var _INIT_STATE = Enemy.prototype.STATE_CHASING;
var _cRad = 20;
var _collOffsetX = 0;
var _collOffsetY = -20;
var dx = 0;
var dy = 0;
var _flank = 0;
var _stunTimer = 20;
}
Symbol 1661 MovieClip [__Packages.Zombie] Frame 0
class Zombie extends Enemy
{
var _animKey, _spriteController, _fsm, STATE_INIT, _vx, _vy, _vr, _angle, _speed, _speedMax, _agil, _dir, _spawnX, _spawnY, _mc, _idx;
function Zombie (gb, mc, seekTarget, idx, enemyList) {
super(gb, mc, seekTarget, idx, enemyList);
_animKey = {n_idle:{frames:[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3], loop:true}, e_idle:{frames:[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3], loop:true}, s_idle:{frames:[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3], loop:true}, w_idle:{frames:[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3], loop:true}, ne_idle:{frames:[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3], loop:true}, se_idle:{frames:[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3], loop:true}, sw_idle:{frames:[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3], loop:true}, nw_idle:{frames:[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3], loop:true}, w_run:{frames:[162, 163, 164, 165, 166, 167, 168, 169, 170, 171], loop:true}, e_run:{frames:[150, 151, 152, 153, 154, 155, 156, 157, 158, 159], loop:true}, n_run:{frames:[175, 176, 177, 178, 179, 180, 181, 182], loop:true}, s_run:{frames:[142, 143, 144, 145, 146, 147, 148, 149], loop:true}, ne_run:{frames:[150, 151, 152, 153, 154, 155, 156, 157, 158, 159], loop:true}, se_run:{frames:[150, 151, 152, 153, 154, 155, 156, 157, 158, 159], loop:true}, nw_run:{frames:[162, 163, 164, 165, 166, 167, 168, 169, 170, 171], loop:true}, sw_run:{frames:[162, 163, 164, 165, 166, 167, 168, 169, 170, 171], loop:true}, w_run_op:{frames:[30, 31, 32, 33, 34, 35, 36, 37], loop:true}, e_run_op:{frames:[17, 18, 19, 20, 21, 22, 23, 24], loop:true}, n_run_op:{frames:[53, 54, 55, 56, 57, 58, 59, 60], loop:true}, s_run_op:{frames:[45, 46, 47, 48, 49, 50, 51, 52], loop:true}, ne_run_op:{frames:[17, 18, 19, 20, 21, 22, 23, 24], loop:true}, se_run_op:{frames:[17, 18, 19, 20, 21, 22, 23, 24], loop:true}, nw_run_op:{frames:[30, 31, 32, 33, 34, 35, 36, 37], loop:true}, sw_run_op:{frames:[30, 31, 32, 33, 34, 35, 36, 37], loop:true}, unzombify:{frames:[108, 107, 106, 105, 104, 103, 102, 101, 100, 99, 98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80, 79, 78, 77, 76, 75, 74, 73, 72, 71, 70, 69, 68, 67, 66, 65, 64, 63, 62, 61, 1], loop:false}, zombify:{frames:[61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108], loop:false}, struggle:{frames:[132, 133, 134, 135, 136, 137, 138, 139, 140, 141], loop:false}, daze1:{frames:[183, 184, 185, 186, 187, 188, 189], loop:true}, daze2:{frames:[190, 191, 192, 193, 194, 195, 196, 197, 198, 199], loop:true}, daze3_start:{frames:[200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218], loop:false}, daze3_loop:{frames:[219, 220], loop:true}};
_spriteController.SetKey(_animKey);
}
function init(x, y) {
_fsm.SetState(STATE_INIT);
_vx = 0;
_vy = 0;
_vr = 0;
_angle = 0;
_speed = 0;
_speedMax = 0.2 + (0.5 * Math.random());
_agil = 1;
_dir = "s";
_spawnX = x;
_spawnY = y;
_mc._x = x;
_mc._y = y;
var _local3 = 200 + ((_mc._y * 1000) + _idx);
_mc.swapDepths(_local3);
var _local2 = _spriteController.PlayAnimation(_dir + "_run");
_mc.gotoAndStop(_local2);
}
function toString() {
return("Zombie()");
}
}
Symbol 1662 MovieClip [__Packages.Boss_362] Frame 0
class Boss_362
{
var _gb, _mc, _jumpInterval, _healthBarMC, _health, _spriteController, _animKey, _states, _fsm, _collObj, _x0, _y0, _vx, _vy, _jumpGoalX, _jumpGoalY;
function Boss_362 (gb, mc, idx) {
trace("Class.........Boss_362");
_gb = gb;
_mc = mc;
_jumpInterval = {};
_healthBarMC = _gb.attachMovie("bossBar", "bossBar", 20000);
_health = _healthMax;
hideHealthBar();
_spriteController = new Standard.SpriteController();
_animKey = {idle:{frames:[1], loop:false}, hit:{frames:[78, 79, 80, 81, 82, 83, 84], loop:false}, spin1_start:{frames:[14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 34, 35, 34, 35, 34, 35, 34, 35], loop:false}, spin1_loop:{frames:[36, 37], loop:true}, jump:{frames:[39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58], loop:true}, spin2_start:{frames:[59, 60, 61, 62], loop:false}, spin2_loop:{frames:[63, 64, 65], loop:true}, signthrow:{frames:[66, 66, 66, 67, 67, 67, 68, 68, 68, 69, 69, 69, 70, 70, 70, 71, 71, 71, 72, 72, 72, 73, 73, 73, 74, 74, 74, 75, 75, 75, 76, 76, 76, 77, 77, 77, 78, 78, 78, 79, 79, 79, 80, 80, 80, 81, 81, 81, 82, 82, 82, 83, 83, 83, 84, 84, 84, 85, 85, 85, 86, 86, 86, 87, 87, 87, 88, 88, 88, 89, 89, 89, 90, 90, 90, 91, 91, 91, 92, 92, 92, 93, 93, 93, 94, 94, 94, 95, 95, 95, 96, 96, 96, 97, 97, 97, 98, 98, 98, 99, 99, 99, 100, 100, 100, 101, 101, 101, 102, 102, 102, 103, 103, 103, 104, 104, 104], loop:false}, dizzy:{frames:[105, 105, 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, 120, 120, 121, 121, 122, 122, 123, 123, 124, 124, 125, 125], loop:false}, dead:{frames:[131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196], loop:false}};
_spriteController.SetKey(_animKey);
_states = ["STATE_Global", "STATE_Init", "STATE_Idle", "STATE_Spin1Start", "STATE_Spin1Loop", "STATE_Jump", "STATE_Spin2Start", "STATE_Spin2Loop", "STATE_Throw", "STATE_ThrowJump", "STATE_Dizzy", "STATE_Dead"];
_fsm = new Standard.Simple_FSM(this, _states, _gb._time, _gb._msgRoute);
_collObj = new Standard.Geometry.Circle(_mc._x + _collOffsetX, _mc._y + _collOffsetY, _cRad);
}
function init(x0, y0) {
_fsm.SetState(STATE_INIT);
_x0 = x0;
_y0 = y0;
moveTo(x0, y0);
var _local3 = 200 + (_mc._y * 1000);
_mc.swapDepths(_local3);
var _local2 = _spriteController.PlayAnimation("idle");
_mc.gotoAndStop(_local2);
_vx = 15;
_vy = 15;
jumpInit();
}
function update() {
var _local2 = 200 + (_mc._y * 1000);
_mc.swapDepths(_local2);
_fsm.Update();
}
function GetStateMachine(Void) {
return(_fsm);
}
function flashSprite() {
var _local3 = new flash.geom.ColorTransform(1, 1, 1, 1, 0, -200, -200, 0);
var _local4 = new flash.geom.Transform(_mc);
_local4.colorTransform = _local3;
_global.setTimeout(this, "restoreSprite", 150);
}
function restoreSprite() {
var _local2 = new flash.geom.ColorTransform(1, 1, 1, 1, 0, 0, 0, 0);
var _local3 = new flash.geom.Transform(_mc);
_local3.colorTransform = _local2;
}
function bounce() {
if (((_mc._x + _vx) < _gb._playField.xMin) || ((_mc._x + _vx) > _gb._playField.xMax)) {
_vx = (-_vx) - random(3);
}
if (((_mc._y + _vy) < _gb._playField.yMin) || ((_mc._y + _vy) > _gb._playField.yMax)) {
_vy = (-_vy) - random(3);
}
moveXY(_vx, _vy);
}
function getCollObject() {
return(_collObj);
}
function knockback() {
_vy = -1;
}
function moveXY(dx, dy) {
moveTo(_mc._x + dx, _mc._y + dy);
}
function moveTo(x, y) {
if (y > 450) {
y = 0;
}
_mc._x = x;
_mc._y = y;
_collObj.setPos(_mc._x + _collOffsetX, _mc._y + _collOffsetY);
}
function setMCDir(sDir) {
if (sDir == "w") {
_mc._xscale = 100;
} else {
_mc._xscale = -100;
}
}
function jumpInit() {
_jumpGoalX = 540;
_jumpGoalY = 100;
setMCDir("w");
}
function jumpStart() {
_vx = (_jumpGoalX - _mc._x) / _jumpFramesTotal;
_vy = (_jumpGoalY - _mc._y) / _jumpFramesTotal;
_jumpFrameCount = 0;
_vz = 10;
_gb._soundModule.PlaySound("toilenator_jump.wav", 60);
}
function jumpTween() {
_jumpFrameCount++;
moveXY(_vx, _vy - _vz);
if (_jumpFrameCount == _jumpFramesTotal) {
_mc._x = _jumpGoalX;
_mc._y = _jumpGoalY;
_fsm.SendMsg(_global.MSG_NextState, this);
}
_vz = _vz - 1;
if (_vz < 0) {
_vz = 0;
}
}
function zoomStart() {
var _local2 = [60, 540];
if (_jumpGoalX == _local2[0]) {
_jumpGoalX = _local2[1];
_mc._xscale = -100;
} else {
_jumpGoalX = _local2[0];
_mc._xscale = 100;
}
_vx = (_jumpGoalX - _mc._x) / _jumpFramesTotal;
_vy = (_jumpGoalY - _mc._y) / _jumpFramesTotal;
_jumpFrameCount = 0;
}
function zoomTween() {
_jumpFrameCount++;
moveXY(_vx, _vy - Math.sin((180 * _jumpFrameCount) / _jumpFramesTotal));
if (_jumpFrameCount == _jumpFramesTotal) {
_mc._x = _jumpGoalX;
_mc._y = _jumpGoalY;
if (_mc._y > 300) {
_fsm.SendMsg(_global.MSG_Stop, this);
} else {
_fsm.SendMsg(_global.MSG_NextState, this);
}
}
_vz = _vz - 1;
}
function checkCollision() {
if (!_gb._hero.getCollEnabled()) {
return(undefined);
}
var _local5 = _gb._hero._mc;
var _local3 = _local5._x;
var _local4 = _local5._y;
if (((_mc.hitArea.hitTest(_local3, _local4, true) || (_mc.hitArea.hitTest(_local3, _local4 - 38, true))) || (_mc.hitArea.hitTest(_local3 - 14, _local4 - 19, true))) || (_mc.hitArea.hitTest(_local3 + 14, _local4 - 19, true))) {
_fsm.SendMsg(_global.MSG_Hit, _gb._hero);
_fsm.SendMsg(_global.MSG_TargetCaught, this);
_heroHit = true;
}
}
function checkSignCollision() {
if (!_gb._hero.getCollEnabled()) {
return(undefined);
}
var _local3 = _gb._hero._mc;
if (_mc.sign_mc.hitArea.hitTest(_local3.hitArea)) {
_fsm.SendMsg(_global.MSG_Hit, _gb._hero);
}
}
function isDead() {
return(Boolean(_health <= 0));
}
function updateHealthBar() {
if (_health <= 0) {
return(undefined);
}
_healthBarMC._visible = true;
_healthBarMC._x = _mc._x;
_healthBarMC._y = _mc._y - 50;
_healthBarMC.gotoAndStop(Math.floor((100 * _health) / _healthMax));
_global.setTimeout(this, "hideHealthBar", 300);
}
function hideHealthBar() {
_healthBarMC._visible = false;
}
function takeDamage(n) {
flashSprite();
_health = _health - n;
updateHealthBar();
if (isDead()) {
_fsm.SetState(STATE_DEAD);
}
}
function STATE_Global_Message(oMsg) {
}
function STATE_Init_Update(Void) {
_fsm.SetState(_INIT_STATE);
}
function STATE_Init_Exit(Void) {
}
function STATE_Spin1Start_Enter() {
_heroHit = false;
_vx = -10;
_vy = 10;
var _local2 = _spriteController.PlayAnimation("spin1_start");
_mc.gotoAndStop(_local2);
}
function STATE_Spin1Start_Update() {
_mc.gotoAndStop(_spriteController.Update());
if (_spriteController.AnimationComplete()) {
_fsm.SetState(STATE_SPIN1_LOOP);
}
}
function STATE_Spin1Start_Message(oMsg) {
}
function STATE_Spin1Start_Exit() {
}
function STATE_Spin1Loop_Enter() {
_fsm.SendDelayedMsgToMe(10, _global.MSG_Stop);
var _local3 = _spriteController.PlayAnimation("spin1_loop");
_mc.gotoAndStop(_local3);
_gb._soundModule.PlaySound("362_wind_loop.wav", 100, 0, 0, 9999);
}
function STATE_Spin1Loop_Update() {
bounce();
checkCollision();
_mc.gotoAndStop(_spriteController.Update());
}
function STATE_Spin1Loop_Message(oMsg) {
switch (oMsg.GetMsgName()) {
case _global.MSG_Stop :
_fsm.SetState(STATE_DIZZY);
break;
case _global.MSG_TargetCaught :
_fsm.SetState(STATE_JUMP);
}
}
function STATE_Spin1Loop_Exit() {
_gb._soundModule.StopSound("362_wind_loop.wav");
}
function STATE_Spin2Start_Enter() {
_heroHit = false;
zoomStart();
var _local2 = _spriteController.PlayAnimation("spin2_start");
_mc.gotoAndStop(_local2);
}
function STATE_Spin2Start_Update() {
_mc.gotoAndStop(_spriteController.Update());
if (_spriteController.AnimationComplete()) {
_fsm.SetState(STATE_SPIN2_LOOP);
}
}
function STATE_Spin2Start_Message(oMsg) {
}
function STATE_Spin2Start_Exit() {
}
function STATE_Spin2Loop_Enter() {
var _local2 = _spriteController.PlayAnimation("spin2_loop");
_mc.gotoAndStop(_local2);
_gb._soundModule.PlaySound("362_wind_loop.wav", 100, 0, 0, 9999);
}
function STATE_Spin2Loop_Update() {
zoomTween();
checkCollision();
_mc.gotoAndStop(_spriteController.Update());
}
function STATE_Spin2Loop_Message(oMsg) {
switch (oMsg.GetMsgName()) {
case _global.MSG_Stop :
_fsm.SetState(STATE_THROWJUMP);
break;
case _global.MSG_NextState :
_jumpGoalY = _jumpGoalY + 75;
_fsm.SetState(STATE_JUMP);
break;
case _global.MSG_TargetCaught :
_fsm.SetState(STATE_THROWJUMP);
}
}
function STATE_Spin2Loop_Exit() {
_gb._soundModule.StopSound("362_wind_loop.wav");
}
function STATE_Jump_Enter() {
jumpStart();
var _local2 = _spriteController.PlayAnimation("jump");
_mc.gotoAndStop(_local2);
}
function STATE_Jump_Update() {
_mc.gotoAndStop(_spriteController.Update());
jumpTween();
checkCollision();
}
function STATE_Jump_Message(oMsg) {
if (!(oMsg.GetMsgName() === _global.MSG_NextState)) {
} else {
_fsm.SetState(STATE_SPIN2_START);
}
}
function STATE_Jump_Exit() {
}
function STATE_Dizzy_Enter() {
_fsm.SendDelayedMsgToMe(4, _global.MSG_Run);
var _local3 = _spriteController.PlayAnimation("dizzy");
_mc.gotoAndStop(_local3);
}
function STATE_Dizzy_Update() {
_mc.gotoAndStop(_spriteController.Update());
}
function STATE_Dizzy_Message(oMsg) {
switch (oMsg.GetMsgName()) {
case _global.MSG_Run :
_fsm.SetState(STATE_JUMP);
break;
case _global.MSG_BulletHit :
takeDamage(5);
break;
case _global.MSG_Unzombify :
takeDamage(10);
}
}
function STATE_Dizzy_Exit() {
}
function STATE_ThrowJump_Enter() {
_jumpGoalX = 300;
_jumpGoalY = 100;
jumpStart();
var _local2 = _spriteController.PlayAnimation("jump");
_mc.gotoAndStop(_local2);
}
function STATE_ThrowJump_Update() {
_mc.gotoAndStop(_spriteController.Update());
jumpTween();
checkCollision();
}
function STATE_ThrowJump_Message(oMsg) {
if (!(oMsg.GetMsgName() === _global.MSG_NextState)) {
} else {
_fsm.SetState(STATE_THROW);
}
}
function STATE_ThrowJump_Exit() {
}
function STATE_Throw_Enter() {
var _local2 = _spriteController.PlayAnimation("signthrow");
_mc.gotoAndStop(_local2);
}
function STATE_Throw_Update() {
_mc.gotoAndStop(_spriteController.Update());
if (_spriteController.GetCurrentFrame() == 73) {
_gb._soundModule.PlaySound("362_swing_weapon.wav");
}
if (_spriteController.AnimationComplete()) {
_fsm.SendMsg(_global.MSG_NextState, this);
}
checkSignCollision();
}
function STATE_Throw_Message(oMsg) {
switch (oMsg.GetMsgName()) {
case _global.MSG_BulletHit :
takeDamage(5);
break;
case _global.MSG_Unzombify :
takeDamage(10);
break;
case _global.MSG_NextState :
jumpInit();
_fsm.SetState(STATE_SPIN1_START);
}
}
function STATE_Throw_Exit() {
}
function STATE_Dead_Enter() {
_mc.swapDepths(200);
_gb._soundModule.StopSound("362_wind_loop.wav");
_gb._soundModule.PlaySound("boss_death_snds.wav");
var _local2 = _spriteController.PlayAnimation("dead");
_mc.gotoAndStop(_local2);
}
function STATE_Dead_Update() {
_mc.gotoAndStop(_spriteController.Update());
}
function toString() {
return("Boss362()");
}
var STATE_GLOBAL = 0;
var STATE_INIT = 1;
var STATE_IDLE = 2;
var STATE_SPIN1_START = 3;
var STATE_SPIN1_LOOP = 4;
var STATE_JUMP = 5;
var STATE_SPIN2_START = 6;
var STATE_SPIN2_LOOP = 7;
var STATE_THROW = 8;
var STATE_THROWJUMP = 9;
var STATE_DIZZY = 10;
var STATE_DEAD = 11;
var _INIT_STATE = Boss_362.prototype.STATE_JUMP;
var _cRad = 10;
var _collOffsetX = 0;
var _collOffsetY = -20;
var _z = 0;
var _vz = 0;
var _jumpFramesTotal = 19;
var _jumpFrameCount = 0;
var _healthMax = 300;
var _heroHit = false;
}
Symbol 1663 MovieClip [__Packages.Boss_Toilenator] Frame 0
class Boss_Toilenator
{
var _gb, _mc, _jumpInterval, _healthBarMC, _health, _spriteController, _animKey, _states, _fsm, _collObj, _vy, _jumpGoalX, _jumpGoalY, _vx;
function Boss_Toilenator (gb, mc, idx) {
trace("Class.........Boss_Toilenator");
_gb = gb;
_mc = mc;
_jumpInterval = {};
_healthBarMC = _gb.attachMovie("bossBar", "bossBar", 20000);
_health = _healthMax;
hideHealthBar();
_spriteController = new Standard.SpriteController();
_animKey = {idle:{frames:[1, 1, 2, 2, 3, 3, 4, 4], loop:true}, attack_side_start:{frames:[20, 20, 21, 21, 22, 22, 23, 23, 23, 23, 23, 23], loop:false}, attack_side_loop:{frames:[24, 24, 25, 25, 26, 26, 27, 27], loop:true}, attack_front_start:{frames:[40, 40, 41, 41, 42, 42, 43, 43, 43, 43, 43, 43], loop:true}, attack_front_loop:{frames:[44, 44, 45, 45, 46, 46, 47, 47], loop:true}, attack_ceiling_start:{frames:[60], loop:false}, attack_ceiling_drop:{frames:[60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 69, 70, 70, 69, 69, 68, 68, 69, 69, 70, 70, 69, 69, 68, 68, 69, 69, 70, 70, 69, 69, 68, 68, 71, 72, 73, 60], loop:false}, attack_spin_start:{frames:[80, 80, 81, 81, 82, 82, 83, 83], loop:false}, attack_spin_loop:{frames:[84, 84, 84, 85, 85, 85, 86, 86, 86, 87, 87, 87, 88, 88, 88, 89, 89, 89, 90, 90, 90, 91, 91, 91, 92, 92, 92, 93, 93, 93, 94, 94, 94, 95, 95, 95, 96, 96, 96, 97, 97, 97, 98, 98, 98, 99, 99, 99, 100, 100, 100, 101, 101, 101, 102, 102, 102, 103, 103, 103, 104, 104, 104, 105, 105, 105, 106, 106, 106, 107, 107, 107, 84, 84, 84, 85, 85, 85, 86, 86, 86, 87, 87, 87, 88, 88, 88, 89, 89, 89, 90, 90, 90, 91, 91, 91, 92, 92, 92, 93, 93, 93, 94, 94, 94, 95, 95, 95, 96, 96, 96, 97, 97, 97, 98, 98, 98, 99, 99, 99, 100, 100, 100, 101, 101, 101, 102, 102, 102, 103, 103, 103, 104, 104, 104, 105, 105, 105, 106, 106, 106, 107, 107, 107], loop:true}, hit:{frames:[120], loop:false}, jump:{frames:[140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159], loop:false}, dead:{frames:[174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231], loop:false}};
_spriteController.SetKey(_animKey);
_states = ["STATE_Global", "STATE_Init", "STATE_Idle", "STATE_AttackSideStart", "STATE_AttackSideLoop", "STATE_AttackFrontStart", "STATE_AttackFrontLoop", "STATE_AttackCeilingStart", "STATE_AttackCeilingDrop", "STATE_AttackSpinStart", "STATE_AttackSpinLoop", "STATE_JumpHoriz", "STATE_JumpVert", "STATE_Dead"];
_fsm = new Standard.Simple_FSM(this, _states, _gb._time, _gb._msgRoute);
_collObj = new Standard.Geometry.Circle(_mc._x + _collOffsetX, _mc._y + _collOffsetY, _cRad);
}
function init(x, y) {
_fsm.SetState(STATE_INIT);
moveTo(x, y);
var _local3 = 200 + (_mc._y * 1000);
_mc.swapDepths(_local3);
var _local2 = _spriteController.PlayAnimation("idle");
_mc.gotoAndStop(_local2);
jumpInit();
}
function update() {
var _local2 = 200 + (_mc._y * 1000);
_mc.swapDepths(_local2);
_fsm.Update();
}
function GetStateMachine(Void) {
return(_fsm);
}
function follow() {
var _local2 = (_gb._hero._mc._x - _mc._x) / 8;
var _local3 = (_gb._hero._mc._y - _mc._y) / 8;
moveTo(_mc._x + _local2, _mc._y + _local3);
}
function getCollObject() {
return(_collObj);
}
function knockback() {
_vy = -1;
}
function moveXY(dx, dy) {
moveTo(_mc._x + dx, _mc._y + dy);
}
function moveTo(x, y) {
if (y > 450) {
y = 0;
}
_mc._x = x;
_mc._y = y;
_collObj.setPos(_mc._x + _collOffsetX, _mc._y + _collOffsetY);
}
function setMCDir(sDir) {
if (sDir == "w") {
_mc._xscale = 100;
} else {
_mc._xscale = -100;
}
}
function jumpInit() {
_jumpGoalX = 400;
_jumpGoalY = 110;
_vy = 0;
_vx = 10;
setMCDir("w");
}
function jumpStart(typ) {
var _local2 = [120, 260, 30, 500, 300];
var _local3 = [200, 340, 100, 240];
if (typ == "horiz") {
_jumpGoalX = _local2[_jumpCount];
_jumpGoalY = 110;
} else if (typ == "vert") {
_jumpGoalX = 300;
_jumpGoalY = _local3[_jumpCount];
}
_vx = (_jumpGoalX - _mc._x) / _jumpFramesTotal;
_vy = (_jumpGoalY - _mc._y) / _jumpFramesTotal;
_jumpFrameCount = 0;
_vz = 10;
_gb._soundModule.PlaySound("toilenator_jump.wav", 60);
}
function jumpTween() {
_jumpFrameCount++;
var _local3 = 10;
moveXY(_vx, _vy - _vz);
if (_jumpFrameCount == _jumpFramesTotal) {
moveTo(_jumpGoalX, _jumpGoalY);
_fsm.SendMsg(_global.MSG_NextState, this);
}
_vz = _vz - 1;
if (_vz < 0) {
_vz = 0;
}
}
function zoomStart() {
var _local2 = [60, 540];
if (_jumpGoalX == _local2[0]) {
_jumpGoalX = _local2[1];
_mc._xscale = -100;
} else {
_jumpGoalX = _local2[0];
_mc._xscale = 100;
}
_vx = (_jumpGoalX - _mc._x) / _jumpFramesTotal;
_vy = (_jumpGoalY - _mc._y) / _jumpFramesTotal;
_jumpFrameCount = 0;
}
function zoomTween() {
_jumpFrameCount++;
moveXY(_vx, _vy - Math.sin((180 * _jumpFrameCount) / _jumpFramesTotal));
if (_jumpFrameCount == _jumpFramesTotal) {
moveTo(_jumpGoalX, _jumpGoalY);
if (_mc._y > 300) {
_fsm.SendMsg(_global.MSG_Stop, this);
} else {
_fsm.SendMsg(_global.MSG_NextState, this);
}
}
_vz = _vz - 1;
}
function flashSprite() {
var _local3 = new flash.geom.ColorTransform(1, 1, 1, 1, 0, -200, -200, 0);
var _local4 = new flash.geom.Transform(_mc);
_local4.colorTransform = _local3;
_global.setTimeout(this, "restoreSprite", 150);
}
function restoreSprite() {
var _local2 = new flash.geom.ColorTransform(1, 1, 1, 1, 0, 0, 0, 0);
var _local3 = new flash.geom.Transform(_mc);
_local3.colorTransform = _local2;
}
function checkCollision() {
if (!_gb._hero.getCollEnabled()) {
return(undefined);
}
var _local5 = _gb._hero._mc;
var _local3 = _local5._x;
var _local4 = _local5._y;
if (((_mc.hitArea.hitTest(_local3, _local4, true) || (_mc.hitArea.hitTest(_local3, _local4 - 38, true))) || (_mc.hitArea.hitTest(_local3 - 14, _local4 - 19, true))) || (_mc.hitArea.hitTest(_local3 + 14, _local4 - 19, true))) {
_fsm.SendMsg(_global.MSG_Hit, _gb._hero);
_fsm.SendMsg(_global.MSG_TargetCaught, this);
_heroHit = true;
}
}
function checkTPCollision() {
if (!_gb._hero.getCollEnabled()) {
return(undefined);
}
var _local5 = _gb._hero._mc;
var _local3 = _local5._x;
var _local4 = _local5._y;
if (((_mc.tpHitArea.hitTest(_local3, _local4, true) || (_mc.tpHitArea.hitTest(_local3, _local4 - 38, true))) || (_mc.tpHitArea.hitTest(_local3 - 14, _local4 - 19, true))) || (_mc.tpHitArea.hitTest(_local3 + 14, _local4 - 19, true))) {
_fsm.SendMsg(_global.MSG_Hit, _gb._hero);
}
}
function isDead() {
return(Boolean(_health <= 0));
}
function updateHealthBar() {
if (_health <= 0) {
return(undefined);
}
_healthBarMC._visible = true;
_healthBarMC._x = _mc._x;
_healthBarMC._y = _mc._y - 60;
_healthBarMC.gotoAndStop(Math.floor((100 * _health) / _healthMax));
_global.setTimeout(this, "hideHealthBar", 300);
}
function hideHealthBar() {
_healthBarMC._visible = false;
}
function takeDamage(n) {
flashSprite();
_health = _health - n;
updateHealthBar();
if (isDead()) {
_fsm.SetState(STATE_DEAD);
}
}
function STATE_Global_Message(oMsg) {
}
function STATE_Init_Update(Void) {
_fsm.SetState(_INIT_STATE);
}
function STATE_Init_Exit(Void) {
}
function STATE_AttackFrontStart_Enter() {
var _local3 = _spriteController.PlayAnimation("attack_front_start");
_mc.gotoAndStop(_local3);
if (_jumpCount == 6) {
_jumpCount = 0;
_fsm.SendMsg(_global.MSG_NextState, this);
} else {
_fsm.SendDelayedMsgToMe(2, _global.MSG_Stop);
}
}
function STATE_AttackFrontStart_Update() {
checkCollision();
_mc.gotoAndStop(_spriteController.Update());
if (_spriteController.AnimationComplete()) {
_fsm.SetState(STATE_ATTACK_FRONT_LOOP);
}
}
function STATE_AttackFrontStart_Message(oMsg) {
switch (oMsg.GetMsgName()) {
case _global.MSG_NextState :
_fsm.SetState(STATE_ATTACK_SIDE_START);
break;
case _global.MSG_BulletHit :
takeDamage(5);
}
}
function STATE_AttackFrontStart_Exit() {
}
function STATE_AttackFrontLoop_Enter() {
var _local2 = _spriteController.PlayAnimation("attack_front_loop");
_mc.gotoAndStop(_local2);
_gb._soundModule.PlaySound("toilet_paper_loops.wav", 100, 0, 0, 9999);
}
function STATE_AttackFrontLoop_Update() {
_mc.gotoAndStop(_spriteController.Update());
checkTPCollision();
checkCollision();
}
function STATE_AttackFrontLoop_Message(oMsg) {
switch (oMsg.GetMsgName()) {
case _global.MSG_NextState :
_fsm.SetState(STATE_ATTACK_SIDE_START);
break;
case _global.MSG_Stop :
_fsm.SetState(STATE_JUMP_HORIZ);
break;
case _global.MSG_BulletHit :
takeDamage(5);
break;
case _global.MSG_Unzombify :
takeDamage(10);
}
}
function STATE_AttackFrontLoop_Exit() {
_gb._soundModule.StopSound("toilet_paper_loops.wav");
}
function STATE_AttackSideStart_Enter() {
var _local3 = _spriteController.PlayAnimation("attack_side_start");
_mc.gotoAndStop(_local3);
if (_jumpCount == 4) {
_jumpCount = 0;
_fsm.SendMsg(_global.MSG_NextState, this);
} else {
_fsm.SendDelayedMsgToMe(2, _global.MSG_Stop);
}
}
function STATE_AttackSideStart_Update() {
checkCollision();
_mc.gotoAndStop(_spriteController.Update());
if (_spriteController.AnimationComplete()) {
_fsm.SetState(STATE_ATTACK_SIDE_LOOP);
}
}
function STATE_AttackSideStart_Message(oMsg) {
switch (oMsg.GetMsgName()) {
case _global.MSG_NextState :
_fsm.SetState(STATE_ATTACK_SPIN_START);
break;
case _global.MSG_BulletHit :
takeDamage(5);
}
}
function STATE_AttackSideStart_Exit() {
}
function STATE_AttackSideLoop_Enter() {
var _local2 = _spriteController.PlayAnimation("attack_side_loop");
_mc.gotoAndStop(_local2);
_gb._soundModule.PlaySound("toilet_paper_loops.wav", 100, 0, 0, 9999);
}
function STATE_AttackSideLoop_Update() {
_mc.gotoAndStop(_spriteController.Update());
checkTPCollision();
checkCollision();
}
function STATE_AttackSideLoop_Message(oMsg) {
switch (oMsg.GetMsgName()) {
case _global.MSG_NextState :
_fsm.SetState(STATE_ATTACK_SIDE_START);
break;
case _global.MSG_Stop :
_fsm.SetState(STATE_JUMP_VERT);
break;
case _global.MSG_BulletHit :
takeDamage(5);
break;
case _global.MSG_Unzombify :
takeDamage(10);
}
}
function STATE_AttackSideLoop_Exit() {
_gb._soundModule.StopSound("toilet_paper_loops.wav");
}
function STATE_AttackSpinStart_Enter() {
var _local2 = _spriteController.PlayAnimation("attack_spin_start");
_mc.gotoAndStop(_local2);
}
function STATE_AttackSpinStart_Update() {
checkCollision();
_mc.gotoAndStop(_spriteController.Update());
if (_spriteController.AnimationComplete()) {
_fsm.SetState(STATE_ATTACK_SPIN_LOOP);
}
}
function STATE_AttackSpinStart_Message(oMsg) {
}
function STATE_AttackSpinStart_Exit() {
}
function STATE_AttackSpinLoop_Enter() {
var _local2 = _spriteController.PlayAnimation("attack_spin_loop");
_mc.gotoAndStop(_local2);
_gb._soundModule.PlaySound("toilet_paper_loops.wav", 100, 0, 0, 9999);
}
function STATE_AttackSpinLoop_Update() {
checkTPCollision();
checkCollision();
_mc.gotoAndStop(_spriteController.Update());
if (_spriteController.AnimationComplete()) {
_fsm.SendMsg(_global.MSG_NextState, this);
}
}
function STATE_AttackSpinLoop_Message(oMsg) {
switch (oMsg.GetMsgName()) {
case _global.MSG_NextState :
_fsm.SetState(STATE_ATTACK_CEILING_START);
break;
case _global.MSG_BulletHit :
takeDamage(5);
break;
case _global.MSG_Unzombify :
takeDamage(10);
}
}
function STATE_AttackSpinLoop_Exit() {
_gb._soundModule.StopSound("toilet_paper_loops.wav");
}
function STATE_AttackCeilingStart_Enter() {
var _local3 = _spriteController.PlayAnimation("attack_ceiling_start");
_mc.gotoAndStop(_local3);
_fsm.SendDelayedMsgToMe(5, _global.MSG_Run);
}
function STATE_AttackCeilingStart_Update() {
follow();
_mc.gotoAndStop(_spriteController.Update());
}
function STATE_AttackCeilingStart_Message(oMsg) {
if (!(oMsg.GetMsgName() === _global.MSG_Run)) {
} else {
_fsm.SetState(STATE_ATTACK_CEILING_DROP);
}
}
function STATE_AttackCeilingStart_Exit() {
}
function STATE_AttackCeilingDrop_Enter() {
var _local2 = _spriteController.PlayAnimation("attack_ceiling_drop");
_mc.gotoAndStop(_local2);
_dropCount++;
_gb._soundModule.PlaySound("toilenator_drop_from_top.wav", 120);
}
function STATE_AttackCeilingDrop_Update() {
checkCollision();
_mc.gotoAndStop(_spriteController.Update());
if (_spriteController.AnimationComplete()) {
if (_dropCount == 6) {
_fsm.SendMsg(_global.MSG_NextState, this);
} else {
_fsm.SendMsg(_global.MSG_Stop, this);
}
}
}
function STATE_AttackCeilingDrop_Message(oMsg) {
switch (oMsg.GetMsgName()) {
case _global.MSG_Stop :
_fsm.SetState(STATE_ATTACK_CEILING_START);
break;
case _global.MSG_NextState :
_dropCount = 0;
_jumpCount = 0;
_fsm.SetState(STATE_JUMP_HORIZ);
break;
case _global.MSG_BulletHit :
takeDamage(5);
break;
case _global.MSG_Unzombify :
takeDamage(10);
}
}
function STATE_AttackCeilingDrop_Exit() {
}
function STATE_JumpHoriz_Enter() {
var _local3 = -1 + (2 * (_jumpCount % 2));
jumpStart("horiz");
var _local2 = _spriteController.PlayAnimation("jump");
_mc.gotoAndStop(_local2);
_jumpCount++;
}
function STATE_JumpHoriz_Update() {
_mc.gotoAndStop(_spriteController.Update());
jumpTween();
checkCollision();
}
function STATE_JumpHoriz_Message(oMsg) {
switch (oMsg.GetMsgName()) {
case _global.MSG_NextState :
_fsm.SetState(STATE_ATTACK_FRONT_START);
break;
case _global.MSG_BulletHit :
takeDamage(5);
break;
case _global.MSG_Unzombify :
takeDamage(10);
}
}
function STATE_JumpHoriz_Exit() {
}
function STATE_JumpVert_Enter() {
var _local3 = -1 + (2 * (_jumpCount % 2));
jumpStart("vert");
var _local2 = _spriteController.PlayAnimation("jump");
_mc.gotoAndStop(_local2);
_jumpCount++;
}
function STATE_JumpVert_Update() {
_mc.gotoAndStop(_spriteController.Update());
jumpTween();
checkCollision();
}
function STATE_JumpVert_Message(oMsg) {
switch (oMsg.GetMsgName()) {
case _global.MSG_NextState :
_fsm.SetState(STATE_ATTACK_SIDE_START);
break;
case _global.MSG_BulletHit :
takeDamage(5);
break;
case _global.MSG_Unzombify :
takeDamage(10);
}
}
function STATE_JumpVert_Exit() {
}
function STATE_Dead_Enter() {
_mc.swapDepths(200);
var _local2 = _spriteController.PlayAnimation("dead");
_gb._soundModule.StopSound("toilet_paper_loops.wav");
_gb._soundModule.PlaySound("boss_death_snds.wav");
_mc.gotoAndStop(_local2);
}
function STATE_Dead_Update() {
_mc.gotoAndStop(_spriteController.Update());
}
function toString() {
return("Boss_Toilenator()");
}
var STATE_GLOBAL = 0;
var STATE_INIT = 1;
var STATE_IDLE = 2;
var STATE_ATTACK_SIDE_START = 3;
var STATE_ATTACK_SIDE_LOOP = 4;
var STATE_ATTACK_FRONT_START = 5;
var STATE_ATTACK_FRONT_LOOP = 6;
var STATE_ATTACK_CEILING_START = 7;
var STATE_ATTACK_CEILING_DROP = 8;
var STATE_ATTACK_SPIN_START = 9;
var STATE_ATTACK_SPIN_LOOP = 10;
var STATE_JUMP_HORIZ = 11;
var STATE_JUMP_VERT = 12;
var STATE_DEAD = 13;
var _INIT_STATE = Boss_Toilenator.prototype.STATE_ATTACK_FRONT_START;
var _cRad = 10;
var _collOffsetX = 0;
var _collOffsetY = -20;
var _z = 0;
var _vz = 0;
var _jumpFramesTotal = 19;
var _jumpFrameCount = 0;
var _healthMax = 300;
var _heroHit = false;
var _jumpCount = 0;
var _dropCount = 0;
}
Instance of Symbol 90 MovieClip "mcNotice" in Symbol 127 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 127 MovieClip Frame 120
stop();
if ((_url.indexOf("freeonlinegames.com") >= 0) && (_url.indexOf("file:") == -1)) {
_root.okToPlay = true;
_root.play();
} else if (_root.debug) {
_root.okToPlay = true;
_root.play();
} else {
_root.mcTaglines._visible = false;
mcNotice._visible = true;
}
Symbol 128 MovieClip Frame 71
stop();
var fogsound = new Sound();
fogsound.attachSound("fogaudio");
fogsound.start(0, 1);
Symbol 173 MovieClip Frame 1
stop();
Symbol 247 MovieClip [door_n1] Frame 2
stop();
Symbol 247 MovieClip [door_n1] Frame 5
stop();
Symbol 247 MovieClip [door_n1] Frame 14
stop();
Symbol 252 MovieClip [door_n2] Frame 2
stop();
Symbol 252 MovieClip [door_n2] Frame 5
stop();
Symbol 252 MovieClip [door_n2] Frame 14
stop();
Symbol 257 MovieClip [door_n3] Frame 2
stop();
Symbol 257 MovieClip [door_n3] Frame 5
stop();
Symbol 257 MovieClip [door_n3] Frame 14
stop();
Symbol 262 MovieClip [door_n4] Frame 2
stop();
Symbol 262 MovieClip [door_n4] Frame 5
stop();
Symbol 262 MovieClip [door_n4] Frame 14
stop();
Symbol 267 MovieClip [door_n5] Frame 2
stop();
Symbol 267 MovieClip [door_n5] Frame 5
stop();
Symbol 267 MovieClip [door_n5] Frame 14
stop();
Symbol 275 MovieClip Frame 2
stop();
Symbol 277 MovieClip Frame 2
stop();
Symbol 283 MovieClip [door_hamster] Frame 2
stop();
Symbol 283 MovieClip [door_hamster] Frame 5
stop();
Symbol 283 MovieClip [door_hamster] Frame 14
stop();
Symbol 375 MovieClip Frame 15
stop();
Symbol 543 MovieClip Frame 15
stop();
Symbol 698 MovieClip Frame 15
stop();
Symbol 721 MovieClip [pickup_health0] Frame 19
gotoAndPlay (1);
Symbol 721 MovieClip [pickup_health0] Frame 64
stop();
Symbol 725 MovieClip [pickup_health1] Frame 19
gotoAndPlay (1);
Symbol 725 MovieClip [pickup_health1] Frame 64
stop();
Symbol 729 MovieClip [pickup_health2] Frame 19
gotoAndPlay (1);
Symbol 729 MovieClip [pickup_health2] Frame 64
stop();
Symbol 733 MovieClip [pickup_health3] Frame 19
gotoAndPlay (1);
Symbol 733 MovieClip [pickup_health3] Frame 64
stop();
Symbol 737 MovieClip [pickup_health4] Frame 19
gotoAndPlay (1);
Symbol 737 MovieClip [pickup_health4] Frame 64
stop();
Symbol 741 MovieClip [pickup_health5] Frame 19
gotoAndPlay (1);
Symbol 741 MovieClip [pickup_health5] Frame 64
stop();
Symbol 745 MovieClip [pickup_health6] Frame 19
gotoAndPlay (1);
Symbol 745 MovieClip [pickup_health6] Frame 64
stop();
Symbol 749 MovieClip [pickup_health7] Frame 19
gotoAndPlay (1);
Symbol 749 MovieClip [pickup_health7] Frame 64
stop();
Symbol 753 MovieClip [pickup_health8] Frame 19
gotoAndPlay (1);
Symbol 753 MovieClip [pickup_health8] Frame 64
stop();
Symbol 757 MovieClip [pickup_health9] Frame 19
gotoAndPlay (1);
Symbol 757 MovieClip [pickup_health9] Frame 64
stop();
Symbol 761 MovieClip [pickup_health10] Frame 19
gotoAndPlay (1);
Symbol 761 MovieClip [pickup_health10] Frame 64
stop();
Symbol 765 MovieClip [pickup_health11] Frame 19
gotoAndPlay (1);
Symbol 765 MovieClip [pickup_health11] Frame 64
stop();
Symbol 769 MovieClip [pickup_health12] Frame 19
gotoAndPlay (1);
Symbol 769 MovieClip [pickup_health12] Frame 64
stop();
Symbol 892 MovieClip Frame 1
stop();
Symbol 921 MovieClip Frame 1
stop();
Symbol 921 MovieClip Frame 9
gotoAndPlay (2);
Symbol 952 MovieClip Frame 1
stop();
Symbol 952 MovieClip Frame 9
gotoAndPlay (2);
Symbol 983 MovieClip Frame 1
stop();
Symbol 983 MovieClip Frame 9
gotoAndPlay (2);
Symbol 1014 MovieClip Frame 1
stop();
Symbol 1014 MovieClip Frame 9
gotoAndPlay (2);
Symbol 1045 MovieClip Frame 1
stop();
Symbol 1045 MovieClip Frame 9
gotoAndPlay (2);
Symbol 1110 MovieClip Frame 1
stop();
Symbol 1123 MovieClip [bullet] Frame 1
stop();
Symbol 1151 MovieClip [callout] Frame 2
stop();
Symbol 1151 MovieClip [callout] Frame 101
stop();
Symbol 1151 MovieClip [callout] Frame 201
stop();
Symbol 1151 MovieClip [callout] Frame 301
stop();
Symbol 1151 MovieClip [callout] Frame 401
stop();
Symbol 1184 MovieClip [hamster0] Frame 1
stop();
Symbol 1191 MovieClip [door_e] Frame 2
stop();
Symbol 1191 MovieClip [door_e] Frame 5
stop();
Symbol 1191 MovieClip [door_e] Frame 14
stop();
Symbol 1192 MovieClip [door_w] Frame 2
stop();
Symbol 1192 MovieClip [door_w] Frame 5
stop();
Symbol 1192 MovieClip [door_w] Frame 14
stop();
Symbol 1207 MovieClip [door_s] Frame 2
stop();
Symbol 1207 MovieClip [door_s] Frame 5
stop();
Symbol 1373 MovieClip [bossBar] Frame 1
stop();
Symbol 1376 MovieClip [scorePop] Frame 1
stop();
Symbol 1376 MovieClip [scorePop] Frame 15
stop();
Symbol 1378 MovieClip [noGrenade] Frame 1
stop();
Symbol 1378 MovieClip [noGrenade] Frame 8
stop();
Symbol 1401 MovieClip Frame 40
stop();
Symbol 1410 Button
on (rollOver) {
startMC.gotoAndPlay("rollover");
}
on (rollOut) {
startMC.gotoAndPlay("rollout");
}
Symbol 1414 Button
on (release) {
getURL ("http://www.freegamesforyourwebsite.com/click.php?gid=265&area=menu", "_blank");
}
Symbol 1418 Button
on (release) {
_root.gotoAndPlay("scoreboard");
}
Symbol 1463 MovieClip Frame 71
stop();
start_Btn.onPress = function () {
_parent.play();
};
Instance of Symbol 1462 MovieClip in Symbol 1463 MovieClip Frame 71
on (release) {
getURL ("http://www.freegamesforyourwebsite.com/click.php?gid=265&area=minilogo", "_blank");
}
Symbol 1473 MovieClip Frame 1
stop();
Symbol 1473 MovieClip Frame 9
stop();
Symbol 1473 MovieClip Frame 20
stop();
Symbol 1474 Button
on (rollOver) {
playMC.gotoAndPlay("rollover");
}
on (rollOut) {
playMC.gotoAndPlay("rollout");
}
Symbol 1475 MovieClip Frame 31
stop();
onEnterFrame = function () {
if (Key.isDown(80) || (Key.isDown(112))) {
restartGame_btn.onRelease();
}
};
restartGame_btn.onRelease = function () {
_root.ui.pauseGame = false;
if (!_global.MUSIC_MUTE) {
var _local4 = new Sound(_root);
_local4.setVolume(50);
}
_root.ui.instructionsBtn.enabled = true;
_root.ui.musicBtn.enabled = true;
_parent.play();
delete _parent.onEnterFrame;
};
Symbol 1486 MovieClip Frame 1
stop();
Symbol 1486 MovieClip Frame 9
stop();
Symbol 1486 MovieClip Frame 20
stop();
Symbol 1487 Button
on (release) {
_root.gb.init();
_parent.play();
}
on (rollOver) {
playMC.gotoAndPlay("rollover");
}
on (rollOut) {
playMC.gotoAndPlay("rollout");
}
Symbol 1488 MovieClip Frame 501
_parent.play();
Symbol 1488 MovieClip Frame 520
stop();
Symbol 1496 Button
on (release) {
getURL ("http://www.freegamesforyourwebsite.com/click.php?gid=265&area=gameover", "_blank");
}
Symbol 1500 Button
on (release) {
stopAllSounds();
_parent._parent.gb.continueFromHere();
_parent.gotoAndStop("game");
trace("continue..............................");
}
Symbol 1507 MovieClip [TMPd4lzhusf84] Frame 1
function earl223(val) {
var _local3 = new Array("_", "Z", "y", "x", "W", "v", "u", "T", "s", "r", "Q", "P", "O", "n", "m", "L", "K", "j", "i", "H", "g", "F", "e", "d", "C", "B", "a");
var _local2 = "";
val1 = 0;
while (val1 < val.length) {
if (val.substr(val1, 1) == ":") {
_local2 = _local2 + ":";
} else if (Number(val.substr(val1, 2)) > 26) {
_local2 = _local2 + _local3[Number(val.substr(val1, 1))];
} else if (Number(val.substr(val1, 1)) == 0) {
_local2 = _local2 + "_";
} else {
_local2 = _local2 + _local3[Number(val.substr(val1, 2))];
val1++;
}
val1++;
}
return(_local2);
}
mcButtonMain.mcButton.FOG.swapDepths(0);
mcButtonMain.mcButton.attachMovie(btnMC, "btnMC", 0);
mcButtonMain.mcButton.btnMC.onRelease = function () {
var _local2 = new LoadVars();
_local2.onLoad = function () {
getURL ("http://www.freeonlinegames.com/scoreboard.php?", "_blank");
};
_local2.score = Score;
_local2.score2 = earl223(String(Score));
_local2.gamer = gameID;
_local2.id = random(9999999);
_local2.toString();
_local2.sendAndLoad("http://www.freeonlinegames.com/scoreboard/score_c.php", _local2, "POST");
delete this.onRelease;
};
Symbol 1508 MovieClip Frame 118
stop();
Instance of Symbol 1507 MovieClip [TMPd4lzhusf84] "submitScore" in Symbol 1508 MovieClip Frame 118
//component parameters
onClipEvent (construct) {
btnMC = "submitBtn";
gameID = 278;
}
Symbol 1519 Button
on (release) {
stop();
stopAllSounds();
_parent._parent.gb.startFromZero();
_parent.gotoAndPlay(1);
}
Symbol 1522 MovieClip Frame 1
Instance of Symbol 1507 MovieClip [TMPd4lzhusf84] "submitScore" in Symbol 1522 MovieClip Frame 234
//component parameters
onClipEvent (construct) {
btnMC = "submitBtn";
gameID = 278;
}
Symbol 1522 MovieClip Frame 254
stop();
submitScore.Score = _global.finalscore;
Symbol 1523 MovieClip Frame 12
stop();
Symbol 1523 MovieClip Frame 25
stop();
Symbol 1523 MovieClip Frame 38
stop();
Symbol 1523 MovieClip Frame 39
_parent.gotoAndStop("startGame");
trace("\u5F00\u59CB");
Symbol 1523 MovieClip Frame 50
stop();
Symbol 1523 MovieClip Frame 71
stop();
Symbol 1523 MovieClip Frame 77
_root.scorePop._visible = false;
Symbol 1523 MovieClip Frame 84
_root.scorePop._visible = false;
Symbol 1523 MovieClip Frame 99
_root.scorePop._visible = false;
Symbol 1523 MovieClip Frame 111
stop();
Symbol 1523 MovieClip Frame 133
stop();
Symbol 1523 MovieClip Frame 155
_parent.gb.startGameEngine();
stop();
Symbol 1533 MovieClip Frame 1
stop();
Symbol 1540 MovieClip Frame 1
stop();
Symbol 1571 MovieClip [hamster1] Frame 1
stop();
Symbol 1575 MovieClip [explosion] Frame 10
stop();
Symbol 1577 MovieClip Frame 19
gotoAndPlay (1);
Symbol 1577 MovieClip Frame 40
stop();
Symbol 1578 MovieClip Frame 1
stop();
Symbol 1579 MovieClip [GameEngine] Frame 1
#initclip 22
Object.registerClass("GameEngine", GameBoard);
#endinitclip
Symbol 1591 MovieClip Frame 1
stop();
Symbol 1591 MovieClip Frame 40
this.gotoAndStop(1);
Symbol 1595 MovieClip Frame 1
stop();
Symbol 1601 MovieClip Frame 1
stop();
Symbol 1604 MovieClip Frame 1
pauseGame = false;
Symbol 1613 Button
on (press) {
sboard.dir = "up";
}
on (release) {
sboard.dir = "stop";
}
Symbol 1614 Button
on (press) {
sboard.dir = "down";
}
on (release) {
sboard.dir = "stop";
}
Symbol 1621 MovieClip Frame 1
stop();
Symbol 1621 MovieClip Frame 2
stop();
Symbol 1631 MovieClip [TMP6ojzjuzm8i] Frame 1
var arrScore = new Array();
mcScoreboard.sboard.dir = "stop";
mcScoreboard.sboard.mcScoreHolder.mcScore._visible = false;
mcLabel._visible = false;
var main = this;
xmlPlayer = new XML();
xmlPlayer.ignoreWhite = true;
xmlPlayer.onLoad = function (success) {
if (success) {
myPlayer = xmlPlayer.firstChild.childNodes;
ctr2 = 0;
while (ctr2 < myPlayer.length) {
thisPlayer = main.mcScoreboard.sboard.mcScoreHolder.mcScore.duplicateMovieClip("mcScore" + ctr2, ctr2);
thisPlayer._y = ctr2 * thisPlayer._height;
thisPlayer._visible = true;
if ((ctr2 % 2) > 0) {
thisPlayer.gotoAndStop(2);
}
thisPlayer.txtNumber.text = (ctr2 + 1) + ")";
thisPlayer.txtNickname.text = myPlayer[ctr2].attributes.player;
thisPlayer.txtScore.text = myPlayer[ctr2].attributes.score;
ctr2++;
}
main.mcScoreboard.mcLoading._visible = false;
main.mcScoreboard.sboard.mcScoreHolder.item = myPlayer.length;
main.mcScoreboard.sboard.mcScoreHolder.speedy = 0;
main.mcScoreboard.sboard.mcScoreHolder.desty = 0;
main.mcScoreboard.sboard.mcScoreHolder.onEnterFrame = function () {
if ((this.desty < 0) && (this._parent.dir == "up")) {
this.desty = this.desty + 10;
if (this.desty > 0) {
this.desty = 0;
}
}
if ((this.desty > (this._parent.mcBlock._height - (this.mcScore._height * this.item))) && (this._parent.dir == "down")) {
this.desty = this.desty - 10;
if (this.desty < (this._parent.mcBlock._height - (this.mcScore._height * this.item))) {
this.desty = this._parent.mcBlock._height - (this.mcScore._height * this.item);
}
}
this.speedy = (this.desty - this._y) + (this.speedy * 0.4);
this._y = this._y + this.speedy;
};
}
};
xmlPlayer.load((("http://www.freeonlinegames.com/scoreboard/getTopPlayer.php?id=" + _root.gameID) + "&rand=") + random(999999));
Symbol 1636 MovieClip [TMP6pbk6uzm9i] Frame 1
var arrScore = new Array();
mcScoreboard.sboard.dir = "stop";
mcScoreboard.sboard.mcScoreHolder.mcScore._visible = false;
mcLabel._visible = false;
var main = this;
xmlPlayer = new XML();
xmlPlayer.ignoreWhite = true;
xmlPlayer.onLoad = function (success) {
if (success) {
myPlayer = xmlPlayer.firstChild.childNodes;
ctr2 = 0;
while (ctr2 < myPlayer.length) {
thisPlayer = main.mcScoreboard.sboard.mcScoreHolder.mcScore.duplicateMovieClip("mcScore" + ctr2, ctr2);
thisPlayer._y = ctr2 * thisPlayer._height;
thisPlayer._visible = true;
if ((ctr2 % 2) > 0) {
thisPlayer.gotoAndStop(2);
}
thisPlayer.txtNumber.text = (ctr2 + 1) + ")";
thisPlayer.txtNickname.text = myPlayer[ctr2].attributes.player;
thisPlayer.txtScore.text = myPlayer[ctr2].attributes.score;
ctr2++;
}
main.mcScoreboard.mcLoading._visible = false;
main.mcScoreboard.sboard.mcScoreHolder.item = myPlayer.length;
main.mcScoreboard.sboard.mcScoreHolder.speedy = 0;
main.mcScoreboard.sboard.mcScoreHolder.desty = 0;
main.mcScoreboard.sboard.mcScoreHolder.onEnterFrame = function () {
if ((this.desty < 0) && (this._parent.dir == "up")) {
this.desty = this.desty + 10;
if (this.desty > 0) {
this.desty = 0;
}
}
if ((this.desty > (this._parent.mcBlock._height - (this.mcScore._height * this.item))) && (this._parent.dir == "down")) {
this.desty = this.desty - 10;
if (this.desty < (this._parent.mcBlock._height - (this.mcScore._height * this.item))) {
this.desty = this._parent.mcBlock._height - (this.mcScore._height * this.item);
}
}
this.speedy = (this.desty - this._y) + (this.speedy * 0.4);
this._y = this._y + this.speedy;
};
}
};
xmlPlayer.load(((("http://www.freeonlinegames.com/scoreboard/getTopPlayer.php?id=" + gameID) + "&rand=") + random(999999)) + "&filt=1");
Symbol 1642 Button
on (release) {
gotoAndPlay ("start");
}