Frame 1
function doLoading() {
ratio = getBytesLoaded() / getBytesTotal();
if (ratio == 1) {
clearInterval(loader);
gotoAndStop ("game");
} else {
loader_mc.loader_bar.gotoAndStop(Math.ceil(ratio * 100));
}
}
loader = setInterval(doLoading, 5);
stop();
var ratio;
Frame 6
function doCallBack() {
project.log("outer callback hit");
project.doCallBack();
}
project.init();
project.tabChildren = false;
stop();
Symbol 857 MovieClip [__Packages.nick.avatarfortfight.Engine] Frame 0
class nick.avatarfortfight.Engine extends MovieClip
{
var __gameStartTime, __interval, sound, viewport_mc, viewport, from_email, from_name, to_email, to_name, helpViewed, __ProxyObj, gameMode, __emailGameState, playerOneCharacter, playerTwoCharacter, isPaused, activeWorld, state, __updateUI, __didResign, __levelNum, __lives, __score, isUILocked, __health, menus_mc, gotoAndStop, btn_1player, btn_2player, btn_email, btn_earth, btn_water, btn_fire, btn_startOver, selectedOne_mc, txt_type, selectedTwo_mc, btn_play, _quality, weaponScroll_left_mc, weaponScroll_right_mc, gameplay_mc, look_mc, clickHD_mc, mouse, _xmouse, _ymouse, key, txt_response, __versusTimer;
function Engine () {
super();
}
function init() {
trace("-- Engine initted --");
__gameStartTime = getTimer();
log("INIT!!");
__interval = new smashing.IntervalEngine(this, "update");
__interval.startFast();
sound = new smashing.SoundEngine(viewport_mc, 10);
sound.createSound("rain", "SFX_weapon_1.wav");
sound.createSound("shrapnel", "SFX_1_hit.wav");
sound.createSound("explode", "SFX_weapon_2.wav");
sound.createSound("heavy", "SFX_weapon_3.wav");
sound.createSound("heal", "pickup_heal.mp3");
sound.createSound("damage", "pickup_power.mp3");
sound.createSound("fallout", "explosionfallout.wav");
sound.createSound("gameWin", "avatar_win.wav");
sound.createSound("gameLose", "avatar_lose.wav");
sound.createSound("click", "UI_button_click2.mp3");
sound.createSound("smallClick", "UI_button_click.mp3");
sound.createSound("rollover", "UI_button_rollover.mp3");
sound.createSound("weaponSelect", "UI_weaponselect_click.mp3");
sound.createSound("look", "UI_look_ani.mp3");
sound.createSound("rolloverRain", "UI_weapon1_rollover.mp3");
sound.createSound("rolloverExplode", "UI_weapon2_rollover.mp3");
sound.createSound("rolloverHeavy", "UI_weapon3_rollover.mp3");
sound.createGroup("music");
sound.createSound("music", "gameloop.wav", "music");
sound.createSound("menuMusic", "avatar_intro.wav", "music");
viewport = new smashing.keithm.Viewport(viewport_mc, 1);
viewport.createGroup({name:"bg", index:0, slots:30, depthsort:true, zsort:false, reverse:false});
viewport.createGroup({name:"player", index:1, slots:1});
viewport.createGroup({name:"obstacle", index:2, slots:1000, depthsort:false, zsort:false, reverse:false});
viewport.createGroup({name:"effect", index:3, slots:100, depthsort:false, zsort:false, reverse:false});
viewport.init({screenWidth:nick.avatarfortfight.Dimensions.__get__screenWidth(), screenHeight:nick.avatarfortfight.Dimensions.__get__screenHeight(), sc:nick.avatarfortfight.Dimensions.__get__sc()});
from_email = "";
from_name = "";
to_email = "";
to_name = "";
helpViewed = false;
__initMouse();
reset();
__ProxyObj = _global.ProxyObj;
if ((__ProxyObj.getGameID() != null) && (__ProxyObj.getGameID() != -1)) {
if (__ProxyObj.getSuccessCodeRetrieve() == "ok") {
gameMode = "email";
__emailGameState == "pending";
log("continue from proxy");
continueFromProxyData();
} else if (__ProxyObj.getSuccessCodeRetrieve() == "id_expired") {
goTimeOut();
} else {
goError();
}
} else {
log("proxy empty");
goModeSelect();
}
}
function selectMode(t_mode) {
gameMode = t_mode;
if (gameMode == "email") {
__emailGameState = "playerOneSelect";
}
goCharacterSelect();
}
function selectCharacter(t_char) {
if (gameMode == "one") {
playerOneCharacter = t_char;
selectRandomCharacter(playerOneCharacter);
goReady();
} else if (gameMode == "two") {
if (playerOneCharacter == "pending") {
playerOneCharacter = t_char;
goCharacterTwoSelect();
} else {
playerTwoCharacter = t_char;
goReady();
}
} else if (gameMode == "email") {
if (__emailGameState == "playerOneSelect") {
playerOneCharacter = t_char;
goEmail();
} else if (__emailGameState == "playerTwoSelect") {
playerTwoCharacter = t_char;
goEmail();
}
}
}
function selectRandomCharacter(t_playerOne) {
var _local2 = Math.random();
if (_local2 < 0.34) {
playerTwoCharacter = "earth";
if (t_playerOne == "earth") {
playerTwoCharacter = "water";
}
} else if (_local2 < 0.67) {
playerTwoCharacter = "water";
if (t_playerOne == "water") {
playerTwoCharacter = "fire";
}
} else {
playerTwoCharacter = "fire";
if (t_playerOne == "fire") {
playerTwoCharacter = "earth";
}
}
}
function update(el) {
if (el > 0.15) {
el = 0.15;
}
if (!isPaused) {
activeWorld.update(el);
}
if (state == "g") {
viewport.update(el);
if (__updateUI) {
updateUI();
__updateUI = false;
}
}
updateAfterEvent();
}
function reset() {
activeWorld.reset();
activeWorld = new nick.avatarfortfight.World();
activeWorld.init(this);
viewport.newView();
__didResign = false;
__levelNum = 0;
__lives = __STARTLIVES;
__score = 0;
playerOneCharacter = "pending";
playerTwoCharacter = "pending";
__updateUI = true;
}
function startMatch() {
__ProxyObj.startNewGame();
goGameplay();
startBattle();
}
function continueMatch(t_data) {
goGameplay();
startBattle(t_data);
}
function startBattle(t_data) {
trace("Generate new battle");
sound.stopGroup("music");
playMusic("music");
state_game();
activeWorld.generate();
if (t_data != undefined) {
activeWorld.continueFromData(t_data);
}
setViewportToWorld();
viewport.newView();
unlockUI();
unpause();
activeWorld.start();
viewport.update(0.001);
if (!helpViewed) {
showIntroHelp();
}
}
function restartLevel() {
viewport.newView();
activeWorld.reset();
resetCamera();
unlockUI();
unpause();
activeWorld.start();
}
function stopGame() {
pause();
reset();
stopSound("music");
}
function endLevel() {
activeWorld.end();
pause();
}
function destroy() {
__interval.clear();
__clearMouse();
__clearKey();
}
function winGame() {
}
function gameOver() {
goGameOver();
}
function pause() {
isPaused = true;
}
function unpause() {
isPaused = false;
}
function lockUI() {
isUILocked = true;
}
function unlockUI() {
isUILocked = false;
}
function addScore(t_score) {
__score = __score + t_score;
__updateUI = true;
}
function loseHealth(t_amount) {
if (t_amount == undefined) {
t_amount = 1;
}
__health = __health - t_amount;
if (__health <= 0) {
loseLife();
}
__updateUI = true;
}
function loseLife() {
__lives--;
if (__lives <= 0) {
gameOver();
} else {
restartLevel();
}
__updateUI = true;
}
function requestUpdateUI() {
__updateUI = true;
}
function resignMatch() {
__didResign = true;
backToEmail();
}
function playSound(t_name, t_loops) {
if (t_loops == undefined) {
sound.playSound(t_name);
} else {
sound.playSound(t_name, t_loops);
}
}
function playMusic(t_name) {
sound.playSound(t_name, 0);
}
function stopSound(t_name) {
sound.stopSound(t_name);
}
function queueSound(t_name) {
sound.queueSound(t_name);
}
function goModeSelect() {
sound.stopGroup("music");
playMusic("menuMusic");
state_menu();
pause();
menus_mc.gotoAndStop("off");
(gotoAndStop("modeSelect"));// not popped
btn_1player.onRelease = function () {
this._parent.selectMode("one");
};
makeButton(btn_1player);
btn_2player.onRelease = function () {
this._parent.selectMode("two");
};
makeButton(btn_2player);
btn_email.onRelease = function () {
this._parent.selectMode("email");
};
makeButton(btn_email);
}
function goCharacterSelect() {
(gotoAndStop("characterSelect"));// not popped
updateModeText();
btn_earth.onRelease = function () {
this._parent.selectCharacter("earth");
};
makeButton(btn_earth);
btn_water.onRelease = function () {
this._parent.selectCharacter("water");
};
makeButton(btn_water);
btn_fire.onRelease = function () {
this._parent.selectCharacter("fire");
};
makeButton(btn_fire);
btn_startOver.onRelease = function () {
this._parent.clickStartOver();
};
makeButton(btn_startOver);
}
function goCharacterTwoSelect() {
(gotoAndStop("characterSelectTwo"));// not popped
selectedOne_mc.gotoAndStop(playerOneCharacter);
if (playerOneCharacter != "earth") {
btn_earth.onRelease = function () {
this._parent.selectCharacter("earth");
};
makeButton(btn_earth);
} else {
eraseButton(btn_earth);
btn_earth.gotoAndStop("disabled");
}
if (playerOneCharacter != "water") {
btn_water.onRelease = function () {
this._parent.selectCharacter("water");
};
makeButton(btn_water);
} else {
eraseButton(btn_water);
btn_water.gotoAndStop("disabled");
}
if (playerOneCharacter != "fire") {
btn_fire.onRelease = function () {
this._parent.selectCharacter("fire");
};
makeButton(btn_fire);
} else {
eraseButton(btn_fire);
btn_fire.gotoAndStop("disabled");
}
btn_startOver.onRelease = function () {
this._parent.clickStartOver();
};
updateModeText();
}
function updateModeText() {
if (gameMode == "one") {
txt_type.text = "Single Player Battle";
} else if (gameMode == "two") {
txt_type.text = "Two Player Versus Battle";
} else {
txt_type.text = "E-Mail Battle";
}
}
function goReady() {
if (gameMode == "one") {
(gotoAndStop("ready"));// not popped
selectedOne_mc.gotoAndStop(playerOneCharacter);
} else {
(gotoAndStop("readyTwo"));// not popped
selectedOne_mc.gotoAndStop(playerOneCharacter);
selectedTwo_mc.gotoAndStop(playerTwoCharacter);
}
updateModeText();
btn_startOver.onRelease = function () {
this._parent.clickStartOver();
};
makeButton(btn_startOver);
btn_play.onRelease = function () {
this._parent.startMatch();
};
makeButton(btn_play);
}
function goVersus() {
pause();
(gotoAndStop("vs"));// not popped
}
function goGameplay() {
_quality = "MEDIUM";
(gotoAndStop("game"));// not popped
weaponScroll_left_mc.tabChildren = false;
weaponScroll_right_mc.tabChildren = false;
updateUI();
}
function goGameOver() {
stopSound("music");
playSound("gameLose");
_quality = "HIGH";
pause();
menus_mc.gotoAndStop("lose");
makeButton(menus_mc.btn_playAgain);
menus_mc.btn_playAgain.onRelease = function () {
this._parent._parent.clickPlayAgain();
};
}
function goGameWin(t_turn) {
stopSound("music");
playSound("gameWin");
_quality = "HIGH";
pause();
menus_mc.gotoAndStop("win");
menus_mc.winner_mc.gotoAndStop(t_turn);
makeButton(menus_mc.btn_playAgain);
menus_mc.btn_playAgain.onRelease = function () {
this._parent._parent.clickPlayAgain();
};
}
function goEmailWin(t_turn) {
_quality = "HIGH";
pause();
menus_mc.gotoAndStop("winEmail");
menus_mc.winner_mc.gotoAndStop(t_turn);
makeButton(menus_mc.btn_email);
menus_mc.btn_email.onRelease = function () {
this._parent._parent.goEmail();
};
}
function goEmail() {
trace("go email");
_quality = "HIGH";
pause();
activeWorld.pauseForMenu();
menus_mc.gotoAndStop("email");
fillEmailAddresses();
}
function backToEmail() {
menus_mc.gotoAndStop("email");
menus_mc.display_mc.gotoAndStop("input");
fillEmailAddresses();
}
function fillEmailAddresses() {
menus_mc.display_mc.txt_name.text = from_name;
menus_mc.display_mc.txt_email.text = from_email;
menus_mc.display_mc.txt_toemail.text = to_email;
}
function goEmailPopup(t_side) {
trace("Email popup : " + t_side);
_quality = "HIGH";
pause();
activeWorld.pauseForMenu();
var t_mc = eval (("this.weaponScroll_" + t_side) + "_mc");
t_mc.banner.gotoAndPlay("up");
t_mc.banner.banner_mc.gotoAndStop("email");
t_mc.banner.banner_mc.btn_send.owner = this;
t_mc.banner.banner_mc.btn_send.onRelease = function () {
this.owner.goEmail();
};
makeButton(t_mc.banner.banner_mc.btn_send);
t_mc.banner.banner_mc.btn_resign.owner = this;
t_mc.banner.banner_mc.btn_resign.onRelease = function () {
this.owner.clickGoResign();
};
makeButton(t_mc.banner.banner_mc.btn_resign);
}
function goTimeOut() {
_quality = "HIGH";
pause();
activeWorld.pauseForMenu();
menus_mc.gotoAndStop("timeout");
}
function goError() {
_quality = "HIGH";
pause();
activeWorld.pauseForMenu();
menus_mc.gotoAndStop("error");
}
function playPlayerTurn(t_frame) {
gameplay_mc.playerTurn_mc.gotoAndPlay("play");
gameplay_mc.playerTurn_mc.text_mc.gotoAndStop(t_frame);
}
function updateUI() {
weaponScroll_left_mc.gotoAndStop(activeWorld.playerOne.character);
weaponScroll_left_mc.banner.banner_mc.txt_playerNum.text = "player 1";
weaponScroll_left_mc.damageBar_mc.gotoAndStop(1 + Math.floor(100 * activeWorld.playerOne.__get__totalDamagePercent()));
drawScore(weaponScroll_left_mc.score_mc, activeWorld.playerOne.score);
weaponScroll_right_mc.gotoAndStop(activeWorld.playerTwo.character);
weaponScroll_right_mc.banner.banner_mc.txt_playerNum.text = "player 2";
weaponScroll_right_mc.damageBar_mc.gotoAndStop(1 + Math.floor(100 * activeWorld.playerTwo.__get__totalDamagePercent()));
drawScore(weaponScroll_right_mc.score_mc, activeWorld.playerTwo.score);
}
function drawScore(t_mc, t_score) {
var t_string = String(t_score);
var c = t_string.length;
while (c--) {
eval ((t_mc + ".score") + c).gotoAndStop(Number(t_string.charAt((t_string.length - 1) - c)) + 1);
}
}
function goWeaponSelect(t_player, t_side) {
var t_mc = eval (("this.weaponScroll_" + t_side) + "_mc");
t_mc.gotoAndStop(t_player.character);
t_mc.banner.gotoAndPlay("up");
t_mc.banner.banner_mc.weapons.gotoAndStop(t_player.character);
t_mc.banner.character_mc.gotoAndStop(t_player.character);
trace((t_mc.banner.character_mc + " : ") + t_player.character);
t_mc.banner.banner_mc.weapons.rain.gotoAndStop("off");
t_mc.banner.banner_mc.weapons.explode.gotoAndStop("off");
t_mc.banner.banner_mc.weapons.heavy.gotoAndStop("off");
eval ((t_mc.banner.banner_mc.weapons + ".") + t_player.lastProjectile).gotoAndStop("dim");
}
function hideWeaponSelect(t_side) {
eval (("this.weaponScroll_" + t_side) + "_mc").banner.gotoAndPlay("down");
}
function showCPUTurn() {
weaponScroll_right_mc.banner.gotoAndPlay("p2Turn");
}
function hideCPUTurn() {
weaponScroll_right_mc.banner.gotoAndPlay("off");
}
function clickWeaponSelect(t_type, t_mc) {
if (isPaused) {
return(undefined);
}
eval ((t_mc + ".") + t_type).gotoAndStop("selected");
if ((t_type != "rain") && (!t_mc.rain.dim)) {
t_mc.rain.gotoAndStop("off");
} else if ((t_type != "explode") && (!t_mc.explode.dim)) {
t_mc.explode.gotoAndStop("off");
} else if ((t_type != "heavy") && (!t_mc.heavy.dim)) {
t_mc.heavy.gotoAndStop("off");
}
playSound("weaponSelect");
activeWorld.selectWeapon(t_type);
}
function showLookButton(t_direction) {
look_mc.gotoAndStop(t_direction);
}
function hideLookButton() {
look_mc.gotoAndStop("hidden");
}
function clickLook() {
activeWorld.look();
}
function makeButton(t_mc) {
t_mc.owner = this;
t_mc.onPress = function () {
this.owner.playSound("click");
};
t_mc.onRollOver = function () {
this.gotoAndStop("over");
this.owner.playSound("rollover");
};
t_mc.onRollOut = (t_mc.onDragOut = function () {
this.gotoAndStop("off");
});
t_mc.tabEnabled = false;
}
function eraseButton(t_mc) {
t_mc.onRollOver = (t_mc.onRollOut = (t_mc.onDragOut = (t_mc.onRelease = (t_mc.onPress = null))));
}
function clickPlay() {
startMatch();
}
function clickStartOver() {
reset();
goModeSelect();
}
function clickPlayAgain() {
stopGame();
goModeSelect();
}
function clickHelp() {
helpViewed = true;
_quality = "HIGH";
pause();
activeWorld.pauseForMenu();
menus_mc.gotoAndStop("help");
}
function showIntroHelp() {
helpViewed = true;
_quality = "HIGH";
pause();
menus_mc.gotoAndStop("help");
weaponScroll_left_mc.banner.gotoAndStop("off");
}
function clickMenuHelp() {
helpViewed = true;
menus_mc.gotoAndStop("help");
}
function closeMenu() {
if (state == "m") {
menus_mc.display_mc._visible = false;
menus_mc.scroll_mc.gotoAndPlay("close");
} else {
_quality = "MEDIUM";
activeWorld.unpauseFromMenu();
menus_mc.display_mc._visible = false;
menus_mc.scroll_mc.gotoAndPlay("close");
unpause();
}
}
function clickQuit() {
menus_mc.display_mc._visible = false;
menus_mc.scroll_mc.gotoAndPlay("close");
clickPlayAgain();
}
function clickGoQuit() {
_quality = "HIGH";
pause();
activeWorld.pauseForMenu();
menus_mc.gotoAndStop("quit");
}
function clickResign() {
resignMatch();
}
function clickGoResign() {
_quality = "HIGH";
pause();
activeWorld.pauseForMenu();
menus_mc.gotoAndStop("email");
menus_mc.display_mc.gotoAndStop("resign");
}
function goOpponentResigned() {
menus_mc.gotoAndStop("opponentResign");
}
function clickSend() {
sendEmail(menus_mc.display_mc.txt_name.text, menus_mc.display_mc.txt_email.text, menus_mc.display_mc.txt_toemail.text);
}
function showClickHD() {
clickHD_mc._visible = true;
}
function hideClickHD() {
clickHD_mc._visible = true;
}
function __initMouse() {
mouse = {};
mouse.owner = this;
mouse.onMouseDown = function () {
this.owner.mouse_down();
};
mouse.onMouseUp = function () {
this.owner.mouse_up();
};
Mouse.addListener(mouse);
}
function __clearMouse() {
Mouse.removeListener(mouse);
}
function mouse_down() {
if (!isPaused) {
if (clickHD_mc.hitTest(_xmouse + 300, _ymouse + 200, true)) {
activeWorld.startCharge();
}
}
}
function mouse_up() {
if (!isPaused) {
activeWorld.releaseCharge();
}
}
function __initKey() {
key = {};
key.owner = this;
key.onKeyDown = function () {
this.owner.key_down();
};
Key.addListener(key);
}
function __clearKey() {
Key.removeListener(key);
}
function key_down() {
if (Key.getCode(32)) {
}
}
function key_up() {
if (Key.getCode(32)) {
}
}
function __hardLevels() {
}
function parseMainXML() {
}
function setViewportToWorld() {
viewport.setTargetWorld(activeWorld);
}
function resetCamera() {
viewport.camera.reset();
}
function setCameraTrack(t_data) {
viewport.setCameraTrack(t_data);
}
function clearCameraTrack() {
viewport.clearCameraTrack();
}
function setCameraTarget(t_point) {
viewport.setCameraTarget(t_point);
}
function setCameraMovement(t_point) {
viewport.setCameraMovement(t_point);
}
function doCallBack() {
var _local2 = __ProxyObj.getSuccessCodeSave();
log("Callback Recieved! : " + _local2);
txt_response.text = "Server Response: " + _local2;
menus_mc.gotoAndStop("email");
if (_local2 == "save_success") {
menus_mc.display_mc.gotoAndStop("sent");
} else if (_local2 == "from_invalid") {
menus_mc.display_mc.gotoAndStop("email_error");
} else if (_local2 == "to_invalid") {
menus_mc.display_mc.gotoAndStop("email_error");
} else if (_local2 == "save_error") {
menus_mc.display_mc.gotoAndStop("timeout_error");
} else if (_local2 == "name_invalid") {
menus_mc.display_mc.gotoAndStop("name_error");
} else {
menus_mc.display_mc.gotoAndStop("timeout_error");
}
}
function sendEmail(t_name, t_email, t_sendEmail) {
var _local3 = __ProxyObj.getGameID();
var _local5 = __ProxyObj.getGameName();
var _local2 = createGameStateData();
var _local4 = __ProxyObj.getGameTurn();
from_name = t_name;
from_email = t_email;
to_email = t_sendEmail;
to_name = "";
if ((__ProxyObj.getToName() != null) && (__ProxyObj.getToName() != undefined)) {
to_name = __ProxyObj.getToName();
}
menus_mc.display_mc.gotoAndStop("sending");
__ProxyObj.sendGameVars(_local3, _local5, _local2, _local4, to_email, from_email, to_name, from_name);
}
function createGameStateData() {
var _local2;
if (__emailGameState == "playerOneSelect") {
_local2 = "0";
_local2 = _local2 + String(getNumberFromCharacter(playerOneCharacter));
return(_local2);
}
if (__emailGameState == "playerTwoSelect") {
_local2 = "1";
_local2 = _local2 + (String(getNumberFromCharacter(playerOneCharacter)) + "00000888");
_local2 = _local2 + String(getNumberFromCharacter(playerTwoCharacter));
return(_local2);
}
if (__didResign) {
_local2 = "4";
} else if (activeWorld.__get__currentTurn() == 2) {
_local2 = "3";
} else {
_local2 = "2";
}
_local2 = _local2 + activeWorld.getSaveState();
return(_local2);
}
function NumberToString(t_num, t_spaces) {
var _local2 = t_spaces - String(t_num).length;
var _local1 = "";
while (_local2--) {
_local1 = _local1 + "0";
}
_local1 = _local1 + String(t_num);
return(_local1);
}
function StringToNumber(t_string) {
var _local1 = t_string.length;
var _local2 = 1;
var _local3 = 0;
while (_local1--) {
_local3 = _local3 + (Number(t_string.charAt(_local1)) * _local2);
_local2 = _local2 * 10;
}
return(_local3);
}
function continueFromProxyData() {
helpViewed = true;
if (__ProxyObj.getFromEmail() != null) {
from_email = __ProxyObj.getFromEmail();
} else {
from_email = "";
}
if (__ProxyObj.getFromName() != null) {
from_name = __ProxyObj.getFromName();
} else {
from_name = "";
}
if (__ProxyObj.getToEmail() != null) {
to_email = __ProxyObj.getToEmail();
} else {
to_email = "";
}
if (__ProxyObj.getToName() != null) {
to_name = __ProxyObj.getToName();
} else {
to_name = "";
}
var _local2 = new String(__ProxyObj.getGameState());
playerOneCharacter = getCharacterFromNumber(Number(_local2.charAt(1)));
if (_local2.charAt(0) == 0) {
__emailGameState = "playerTwoSelect";
goCharacterTwoSelect();
return(undefined);
}
playerTwoCharacter = getCharacterFromNumber(Number(_local2.charAt(10)));
if (_local2.charAt(0) == 1) {
__emailGameState = "firstTurn";
goReady();
} else if (_local2.charAt(0) == 4) {
goOpponentResigned();
} else {
__emailGameState = "game";
continueMatch(_local2);
}
}
function getCharacterFromNumber(t_num) {
if (t_num == 0) {
return("earth");
}
if (t_num == 1) {
return("water");
}
return("fire");
}
function getNumberFromCharacter(t_char) {
if (t_char == "earth") {
return(0);
}
if (t_char == "water") {
return(1);
}
return(2);
}
function get score() {
return(__score);
}
function get lives() {
return(__lives);
}
function get health() {
return(__health);
}
function get gameStartTime() {
return(__gameStartTime);
}
function get camera() {
return(viewport.camera);
}
function state_game() {
state = "g";
}
function state_versus() {
state = "v";
__versusTimer = __VERSUS_TOTAL;
}
function state_menu() {
state = "m";
}
function log(message) {
var _local1 = new LocalConnection();
_local1.send("_SILCtrace", "trace", message);
_local1.close();
trace("LOG : " + message);
}
var __VERSUS_TOTAL = 3.4;
var __STARTLIVES = 3;
var __STARTHEALTH = 3;
}
Symbol 858 MovieClip [__Packages.smashing.keithm.Viewport] Frame 0
class smashing.keithm.Viewport
{
var __a_groups, __o_groups, __viewportPath, __viewportDepth, camera, l, screenWidth, screenHeight, sc, __vWorld, mc, a, aa, ll, fl, cam, e, onsc, zdiff, scale, xdiff, ydiff;
function Viewport (t_path, t_depth) {
__a_groups = [];
__o_groups = {};
__viewportPath = t_path;
__viewportDepth = t_depth;
}
function init(t_data) {
camera = new smashing.keithm.VCamera();
setDimensions(t_data);
var _local5 = __a_groups.length;
var _local4 = [];
var _local2 = 0;
while (_local4.length < _local5) {
l = __a_groups.length;
while (l--) {
if (__a_groups[l].index < __a_groups[_local2].index) {
_local2 = l;
}
}
_local4.push(__a_groups[_local2]);
__a_groups.splice(_local2, 1);
}
__a_groups = _local4;
var _local3 = __defaultMCDepth;
l = 0;
while (l < __a_groups.length) {
_local3 = __a_groups[l].init(_local3);
_local3++;
l++;
}
newView();
}
function setDimensions(t_data) {
screenWidth = t_data.screenWidth;
screenHeight = t_data.screenHeight;
sc = t_data.sc;
camera.setDimensions({screenWidth:screenWidth, screenHeight:screenHeight, sc:sc});
}
function setTargetWorld(t_world) {
__vWorld = t_world;
camera.init(t_world.cameraData);
}
function setCameraTrack(t_data) {
camera.setTrack(t_data);
}
function clearCameraTrack(t_data) {
camera.clearTrack();
}
function setCameraTarget(t_point) {
camera.setTarget(t_point.x, t_point.y, t_point.z);
}
function setCameraMovement(t_point) {
camera.setMoveRate(t_point.x, t_point.y, t_point.z);
}
function newView() {
var _local3 = __a_groups.length;
while (_local3--) {
__a_groups[_local3].reset();
}
if (mc != undefined) {
mc.removeMovieClip();
}
mc = __viewportPath.createEmptyMovieClip("viewport" + __viewportDepth, __viewportDepth);
if (__vWorld != undefined) {
a = __vWorld.a_renderOnceArray;
l = a.length;
while (l--) {
aa = a[l];
ll = aa.length;
while (ll--) {
draw({element:aa[ll]});
aa[ll].renderDirect();
}
}
}
}
function clearGroup(t_group) {
var _local2 = __o_groups[t_group].mcs;
while (_local2.length > 0) {
__eraseAsset(_local2[0].mc, t_group);
}
}
function update(el) {
camera.update(el);
fl = camera.fl;
cam = camera.edges;
a = __vWorld.a_renderArray;
l = a.length;
while (l--) {
aa = a[l];
ll = aa.length;
while (ll--) {
e = aa[ll];
if (e.flag_eraseMe) {
erase({element:e});
continue;
}
if ((!e.isSpawned) || ((!e.isAlive) && (!e.drawWhenKilled))) {
continue;
}
onsc = false;
zdiff = e.z - camera.z;
if (e.CUSTOMDRAW) {
onsc = true;
} else if (zdiff > 0) {
scale = fl / (fl + e.z);
xdiff = Math.abs((e.x + (-camera.x)) * scale);
ydiff = Math.abs((e.y + (-camera.y)) * scale);
if (((xdiff < (sc.x + e.baseWidth)) && (ydiff < (sc.y + e.baseHeight))) && (zdiff < camera.farClip)) {
onsc = true;
}
}
if (onsc) {
if (!e.isDrawn) {
draw({element:e});
}
e.render(camera, scale);
} else if (e.isDrawn) {
erase({element:e});
}
}
}
}
function draw(t_data) {
var _local4;
if (t_data.element != undefined) {
var _local3 = t_data.element;
if (!_local3.isSpawned) {
trace(("WARNING: despawned entity " + _local3.assetID) + " received draw request.");
return(undefined);
}
_local4 = __drawElement(_local3);
if (_local4 != undefined) {
_local3.onDraw(_local4, this);
// unexpected jump
}
trace("ERROR DRAWING ASSET " + _local3.assetID);
return(undefined);
}
if (t_data.assetID == "_empty") {
return(__drawEmpty(t_data.groupName, t_data.z + t_data.zInfluence));
}
return(__drawAsset(t_data.assetID, t_data.groupName, t_data.z + t_data.zInfluence));
}
function erase(t_data) {
if (t_data.element != undefined) {
__eraseAsset(t_data.element.mc, t_data.element.DRAWTYPE);
t_data.element.onErase(this);
} else {
__eraseAsset(t_data.mc, t_data.groupName);
}
}
function createGroup(t_data) {
__a_groups.push((__o_groups[t_data.name] = new smashing.keithm.ViewportGroup(t_data)));
}
function __drawElement(t_element) {
var _local4 = __o_groups[t_element.DRAWTYPE];
var _local6 = _local4.getDepth(t_element.z + t_element.zInfluence);
if (t_element.assetID == "_empty") {
var _local3 = mc.createEmptyMovieClip(t_element.DRAWTYPE + _local6, _local6);
} else {
var _local3 = mc.attachMovie(t_element.assetID, t_element.assetID + _local6, _local6);
}
_local4.mcs.push({mc:_local3, depth:_local6, z:t_element.z});
e.initScale(camera);
return(_local3);
}
function __drawAsset(t_asset, t_groupName, t_z) {
var _local3 = __o_groups[t_groupName];
var _local7 = _local3.getDepth(t_z);
var _local2 = mc.attachMovie(t_asset, t_asset + _local7, _local7);
_local3.mcs.push({mc:_local2, depth:_local7, z:t_z});
return(_local2);
}
function __drawEmpty(t_groupName, t_z) {
var _local4 = __o_groups[t_groupName];
var _local7 = _local4.getDepth(t_z);
var _local2 = mc.createEmptyMovieClip(t_groupName + _local7, _local7);
__o_groups[t_groupName].mcs.push({mc:_local2, depth:_local7, z:t_z});
return(_local2);
}
function __eraseAsset(t_mc, t_groupName) {
var _local3 = __o_groups[t_groupName];
var _local2 = _local3.mcs.length;
while (_local2--) {
if (_local3.mcs[_local2].mc == t_mc) {
_local3.mcs[_local2].mc.removeMovieClip();
_local3.mcs.splice(_local2, 1);
return(undefined);
}
}
}
var __defaultMCDepth = 100;
}
Symbol 859 MovieClip [__Packages.smashing.keithm.VCamera] Frame 0
class smashing.keithm.VCamera
{
var startX, sc, startY, startZ, remoteScale, xMult, yMult, zMult, fl, farClip, edges, screenWidth, screenHeight, baseVisWidth, baseVisHeight, isTrack, targetX, offset, te, targetY, targetZ, isTarget, doScrollX, xdiff, x, enforceXpad, padding, easeCushion, mr, ydiff, doScrollY, y, enforceYpad, doScrollZ, zdiff, z, enforceZpad, visWidth, visHeight, limit;
function VCamera () {
}
function init(t_data) {
if (t_data.x == undefined) {
startX = sc.x;
} else {
startX = t_data.x;
}
if (t_data.y == undefined) {
startY = sc.y;
} else {
startY = t_data.y;
}
if (t_data.z == undefined) {
startZ = 0;
} else {
startY = t_data.z;
}
remoteScale = false;
setMoveRate(0, 0, 0);
if (t_data.xmult != undefined) {
xMult = t_data.xmult;
} else {
xMult = 1;
}
if (t_data.ymult != undefined) {
yMult = t_data.ymult;
} else {
yMult = 1;
}
if (t_data.zmult != undefined) {
yMult = t_data.zmult;
} else {
zMult = 1;
}
if (t_data.fl != undefined) {
fl = t_data.fl;
} else {
fl = DEF_FL;
}
if (t_data.farClipping != undefined) {
farClip = t_data.farClipping;
} else {
farClip = 100000 /* 0x0186A0 */;
}
edges = {};
reset();
}
function setDimensions(t_data) {
screenWidth = t_data.screenWidth;
screenHeight = t_data.screenHeight;
sc = t_data.sc;
baseVisWidth = (screenWidth / 2) + VISCUSHION;
baseVisHeight = (screenHeight / 2) + VISCUSHION;
}
function update(el) {
if (isTrack) {
targetX = te.x + offset.x;
targetY = te.y + offset.y;
targetZ = te.z + offset.z;
}
if (isTarget) {
if (doScrollX) {
xdiff = targetX - x;
if (enforceXpad) {
if (xdiff > padding.r) {
x = targetX - padding.r;
} else if ((-xdiff) > padding.l) {
x = targetX + padding.l;
}
}
if (Math.abs(xdiff) > easeCushion.x) {
mr.x = xdiff + (xdiff - (xdiff * Math.pow(el, 1)));
} else {
mr.x = 0;
}
if (Math.abs(mr.x) > Math.abs(ydiff)) {
mr.x = xdiff;
}
} else {
mr.x = 0;
}
if (doScrollY) {
ydiff = targetY - y;
if (enforceYpad) {
if (ydiff > padding.b) {
y = targetY - padding.b;
} else if ((-ydiff) > padding.t) {
y = targetY + padding.t;
}
}
if (Math.abs(ydiff) > easeCushion.y) {
mr.y = ydiff;
mr.y = mr.y + (mr.y - (mr.y * Math.pow(el, 1)));
} else {
mr.y = 0;
}
if (Math.abs(mr.y) > Math.abs(ydiff)) {
mr.y = ydiff;
}
} else {
mr.y = 0;
}
if (doScrollZ) {
zdiff = targetZ - z;
if (enforceZpad) {
if (zdiff > padding.f) {
z = targetZ - padding.f;
} else if ((-zdiff) > padding.n) {
z = targetZ + padding.n;
}
}
if (Math.abs(zdiff) > easeCushion.z) {
mr.z = zdiff;
mr.z = mr.z + (mr.z - (mr.z * Math.pow(el, 1)));
} else {
mr.z = 0;
}
if (Math.abs(mr.z) > Math.abs(zdiff)) {
mr.z = zdiff;
}
} else {
mr.z = 0;
}
}
x = x + ((xMult * (Math.floor(mr.x * 100) / 100)) * el);
y = y + ((yMult * (Math.floor(mr.y * 100) / 100)) * el);
z = z + ((zMult * (Math.floor(mr.z * 100) / 100)) * el);
visWidth = baseVisWidth - (z * 3);
visHeight = baseVisHeight - z;
if (limit.left != null) {
if (((x - visWidth) - limit.left) < 0) {
x = limit.left + visWidth;
}
}
if (limit.right != null) {
if ((limit.right - (x + visWidth)) < 0) {
x = limit.right - visWidth;
}
}
if (limit.top != null) {
if (((y - visHeight) - limit.top) < 0) {
y = limit.top + visHeight;
}
}
if (limit.bottom != null) {
if ((limit.bottom - (y + visHeight)) < 0) {
y = limit.bottom - visHeight;
}
}
if (limit.near != null) {
if ((z - limit.near) < 0) {
z = limit.near;
}
}
if (limit.far != null) {
if ((limit.far - z) < 0) {
z = limit.far;
}
}
edges.r = x + visWidth;
edges.l = x - visWidth;
edges.t = y - visHeight;
edges.b = y + visHeight;
}
function setMoveRate(t_x, t_y, t_z) {
if (t_x == undefined) {
t_x = 0;
}
if (t_y == undefined) {
t_y = 0;
}
if (t_z == undefined) {
t_z = 0;
}
mr = {x:t_x, y:t_y, z:t_z};
}
function setTarget(t_x, t_y, t_z) {
setTrack({doxpad:false, doypad:false, dozpad:false});
isTrack = false;
targetX = t_x;
targetY = t_y;
targetZ = t_z;
if (t_z != 0) {
doScrollZ = true;
}
}
function setTrack(t_data) {
te = t_data.element;
if (t_data.scrollx != undefined) {
doScrollX = t_data.scrollx;
} else {
doScrollX = true;
}
if (t_data.scrolly != undefined) {
doScrollY = t_data.scrolly;
} else {
doScrollY = true;
}
if (t_data.scrollz != undefined) {
doScrollZ = t_data.scrollz;
} else {
doScrollZ = false;
}
offset = {x:0, y:0, z:0};
if (t_data.xoffset != undefined) {
offset.x = t_data.xoffset;
}
if (t_data.yoffset != undefined) {
offset.y = t_data.yoffset;
}
if (t_data.zoffset != undefined) {
offset.z = t_data.zoffset;
}
if (t_data.doxpad != undefined) {
enforceXpad = t_data.doxpad;
} else {
enforceXpad = true;
}
if (t_data.doypad != undefined) {
enforceYpad = t_data.doypad;
} else {
enforceYpad = true;
}
if (t_data.dozpad != undefined) {
enforceZpad = t_data.dozpad;
} else {
enforceZpad = true;
}
padding = {t:0, b:0, l:0, r:0, f:0, n:0};
if (t_data.topPad != undefined) {
padding.t = t_data.topPad;
}
if (t_data.bottomPad != undefined) {
padding.b = t_data.bottomPad;
}
if (t_data.leftPad != undefined) {
padding.l = t_data.leftPad;
}
if (t_data.rightPad != undefined) {
padding.r = t_data.rightPad;
}
if (t_data.nearPad != undefined) {
padding.n = t_data.nearPad;
}
if (t_data.farPad != undefined) {
padding.f = t_data.farPad;
}
limit = {left:null, right:null, top:null, bottom:null, near:null, far:null};
if (t_data.leftlimit != undefined) {
limit.left = t_data.leftlimit;
}
if (t_data.rightlimit != undefined) {
limit.right = t_data.rightlimit;
}
if (t_data.toplimit != undefined) {
limit.top = t_data.toplimit;
}
if (t_data.bottomlimit != undefined) {
limit.bottom = t_data.bottomlimit;
}
if (t_data.farlimit != undefined) {
limit.far = t_data.farlimit;
}
if (t_data.nearlimit != undefined) {
limit.near = t_data.nearlimit;
}
easeCushion = {x:DEFCUSHION_X, y:DEFCUSHION_Y, z:DEFCUSHION_Z};
if (t_data.easex != undefined) {
easeCushion.x = t_data.easex;
}
if (t_data.easey != undefined) {
easeCushion.y = t_data.easey;
}
if (t_data.easez != undefined) {
easeCushion.z = t_data.easez;
}
if (t_data.xmult != undefined) {
xMult = t_data.xmult;
}
if (t_data.ymult != undefined) {
yMult = t_data.ymult;
}
if (t_data.zmult != undefined) {
zMult = t_data.zmult;
}
isTrack = true;
isTarget = true;
}
function clearTrack() {
te = {};
isTrack = false;
clearTarget();
}
function clearTarget() {
targetX = x;
targetY = y;
targetZ = z;
isTarget = false;
}
function reset() {
moveTo(startX, startY, startZ);
}
function moveTo(t_x, t_y, t_z) {
x = t_x;
y = t_y;
z = t_z;
}
function clear() {
reset();
clearTrack();
}
function toString() {
return((((((((((("Camera : focus : " + x) + " , ") + y) + " , ") + z) + " : scroll : ") + mr.x) + " , ") + mr.y) + " , ") + mr.z);
}
var DEF_FL = 100;
var VISCUSHION = 0;
var DEFCUSHION_X = 2;
var DEFCUSHION_Y = 2;
var DEFCUSHION_Z = 1;
}
Symbol 860 MovieClip [__Packages.smashing.Point3D] Frame 0
class smashing.Point3D
{
var x, y, z;
function Point3D (x, y, z) {
this.x = Number(x);
this.y = Number(y);
this.z = Number(z);
}
function get length() {
return(Math.sqrt(((x * x) + (y * y)) + (z * z)));
}
function set length(newLength) {
if (length != 0) {
var _local2 = newLength / length;
x = x * _local2;
y = y * _local2;
z = z * _local2;
}
//return(length);
}
function get lengthSqu() {
return(((x * x) + (y * y)) + (z * z));
}
function copy() {
return(new smashing.Point3D(x, y, z));
}
function addPoint(p) {
return(new smashing.Point3D(p.x + x, p.y + y, p.z + z));
}
function subtractPoint(p) {
return(new smashing.Point3D(x - p.x, y - p.y, z - p.z));
}
function addScalar(n) {
return(new smashing.Point3D(x + n, y + n, z + n));
}
function subtractScalar(n) {
return(new smashing.Point3D(x - n, y - n, z - n));
}
function addPointMe(p) {
x = x + p.x;
y = y + p.y;
z = z + p.z;
}
function subtractPointMe(p) {
x = x - p.x;
y = y - p.y;
z = z - p.z;
}
function addScalarMe(n) {
x = x + n;
y = y + n;
z = z + n;
}
function subtractScalarMe(n) {
x = x - n;
y = y - n;
z = z - n;
}
function multiply(n) {
var _local2 = copy();
_local2.x = _local2.x * n;
_local2.y = _local2.y * n;
_local2.z = _local2.z * n;
return(_local2);
}
function divide(n) {
var _local2 = copy();
if (n == 0) {
_local2.x = 0;
_local2.y = 0;
_local2.z = 0;
return(undefined);
}
_local2.x = _local2.x / n;
_local2.y = _local2.y / n;
_local2.z = _local2.z / n;
return(_local2);
}
function multiplyMe(n) {
x = x * n;
y = y * n;
z = z * n;
}
function divideMe(n) {
x = x / n;
y = y / n;
z = z / n;
}
function dot(p) {
return(((x * p.x) + (y * p.y)) + (z * p.z));
}
function cross(p) {
return(new smashing.Point3D((y * p.z) - (z * p.y), (z * p.x) - (x * p.z), (x * p.y) - (y * p.x)));
}
function pseudoCross() {
return(new smashing.Point3D(y, -x, z));
}
function normalize() {
if (((!x) && (!y)) && (!z)) {
return(undefined);
}
var _local2 = length;
return(new smashing.Point3D(x / _local2, y / _local2, z / _local2));
}
function normalizeMe() {
if ((!x) && (!y)) {
return(undefined);
}
var _local2 = length;
x = x / _local2;
y = y / _local2;
z = z / _local2;
}
function reverse() {
var _local2 = new smashing.Point3D(x * -1, y * -1, z * -1);
return(_local2);
}
function reverseMe() {
x = x * -1;
y = y * -1;
z = z * -1;
}
function findCosine(vOther) {
var _local3 = dot(vOther);
var _local4 = length * vOther.__get__length();
var _local2 = _local3 / _local4;
return(_local2);
}
function equals(p) {
if (((x == p.x) && (y == p.y)) && (z == p.z)) {
return(true);
}
return(false);
}
function zero() {
x = 0;
y = 0;
z = 0;
}
function distSqu(p) {
var _local4 = p.x - x;
var _local3 = p.y - y;
var _local2 = p.z - z;
return(((_local4 * _local4) + (_local3 * _local3)) + (_local2 * _local2));
}
function toString() {
var _local2 = ((((("Point3D (" + x) + ",") + y) + ",") + z) + ")";
return(_local2);
}
}
Symbol 861 MovieClip [__Packages.smashing.keithm.ViewportGroup] Frame 0
class smashing.keithm.ViewportGroup
{
var name, mcs, index, numSlots, depthsort, zsort, reverse, min, max, current, isSearching, loop;
function ViewportGroup (t_data) {
name = t_data.name;
mcs = [];
index = t_data.index;
numSlots = t_data.slots;
if (t_data.zsort == true) {
t_data.depthsort = true;
} else if (t_data.zsort == undefined) {
t_data.zsort = false;
}
if (t_data.depthsort == undefined) {
t_data.depthsort = false;
}
depthsort = t_data.depthsort;
zsort = t_data.zsort;
if (t_data.reverse == undefined) {
t_data.reverse = false;
}
reverse = t_data.reverse;
}
function init(t_depth) {
min = t_depth;
max = t_depth + numSlots;
reset();
return(max);
}
function reset() {
mcs = [];
if (reverse) {
current = max;
} else {
current = min;
}
}
function getDepth(t_z) {
if (depthsort) {
return(__getNewDepth(t_z));
}
increment();
return(current);
}
function increment() {
isSearching = true;
while (isSearching) {
if (reverse) {
current--;
if (current < min) {
current = max;
}
} else {
current++;
if (current > max) {
current = min;
}
}
isSearching = false;
loop = mcs.length;
while (loop--) {
if (mcs[loop].depth == current) {
isSearching = true;
loop = 0;
}
}
}
}
function __getNewDepth(t_z) {
var _local6;
var _local2;
var _local4 = 1000000 /* 0x0F4240 */;
var _local3;
loop = mcs.length;
while (loop--) {
_local3 = t_z - mcs[loop].z;
if ((_local3 <= _local4) && (_local3 >= 0)) {
_local6 = loop;
if (_local4 == _local3) {
if (reverse) {
if (mcs[loop].depth > _local2) {
_local2 = mcs[loop].depth;
}
} else if (mcs[loop].depth < _local2) {
_local2 = mcs[loop].depth;
}
} else {
_local4 = _local3;
_local2 = mcs[loop].depth;
}
}
}
var _local5 = _local2;
if (_local5 == undefined) {
_local5 = max;
} else if (!reverse) {
_local5--;
}
if (_local5 < min) {
_local5 = __resortDepths();
}
__displaceDepth(_local5);
return(_local5);
}
function __displaceDepth(t_depth) {
var _local3 = t_depth - 1;
if (_local3 < min) {
_local3 = __resortDepths();
}
var _local2 = mcs.length;
while (_local2--) {
if (mcs[_local2].depth == t_depth) {
__displaceDepth(_local3);
mcs[_local2].depth = _local3;
mcs[_local2].mc.swapDepths(_local3);
return(undefined);
}
}
}
function __resortDepths() {
var _local3;
var _local4 = 1000000 /* 0x0F4240 */;
loop = mcs.length;
while (loop--) {
if (mcs[loop].z < _local4) {
_local3 = loop;
_local4 = mcs[loop].z;
}
}
mcs[_local3].depth = max;
loop = 1;
var _local2;
var _local5;
while (loop <= mcs.length) {
_local4 = 1000000 /* 0x0F4240 */;
_local2 = mcs.length;
while (_local2--) {
if (((_local2 != _local3) && (mcs[_local2].depth < mcs[_local3].depth)) && ((mcs[_local2].z - mcs[_local3].z) < _local4)) {
_local5 = _local2;
_local4 = mcs[_local2].z - mcs[_local3].z;
}
}
mcs[_local5].depth = mcs[_local3].depth - 1;
_local3 = _local5;
loop++;
}
loop = mcs.length;
while (loop--) {
mcs[loop].mc.swapDepths(mcs[loop].depth);
}
return(mcs[_local3].depth - 1);
}
}
Symbol 862 MovieClip [__Packages.smashing.SoundEngine] Frame 0
class smashing.SoundEngine
{
var __mc, o_sounds, o_groups, flag_muted, flag_overwrite, __groupCount, __a_soundQueue;
function SoundEngine (t_path, t_depth, t_overwrite) {
__mc = t_path.createEmptyMovieClip(__DEFAULTMCNAME, t_depth);
o_sounds = {};
o_groups = {};
flag_muted = false;
if (t_overwrite == undefined) {
t_overwrite = false;
}
flag_overwrite = t_overwrite;
__groupCount = 0;
createGroup(__DEFAULTGROUPNAME);
trace("-- Init Sound Engine -- ");
}
function createGroup(t_name) {
__groupCount++;
var _local2 = __mc.createEmptyMovieClip(t_name, __groupCount);
_local2.soundObject = new Sound(_local2);
o_groups[t_name] = _local2;
}
function createSound(t_name, t_assetID, t_groupName) {
var _local4;
if (t_groupName == undefined) {
t_groupName = __DEFAULTGROUPNAME;
}
_local4 = o_groups[t_groupName];
if (_local4 != undefined) {
var _local2 = {};
_local2.soundEffect = new Sound(_local4);
_local2.soundEffect.attachSound(t_assetID);
o_sounds[t_name] = _local2;
} else {
trace((("Error Locating Group " + t_groupName) + " for create sound ") + t_name);
}
}
function playSound(t_soundName, t_loops) {
if (flag_muted) {
return(undefined);
}
var _local2 = o_sounds[t_soundName];
if (_local2 != undefined) {
if (t_loops == undefined) {
t_loops = 1;
} else if (t_loops == 0) {
t_loops = 100000 /* 0x0186A0 */;
}
if (flag_overwrite) {
_local2.SoundEffect.stop(_local2.idName);
}
_local2.soundEffect.start(0, t_loops);
} else {
trace(("Error - sound " + t_soundName) + " not found");
}
}
function stopSound(t_soundName) {
o_sounds[t_soundName].soundEffect.stop();
}
function stopGroup(t_groupName) {
o_groups[t_groupName].soundObject.stop();
}
function stopAll() {
stopAllSounds();
}
function changeVolume(t_vol, t_groupName) {
if (t_groupName == undefined) {
t_groupName = __DEFAULTGROUPNAME;
}
o_groups[t_groupName].soundObject.setVolume(t_vol);
}
function toggleSound() {
if (flag_muted) {
soundOn();
} else {
soundOff();
}
return(!flag_muted);
}
function soundOff() {
flag_muted = true;
}
function soundOn() {
flag_muted = false;
}
function queueSound(t_soundName) {
__a_soundQueue.push({sound:t_soundName, isPlaying:false});
__playQueue();
}
function __playQueue() {
if (__a_soundQueue.length == 0) {
return(undefined);
}
if (!__a_soundQueue[0].isPlaying) {
playSound(__a_soundQueue[0].sound, 1, true);
__a_soundQueue[0].isPlaying = true;
}
}
function onQueuedSoundComplete() {
__a_soundQueue.splice(0, 1);
__playQueue();
}
function get queueLength() {
return(__a_soundQueue.length);
}
function isQueuePlaying() {
if (__a_soundQueue.length == 0) {
return(false);
}
return(true);
}
var __DEFAULTMCNAME = "soundEngine_MC";
var __DEFAULTGROUPNAME = "sound";
}
Symbol 863 MovieClip [__Packages.nick.avatarfortfight.World] Frame 0
class nick.avatarfortfight.World
{
var engine, gravity, cam, __currentTurn, firingPlayer, playerOne, targetPlayer, playerTwo, __CPU, __CPUtimer, __state, __fireAngle, __fireCharge, __activePlayer, __isPickupTurn, __canHit, loop, a_projectiles, __didHit, __deadProjectileCounter, pickup, __horizon, trackingProjectile, __chargeUp, __fireAngle_frame, __lookTimer, __turnTimer, a_effects, ploop, a_scenery, cameraData, a_renderArray, a_renderOnceArray;
function World () {
}
function init(t_engine) {
engine = t_engine;
gravity = new smashing.Point3D(0, 200, 0);
cam = engine.camera;
}
function start() {
if (!engine.helpViewed) {
engine.camera.y = 2900;
}
beginTurn();
}
function end() {
}
function beginTurn() {
if (__currentTurn == 1) {
firingPlayer = playerOne;
targetPlayer = playerTwo;
if (engine.gameMode != "email") {
__CPU = false;
}
} else {
firingPlayer = playerTwo;
targetPlayer = playerOne;
if (engine.gameMode == "one") {
__CPU = true;
__CPUtimer = 2;
__state = "aim";
__fireAngle = 190 + (Math.random() * 37);
__fireCharge = 0.65 + (Math.random() * 0.28);
engine.showCPUTurn();
}
}
if ((engine.gameMode == "email") && (__currentTurn == __activePlayer)) {
__CPU = false;
}
firingPlayer.beginTurn();
firingPlayer.mc.catapult.launcher.meter.gotoAndStop(1);
if (!__CPU) {
__state = "weaponSelect";
engine.showLookButton(((__currentTurn == 1) ? "left" : "right"));
engine.goWeaponSelect(firingPlayer, ((__currentTurn == 1) ? "left" : "right"));
}
if ((engine.gameMode != "email") || ((engine.gameMode == "email") && (!__CPU))) {
if (__isPickupTurn) {
spawnPickup();
}
if (__CPU) {
firingPlayer.pickRandomWeapon();
} else {
__fireAngle = 0;
__fireCharge = 0;
}
__canHit = true;
}
engine.requestUpdateUI();
engine.setCameraTrack({element:firingPlayer, xoffset:0, yoffset:0, topPad:500, bottomPad:500, easey:50, easyx:50, leftlimit:__CAM_LEFTBOUNDS, rightlimit:__CAM_RIGHTBOUNDS, bottomlimit:__CAM_BOTTOMBOUNDS});
}
function nextTurn() {
loop = a_projectiles.length;
while (loop--) {
a_projectiles[loop].flag_eraseMe = true;
}
if (!targetPlayer.__get__isKeepStanding()) {
if (engine.gameMode == "email") {
if (__currentTurn == __activePlayer) {
engine.goEmailWin(__currentTurn);
} else {
engine.goGameOver();
}
} else if ((__currentTurn == 1) || (engine.gameMode == "two")) {
engine.goGameWin(__currentTurn);
} else {
engine.goGameOver();
}
return(undefined);
}
__didHit = false;
if ((engine.gameMode == "email") && (__currentTurn == __activePlayer)) {
engine.goEmailPopup(((__currentTurn == 1) ? "left" : "right"));
} else {
__currentTurn++;
if (__currentTurn > 2) {
__currentTurn = 1;
if (__isPickupTurn) {
__isPickupTurn = false;
} else {
__isPickupTurn = true;
}
}
beginTurn();
}
}
function selectWeapon(t_type) {
firingPlayer.selectProjectile(t_type);
engine.hideWeaponSelect(((__currentTurn == 1) ? "left" : "right"));
__state = "aim";
engine.showClickHD();
}
function update(el) {
if (__CPU) {
runAI(el);
}
cam.remoteScale = true;
if (__state == "fly") {
__deadProjectileCounter = 0;
loop = a_projectiles.length;
while (loop--) {
a_projectiles[loop].fullUpdate(el);
if (a_projectiles[loop].isAlive) {
if (pickup.isAlive) {
if (a_projectiles[loop].runHD_entity_box(pickup, el)) {
pickup.hitReact(a_projectiles[loop]);
}
}
if ((__canHit && (a_projectiles[loop].isAlive)) && (targetPlayer.runHD(a_projectiles[loop], el))) {
targetPlayer.hitReact(a_projectiles[loop]);
a_projectiles[loop].hitReact();
firingPlayer.addScore((a_projectiles[loop].damage * 100) * firingPlayer.combo);
if (__CPU) {
firingPlayer.updatePrevScore();
}
__horizon.mc.gotoAndPlay("flash");
__didHit = true;
}
if ((a_projectiles[loop].x > __RIGHTBOUNDS) || (a_projectiles[loop].x < __LEFTBOUNDS)) {
a_projectiles[loop].kill();
}
} else {
__deadProjectileCounter++;
}
}
if (trackingProjectile.y < 2600) {
cam.z = (trackingProjectile.y - 2600) / 20;
} else {
cam.z = 0;
}
if (__deadProjectileCounter == a_projectiles.length) {
if (__didHit) {
firingPlayer.combo++;
} else {
firingPlayer.combo = 1;
}
prepNextTurn();
}
} else if (__state == "charge") {
if (__chargeUp) {
__fireCharge = __fireCharge + el;
if (__fireCharge > 1) {
__fireCharge = 1;
__chargeUp = false;
}
} else {
__fireCharge = __fireCharge - el;
if (__fireCharge < 0) {
__fireCharge = 0;
__chargeUp = true;
}
}
if (cam.z < 0) {
cam.z = cam.z + (el * 100);
}
if (cam.z > 0) {
cam.z = 0;
}
firingPlayer.mc.catapult.launcher.meter.gotoAndStop(Math.ceil(100 * __fireCharge));
} else if (__state == "aim") {
if (cam.z < 0) {
cam.z = cam.z + (el * 100);
}
if (cam.z > 0) {
cam.z = 0;
}
if (!__CPU) {
updateFireAngle();
if (__currentTurn == 1) {
__fireAngle_frame = 90 + __fireAngle;
} else {
__fireAngle_frame = 90 - (__fireAngle - 180);
}
if (__fireAngle_frame < 0) {
__fireAngle_frame = 90;
} else if (__fireAngle_frame > 90) {
__fireAngle_frame = 0;
}
firingPlayer.mc.catapult.gotoAndStop(Math.floor(__fireAngle_frame));
}
} else if (__state == "catapult") {
if (firingPlayer.mc.catapult._currentFrame > 100) {
fireProjectile();
}
} else if (__state == "looking") {
if (cam.z < -289) {
cam.z = -290;
__lookTimer = __lookTimer - el;
if (__lookTimer <= 0) {
cancelLook();
}
}
} else if (__state == "nextTurn") {
if (__turnTimer > 0) {
__turnTimer = __turnTimer - el;
} else {
nextTurn();
}
}
var _local3;
loop = a_effects.length;
while (loop--) {
_local3 = a_effects[loop];
if (!_local3.isAlive) {
a_effects.splice(loop, 1);
}
_local3.fullUpdate(el);
}
}
function runAI(el) {
if (__state == "aim") {
__CPUtimer = __CPUtimer - el;
if (__CPUtimer < 0) {
__state = "fire";
}
} else if (__state == "fire") {
firingPlayer.mc.catapult.launcher.meter.gotoAndStop(Math.ceil(100 * __fireCharge));
firingPlayer.mc.catapult.gotoAndStop(Math.floor(__fireAngle_frame));
engine.hideClickHD();
releaseProjectile();
} else if (__state == "catapult") {
if (firingPlayer.mc.catapult._currentFrame > 100) {
fireProjectile();
engine.hideCPUTurn();
}
}
}
function createEffect(t_data) {
if (t_data.grav) {
t_data.grav = gravity;
}
t_data.owner = this;
var _local2 = new smashing.keithm.Effect();
_local2.init(t_data);
_local2.spawn();
a_effects.push(_local2);
}
function look() {
engine.playSound("look");
engine.hideLookButton();
if (__state == "weaponSelect") {
engine.hideWeaponSelect(((__currentTurn == 1) ? "left" : "right"));
}
__state = "looking";
__lookTimer = __LOOK_TIMER;
engine.setCameraTarget(new smashing.Point3D(1290, 2350, -300));
}
function pickup_health() {
firingPlayer.heal();
firingPlayer.addScore(150);
engine.playSound("heal");
}
function pickup_damage(t_proj) {
t_proj.powerUp();
firingPlayer.addScore(150);
engine.playSound("damage");
}
function cancelLook() {
engine.showLookButton(((__currentTurn == 1) ? "left" : "right"));
__state = "weaponSelect";
engine.goWeaponSelect(firingPlayer, ((__currentTurn == 1) ? "left" : "right"));
engine.setCameraTrack({element:firingPlayer, xoffset:0, yoffset:0, zoffset:-100, scrollz:true, dozpad:false, topPad:500, bottomPad:500, easey:50, easyx:50, easez:0, leftlimit:__CAM_LEFTBOUNDS, rightlimit:__CAM_RIGHTBOUNDS, bottomlimit:__CAM_BOTTOMBOUNDS});
}
function startCharge() {
if (__CPU || ((!__CPU) && (__state != "aim"))) {
return(undefined);
}
__state = "charge";
__chargeUp = true;
updateFireAngle();
engine.hideLookButton();
if (isNaN(__fireAngle)) {
__fireAngle = 120;
trace("Fire Angle NAN");
}
engine.hideClickHD();
}
function updateFireAngle() {
var _local2 = firingPlayer.__get__catapultPoint();
__fireAngle = Math.atan((_local2.y - (_ymouse + cam.edges.t)) / (_local2.x - (_xmouse + cam.edges.l))) * 57.2957795130823;
if (_xmouse < _local2.x) {
__fireAngle = __fireAngle + 180;
}
if (__currentTurn == 1) {
if ((__fireAngle > 220) || (__fireAngle < -90)) {
__fireAngle = -90;
} else if (__fireAngle > -10) {
__fireAngle = -10;
}
} else if (__fireAngle < 145) {
__fireAngle = 270;
} else if (__fireAngle < 190) {
__fireAngle = 190;
}
}
function releaseCharge() {
if (__state != "charge") {
return(undefined);
}
releaseProjectile();
}
function releaseProjectile() {
firingPlayer.fireProjectile();
__state = "catapult";
}
function fireProjectile() {
if (firingPlayer.selectedProjectile == "rain") {
trackingProjectile = new nick.avatarfortfight.ents.Projectile_Rain();
} else if (firingPlayer.selectedProjectile == "explode") {
trackingProjectile = new nick.avatarfortfight.ents.Projectile_Explode();
} else {
trackingProjectile = new nick.avatarfortfight.ents.Projectile_Heavy();
}
a_projectiles.push(trackingProjectile);
refreshRenderArray();
var _local2 = firingPlayer.__get__catapultPoint();
trackingProjectile.init({character:firingPlayer.character, x:_local2.x, y:_local2.y, owner:this});
trackingProjectile.spawn();
if (!__CPU) {
if (__currentTurn == 1) {
__fireAngle = -10 + (__fireAngle * 0.6);
} else {
__fireAngle = 190 + ((90 - (270 - __fireAngle)) * 0.6);
}
__fireAngle = Math.round(__fireAngle);
__fireCharge = Math.round(__fireCharge * 1000) / 1000;
if (__fireCharge > 0.955) {
trace("crit!");
__fireCharge = 1.2;
} else if (__fireCharge > 0.1) {
if (firingPlayer.selectedProjectile == "heavy") {
__fireCharge = 0.15 + (Math.round((0.85 * __fireCharge) * 1000) / 1000);
} else {
__fireCharge = 0.3 + (Math.round((0.7 * __fireCharge) * 1000) / 1000);
}
} else {
trace("miss.");
__fireCharge = 0.05;
}
}
trackingProjectile.launch(__fireCharge, __fireAngle);
engine.setCameraTrack({element:trackingProjectile, xoffset:0, yoffset:120, topPad:50, bottomPad:50, easey:20, easyx:100, leftlimit:__CAM_LEFTBOUNDS, rightlimit:__CAM_RIGHTBOUNDS, bottomlimit:__CAM_BOTTOMBOUNDS});
firingPlayer.emptyProjectile();
__state = "fly";
}
function spawnRain(t_projectile) {
var _local2;
var _local5 = t_projectile.velocity.x;
var _local4 = Math.abs(targetPlayer.x - t_projectile.peakPoint.x);
ploop = 0;
while (ploop < 3) {
_local2 = new nick.avatarfortfight.ents.Projectile_Shrapnel();
_local2.init({character:firingPlayer.character, x:t_projectile.peakPoint.x, y:t_projectile.peakPoint.y, owner:this});
_local2.spawn();
if (t_projectile.isPoweredUp) {
_local2.powerUp();
}
_local2.spray(_local5);
a_projectiles.push(_local2);
if ((_local4 < 500) && (ploop == 0)) {
trackingProjectile = _local2;
} else if (((_local4 > 500) && (_local4 < 900)) && (ploop == 1)) {
trackingProjectile = _local2;
} else if (ploop == 2) {
trackingProjectile = _local2;
}
_local5 = _local5 + t_projectile.velocity.x;
ploop++;
}
refreshRenderArray();
engine.setCameraTrack({element:trackingProjectile, xoffset:0, yoffset:120, topPad:50, bottomPad:50, easey:20, easyx:100, leftlimit:__CAM_LEFTBOUNDS, rightlimit:__CAM_RIGHTBOUNDS, bottomlimit:__CAM_BOTTOMBOUNDS});
}
function spawnPickup(t_x, t_y, t_type) {
if ((t_type == undefined) || (t_type == 0)) {
if (Math.random() > 0.5) {
pickup = new nick.avatarfortfight.ents.Pickup_Health();
} else {
pickup = new nick.avatarfortfight.ents.Pickup_Damage();
}
} else if (t_type == 1) {
pickup = new nick.avatarfortfight.ents.Pickup_Health();
} else {
pickup = new nick.avatarfortfight.ents.Pickup_Damage();
}
if (__currentTurn == 1) {
if (t_x == undefined) {
t_x = 500 + (Math.random() * 800);
}
} else if (t_x == undefined) {
t_x = 1800 - (Math.random() * 800);
}
if (t_y == undefined) {
t_y = 2300 - (Math.random() * 350);
}
t_x = Math.round(t_x);
t_y = Math.round(t_y);
pickup.init({x:t_x, y:t_y, owner:this});
pickup.spawn();
refreshRenderArray();
}
function prepNextTurn() {
pickup.despawn();
__state = "nextTurn";
if (!targetPlayer.__get__isKeepStanding()) {
__turnTimer = __NEXT_TURN_DELAY * 2;
} else {
__turnTimer = __NEXT_TURN_DELAY;
}
}
function generate() {
playerOne = null;
playerTwo = null;
if (engine.playerOneCharacter == "earth") {
playerOne = new nick.avatarfortfight.ents.Player_Earth();
} else if (engine.playerOneCharacter == "water") {
playerOne = new nick.avatarfortfight.ents.Player_Water();
} else if (engine.playerOneCharacter == "fire") {
playerOne = new nick.avatarfortfight.ents.Player_Fire();
}
playerOne.init({x:170, y:2915, owner:this});
playerOne.spawn();
if (engine.playerTwoCharacter == "earth") {
playerTwo = new nick.avatarfortfight.ents.Player_Earth();
} else if (engine.playerTwoCharacter == "water") {
playerTwo = new nick.avatarfortfight.ents.Player_Water();
} else if (engine.playerTwoCharacter == "fire") {
playerTwo = new nick.avatarfortfight.ents.Player_Fire();
}
playerTwo.init({x:2270, y:2915, owner:this, flip:true});
playerTwo.spawn();
var _local4 = [];
_local4.push({type:"scenery", asset:"bg_horizon", x:-1600, y:4100, z:600});
_local4.push({type:"scenery", asset:"bg_" + playerOne.character, x:playerOne.x - 20, y:3100, z:150});
_local4.push({type:"scenery", asset:"bg_land_" + playerOne.character, x:playerOne.x + 130, y:3000});
_local4.push({type:"scenery", asset:"bg_" + playerTwo.character, x:playerTwo.x, y:3100, z:150, flip:true});
_local4.push({type:"scenery", asset:"bg_land_" + playerTwo.character, x:playerTwo.x - 130, y:3000, flip:true});
a_projectiles = [];
a_scenery = [];
var _local2;
var _local5;
var _local3 = _local4.length;
while (_local3--) {
_local4[_local3].owner = this;
_local5 = false;
_local2 = new nick.avatarfortfight.ents.Scenery();
a_scenery.push(_local2);
_local2.init(_local4[_local3]);
_local2.spawn();
if (_local2.assetID == "bg_horizon") {
__horizon = _local2;
}
}
a_effects = [];
cameraData = {x:300, y:2400};
refreshRenderArray();
reset(false);
}
function continueFromData(t_data) {
if (t_data.charAt(0) == "2") {
__currentTurn = 1;
__activePlayer = 2;
} else {
__currentTurn = 2;
__activePlayer = 1;
}
playerOne.score = (playerOne.prevScore = engine.StringToNumber(t_data.slice(2, 7)));
playerOne.setHP(Number(t_data.charAt(7)), Number(t_data.charAt(8)), Number(t_data.charAt(9)));
playerOne.selectProjectile((playerOne.lastProjectile = getProjectileFromNumber(Number(t_data.charAt(20)))));
playerTwo.score = (playerTwo.prevScore = engine.StringToNumber(t_data.slice(11, 16)));
playerTwo.setHP(Number(t_data.charAt(16)), Number(t_data.charAt(17)), Number(t_data.charAt(18)));
playerTwo.selectProjectile((playerTwo.lastProjectile = getProjectileFromNumber(Number(t_data.charAt(21)))));
__CPU = true;
__CPUtimer = 2;
__state = "aim";
if (t_data.charAt(22) == "0") {
__fireAngle = Number(t_data.slice(23, 25));
} else {
__fireAngle = Number(t_data.slice(22, 25));
}
if (__currentTurn == 1) {
__fireAngle = __fireAngle * -1;
}
var _local3 = t_data.slice(25, 29);
__fireCharge = Number((_local3.substr(0, 1) + ".") + _local3.substr(1, 3));
if (t_data.charAt(29) == "1") {
__canHit = true;
} else {
__canHit = false;
}
if (t_data.charAt(19) == 0) {
__isPickupTurn = false;
} else {
__isPickupTurn = true;
}
if (__isPickupTurn) {
spawnPickup(engine.StringToNumber(t_data.slice(31, 35)), engine.StringToNumber(t_data.slice(35, 39)), Number(t_data.charAt(30)));
}
engine.hideLookButton();
}
function getSaveState() {
var _local2 = "";
_local2 = _local2 + playerOne.getSaveState();
_local2 = _local2 + playerTwo.getSaveState();
if (__isPickupTurn) {
_local2 = _local2 + "1";
} else {
_local2 = _local2 + "0";
}
_local2 = _local2 + String(getNumberFromProjectile(playerOne.lastProjectile));
_local2 = _local2 + String(getNumberFromProjectile(playerTwo.lastProjectile));
_local2 = _local2 + engine.NumberToString(Math.abs(__fireAngle), 3);
var _local3 = String(__fireCharge);
_local3 = _local3.charAt(0) + _local3.substr(2, 4);
_local2 = _local2 + _local3;
if (__didHit) {
_local2 = _local2 + "1";
} else {
_local2 = _local2 + "0";
}
if (__isPickupTurn) {
_local2 = _local2 + ((String(pickup.effectID) + engine.NumberToString(pickup.startX, 4)) + engine.NumberToString(pickup.startY, 4));
} else {
_local2 = _local2 + "000000000";
}
return(_local2);
}
function getProjectileFromNumber(t_num) {
if (t_num == 0) {
return("rain");
}
if (t_num == 1) {
return("explode");
}
if (t_num == 2) {
return("heavy");
}
return("pending");
}
function getNumberFromProjectile(t_proj) {
if (t_proj == "rain") {
return(0);
}
if (t_proj == "explode") {
return(1);
}
if (t_proj == "heavy") {
return(2);
}
return(3);
}
function refreshRenderArray() {
a_renderArray = [a_scenery, a_effects, a_projectiles, [playerOne, playerTwo, pickup]];
a_renderOnceArray = [];
}
function reset(t_resetObjects) {
__currentTurn = 1;
__activePlayer = 1;
if (t_resetObjects == undefined) {
t_resetObjects = true;
}
__isPickupTurn = false;
__didHit = false;
if (t_resetObjects) {
playerOne.reset();
playerTwo.reset();
pickup.despawn();
var _local3 = a_projectiles;
var _local2 = _local3.length;
while (_local2--) {
_local3[_local2].splice(_local2, 1);
}
_local3 = a_scenery;
_local2 = _local3.length;
while (_local2--) {
_local3[_local2].reset();
}
_local2 = a_effects.length;
while (_local2--) {
a_effects.splice(_local2, 1);
}
}
}
function pauseForMenu() {
trace("Pause for menu: " + __state);
if ((__state == "weaponSelect") && (!__CPU)) {
engine.hideLookButton();
engine.hideWeaponSelect(((__currentTurn == 1) ? "left" : "right"));
}
}
function unpauseFromMenu() {
if (__state == "weaponSelect") {
engine.showLookButton(((__currentTurn == 1) ? "left" : "right"));
engine.goWeaponSelect(firingPlayer, ((__currentTurn == 1) ? "left" : "right"));
}
}
function get currentTurn() {
return(__currentTurn);
}
function get state() {
return(__state);
}
var __NEXT_TURN_DELAY = 1.8;
var groundHeight = 2910;
var __CAM_RIGHTBOUNDS = 2400;
var __CAM_LEFTBOUNDS = 0;
var __CAM_BOTTOMBOUNDS = 3000;
var __RIGHTBOUNDS = 2500;
var __LEFTBOUNDS = -100;
var __BOTTOMBOUNDS = 3100;
var __LOOK_TIMER = 1;
}
Symbol 864 MovieClip [__Packages.smashing.keithm.Renderable] Frame 0
class smashing.keithm.Renderable
{
var baseWidth, baseHeight, hdWidth, hdHeight, radius, assetID, owner, __DEF_ASSET, startX, startY, startZ, zInfluence, isSpawned, x, y, z, mc, isDrawn, isAlive, isHidden, flag_eraseMe, __flag_scaleChanged, scale, startScale, hdReg;
function Renderable () {
baseWidth = __DEF_WIDTH;
baseHeight = __DEF_HEIGHT;
if (__USE_DIMENSIONS_AS_HD) {
hdWidth = baseWidth / 2;
hdHeight = baseHeight / 2;
radius = hdWidth;
} else {
hdWidth = __DEF_HD_WIDTH;
hdHeight = __DEF_HD_HEIGHT;
radius = __DEF_HD_WIDTH;
}
setHDRegistration();
}
function init(t_data) {
if (t_data.owner == undefined) {
trace("ERROR! NO OWNER SENT TO ELEMENT: " + assetID);
}
owner = t_data.owner;
if (t_data.asset == undefined) {
t_data.asset = __DEF_ASSET;
}
assetID = t_data.asset;
if (t_data.x == undefined) {
t_data.x = 0;
}
startX = t_data.x;
if (t_data.y == undefined) {
t_data.y = 0;
}
startY = t_data.y;
if (t_data.z == undefined) {
t_data.z = __DEF_Z;
}
startZ = t_data.z;
if (t_data.zInfluence == undefined) {
t_data.zInfluence = 0;
}
zInfluence = t_data.zInfluence;
isSpawned = false;
}
function get doUpdate() {
return(__DO_UPDATE);
}
function get drawWhenKilled() {
return(__DRAW_WHEN_KILLED);
}
function spawn() {
isSpawned = true;
reset();
}
function reset() {
x = startX;
y = startY;
z = startZ;
if (((mc == undefined) || (mc == Void)) || (mc == "")) {
isDrawn = false;
}
isAlive = true;
isHidden = false;
flag_eraseMe = false;
}
function onDraw(t_newmc, t_viewport) {
isDrawn = true;
mc = t_newmc;
if (isHidden) {
mc._visible = false;
}
if (__USE_ACTUAL_DIMENSIONS) {
baseWidth = mc._width;
baseHeight = mc._height;
setHDRegistration();
}
if (__USE_DIMENSIONS_AS_HD) {
hdWidth = baseWidth / 2;
hdHeight = baseHeight / 2;
radius = hdWidth;
}
__flag_scaleChanged = true;
mc._x = -1000 - baseWidth;
mc._y = -1000 - baseHeight;
}
function update(el) {
}
function move(el) {
}
function fullUpdate(el) {
}
function render(camera, t_scale) {
if (t_scale == undefined) {
t_scale = camera.fl / (z - camera.z);
}
mc._x = ((x - camera.x) * scale) + camera.sc.x;
mc._y = ((y - camera.y) * scale) + camera.sc.y;
if (__3D_SCALE) {
if (z < camera.z) {
return(undefined);
}
if (scale != t_scale) {
scale = t_scale;
mc._xscale = (mc._yscale = 100 * (1 + (scale - startScale)));
}
}
}
function renderDirect() {
mc._x = x;
mc._y = y;
}
function initScale(camera) {
startScale = (scale = camera.fl / (startZ - camera.startZ));
}
function onErase(t_viewport) {
flag_eraseMe = false;
isDrawn = false;
mc = undefined;
if (!isSpawned) {
return(undefined);
}
if (__KILL_ON_ERASE) {
kill();
}
}
function despawn() {
isAlive = false;
isSpawned = false;
flag_eraseMe = true;
}
function deleteMe() {
}
function kill() {
isAlive = false;
if ((!__DRAW_WHEN_KILLED) && (isDrawn)) {
flag_eraseMe = true;
}
}
function hide() {
mc._visible = false;
isHidden = true;
}
function show() {
mc._visible = true;
isHidden = false;
}
function setHDRegistration() {
hdReg = {};
hdReg.x = 0;
hdReg.y = 0;
}
function animate(t_frame, t_subFrame) {
mc.gotoAndStop(t_frame);
if (t_subFrame != undefined) {
mc.anim.gotoAndStop(t_subFrame);
}
}
function toString() {
return("Renderable: " + TYPE);
}
function drawHitBox() {
var _local3 = hdReg.x;
var _local4 = hdReg.y;
var _local2 = mc.createEmptyMovieClip("hitbox", 1);
_local2.beginFill(16751103, 50);
_local2.lineStyle(2, 16751103, 100);
_local2.moveTo(_local3 - hdWidth, _local4 - hdHeight);
_local2.lineTo(_local3 + hdWidth, _local4 - hdHeight);
_local2.lineTo(_local3 + hdWidth, _local4 + hdHeight);
_local2.lineTo(_local3 - hdWidth, _local4 + hdHeight);
_local2.lineTo(_local3 - hdWidth, _local4 - hdHeight);
_local2.endFill();
}
function drawReg() {
var _local2 = mc.createEmptyMovieClip("hitbox", 1);
_local2.beginFill(16751103, 50);
_local2.lineStyle(2, 16751103, 100);
_local2.moveTo(-5, -5);
_local2.lineTo(5, -5);
_local2.lineTo(5, 5);
_local2.lineTo(-5, 5);
_local2.lineTo(-5, -5);
}
var TYPE = "element";
var DRAWTYPE = "element";
var CUSTOMDRAW = false;
var __DEF_Z = 100;
var __3D_SCALE = false;
var __DEF_WIDTH = 50;
var __DEF_HEIGHT = 50;
var __USE_ACTUAL_DIMENSIONS = true;
var __DEF_HD_WIDTH = 25;
var __DEF_HD_HEIGHT = 25;
var __USE_DIMENSIONS_AS_HD = true;
var __DRAW_WHEN_KILLED = true;
var __KILL_ON_ERASE = false;
var __DO_UPDATE = true;
}
Symbol 865 MovieClip [__Packages.smashing.keithm.Element] Frame 0
class smashing.keithm.Element extends smashing.keithm.Renderable
{
var mass, bounciness, startSpin, startVelocity, owner, startGravity, velocity, gravityVector, rotation, spin, isSpinning, nextX, x, nextY, y, nextZ, z, mc, hdReg, radius, hdWidth, hdHeight, TYPE;
function Element () {
super();
}
function init(t_data) {
super.init(t_data);
if (t_data.mass == undefined) {
mass = __DEF_MASS;
} else {
mass = t_data.mass;
}
if (t_data.bounce == undefined) {
bounciness = __DEF_BOUNCY;
} else {
bounciness = t_data.bounce;
}
if (t_data.spin != undefined) {
startSpin = t_data.spin;
} else {
startSpin = 0;
}
if (t_data.move != undefined) {
startVelocity = t_data.move;
} else {
startVelocity = new smashing.Point3D(0, 0, 0);
}
if (owner.gravity != undefined) {
startGravity = owner.gravity;
} else {
startGravity = new smashing.Point3D(0, 0, 0);
}
}
function reset() {
velocity = startVelocity;
gravityVector = startGravity;
rotation = 0;
spin = startSpin;
if (startSpin == 0) {
isSpinning = false;
} else {
isSpinning = true;
}
super.reset();
}
function update(el) {
if (__USE_GRAVITY) {
addVelocity(gravityVector, el);
}
if (spin != 0) {
isSpinning = true;
}
rotation = rotation + (spin * el);
nextX = x + (velocity.x * el);
nextY = y + (velocity.y * el);
nextZ = z + (velocity.z * el);
}
function move(el) {
x = x + (velocity.x * el);
y = y + (velocity.y * el);
z = z + (velocity.z * el);
}
function fullUpdate(el) {
if (__USE_GRAVITY) {
addVelocity(gravityVector, el);
}
if (spin != 0) {
isSpinning = true;
}
rotation = rotation + (spin * el);
nextX = (x = x + (velocity.x * el));
nextY = (y = y + (velocity.y * el));
nextZ = (z = z + (velocity.z * el));
}
function render(camera) {
super.render(camera);
if (isSpinning) {
mc._rotation = rotation;
isSpinning = false;
}
}
function runHD_entity_radius(t_target, el) {
var _local4 = (nextX + hdReg.x) - ((t_target.x + (t_target.velocity.x * el)) + t_target.hdReg.x);
var _local3 = (nextY + hdReg.y) - ((t_target.y + (t_target.velocity.y * el)) + t_target.hdReg.y);
var _local5 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
if (_local5 <= (t_target.radius + radius)) {
return(true);
}
return(false);
}
function runHD_entity_box(t_target, el) {
var _local3 = {x:false, y:false};
if (Math.abs((nextX + hdReg.x) - ((t_target.x + (t_target.velocity.x * el)) + t_target.hdReg.x)) < (hdWidth + t_target.hdWidth)) {
_local3.x = true;
}
if (Math.abs((nextY + hdReg.y) - ((t_target.y + (t_target.velocity.y * el)) + t_target.hdReg.y)) < (hdHeight + t_target.hdHeight)) {
_local3.y = true;
}
if (_local3.x && (_local3.y)) {
return(true);
}
return(false);
}
function runHD_entity_3D(t_target, el) {
var _local3 = z - t_target.z;
var _local2 = (nextZ + radius) - t_target.z;
if ((_local3 * _local2) <= 0) {
return(runHD_entity_radius(t_target, el));
}
return(false);
}
function runHD_line_sphere(t_lineStart, t_lineEnd, el) {
var _local4 = new smashing.Point3D(t_lineStart.x, t_lineStart.y, 0);
var _local3 = new smashing.Point3D(t_lineEnd.x, t_lineEnd.y, 0);
var _local6 = _local4.x - _local3.x;
var _local7 = _local4.y - _local3.y;
var _local2 = getLineSeperation(_local3, {x:x, y:y}, _local6, _local7);
var _local5;
if (_local2.distance <= radius) {
_local5 = new smashing.Point3D(x + _local2.xSeparation, y + _local2.ySeparation);
return(true);
}
_local5.x = (_local5.y = 0);
return(false);
}
function runHD_line_sphere_complex(t_lineStart, t_lineEnd, el) {
var _local5 = new smashing.Point3D(t_lineStart.x, t_lineStart.y, 0);
var _local7 = new smashing.Point3D(t_lineEnd.x, t_lineEnd.y, 0);
var _local8;
var _local16 = getDistBetween(_local5, {x:x, y:y});
var _local15 = getDistBetween(_local7, {x:x, y:y});
var _local11 = getDistBetween(_local5, _local7);
var _local4 = new smashing.Point3D(_local5.x, _local5.y);
var _local9 = new smashing.Point3D(_local7.x, _local7.y);
var _local12 = _local9.x - _local4.x;
var _local13 = _local9.y - _local4.y;
var _local3 = _local12 / _local11;
var _local2 = _local13 / _local11;
var _local10;
_local4.subtractScalarMe(_local3 * radius, _local2 * radius);
_local9.addScalarMe(_local3 * radius, _local2 * radius);
var _local6 = getLineSeperation(_local5, {x:x, y:y}, _local12, _local13);
_local12 = _local9.x - _local4.x;
_local13 = _local9.y - _local4.y;
var _local14 = getLineSeperation(_local4, {x:x, y:y}, _local12, _local13);
if (_local6.distance <= radius) {
if (_local15 > _local11) {
_local8 = Math.sqrt((radius * radius) - (_local14.distance * _local14.distance));
_local3 = _local3 * _local8;
_local2 = _local2 * _local8;
(x + _local14.xSeparation) + _local3;
_local10 = (y + _local14.ySeparation) + _local2;
} else {
_local8 = Math.sqrt((radius * radius) - (_local6.distance * _local6.distance));
_local3 = _local3 * _local8;
_local2 = _local2 * _local8;
(x + _local6.xSeparation) + _local3;
_local10 = (y + _local6.ySeparation) + _local2;
if (getDistBetween(_local5, _local10) >= _local11) {
_local10.copy(_local7);
}
}
return(true);
}
_local10.x = (_local10.y = 0);
return(false);
}
function getLineSeperation(p0, s, dx, dy) {
var _local1 = new Object();
var _local5 = p0.x - s.x;
var _local6 = p0.y - s.y;
var _local7 = (dx * dx) + (dy * dy);
var _local2 = (-((_local5 * dx) + (_local6 * dy))) / _local7;
_local2 = Math.min(Math.max(_local2, 0), 1);
_local1.xSeparation = _local5 + (_local2 * dx);
_local1.ySeparation = _local6 + (_local2 * dy);
_local1.distance = Math.sqrt((_local1.xSeparation * _local1.xSeparation) + (_local1.ySeparation * _local1.ySeparation));
return(_local1);
}
function getDistBetween(p0, p1) {
return(Math.sqrt((p1.x - p0.x) * (p1.x - p0.x)) + ((p1.y - p0.y) * (p1.y - p0.y)));
}
function hitReact(t_target) {
}
function replaceVelocity(t_vector) {
velocity = t_vector.copy();
}
function inputVelocity(t_vector) {
velocity.x = velocity.x + t_vector.x;
velocity.y = velocity.y + t_vector.y;
velocity.z = velocity.z + t_vector.z;
}
function addVelocity(t_vector, el, maxVelocity, xMult, yMult, zMult) {
if (maxVelocity == undefined) {
maxVelocity = __MAX_VELOCITY;
}
zMult = 1;
yMult = zMult;
xMult = yMult;
if ((Math.abs(velocity.x) < maxVelocity) || ((velocity.x * t_vector.x) < 0)) {
velocity.x = velocity.x + ((t_vector.x * el) * xMult);
}
if ((Math.abs(velocity.y) < maxVelocity) || ((velocity.y * t_vector.y) < 0)) {
velocity.y = velocity.y + ((t_vector.y * el) * yMult);
}
if ((Math.abs(velocity.z) < maxVelocity) || ((velocity.z * t_vector.z) < 0)) {
velocity.z = velocity.z + ((t_vector.z * el) * zMult);
}
}
function decelVelocityX(el, t_friction) {
if (t_friction == undefined) {
t_friction = 1;
}
if (velocity.x < 0) {
velocity.x = velocity.x + ((__DECELERATION_DECAY * t_friction) * el);
if (velocity.x > 0) {
velocity.x = 0;
}
return(undefined);
}
velocity.x = velocity.x - ((__DECELERATION_DECAY * t_friction) * el);
if (velocity.x < 0) {
velocity.x = 0;
}
}
function decelVelocityY(el, t_friction) {
if (t_friction == undefined) {
t_friction = 1;
}
if (velocity.y < 0) {
velocity.y = velocity.y + ((__DECELERATION_DECAY * t_friction) * el);
if (velocity.y > 0) {
velocity.y = 0;
}
return(undefined);
}
velocity.y = velocity.y - ((__DECELERATION_DECAY * t_friction) * el);
if (velocity.y < 0) {
velocity.y = 0;
}
}
function decelVelocityZ(el, t_friction) {
if (t_friction == undefined) {
t_friction = 1;
}
if (velocity.z < 0) {
velocity.z = velocity.z + ((__DECELERATION_DECAY * t_friction) * el);
if (velocity.z > 0) {
velocity.z = 0;
}
return(undefined);
}
velocity.z = velocity.z - ((__DECELERATION_DECAY * t_friction) * el);
if (velocity.z < 0) {
velocity.z = 0;
}
}
function decayVelocityX(t_decay) {
if (t_decay == undefined) {
t_decay = __COLLISION_DECAY;
}
if (bounciness) {
t_decay = t_decay / bounciness;
}
velocity.x = velocity.x * (1 - t_decay);
}
function decayVelocityY(t_decay) {
if (t_decay == undefined) {
t_decay = __COLLISION_DECAY;
}
if (bounciness) {
t_decay = t_decay / bounciness;
}
velocity.y = velocity.y * (1 - t_decay);
}
function decayVelocityZ(t_decay) {
if (t_decay == undefined) {
t_decay = __COLLISION_DECAY;
}
if (bounciness) {
t_decay = t_decay / bounciness;
}
velocity.z = velocity.z * (1 - t_decay);
}
function invertVelocityX() {
velocity.x = velocity.x * -1;
}
function invertVelocityY() {
velocity.y = velocity.y * -1;
}
function invertVelocityZ() {
velocity.z = velocity.z * -1;
}
function magnitudeToVector(t_magnitude, t_angle) {
var _local2;
var _local1;
var _local3 = t_angle * (Math.PI/180);
_local2 = t_magnitude * Math.cos(_local3);
_local2 = Math.round(_local2 * 100) / 100;
_local1 = t_magnitude * Math.sin(_local3);
_local1 = Math.round(_local1 * 100) / 100;
return(new smashing.Point3D(_local2, _local1, 0));
}
function toString() {
return("Element: " + TYPE);
}
var __DEF_MASS = 1;
var __DEF_BOUNCY = 1;
var __USE_GRAVITY = false;
var __MAX_VELOCITY = 300;
var __DECELERATION_DECAY = 100;
var __COLLISION_DECAY = 0.25;
var __DO_UPDATE = true;
}
Symbol 866 MovieClip [__Packages.nick.avatarfortfight.Entity] Frame 0
class nick.avatarfortfight.Entity extends smashing.keithm.Element
{
var __FLIP_X, scale, x, mc, y, isSpinning, rotation, z, newScale, startScale, animate;
function Entity () {
super();
}
function get flip() {
return(__FLIP_X);
}
function init(t_data) {
super.init(t_data);
__FLIP_X = 1;
if (t_data.flip == true) {
__FLIP_X = -1;
}
}
function reset() {
super.reset();
}
function fullUpdate(el) {
super.fullUpdate(el);
}
function update(el) {
super.update(el);
}
function move(el) {
super.move(el);
}
function render(camera) {
mc._x = ((x - camera.x) * scale) + camera.sc.x;
mc._y = ((y - camera.y) * scale) + camera.sc.y;
if (isSpinning) {
mc._rotation = rotation;
isSpinning = false;
}
if (__3D_SCALE) {
if (z < camera.z) {
return(undefined);
}
newScale = camera.fl / (z - camera.z);
if (scale != newScale) {
scale = newScale;
mc._xscale = (mc._yscale = 100 * (1 + (scale - startScale)));
mc._xscale = mc._xscale * __FLIP_X;
}
}
}
function onDraw(t_newmc) {
super.onDraw(t_newmc);
mc._xscale = 100 * __FLIP_X;
animate("idle");
}
function hitReact(t_target) {
}
var DRAW_WHEN_KILLED = false;
var __KILL_ON_ERASE = false;
var __3D_SCALE = true;
var __USE_GRAVITY = true;
var __DO_UPDATE = true;
}
Symbol 867 MovieClip [__Packages.nick.avatarfortfight.ents.Player] Frame 0
class nick.avatarfortfight.ents.Player extends nick.avatarfortfight.Entity
{
var __FLIP_X, __particleDirection, __wallPrevHP, __wallHP, __towerPrevHP, __towerHP, __keepPrevHP, __keepHP, lastProjectile, selectedProjectile, mc, __invincible_timer, y, x, owner, __drawArrow, combo, score, prevScore, character;
function Player () {
super();
}
function beginTurn() {
if (__FLIP_X > 0) {
__particleDirection = -1;
} else {
__particleDirection = 1;
}
__wallPrevHP = __wallHP;
__towerPrevHP = __towerHP;
__keepPrevHP = __keepHP;
}
function pickRandomWeapon() {
if (Math.random() > 0.5) {
selectProjectile("rain");
} else {
selectProjectile("explode");
}
if (selectedProjectile == lastProjectile) {
selectProjectile("heavy");
}
}
function selectProjectile(t_type) {
selectedProjectile = t_type;
mc.catapult.projectile_mc.gotoAndStop(t_type);
}
function get isInvincible() {
return(((__invincible_timer > 0) ? true : false));
}
function runHD(t_projectile, el) {
if (t_projectile.hitTest(mc)) {
var _local3;
if ((y - t_projectile.y) > __KEEP_HEIGHT) {
trace("damage tower");
if (__towerHP <= 0) {
return(false);
}
spawnRoofParticles(t_projectile);
_local3 = Math.ceil(__towerHP / 2);
__towerHP = __towerHP - t_projectile.damage;
if (__towerHP < 0) {
__towerHP = 0;
}
if (_local3 != Math.ceil(__towerHP / 2)) {
mc.tower.gotoAndPlay(Math.ceil(__towerHP / 2) + "collapse");
}
} else if ((t_projectile.isGroundExplode() && (__wallHP > 0)) || ((!t_projectile.isGroundExplode()) && ((__FLIP_X * (x - t_projectile.x)) < (-__KEEP_HALFWIDTH)))) {
trace("damage wall");
if (__wallHP <= 0) {
return(false);
}
spawnWallParticles(t_projectile);
_local3 = Math.ceil(__wallHP / 2);
__wallHP = __wallHP - t_projectile.damage;
if (__wallHP < 0) {
__wallHP = 0;
}
if (_local3 != Math.ceil(__wallHP / 2)) {
mc.wall.gotoAndPlay(Math.ceil(__wallHP / 2) + "collapse");
}
} else {
trace("damage keep");
spawnKeepParticles(t_projectile);
_local3 = getKeepFrame();
__keepHP = __keepHP - t_projectile.damage;
var _local4 = getKeepFrame();
if ((_local4 == 0) && (_local3 != 0)) {
mc.keep.gotoAndPlay("2collapse");
if (__wallHP > 0) {
__wallHP = 0;
mc.wall.gotoAndPlay("0collapse");
}
if (__towerHP > 0) {
__towerHP = 0;
mc.tower.gotoAndPlay("0collapse");
}
} else if ((_local3 != _local4) && (__towerHP <= 0)) {
mc.keep.gotoAndPlay(_local4 + "collapse");
}
}
owner.engine.playSound("fallout");
spawnGenericParticles(t_projectile);
owner.engine.requestUpdateUI();
return(true);
}
if (t_projectile.isExploded && (t_projectile.projType != "explode")) {
t_projectile.kill();
}
return(false);
}
function getKeepFrame() {
if ((__towerHP > 0) && (__keepHP > 0)) {
return(4);
}
if (__keepHP > (__MAX_HP / 2)) {
return(4);
}
if (__keepHP > 0) {
return(3);
}
return(0);
}
function spawnRoofParticles(t_projectile) {
owner.createEffect({asset:__particle1Asset, x:x - 5, y:y - 150, grav:true, spin:-10, move:new smashing.Point3D((__FLIP_X * Math.random()) * 100, -120 - (Math.random() * 20), -140)});
owner.createEffect({asset:__particle2Asset, x:x + 5, y:y - 150, grav:true, spin:-180, move:new smashing.Point3D((__FLIP_X * Math.random()) * 100, -90 - (Math.random() * 20), 0)});
owner.createEffect({asset:__particle1Asset, x:x - 15, y:y - 155, grav:true, spin:-100, move:new smashing.Point3D((__FLIP_X * Math.random()) * 100, -140 - (Math.random() * 20), -40)});
owner.createEffect({asset:__particle2Asset, x:x + 10, y:y - 165, grav:true, spin:70, move:new smashing.Point3D((__FLIP_X * Math.random()) * 90, -50 - (Math.random() * 50), 0)});
}
function spawnWallParticles(t_projectile) {
owner.createEffect({asset:__particle1Asset, x:x + (40 * __FLIP_X), y:y - 25, grav:true, spin:-10, move:new smashing.Point3D((__FLIP_X * Math.random()) * 80, -120 - (Math.random() * 20), -140)});
owner.createEffect({asset:__particle2Asset, x:x + (40 * __FLIP_X), y:y - 25, grav:true, spin:-180, move:new smashing.Point3D((__FLIP_X * Math.random()) * 70, -90 - (Math.random() * 20), 0)});
owner.createEffect({asset:__particle1Asset, x:x + (40 * __FLIP_X), y:y - 25, grav:true, spin:-100, move:new smashing.Point3D((__FLIP_X * Math.random()) * 100, -140 - (Math.random() * 50), -40)});
owner.createEffect({asset:__particle2Asset, x:x + (40 * __FLIP_X), y:y - 25, grav:true, spin:70, move:new smashing.Point3D((__FLIP_X * Math.random()) * 90, -50 - (Math.random() * 50), 0)});
}
function spawnKeepParticles(t_projectile) {
owner.createEffect({asset:__particle1Asset, x:x - 5, y:y - 60, grav:true, spin:-10, move:new smashing.Point3D(__FLIP_X * (30 + (Math.random() * 70)), -120 - (Math.random() * 20), -140)});
owner.createEffect({asset:__particle2Asset, x:x + 5, y:y - 60, grav:true, spin:-180, move:new smashing.Point3D(__FLIP_X * (20 + (Math.random() * 70)), -90 - (Math.random() * 20), 0)});
owner.createEffect({asset:__particle1Asset, x:x - 15, y:y - 55, grav:true, spin:-100, move:new smashing.Point3D(__FLIP_X * (20 + (Math.random() * 80)), -140 - (Math.random() * 20), -40)});
owner.createEffect({asset:__particle2Asset, x:x + 10, y:y - 55, grav:true, spin:70, move:new smashing.Point3D(__FLIP_X * (10 + (Math.random() * 60)), -50 - (Math.random() * 50), 0)});
owner.createEffect({asset:__particle3Asset, x:x - 25, y:y - 65, grav:true, spin:-100, move:new smashing.Point3D((__FLIP_X * Math.random()) * 80, -40 - (Math.random() * 20), -50)});
owner.createEffect({asset:__particle3Asset, x:x + 20, y:y - 65, grav:true, spin:70, move:new smashing.Point3D((__FLIP_X * Math.random()) * 20, -50 - (Math.random() * 30), -80)});
}
function spawnGenericParticles(t_projectile) {
owner.createEffect({asset:__particle1Asset, x:t_projectile.x - 5, y:t_projectile.y + 5, grav:true, spin:-100, move:new smashing.Point3D((__FLIP_X * Math.random()) * 140, -160 - (Math.random() * 20), -100)});
owner.createEffect({asset:__particle3Asset, x:t_projectile.x - 15, y:t_projectile.y + 5, grav:true, spin:70, move:new smashing.Point3D((__FLIP_X * Math.random()) * 60, -50 - (Math.random() * 70), 0)});
owner.createEffect({asset:__particle2Asset, x:t_projectile.x - 5, y:t_projectile.y - 5, grav:true, spin:200, move:new smashing.Point3D((__FLIP_X * Math.random()) * 200, -130 - (Math.random() * 20), -50)});
owner.createEffect({asset:__particle2Asset, x:t_projectile.x + 10, y:t_projectile.y, grav:true, spin:140, move:new smashing.Point3D((__FLIP_X * Math.random()) * 80, -110 - (Math.random() * 20), 50)});
}
function onDraw(t_newmc) {
super.onDraw(t_newmc);
mc.tower.gotoAndStop(String(Math.ceil(__towerHP / 2)) + "idle");
mc.wall.gotoAndStop(String(Math.ceil(__wallHP / 2)) + "idle");
mc.keep.gotoAndStop(String(getKeepFrame()) + "idle");
if (selectedProjectile != undefined) {
mc.catapult.projectile_mc.gotoAndStop(selectedProjectile);
} else {
mc.catapult.projectile_mc.gotoAndStop("empty");
}
}
function fireProjectile() {
mc.catapult.gotoAndPlay("launch");
}
function emptyProjectile() {
lastProjectile = selectedProjectile;
selectedProjectile = "empty";
}
function fullUpdate(el) {
super.fullUpdate(el);
if (__invincible_timer > 0) {
__invincible_timer = __invincible_timer - el;
}
}
function update(el) {
super.update(el);
if (__invincible_timer > 0) {
__invincible_timer = __invincible_timer - el;
}
}
function reset() {
__invincible_timer = 0;
__wallHP = (__wallPrevHP = __MAX_HP);
__towerHP = (__towerPrevHP = __MAX_HP);
__keepHP = (__keepPrevHP = __MAX_HP);
__drawArrow = false;
combo = 1;
score = (prevScore = 0);
selectedProjectile = "empty";
super.reset();
}
function setHP(t_wall, t_tower, t_keep) {
__wallHP = (__wallPrevHP = t_wall);
__towerHP = (__towerPrevHP = t_tower);
__keepHP = (__keepPrevHP = t_keep);
}
function invincible() {
__invincible_timer = __INVINCIBLE_MAX;
}
function heal() {
if (__keepHP < __MAX_HP) {
__keepHP = __keepHP + 2;
if (__keepHP > __MAX_HP) {
__keepHP = __MAX_HP;
}
} else if (__towerHP < __MAX_HP) {
__towerHP = __towerHP + 2;
if (__towerHP > __MAX_HP) {
__towerHP = __MAX_HP;
}
} else {
__wallHP = __wallHP + 2;
if (__wallHP > __MAX_HP) {
__wallHP = __MAX_HP;
}
}
}
function get catapultPoint() {
if (__FLIP_X < 0) {
return({x:x - __catapultOffsetX, y:y + __catapultOffsetY});
}
return({x:x + __catapultOffsetX, y:y + __catapultOffsetY});
}
function get targettingOrigin() {
return({x:x, y:y});
}
function get totalDamagePercent() {
if (__keepHP <= 0) {
return(100);
}
return(1 - (((__wallHP + __towerHP) + __keepHP) / 24));
}
function addScore(t_value) {
score = score + t_value;
owner.engine.requestUpdateUI();
}
function updatePrevScore() {
prevScore = score;
}
function get isKeepStanding() {
if (__keepHP > 0) {
return(true);
}
return(false);
}
function getSaveState() {
return((((String(owner.engine.getNumberFromCharacter(character)) + owner.engine.NumberToString(prevScore, 5)) + String(__wallPrevHP)) + String(__towerPrevHP)) + String(__keepPrevHP));
}
var TYPE = "player";
var DRAWTYPE = "player";
var __DEF_ASSET = "player_mc";
var __DEF_WIDTH = 500;
var __DEF_HEIGHT = 300;
var __USE_ACTUAL_DIMENSIONS = false;
var __INVINCIBLE_MAX = 0.5;
var __catapultOffsetX = 0;
var __catapultOffsetY = 0;
var __KEEP_HALFWIDTH = 140;
var __KEEP_HEIGHT = 100;
var __particle1Asset = "";
var __particle2Asset = "";
var __particle3Asset = "";
var __MAX_HP = 8;
}
Symbol 868 MovieClip [__Packages.nick.avatarfortfight.ents.Scenery] Frame 0
class nick.avatarfortfight.ents.Scenery extends nick.avatarfortfight.Entity
{
function Scenery () {
super();
}
var TYPE = "scenery";
var DRAWTYPE = "bg";
var __DEF_ASSET = "bg_tree";
var __DEF_BOUNCY = 0;
var __DEF_WIDTH = 400;
var __DEF_HEIGHT = 400;
var __USE_ACTUAL_DIMENSIONS = true;
var __USE_DIMENSIONS_AS_HD = true;
var __USE_GRAVITY = false;
var __DO_UPDATE = false;
}
Symbol 869 MovieClip [__Packages.smashing.keithm.Effect] Frame 0
class smashing.keithm.Effect extends smashing.keithm.Element
{
var startGravity, flag_HD, isDrawn, mc, kill;
function Effect () {
super();
}
function init(t_data) {
super.init(t_data);
if ((t_data.grav != undefined) && (t_data.grav != false)) {
startGravity = t_data.grav.copy();
} else {
startGravity = new smashing.Point3D(0, 0, 0);
}
flag_HD = true;
}
function update(el) {
if (isDrawn && (mc._currentFrame == mc._totalFrames)) {
kill();
return(undefined);
}
super.update(el);
}
function fullUpdate(el) {
if (isDrawn && (mc._currentFrame == mc._totalFrames)) {
kill();
return(undefined);
}
super.fullUpdate(el);
}
var TYPE = "effect";
var DRAWTYPE = "effect";
var __KILL_ON_ERASE = false;
var __DRAW_WHEN_KILLED = false;
var __USE_GRAVITY = true;
var __3D_SCALE = true;
var __DO_UPDATE = true;
}
Symbol 870 MovieClip [__Packages.nick.avatarfortfight.ents.Projectile] Frame 0
class nick.avatarfortfight.ents.Projectile extends nick.avatarfortfight.Entity
{
var assetID, __particle1Asset, __particle2Asset, __isExploded, startSpin, damage, isPoweredUp, mc, isAlive, __progress, __ratio, __pathLength, x, nextX, __targetPoint, startX, y, nextY, __peakPoint, startY, owner, spin, isSpinning, rotation, velocity, magnitudeToVector, __vertProgress, kill;
function Projectile () {
super();
}
function init(t_data) {
super.init(t_data);
assetID = (("proj_" + t_data.character) + __PROJTYPE) + "_mc";
__particle1Asset = t_data.character + "_part_1";
__particle2Asset = t_data.character + "_part_2";
__isExploded = false;
startSpin = 100;
damage = __BASE_DAMAGE;
isPoweredUp = false;
}
function onDraw(t_newmc) {
super.onDraw(t_newmc);
if (isPoweredUp) {
mc.damage_mc.gotoAndStop("on");
}
}
function fullUpdate(el) {
if (!isAlive) {
return(undefined);
}
__progress = __progress + (__FLIGHT_SPEED * el);
__ratio = __progress / __pathLength;
x = (nextX = startX + (__targetPoint.x * __ratio));
y = (nextY = startY + (__peakPoint.y * Math.sin(__ratio * __RADIAN)));
if ((y > owner.groundHeight) || (__ratio > 1.4)) {
y = owner.groundHeight;
explode();
}
if (spin != 0) {
isSpinning = true;
}
rotation = rotation + (spin * el);
}
function powerUp() {
damage++;
isPoweredUp = true;
mc.damage_mc.gotoAndStop("on");
}
function hitTest(t_mc) {
return(t_mc.hitTest(mc._x, mc._y, true));
}
function launch(t_charge, t_angle) {
velocity = magnitudeToVector(1, t_angle);
velocity.__set__length(__LAUNCH_VELOCITY * t_charge);
__peakPoint = new smashing.Point3D(velocity.x, velocity.y, 0);
__targetPoint = new smashing.Point3D(velocity.x * 2, Math.abs(owner.groundHeight - startY), 0);
__pathLength = __peakPoint.__get__length() + __peakPoint.subtractPoint(__targetPoint).__get__length();
__progress = (__vertProgress = __pathLength * __INITIAL_PROGRESS_RATIO);
trace((("Launch : " + __progress) + " / ") + __pathLength);
}
function explode() {
if (__isExploded) {
return(undefined);
}
__isExploded = true;
velocity = new smashing.Point3D(0, 0, 0);
spin = 0;
mc._rotation = 0;
mc.gotoAndPlay("explode");
spawnExplodeParticles();
}
function spawnExplodeParticles() {
owner.createEffect({asset:__particle1Asset, x:x - 8, y:y + 5, spin:110, grav:true, move:new smashing.Point3D(70 - (Math.random() * 140), -250 - (Math.random() * 60), 0)});
owner.createEffect({asset:__particle1Asset, x:x, y:y + 5, spin:-140, grav:true, move:new smashing.Point3D(70 - (Math.random() * 140), -200 - (Math.random() * 50), 0)});
}
function hitReact(t_target) {
explode();
kill();
}
function isGroundExplode() {
return(false);
}
function get peakPoint() {
return({x:startX + __peakPoint.x, y:startY + __peakPoint.y});
}
function get drawWhenKilled() {
return(false);
}
function get isExploded() {
return(__isExploded);
}
function get projType() {
return(__PROJTYPE);
}
var TYPE = "projectile";
var DRAWTYPE = "obstacle";
var __PROJTYPE = "";
var __DEF_ASSET = "";
var __DEF_WIDTH = 18;
var __DEF_HEIGHT = 18;
var __DEF_HD_WIDTH = 60;
var __DEF_HD_HEIGHT = 60;
var __USE_ACTUAL_DIMENSIONS = true;
var __USE_DIMENSIONS_AS_HD = false;
var __DRAW_WHEN_KILLED = true;
var __BASE_DAMAGE = 2;
var __LAUNCH_VELOCITY = 1900;
var __FLIGHT_SPEED = 600;
var __INITIAL_PROGRESS_RATIO = 0.05;
var __RADIAN = Math.PI;
}
Symbol 871 MovieClip [__Packages.nick.avatarfortfight.ents.Projectile_Rain] Frame 0
class nick.avatarfortfight.ents.Projectile_Rain extends nick.avatarfortfight.ents.Projectile
{
var __ratio, isAlive, owner, kill;
function Projectile_Rain () {
super();
}
function fullUpdate(el) {
super.fullUpdate(el);
if ((__ratio > 0.5) && (isAlive)) {
explode();
}
}
function explode() {
owner.spawnRain(this);
owner.engine.playSound("rain");
kill();
super.explode();
}
var __PROJTYPE = "Rain";
var __BASE_DAMAGE = 2;
var __LAUNCH_VELOCITY = 1750;
var __EXPLODE_DISTANCE = 700;
var __EXPLODE_HEIGHT = 2600;
}
Symbol 872 MovieClip [__Packages.nick.avatarfortfight.ents.Projectile_Explode] Frame 0
class nick.avatarfortfight.ents.Projectile_Explode extends nick.avatarfortfight.ents.Projectile
{
var __isExploded, mc, kill, owner, y;
function Projectile_Explode () {
super();
}
function fullUpdate(el) {
if (__isExploded) {
if (mc._currentFrame == mc._totalFrames) {
kill();
__isExploded = false;
}
return(undefined);
}
super.fullUpdate(el);
}
function hitTest(t_mc) {
if (__isExploded) {
return(t_mc.hitTest(mc));
}
return(t_mc.hitTest(mc._x, mc._y, true));
}
function explode() {
super.explode();
trace((("explode! " + y) + " < ") + owner.groundHeight);
if (y < owner.groundHeight) {
mc.gotoAndPlay("explode2");
}
owner.engine.playSound("explode");
}
function isGroundExplode() {
if (__isExploded) {
return(true);
}
return(false);
}
var __PROJTYPE = "Explode";
var __LAUNCH_VELOCITY = 1700;
var __BASE_DAMAGE = 3;
}
Symbol 873 MovieClip [__Packages.nick.avatarfortfight.ents.Projectile_Heavy] Frame 0
class nick.avatarfortfight.ents.Projectile_Heavy extends nick.avatarfortfight.ents.Projectile
{
var damage, isPoweredUp, mc, owner;
function Projectile_Heavy () {
super();
}
function powerUp() {
damage = damage + 2;
isPoweredUp = true;
mc.damage_mc.gotoAndStop("on");
}
function explode() {
super.explode();
owner.engine.playSound("heavy");
}
var __PROJTYPE = "Heavy";
var __LAUNCH_VELOCITY = 1600;
var __BASE_DAMAGE = 4;
}
Symbol 874 MovieClip [__Packages.nick.avatarfortfight.ents.Projectile_Shrapnel] Frame 0
class nick.avatarfortfight.ents.Projectile_Shrapnel extends nick.avatarfortfight.ents.Projectile
{
var isAlive, __progress, __FLIGHT_SPEED, __ratio, __pathLength, x, nextX, __targetPoint, startX, y, nextY, __RADIAN, startY, owner, spin, isSpinning, rotation, velocity, __vertProgress;
function Projectile_Shrapnel () {
super();
}
function fullUpdate(el) {
if (!isAlive) {
return(undefined);
}
__progress = __progress + (__FLIGHT_SPEED * el);
__ratio = __progress / __pathLength;
x = (nextX = startX + (__targetPoint.x * __ratio));
y = (nextY = startY + (__targetPoint.y * Math.sin(__ratio * __RADIAN)));
if ((y > owner.groundHeight) || (__ratio > 1.4)) {
explode();
}
if (spin != 0) {
isSpinning = true;
}
rotation = rotation + (spin * el);
}
function spray(t_distance) {
velocity = new smashing.Point3D(0, 0, 0);
__targetPoint = new smashing.Point3D(t_distance, (owner.groundHeight - y) + 200, 0);
__pathLength = __targetPoint.length;
__progress = (__vertProgress = 0);
}
function explode() {
owner.engine.playSound("shrapnel");
super.explode();
}
var __PROJTYPE = "Shrapnel";
var __BASE_DAMAGE = 2;
}
Symbol 875 MovieClip [__Packages.nick.avatarfortfight.ents.Pickup] Frame 0
class nick.avatarfortfight.ents.Pickup extends nick.avatarfortfight.Entity
{
var mc, kill;
function Pickup () {
super();
}
function hitReact(t_target) {
mc.gotoAndPlay("pickup");
kill();
}
var TYPE = "pickup";
var DRAWTYPE = "obstacle";
var __DEF_ASSET = "pickup_mc";
var effectType = "none";
var effectID = 0;
var __DEF_WIDTH = 90;
var __DEF_HEIGHT = 90;
var __DEF_HD_WIDTH = 40;
var __DEF_HD_HEIGHT = 60;
var __USE_ACTUAL_DIMENSIONS = false;
var __USE_DIMENSIONS_AS_HD = false;
var __DRAW_WHEN_KILLED = true;
var value = 100;
}
Symbol 876 MovieClip [__Packages.nick.avatarfortfight.ents.Pickup_Health] Frame 0
class nick.avatarfortfight.ents.Pickup_Health extends nick.avatarfortfight.ents.Pickup
{
var owner;
function Pickup_Health () {
super();
}
function hitReact(t_target) {
owner.pickup_health();
super.hitReact();
}
var TYPE = "pickup";
var DRAWTYPE = "obstacle";
var __DEF_ASSET = "pickup_health_mc";
var effectType = "health";
var effectID = 1;
}
Symbol 877 MovieClip [__Packages.nick.avatarfortfight.ents.Pickup_Damage] Frame 0
class nick.avatarfortfight.ents.Pickup_Damage extends nick.avatarfortfight.ents.Pickup
{
var owner;
function Pickup_Damage () {
super();
}
function hitReact(t_target) {
owner.pickup_damage(t_target);
super.hitReact();
}
var TYPE = "pickup";
var DRAWTYPE = "obstacle";
var __DEF_ASSET = "pickup_damage_mc";
var effectType = "damage";
var effectID = 2;
}
Symbol 878 MovieClip [__Packages.nick.avatarfortfight.ents.Player_Earth] Frame 0
class nick.avatarfortfight.ents.Player_Earth extends nick.avatarfortfight.ents.Player
{
function Player_Earth () {
super();
}
var character = "earth";
var __DEF_ASSET = "fort_earth_mc";
var __catapultOffsetX = -25;
var __catapultOffsetY = -30;
var __KEEP_HALFWIDTH = 100;
var __KEEP_HEIGHT = 95;
var __particle1Asset = "earth_part_2";
var __particle2Asset = "earth_part_3";
var __particle3Asset = "earth_part_4";
}
Symbol 879 MovieClip [__Packages.nick.avatarfortfight.ents.Player_Water] Frame 0
class nick.avatarfortfight.ents.Player_Water extends nick.avatarfortfight.ents.Player
{
function Player_Water () {
super();
}
var character = "water";
var __DEF_ASSET = "fort_water_mc";
var __catapultOffsetX = -25;
var __catapultOffsetY = -30;
var __KEEP_HALFWIDTH = 100;
var __KEEP_HEIGHT = 90;
var __particle1Asset = "water_part_2";
var __particle2Asset = "water_part_3";
var __particle3Asset = "water_part_4";
}
Symbol 880 MovieClip [__Packages.nick.avatarfortfight.ents.Player_Fire] Frame 0
class nick.avatarfortfight.ents.Player_Fire extends nick.avatarfortfight.ents.Player
{
function Player_Fire () {
super();
}
var character = "fire";
var __DEF_ASSET = "fort_fire_mc";
var __catapultOffsetX = -25;
var __catapultOffsetY = -30;
var __KEEP_HALFWIDTH = 100;
var __KEEP_HEIGHT = 90;
var __particle1Asset = "fire_part_2";
var __particle2Asset = "fire_part_3";
var __particle3Asset = "fire_part_4";
}
Symbol 881 MovieClip [__Packages.smashing.IntervalEngine] Frame 0
class smashing.IntervalEngine
{
var _uo, _uf, _update_interval, _i, _last_update, _ft, _el;
function IntervalEngine (update_object, update_function) {
_uo = update_object;
_uf = update_function;
}
function startFlat(FPS) {
_FPS = FPS;
_update_interval = 1 / FPS;
_i = setInterval(this, "_flat_step", 0);
}
function startFlex() {
_last_update = getTimer() * 0.001;
_i = setInterval(this, "_flex_step", 0);
}
function startFast() {
_last_update = getTimer();
_i = setInterval(this, "_fast_step", 0);
}
function pause(Void) {
_is_paused = true;
}
function unpause(Void) {
_is_paused = false;
}
function reset(Void) {
if (_i != undefined) {
clearInterval(_i);
}
_ft = 0;
_last_update = getTimer() * 0.001;
_lel = _MAX_FRAMETIME / 2;
pause();
}
function _flex_step(Void) {
if (_is_paused) {
_last_update = getTimer() * 0.001;
return(undefined);
}
_el = Math.min(_MAX_FRAMETIME, (-_last_update) + ((_last_update = getTimer() * 0.001)));
_lel = _lel - Math.max(-_MAX_TIMEDIFF, Math.min(_MAX_TIMEDIFF, _lel - _el));
_uo[_uf](_lel);
}
function _flat_step(Void) {
if (_is_paused) {
return(undefined);
}
_ft = _ft + ((-_last_update) + ((_last_update = getTimer() * 0.001)));
if (_ft < _update_interval) {
return(undefined);
}
_uo[_uf](_ft);
_ft = 0;
}
function _fast_step(Void) {
_el = (-_last_update) + ((_last_update = getTimer()));
_uo[_uf](_el * 0.001);
}
function clear() {
clearInterval(_i);
}
var _MAX_TIMEDIFF = 0.005;
var _MIN_FPS = 5;
var _MAX_FRAMETIME = 1 / smashing.IntervalEngine.prototype._MIN_FPS;
var _lel = 0.2;
var _FPS = 0;
var _is_paused = false;
}
Symbol 882 MovieClip [__Packages.nick.avatarfortfight.Dimensions] Frame 0
class nick.avatarfortfight.Dimensions
{
function Dimensions () {
}
static function get screenWidth() {
return(__SCREENWIDTH);
}
static function get screenHeight() {
return(__SCREENHEIGHT);
}
static function get sc() {
return(__sc);
}
static var __SCREENWIDTH = Stage.width;
static var __SCREENHEIGHT = Stage.height;
static var __sc = {x:Stage.width / 2, y:Stage.height / 2};
}
Symbol 35 MovieClip [bg_horizon] Frame 1
stop();
Symbol 35 MovieClip [bg_horizon] Frame 5
play();
Symbol 54 MovieClip [bonus_indicator] Frame 1
stop();
Symbol 117 MovieClip [proj_earthExplode_mc] Frame 1
stop();
Symbol 117 MovieClip [proj_earthExplode_mc] Frame 35
stop();
Symbol 117 MovieClip [proj_earthExplode_mc] Frame 53
stop();
Symbol 133 MovieClip [proj_earthHeavy_mc] Frame 1
stop();
Symbol 133 MovieClip [proj_earthHeavy_mc] Frame 24
stop();
Symbol 142 MovieClip [proj_earthShrapnel_mc] Frame 1
stop();
Symbol 142 MovieClip [proj_earthShrapnel_mc] Frame 21
stop();
Symbol 148 MovieClip [proj_earthRain_mc] Frame 1
stop();
Symbol 148 MovieClip [proj_earthRain_mc] Frame 15
stop();
Symbol 157 MovieClip [proj_fireExplode_mc] Frame 1
stop();
Symbol 157 MovieClip [proj_fireExplode_mc] Frame 32
stop();
Symbol 157 MovieClip [proj_fireExplode_mc] Frame 59
stop();
Symbol 164 MovieClip [proj_fireHeavy_mc] Frame 1
stop();
Symbol 164 MovieClip [proj_fireHeavy_mc] Frame 24
stop();
Symbol 168 MovieClip [proj_fireRain_mc] Frame 1
stop();
Symbol 168 MovieClip [proj_fireRain_mc] Frame 15
stop();
Symbol 169 MovieClip [proj_fireShrapnel_mc] Frame 1
stop();
Symbol 169 MovieClip [proj_fireShrapnel_mc] Frame 20
stop();
Symbol 186 MovieClip [proj_waterExplode_mc] Frame 1
stop();
Symbol 186 MovieClip [proj_waterExplode_mc] Frame 32
stop();
Symbol 186 MovieClip [proj_waterExplode_mc] Frame 58
stop();
Symbol 191 MovieClip [proj_waterHeavy_mc] Frame 1
stop();
Symbol 191 MovieClip [proj_waterHeavy_mc] Frame 24
stop();
Symbol 198 MovieClip [proj_waterRain_mc] Frame 1
stop();
Symbol 198 MovieClip [proj_waterRain_mc] Frame 15
stop();
Symbol 199 MovieClip [proj_waterShrapnel_mc] Frame 1
stop();
Symbol 199 MovieClip [proj_waterShrapnel_mc] Frame 20
stop();
Symbol 226 MovieClip Frame 1
stop();
Symbol 226 MovieClip Frame 18
stop();
Symbol 226 MovieClip Frame 31
stop();
Symbol 226 MovieClip Frame 44
stop();
Symbol 226 MovieClip Frame 58
stop();
Symbol 233 MovieClip Frame 1
stop();
Symbol 233 MovieClip Frame 18
stop();
Symbol 233 MovieClip Frame 58
stop();
Symbol 246 MovieClip Frame 1
stop();
Symbol 246 MovieClip Frame 18
stop();
Symbol 246 MovieClip Frame 31
stop();
Symbol 246 MovieClip Frame 44
stop();
Symbol 246 MovieClip Frame 58
stop();
Symbol 263 MovieClip Frame 1
stop();
Symbol 266 MovieClip Frame 1
stop();
Symbol 292 MovieClip Frame 1
stop();
Symbol 302 MovieClip Frame 1
stop();
Symbol 302 MovieClip Frame 18
stop();
Symbol 302 MovieClip Frame 31
stop();
Symbol 302 MovieClip Frame 44
stop();
Symbol 302 MovieClip Frame 58
stop();
Symbol 310 MovieClip Frame 1
stop();
Symbol 310 MovieClip Frame 18
stop();
Symbol 310 MovieClip Frame 58
stop();
Symbol 313 MovieClip Frame 1
stop();
Symbol 313 MovieClip Frame 18
stop();
Symbol 313 MovieClip Frame 31
stop();
Symbol 313 MovieClip Frame 44
stop();
Symbol 313 MovieClip Frame 58
stop();
Symbol 328 MovieClip Frame 1
stop();
Symbol 335 MovieClip Frame 1
stop();
Symbol 339 MovieClip Frame 1
stop();
Symbol 352 MovieClip Frame 1
stop();
Symbol 352 MovieClip Frame 18
stop();
Symbol 352 MovieClip Frame 31
stop();
Symbol 352 MovieClip Frame 44
stop();
Symbol 352 MovieClip Frame 58
stop();
Symbol 359 MovieClip Frame 1
stop();
Symbol 359 MovieClip Frame 18
stop();
Symbol 359 MovieClip Frame 58
stop();
Symbol 362 MovieClip Frame 1
stop();
Symbol 362 MovieClip Frame 18
stop();
Symbol 362 MovieClip Frame 31
stop();
Symbol 362 MovieClip Frame 44
stop();
Symbol 362 MovieClip Frame 58
stop();
Symbol 379 MovieClip Frame 1
stop();
Symbol 382 MovieClip Frame 1
stop();
Symbol 390 MovieClip Frame 1
stop();
Symbol 424 MovieClip [pickup_damage_mc] Frame 1
stop();
Symbol 424 MovieClip [pickup_damage_mc] Frame 25
stop();
Symbol 442 MovieClip [pickup_health_mc] Frame 1
stop();
Symbol 442 MovieClip [pickup_health_mc] Frame 25
stop();
Symbol 476 MovieClip Frame 1
stop();
Symbol 476 MovieClip Frame 5
stop();
Symbol 476 MovieClip Frame 10
stop();
Symbol 483 MovieClip Frame 1
stop();
Symbol 483 MovieClip Frame 5
stop();
Symbol 483 MovieClip Frame 10
stop();
Symbol 487 MovieClip Frame 1
stop();
Symbol 487 MovieClip Frame 5
stop();
Symbol 487 MovieClip Frame 10
stop();
Symbol 494 Button
on (release) {
clickHelp();
}
Symbol 518 Button
on (release) {
_parent._parent._parent.closeMenu();
}
Symbol 519 MovieClip Frame 1
state_mc.gotoAndStop(_parent.state);
trace(_parent.state);
Symbol 519 MovieClip Frame 5
_parent._parent.display_mc._visible = true;
stop();
Symbol 519 MovieClip Frame 8
_parent.gotoAndPlay("close");
gotoAndStop ("off");
Symbol 520 MovieClip Frame 6
stop();
Symbol 520 MovieClip Frame 11
stop();
_parent.gotoAndStop("off");
Symbol 542 MovieClip Frame 38
stop();
Symbol 550 MovieClip Frame 6
stop();
Symbol 551 MovieClip Frame 5
stop();
Symbol 552 MovieClip Frame 1
stop();
Symbol 552 MovieClip Frame 5
stop();
Symbol 552 MovieClip Frame 10
stop();
Symbol 574 MovieClip Frame 6
stop();
Symbol 575 MovieClip Frame 1
stop();
Symbol 575 MovieClip Frame 5
stop();
Symbol 575 MovieClip Frame 10
stop();
Symbol 581 MovieClip Frame 1
stop();
Symbol 581 MovieClip Frame 6
stop();
Symbol 581 MovieClip Frame 11
stop();
Symbol 582 MovieClip Frame 1
btn_next.onRollOver = function () {
btn_next.gotoAndStop("over");
};
btn_next.onRollOut = function () {
btn_next.gotoAndStop("off");
};
btn_next.onRelease = function () {
nextFrame();
_parent._parent.playSound("smallClick");
};
stop();
Symbol 582 MovieClip Frame 2
btn_next.onRollOver = function () {
btn_next.gotoAndStop("over");
};
btn_next.onRollOut = function () {
btn_next.gotoAndStop("off");
};
btn_next.onRelease = function () {
nextFrame();
_parent._parent.playSound("smallClick");
};
btn_back.onRollOver = function () {
btn_back.gotoAndStop("over");
};
btn_back.onRollOut = function () {
btn_back.gotoAndStop("off");
};
btn_back.onRelease = function () {
prevFrame();
_parent._parent.playSound("smallClick");
};
stop();
Symbol 582 MovieClip Frame 3
btn_back.onRollOver = function () {
btn_back.gotoAndStop("over");
};
btn_back.onRollOut = function () {
btn_back.gotoAndStop("off");
};
btn_back.onRelease = function () {
prevFrame();
_parent._parent.playSound("smallClick");
};
btn_play.onRollOver = function () {
btn_play.gotoAndStop("over");
};
btn_play.onRollOut = (btn_play.onDragOut = function () {
btn_play.gotoAndStop("off");
});
btn_play.onRelease = function () {
prevFrame();
_parent._parent.closeMenu();
};
stop();
Symbol 583 MovieClip Frame 1
state_mc.gotoAndStop(_parent.state);
trace(_parent.state);
Symbol 583 MovieClip Frame 5
_parent._parent.display_mc._visible = true;
stop();
Symbol 583 MovieClip Frame 8
_parent.gotoAndPlay("close");
gotoAndStop ("off");
Symbol 584 MovieClip Frame 6
stop();
Symbol 584 MovieClip Frame 11
stop();
_parent.gotoAndStop("off");
Symbol 590 MovieClip Frame 6
stop();
Symbol 591 MovieClip Frame 1
stop();
Symbol 591 MovieClip Frame 5
stop();
Symbol 591 MovieClip Frame 10
stop();
Symbol 595 MovieClip Frame 6
stop();
Symbol 596 MovieClip Frame 1
stop();
Symbol 596 MovieClip Frame 5
stop();
Symbol 596 MovieClip Frame 10
stop();
Symbol 608 MovieClip Frame 6
stop();
Symbol 609 MovieClip Frame 1
stop();
Symbol 609 MovieClip Frame 5
stop();
Symbol 609 MovieClip Frame 10
stop();
Symbol 617 MovieClip Frame 6
stop();
Symbol 618 MovieClip Frame 1
stop();
Symbol 618 MovieClip Frame 5
stop();
Symbol 618 MovieClip Frame 10
stop();
Instance of Symbol 618 MovieClip "btn_playAgain" in Symbol 620 MovieClip Frame 1
on (release) {
_parent._parent._parent._parent.clickResign();
}
on (rollOver) {
gotoAndStop ("over");
_parent._parent._parent.playSound("rollover");
}
on (rollOut, dragOut) {
gotoAndStop ("off");
}
on (press) {
gotoAndStop ("down");
_parent._parent._parent.playSound("click");
}
Instance of Symbol 575 MovieClip "btn_back" in Symbol 620 MovieClip Frame 1
on (release) {
_parent._parent._parent._parent.closeMenu();
}
on (rollOver) {
gotoAndStop ("over");
_parent._parent._parent.playSound("rollover");
}
on (rollOut, dragOut) {
gotoAndStop ("off");
}
on (press) {
gotoAndStop ("down");
_parent._parent._parent.playSound("click");
}
Symbol 621 MovieClip Frame 1
stop();
txt_name.tabEnabled = true;
txt_email.tabEnabled = true;
txt_toemail.tabEnabled = true;
Instance of Symbol 591 MovieClip "btn_send" in Symbol 621 MovieClip Frame 1
on (release) {
_parent._parent._parent.clickSend();
}
on (rollOver) {
gotoAndStop ("over");
_parent._parent._parent.playSound("rollover");
}
on (rollOut, dragOut) {
gotoAndStop ("off");
}
on (press) {
gotoAndStop ("down");
_parent._parent._parent.playSound("click");
}
Instance of Symbol 596 MovieClip "btn_cancel" in Symbol 621 MovieClip Frame 1
on (release) {
_parent._parent._parent.closeMenu();
}
on (rollOver) {
gotoAndStop ("over");
_parent._parent._parent.playSound("rollover");
}
on (rollOut, dragOut) {
gotoAndStop ("off");
}
on (press) {
gotoAndStop ("down");
_parent._parent._parent.playSound("click");
}
Instance of Symbol 575 MovieClip "btn_back" in Symbol 621 MovieClip Frame 15
on (release) {
_parent._parent._parent.backToEmail();
}
on (rollOver) {
gotoAndStop ("over");
}
on (rollOut, dragOut) {
gotoAndStop ("off");
}
on (press) {
gotoAndStop ("down");
}
Symbol 625 MovieClip Frame 6
stop();
Symbol 626 MovieClip Frame 1
stop();
Symbol 626 MovieClip Frame 5
stop();
Symbol 626 MovieClip Frame 10
stop();
Instance of Symbol 626 MovieClip "btn_playAgain" in Symbol 628 MovieClip Frame 1
on (release) {
_parent._parent._parent.clickQuit();
}
on (rollOver) {
gotoAndStop ("over");
_parent._parent._parent.playSound("rollover");
}
on (rollOut, dragOut) {
gotoAndStop ("off");
}
on (press) {
gotoAndStop ("down");
_parent._parent._parent.playSound("click");
}
Instance of Symbol 575 MovieClip "btn_back" in Symbol 628 MovieClip Frame 1
on (release) {
_parent._parent._parent.closeMenu();
}
on (rollOver) {
gotoAndStop ("over");
_parent._parent._parent.playSound("rollover");
}
on (rollOut, dragOut) {
gotoAndStop ("off");
}
on (press) {
gotoAndStop ("down");
_parent._parent._parent.playSound("click");
}
Instance of Symbol 609 MovieClip "btn_playAgain" in Symbol 630 MovieClip Frame 1
on (release) {
_parent._parent._parent.clickPlayAgain();
}
on (rollOver) {
gotoAndStop ("over");
_parent._parent._parent.playSound("rollover");
}
on (rollOut, dragOut) {
gotoAndStop ("off");
}
on (press) {
gotoAndStop ("down");
_parent._parent._parent.playSound("click");
}
Instance of Symbol 609 MovieClip "btn_playAgain" in Symbol 632 MovieClip Frame 1
on (release) {
_parent._parent._parent.clickPlayAgain();
}
on (rollOver) {
gotoAndStop ("over");
_parent._parent._parent.playSound("rollover");
}
on (rollOut, dragOut) {
gotoAndStop ("off");
}
on (press) {
gotoAndStop ("down");
_parent._parent._parent.playSound("click");
}
Instance of Symbol 609 MovieClip "btn_playAgain" in Symbol 634 MovieClip Frame 1
on (release) {
_parent._parent._parent.clickPlayAgain();
}
on (rollOver) {
gotoAndStop ("over");
_parent._parent._parent.playSound("rollover");
}
on (rollOut, dragOut) {
gotoAndStop ("off");
}
on (press) {
gotoAndStop ("down");
_parent._parent._parent.playSound("click");
}
Symbol 647 MovieClip Frame 15
stop();
Symbol 652 MovieClip Frame 1
stop();
Symbol 652 MovieClip Frame 5
stop();
Symbol 652 MovieClip Frame 10
stop();
Symbol 659 MovieClip Frame 1
stop();
Symbol 659 MovieClip Frame 2
stop();
Symbol 662 MovieClip Frame 1
stop();
Symbol 662 MovieClip Frame 5
display_mc._visible = false;
btn.useHandCursor = false;
Symbol 662 MovieClip Frame 10
display_mc._visible = false;
btn.useHandCursor = false;
Symbol 662 MovieClip Frame 15
display_mc._visible = false;
btn.useHandCursor = false;
Symbol 662 MovieClip Frame 20
display_mc._visible = false;
btn.useHandCursor = false;
Symbol 662 MovieClip Frame 25
display_mc._visible = false;
btn.useHandCursor = false;
Symbol 662 MovieClip Frame 30
display_mc._visible = false;
btn.useHandCursor = false;
Symbol 662 MovieClip Frame 35
display_mc._visible = false;
btn.useHandCursor = false;
Symbol 662 MovieClip Frame 40
btn.useHandCursor = false;
Symbol 662 MovieClip Frame 45
btn.useHandCursor = false;
Symbol 662 MovieClip Frame 50
btn.useHandCursor = false;
Symbol 668 MovieClip Frame 1
stop();
Symbol 668 MovieClip Frame 5
stop();
Symbol 668 MovieClip Frame 10
stop();
Symbol 677 MovieClip Frame 1
stop();
Symbol 683 MovieClip Frame 1
stop();
Symbol 689 MovieClip Frame 1
stop();
Symbol 695 MovieClip Frame 1
stop();
Symbol 705 MovieClip Frame 1
stop();
Symbol 705 MovieClip Frame 7
stop();
_parent._parent.txtOverlay_mc.gotoAndPlay("fadeup");
Symbol 705 MovieClip Frame 12
stop();
_parent._parent.txtOverlay_mc.gotoAndPlay("fadeup");
Symbol 709 MovieClip Frame 1
stop();
Symbol 709 MovieClip Frame 7
stop();
_parent._parent.txtOverlay_mc.gotoAndPlay("fadeup");
Symbol 709 MovieClip Frame 12
stop();
_parent._parent.txtOverlay_mc.gotoAndPlay("fadeup");
Symbol 713 MovieClip Frame 1
stop();
Symbol 713 MovieClip Frame 7
stop();
_parent._parent.txtOverlay_mc.gotoAndPlay("fadeup");
Symbol 713 MovieClip Frame 12
stop();
_parent._parent.txtOverlay_mc.gotoAndPlay("fadeup");
Symbol 714 MovieClip Frame 1
stop();
Symbol 714 MovieClip Frame 2
stop();
Symbol 714 MovieClip Frame 3
stop();
Symbol 724 Button
on (release) {
_parent._parent._parent._parent._parent.clickWeaponSelect("rain", _parent);
}
on (rollOver) {
gotoAndStop ("over");
_parent._parent._parent._parent._parent.playSound("rolloverRain");
}
on (rollOut, dragOut) {
gotoAndStop ("off");
}
Symbol 725 MovieClip Frame 1
dim = false;
stop();
Symbol 725 MovieClip Frame 15
dim = true;
Symbol 728 Button
on (release) {
_parent._parent._parent._parent._parent.clickWeaponSelect("explode", _parent);
}
on (rollOver) {
gotoAndStop ("over");
_parent._parent._parent._parent._parent.playSound("rolloverExplode");
}
on (rollOut, dragOut) {
gotoAndStop ("off");
}
Symbol 729 MovieClip Frame 1
dim = false;
stop();
Symbol 729 MovieClip Frame 15
dim = true;
Symbol 736 Button
on (release) {
_parent._parent._parent._parent._parent.clickWeaponSelect("heavy", _parent);
}
on (rollOver) {
gotoAndStop ("over");
_parent._parent._parent._parent._parent.playSound("rolloverHeavy");
}
on (rollOut, dragOut) {
gotoAndStop ("off");
}
Symbol 737 MovieClip Frame 1
dim = false;
stop();
Symbol 737 MovieClip Frame 15
dim = true;
Symbol 739 Button
on (release) {
_parent._parent._parent._parent._parent.clickWeaponSelect("rain", _parent);
}
on (rollOver) {
gotoAndStop ("over");
_parent._parent._parent._parent._parent.playSound("rolloverRain");
}
on (rollOut, dragOut) {
gotoAndStop ("off");
}
Symbol 740 MovieClip Frame 1
dim = false;
stop();
Symbol 740 MovieClip Frame 15
dim = true;
Symbol 741 Button
on (release) {
_parent._parent._parent._parent._parent.clickWeaponSelect("explode", _parent);
}
on (rollOver) {
gotoAndStop ("over");
_parent._parent._parent._parent._parent.playSound("rolloverExplode");
}
on (rollOut, dragOut) {
gotoAndStop ("off");
}
Symbol 742 MovieClip Frame 1
dim = false;
stop();
Symbol 742 MovieClip Frame 15
dim = true;
Symbol 748 Button
on (release) {
_parent._parent._parent._parent._parent.clickWeaponSelect("heavy", _parent);
}
on (rollOver) {
gotoAndStop ("over");
_parent._parent._parent._parent._parent.playSound("rolloverHeavy");
}
on (rollOut, dragOut) {
gotoAndStop ("off");
}
Symbol 749 MovieClip Frame 1
dim = false;
stop();
Symbol 749 MovieClip Frame 15
dim = true;
Symbol 751 Button
on (release) {
_parent._parent._parent._parent._parent.clickWeaponSelect("rain", _parent);
}
on (rollOver) {
gotoAndStop ("over");
_parent._parent._parent._parent._parent.playSound("rolloverRain");
}
on (rollOut, dragOut) {
gotoAndStop ("off");
}
Symbol 752 MovieClip Frame 1
dim = false;
stop();
Symbol 752 MovieClip Frame 15
dim = true;
Symbol 754 Button
on (release) {
_parent._parent._parent._parent._parent.clickWeaponSelect("explode", _parent);
}
on (rollOver) {
gotoAndStop ("over");
_parent._parent._parent._parent._parent.playSound("rolloverExplode");
}
on (rollOut, dragOut) {
gotoAndStop ("off");
}
Symbol 755 MovieClip Frame 1
dim = false;
stop();
Symbol 755 MovieClip Frame 15
dim = true;
Symbol 757 Button
on (release) {
_parent._parent._parent._parent._parent.clickWeaponSelect("heavy", _parent);
}
on (rollOver) {
gotoAndStop ("over");
_parent._parent._parent._parent._parent.playSound("rolloverHeavy");
}
on (rollOut, dragOut) {
gotoAndStop ("off");
}
Symbol 758 MovieClip Frame 1
dim = false;
stop();
Symbol 758 MovieClip Frame 15
dim = true;
Symbol 759 MovieClip Frame 1
stop();
Symbol 759 MovieClip Frame 5
stop();
Symbol 759 MovieClip Frame 10
stop();
Symbol 764 MovieClip Frame 1
stop();
Symbol 767 MovieClip Frame 1
stop();
Symbol 767 MovieClip Frame 6
stop();
Symbol 768 MovieClip Frame 1
stop();
Symbol 768 MovieClip Frame 2
play();
Symbol 768 MovieClip Frame 9
character_mc.char.gotoAndPlay("up");
stop();
Symbol 768 MovieClip Frame 10
character_mc.char.gotoAndPlay("down");
Symbol 768 MovieClip Frame 15
gotoAndStop ("off");
Symbol 805 MovieClip Frame 1
stop();
Symbol 825 MovieClip Frame 1
stop();
Symbol 825 MovieClip Frame 5
stop();
Symbol 825 MovieClip Frame 10
stop();
Symbol 832 Button
on (release) {
clickGoQuit();
}
Symbol 834 MovieClip Frame 1
stop();
Symbol 836 MovieClip Frame 1
stop();
Symbol 836 MovieClip Frame 2
play();
Symbol 836 MovieClip Frame 9
character_mc.char.gotoAndPlay("up");
stop();
Symbol 836 MovieClip Frame 10
character_mc.char.gotoAndPlay("down");
Symbol 836 MovieClip Frame 15
gotoAndStop ("off");
Symbol 836 MovieClip Frame 40
stop();
Symbol 837 MovieClip Frame 1
stop();
Symbol 837 MovieClip Frame 5
stop();
Symbol 837 MovieClip Frame 10
stop();
Symbol 846 MovieClip Frame 5
stop();
Symbol 847 Button
on (release) {
_parent._parent._parent.clickLook();
}
Symbol 849 MovieClip Frame 25
stop();
Symbol 850 Button
on (release) {
_parent._parent._parent.clickLook();
}
Symbol 852 MovieClip Frame 25
stop();
Symbol 853 MovieClip Frame 1
stop();
Symbol 856 MovieClip [_Project] Frame 1
#initclip 27
Object.registerClass("_Project", nick.avatarfortfight.Engine);
#endinitclip
menus_mc.tabChildren = false;
stop();
Symbol 856 MovieClip [_Project] Frame 30
btn_clickHD.useHandCursor = false;