Frame 1
function doLoader() {
ratio = getBytesLoaded() / getBytesTotal();
bar_mc.gotoAndStop(Math.ceil(ratio * FRAMES));
if (ratio == 1) {
clearInterval(loader_int);
bar_mc.gotoAndStop(FRAMES);
gotoAndStop ("game");
}
}
var ratio;
var FRAMES = 100;
loader_int = setInterval(doLoader, 5);
stop();
Frame 5
project.init();
Symbol 15 MovieClip Frame 1
stop();
Symbol 15 MovieClip Frame 5
stop();
Symbol 15 MovieClip Frame 10
stop();
Symbol 47 MovieClip Frame 5
stop();
Symbol 48 MovieClip Frame 1
stop();
Symbol 48 MovieClip Frame 5
stop();
Symbol 48 MovieClip Frame 10
stop();
Symbol 52 MovieClip Frame 6
stop();
Symbol 56 MovieClip Frame 2
stop();
Symbol 57 MovieClip Frame 1
stop();
Symbol 57 MovieClip Frame 5
stop();
Symbol 57 MovieClip Frame 10
stop();
Symbol 66 MovieClip Frame 1
stop();
Symbol 66 MovieClip Frame 5
stop();
Symbol 66 MovieClip Frame 10
stop();
Symbol 67 MovieClip [_nick_highscore_board] Frame 1
#initclip 78
Object.registerClass("_nick_highscore_board", nick.highscores.HighscoreTable);
#endinitclip
Symbol 67 MovieClip [_nick_highscore_board] Frame 5
stop();
Instance of Symbol 15 MovieClip "btn_close" in Symbol 67 MovieClip [_nick_highscore_board] Frame 5
on (release) {
_parent.gotoAndPlay("outro");
}
Instance of Symbol 48 MovieClip "btn_next" in Symbol 67 MovieClip [_nick_highscore_board] Frame 15
on (release) {
_parent.nextPage();
}
Instance of Symbol 57 MovieClip "btn_back" in Symbol 67 MovieClip [_nick_highscore_board] Frame 15
on (release) {
_parent.prevPage();
}
Instance of Symbol 66 MovieClip "btn_submit" in Symbol 67 MovieClip [_nick_highscore_board] Frame 15
on (release) {
nick.highscores.HighscoreEngine.submitFromBoard();
}
Symbol 67 MovieClip [_nick_highscore_board] Frame 21
play();
Symbol 67 MovieClip [_nick_highscore_board] Frame 25
smashing.rampage.Messenger.sendMessage("screen", "onBoardClosed");
Symbol 1245 MovieClip [__Packages.nick.highscores.HighscoreEngine] Frame 0
class nick.highscores.HighscoreEngine
{
static var __userName, __loadState, __xml, __userPath, __scorePath, __game_id, __user_vars, __highscoreMC, __scores, __userScore, __functionToRunAfterLoad, __stateVerificationInterval, __score_vars;
function HighscoreEngine () {
}
static function init(pXmlData) {
trace("** Highscore Data Class Initialized **");
__userName = "null";
__loadState = "loading";
if (__USE_XML) {
if (pXmlData == undefined) {
loadXML();
} else {
__xml = pXmlData;
onXMLloaded(true);
}
}
}
static function loadXML() {
__xml = new XML();
__xml.ignoreWhite = true;
__xml.onLoad = function (success) {
nick.highscores.HighscoreEngine.onXMLloaded(success);
};
var _local2 = _root._url.slice(0, _root._url.lastIndexOf("/"));
if (_local2 != "") {
_local2 = _local2 + "/";
}
log(("Loading XML file from " + (_local2 + __XML_FILE_URL)) + " ...");
__xml.load(_local2 + __XML_FILE_URL);
}
static function onXMLloaded(success) {
if (success) {
__userPath = __xml.firstChild.childNodes[0].firstChild.nodeValue;
__scorePath = __xml.firstChild.childNodes[1].firstChild.nodeValue;
__game_id = __xml.firstChild.childNodes[2].firstChild.nodeValue;
log("Xml loaded : ");
log("User : " + __userPath);
log("score: " + __scorePath);
log("gameID: " + __game_id);
} else {
log("XML Loading error");
}
updateUserLogin();
}
static function manualXML(userPath, scorePath, gameID) {
__userPath = userPath;
__scorePath = scorePath;
__game_id = gameID;
updateUserLogin();
}
static function updateUserLogin() {
log("Test user login...");
__user_vars = new LoadVars();
__user_vars.onLoad = function (success) {
nick.highscores.HighscoreEngine.onLogin(success);
};
__user_vars.load(__userPath);
}
static function onLogin(success) {
if (success) {
while (__user_vars.screenName.indexOf("/n") != -1) {
log("[HighscoreEngine] Cull login string - : " + __user_vars.screenName);
__user_vars.screenName = __user_vars.screenName.substr(0, __user_vars.screenName.length - 2);
log("[HighscoreEngine] Result: " + __user_vars.screenName);
}
__userName = __user_vars.screenName;
log("[HighscoreEngine] User is : " + __userName);
} else {
log("[HighscoreEngine] User is not logged in.");
}
if (__DO_DEBUG) {
__userName = "Keith";
log("[HighscoreEngine] DEBUG ACTIVE <~~~~ Fake log-in engaged.");
}
__loadState = "ready";
}
static function populateHighscoreBoard(pDidSubmit) {
if (isLoggedIn) {
__highscoreMC.init(__scores, {name:__userName, score:__userScore, didSubmit:pDidSubmit});
} else {
__highscoreMC.init(__scores, {name:"", score:0});
}
}
static function runReadyTest(callback) {
if (__loadState != "ready") {
__functionToRunAfterLoad = callback;
startBoardReadyInterval();
return(false);
}
return(true);
}
static function startBoardReadyInterval() {
__stateVerificationInterval = setInterval(function () {
nick.highscores.HighscoreEngine.runBoardReadyInterval();
}, 5);
}
static function runBoardReadyInterval() {
if (__loadState == "ready") {
clearInterval(__stateVerificationInterval);
if (__functionToRunAfterLoad == "sendAndView") {
sendAndViewScore(__highscoreMC, __userScore);
} else {
viewScores(__highscoreMC);
}
} else if (__loadState == "error") {
__highscoreMC.showError();
clearInterval(__stateVerificationInterval);
}
}
static function sendAndViewScore(boardMC, score) {
__highscoreMC = boardMC;
__userScore = score;
__highscoreMC.showIntro();
if (runReadyTest("sendAndView") == false) {
return(undefined);
}
log("Send Score...");
if ((__userName == "null") && (__userName == undefined)) {
log(("Error: User name is : " + __userName) + ". Only logged in users may send scores.");
return(undefined);
}
__score_vars = new LoadVars();
__score_vars.onLoad = function (success) {
nick.highscores.HighscoreEngine.onSubmitHighscoresRecieved(success);
};
log((((((((("Load ( " + __scorePath) + "?msg=S&game=") + __game_id) + "&name=") + __userName) + "&score=") + __userScore) + "&limitEntries=true") + " )");
__score_vars.load(((((((__scorePath + "?msg=S&game=") + __game_id) + "&name=") + __userName) + "&score=") + __userScore) + "&limitEntries=true");
}
static function viewScores(boardMC, score) {
__highscoreMC = boardMC;
if (score == undefined) {
__userScore = 0;
} else {
__userScore = score;
}
__highscoreMC.showIntro();
if (runReadyTest("view") == false) {
return(undefined);
}
log("View Scores...");
log(((("Load ( " + __scorePath) + "?msg=Q&game=") + __game_id) + " )");
__score_vars = new LoadVars();
__score_vars.onLoad = function (success) {
nick.highscores.HighscoreEngine.onViewHighscoresRecieved(success);
};
__score_vars.load((__scorePath + "?msg=Q&game=") + __game_id);
}
static function submitFromBoard() {
if (__userScore == 0) {
return(undefined);
}
__highscoreMC.showLoading();
log("Send Score from board...");
if ((__userName == "null") && (__userName == undefined)) {
log(("Error: User name is : " + __userName) + ". Only logged in users may send scores.");
return(undefined);
}
__score_vars = new LoadVars();
__score_vars.onLoad = function (success) {
nick.highscores.HighscoreEngine.onSubmitHighscoresRecieved(success);
};
log((((((((("Load ( " + __scorePath) + "?msg=S&game=") + __game_id) + "&name=") + __userName) + "&score=") + __userScore) + "&limitEntries=true") + " )");
__score_vars.load(((((((__scorePath + "?msg=S&game=") + __game_id) + "&name=") + __userName) + "&score=") + __userScore) + "&limitEntries=true");
}
static function onSubmitHighscoresRecieved(success) {
log("Server callback recieved on Submit: ");
log("Success: " + success);
log("Returning game ID: " + __score_vars.game);
if ((!success) || (__score_vars.game != __game_id)) {
log("Highscore retrieval Failed.");
__highscoreMC.showError();
return(undefined);
}
generateScoreArray();
populateHighscoreBoard(true);
}
static function onViewHighscoresRecieved(success) {
log("Server callback recieved on View: ");
log("Success: " + success);
log("Returning game ID: " + __score_vars.game);
if ((!success) || (__score_vars.game != __game_id)) {
log("Highscore retrieval Failed.");
__highscoreMC.showError();
return(undefined);
}
generateScoreArray();
populateHighscoreBoard(false);
}
static function generateScoreArray() {
__scores = [];
var _local1 = 0;
while (_local1 < __score_vars.count) {
__scores.push({name:__score_vars["pn" + _local1], score:__score_vars["ps" + _local1]});
_local1++;
}
}
static function set userPath(path) {
__userPath = path;
//return(userPath);
}
static function get userPath() {
return(__userPath);
}
static function set scorePath(path) {
__scorePath = path;
//return(scorePath);
}
static function get scorePath() {
return(__scorePath);
}
static function set gameID(id) {
__game_id = id;
//return(gameID);
}
static function get gameID() {
return(__game_id);
}
static function get scores() {
return(__scores);
}
static function get userName() {
return(__userName);
}
static function get isLoggedIn() {
return((((__userName == undefined) || (__userName == "null")) ? false : true));
}
static function log(message) {
var _local1 = new LocalConnection();
_local1.send("_SILCtrace", "trace", message);
_local1.close();
trace("LOG : " + message);
}
static var __USE_XML = true;
static var __XML_FILE_URL = "config.xml";
static var __SCORE_CALL = "onHighscores";
static var __DO_DEBUG = false;
}
Symbol 1246 MovieClip [__Packages.nick.highscores.HighscoreTable] Frame 0
class nick.highscores.HighscoreTable extends MovieClip
{
var gotoAndStop, _currentframe, gotoAndPlay, __scores, __player, __page, __totalPages, btn_submit, playerScore_mc, pagination_txt;
function HighscoreTable () {
super();
}
function showLoading() {
gotoAndStop("loading");
}
function showIntro() {
if (_currentframe < 5) {
gotoAndPlay("intro");
}
}
function showError() {
gotoAndStop("error");
}
function showTable() {
gotoAndStop("ready");
emptyTable();
}
function init(t_scores, t_player) {
showTable();
__scores = t_scores;
__player = t_player;
__page = 1;
__totalPages = Math.ceil(__scores.length / __SCORES_PER_PAGE);
var _local2 = 0;
while (_local2 < __scores.length) {
if (__scores[_local2].name == "") {
__totalPages = Math.ceil(_local2 / __SCORES_PER_PAGE);
_local2 = __scores.length;
}
_local2++;
}
drawSubmitButton();
populatePlayer();
populateTable();
}
function calculatePlayerRank() {
if (!__player.didSubmit) {
return("");
}
var _local2 = 0;
while (_local2 < __scores.length) {
if (__scores[_local2].name == __player.name) {
return(String(_local2 + 1));
}
_local2++;
}
return("");
}
function drawSubmitButton() {
if ((((((__player.score == 0) || (__player.didSubmit)) || (__player.name == "")) || (__player.name == undefined)) || (__player.name == null)) || (__player.name == "null")) {
btn_submit._visible = false;
} else {
btn_submit._visible = true;
}
}
function populatePlayer() {
if ((((__player.name == "") || (__player.name == undefined)) || (__player.name == null)) || (__player.name == "null")) {
playerScore_mc._visible = false;
} else {
playerScore_mc._visible = true;
playerScore_mc.name.text = __player.name;
playerScore_mc.score.text = __player.score;
playerScore_mc.rank.text = calculatePlayerRank();
}
}
function populateTable() {
var c = ((__page - 1) * __SCORES_PER_PAGE);
var loop = 1;
while (loop <= __SCORES_PER_PAGE) {
if (__scores[c].name != "") {
eval ((this + ".hs_") + loop).rank.text = ((__page - 1) * 10) + loop;
eval ((this + ".hs_") + loop).name.text = __scores[c].name;
eval ((this + ".hs_") + loop).score.text = __scores[c].score;
} else {
eval ((this + ".hs_") + loop).rank.text = "";
eval ((this + ".hs_") + loop).name.text = "";
eval ((this + ".hs_") + loop).score.text = "";
}
loop++;
c++;
}
pagination_txt.text = (__page + " of ") + __totalPages;
if (__totalPages < 1) {
__totalPages = 1;
}
}
function emptyTable() {
playerScore_mc._visible = false;
var loop = 1;
while (loop <= __SCORES_PER_PAGE) {
eval ((this + ".hs_") + loop).rank.text = "";
eval ((this + ".hs_") + loop).name.text = "";
eval ((this + ".hs_") + loop).score.text = "";
loop++;
}
pagination_txt.text = "";
}
function nextPage() {
__page++;
if (__page > __totalPages) {
__page = 1;
}
populateTable();
}
function prevPage() {
__page--;
if (__page < 1) {
__page = __totalPages;
}
populateTable();
}
static function log(message) {
var _local1 = new LocalConnection();
_local1.send("_SILCtrace", "trace", message);
_local1.close();
trace("LOG : " + message);
}
var __SCORES_PER_PAGE = 10;
}
Symbol 1247 MovieClip [__Packages.smashing.rampage.Messenger] Frame 0
class smashing.rampage.Messenger
{
static var __addresses;
function Messenger () {
}
static function registerAddress(id, obj) {
if (__addresses == undefined) {
__addresses = {};
}
__addresses[id] = obj;
}
static function removeAddress(id) {
__addresses[id] = "";
}
static function getAddress(id) {
return(__addresses[id]);
}
static function sendMessage(id, message, args) {
if ((__addresses[id] != "") && (__addresses[id] != undefined)) {
__addresses[id].onMessageReceived(message, args);
return(undefined);
}
trace("[Messenger] Error locating message recipient " + id);
}
}
Symbol 1248 MovieClip [__Packages.smashing.rampage.BaseEngine] Frame 0
class smashing.rampage.BaseEngine extends MovieClip
{
var __gameStartTime, isPaused, __interval, mouse, key;
function BaseEngine () {
super();
}
function init() {
__gameStartTime = getTimer();
__initInterval();
__initSounds();
__initGameState();
__initUI();
__initViewport();
__initMouse();
__initKey();
isPaused = false;
smashing.rampage.Messenger.registerAddress("engine", this);
}
function __initInterval() {
__interval = new smashing.IntervalEngine(this, "update");
__interval.startFast();
}
function __initSounds() {
}
function __initGameState() {
}
function __initUI() {
}
function __initViewport() {
}
function update(dt) {
}
function pause() {
isPaused = true;
}
function unpause() {
isPaused = false;
}
function onQuit() {
stopAllSounds();
destroy();
}
function destroy() {
__interval.clear();
__clearMouse();
__clearKey();
}
function __initMouse() {
mouse = {};
mouse.owner = this;
Mouse.addListener(mouse);
}
function __clearMouse() {
Mouse.removeListener(mouse);
}
function mouse_up() {
}
function mouse_down() {
}
function __initKey() {
key = {};
key.owner = this;
Key.addListener(key);
}
function __clearKey() {
Key.removeListener(key);
}
function key_down() {
}
function key_up() {
}
function onMessageReceived(message, args) {
this[message](args);
}
}
Symbol 1249 MovieClip [__Packages.smashing.IntervalEngine] Frame 0
class smashing.IntervalEngine
{
var _uo, _uf, _update_interval, _last_update, _i, _ft, _el;
function IntervalEngine (update_object, update_function) {
_uo = update_object;
_uf = update_function;
}
function startFlat(FPS) {
_FPS = FPS;
_update_interval = 1 / FPS;
_last_update = getTimer() * 0.001;
_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", 10);
}
function reset(Void) {
if (_i != undefined) {
clearInterval(_i);
}
_ft = 0;
_last_update = getTimer() * 0.001;
_lel = _MAX_FRAMETIME / 2;
}
function _flex_step(Void) {
_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) {
_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;
}
Symbol 1250 MovieClip [__Packages.nick.avatar.fortressfight2.Engine] Frame 0
class nick.avatar.fortressfight2.Engine extends smashing.rampage.BaseEngine
{
var activeWorld, _parent, pause, __sounds, __UI, viewport_mc, __state, isPaused, unpause, __interval, __screenshotData, screenshot_mc, bg_color, __transTarget, __transFunc, __transArgs, transition_mc, mouse, key, highscore_mc, __gameStartTime;
function Engine () {
super();
}
function init() {
super.init();
activeWorld = new nick.avatar.fortressfight2.World();
activeWorld.init(this);
nick.highscores.HighscoreEngine.init(_parent.gxml.xdata);
pause();
if (__DEBUG_MUSIC_ON) {
__sounds.playMusic("music1");
}
__UI.goScreen("splash");
}
function __initSounds() {
nick.avatar.fortressfight2.Sounds.init();
__sounds = nick.avatar.fortressfight2.Sounds.getInstance();
__sounds.generateSounds(viewport_mc);
}
function __initGameState() {
nick.avatar.fortressfight2.GameState.init();
__state = nick.avatar.fortressfight2.GameState.getInstance();
}
function __initUI() {
nick.avatar.fortressfight2.ui.UI.init();
__UI = nick.avatar.fortressfight2.ui.UI.getInstance();
__UI.linkEngine(this);
__UI.reset();
}
function __initViewport() {
smashing.rampage.viewport.Viewport.init(viewport_mc, 2, nick.avatar.fortressfight2.GameState.getInstance());
var _local2 = smashing.rampage.viewport.Viewport.getInstance();
_local2.setScrollport(1);
_local2.createGroup({id:"bg", index:0, slots:10, scrollport:true});
_local2.createGroup({id:"rearpower", index:1, slots:200});
_local2.createGroup({id:"structures", index:2, slots:500});
_local2.createGroup({id:"forepower", index:3, slots:200});
_local2.createGroup({id:"projectile", index:4, slots:500});
_local2.createGroup({id:"catapult", index:5, slots:100});
_local2.createGroup({id:"effect", index:6, slots:500});
_local2.createGroup({id:"arrow", index:7, slots:10});
_local2.initGroups();
nick.avatar.fortressfight2.GameCamera.init();
}
function update(dt) {
if (!isPaused) {
activeWorld.update(dt);
}
__UI.update(dt);
updateAfterEvent();
}
function startMatch() {
trace("Start Match : " + __state.levelNum);
__UI.goScreen("gameplay");
hideScreenshot();
__state.resetMatch();
smashing.rampage.viewport.Viewport.getInstance().newView();
activeWorld.generate(__state.levelNum);
activeWorld.start();
unpause();
}
function clear() {
activeWorld.clear();
smashing.rampage.viewport.Viewport.getInstance().newView();
}
function destroy() {
__interval.clear();
__clearMouse();
__clearKey();
}
function showScreenshot() {
__screenshotData = new flash.display.BitmapData(600, 400);
screenshot_mc.createEmptyMovieClip("bitmap", 1);
screenshot_mc.bitmap.attachBitmap(__screenshotData, 1);
__screenshotData.draw(viewport_mc);
viewport_mc._visible = false;
}
function hideScreenshot() {
__screenshotData.dispose();
screenshot_mc.bitmap.removeMovieClip();
viewport_mc._visible = true;
}
function pauseInGame() {
pause();
}
function unpauseInGame() {
unpause();
}
function setBGColor(pData) {
bg_color.gotoAndStop(pData.kingdom);
}
function onPressQuit() {
pause();
smashing.rampage.viewport.Viewport.getInstance().newView();
onGameOver(true);
}
function onPressPlayAgain() {
pause();
smashing.rampage.viewport.Viewport.getInstance().newView();
__UI.goScreen("splash");
}
function onSelectSingleMode() {
__state.setModeSingle();
__state.resetGame();
__UI.goScreen("select");
}
function onSelectVersusMode() {
__state.setModeVersus();
__state.resetGame();
__UI.goScreen("select");
}
function onSelectKingdom(pData) {
if (__state.kingdom1 == "") {
__state.selectKingdom(1, pData.kingdom);
if (__state.mode == 1) {
__state.selectRandomKingdom();
startMatch();
} else {
smashing.rampage.Messenger.sendMessage("screen", "adaptForPlayerTwo");
}
} else {
__state.selectKingdom(2, pData.kingdom);
startMatch();
}
}
function onGameOver(boolQuit) {
pause();
if ((((!boolQuit) && (__state.mode == 1)) && (__state.turn == 1)) && (__state.levelNum < 20)) {
__UI.goScreen("shop");
} else {
__state.quitGame = boolQuit == true;
__UI.goScreen("end");
}
}
function goNextMatch() {
__state.nextMatch();
__state.selectRandomKingdom();
startMatch();
}
function runTransition(pTarget, pFunc, pArgs) {
__transTarget = pTarget;
__transFunc = pFunc;
__transArgs = pArgs;
transition_mc.gotoAndPlay("in");
}
function onTransitionComplete() {
__transTarget[__transFunc](__transArgs);
}
function toggleMusic() {
if (__sounds.muteMusic) {
__sounds.muteMusic = false;
__sounds.playMusic();
} else {
__sounds.muteMusic = true;
__sounds.stopMusic();
}
}
function __initMouse() {
mouse = {};
mouse.owner = this;
mouse.onMouseUp = function () {
this.owner.mouse_up();
};
mouse.onMouseDown = function () {
this.owner.mouse_down();
};
Mouse.addListener(mouse);
}
function __clearMouse() {
Mouse.removeListener(mouse);
}
function mouse_up() {
if (!isPaused) {
activeWorld.onMouseUp();
}
}
function mouse_down() {
if (!isPaused) {
activeWorld.onMouseDown();
}
}
function __initKey() {
}
function __clearKey() {
Key.removeListener(key);
}
function key_down() {
if (Key.getCode() == 32) {
}
}
function key_up() {
if (Key.getCode(32)) {
}
}
function testShowSubmitScoreButton() {
return(nick.highscores.HighscoreEngine.__get__isLoggedIn());
}
function onPressGameOverSubmitScore() {
if (!nick.highscores.HighscoreEngine.__get__isLoggedIn()) {
return(undefined);
}
__UI.goScreen("highscore");
nick.highscores.HighscoreEngine.sendAndViewScore(highscore_mc, __state.score1);
}
function onPressViewScores() {
__UI.goScreen("highscore");
nick.highscores.HighscoreEngine.viewScores(highscore_mc, __state.score1);
}
function onHighscoreBoardClosed() {
__UI.goScreen("splash");
}
function get gameStartTime() {
return(__gameStartTime);
}
function isMusicMuted() {
return(__sounds.muteMusic);
}
var __STARTLEVEL = 0;
var __DEBUG_MUSIC_ON = true;
}
Symbol 1251 MovieClip [__Packages.nick.avatar.fortressfight2.World] Frame 0
class nick.avatar.fortressfight2.World
{
var engine, __state, __gravity, __igniteTimer, __entitys, __projectiles, __effects, __pickups, __scenery, __playerOnePowers, __playerTwoPowers, __gameMode, __battleground, __camera, __modeTimer, __playerTwo, __playerOne, __arrow, __lastEarthWave, __fireMagnitude, __fireAngle, __castingPowerID, __magnitudeDeviation, __angleDeviation, __lastPower, __loop, __bloop;
function World (t_engine) {
}
function init(t_engine) {
engine = t_engine;
__state = nick.avatar.fortressfight2.GameState.getInstance();
smashing.rampage.Messenger.registerAddress("world", this);
__gravity = new smashing.Point3D(0, 220, 0);
__igniteTimer = 0;
}
function start() {
setMode("intro");
renderAll();
}
function clear() {
__entitys = [];
__projectiles = [];
__effects = [];
__pickups = [];
__scenery = [];
__playerOnePowers = [];
__playerTwoPowers = [];
}
function setMode(pMode) {
trace("Set Mode : " + pMode);
__gameMode = pMode;
switch (__gameMode) {
case "intro" :
update = updateIntro;
smashing.rampage.Messenger.sendMessage("screen", "showIntro", {bg:__battleground.kingdom});
__camera.goIntroView();
__modeTimer = __INTRO_TIMER;
break;
case "select" :
update = updateWatch;
__camera.goPlayerView(((__state.turn == 1) ? (__playerOne) : (__playerTwo)));
break;
case "gameover" :
trace("GAME OVER REACHED : 100g bonus");
if (__state.mode == 1) {
__state.addGold(__VICTORY_GOLD_BONUS);
__playerOne.onVictoryAmmoBonus();
}
clearActivePowers();
__modeTimer = __GAMEOVER_TIMER;
update = updateGameOver;
break;
case "ai" :
update = updateAI;
__camera.goPlayerView(((__state.turn == 1) ? (__playerOne) : (__playerTwo)));
break;
case "aim" :
update = updateAim;
__camera.goLongView();
__arrow = nick.avatar.fortressfight2.Library.createArrow({player:((__state.turn == 1) ? (__playerOne) : (__playerTwo))});
break;
case "catapult" :
update = updateCatapult;
__camera.goPlayerView(((__state.turn == 1) ? (__playerOne) : (__playerTwo)));
break;
case "fire" :
fireProjectile();
__arrow.requestErase();
update = updateFire;
break;
case "powerintro" :
smashing.rampage.Messenger.sendMessage("screen", "playPowerIntro");
update = updateWatch;
break;
case "power" :
generatePower();
update = updatePower;
break;
case "powerfinish" :
__camera.goPlayerView(((__state.turn == 1) ? (__playerOne) : (__playerTwo)));
update = updateWatch;
break;
case "earthwave" :
update = updateWatch;
__lastEarthWave.setIsBeingTracked();
__camera.goTrackingView(__lastEarthWave);
}
}
function clearActivePowers() {
var _local2 = __playerOnePowers.length;
while (_local2--) {
__playerOnePowers[_local2].clear();
}
_local2 = __playerTwoPowers.length;
while (_local2--) {
__playerTwoPowers[_local2].clear();
}
}
function fireProjectile() {
var _local2 = ((__state.turn == 1) ? (__playerOne.getFirePoint()) : (__playerTwo.getFirePoint()));
var _local3 = ((__state.turn == 1) ? (__playerOne.weaponID) : (__playerTwo.weaponID));
var _local5 = ((__state.turn == 1) ? (__playerOne.getIsIgnited()) : (__playerTwo.getIsIgnited()));
var _local6 = ((__state.turn == 1) ? (__playerOne.getIsCharged()) : (__playerTwo.getIsCharged()));
var _local4 = !((__state.turn == 1) ? (__playerOne.getIsArmoryDestroyed()) : (__playerTwo.getIsArmoryDestroyed()));
if (_local3 == "spikes") {
if (__state.turn == 1) {
__projectiles.push(nick.avatar.fortressfight2.Library.createProjectile(_local3, {angle:__fireAngle - 4, mag:__fireMagnitude + 40, left:((__state.turn == 1) ? true : false), x:_local2.x - 5, y:_local2.y - 6, ignite:_local5, charged:_local6, armory:_local4}));
var _local7 = nick.avatar.fortressfight2.Library.createProjectile(_local3, {angle:__fireAngle, mag:__fireMagnitude + 20, left:((__state.turn == 1) ? true : false), x:_local2.x + 20, y:_local2.y, ignite:_local5, charged:_local6, armory:_local4});
__projectiles.push(_local7);
__projectiles.push(nick.avatar.fortressfight2.Library.createProjectile(_local3, {angle:__fireAngle + 4, mag:__fireMagnitude, left:((__state.turn == 1) ? true : false), x:_local2.x + 40, y:_local2.y + 6, ignite:_local5, charged:_local6, armory:_local4}));
} else {
__projectiles.push(nick.avatar.fortressfight2.Library.createProjectile(_local3, {angle:__fireAngle + 4, mag:__fireMagnitude + 40, left:((__state.turn == 1) ? true : false), x:_local2.x + 5, y:_local2.y + 6, ignite:_local5, charged:_local6, armory:_local4}));
var _local7 = nick.avatar.fortressfight2.Library.createProjectile(_local3, {angle:__fireAngle, mag:__fireMagnitude + 20, left:((__state.turn == 1) ? true : false), x:_local2.x - 20, y:_local2.y, ignite:_local5, charged:_local6, armory:_local4});
__projectiles.push(_local7);
__projectiles.push(nick.avatar.fortressfight2.Library.createProjectile(_local3, {angle:__fireAngle - 4, mag:__fireMagnitude, left:((__state.turn == 1) ? true : false), x:_local2.x - 40, y:_local2.y - 6, ignite:_local5, charged:_local6, armory:_local4}));
}
__camera.goTrackingView(_local7);
} else {
__projectiles.push(nick.avatar.fortressfight2.Library.createProjectile(_local3, {angle:__fireAngle, mag:__fireMagnitude, left:((__state.turn == 1) ? true : false), x:_local2.x, y:_local2.y, ignite:_local5, charged:_local6, armory:_local4}));
__camera.goTrackingView(__projectiles[0]);
}
}
function onLavaSplatter() {
var _local4 = __projectiles[0].x;
var _local3 = __projectiles[0].y;
var _local2 = ((__state.turn == 1) ? true : false);
__projectiles.push(nick.avatar.fortressfight2.Library.createProjectile("lavachunk", {angle:235 + (Math.random() * 70), mag:210 + (Math.random() * 100), left:_local2, x:_local4, y:_local3}));
__projectiles.push(nick.avatar.fortressfight2.Library.createProjectile("lavachunk", {angle:235 + (Math.random() * 70), mag:230 + (Math.random() * 100), left:_local2, x:_local4, y:_local3}));
var _local5 = nick.avatar.fortressfight2.Library.createProjectile("lavachunk", {angle:270, mag:290, left:_local2, x:_local4, y:_local3});
__projectiles.push(_local5);
__projectiles.push(nick.avatar.fortressfight2.Library.createProjectile("lavachunk", {angle:235 + (Math.random() * 70), mag:130 + (Math.random() * 100), left:_local2, x:_local4, y:_local3}));
__projectiles.push(nick.avatar.fortressfight2.Library.createProjectile("lavachunk", {angle:235 + (Math.random() * 70), mag:200 + (Math.random() * 100), left:_local2, x:_local4, y:_local3}));
__camera.changeTrackingView(_local5);
}
function onSparkRockShatter() {
var _local4 = __projectiles[0].x;
var _local3 = __projectiles[0].y;
var _local2 = ((__state.turn == 1) ? true : false);
var _local5 = ((__state.turn == 1) ? (__playerOne.getIsCharged()) : (__playerTwo.getIsCharged()));
var _local6 = nick.avatar.fortressfight2.Library.createProjectile("sparkchunk", {angle:(_local2 ? 20 : 160), mag:300, left:_local2, x:_local4, y:_local3, charged:_local5});
__projectiles.push(_local6);
__projectiles.push(nick.avatar.fortressfight2.Library.createProjectile("sparkchunk", {angle:(_local2 ? 37 : 143), mag:300, left:_local2, x:_local4, y:_local3, charged:_local5}));
__projectiles.push(nick.avatar.fortressfight2.Library.createProjectile("sparkchunk", {angle:(_local2 ? 55 : 125), mag:300, left:_local2, x:_local4, y:_local3, charged:_local5}));
__camera.changeTrackingView(_local6);
}
function onSkipPower() {
smashing.rampage.Messenger.sendMessage("screen", "openWeapons");
}
function onSelectPower(pData) {
onActivatePower(nick.avatar.fortressfight2.Library.translatePowerNum(((__state.turn == 1) ? (__state.kingdom1) : (__state.kingdom2)), pData.num));
var _local2;
if (__state.turn == 1) {
_local2 = nick.avatar.fortressfight2.Library.retrievePowerCost(__state.kingdom1, pData.num);
_local2 = _local2 * __playerOne.bendingMultiplier;
if (__state.battlegroundKingdom == "air") {
_local2 = _local2 - 10;
} else if (__state.battlegroundKingdom == "earth") {
_local2 = _local2 + 10;
}
_local2 = Math.floor(_local2 / 10) * 10;
if (_local2 > 100) {
_local2 = 100;
}
__playerOne.onSpendPower(_local2);
} else {
_local2 = nick.avatar.fortressfight2.Library.retrievePowerCost(__state.kingdom2, pData.num);
_local2 = _local2 * __playerTwo.bendingMultiplier;
if (__state.battlegroundKingdom == "air") {
_local2 = _local2 - 10;
} else if (__state.battlegroundKingdom == "earth") {
_local2 = _local2 + 10;
}
_local2 = Math.floor(_local2 / 10) * 10;
if (_local2 > 100) {
_local2 = 100;
}
__playerTwo.onSpendPower(_local2);
}
smashing.rampage.Messenger.sendMessage("screen", "closePowers");
}
function onActivatePower(pID) {
__castingPowerID = pID;
setMode("powerintro");
}
function onSelectWeapon(pData) {
var _local2 = nick.avatar.fortressfight2.Library.translateWeaponNum(((__state.turn == 1) ? (__state.kingdom1) : (__state.kingdom2)), pData.num);
if (__state.turn == 1) {
__playerOne.setWeapon(_local2, pData.num);
} else {
__playerTwo.setWeapon(_local2, pData.num);
}
smashing.rampage.Messenger.sendMessage("screen", "closeWeapons");
setMode("aim");
}
function onMouseDown() {
if (_ymouse > 360) {
return(undefined);
}
if (__gameMode == "aim") {
__arrow.startCharge();
}
}
function onMouseUp() {
if ((__gameMode == "aim") && (__arrow.isCharging)) {
__arrow.endCharge();
__fireAngle = __arrow.translateAngle();
__fireMagnitude = __arrow.translateChargeToMagnitude();
setMode("catapult");
}
}
function onRespondIntroComplete(pData) {
if ((pData.success == true) || (__gameMode == "intro")) {
setMode("select");
}
}
function onPanToPlayerComplete() {
switch (__gameMode) {
case "catapult" :
if (__state.turn == 1) {
__playerOne.onFireCatapult();
} else {
__playerTwo.onFireCatapult();
}
break;
case "ai" :
generatePickups();
runPowerAI();
break;
case "select" :
smashing.rampage.Messenger.sendMessage("screen", "openPowers");
generatePickups();
break;
case "power" :
break;
case "powerfinish" :
update = updateWatch;
if ((__state.mode == 1) && (__state.turn == 2)) {
runWeaponAI();
} else {
smashing.rampage.Messenger.sendMessage("screen", "openWeapons");
}
}
}
function runPowerAI() {
var _local3 = __playerTwo.chooseRandomPower();
if (_local3 == 0) {
runWeaponAI();
} else {
onActivatePower(nick.avatar.fortressfight2.Library.translatePowerNum(((__state.turn == 1) ? (__state.kingdom1) : (__state.kingdom2)), _local3));
var _local2;
_local2 = nick.avatar.fortressfight2.Library.retrievePowerCost(__state.kingdom2, _local3);
_local2 = _local2 * __playerTwo.bendingMultiplier;
if (__state.battlegroundKingdom == "air") {
_local2 = _local2 - 10;
} else if (__state.battlegroundKingdom == "earth") {
_local2 = _local2 + 10;
}
_local2 = Math.floor(_local2 / 10) * 10;
if (_local2 > 100) {
_local2 = 100;
}
__playerTwo.onSpendPower(_local2);
}
}
function runWeaponAI() {
__playerTwo.chooseRandomWeapon();
if ((!__playerOne.getIsArmoryDestroyed()) && (Math.random() < 0.2)) {
__fireAngle = -130;
__fireMagnitude = 450 + (Math.random() * (__magnitudeDeviation / 2));
} else {
__fireAngle = (-140 + (__angleDeviation / 2)) - (Math.random() * __angleDeviation);
__fireMagnitude = (579 - (__magnitudeDeviation / 2)) + (Math.random() * __magnitudeDeviation);
}
setMode("catapult");
}
function onKeepHit(pData) {
__state.addScore(pData.damage * __SCORE_DAMAGE_MULTI);
__camera.goPlayerView(pData.player);
if (pData.player.getIsDestroyed()) {
setMode("gameover");
}
var _local2 = __playerOnePowers.length;
while (_local2--) {
(pData.player.isLeft ? (__playerOnePowers[_local2].onFriendlyDamage()) : (__playerOnePowers[_local2].onEnemyDamage()));
}
_local2 = __playerTwoPowers.length;
while (_local2--) {
(pData.player.isLeft ? (__playerTwoPowers[_local2].onEnemyDamage()) : (__playerTwoPowers[_local2].onFriendlyDamage()));
}
}
function onPowerIntroComplete() {
setMode("power");
}
function onPowerComplete() {
if (__lastPower.IS_INSTANT_OFFENSIVE || (__lastPower.IS_TRACKING_SPAWN)) {
setMode("powerfinish");
} else if ((__state.mode == 1) && (__state.turn == 2)) {
setMode("powerfinish");
} else {
smashing.rampage.Messenger.sendMessage("screen", "openWeapons");
update = updateWatch;
}
}
function onEarthWaveUpdateComplete() {
setMode("select");
}
function update(dt) {
}
function updateWatch(dt) {
__camera.update(dt);
renderAll(dt);
}
function updatePower(dt) {
__loop = __playerOnePowers.length;
while (__loop--) {
if (__playerOnePowers[__loop].doRemove) {
__playerOnePowers.splice(__loop, 1);
} else {
__playerOnePowers[__loop].update(dt);
}
}
__loop = __playerTwoPowers.length;
while (__loop--) {
if (__playerTwoPowers[__loop].doRemove) {
__playerTwoPowers.splice(__loop, 1);
} else {
__playerTwoPowers[__loop].update(dt);
}
}
__camera.update(dt);
__loop = __playerOnePowers.length;
while (__loop--) {
if (__playerOnePowers[__loop].doRemove) {
__playerOnePowers.splice(__loop, 1);
} else {
__playerOnePowers[__loop].render(dt);
}
}
__loop = __playerTwoPowers.length;
while (__loop--) {
if (__playerTwoPowers[__loop].doRemove) {
__playerTwoPowers.splice(__loop, 1);
} else {
__playerTwoPowers[__loop].render(dt);
}
}
if (dt == undefined) {
dt = 0;
}
__loop = __projectiles.length;
while (__loop--) {
__projectiles[__loop].render(dt);
}
__playerOne.render(dt);
__playerTwo.render(dt);
__loop = __scenery.length;
while (__loop--) {
__scenery[__loop].updateAndRender(dt);
}
__loop = __pickups.length;
while (__loop--) {
if (__pickups[__loop].doRemove) {
__pickups.splice(__loop, 1);
} else {
__pickups[__loop].updateAndRender(dt);
}
}
__loop = __effects.length;
while (__loop--) {
if (__effects[__loop].doRemove) {
__effects.splice(__loop, 1);
} else {
__effects[__loop].updateAndRender(dt);
}
}
if (__lastPower.DO_COLLECT_PICKUPS) {
__loop = __pickups.length;
while (__loop--) {
__pickups[__loop].runHD(__lastPower);
}
}
if (__igniteTimer > 0) {
__igniteTimer = __igniteTimer - dt;
if (__igniteTimer <= 0) {
onPowerComplete();
}
}
}
function updateGameOver(dt) {
__camera.update(dt);
renderAll(dt);
var _local2 = false;
if (__state.turn == 1) {
if (__playerTwo.isDestructionComplete()) {
_local2 = true;
}
} else if (__playerOne.isDestructionComplete()) {
_local2 = true;
}
if (_local2) {
__modeTimer = __modeTimer - dt;
if (__modeTimer < 0) {
smashing.rampage.Messenger.sendMessage("engine", "onGameOver");
}
}
}
function updateAI(dt) {
__camera.update(dt);
renderAll(dt);
}
function updateIntro(dt) {
__camera.update(dt);
renderAll(dt);
__modeTimer = __modeTimer - dt;
if (__modeTimer < 0) {
smashing.rampage.Messenger.sendMessage("screen", "requestIntroComplete");
}
}
function updateCatapult(dt) {
__camera.update(dt);
if (__state.turn == 1) {
if (__playerOne.isCatapultComplete()) {
setMode("fire");
}
} else if (__playerTwo.isCatapultComplete()) {
setMode("fire");
}
renderAll(dt);
}
function updateAim(dt) {
__camera.update(dt);
__arrow.updateAndRender(dt);
if (__state.turn == 1) {
__playerOne.onAimCatapult(__arrow.getAngleAsRatio());
} else {
__playerTwo.onAimCatapult(__arrow.getAngleAsRatio());
}
renderAll(dt);
}
function updateFire(dt) {
if (dt > 0.2) {
dt = 0.2;
}
var _local3;
__loop = __projectiles.length;
while (__loop--) {
__projectiles[__loop].update(dt);
}
__camera.update(dt);
__playerOne.updateAndRender(dt);
__playerTwo.updateAndRender(dt);
__loop = __projectiles.length;
while (__loop--) {
if (__projectiles[__loop].doRemove) {
__projectiles.splice(__loop, 1);
} else {
if (__state.turn == 1) {
__playerTwo.runHD(__projectiles[__loop]);
} else {
__playerOne.runHD(__projectiles[__loop]);
}
__bloop = __playerOnePowers.length;
while (__bloop--) {
if (__playerOnePowers[__bloop].DO_HD) {
__playerOnePowers[__bloop].runHD(__projectiles[__loop]);
}
}
__bloop = __playerTwoPowers.length;
while (__bloop--) {
if (__playerTwoPowers[__bloop].DO_HD) {
__playerTwoPowers[__bloop].runHD(__projectiles[__loop]);
}
}
__bloop = __pickups.length;
while (__bloop--) {
__pickups[__bloop].runHD(__projectiles[__loop]);
}
__projectiles[__loop].render(dt);
}
}
__loop = __scenery.length;
while (__loop--) {
__scenery[__loop].updateAndRender(dt);
}
__loop = __effects.length;
while (__loop--) {
if (__effects[__loop].doRemove) {
__effects.splice(__loop, 1);
} else {
__effects[__loop].updateAndRender(dt);
}
}
__loop = __playerOnePowers.length;
while (__loop--) {
if (__playerOnePowers[__loop].doRemove) {
__playerOnePowers.splice(__loop, 1);
} else {
__playerOnePowers[__loop].updateAndRender(dt);
}
}
__loop = __playerTwoPowers.length;
while (__loop--) {
if (__playerTwoPowers[__loop].doRemove) {
__playerTwoPowers.splice(__loop, 1);
} else {
__playerTwoPowers[__loop].updateAndRender(dt);
}
}
__loop = __pickups.length;
while (__loop--) {
_local3 = __pickups[__loop];
if (_local3.doRemove) {
__pickups.splice(__loop, 1);
} else {
_local3.updateAndRender(dt);
}
}
if (__projectiles.length == 0) {
onTurnEnd();
}
}
function onTurnEnd() {
__state.nextTurn();
var _local2 = false;
if (__state.turn == 1) {
__playerOne.onTurnBegin();
__loop = __playerOnePowers.length;
while (__loop--) {
__playerOnePowers[__loop].updateFriendlyTurn();
if (__playerOnePowers[__loop].ID == "wave") {
_local2 = true;
__lastEarthWave = __playerOnePowers[__loop];
}
}
__loop = __playerTwoPowers.length;
while (__loop--) {
__playerTwoPowers[__loop].updateEnemyTurn();
}
if (_local2 && (__lastEarthWave.isAlive)) {
setMode("earthwave");
} else {
setMode("select");
}
} else {
__playerTwo.onTurnBegin();
__loop = __playerOnePowers.length;
while (__loop--) {
__playerOnePowers[__loop].updateEnemyTurn();
}
__loop = __playerTwoPowers.length;
while (__loop--) {
__playerTwoPowers[__loop].updateFriendlyTurn();
if (__playerTwoPowers[__loop].ID == "wave") {
_local2 = true;
__lastEarthWave = __playerTwoPowers[__loop];
}
}
if (__state.mode == 2) {
if (_local2) {
setMode("earthwave");
} else {
setMode("select");
}
} else {
if (__state.turnsPassed >= 26) {
__angleDeviation = 0;
__magnitudeDeviation = 0;
}
setMode("ai");
}
}
}
function renderAll(dt) {
if (dt == undefined) {
dt = 0;
}
__loop = __projectiles.length;
while (__loop--) {
__projectiles[__loop].render(dt);
}
__playerOne.render(dt);
__playerTwo.render(dt);
__loop = __scenery.length;
while (__loop--) {
__scenery[__loop].updateAndRender(dt);
}
__loop = __pickups.length;
while (__loop--) {
if (__pickups[__loop].doRemove) {
__pickups.splice(__loop, 1);
} else {
__pickups[__loop].updateAndRender(dt);
}
}
__loop = __playerOnePowers.length;
while (__loop--) {
if (__playerOnePowers[__loop].doRemove) {
__playerOnePowers.splice(__loop, 1);
} else {
__playerOnePowers[__loop].updateAndRender(dt);
}
}
__loop = __playerTwoPowers.length;
while (__loop--) {
if (__playerTwoPowers[__loop].doRemove) {
__playerTwoPowers.splice(__loop, 1);
} else {
__playerTwoPowers[__loop].updateAndRender(dt);
}
}
__loop = __effects.length;
while (__loop--) {
if (__effects[__loop].doRemove) {
__effects.splice(__loop, 1);
} else {
__effects[__loop].updateAndRender(dt);
}
}
}
function generate(pLevelNum) {
clear();
__camera = nick.avatar.fortressfight2.GameCamera.getInstance();
__camera.generate({y:6800});
__camera.goInitView();
if (pLevelNum == 1) {
__playerOne = new nick.avatar.fortressfight2.ents.Player({kingdom:__state.kingdom1, left:true});
} else {
__playerOne.resetForMatch();
}
__playerTwo = new nick.avatar.fortressfight2.ents.Player({kingdom:__state.kingdom2, left:false});
__state.linkPlayers(__playerOne, __playerTwo);
generateBattleground();
__entitys = [];
var _local2 = (__maxLevel - pLevelNum) * 5;
if (_local2 < 0) {
_local2 = 0;
}
__angleDeviation = _local2 * 1.5;
__magnitudeDeviation = _local2 * 5.6;
}
function generateBurn() {
__lastPower = nick.avatar.fortressfight2.Library.createPower("burn", {enemy:((__state.turn == 1) ? (__playerOne) : (__playerTwo)), owner:((__state.turn == 1) ? (__playerTwo) : (__playerOne))});
var _local2;
if (__state.turn == 1) {
while (_local2--) {
_local2 = __playerTwoPowers.length;
if (__playerTwoPowers[_local2].ID == __lastPower.ID) {
__playerTwoPowers[_local2].clear();
}
}
__playerTwoPowers.push(__lastPower);
} else {
_local2 = __playerOnePowers.length;
while (_local2--) {
if (__playerOnePowers[_local2].ID == __lastPower.ID) {
__playerOnePowers[_local2].clear();
}
}
__playerOnePowers.push(__lastPower);
}
}
function generatePower() {
__lastPower = nick.avatar.fortressfight2.Library.createPower(__castingPowerID, {owner:((__state.turn == 1) ? (__playerOne) : (__playerTwo)), enemy:((__state.turn == 1) ? (__playerTwo) : (__playerOne))});
if (__castingPowerID == "ignite") {
if (__state.turn == 1) {
__playerOne.applyIgnite();
} else {
__playerTwo.applyIgnite();
}
__igniteTimer = 1;
return(undefined);
}
var _local2;
if (__state.turn == 1) {
_local2 = __playerOnePowers.length;
while (_local2--) {
if (__playerOnePowers[_local2].ID == __lastPower.ID) {
__playerOnePowers[_local2].clear();
}
}
__playerOnePowers.push(__lastPower);
} else {
while (_local2--) {
_local2 = __playerTwoPowers.length;
if (__playerTwoPowers[_local2].ID == __lastPower.ID) {
__playerTwoPowers[_local2].clear();
}
}
__playerTwoPowers.push(__lastPower);
}
if (__lastPower.IS_INSTANT_OFFENSIVE) {
__camera.goPlayerView(((__state.turn == 1) ? (__playerTwo) : (__playerOne)));
} else if (__lastPower.IS_TRACKING_SPAWN) {
__camera.goTrackingView(__lastPower);
}
}
function generateShrapnel(pData) {
pData.kingdom = ((__state.turn == 1) ? (__playerTwo.kingdom) : (__playerOne.kingdom));
var _local2 = 3 + Math.ceil(Math.random() * 2);
if (__effects.length > 4) {
_local2 = 1;
}
while (_local2--) {
__effects.push(nick.avatar.fortressfight2.Library.createShrapnel(pData));
}
}
function generateBattleground() {
var _local3 = ["earth", "air", "water", "fire"];
var _local2 = Math.floor(Math.random() * _local3.length);
if (_local2 == _local3.length) {
_local2--;
}
__battleground = nick.avatar.fortressfight2.Library.createBattleground(_local3[_local2]);
smashing.rampage.Messenger.sendMessage("engine", "setBGColor", {kingdom:__battleground.kingdom});
__state.selectBattleground(_local3[_local2]);
__scenery = [];
__scenery.push(nick.avatar.fortressfight2.Library.createScroller({bg:__battleground.FAR_ASSET, tiles:3, zmult:0.2}));
__scenery.push(nick.avatar.fortressfight2.Library.createScroller({bg:__battleground.MID_ASSET, tiles:3, zmult:0.5}));
__scenery.push(nick.avatar.fortressfight2.Library.createScroller({bg:__battleground.NEAR_ASSET, tiles:5, zmult:1}));
}
function generatePickups() {
var _local2 = __pickups.length;
while (_local2--) {
__pickups[_local2].requestErase();
}
__pickups = [];
var _local4 = ((__state.turn == 1) ? 1400 : 2050);
var _local3 = nick.avatar.fortressfight2.Library.createRandomPickups(1 + Math.ceil(Math.random() * 2), __state.mode);
_local2 = _local3.length;
while (_local2--) {
_local3[_local2].x = _local4 + (Math.random() * 500);
_local3[_local2].y = 6450 - (_local2 * 245);
__pickups.push(_local3[_local2]);
}
}
function get camera() {
return(__camera);
}
function onCollectDamage() {
trace("Collect Dam");
var _local2 = __projectiles.length;
while (_local2--) {
__projectiles[_local2].onCharge();
}
if (__state.turn == 1) {
__playerOne.applyCharge();
} else {
__playerTwo.applyCharge();
}
__state.addScore(__SCORE_PICKUP);
}
function onCollectHealth() {
if (__state.turn == 1) {
__playerOne.onHeal(2 + (__playerOne.getIsAmplifying() ? 1 : 0));
} else {
__playerTwo.onHeal(2 + (__playerTwo.getIsAmplifying() ? 1 : 0));
}
__state.addScore(__SCORE_PICKUP);
}
function onCollectAmmo() {
if (__state.turn == 1) {
__playerOne.collectAmmo(1 + (__playerOne.getIsAmplifying() ? 1 : 0));
} else {
__playerTwo.collectAmmo(1 + (__playerTwo.getIsAmplifying() ? 1 : 0));
}
__state.addScore(__SCORE_PICKUP);
}
function onCollectGold() {
if (__state.turn == 1) {
__state.addScore(__SCORE_PICKUP + (__playerOne.getIsAmplifying() ? 75 : 0));
__state.addGold(55);
} else {
__state.addScore(__SCORE_PICKUP + (__playerTwo.getIsAmplifying() ? 75 : 0));
}
}
function onSatelliteDestroyed() {
__state.addScore(__SCORE_SATELLITE);
}
function onMessageReceived(message, args) {
this[message](args);
}
var __INTRO_TIMER = 6;
var __GAMEOVER_TIMER = 1.6;
var __maxLevel = 6;
var __SCORE_PICKUP = 300;
var __SCORE_DAMAGE_MULTI = 50;
var __SCORE_SATELLITE = 400;
var __VICTORY_GOLD_BONUS = 100;
}
Symbol 1252 MovieClip [__Packages.smashing.rampage.BaseCamera] Frame 0
class smashing.rampage.BaseCamera
{
static var __instance;
var __gameState, x, y, z, fl, farClip, __bound_left, __bound_right, __bound_top, __bound_bottom, left, right, top, bottom;
function BaseCamera (t_data) {
}
static function init() {
__instance = new smashing.rampage.BaseCamera();
}
static function getInstance() {
return(__instance);
}
function generate(t_data) {
__gameState = getGameState();
x = (y = (z = 0));
if (t_data.x != undefined) {
x = t_data.x;
}
if (t_data.y != undefined) {
y = t_data.y;
}
if (t_data.z != undefined) {
z = t_data.z;
}
fl = __FL_DEF;
farClip = __DEF_CLIP;
refreshEdges();
}
function getGameState() {
return(new Object());
}
function update(dt) {
}
function setBounds(left, right, top, bottom) {
__bound_left = left + __gameState.HALF_WIDTH;
__bound_right = right - __gameState.HALF_WIDTH;
__bound_top = top + __gameState.HALF_HEIGHT;
__bound_bottom = bottom - __gameState.HALF_HEIGHT;
}
function enforceBounds() {
if (x < __bound_left) {
x = __bound_left;
} else if (x > __bound_right) {
x = __bound_right;
}
if (y < __bound_top) {
y = __bound_top;
} else if (y > __bound_bottom) {
y = __bound_bottom;
}
}
function refreshEdges() {
left = x - __gameState.HALF_WIDTH;
right = x + __gameState.HALF_WIDTH;
top = y - __gameState.HALF_HEIGHT;
bottom = y + __gameState.HALF_HEIGHT;
}
function get sc() {
return(__gameState.sc);
}
function screenWidth() {
return(__gameState.SCREEN_WIDTH);
}
function screenHeight() {
return(__gameState.SCREEN_WIDTH);
}
function halfWidth() {
return(__gameState.HALF_WIDTH);
}
function halfHeight() {
return(__gameState.HALF_HEIGHT);
}
function toString() {
return((((("Camera : focus : " + x) + " , ") + y) + " , ") + z);
}
var __DEF_CLIP = 100000;
var __FL_DEF = 1000;
var __EDGE_PADDING = 50;
}
Symbol 1253 MovieClip [__Packages.nick.avatar.fortressfight2.GameCamera] Frame 0
class nick.avatar.fortressfight2.GameCamera extends smashing.rampage.BaseCamera
{
static var __instance;
var z, x, y, __trackingObject, __trackStartX, __trackStartY, __trackStartZ, __trackLine, __trackProgress, __trackRatio, __trackTargetX, __gameState;
function GameCamera () {
super();
}
static function init() {
__instance = new nick.avatar.fortressfight2.GameCamera();
}
static function getInstance() {
return(__instance);
}
function getGameState() {
return(nick.avatar.fortressfight2.GameState.getInstance());
}
function goInitView() {
z = 0;
x = __LONG_X;
y = nick.avatar.fortressfight2.GameState.getInstance().GROUND_Y - 150;
}
function goIntroView() {
update = updateIntro;
z = __LONG_Z;
x = __LONG_X;
y = nick.avatar.fortressfight2.GameState.getInstance().GROUND_Y - 150;
}
function goPlayerView(pPlayer) {
__trackingObject = pPlayer;
update = updatePlayer;
__trackStartX = x;
__trackStartY = y;
__trackStartZ = z;
__trackLine = new smashing.Point3D(__trackingObject.x - x, __trackingObject.y - y, Math.abs(z));
__trackProgress = 0;
__trackRatio = 0;
}
function goLongView() {
update = updateLong;
z = 0;
__trackStartX = x;
__trackTargetX = __LONG_X - x;
}
function goTrackingView(pTarget) {
__trackingObject = pTarget;
update = updateTracking;
z = 0;
}
function changeTrackingView(pTarget) {
__trackingObject = pTarget;
}
function update(dt) {
}
function updatePlayer(dt) {
if (__trackRatio < 1) {
__trackProgress = __trackProgress + (__SCROLL_RATE * dt);
__trackRatio = __trackProgress / __trackLine.__get__length();
if (__trackRatio >= 1) {
__trackRatio = 1;
z = 0;
smashing.rampage.Messenger.sendMessage("world", "onPanToPlayerComplete");
}
x = __trackStartX + (__trackLine.x * __trackRatio);
y = __trackStartY + (__trackLine.y * __trackRatio);
z = __trackStartZ + (__trackLine.z * __trackRatio);
}
if (y > (__gameState.GROUND_Y - 200)) {
y = __gameState.GROUND_Y - 200;
}
}
function updateLong(dt) {
if (z > __LONG_Z) {
z = z + (__ZOOM_RATE_Z * dt);
if (z < __LONG_Z) {
z = __LONG_Z;
}
}
x = __trackStartX + (__trackTargetX * (z / __LONG_Z));
}
function updateIntro(dt) {
z = z + (30 * dt);
if (y > (__gameState.GROUND_Y - 200)) {
y = __gameState.GROUND_Y - 200;
}
}
function updateTracking(dt) {
z = z - (50 * dt);
var _local3 = __trackingObject.x - x;
var _local2 = __trackingObject.y - y;
if (_local3 > __SCROLL_TETHER_H) {
x = __trackingObject.x - __SCROLL_TETHER_H;
} else if (_local3 < (-__SCROLL_TETHER_H)) {
x = __trackingObject.x + __SCROLL_TETHER_H;
}
if (_local2 > __SCROLL_TETHER_V) {
y = __trackingObject.y - __SCROLL_TETHER_V;
} else if (_local2 < (-__SCROLL_TETHER_V)) {
y = __trackingObject.y + __SCROLL_TETHER_V;
}
if (y > (__gameState.GROUND_Y - 200)) {
y = __gameState.GROUND_Y - 200;
}
}
var __ENFORCE_BOUNDS = true;
var __SCROLL_TETHER_H = 45;
var __SCROLL_TETHER_V = 45;
var __SCROLL_RATE = 2200;
var __CHASE_RATE = 300;
var __ZOOM_RATE_Z = -1500;
var __LONG_Z = -2250;
var __LONG_X = 1900;
}
Symbol 1254 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);
}
function rotateMe(angle) {
var _local3 = Math.cos((angle * Math.PI) / 180);
var _local2 = Math.sin((angle * Math.PI) / 180);
x = (x * _local3) - (y * _local2);
y = (x * _local2) + (y * _local3);
}
function rotate(angle) {
var _local3 = Math.cos((angle * Math.PI) / 180);
var _local2 = Math.sin((angle * Math.PI) / 180);
return(new smashing.Point3D((x * _local3) - (y * _local2), (x * _local2) + (y * _local3), 0));
}
}
Symbol 1255 MovieClip [__Packages.nick.avatar.fortressfight2.GameState] Frame 0
class nick.avatar.fortressfight2.GameState
{
static var __instance;
var playerOne, playerTwo, hasChanged, levelNum, score1, score2, gold, turnsPassed, kingdom1, kingdom2, mode, goldChanged, turn, battlegroundKingdom;
function GameState () {
}
static function init() {
__instance = new nick.avatar.fortressfight2.GameState();
}
static function getInstance() {
return(__instance);
}
function linkPlayers(p1, p2) {
trace("Linked Players : " + p1);
playerOne = p1;
playerTwo = p2;
hasChanged = true;
}
function resetGame() {
levelNum = 1;
score1 = 0;
score2 = 0;
gold = 0;
turnsPassed = 0;
kingdom1 = "";
kingdom2 = "";
hasChanged = false;
if (mode == 1) {
goldChanged = true;
} else {
goldChanged = false;
}
if (mode == 1) {
setTurn(1);
} else {
setTurn(((Math.random() < 0.5) ? 1 : 2));
}
}
function nextMatch() {
turnsPassed = 0;
levelNum++;
score2 = 0;
}
function resetMatch() {
hasChanged = false;
}
function setModeSingle() {
mode = 1;
}
function setModeVersus() {
mode = 2;
}
function setTurn(pNum) {
turn = pNum;
}
function nextTurn() {
turnsPassed++;
if (turn == 1) {
turn = 2;
} else {
turn = 1;
}
}
function selectKingdom(pIndex, pKingdom) {
if (pIndex == 1) {
kingdom1 = pKingdom;
} else {
kingdom2 = pKingdom;
}
}
function selectRandomKingdom() {
var _local3 = ["water", "earth", "fire"];
var _local4 = kingdom2;
var _local2 = _local3.length;
while (_local2--) {
if ((_local3[_local2] == _local4) || (_local3[_local2] == kingdom1)) {
_local3.splice(_local2, 1);
}
}
var _local5 = Math.floor(Math.random() * _local3.length);
if (_local5 > (_local3.length - 1)) {
_local5--;
}
kingdom2 = _local3[_local5];
}
function selectBattleground(pKingdom) {
battlegroundKingdom = pKingdom;
}
function addScore(val) {
if (turn == 1) {
score1 = score1 + val;
if (mode == 1) {
addGold(Math.floor(val / 15));
}
} else {
score2 = score2 + val;
}
hasChanged = true;
}
function addGold(val) {
if (mode != 1) {
return(undefined);
}
gold = gold + val;
goldChanged = true;
hasChanged = true;
}
function spendGold(pAmount) {
trace("[State] Spend Gold : " + pAmount);
gold = gold - pAmount;
goldChanged = true;
hasChanged = true;
}
var SCREEN_WIDTH = Stage.width;
var SCREEN_HEIGHT = Stage.height;
var HALF_WIDTH = Stage.width / 2;
var HALF_HEIGHT = Stage.height / 2;
var sc = {x:Stage.width / 2, y:Stage.height / 2};
var GROUND_Y = 7000;
var LEFT_KEEP_X = 1000;
var RIGHT_KEEP_X = 2800;
var GRAVITY_Y = 220;
var quitGame = false;
var REPAIR_TOWER_COST = 80;
var REPAIR_ARMORY_COST = 80;
var REPAIR_KEEP_COST = 350;
var AMMO_COST = 20;
}
Symbol 1256 MovieClip [__Packages.nick.avatar.fortressfight2.ents.Player] Frame 0
class nick.avatar.fortressfight2.ents.Player
{
var kingdom, isLeft, __keep, __catapult, __tower, __armory, weaponID, weaponNum, bendingMultiplier, power, ammo0, ammo1, ammo2, ammo3, ammo1Value, ammo2Value, ammo3Value, __AICostArray, __ignited, __charged, __amplifying, __village, __result;
function Player (pData) {
init(pData);
}
function init(pData) {
kingdom = pData.kingdom;
isLeft = pData.left;
var _local3 = (isLeft ? (nick.avatar.fortressfight2.GameState.getInstance().LEFT_KEEP_X) : (nick.avatar.fortressfight2.GameState.getInstance().RIGHT_KEEP_X));
var _local2 = nick.avatar.fortressfight2.GameState.getInstance().GROUND_Y - 60;
__keep = nick.avatar.fortressfight2.Library.createKeep(kingdom, {x:_local3, y:_local2, left:isLeft, owner:this});
__catapult = nick.avatar.fortressfight2.Library.createCatapult({kingdom:kingdom, x:_local3 + 20, y:_local2, left:isLeft, owner:this});
__tower = nick.avatar.fortressfight2.Library.createTower({kingdom:kingdom, x:_local3 + (__TOWER_OFFSET * (isLeft ? 1 : -1)), y:_local2, left:isLeft, owner:this});
__armory = nick.avatar.fortressfight2.Library.createArmory({kingdom:kingdom, x:_local3 + (__ARMORY_OFFSET * (isLeft ? 1 : -1)), y:_local2, left:isLeft, owner:this});
weaponID = "";
weaponNum = 0;
bendingMultiplier = 1;
power = 100;
ammo0 = 99;
if (kingdom == "water") {
ammo1 = 8;
ammo2 = 5;
ammo3 = 2;
ammo1Value = 1;
ammo2Value = 2;
ammo3Value = 4;
} else if (kingdom == "earth") {
ammo1 = 5;
ammo2 = 3;
ammo3 = 2;
ammo1Value = 2;
ammo2Value = 3;
ammo3Value = 4;
} else if (kingdom == "fire") {
ammo1 = 4;
ammo2 = 4;
ammo3 = 2;
ammo1Value = 2;
ammo2Value = 3;
ammo3Value = 4;
}
__AICostArray = [];
__ignited = false;
__charged = false;
__amplifying = false;
__village = [];
}
function resetForMatch() {
power = 100;
__ignited = false;
__charged = false;
__amplifying = false;
weaponID = "";
weaponNum = 0;
bendingMultiplier = 1;
}
function update(dt) {
}
function collectAmmo(pCount) {
var _local2;
while (pCount--) {
_local2 = Math.ceil(Math.random() * 3);
if (_local2 == 0) {
_local2 = 1;
}
this["ammo" + _local2]++;
}
if (this["ammo" + _local2] > 99) {
this["ammo" + _local2] = 99;
}
}
function onPurchaseAmmo(pNum) {
this["ammo" + pNum]++;
if (this["ammo" + pNum] > 99) {
this["ammo" + pNum] = 99;
}
}
function onVictoryAmmoBonus() {
if (ammo1 < 4) {
ammo1++;
if (ammo1 > 99) {
ammo1 = 99;
}
}
if (ammo2 < 4) {
ammo2++;
if (ammo2 > 99) {
ammo2 = 99;
}
}
if (ammo3 < 4) {
ammo3++;
if (ammo3 > 99) {
ammo3 = 99;
}
}
}
function onTurnBegin(dt) {
bendingMultiplier = 1;
if (power < 100) {
power = power + (15 + ((__tower.health > 0) ? 10 : 0));
if (power > 100) {
power = 100;
}
}
__ignited = false;
__charged = false;
__amplifying = false;
}
function updateAndRender(dt) {
render(dt);
}
function render(dt) {
__keep.render(dt);
__catapult.render(dt);
__tower.render(dt);
__armory.render(dt);
}
function setWeapon(pID, pNum) {
weaponID = pID;
weaponNum = pNum;
if (weaponID == "orb") {
__amplifying = true;
}
__catapult.setWeapon(weaponID);
}
function chooseRandomWeapon() {
var _local2 = Math.ceil(Math.random() * 3);
if (_local2 == 0) {
_local2++;
}
setWeapon(nick.avatar.fortressfight2.Library.translateWeaponNum(kingdom, _local2), _local2);
}
function chooseRandomPower() {
var _local3;
var _local2;
var _local4 = nick.avatar.fortressfight2.GameState.getInstance().battlegroundKingdom;
if (__AICostArray.length == 0) {
_local3 = 1;
while (_local3 < 4) {
_local2 = nick.avatar.fortressfight2.Library.retrievePowerCost(kingdom, _local3);
if (_local4 == "air") {
_local2 = _local2 - 10;
} else if (_local4 == "earth") {
_local2 = _local2 + 10;
}
__AICostArray.push(_local2);
_local3++;
}
}
var _local5 = [];
_local3 = __AICostArray.length;
while (_local3--) {
if ((__AICostArray[_local3] * bendingMultiplier) <= power) {
_local5.push(_local3 + 1);
}
}
if (((power < 100) && (Math.random() < 0.4)) || (_local5.length == 0)) {
return(0);
}
var _local6 = Math.ceil(Math.random() * _local5.length);
if (_local6 == 0) {
_local6++;
}
return(_local6);
}
function onSpendPower(pAmount) {
power = power - pAmount;
if (power < 0) {
trace("[Player][onSpendPower] ERROR! Somehow Overspent power ~ " + power);
}
}
function runHD(pProjectile) {
if (!pProjectile.getIsDangerous()) {
return(undefined);
}
if (__armory.health > 0) {
if (pProjectile.doBoxHD) {
__result = {result:__armory.runBoxCollision(pProjectile), loc:"armory"};
} else {
__result = __armory.runLineCollision(pProjectile.moveLine);
}
if (__result.result == true) {
__armory.hitReact(__result.loc, pProjectile);
pProjectile.onHitStructure();
if (__armory.health <= 0) {
onArmoryDestroyed();
}
return(undefined);
}
}
if (__tower.health > 0) {
if (pProjectile.doBoxHD) {
__result = {result:__tower.runBoxCollision(pProjectile), loc:"tower"};
} else {
__result = __tower.runLineCollision(pProjectile.moveLine);
}
if (__result.result == true) {
__tower.hitReact(__result.loc, pProjectile);
pProjectile.onHitStructure();
if (__tower.health <= 0) {
onTowerDestroyed();
}
return(undefined);
}
}
if (pProjectile.doBoxHD) {
if (__keep.runBoxCollision(pProjectile)) {
onHorizontalDamage(pProjectile.getDamage());
pProjectile.onHitStructure();
}
return(undefined);
}
__result = __keep.runLineCollision(pProjectile.moveLine);
if (__result.result == true) {
__keep.hitReact(__result.loc, pProjectile);
pProjectile.onHitKeep();
smashing.rampage.Messenger.sendMessage("world", "onKeepHit", {player:this, damage:pProjectile.getDamage()});
return(undefined);
}
}
function onArmoryDestroyed() {
smashing.rampage.Messenger.sendMessage("world", "onSatelliteDestroyed");
}
function onTowerDestroyed() {
smashing.rampage.Messenger.sendMessage("world", "onSatelliteDestroyed");
}
function onAimCatapult(pAngleRatio) {
__catapult.aim(pAngleRatio);
}
function onFireCatapult() {
__catapult.fire();
if (weaponNum > 0) {
this["ammo" + weaponNum]--;
}
}
function isCatapultComplete() {
if (__catapult.testIsFireComplete()) {
return(true);
}
return(false);
}
function getFirePoint() {
return(__catapult.getFirePoint());
}
function getIsDestroyed() {
return(__keep.heartHealth <= 0);
}
function getIsTowerDestroyed() {
return(__tower.health <= 0);
}
function getIsArmoryDestroyed() {
return(__armory.health <= 0);
}
function getHealthAsPercent() {
return(__keep.getHealthAsPercent());
}
function onRepairKeep() {
__keep.healToFull();
}
function onRepairTower() {
__tower.healToFull();
}
function onRepairArmory() {
__armory.healToFull();
}
function isDestructionComplete() {
return(__keep.isDestructionComplete());
}
function onHeal(pAmount) {
__keep.onHeal(pAmount);
}
function onDamage(pAmount) {
__keep.onDamage(pAmount);
}
function onKeepDamaged(pData) {
smashing.rampage.Messenger.sendMessage("world", "onKeepHit", {player:this, damage:pData.damage});
}
function onVerticalDamage(pAmount) {
__keep.onVerticalDamage(pAmount);
}
function onHorizontalDamage(pAmount) {
__keep.onHorizontalDamage(pAmount);
}
function applyIgnite() {
__ignited = true;
__catapult.applyIgnite();
}
function applyCharge() {
__charged = true;
}
function getIsIgnited() {
return(__ignited);
}
function getIsCharged() {
return(__charged);
}
function getIsAmplifying() {
return(__amplifying);
}
function get x() {
return(__keep.x);
}
function get y() {
return(__keep.y);
}
function get z() {
return(__keep.z);
}
function get renderx() {
return(__keep.mc._x);
}
function get rendery() {
return(__keep.mc._y);
}
var __TOWER_OFFSET = 400;
var __ARMORY_OFFSET = 650;
}
Symbol 1257 MovieClip [__Packages.smashing.rampage.Renderable] Frame 0
class smashing.rampage.Renderable
{
var mc, baseWidth, baseHeight, hdWidth, hdHeight, radius, assetID, startX, startY, startZ, __camera, x, y, z, depthInfluence, flipH, doUpdate, threedScale, __onscreen, isDrawn, isAlive, isHidden, scale, startScale, hdReg;
function Renderable (t_data) {
mc = null;
baseWidth = __DEF_WIDTH;
baseHeight = __DEF_HEIGHT;
if (__USE_DIMENSIONS_AS_HD) {
hdWidth = baseWidth / 2;
hdHeight = baseHeight / 2;
radius = hdWidth;
} else {
hdWidth = __DEF_HD_WIDTH / 2;
hdHeight = __DEF_HD_HEIGHT / 2;
radius = hdWidth;
}
setHDRegistration();
init(t_data);
}
function init(t_data) {
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 (__camera != undefined) {
initScale();
}
x = startX;
y = startY;
z = startZ;
if (t_data.depthInfluence == undefined) {
t_data.depthInfluence = 0;
}
depthInfluence = t_data.depthInfluence;
if (t_data.flip != undefined) {
flip();
} else {
flipH = false;
}
doUpdate = __DO_UPDATE;
threedScale = __3D_SCALE;
__onscreen = false;
if (((mc == undefined) || (mc == null)) || (mc == "")) {
isDrawn = false;
}
isAlive = true;
isHidden = false;
}
function linkCamera(cam) {
__camera = cam;
if (startZ != undefined) {
initScale();
}
}
function onDraw(t_newmc) {
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;
}
}
if (flipH) {
mc._xscale = -100;
}
mc._x = -1000 - baseWidth;
mc._y = -1000 - baseHeight;
}
function update(dt) {
}
function updateAndRender(dt) {
}
function render(dt) {
updateDraw();
if (!isDrawn) {
return(undefined);
}
if (threedScale) {
if (z < __camera.z) {
return(undefined);
}
var _local2 = __camera.fl / (z - __camera.z);
if (scale != _local2) {
scale = _local2;
mc._xscale = (mc._yscale = 100 * (1 + (scale - startScale)));
if (flipH) {
mc._xscale = mc._xscale * -1;
}
}
}
mc._x = ((x - __camera.x) * scale) + __camera.__get__sc().x;
mc._y = ((y - __camera.y) * scale) + __camera.__get__sc().y;
}
function renderDirect(camera) {
mc._x = x;
mc._y = y;
}
function initScale() {
startScale = (scale = __camera.fl / (startZ - __camera.z));
}
function updateDraw() {
__onscreen = false;
if (CUSTOMDRAW) {
__onscreen = true;
} else if (z >= __camera.z) {
if ((Math.abs((x - __camera.x) * scale) < (__camera.__get__sc().x + baseWidth)) && (Math.abs((y - __camera.y) * scale) < (__camera.__get__sc().y + baseHeight))) {
__onscreen = true;
}
}
if ((!isDrawn) && (__onscreen)) {
smashing.rampage.viewport.Viewport.getInstance().draw({element:this});
} else if (isDrawn && (!__onscreen)) {
requestErase();
}
}
function onErase(t_viewport) {
isDrawn = false;
mc = null;
}
function requestErase() {
if (!isDrawn) {
return(undefined);
}
smashing.rampage.viewport.Viewport.getInstance().erase({element:this});
}
function requestDepthSort() {
smashing.rampage.viewport.Viewport.getInstance().requestGroupDepthSort(getDrawType());
}
function requestDepthChange() {
smashing.rampage.viewport.Viewport.getInstance().requestDepthChange(this);
}
function deleteMe() {
}
function kill() {
isAlive = false;
}
function hide() {
if (isDrawn) {
mc._visible = false;
}
isHidden = true;
}
function show() {
if (isDrawn) {
mc._visible = true;
}
isHidden = false;
}
function flip() {
flipH = true;
if (isDrawn) {
mc._xscale = -100;
}
}
function unflip() {
flipH = false;
if (isDrawn) {
mc._xscale = 100;
}
}
function toggleFlip() {
if (flipH) {
unflip();
} else {
flip();
}
}
function setHDRegistration() {
hdReg = {};
hdReg.x = 0;
hdReg.y = 0;
}
function runHD_entity_radius(t_target, dt) {
var _local4 = (x + hdReg.x) - (t_target.x + t_target.hdReg.x);
var _local3 = (y + hdReg.y) - (t_target.y + 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, dt) {
if (Math.abs((x + hdReg.x) - (t_target.x + t_target.hdReg.x)) < (hdWidth + t_target.hdWidth)) {
if (Math.abs((y + hdReg.y) - (t_target.y + t_target.hdReg.y)) < (hdHeight + t_target.hdHeight)) {
return(true);
}
}
return(false);
}
function runHD_entity_3D(t_target, dt) {
var _local3 = z - t_target.z;
var _local2 = (z + radius) - t_target.z;
if ((_local3 * _local2) <= 0) {
return(runHD_entity_radius(t_target, dt));
}
return(false);
}
function runHD_line_sphere(t_lineStart, t_lineEnd, dt) {
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, dt) {
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_source) {
}
function getDrawType() {
return(DRAWTYPE);
}
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 __DEF_ASSET = "";
var __DEF_Z = 1000;
var __3D_SCALE = false;
var __DEF_WIDTH = 50;
var __DEF_HEIGHT = 50;
var __USE_ACTUAL_DIMENSIONS = true;
var CUSTOMDRAW = false;
var __DEF_HD_WIDTH = 25;
var __DEF_HD_HEIGHT = 25;
var __USE_DIMENSIONS_AS_HD = true;
var __DO_UPDATE = true;
}
Symbol 1258 MovieClip [__Packages.smashing.rampage.viewport.Viewport] Frame 0
class smashing.rampage.viewport.Viewport
{
static var __instance;
var __a_groups, __o_groups, __dimensions, __viewportPath, __viewportDepth, __useScrollport, __sortGroupHasChanged, __groupsToBeUpdated, __groupsToBeSorted, __scrollportDepth, __loop, mc, scrollmc;
function Viewport (pPath, pDepth, pDimensions) {
__a_groups = [];
__o_groups = {};
__dimensions = pDimensions;
__viewportPath = pPath;
__viewportDepth = pDepth;
__useScrollport = false;
__sortGroupHasChanged = false;
__groupsToBeUpdated = [];
__groupsToBeSorted = [];
trace("-- Init Viewport --");
}
static function init(pPath, pDepth, pDimensions) {
__instance = new smashing.rampage.viewport.Viewport(pPath, pDepth, pDimensions);
}
static function getInstance() {
return(__instance);
}
function setScrollport(pDepth) {
__useScrollport = true;
__scrollportDepth = pDepth;
}
function initGroups() {
var _local6 = __a_groups.length;
var _local2;
var _local5 = [];
var _local3 = 0;
while (_local5.length < _local6) {
_local2 = __a_groups.length;
while (_local2--) {
if (__a_groups[_local2].index < __a_groups[_local3].index) {
_local3 = _local2;
}
}
_local5.push(__a_groups[_local3]);
__a_groups.splice(_local3, 1);
}
__a_groups = _local5;
var _local4 = __defaultMCDepth;
_local2 = 0;
while (_local2 < __a_groups.length) {
_local4 = __a_groups[_local2].init(_local4);
_local4++;
_local2++;
}
newView();
}
function update(dt) {
if (__sortGroupHasChanged) {
__loop = __groupsToBeSorted.length;
while (__loop--) {
__groupsToBeSorted[__loop].requestDepthSort();
}
__groupsToBeSorted = [];
__sortGroupHasChanged = false;
}
__loop = __groupsToBeUpdated.length;
while (__loop--) {
__groupsToBeUpdated[__loop].update(dt);
}
}
function newView() {
var _local2 = __a_groups.length;
while (_local2--) {
__a_groups[_local2].reset();
}
if (mc != undefined) {
mc.removeMovieClip();
}
mc = __viewportPath.createEmptyMovieClip("viewport" + __viewportDepth, __viewportDepth);
if (__useScrollport) {
if (scrollmc != undefined) {
scrollmc.removeMovieClip();
}
scrollmc = __viewportPath.createEmptyMovieClip("scrollport" + __scrollportDepth, __scrollportDepth);
scrollmc.scrollRect = new flash.geom.Rectangle(0, 0, __dimensions.SCREEN_WIDTH + 1, __dimensions.SCREEN_HEIGHT);
}
}
function clearGroup(pGroupID) {
__o_groups[pGroupID].clear();
}
function draw(pData) {
var _local4;
if (pData.element != undefined) {
var _local3 = pData.element;
_local4 = __drawElement(_local3);
if (_local4 != undefined) {
_local3.onDraw(_local4);
// unexpected jump
}
trace("* Viewport Error: Error drawing asset " + _local3.assetID);
return(undefined);
}
if (pData.assetID == "_empty") {
return(__drawEmpty(pData.groupID, pData.depth + pData.depthInfluence));
}
return(__drawAsset(pData.assetID, pData.groupID, pData.depth + pData.depthInfluence));
}
function erase(pData) {
if (pData.element != undefined) {
__eraseAsset(pData.element.mc, pData.element.getDrawType());
pData.element.onErase();
} else {
__eraseAsset(pData.mc, pData.groupID);
}
}
function createGroup(pData) {
__a_groups.push((__o_groups[pData.id] = new smashing.rampage.viewport.ViewportGroup(pData)));
if (__a_groups[__a_groups.length - 1].doActiveSort) {
__groupsToBeUpdated.push(__a_groups[__a_groups.length - 1]);
}
}
function requestGroupDepthSort(pGroup) {
__o_groups[pGroup].requestDepthSort();
}
function requestDepthChange(pElement) {
__o_groups[pElement.getDrawType()].requestDepthChange(pElement);
}
function __drawElement(pElement) {
var _local2 = __o_groups[pElement.getDrawType()];
if (_local2 == undefined) {
trace(("* [Viewport] Error: Group " + pElement.getDrawType()) + " not found.");
return(null);
}
var _local5 = _local2.getDepth();
var _local4 = mc;
if (_local2.scrollport) {
_local4 = scrollmc;
}
if (pElement.assetID == "_empty") {
var _local6 = _local4.createEmptyMovieClip(pElement.getDrawType() + _local2.getID(), _local5);
} else {
var _local6 = _local4.attachMovie(pElement.assetID, pElement.assetID + _local2.getID(), _local5);
}
_local2.addElement(new smashing.rampage.viewport.ViewportElement(_local6, _local5, pElement));
if (_local2.doSort) {
if (!_local2.awaitingSort) {
__groupsToBeSorted.push(_local2);
_local2.awaitingSort = true;
}
__sortGroupHasChanged = true;
}
return(_local6);
}
function __drawAsset(pAsset, pGroupID, pDepth) {
var _local2 = __o_groups[pGroupID];
var _local5 = _local2.getDepth(pDepth);
var _local4 = mc;
if (_local2.scrollport) {
_local4 = scrollmc;
}
var _local3 = _local4.attachMovie(pAsset, pAsset + _local2.getID(), _local5);
_local2.addElement(new smashing.rampage.viewport.ViewportElement(_local3, _local5));
return(_local3);
}
function __drawEmpty(pGroupID, pDepth) {
var _local2 = __o_groups[pGroupID];
var _local5 = _local2.getDepth(pDepth);
var _local4 = mc;
if (_local2.scrollport) {
_local4 = scrollmc;
}
var _local3 = _local4.createEmptyMovieClip(pGroupID + _local2.getID(), _local5);
__o_groups[pGroupID].addElement(new smashing.rampage.viewport.ViewportElement(_local3, _local5));
return(_local3);
}
function __eraseAsset(pMc, pGroupID) {
__o_groups[pGroupID].removeElementByMC(pMc);
}
function toString() {
return("Viewport exists");
}
var __defaultMCDepth = 100;
}
Symbol 1259 MovieClip [__Packages.smashing.rampage.viewport.ViewportGroup] Frame 0
class smashing.rampage.viewport.ViewportGroup
{
var id, elements, index, totalSlots, scrollport, sortAxis, reverse, ascending, __sortRate, doSort, doActiveSort, __sortTimer, idCounter, awaitingSort, __min, __max, __current, __ra, __targetDepth, __loop;
function ViewportGroup (t_data) {
id = t_data.id;
elements = [];
index = t_data.index;
totalSlots = t_data.slots;
if (t_data.scrollport == undefined) {
t_data.scrollport = false;
}
scrollport = t_data.scrollport;
if (t_data.sortAxis == undefined) {
t_data.sortAxis = "";
}
sortAxis = t_data.sortAxis;
if (sortAxis == "") {
if (t_data.reverse == undefined) {
t_data.reverse = false;
}
reverse = t_data.reverse;
ascending = false;
__sortRate = 0;
doSort = false;
doActiveSort = false;
} else {
doSort = true;
reverse = false;
if (totalSlots < 10000) {
totalSlots = 10000;
}
if (t_data.ascending == undefined) {
t_data.ascending = false;
}
ascending = t_data.ascending;
if (t_data.sortRate == undefined) {
t_data.sortRate = 0;
doActiveSort = false;
} else {
doActiveSort = true;
}
__sortRate = t_data.sortRate;
__sortTimer = __sortRate;
}
idCounter = 0;
awaitingSort = false;
}
function update(dt) {
__sortTimer = __sortTimer - dt;
if (__sortTimer < 0) {
requestDepthSort();
}
}
function init(pDepth) {
__min = pDepth;
__max = pDepth + totalSlots;
reset();
return(__max);
}
function reset() {
elements = [];
if (doSort) {
__current = __max;
} else if (reverse) {
__current = __max;
} else {
__current = __min;
}
}
function clear() {
trace("[Viewport Group] Clear all MCs!");
while (elements.length > 0) {
removeElementByMC(elements[elements.length - 1].mc);
}
reset();
}
function addElement(pElement) {
elements.push(pElement);
}
function removeElementByMC(pMc) {
var _local2 = elements.length;
while (_local2--) {
if (elements[_local2].mc == pMc) {
elements[_local2].mc.removeMovieClip();
elements.splice(_local2, 1);
return(undefined);
}
}
trace("[ViewportGroup][removeElementByMC] Error: Unable to find mc " + pMc);
}
function getID() {
idCounter++;
return(("_" + id) + idCounter);
}
function requestDepthChange(pElement) {
__resortDepths();
}
function requestDepthSort() {
__resortDepths();
}
function getDepth() {
if (!doSort) {
__calculateFastDepth();
} else {
__calculateTempDepth();
}
return(__current);
}
function __calculateFastDepth() {
if (reverse) {
__current--;
if (__current < __min) {
__current = __flattenDepths();
}
} else {
__current++;
if (__current > __max) {
__current = __flattenDepths();
}
}
}
function __calculateTempDepth() {
__current--;
}
function __flattenDepths() {
trace("Flatten Depths!");
__ra = [];
while (__ra.length < elements.length) {
__ra.push(elements[__ra.length]);
}
elements = [];
__targetDepth = (reverse ? (__max) : (__min));
var _local2;
var _local3;
while (__ra.length > 0) {
_local2 = (reverse ? (__min - 1000) : (__max + 1000));
__loop = __ra.length;
while (__loop--) {
if ((reverse ? (_local2 < __ra[__loop].depth) : (_local2 > __ra[__loop].depth))) {
_local3 = __loop;
_local2 = __ra[__loop].depth;
}
}
__ra[_local3].redepth(__targetDepth);
elements.push(__ra[_local3]);
__ra.splice(_local3, 1);
if (reverse) {
__targetDepth--;
if (__targetDepth < __min) {
trace(("[ViewportGroup] Critical depth error: more Elements in group " + id) + " than slots");
}
} else {
__targetDepth++;
if (__targetDepth > __max) {
trace(("[ViewportGroup] Critical depth error: more Elements in group " + id) + " than slots");
}
}
}
return(__targetDepth);
}
function __resortDepths() {
__ra = [];
while (__ra.length < elements.length) {
__ra.push(elements[__ra.length]);
}
elements = [];
__targetDepth = __min;
var _local3;
var _local2;
while (__ra.length > 0) {
_local3 = 10000000 /* 0x989680 */;
_local2 = -1;
__loop = __ra.length;
while (__loop--) {
if (_local3 > __ra[__loop].getAxis(sortAxis)) {
_local2 = __loop;
_local3 = __ra[__loop].getAxis(sortAxis);
}
}
__ra[_local2].redepth(__targetDepth);
elements.push(__ra[_local2]);
__ra.splice(_local2, 1);
__targetDepth++;
if (__targetDepth > __max) {
trace(("[ViewportGroup] Critical depth error: more Elements in group " + id) + " than slots");
}
}
__current = __max;
__sortTimer = __sortRate;
awaitingSort = false;
}
}
Symbol 1260 MovieClip [__Packages.smashing.rampage.viewport.ViewportElement] Frame 0
class smashing.rampage.viewport.ViewportElement
{
var mc, depth, __needsDepthRecalc, isElement, element, __storedDepth;
function ViewportElement (pMc, pDepth, pElement) {
mc = pMc;
depth = pDepth;
__needsDepthRecalc = true;
if (pElement == undefined) {
isElement = false;
} else {
isElement = true;
element = pElement;
}
}
function redepth(pDepth) {
depth = pDepth;
mc.swapDepths(depth);
__needsDepthRecalc = true;
}
function getAxis(pAxis) {
if (__needsDepthRecalc) {
__storedDepth = element[pAxis] + element.depthInfluence;
__needsDepthRecalc = false;
}
return(__storedDepth);
}
}
Symbol 1261 MovieClip [__Packages.nick.avatar.fortressfight2.GameRenderable] Frame 0
class nick.avatar.fortressfight2.GameRenderable extends smashing.rampage.Renderable
{
var linkCamera, __onscreen, CUSTOMDRAW, __camera, z, baseWidth, scale, x, baseHeight, y, isDrawn, requestErase;
function GameRenderable (t_data) {
super(t_data);
}
function init(t_data) {
linkCamera(nick.avatar.fortressfight2.GameCamera.getInstance());
super.init(t_data);
}
function updateDraw() {
__onscreen = false;
if (CUSTOMDRAW) {
__onscreen = true;
} else if (z >= __camera.z) {
if (((Math.abs((x - __camera.x) * scale) / 2) < (__camera.__get__sc().x + baseWidth)) && ((Math.abs((y - __camera.y) * scale) / 2) < (__camera.__get__sc().y + baseHeight))) {
__onscreen = true;
}
}
if ((!isDrawn) && (__onscreen)) {
smashing.rampage.viewport.Viewport.getInstance().draw({element:this});
} else if (isDrawn && (!__onscreen)) {
requestErase();
}
}
}
Symbol 1262 MovieClip [__Packages.nick.avatar.fortressfight2.ents.Entity] Frame 0
class nick.avatar.fortressfight2.ents.Entity extends nick.avatar.fortressfight2.GameRenderable
{
var doRemove, velocity, __animation, kill, requestErase, isAlive, hdWidth, hdReg, x, hdHeight, y, render, mc, __isAnimating, DRAWTYPE, specialDepth;
function Entity (pData) {
super(pData);
}
function init(pData) {
doRemove = false;
super.init(pData);
velocity = new smashing.Point3D(0, 0, 0);
__animation = __IDLE_ANIMATION;
}
function startDie() {
kill();
animate(__DEATH_ANIMATION);
if (__USES_VELOCITY) {
velocity.x = (velocity.y = 0);
}
}
function endDie() {
requestErase();
}
function updateDraw() {
if (doRemove) {
return(undefined);
}
super.updateDraw();
}
function runHD(t_target, dt) {
if (!(isAlive && (t_target.isAlive))) {
return(false);
}
if (Math.abs((x + hdReg.x) - (t_target.x + t_target.hdReg.x)) < (hdWidth + t_target.hdWidth)) {
if (Math.abs((y + hdReg.y) - (t_target.y + t_target.hdReg.y)) < (hdHeight + t_target.hdHeight)) {
return(true);
}
}
return(false);
}
function hitReact(t_source) {
}
function onDraw(t_newmc) {
super.onDraw(t_newmc);
animateLoop(__IDLE_ANIMATION);
}
function update(dt) {
updateAnim();
}
function updateAndRender(dt) {
updateAnim();
render(dt);
}
function animate(frame) {
if (frame != undefined) {
__animation = frame;
}
mc.gotoAndStop(__animation);
if (__animation == __IDLE_ANIMATION) {
__isAnimating = false;
} else {
__isAnimating = true;
}
}
function animateLoop(frame) {
if (frame != undefined) {
__animation = frame;
}
mc.gotoAndStop(__animation);
__isAnimating = false;
}
function updateAnim() {
if (__isAnimating) {
if (mc.anim._currentFrame == mc.anim._totalFrames) {
if (__animation == __DEATH_ANIMATION) {
endDie();
} else {
animateLoop(__IDLE_ANIMATION);
}
}
}
}
function freezeAnimation() {
mc.anim.stop();
}
function unfreezeAnimation() {
if (__isAnimating) {
mc.anim.play();
} else {
animate();
}
}
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, dt, 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 * dt) * xMult);
}
if ((Math.abs(velocity.y) < maxVelocity) || ((velocity.y * t_vector.y) < 0)) {
velocity.y = velocity.y + ((t_vector.y * dt) * yMult);
}
if ((Math.abs(velocity.z) < maxVelocity) || ((velocity.z * t_vector.z) < 0)) {
velocity.z = velocity.z + ((t_vector.z * dt) * zMult);
}
}
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 getDrawType() {
return(((HAS_SPECIAL_DEPTH == true) ? ((DRAWTYPE + "_") + specialDepth) : (DRAWTYPE)));
}
var HAS_SPECIAL_DEPTH = false;
var __3D_SCALE = true;
var __IDLE_ANIMATION = "idle";
var __DEATH_ANIMATION = "die";
var __MAX_VELOCITY = 300;
var __USES_VELOCITY = false;
}
Symbol 1263 MovieClip [__Packages.nick.avatar.fortressfight2.ents.Structure] Frame 0
class nick.avatar.fortressfight2.ents.Structure extends nick.avatar.fortressfight2.ents.Entity
{
var __state, __ownerPlayer, isLeft, kingdom, updateDraw, isDrawn, threedScale, __camera, z, scale, startScale, mc, flipH, x, y, hdWidth, hdReg, __i, flip;
function Structure (pData) {
super(pData);
__state = nick.avatar.fortressfight2.GameState.getInstance();
}
function init(pData) {
super.init(pData);
__ownerPlayer = pData.owner;
isLeft = pData.left;
kingdom = pData.kingdom;
}
function updateAndRender(dt) {
render(dt);
}
function render(dt) {
updateDraw();
if (!isDrawn) {
return(undefined);
}
if (threedScale) {
if (z < __camera.z) {
return(undefined);
}
var _local2 = __camera.fl / (z - __camera.z);
if (scale != _local2) {
scale = _local2;
mc._xscale = (mc._yscale = 100 * (1 + (scale - startScale)));
if (flipH) {
mc._xscale = mc._xscale * -1;
}
}
}
mc._x = ((x - __camera.x) * scale) + __camera.__get__sc().x;
mc._y = (y - __camera.y) + __camera.__get__sc().y;
}
function runLineCollision(pLine) {
return({result:false, loc:""});
}
function runBoxCollision(pProjectile) {
if (Math.abs((x + hdReg.x) - (pProjectile.x + pProjectile.hdReg.x)) < (hdWidth + pProjectile.hdWidth)) {
return(true);
}
return(false);
}
function testLineAgainstBox(pLine, pBox) {
__i = pBox.length;
while (__i--) {
if (pBox[__i].getSegmentIntersection(pLine) != null) {
return(true);
}
}
return(false);
}
function onDraw(pNewMC) {
super.onDraw(pNewMC);
if (!isLeft) {
flip();
}
}
function difficultyAdjust() {
var _local2;
if (((__state.mode == 1) && (__state.turn == 2)) && (__state.levelNum > __maxLevel)) {
_local2 = __state.levelNum - __maxLevel;
} else {
_local2 = 0;
}
trace("difficultyAdjust = " + _local2);
return(_local2);
}
var TYPE = "keep";
var DRAWTYPE = "structures";
var __DEF_ASSET = "";
var __DEF_WIDTH = 100;
var __DEF_HEIGHT = 100;
var __USE_ACTUAL_DIMENSIONS = false;
var __DEF_HD_WIDTH = 40;
var __DEF_HD_HEIGHT = 60;
var __USE_DIMENSIONS_AS_HD = false;
var __maxLevel = 6;
}
Symbol 1264 MovieClip [__Packages.smashing.rampage.Line] Frame 0
class smashing.rampage.Line
{
var p0, p1, vector, center, faceNormal, len, parametricDenomX, parametricDenomY, slope, bslope, yint, byint, det_inv, result, xseg, yseg;
function Line (t_p0, t_p1) {
p0 = t_p0;
p1 = t_p1;
vector = new smashing.Point3D(p1.x - p0.x, p1.y - p0.y, p1.z - p0.z);
center = new smashing.Point3D(p0.x + (vector.x / 2), p0.y + (vector.y / 2), p0.z + (vector.z / 2));
faceNormal = vector.pseudoCross().normalize();
len = Math.sqrt(((vector.x * vector.x) + (vector.y * vector.y)) + (vector.z * vector.z));
parametricDenomX = p1.x - p0.x;
parametricDenomY = p1.y - p0.y;
slope = vector.y / vector.x;
if (vector.x == 0) {
slope = 100000 /* 0x0186A0 */;
}
}
function setLength(t_length) {
var _local2 = t_length / len;
vector.multiplyMe(_local2);
p1 = new smashing.Point3D(p0.x + vector.x, p0.y + vector.y, p0.z + vector.z);
center = new smashing.Point3D(p0.x + (vector.x / 2), p0.y + (vector.y / 2), p0.z + (vector.z / 2));
len = t_length;
parametricDenomX = p1.x - p0.x;
parametricDenomY = p1.y - p0.y;
}
function getFaceNormal() {
return(faceNormal);
}
function getIntersection(t_line) {
bslope = t_line.slope;
yint = p0.y - (slope * p0.x);
byint = t_line.p0.y - (bslope * t_line.p0.x);
det_inv = 1 / ((slope * -1) - (bslope * -1));
return(new smashing.Point3D(((-1 * byint) - (-1 * yint)) * det_inv, ((bslope * yint) - (slope * byint)) * det_inv, 0));
}
function getSegmentIntersection(t_line) {
bslope = t_line.slope;
yint = p0.y - (slope * p0.x);
byint = t_line.p0.y - (bslope * t_line.p0.x);
det_inv = 1 / ((slope * -1) - (bslope * -1));
result = new smashing.Point3D(((-1 * byint) - (-1 * yint)) * det_inv, ((bslope * yint) - (slope * byint)) * det_inv, 0);
if (testPointSegmentOverlap(result) && (t_line.testPointSegmentOverlap(result))) {
return(result);
}
return(null);
}
function testPointSegmentOverlap(testPoint) {
if (parametricDenomX == 0) {
xseg = 0;
} else {
xseg = (testPoint.x - p0.x) / parametricDenomX;
}
if (parametricDenomY == 0) {
yseg = 0;
} else {
yseg = (testPoint.y - p0.y) / parametricDenomY;
}
if ((((xseg >= 0) && (xseg <= 1)) && (yseg >= 0)) && (yseg <= 1)) {
return(true);
}
return(false);
}
function toString() {
return((((((("Line " + p0.x) + ", ") + p0.y) + " ~> ") + p1.x) + ", ") + p1.y);
}
}
Symbol 1265 MovieClip [__Packages.nick.avatar.fortressfight2.ents.KeepBase] Frame 0
class nick.avatar.fortressfight2.ents.KeepBase extends nick.avatar.fortressfight2.ents.Structure
{
var wallHealth, towerHealth, heartHealth, wallBox, towerBox, heartBox, __state, testLineAgainstBox, difficultyAdjust, mc, __ownerPlayer, startScale, scale, __camera, startZ, x, y, isLeft;
function KeepBase (pData) {
super(pData);
}
function init(pData) {
super.init(pData);
wallHealth = (towerHealth = __APPENDAGE_HEALTH);
heartHealth = __HEART_HEALTH;
wallBox = [];
generateWallBox();
towerBox = [];
generateTowerBox();
heartBox = [];
generateHeartBox();
__state = nick.avatar.fortressfight2.GameState.getInstance();
}
function healToFull() {
wallHealth = (towerHealth = __APPENDAGE_HEALTH);
heartHealth = __HEART_HEALTH;
}
function runLineCollision(pLine) {
if (wallHealth > 0) {
if (testLineAgainstBox(pLine, wallBox)) {
return({result:true, loc:"wall"});
}
}
if (towerHealth > 0) {
if (testLineAgainstBox(pLine, towerBox)) {
return({result:true, loc:"tower"});
}
}
if (testLineAgainstBox(pLine, heartBox)) {
return({result:true, loc:"heart"});
}
return({result:false, loc:""});
}
function hitReact(pLoc, pProjectile) {
var _local2 = pProjectile.getDamage(this);
_local2 = _local2 + difficultyAdjust();
if (pLoc == "wall") {
wallHealth = wallHealth - _local2;
onSectionDamaged(mc.wall_mc, wallHealth / __APPENDAGE_HEALTH);
} else if (pLoc == "tower") {
towerHealth = towerHealth - _local2;
onSectionDamaged(mc.tower_mc, towerHealth / __APPENDAGE_HEALTH);
} else {
heartHealth = heartHealth - _local2;
if (towerHealth <= 0) {
onSectionDamaged(mc.heart_mc, heartHealth / __HEART_HEALTH);
}
}
__state.hasChanged = true;
}
function onHeal(pAmount) {
if (__state.battlegroundKingdom == "water") {
pAmount = pAmount + 1;
}
if (heartHealth < __HEART_HEALTH) {
heartHealth = heartHealth + pAmount;
if (heartHealth > __HEART_HEALTH) {
heartHealth = __HEART_HEALTH;
}
} else if (towerHealth < __APPENDAGE_HEALTH) {
towerHealth = towerHealth + pAmount;
if (towerHealth > __APPENDAGE_HEALTH) {
towerHealth = __APPENDAGE_HEALTH;
}
} else if (wallHealth < __APPENDAGE_HEALTH) {
wallHealth = wallHealth + pAmount;
if (wallHealth > __APPENDAGE_HEALTH) {
wallHealth = __APPENDAGE_HEALTH;
}
}
__state.hasChanged = true;
renderAllSections();
}
function onDamage(pAmount) {
if (wallHealth > 0) {
wallHealth = wallHealth - pAmount;
if (wallHealth < 0) {
wallHealth = 0;
}
onSectionDamaged(mc.wall_mc, wallHealth / __APPENDAGE_HEALTH);
} else if (towerHealth > 0) {
towerHealth = towerHealth - pAmount;
if (towerHealth < 0) {
towerHealth = 0;
}
onSectionDamaged(mc.tower_mc, towerHealth / __APPENDAGE_HEALTH);
} else if (heartHealth > 0) {
heartHealth = heartHealth - pAmount;
if (heartHealth < 1) {
heartHealth = 1;
}
if (towerHealth <= 0) {
onSectionDamaged(mc.heart_mc, heartHealth / __HEART_HEALTH);
}
}
smashing.rampage.Messenger.sendMessage("world", "onKeepHit", {player:__ownerPlayer, damage:pAmount});
__state.hasChanged = true;
}
function onVerticalDamage(pAmount) {
if (towerHealth > 0) {
towerHealth = towerHealth - pAmount;
if (towerHealth < 0) {
towerHealth = 0;
}
onSectionDamaged(mc.tower_mc, towerHealth / __APPENDAGE_HEALTH);
} else if (heartHealth > 0) {
heartHealth = heartHealth - pAmount;
if (heartHealth < 1) {
heartHealth = 1;
}
if (towerHealth <= 0) {
onSectionDamaged(mc.heart_mc, heartHealth / __HEART_HEALTH);
}
}
smashing.rampage.Messenger.sendMessage("world", "onKeepHit", {player:__ownerPlayer, damage:pAmount});
__state.hasChanged = true;
}
function onHorizontalDamage(pAmount) {
if (wallHealth > 0) {
wallHealth = wallHealth - pAmount;
if (wallHealth < 0) {
wallHealth = 0;
}
onSectionDamaged(mc.wall_mc, wallHealth / __APPENDAGE_HEALTH);
} else if (heartHealth > 0) {
heartHealth = heartHealth - pAmount;
if (heartHealth < 1) {
heartHealth = 1;
}
if (towerHealth <= 0) {
onSectionDamaged(mc.heart_mc, heartHealth / __HEART_HEALTH);
}
}
smashing.rampage.Messenger.sendMessage("world", "onKeepHit", {player:__ownerPlayer, damage:pAmount});
__state.hasChanged = true;
}
function onDraw(pNewMC) {
super.onDraw(pNewMC);
renderAllSections();
}
function renderAllSections() {
renderSection(mc.tower_mc, towerHealth / __APPENDAGE_HEALTH);
renderSection(mc.wall_mc, wallHealth / __APPENDAGE_HEALTH);
if (towerHealth <= 0) {
renderSection(mc.heart_mc, heartHealth / __HEART_HEALTH);
} else {
renderSection(mc.heart_mc, 1);
}
}
function getHealthAsPercent() {
return(((towerHealth + heartHealth) + wallHealth) / ((__APPENDAGE_HEALTH * 2) + __HEART_HEALTH));
}
function renderSection(pMc, pPercent) {
var _local1;
if (pPercent == 1) {
_local1 = 0;
} else {
_local1 = 4 - Math.ceil(pPercent * 3);
}
if ((_local1 > 0) && (_local1 < 4)) {
pMc.gotoAndStop(_local1 + "dam");
} else if (_local1 == 0) {
pMc.gotoAndStop("intact");
} else {
pMc.gotoAndStop("dead");
}
}
function onSectionDamaged(pMc, pPercent) {
var _local1;
if (pPercent < 0) {
pPercent = 0;
}
if (pPercent == 1) {
_local1 = 0;
} else {
_local1 = 4 - Math.ceil(pPercent * 3);
}
var _local4 = [6, 19, 32, 45, 60];
trace(((((("DAMAGE : " + pMc._name) + "( ") + pPercent) + " ~= ") + _local1) + " ) ----------");
if (_local1 > 0) {
trace((("Run collapse to stop label : " + _local1) + " Health : ") + pPercent);
trace((("Frame " + pMc._currentframe) + " ~~ ") + (_local4[_local1 - 1] - 1));
if (pMc._currentframe < _local4[_local1 - 1]) {
pMc.stopLabel = _local1;
pMc.play();
}
}
}
function isDestructionComplete() {
return(mc.heart_mc._currentFrame == mc.heart_mc._totalFrames);
}
function initScale() {
startScale = (scale = __camera.fl / (startZ - __camera.z));
}
function generateWallBox() {
wallBox.push(new smashing.rampage.Line(new smashing.Point3D(x + (__HEART_RIGHT * getFlipMod()), y + __HEART_TOP, 0), new smashing.Point3D(x + (__WALL_RIGHT * getFlipMod()), y + __HEART_TOP, 0)));
wallBox.push(new smashing.rampage.Line(new smashing.Point3D(x + (__WALL_RIGHT * getFlipMod()), y + __HEART_TOP, 0), new smashing.Point3D(x + (__WALL_RIGHT * getFlipMod()), y, 0)));
}
function generateTowerBox() {
towerBox.push(new smashing.rampage.Line(new smashing.Point3D(x + (__HEART_LEFT * getFlipMod()), y + __TOWER_TOP, 0), new smashing.Point3D(x + (__HEART_RIGHT * getFlipMod()), y + __TOWER_TOP, 0)));
towerBox.push(new smashing.rampage.Line(new smashing.Point3D(x + (__HEART_RIGHT * getFlipMod()), y + __TOWER_TOP, 0), new smashing.Point3D(x + (__HEART_RIGHT * getFlipMod()), y + __HEART_TOP, 0)));
towerBox.push(new smashing.rampage.Line(new smashing.Point3D(x + (__HEART_LEFT * getFlipMod()), y + __HEART_TOP, 0), new smashing.Point3D(x + (__HEART_LEFT * getFlipMod()), y + __TOWER_TOP, 0)));
}
function generateHeartBox() {
heartBox.push(new smashing.rampage.Line(new smashing.Point3D(x + (__HEART_LEFT * getFlipMod()), y + __HEART_TOP, 0), new smashing.Point3D(x + (__HEART_RIGHT * getFlipMod()), y + __HEART_TOP, 0)));
heartBox.push(new smashing.rampage.Line(new smashing.Point3D(x + (__HEART_RIGHT * getFlipMod()), y + __HEART_TOP, 0), new smashing.Point3D(x + (__HEART_RIGHT * getFlipMod()), y, 0)));
heartBox.push(new smashing.rampage.Line(new smashing.Point3D(x + (__HEART_LEFT * getFlipMod()), y, 0), new smashing.Point3D(x + (__HEART_LEFT * getFlipMod()), y + __HEART_TOP, 0)));
}
function getFlipMod() {
if (isLeft) {
return(1);
}
return(-1);
}
var TYPE = "keep";
var __DEF_WIDTH = 400;
var __DEF_HEIGHT = 300;
var __USE_ACTUAL_DIMENSIONS = false;
var __APPENDAGE_HEALTH = 10;
var __HEART_HEALTH = 14;
var __WALL_RIGHT = 10;
var __HEART_RIGHT = 5;
var __HEART_TOP = -10;
var __TOWER_TOP = -20;
var __HEART_LEFT = -10;
}
Symbol 1266 MovieClip [__Packages.nick.avatar.fortressfight2.ents.Tower] Frame 0
class nick.avatar.fortressfight2.ents.Tower extends nick.avatar.fortressfight2.ents.Structure
{
var assetID, health, hitBox, testLineAgainstBox, x, y, difficultyAdjust, mc, hdReg;
function Tower (pData) {
super(pData);
}
function init(pData) {
super.init(pData);
assetID = pData.kingdom + "_tower";
health = __DEF_HEALTH;
hitBox = [];
generateHitBox();
}
function healToFull() {
health = __DEF_HEALTH;
}
function runLineCollision(pLine) {
if (testLineAgainstBox(pLine, hitBox)) {
return({result:true, loc:"tower"});
}
return({result:false, loc:""});
}
function generateHitBox() {
hitBox.push(new smashing.rampage.Line(new smashing.Point3D(x + __LEFT, y + __TOP, 0), new smashing.Point3D(x + __RIGHT, y + __TOP, 0)));
hitBox.push(new smashing.rampage.Line(new smashing.Point3D(x + __RIGHT, y + __TOP, 0), new smashing.Point3D(x + __RIGHT, y, 0)));
hitBox.push(new smashing.rampage.Line(new smashing.Point3D(x + __LEFT, y, 0), new smashing.Point3D(x + __LEFT, y + __TOP, 0)));
}
function hitReact(pLoc, pProjectile) {
health = health - (pProjectile.getDamage() + difficultyAdjust());
if (health <= 0) {
mc.gotoAndPlay("hit");
}
}
function onDraw(pNewMC) {
super.onDraw(pNewMC);
if (health <= 0) {
mc.gotoAndStop("dead");
}
}
function setHDRegistration() {
hdReg = {};
hdReg.x = 0;
hdReg.y = -75;
}
var TYPE = "tower";
var __DEF_WIDTH = 100;
var __DEF_HEIGHT = 200;
var __USE_ACTUAL_DIMENSIONS = false;
var __DEF_HD_WIDTH = 45;
var __DEF_HD_HEIGHT = 150;
var __USE_DIMENSIONS_AS_HD = false;
var __DEF_HEALTH = 3;
var __RIGHT = 34;
var __TOP = -145;
var __LEFT = -28;
}
Symbol 1267 MovieClip [__Packages.nick.avatar.fortressfight2.ents.projectiles.Projectile] Frame 0
class nick.avatar.fortressfight2.ents.projectiles.Projectile extends nick.avatar.fortressfight2.ents.Entity
{
var isLeft, __isCharged, __isIgnited, __hasArmory, __bgBonus, __angle, __magnitude, __gravity, __groundY, __rotation, doBoxHD, velocity, magnitudeToVector, isDrawn, mc, flip, doRemove, isAlive, requestErase, moveLine, x, y, startScale, scale, __camera, flipH;
function Projectile (pData) {
super(pData);
}
function init(pData) {
super.init(pData);
isLeft = pData.left;
if (pData.charged == true) {
__isCharged = true;
} else {
__isCharged = false;
}
if (pData.ignite == true) {
__isIgnited = true;
} else {
__isIgnited = false;
}
if (pData.armory == true) {
__hasArmory = true;
} else {
__hasArmory = false;
}
if (nick.avatar.fortressfight2.GameState.getInstance().battlegroundKingdom == "fire") {
__bgBonus = 1;
} else {
__bgBonus = 0;
}
__angle = pData.angle;
__magnitude = pData.mag;
__gravity = nick.avatar.fortressfight2.GameState.getInstance().GRAVITY_Y;
__groundY = nick.avatar.fortressfight2.GameState.getInstance().GROUND_Y - 50;
__rotation = 0;
doBoxHD = false;
velocity = magnitudeToVector(__magnitude, __angle);
}
function onCharge() {
__isCharged = true;
if (isDrawn) {
mc.charge_mc.gotoAndStop("on");
}
}
function onDraw(pNewMC) {
super.onDraw(pNewMC);
if (!isLeft) {
flip();
}
if (__isCharged) {
mc.charge_mc.gotoAndStop("on");
}
if (__isIgnited) {
mc.ignite_mc.gotoAndStop("on");
}
mc.gotoAndStop("fly");
}
function updateAndRender(dt) {
update(dt);
if (!doRemove) {
render(dt);
}
}
function update(dt) {
if (!isAlive) {
if (mc.anim._currentFrame == mc.anim._totalFrames) {
requestErase();
doRemove = true;
}
return(undefined);
}
velocity.y = velocity.y + (__gravity * dt);
moveLine = new smashing.rampage.Line(new smashing.Point3D(x, y, 0), new smashing.Point3D(x + (velocity.x * dt), y + (velocity.y * dt), 0));
if (moveLine.p1.y > __groundY) {
moveLine.p1.y = __groundY;
}
x = moveLine.p1.x;
y = moveLine.p1.y;
}
function render(dt) {
if (isAlive && (y == __groundY)) {
onHitGround();
}
super.render(dt);
}
function getDamage(pKeep) {
trace("Get damage : " + ((((__DAMAGE + (__isCharged ? 1 : 0)) + (__isIgnited ? 1 : 0)) + (__hasArmory ? 1 : 0)) + __bgBonus));
return((((__DAMAGE + (__isCharged ? 1 : 0)) + (__isIgnited ? 1 : 0)) + (__hasArmory ? 1 : 0)) + __bgBonus);
}
function getEffect() {
return("");
}
function initScale() {
startScale = (scale = __camera.fl / 1000);
}
function onUniversalImpact() {
velocity.x = (velocity.y = 0);
if (__CORRECT_ON_HIT) {
__rotation = 0;
mc._rotation = __rotation;
}
}
function onHitGround() {
onUniversalImpact();
mc.gotoAndStop("impact");
mc.charge_mc.gotoAndStop("off");
mc.ignite_mc.gotoAndStop("off");
isAlive = false;
y = __groundY;
}
function onHitKeep() {
onUniversalImpact();
smashing.rampage.Messenger.sendMessage("world", "generateShrapnel", {x:x, y:y});
mc.gotoAndStop("impact");
mc.ignite_mc.gotoAndStop("off");
mc.charge_mc.gotoAndStop("off");
isAlive = false;
if (y > __groundY) {
y = __groundY;
}
}
function onHitStructure() {
onUniversalImpact();
smashing.rampage.Messenger.sendMessage("world", "generateShrapnel", {x:x, y:y});
mc.gotoAndStop("impact");
mc.ignite_mc.gotoAndStop("off");
mc.charge_mc.gotoAndStop("off");
isAlive = false;
if (y > __groundY) {
y = __groundY;
}
}
function spin(pRate, dt) {
if (!isAlive) {
return(undefined);
}
if (velocity.x > 0) {
pRate = pRate * -1;
}
__rotation = __rotation + (pRate * dt);
mc._rotation = __rotation;
}
function orient() {
if (!isAlive) {
return(undefined);
}
__rotation = Math.atan2(velocity.y, velocity.x) * 57.2957795130823;
if (__rotation < 360) {
__rotation = __rotation + 360;
}
if (flipH) {
mc._rotation = __rotation + 180;
} else {
mc._rotation = __rotation;
}
}
function getIsDangerous() {
return(isAlive);
}
function toString() {
return((((("Projectile : " + x) + " , ") + y) + " ~~ ") + velocity);
}
var TYPE = "projectile";
var DRAWTYPE = "projectile";
var __DEF_ASSET = "";
var __DEF_WIDTH = 40;
var __DEF_HEIGHT = 60;
var __USE_ACTUAL_DIMENSIONS = false;
var __DEF_HD_WIDTH = 50;
var __DEF_HD_HEIGHT = 50;
var __USE_DIMENSIONS_AS_HD = false;
var __CORRECT_ON_HIT = false;
var CUSTOMDRAW = true;
var DESTROYS_PICKUPS = false;
var __DAMAGE = 1;
}
Symbol 1268 MovieClip [__Packages.nick.avatar.fortressfight2.ents.Armory] Frame 0
class nick.avatar.fortressfight2.ents.Armory extends nick.avatar.fortressfight2.ents.Structure
{
var assetID, health, hitBox, testLineAgainstBox, x, y, difficultyAdjust, mc, hdReg;
function Armory (pData) {
super(pData);
}
function init(pData) {
super.init(pData);
assetID = pData.kingdom + "_armory";
health = __DEF_HEALTH;
hitBox = [];
generateHitBox();
}
function healToFull() {
health = __DEF_HEALTH;
}
function runLineCollision(pLine) {
if (testLineAgainstBox(pLine, hitBox)) {
return({result:true, loc:"armory"});
}
return({result:false, loc:""});
}
function generateHitBox() {
hitBox.push(new smashing.rampage.Line(new smashing.Point3D(x + __LEFT, y + __TOP, 0), new smashing.Point3D(x + __RIGHT, y + __TOP, 0)));
hitBox.push(new smashing.rampage.Line(new smashing.Point3D(x + __RIGHT, y + __TOP, 0), new smashing.Point3D(x + __RIGHT, y, 0)));
hitBox.push(new smashing.rampage.Line(new smashing.Point3D(x + __LEFT, y, 0), new smashing.Point3D(x + __LEFT, y + __TOP, 0)));
}
function hitReact(pLoc, pProjectile) {
health = health - (pProjectile.getDamage() + difficultyAdjust());
if (health <= 0) {
mc.gotoAndPlay("hit");
}
}
function onDraw(pNewMC) {
super.onDraw(pNewMC);
if (health <= 0) {
mc.gotoAndStop("dead");
}
}
function setHDRegistration() {
hdReg = {};
hdReg.x = 0;
hdReg.y = -34;
}
var TYPE = "armory";
var __DEF_WIDTH = 200;
var __DEF_HEIGHT = 100;
var __USE_ACTUAL_DIMENSIONS = false;
var __DEF_HD_WIDTH = 110;
var __DEF_HD_HEIGHT = 74;
var __USE_DIMENSIONS_AS_HD = false;
var __DEF_HEALTH = 3;
var __RIGHT = 56;
var __TOP = -51;
var __LEFT = -56;
}
Symbol 1269 MovieClip [__Packages.nick.avatar.fortressfight2.ents.Catapult] Frame 0
class nick.avatar.fortressfight2.ents.Catapult extends nick.avatar.fortressfight2.ents.Structure
{
var assetID, __weaponID, kingdom, y, isLeft, x, mc, __isIgnited, isDrawn;
function Catapult (pData) {
super(pData);
}
function init(pData) {
super.init(pData);
assetID = pData.kingdom + "temple_catapult";
__weaponID = "";
}
function aim(pAngleRatio) {
}
function getFirePoint() {
var _local2;
if (kingdom == "earth") {
_local2 = __EARTH_SPAWN_OFFSET;
} else if (kingdom == "water") {
_local2 = __WATER_SPAWN_OFFSET;
} else {
_local2 = __FIRE_SPAWN_OFFSET;
}
return({x:x + (_local2.x * (isLeft ? 1 : -1)), y:y + _local2.y});
}
function fire() {
mc.gotoAndPlay("launch");
if (__isIgnited) {
mc.ignite_mc.gotoAndStop("off");
__isIgnited = false;
}
}
function testIsFireComplete() {
if (mc._currentFrame >= __FIRE_FRAME) {
__weaponID = "";
return(true);
}
return(false);
}
function setWeapon(pWeapon) {
__weaponID = pWeapon;
trace("[Catapult] Set Weapon : " + __weaponID);
mc.gotoAndStop("launch");
mc.projectile_mc.gotoAndStop(__weaponID);
}
function render(dt) {
super.render(dt);
if (isDrawn) {
mc._y = mc._y + 30;
}
}
function onDraw(pNewMC) {
super.onDraw(pNewMC);
if (__weaponID == "") {
mc.projectile_mc.gotoAndStop("hidden");
} else {
mc.projectile_mc.gotoAndStop(__weaponID);
}
mc.gotoAndStop("launch");
if (__isIgnited) {
mc.ignite_mc.gotoAndStop("on");
}
}
function applyIgnite() {
__isIgnited = true;
if (isDrawn) {
mc.ignite_mc.gotoAndStop("on");
}
}
var TYPE = "catapult";
var DRAWTYPE = "catapult";
var __DEF_ASSET = "";
var __DEF_WIDTH = 300;
var __DEF_HEIGHT = 200;
var __USE_ACTUAL_DIMENSIONS = false;
var __EARTH_SPAWN_OFFSET = {x:134, y:-207};
var __FIRE_SPAWN_OFFSET = {x:129, y:-204};
var __WATER_SPAWN_OFFSET = {x:114, y:-214};
var __FIRE_FRAME = 108;
}
Symbol 1270 MovieClip [__Packages.nick.avatar.fortressfight2.Library] Frame 0
class nick.avatar.fortressfight2.Library
{
function Library () {
}
static function createProjectile(pType, pData) {
switch (pType) {
case "boulder" :
return(new nick.avatar.fortressfight2.ents.projectiles.Boulder(pData));
case "sparkrock" :
return(new nick.avatar.fortressfight2.ents.projectiles.EarthSparkRock(pData));
case "sparkchunk" :
return(new nick.avatar.fortressfight2.ents.projectiles.EarthSparkChunk(pData));
case "lance" :
return(new nick.avatar.fortressfight2.ents.projectiles.EarthLance(pData));
case "fist" :
return(new nick.avatar.fortressfight2.ents.projectiles.EarthFist(pData));
case "lavaball" :
return(new nick.avatar.fortressfight2.ents.projectiles.FireLavaBall(pData));
case "lavachunk" :
return(new nick.avatar.fortressfight2.ents.projectiles.FireLavaChunk(pData));
case "flare" :
return(new nick.avatar.fortressfight2.ents.projectiles.FireFlare(pData));
case "magma" :
return(new nick.avatar.fortressfight2.ents.projectiles.FireMagma(pData));
case "orb" :
return(new nick.avatar.fortressfight2.ents.projectiles.WaterOrb(pData));
case "spikes" :
return(new nick.avatar.fortressfight2.ents.projectiles.WaterSpike(pData));
case "tidal" :
return(new nick.avatar.fortressfight2.ents.projectiles.WaterTidal(pData));
}
}
static function createPower(pType, pData) {
switch (pType) {
case "storm" :
return(new nick.avatar.fortressfight2.ents.powers.Storm(pData));
case "pool" :
return(new nick.avatar.fortressfight2.ents.powers.HealingPool(pData));
case "frost" :
return(new nick.avatar.fortressfight2.ents.powers.Frost(pData));
case "ignite" :
return(new nick.avatar.fortressfight2.ents.powers.Ignite(pData));
case "sunbird" :
return(new nick.avatar.fortressfight2.ents.powers.SunBird(pData));
case "meteor" :
return(new nick.avatar.fortressfight2.ents.powers.Meteor(pData));
case "skystone" :
return(new nick.avatar.fortressfight2.ents.powers.SkyStone(pData));
case "vines" :
return(new nick.avatar.fortressfight2.ents.powers.WhiteDragonVines(pData));
case "wave" :
return(new nick.avatar.fortressfight2.ents.powers.EarthWave(pData));
case "burn" :
return(new nick.avatar.fortressfight2.ents.powers.Burn(pData));
}
}
static function createBattleground(pType) {
trace("Create Battleground : " + pType);
switch (pType) {
case "earth" :
return(new nick.avatar.fortressfight2.battlegrounds.BattlegroundEarth());
case "fire" :
return(new nick.avatar.fortressfight2.battlegrounds.BattlegroundFire());
case "air" :
return(new nick.avatar.fortressfight2.battlegrounds.BattlegroundAir());
case "water" :
return(new nick.avatar.fortressfight2.battlegrounds.BattlegroundWater());
}
}
static function createPickup(pType, pData) {
switch (pType) {
case "health" :
return(new nick.avatar.fortressfight2.ents.pickups.PickupHealth(pData));
case "ammo" :
return(new nick.avatar.fortressfight2.ents.pickups.PickupAmmo(pData));
case "damage" :
return(new nick.avatar.fortressfight2.ents.pickups.PickupDamage(pData));
case "gold" :
return(new nick.avatar.fortressfight2.ents.pickups.PickupGold(pData));
}
}
static function createShrapnel(pData) {
return(new nick.avatar.fortressfight2.ents.Shrapnel(pData));
}
static function createPlayer(pData) {
return(new nick.avatar.fortressfight2.ents.Player(pData));
}
static function createScroller(pData) {
return(new nick.avatar.fortressfight2.ents.Scroller(pData));
}
static function createTower(pData) {
return(new nick.avatar.fortressfight2.ents.Tower(pData));
}
static function createArmory(pData) {
return(new nick.avatar.fortressfight2.ents.Armory(pData));
}
static function createCatapult(pData) {
return(new nick.avatar.fortressfight2.ents.Catapult(pData));
}
static function createKeep(pType, pData) {
switch (pType) {
case "earth" :
return(new nick.avatar.fortressfight2.ents.KeepEarth(pData));
case "fire" :
return(new nick.avatar.fortressfight2.ents.KeepFire(pData));
case "water" :
return(new nick.avatar.fortressfight2.ents.KeepWater(pData));
}
}
static function createArrow(pData) {
return(new nick.avatar.fortressfight2.ents.Arrow(pData));
}
static function translatePowerNum(pKingdom, pNum) {
if (pKingdom == "water") {
switch (pNum) {
case 1 :
return("storm");
case 2 :
return("pool");
case 3 :
return("frost");
}
}
if (pKingdom == "fire") {
switch (pNum) {
case 1 :
return("ignite");
case 2 :
return("sunbird");
case 3 :
return("meteor");
}
}
if (pKingdom == "earth") {
switch (pNum) {
case 1 :
return("skystone");
case 2 :
return("wave");
case 3 :
return("vines");
}
}
return(undefined);
}
static function translateWeaponNum(pKingdom, pNum) {
if (pNum == 0) {
return("boulder");
}
if (pKingdom == "earth") {
switch (pNum) {
case 1 :
return("sparkrock");
case 2 :
return("lance");
case 3 :
return("fist");
}
}
if (pKingdom == "fire") {
switch (pNum) {
case 1 :
return("lavaball");
case 2 :
return("flare");
case 3 :
return("magma");
}
}
if (pKingdom == "water") {
switch (pNum) {
case 1 :
return("orb");
case 2 :
return("spikes");
case 3 :
return("tidal");
}
}
return(undefined);
}
static function createRandomPickups(pNum, pMode) {
var _local3 = [];
var _local2;
if (pMode == 1) {
_local2 = ["gold", "ammo", "gold", "damage", "health", "gold", "damage", "health", "gold"];
} else {
_local2 = ["ammo", "damage", "health", "damage", "health"];
}
var _local1;
while (pNum--) {
_local1 = Math.floor(Math.random() * _local2.length);
if (_local1 == _local2.length) {
_local1--;
}
_local3.push(createPickup(_local2[_local1], {}));
_local2.splice(_local1, 1);
}
return(_local3);
}
static function retrievePowerCost(pKingdom, pNum) {
if (pKingdom == "water") {
switch (pNum) {
case 1 :
return(70);
case 2 :
return(70);
case 3 :
return(30);
}
}
if (pKingdom == "fire") {
switch (pNum) {
case 1 :
return(30);
case 2 :
return(30);
case 3 :
return(60);
}
}
if (pKingdom == "earth") {
switch (pNum) {
case 1 :
return(30);
case 2 :
return(90);
case 3 :
return(70);
}
}
return(undefined);
}
static function retrievePowerDescription(pKingdom, pNum) {
if (pKingdom == "water") {
switch (pNum) {
case 1 :
return({name:"Storm Front", desc:"Creates a rain cloud over your opponent's fortress, increasing the cost of their bending powers for 2 turns."});
case 2 :
return({name:"Healing Pool", desc:"Creates a pool of healing water beneath your fortress which repairs a small amount of damage each turn for 3 turns."});
case 3 :
return({name:"Frost", desc:"Coats your fortress in protective ice, lessening the impact of your opponent's next hit by a moderate amount of damage."});
}
}
if (pKingdom == "fire") {
switch (pNum) {
case 1 :
return({name:"Ignite", desc:"Sets your catapult's ammunition aflame, increasing the damage it deals by a small amount."});
case 2 :
return({name:"Sunbird", desc:"Summons a sunbird that flies into the sky. It will claim any powerups and destroy any obstacles it encounters."});
case 3 :
return({name:"Meteor", desc:"Drops a flaming meteor on your opponent's fortress, dealing a small amount damage."});
}
}
if (pKingdom == "earth") {
switch (pNum) {
case 1 :
return({name:"Sky Stone", desc:"Launches a huge, levitating stone into the air which will block any projectile that hits it."});
case 2 :
return({name:"Earth Wave", desc:"Creates a slow moving avalanche of earth. Deals large damage after 4 turns if it's not destroyed."});
case 3 :
return({name:"White Dragon Vines", desc:"Covers your fortress in healing vines that repair moderate damage each turn for 3 turns."});
}
}
return(undefined);
}
static function retrieveWeaponDescription(pKingdom, pNum) {
if (pNum == 0) {
return({name:"Boulder", desc:"A basic chunk of rock. Deals moderate damage."});
}
if (pKingdom == "earth") {
switch (pNum) {
case 1 :
return({name:"Spark Rock", desc:"Breaks apart mid-air, raining 3 chunks down on your opponent. Each chunk deals moderate damage."});
case 2 :
return({name:"Stone Lance", desc:"Pierces opponent defenses, dealing large damage every time."});
case 3 :
return({name:"Earthen Fist", desc:"Pounds through anything it hits in the air, even powerups! Deals devastating damage."});
}
}
if (pKingdom == "fire") {
switch (pNum) {
case 1 :
return({name:"Lava Ball", desc:"Splatters into many chunks of lava on impact. Each chunk deals small damage."});
case 2 :
return({name:"Sun Flare", desc:"Sends out an arc of fire on impact, which may hit structures that the projectile itself missed. Deals large damage."});
case 3 :
return({name:"Magma Bomb", desc:"Fires a huge ball of blasting magma. Deals huge damage and sets your opponent's fortress on fire."});
}
}
if (pKingdom == "water") {
switch (pNum) {
case 1 :
return({name:"Amplifying Orb", desc:"A magical ball of water that doubles the effects of any powerup it hits. Deals moderate damage."});
case 2 :
return({name:"Iceberg Spikes", desc:"Launches three separate ice spikes side-by-side. Each deals small damage."});
case 3 :
return({name:"Tidal Ball", desc:"Deals huge damage. Deals a small amount of extra damage if there is a Storm Front over your opponent's fortress."});
}
}
return(undefined);
}
}
Symbol 1271 MovieClip [__Packages.nick.avatar.fortressfight2.ents.projectiles.Boulder] Frame 0
class nick.avatar.fortressfight2.ents.projectiles.Boulder extends nick.avatar.fortressfight2.ents.projectiles.Projectile
{
var spin;
function Boulder (pData) {
super(pData);
}
function update(dt) {
super.update(dt);
spin(70, dt);
}
var __DEF_ASSET = "weapon_boulder";
var __DAMAGE = 2;
}
Symbol 1272 MovieClip [__Packages.nick.avatar.fortressfight2.ents.projectiles.EarthSparkRock] Frame 0
class nick.avatar.fortressfight2.ents.projectiles.EarthSparkRock extends nick.avatar.fortressfight2.ents.projectiles.Projectile
{
var __hasSplit, __hasSpit, spin, velocity, mc, __gravity, requestErase, doRemove;
function EarthSparkRock (pData) {
super(pData);
__hasSplit = false;
__hasSpit = false;
}
function update(dt) {
super.update(dt);
if (!__hasSplit) {
spin(110, dt);
if (velocity.y > 0) {
mc.gotoAndStop("split");
__hasSplit = true;
}
} else if (!__hasSpit) {
if (mc.anim._currentFrame > 7) {
smashing.rampage.Messenger.sendMessage("world", "onSparkRockShatter");
__hasSpit = true;
velocity.x = (velocity.y = 0);
__gravity = 0;
}
} else if (mc.anim._currentFrame == mc.anim._totalFrames) {
requestErase();
doRemove = true;
}
}
function getIsDangerous() {
return(false);
}
var __DEF_ASSET = "weapon_earth_sparkrock";
var __DAMAGE = 0;
}
Symbol 1273 MovieClip [__Packages.nick.avatar.fortressfight2.ents.projectiles.EarthSparkChunk] Frame 0
class nick.avatar.fortressfight2.ents.projectiles.EarthSparkChunk extends nick.avatar.fortressfight2.ents.projectiles.Projectile
{
var spin;
function EarthSparkChunk (pData) {
super(pData);
}
function update(dt) {
super.update(dt);
spin(200, dt);
}
var __DEF_ASSET = "weapon_earth_sparkchunk";
var __DAMAGE = 2;
}
Symbol 1274 MovieClip [__Packages.nick.avatar.fortressfight2.ents.projectiles.EarthLance] Frame 0
class nick.avatar.fortressfight2.ents.projectiles.EarthLance extends nick.avatar.fortressfight2.ents.projectiles.Projectile
{
var orient;
function EarthLance (pData) {
super(pData);
}
function onDraw(pNewMC) {
super.onDraw(pNewMC);
orient();
}
function update(dt) {
super.update(dt);
orient();
}
var __DEF_ASSET = "weapon_earth_lance";
var __DAMAGE = 4;
}
Symbol 1275 MovieClip [__Packages.nick.avatar.fortressfight2.ents.projectiles.EarthFist] Frame 0
class nick.avatar.fortressfight2.ents.projectiles.EarthFist extends nick.avatar.fortressfight2.ents.projectiles.Projectile
{
var orient;
function EarthFist (pData) {
super(pData);
}
function onDraw(pNewMC) {
super.onDraw(pNewMC);
orient();
}
function update(dt) {
super.update(dt);
orient();
}
var __DEF_ASSET = "weapon_earth_fist";
var __CORRECT_ON_HIT = true;
var __DAMAGE = 6;
var DESTROYS_PICKUPS = true;
}
Symbol 1276 MovieClip [__Packages.nick.avatar.fortressfight2.ents.projectiles.FireLavaBall] Frame 0
class nick.avatar.fortressfight2.ents.projectiles.FireLavaBall extends nick.avatar.fortressfight2.ents.projectiles.Projectile
{
var spin;
function FireLavaBall (pData) {
super(pData);
}
function update(dt) {
super.update(dt);
spin(70, dt);
}
function onUniversalImpact() {
super.onUniversalImpact();
smashing.rampage.Messenger.sendMessage("world", "onLavaSplatter");
}
var __DEF_ASSET = "weapon_fire_lavaball";
var __CORRECT_ON_HIT = true;
var __DAMAGE = 1;
}
Symbol 1277 MovieClip [__Packages.nick.avatar.fortressfight2.ents.projectiles.FireLavaChunk] Frame 0
class nick.avatar.fortressfight2.ents.projectiles.FireLavaChunk extends nick.avatar.fortressfight2.ents.projectiles.Projectile
{
var __spinDir, spin, isAlive, velocity;
function FireLavaChunk (pData) {
super(pData);
__spinDir = ((Math.random() < 0.5) ? 1 : -1);
}
function update(dt) {
super.update(dt);
spin(110 * __spinDir, dt);
}
function getIsDangerous() {
return(isAlive && (velocity.y > -20));
}
var __DEF_ASSET = "weapon_fire_lavachunk";
var __CORRECT_ON_HIT = true;
var __DAMAGE = 1;
}
Symbol 1278 MovieClip [__Packages.nick.avatar.fortressfight2.ents.projectiles.FireFlare] Frame 0
class nick.avatar.fortressfight2.ents.projectiles.FireFlare extends nick.avatar.fortressfight2.ents.projectiles.Projectile
{
var __isBlazing, spin, onUniversalImpact, mc, y, __groundY, isAlive, doBoxHD, __bgBonus, __hasArmory, __isIgnited, __isCharged, hdReg, isLeft;
function FireFlare (pData) {
super(pData);
__isBlazing = false;
setHDRegistration();
}
function update(dt) {
super.update(dt);
spin(170, dt);
}
function onHitGround() {
onUniversalImpact();
mc.gotoAndStop("blaze");
y = __groundY;
isAlive = false;
__isBlazing = true;
doBoxHD = true;
}
function onHitKeep() {
if (__isBlazing) {
__isBlazing = false;
doBoxHD = false;
return(undefined);
}
super.onHitKeep();
}
function onHitStructure() {
if (__isBlazing) {
__isBlazing = false;
doBoxHD = false;
return(undefined);
}
super.onHitStructure();
}
function getDamage(pKeep) {
return(((((__isBlazing ? (__DAMAGE - 1) : (__DAMAGE)) + (__isCharged ? 1 : 0)) + (__isIgnited ? 1 : 0)) + (__hasArmory ? 1 : 0)) + __bgBonus);
}
function getIsDangerous() {
return(isAlive || (__isBlazing));
}
function setHDRegistration() {
hdReg = {};
if (isLeft) {
hdReg.x = 100;
} else {
hdReg.x = -100;
}
hdReg.y = 0;
}
var __DEF_ASSET = "weapon_fire_sunburst";
var __DEF_HD_WIDTH = 260;
var __DEF_HD_HEIGHT = 50;
var __USE_DIMENSIONS_AS_HD = false;
var __CORRECT_ON_HIT = true;
var __DAMAGE = 4;
}
Symbol 1279 MovieClip [__Packages.nick.avatar.fortressfight2.ents.projectiles.FireMagma] Frame 0
class nick.avatar.fortressfight2.ents.projectiles.FireMagma extends nick.avatar.fortressfight2.ents.projectiles.Projectile
{
var spin;
function FireMagma (pData) {
super(pData);
}
function update(dt) {
super.update(dt);
spin(30, dt);
}
function onHitKeep() {
super.onHitKeep();
smashing.rampage.Messenger.sendMessage("world", "generateBurn");
}
var __DEF_ASSET = "weapon_fire_jellybomb";
var __CORRECT_ON_HIT = true;
var __DAMAGE = 5;
}
Symbol 1280 MovieClip [__Packages.nick.avatar.fortressfight2.ents.projectiles.WaterOrb] Frame 0
class nick.avatar.fortressfight2.ents.projectiles.WaterOrb extends nick.avatar.fortressfight2.ents.projectiles.Projectile
{
var spin;
function WaterOrb (pData) {
super(pData);
}
function update(dt) {
super.update(dt);
spin(15, dt);
}
var __DEF_ASSET = "weapon_water_orb";
var __CORRECT_ON_HIT = true;
var __DAMAGE = 3;
}
Symbol 1281 MovieClip [__Packages.nick.avatar.fortressfight2.ents.projectiles.WaterSpike] Frame 0
class nick.avatar.fortressfight2.ents.projectiles.WaterSpike extends nick.avatar.fortressfight2.ents.projectiles.Projectile
{
var orient, __bgBonus, __isIgnited, __hasArmory, __isCharged;
function WaterSpike (pData) {
super(pData);
}
function update(dt) {
super.update(dt);
orient();
}
function onDraw(pNewMC) {
super.onDraw(pNewMC);
orient();
}
function getDamage(pKeep) {
trace("Get damage : " + ((((__DAMAGE + (__isCharged ? 2 : 0)) + (__hasArmory ? 1 : 0)) + (__isIgnited ? 1 : 0)) + __bgBonus));
return((((__DAMAGE + (__isCharged ? 2 : 0)) + (__isIgnited ? 1 : 0)) + (__hasArmory ? 1 : 0)) + __bgBonus);
}
var __DEF_ASSET = "weapon_water_spike";
var __DAMAGE = 1;
}
Symbol 1282 MovieClip [__Packages.nick.avatar.fortressfight2.ents.projectiles.WaterTidal] Frame 0
class nick.avatar.fortressfight2.ents.projectiles.WaterTidal extends nick.avatar.fortressfight2.ents.projectiles.Projectile
{
var __isSplashing, orient, isAlive, onUniversalImpact, mc, y, __groundY, doBoxHD, __bgBonus, __hasArmory, __isIgnited, __isCharged;
function WaterTidal (pData) {
super(pData);
__isSplashing = false;
}
function update(dt) {
super.update(dt);
orient();
}
function onDraw(pNewMC) {
super.onDraw(pNewMC);
orient();
}
function getIsDangerous() {
return(isAlive || (__isSplashing));
}
function onHitGround() {
onUniversalImpact();
mc.gotoAndStop("splash");
y = __groundY;
isAlive = false;
__isSplashing = true;
doBoxHD = true;
}
function onHitKeep() {
if (__isSplashing) {
__isSplashing = false;
doBoxHD = false;
return(undefined);
}
super.onHitKeep();
}
function onHitStructure() {
if (__isSplashing) {
__isSplashing = false;
doBoxHD = false;
return(undefined);
}
super.onHitStructure();
}
function getDamage(pKeep) {
return(((((__isSplashing ? 1 : (__DAMAGE)) + (__isCharged ? 1 : 0)) + (__isIgnited ? 1 : 0)) + (__hasArmory ? 1 : 0)) + __bgBonus);
}
var __DEF_ASSET = "weapon_water_tidalball";
var __CORRECT_ON_HIT = true;
var __DAMAGE = 5;
var __DEF_HD_WIDTH = 260;
var __DEF_HD_HEIGHT = 50;
var __USE_DIMENSIONS_AS_HD = false;
}
Symbol 1283 MovieClip [__Packages.nick.avatar.fortressfight2.ents.powers.Power] Frame 0
class nick.avatar.fortressfight2.ents.powers.Power extends nick.avatar.fortressfight2.ents.Entity
{
var __ownerPlayer, __enemyPlayer, __isLeft, __isInitializing, __introTimer, __groundY, mc, isAlive, requestErase, doRemove, hdWidth, hdReg, x, hdHeight, y, updateDraw, isDrawn, threedScale, __camera, z, scale, startScale, flipH;
function Power (pData) {
super(pData);
}
function init(pData) {
super.init(pData);
__ownerPlayer = pData.owner;
__enemyPlayer = pData.enemy;
__isLeft = __ownerPlayer.isLeft;
__isInitializing = true;
__introTimer = 0;
__groundY = nick.avatar.fortressfight2.GameState.getInstance().GROUND_Y - 57;
__introTimer = __INTRO_DURATION;
}
function onDraw(pNewMC) {
super.onDraw(pNewMC);
if (__isInitializing) {
mc.gotoAndStop("spawn");
__introTimer = __INTRO_DURATION;
__isInitializing = false;
}
}
function clear() {
isAlive = false;
requestErase();
}
function onErase() {
if (!isAlive) {
doRemove = true;
}
if (__introTimer > 0) {
smashing.rampage.Messenger.sendMessage("world", "onPowerComplete");
__introTimer = 0;
}
super.onErase();
}
function runHD(pProjectile) {
if (!isAlive) {
return(undefined);
}
if (Math.abs((x + hdReg.x) - (pProjectile.x + pProjectile.hdReg.x)) < (hdWidth + pProjectile.hdWidth)) {
if (Math.abs((y + hdReg.y) - (pProjectile.y + pProjectile.hdReg.y)) < (hdHeight + pProjectile.hdHeight)) {
hitReact();
if (!pProjectile.DESTROYS_PICKUPS) {
pProjectile.onHitStructure();
}
}
}
}
function hitReact() {
}
function update(dt) {
if (__introTimer > 0) {
__introTimer = __introTimer - dt;
if (__introTimer <= 0) {
smashing.rampage.Messenger.sendMessage("world", "onPowerComplete");
}
}
}
function updateAndRender(dt) {
update(dt);
render(dt);
}
function render(dt) {
updateDraw();
if (!isDrawn) {
return(undefined);
}
if (threedScale) {
if (z < __camera.z) {
return(undefined);
}
var _local2 = __camera.fl / (z - __camera.z);
if (scale != _local2) {
scale = _local2;
mc._xscale = (mc._yscale = 100 * (1 + (scale - startScale)));
if (flipH) {
mc._xscale = mc._xscale * -1;
}
}
}
mc._x = ((x - __camera.x) * scale) + __camera.__get__sc().x;
if (__IS_AIRBORNE) {
mc._y = (((y - __camera.y) * scale) + __camera.__get__sc().y) + ((1 - scale) * 120);
} else {
mc._y = (y - __camera.y) + __camera.__get__sc().y;
}
}
function updateFriendlyTurn() {
}
function updateEnemyTurn() {
}
function onFriendlyDamage() {
}
function onEnemyDamage() {
}
function toString() {
return("Power : " + ID);
}
var TYPE = "power";
var DRAWTYPE = "forepower";
var __DEF_WIDTH = 300;
var __DEF_HEIGHT = 300;
var __USE_ACTUAL_DIMENSIONS = false;
var __DEF_ASSET = "";
var __IDLE_ANIMATION = "idle";
var __DEATH_ANIMATION = "die";
var __INTRO_DURATION = 1.5;
var ID = "";
var DO_HD = false;
var IS_INSTANT_OFFENSIVE = false;
var IS_TRACKING_SPAWN = false;
var DO_COLLECT_PICKUPS = false;
var __IS_AIRBORNE = false;
}
Symbol 1284 MovieClip [__Packages.nick.avatar.fortressfight2.ents.powers.Storm] Frame 0
class nick.avatar.fortressfight2.ents.powers.Storm extends nick.avatar.fortressfight2.ents.powers.Power
{
var startX, x, __enemyPlayer, startY, y, __lifespan, isAlive, mc, requestErase, doRemove, __DEATH_ANIMATION;
function Storm (pData) {
super(pData);
}
function init(pData) {
super.init(pData);
startX = (x = __enemyPlayer.x);
startY = (y = __enemyPlayer.y);
__lifespan = __LIFE_SPAN;
}
function update(dt) {
if (!isAlive) {
if (mc.anim._currentFrame == mc.anim._totalFrames) {
requestErase();
doRemove = true;
return(undefined);
}
}
super.update(dt);
}
function updateEnemyTurn() {
if (isAlive) {
__enemyPlayer.bendingMultiplier = 1.4;
__lifespan--;
if (__lifespan <= 0) {
isAlive = false;
mc.gotoAndStop(__DEATH_ANIMATION);
}
}
}
var ID = "storm";
var DO_HD = false;
var __DEF_ASSET = "power_water_storm";
var __INTRO_DURATION = 2.5;
var IS_INSTANT_OFFENSIVE = true;
var __LIFE_SPAN = 3;
}
Symbol 1285 MovieClip [__Packages.nick.avatar.fortressfight2.ents.powers.HealingPool] Frame 0
class nick.avatar.fortressfight2.ents.powers.HealingPool extends nick.avatar.fortressfight2.ents.powers.Power
{
var startX, x, __ownerPlayer, startY, y, __introTimer, __lifespan, __isLeft, flip, isAlive, mc, requestErase, doRemove, __DEATH_ANIMATION;
function HealingPool (pData) {
super(pData);
}
function init(pData) {
super.init(pData);
startX = (x = __ownerPlayer.x);
startY = (y = __ownerPlayer.y);
__introTimer = 1.5;
__lifespan = __LIFE_SPAN;
if (!__isLeft) {
flip();
}
}
function update(dt) {
if (!isAlive) {
if (mc.anim._currentFrame == mc.anim._totalFrames) {
requestErase();
doRemove = true;
return(undefined);
}
}
super.update(dt);
}
function updateFriendlyTurn() {
if (isAlive) {
__ownerPlayer.onHeal(1);
__lifespan--;
if (__lifespan <= 0) {
isAlive = false;
mc.gotoAndStop(__DEATH_ANIMATION);
}
}
}
var ID = "pool";
var DRAWTYPE = "rearpower";
var DO_HD = false;
var __DEF_ASSET = "power_water_healingpool";
var __INTRO_DURATION = 1.5;
var __LIFE_SPAN = 4;
}
Symbol 1286 MovieClip [__Packages.nick.avatar.fortressfight2.ents.powers.Frost] Frame 0
class nick.avatar.fortressfight2.ents.powers.Frost extends nick.avatar.fortressfight2.ents.powers.Power
{
var startX, x, __ownerPlayer, startY, y, __lifespan, __isLeft, flip, isAlive, mc, requestErase, doRemove, __DEATH_ANIMATION;
function Frost (pData) {
super(pData);
}
function init(pData) {
super.init(pData);
startX = (x = __ownerPlayer.x);
startY = (y = __ownerPlayer.y);
__lifespan = __LIFE_SPAN;
if (!__isLeft) {
flip();
}
}
function update(dt) {
if (!isAlive) {
if (mc.anim._currentFrame == mc.anim._totalFrames) {
requestErase();
doRemove = true;
return(undefined);
}
}
super.update(dt);
}
function updateFriendlyTurn() {
if (isAlive) {
__lifespan--;
if (__lifespan <= 0) {
isAlive = false;
mc.gotoAndStop(__DEATH_ANIMATION);
}
}
}
function onFriendlyDamage() {
if (!isAlive) {
return(undefined);
}
__ownerPlayer.onHeal(2);
isAlive = false;
mc.gotoAndStop(__DEATH_ANIMATION);
}
var ID = "frost";
var DO_HD = false;
var __DEF_ASSET = "power_water_frost";
var __INTRO_DURATION = 1.5;
var __LIFE_SPAN = 3;
}
Symbol 1287 MovieClip [__Packages.nick.avatar.fortressfight2.ents.powers.Ignite] Frame 0
class nick.avatar.fortressfight2.ents.powers.Ignite extends nick.avatar.fortressfight2.ents.powers.Power
{
function Ignite (pData) {
super(pData);
}
var ID = "ignite";
var DO_HD = false;
var __DEF_ASSET = "power_fire_burn";
var __INTRO_DURATION = 0;
}
Symbol 1288 MovieClip [__Packages.nick.avatar.fortressfight2.ents.powers.SunBird] Frame 0
class nick.avatar.fortressfight2.ents.powers.SunBird extends nick.avatar.fortressfight2.ents.powers.Power
{
var __state, startX, x, __ownerPlayer, startY, y, __energy, __baseAngle, __angle, __dirMod, isAlive, mc, requestErase, doRemove, velocity, magnitudeToVector, __DEATH_ANIMATION;
function SunBird (pData) {
super(pData);
}
function init(pData) {
super.init(pData);
__state = nick.avatar.fortressfight2.GameState.getInstance();
startX = (x = __ownerPlayer.x);
startY = (y = __ownerPlayer.y - 30);
__energy = 4.2;
if (__ownerPlayer.isLeft) {
__baseAngle = 311 + (Math.random() * 8);
} else {
__baseAngle = 221 + (Math.random() * 8);
}
__angle = 0;
__dirMod = ((Math.random() < 0.5) ? 1 : -1);
}
function update(dt) {
if (!isAlive) {
if (mc.anim._currentFrame == mc.anim._totalFrames) {
requestErase();
doRemove = true;
smashing.rampage.Messenger.sendMessage("world", "onPowerComplete");
return(undefined);
}
} else {
__energy = __energy - dt;
velocity = magnitudeToVector(__MOVE_RATE, __baseAngle);
x = x + (velocity.x * dt);
y = y + (velocity.y * dt);
mc._rotation = __baseAngle;
if (__energy < 0) {
isAlive = false;
mc.gotoAndStop(__DEATH_ANIMATION);
}
}
super.update(dt);
}
function onDraw(pNewMC) {
super.onDraw(pNewMC);
mc._rotation = __baseAngle;
}
function onErase() {
super.onErase();
if (!doRemove) {
smashing.rampage.Messenger.sendMessage("world", "onPowerComplete");
}
}
var ID = "sunbird";
var DO_HD = true;
var IS_TRACKING_SPAWN = true;
var __IS_AIRBORNE = true;
var __DEF_HD_WIDTH = 90;
var __DEF_HD_HEIGHT = 80;
var __USE_DIMENSIONS_AS_HD = false;
var __INTRO_DURATION = 0;
var __DEF_ASSET = "power_fire_sunbird";
var __MOVE_RATE = 320;
var DO_COLLECT_PICKUPS = true;
}
Symbol 1289 MovieClip [__Packages.nick.avatar.fortressfight2.ents.powers.Meteor] Frame 0
class nick.avatar.fortressfight2.ents.powers.Meteor extends nick.avatar.fortressfight2.ents.powers.Power
{
var startX, x, __enemyPlayer, startY, y, __hasExploded, isDrawn, mc, requestErase, isAlive, doRemove, __introTimer;
function Meteor (pData) {
super(pData);
}
function init(pData) {
super.init(pData);
startX = (x = __enemyPlayer.x);
startY = (y = __enemyPlayer.y + 8);
__hasExploded = false;
}
function update(dt) {
}
function render(dt) {
super.render(dt);
if (!isDrawn) {
return(undefined);
}
if ((!__hasExploded) && (mc.anim._currentFrame > 17)) {
__hasExploded = true;
__enemyPlayer.onVerticalDamage(1);
smashing.rampage.Messenger.sendMessage("world", "generateShrapnel", {x:x, y:y});
} else if (mc.anim._currentFrame == mc.anim._totalFrames) {
requestErase();
isAlive = false;
doRemove = true;
smashing.rampage.Messenger.sendMessage("world", "onPowerComplete");
return(undefined);
}
}
function onErase() {
if (isAlive) {
isAlive = false;
__introTimer = 1;
}
super.onErase();
}
var ID = "meteor";
var DO_HD = false;
var __DEF_ASSET = "power_fire_meteor";
var __INTRO_DURATION = 0;
var IS_INSTANT_OFFENSIVE = true;
}
Symbol 1290 MovieClip [__Packages.nick.avatar.fortressfight2.ents.powers.SkyStone] Frame 0
class nick.avatar.fortressfight2.ents.powers.SkyStone extends nick.avatar.fortressfight2.ents.powers.Power
{
var __ownerPlayer, startX, x, startY, y, __groundY, __targetY, __lifespan, __hoverTimer, __isSpawning, isAlive, mc, requestErase, doRemove, isDrawn, __DEATH_ANIMATION;
function SkyStone (pData) {
super(pData);
}
function init(pData) {
super.init(pData);
if (__ownerPlayer.isLeft) {
startX = (x = (__ownerPlayer.x + 400) + (Math.random() * 600));
} else {
startX = (x = (__ownerPlayer.x - 400) - (Math.random() * 600));
}
startY = (y = __groundY);
__targetY = (y - 200) - (Math.random() * 370);
__lifespan = __LIFE_SPAN;
__hoverTimer = 0;
__isSpawning = true;
}
function update(dt) {
if (!isAlive) {
if (mc.anim._currentFrame == mc.anim._totalFrames) {
requestErase();
doRemove = true;
return(undefined);
}
} else if (__isSpawning && (isDrawn)) {
if (__hoverTimer > 0) {
__hoverTimer = __hoverTimer - dt;
if (__hoverTimer <= 0) {
trace("Spawning Intro done!");
smashing.rampage.Messenger.sendMessage("world", "onPowerComplete");
__hoverTimer = -1;
__isSpawning = false;
}
} else if (mc.anim._currentFrame > 26) {
if (y > __targetY) {
y = y - (__MOVE_RATE * dt);
if (y < __targetY) {
y = __targetY;
__hoverTimer = 1;
}
}
}
}
super.update(dt);
}
function runHD(pProjectile) {
if (!isAlive) {
return(undefined);
}
super.runHD(pProjectile);
}
function hitReact() {
isAlive = false;
mc.gotoAndStop(__DEATH_ANIMATION);
}
function onErase() {
super.onErase();
if (__isSpawning) {
trace("Erased while spawning");
smashing.rampage.Messenger.sendMessage("world", "onPowerComplete");
}
__hoverTimer = -1;
__isSpawning = false;
}
function updateFriendlyTurn() {
if (isAlive) {
__lifespan--;
if (__lifespan <= 0) {
isAlive = false;
mc.gotoAndStop(__DEATH_ANIMATION);
}
}
}
var ID = "skystone";
var DO_HD = true;
var IS_TRACKING_SPAWN = true;
var __IS_AIRBORNE = true;
var __DEF_HD_WIDTH = 60;
var __DEF_HD_HEIGHT = 110;
var __USE_DIMENSIONS_AS_HD = false;
var __INTRO_DURATION = 0;
var __DEF_ASSET = "power_earth_stone";
var __LIFE_SPAN = 3;
var __MOVE_RATE = 180;
}
Symbol 1291 MovieClip [__Packages.nick.avatar.fortressfight2.ents.powers.WhiteDragonVines] Frame 0
class nick.avatar.fortressfight2.ents.powers.WhiteDragonVines extends nick.avatar.fortressfight2.ents.powers.Power
{
var startX, x, __ownerPlayer, startY, y, __lifespan, __isLeft, flip, isAlive, mc, requestErase, doRemove, __DEATH_ANIMATION;
function WhiteDragonVines (pData) {
super(pData);
}
function init(pData) {
super.init(pData);
startX = (x = __ownerPlayer.x);
startY = (y = __ownerPlayer.y);
__lifespan = __LIFE_SPAN;
if (!__isLeft) {
flip();
}
}
function update(dt) {
if (!isAlive) {
if (mc.anim._currentFrame == mc.anim._totalFrames) {
requestErase();
doRemove = true;
return(undefined);
}
}
super.update(dt);
}
function updateFriendlyTurn() {
if (isAlive) {
__ownerPlayer.onHeal(2);
__lifespan--;
if (__lifespan <= 0) {
isAlive = false;
__ownerPlayer.onHeal(2);
mc.gotoAndStop(__DEATH_ANIMATION);
}
}
}
function onFriendlyDamage() {
if (!isAlive) {
return(undefined);
}
isAlive = false;
mc.gotoAndStop(__DEATH_ANIMATION);
}
var ID = "vines";
var DO_HD = false;
var __DEF_ASSET = "power_earth_vines";
var __LIFE_SPAN = 4;
}
Symbol 1292 MovieClip [__Packages.nick.avatar.fortressfight2.ents.powers.EarthWave] Frame 0
class nick.avatar.fortressfight2.ents.powers.EarthWave extends nick.avatar.fortressfight2.ents.powers.Power
{
var __state, startX, x, __ownerPlayer, startY, y, __targetX, __isSpawning, __isBeingTracked, __isLeft, flip, isAlive, __spawnTimer, mc, requestErase, doRemove, __DEATH_ANIMATION, __enemyPlayer, hdReg;
function EarthWave (pData) {
super(pData);
}
function init(pData) {
super.init(pData);
__state = nick.avatar.fortressfight2.GameState.getInstance();
startX = (x = __ownerPlayer.x);
startY = (y = __ownerPlayer.y + 7);
if (__ownerPlayer.isLeft) {
__targetX = x + 450;
} else {
__targetX = x - 450;
}
__isSpawning = true;
__isBeingTracked = false;
if (!__isLeft) {
flip();
}
}
function update(dt) {
if (isAlive) {
if (__targetX > x) {
x = x + (__MOVE_RATE * dt);
if (x > (__state.RIGHT_KEEP_X - 150)) {
onReachEnemyKeep();
} else if (x > __targetX) {
x = __targetX;
}
} else if (__targetX < x) {
x = x - (__MOVE_RATE * dt);
if (x < (__state.LEFT_KEEP_X + 150)) {
onReachEnemyKeep();
} else if (x < __targetX) {
x = __targetX;
}
} else if (__isSpawning) {
if (__spawnTimer > 0) {
__spawnTimer = __spawnTimer - dt;
if (__spawnTimer <= 0) {
__isSpawning = false;
smashing.rampage.Messenger.sendMessage("world", "onPowerComplete");
}
} else {
__spawnTimer = 1;
}
} else if (__isBeingTracked) {
if (__spawnTimer > 0) {
__spawnTimer = __spawnTimer - dt;
if (__spawnTimer <= 0) {
__isBeingTracked = false;
smashing.rampage.Messenger.sendMessage("world", "onEarthWaveUpdateComplete");
}
} else {
__spawnTimer = 1;
}
}
} else if (mc.anim._currentFrame == mc.anim._totalFrames) {
requestErase();
if (__isBeingTracked) {
smashing.rampage.Messenger.sendMessage("world", "onEarthWaveUpdateComplete");
}
doRemove = true;
return(undefined);
}
super.update(dt);
}
function setIsBeingTracked() {
__isBeingTracked = true;
}
function onErase() {
super.onErase();
if (__isSpawning && (__spawnTimer <= 0)) {
smashing.rampage.Messenger.sendMessage("world", "onPowerComplete");
}
__isSpawning = false;
}
function hitReact() {
isAlive = false;
mc.gotoAndStop(__DEATH_ANIMATION);
}
function updateFriendlyTurn() {
if (isAlive) {
if (__ownerPlayer.isLeft) {
__targetX = x + 400;
} else {
__targetX = x - 400;
}
}
}
function onReachEnemyKeep() {
__enemyPlayer.onHorizontalDamage(3);
isAlive = false;
mc.gotoAndStop(__DEATH_ANIMATION);
}
function setHDRegistration() {
hdReg = {};
hdReg.x = 0;
hdReg.y = -23;
}
var ID = "wave";
var DO_HD = true;
var IS_TRACKING_SPAWN = true;
var __DEF_HD_WIDTH = 150;
var __DEF_HD_HEIGHT = 45;
var __USE_DIMENSIONS_AS_HD = false;
var __INTRO_DURATION = 0;
var __DEF_ASSET = "power_earth_wave";
var __MOVE_RATE = 220;
}
Symbol 1293 MovieClip [__Packages.nick.avatar.fortressfight2.ents.powers.Burn] Frame 0
class nick.avatar.fortressfight2.ents.powers.Burn extends nick.avatar.fortressfight2.ents.powers.Power
{
var startX, x, __ownerPlayer, startY, y, __lifespan, isAlive, mc, requestErase, doRemove, __DEATH_ANIMATION;
function Burn (pData) {
super(pData);
}
function init(pData) {
super.init(pData);
startX = (x = __ownerPlayer.x);
startY = (y = __ownerPlayer.y);
__lifespan = __LIFE_SPAN;
}
function update(dt) {
if (!isAlive) {
if (mc.anim._currentFrame == mc.anim._totalFrames) {
requestErase();
doRemove = true;
return(undefined);
}
}
super.update(dt);
}
function updateFriendlyTurn() {
if (isAlive) {
__ownerPlayer.onDamage(1);
__lifespan--;
if (__lifespan <= 0) {
isAlive = false;
mc.gotoAndStop(__DEATH_ANIMATION);
}
}
}
var ID = "burn";
var DO_HD = false;
var __DEF_ASSET = "power_fire_burn";
var __INTRO_DURATION = 0;
var __LIFE_SPAN = 2;
}
Symbol 1294 MovieClip [__Packages.nick.avatar.fortressfight2.battlegrounds.Battleground] Frame 0
class nick.avatar.fortressfight2.battlegrounds.Battleground
{
function Battleground () {
}
}
Symbol 1295 MovieClip [__Packages.nick.avatar.fortressfight2.battlegrounds.BattlegroundEarth] Frame 0
class nick.avatar.fortressfight2.battlegrounds.BattlegroundEarth extends nick.avatar.fortressfight2.battlegrounds.Battleground
{
var kingdom;
function BattlegroundEarth () {
super();
kingdom = "earth";
}
var NEAR_ASSET = "bg_earth_ground";
var MID_ASSET = "bg_earth_mid";
var FAR_ASSET = "bg_earth_sky";
}
Symbol 1296 MovieClip [__Packages.nick.avatar.fortressfight2.battlegrounds.BattlegroundFire] Frame 0
class nick.avatar.fortressfight2.battlegrounds.BattlegroundFire extends nick.avatar.fortressfight2.battlegrounds.Battleground
{
var kingdom;
function BattlegroundFire () {
super();
kingdom = "fire";
}
var NEAR_ASSET = "bg_fire_ground";
var MID_ASSET = "bg_fire_mid";
var FAR_ASSET = "bg_fire_sky";
}
Symbol 1297 MovieClip [__Packages.nick.avatar.fortressfight2.battlegrounds.BattlegroundAir] Frame 0
class nick.avatar.fortressfight2.battlegrounds.BattlegroundAir extends nick.avatar.fortressfight2.battlegrounds.Battleground
{
var kingdom;
function BattlegroundAir () {
super();
kingdom = "air";
}
var NEAR_ASSET = "bg_air_ground";
var MID_ASSET = "bg_air_mid";
var FAR_ASSET = "bg_air_sky";
}
Symbol 1298 MovieClip [__Packages.nick.avatar.fortressfight2.battlegrounds.BattlegroundWater] Frame 0
class nick.avatar.fortressfight2.battlegrounds.BattlegroundWater extends nick.avatar.fortressfight2.battlegrounds.Battleground
{
var kingdom;
function BattlegroundWater () {
super();
kingdom = "water";
}
var NEAR_ASSET = "bg_water_ground";
var MID_ASSET = "bg_water_mid";
var FAR_ASSET = "bg_water_sky";
}
Symbol 1299 MovieClip [__Packages.nick.avatar.fortressfight2.ents.pickups.Pickup] Frame 0
class nick.avatar.fortressfight2.ents.pickups.Pickup extends nick.avatar.fortressfight2.ents.Entity
{
var __groundY, hdWidth, hdReg, x, hdHeight, y, isAlive, mc, updateDraw, isDrawn, __camera, z, scale, startScale, flipH, doRemove;
function Pickup (pData) {
super(pData);
}
function init(pData) {
super.init(pData);
__groundY = nick.avatar.fortressfight2.GameState.getInstance().GROUND_Y - 40;
}
function runHD(pProjectile) {
if (Math.abs((x + hdReg.x) - (pProjectile.x + pProjectile.hdReg.x)) < (hdWidth + pProjectile.hdWidth)) {
if (Math.abs((y + hdReg.y) - (pProjectile.y + pProjectile.hdReg.y)) < (hdHeight + pProjectile.hdHeight)) {
hitReact(pProjectile);
}
}
}
function hitReact(pProjectile) {
isAlive = false;
mc.gotoAndPlay("pickup");
}
function updateAndRender(dt) {
render(dt);
}
function render(dt) {
updateDraw();
if (!isDrawn) {
return(undefined);
}
var _local2 = __camera.fl / (z - __camera.z);
if (scale != _local2) {
scale = _local2;
mc._xscale = (mc._yscale = 100 * (1 + (scale - startScale)));
if (flipH) {
mc._xscale = mc._xscale * -1;
}
}
mc._x = ((x - __camera.x) * scale) + __camera.__get__sc().x;
mc._y = (((y - __camera.y) * scale) + __camera.__get__sc().y) + ((1 - scale) * 120);
}
function onErase() {
super.onErase();
if (!isAlive) {
doRemove = true;
}
}
var TYPE = "pickup";
var DRAWTYPE = "effect";
var __DEF_ASSET = "";
var CUSTOMDRAW = true;
var __DEF_WIDTH = 50;
var __DEF_HEIGHT = 50;
var __USE_ACTUAL_DIMENSIONS = false;
var __DEF_HD_WIDTH = 50;
var __DEF_HD_HEIGHT = 50;
var __USE_DIMENSIONS_AS_HD = false;
}
Symbol 1300 MovieClip [__Packages.nick.avatar.fortressfight2.ents.pickups.PickupHealth] Frame 0
class nick.avatar.fortressfight2.ents.pickups.PickupHealth extends nick.avatar.fortressfight2.ents.pickups.Pickup
{
var isAlive;
function PickupHealth (pData) {
super(pData);
}
function hitReact(pProjectile) {
if (!isAlive) {
return(undefined);
}
super.hitReact();
if (pProjectile.DESTROYS_PICKUPS) {
return(undefined);
}
smashing.rampage.Messenger.sendMessage("world", "onCollectHealth");
}
var __DEF_ASSET = "pickup_health_mc";
}
Symbol 1301 MovieClip [__Packages.nick.avatar.fortressfight2.ents.pickups.PickupAmmo] Frame 0
class nick.avatar.fortressfight2.ents.pickups.PickupAmmo extends nick.avatar.fortressfight2.ents.pickups.Pickup
{
var isAlive;
function PickupAmmo (pData) {
super(pData);
}
function hitReact(pProjectile) {
if (!isAlive) {
return(undefined);
}
super.hitReact();
if (pProjectile.DESTROYS_PICKUPS) {
return(undefined);
}
smashing.rampage.Messenger.sendMessage("world", "onCollectAmmo");
}
var __DEF_ASSET = "pickup_weapons_mc";
}
Symbol 1302 MovieClip [__Packages.nick.avatar.fortressfight2.ents.pickups.PickupDamage] Frame 0
class nick.avatar.fortressfight2.ents.pickups.PickupDamage extends nick.avatar.fortressfight2.ents.pickups.Pickup
{
var isAlive;
function PickupDamage (pData) {
super(pData);
}
function hitReact(pProjectile) {
if (!isAlive) {
return(undefined);
}
super.hitReact();
if (pProjectile.DESTROYS_PICKUPS) {
return(undefined);
}
smashing.rampage.Messenger.sendMessage("world", "onCollectDamage");
}
var __DEF_ASSET = "pickup_damage_mc";
}
Symbol 1303 MovieClip [__Packages.nick.avatar.fortressfight2.ents.pickups.PickupGold] Frame 0
class nick.avatar.fortressfight2.ents.pickups.PickupGold extends nick.avatar.fortressfight2.ents.pickups.Pickup
{
var isAlive;
function PickupGold (pData) {
super(pData);
}
function hitReact(pProjectile) {
if (!isAlive) {
return(undefined);
}
super.hitReact();
if (pProjectile.DESTROYS_PICKUPS) {
return(undefined);
}
smashing.rampage.Messenger.sendMessage("world", "onCollectGold");
}
var __DEF_ASSET = "pickup_gold_mc";
}
Symbol 1304 MovieClip [__Packages.nick.avatar.fortressfight2.ents.Effect] Frame 0
class nick.avatar.fortressfight2.ents.Effect extends nick.avatar.fortressfight2.ents.Entity
{
var doRemove;
function Effect (t_data) {
super(t_data);
}
function onErase() {
doRemove = true;
super.onErase();
}
var TYPE = "effect";
var DRAWTYPE = "effect";
var __3D_SCALE = true;
}
Symbol 1305 MovieClip [__Packages.nick.avatar.fortressfight2.ents.Shrapnel] Frame 0
class nick.avatar.fortressfight2.ents.Shrapnel extends nick.avatar.fortressfight2.ents.Effect
{
var __gravity, velocity, assetID, __spinRate, x, y, z, isDrawn, mc, updateDraw, __camera, scale, startScale, flipH;
function Shrapnel (t_data) {
super(t_data);
}
function init(pData) {
super.init(pData);
__gravity = nick.avatar.fortressfight2.GameState.getInstance().GRAVITY_Y;
velocity = new smashing.Point3D(-100 + (Math.random() * 200), -100 - (Math.random() * 170), -80 - (Math.random() * 290));
var _local3 = Math.ceil(Math.random() * 3);
if (_local3 == 0) {
_local3++;
}
assetID = (pData.kingdom + "_part_") + _local3;
__spinRate = 50 - (Math.random() * 100);
}
function updateAndRender(dt) {
dt = dt * 1.4;
velocity.y = velocity.y + (__gravity * dt);
x = x + (velocity.x * dt);
y = y + (velocity.y * dt);
z = z + (velocity.z * dt);
if (isDrawn) {
mc._rotation = mc._rotation + (__spinRate * dt);
}
render(dt);
}
function render(dt) {
updateDraw();
if (!isDrawn) {
return(undefined);
}
var _local2 = __camera.fl / (z - __camera.z);
if (scale != _local2) {
scale = _local2;
mc._xscale = (mc._yscale = 100 * (1 + (scale - startScale)));
if (flipH) {
mc._xscale = mc._xscale * -1;
}
}
mc._x = ((x - __camera.x) * scale) + __camera.__get__sc().x;
mc._y = (((y - __camera.y) * scale) + __camera.__get__sc().y) + ((1 - scale) * 120);
}
var __DEF_WIDTH = 80;
var __DEF_HEIGHT = 80;
var __USE_ACTUAL_DIMENSIONS = false;
}
Symbol 1306 MovieClip [__Packages.nick.avatar.fortressfight2.ents.Scroller] Frame 0
class nick.avatar.fortressfight2.ents.Scroller extends nick.avatar.fortressfight2.ents.Entity
{
var __halfWidth, __halfHeight, __camera, __width, __height, __dblwidth, __dblheight, __lastx, __offx, __offy, __groundy, __zmult, startZ, z, __DEF_Z, initScale, threedScale, __isForeground, __bgAsset, depthInfluence, __tiles, scale, startScale, mc;
function Scroller (pData) {
super(pData);
}
function init(pData) {
super.init(pData);
__halfWidth = 450;
__halfHeight = __camera.__get__sc().y;
__width = __halfWidth * 2;
__height = __halfHeight * 2;
__dblwidth = __width * 2;
__dblheight = __height * 2;
__lastx = __camera.x;
__offx = (__offy = 0);
__groundy = nick.avatar.fortressfight2.GameState.getInstance().GROUND_Y;
__zmult = pData.zmult;
startZ = (z = __DEF_Z + ((1 - __zmult) * 1000));
initScale();
if (__zmult == 0) {
threedScale = false;
} else {
threedScale = true;
}
if (__zmult == 1) {
__isForeground = true;
} else {
__isForeground = false;
}
__bgAsset = pData.bg;
depthInfluence = -Math.ceil(__zmult * 10);
__tiles = pData.tiles;
updateDraw();
}
function updateDraw() {
super.updateDraw();
render();
}
function render(dt) {
if (threedScale) {
var _local2 = __camera.fl / (z - __camera.z);
if (scale != _local2) {
scale = _local2;
mc._xscale = (mc._yscale = 100 * (1 + (scale - startScale)));
}
}
mc._x = __camera.__get__sc().x + (__offx * scale);
mc._y = __camera.__get__sc().y + __offy;
}
function updateAndRender(dt) {
__offx = __offx + ((__lastx - __camera.x) * __zmult);
__offy = (__groundy - __camera.y) - (__Y_SCALING_OFFSET * __zmult);
if (__zmult == 1) {
if ((__offx * ((__zmult < 1) ? (scale) : 1)) < (-__halfWidth)) {
__offx = __offx + ((__width * Math.ceil(Math.abs(__offx) / __width)) * ((__zmult < 1) ? (scale) : 1));
} else if ((__offx * ((__zmult < 1) ? (scale) : 1)) > __halfWidth) {
__offx = __offx - ((__width * Math.ceil(Math.abs(__offx) / __width)) * ((__zmult < 1) ? (scale) : 1));
}
}
__lastx = __camera.x;
render(dt);
}
function onDraw(pNewMC) {
super.onDraw(pNewMC);
var _local4;
var _local5 = (-__width) * (__tiles / 2);
var _local3 = 0;
while (_local3 < __tiles) {
_local4 = mc.attachMovie(__bgAsset, "tile" + _local3, _local3);
_local4._x = (_local5 + (__width * _local3)) - (1 * _local3);
_local4._y = __Y_SCALING_OFFSET * __zmult;
_local3++;
}
mc.cacheAsBitmap = true;
}
function toString() {
return("This is a scroller : " + mc);
}
var TYPE = "scroller";
var DRAWTYPE = "bg";
var __DEF_ASSET = "_empty";
var CUSTOMDRAW = true;
var __Y_SCALING_OFFSET = 50;
}
Symbol 1307 MovieClip [__Packages.nick.avatar.fortressfight2.ents.KeepEarth] Frame 0
class nick.avatar.fortressfight2.ents.KeepEarth extends nick.avatar.fortressfight2.ents.KeepBase
{
var kingdom, hdReg;
function KeepEarth (pData) {
super(pData);
}
function init(pData) {
super.init(pData);
kingdom = "earth";
}
function setHDRegistration() {
hdReg = {};
hdReg.x = 0;
hdReg.y = -180;
}
var __DEF_HD_WIDTH = 360;
var __DEF_HD_HEIGHT = 260;
var __USE_DIMENSIONS_AS_HD = false;
var __DEF_ASSET = "keep_earth";
var __WALL_RIGHT = 170;
var __HEART_RIGHT = 88.15;
var __HEART_TOP = -77.9;
var __TOWER_TOP = -149.2;
var __HEART_LEFT = -123;
}
Symbol 1308 MovieClip [__Packages.nick.avatar.fortressfight2.ents.KeepFire] Frame 0
class nick.avatar.fortressfight2.ents.KeepFire extends nick.avatar.fortressfight2.ents.KeepBase
{
var kingdom, hdReg;
function KeepFire (pData) {
super(pData);
}
function init(pData) {
super.init(pData);
kingdom = "fire";
}
function setHDRegistration() {
hdReg = {};
hdReg.x = 0;
hdReg.y = -180;
}
var __DEF_HD_WIDTH = 360;
var __DEF_HD_HEIGHT = 260;
var __USE_DIMENSIONS_AS_HD = false;
var __DEF_ASSET = "keep_fire";
var __WALL_RIGHT = 177.6;
var __HEART_RIGHT = 83.3;
var __HEART_TOP = -98.4;
var __TOWER_TOP = -229.6;
var __HEART_LEFT = -73.8;
}
Symbol 1309 MovieClip [__Packages.nick.avatar.fortressfight2.ents.KeepWater] Frame 0
class nick.avatar.fortressfight2.ents.KeepWater extends nick.avatar.fortressfight2.ents.KeepBase
{
var kingdom, hdReg;
function KeepWater (pData) {
super(pData);
}
function init(pData) {
super.init(pData);
kingdom = "water";
}
function setHDRegistration() {
hdReg = {};
hdReg.x = 0;
hdReg.y = -180;
}
var __DEF_HD_WIDTH = 360;
var __DEF_HD_HEIGHT = 260;
var __USE_DIMENSIONS_AS_HD = false;
var __DEF_ASSET = "keep_water";
var __WALL_RIGHT = 210.7;
var __HEART_RIGHT = 104.5;
var __HEART_TOP = -90;
var __TOWER_TOP = -215.3;
var __HEART_LEFT = -102;
}
Symbol 1310 MovieClip [__Packages.nick.avatar.fortressfight2.ents.Arrow] Frame 0
class nick.avatar.fortressfight2.ents.Arrow extends nick.avatar.fortressfight2.ents.Entity
{
var __ownerPlayer, isLeft, charge, __chargeDir, angle, updateDraw, mc, isCharging;
function Arrow (pData) {
super(pData);
}
function init(pData) {
super.init(pData);
__ownerPlayer = pData.player;
isLeft = __ownerPlayer.isLeft;
charge = 0;
__chargeDir = 1;
angle = 0;
}
function updateAndRender(dt) {
updateDraw();
mc._x = __ownerPlayer.renderx;
mc._y = __ownerPlayer.rendery - 25;
angle = Math.atan2(_ymouse - mc._y, _xmouse - mc._x) * 57.2957795130823;
if (angle < 0) {
angle = angle + 360;
}
if (isLeft) {
if ((angle < 180) || (angle > __LEFT_MAX)) {
angle = __LEFT_MAX;
} else if (angle < __LEFT_MIN) {
angle = __LEFT_MIN;
}
} else if (angle > __RIGHT_MAX) {
angle = __RIGHT_MAX;
} else if (angle < __RIGHT_MIN) {
angle = __RIGHT_MIN;
}
mc._rotation = angle;
if (isCharging) {
charge = charge + ((__CHARGE_RATE * dt) * __chargeDir);
if (charge > __MAX_CHARGE) {
charge = __MAX_CHARGE;
__chargeDir = __chargeDir * -1;
}
if (charge < 0) {
charge = 0;
__chargeDir = __chargeDir * -1;
}
mc.arrow_mc.meter_mc.gotoAndStop(Math.ceil((charge / __MAX_CHARGE) * 100));
}
}
function startCharge() {
isCharging = true;
}
function endCharge() {
isCharging = false;
mc.gotoAndStop(mc._totalFrames);
}
function onDraw(pNewMC) {
super.onDraw(pNewMC);
mc.gotoAndStop("idle");
}
function translateChargeToMagnitude() {
return(330 + (charge * 4.25));
}
function translateAngle() {
return(angle - 3);
}
function getAngleAsRatio() {
if (isLeft) {
return((angle - __LEFT_MIN) / (__LEFT_MAX - __LEFT_MIN));
}
return((angle - __RIGHT_MIN) / (__RIGHT_MAX - __RIGHT_MIN));
}
var TYPE = "arrow";
var DRAWTYPE = "arrow";
var __DEF_ASSET = "arrow_mc";
var __DEF_WIDTH = 40;
var __DEF_HEIGHT = 100;
var __USE_ACTUAL_DIMENSIONS = false;
var CUSTOMDRAW = true;
var __3D_SCALE = false;
var __CHARGE_RATE = 70;
var __MAX_CHARGE = 100;
var __LEFT_MIN = 285;
var __LEFT_MAX = 335;
var __RIGHT_MIN = 209;
var __RIGHT_MAX = 259;
}
Symbol 1311 MovieClip [__Packages.smashing.sound.SoundEngine] Frame 0
class smashing.sound.SoundEngine
{
var __mc, o_sounds, o_groups, __a_soundQueue, __flag_muted, __flag_overwrite, __groupCount, __callbackPath, __callbackFunc;
function SoundEngine () {
}
function generateSounds(t_path, t_depth, t_overwrite) {
if (t_path == undefined) {
trace("Sound Engine Error - no path movieclip supplied!");
}
__mc = t_path.createEmptyMovieClip(__DEFAULTMCNAME, t_depth);
o_sounds = {};
o_groups = {};
__a_soundQueue = [];
__flag_muted = false;
if (t_overwrite == undefined) {
t_overwrite = false;
}
__flag_overwrite = t_overwrite;
__groupCount = 0;
createGroup(__DEFAULTGROUPNAME);
trace("-- Init Sound Engine -- ");
}
function setCallback(path, func) {
__callbackPath = path;
__callbackFunc = func;
}
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, doCallback) {
var _local4;
if (((t_groupName == undefined) || (t_groupName == "")) || (t_groupName == null)) {
_local4 = o_groups[__DEFAULTGROUPNAME];
} else {
_local4 = o_groups[t_groupName];
}
if (_local4 != undefined) {
var _local2 = {};
_local2.soundEffect = new Sound(_local4);
_local2.soundEffect.attachSound(t_assetID);
if (doCallback == undefined) {
doCallback = false;
}
_local2.doCallback = doCallback;
o_sounds[t_name] = _local2;
} else {
trace(("Error Locating Group " + t_groupName) + " for create Sound");
}
}
function playSound(t_soundName, t_loops, t_queued) {
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();
}
if (t_queued == true) {
__a_soundQueue[0].doCallback = _local2.doCallback;
_local2.soundEffect.onSoundComplete = mx.utils.Delegate.create(this, onQueuedSoundComplete);
} else if (_local2.doCallback) {
_local2.soundEffect.owner = this;
_local2.soundEffect.myName = t_soundName;
_local2.soundEffect.onSoundComplete = function () {
this.owner.onCallbackSoundComplete(this.myName);
};
}
_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 stopAll() {
clearQueue();
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 callbackSound(t_soundName, t_loops, path, func) {
playSound(t_soundName, t_loops, false);
var _local2 = o_sounds[t_soundName];
_local2.soundEffect.cbpath = path;
_local2.soundEffect.cbfunc = func;
_local2.soundEffect.onSoundComplete = function () {
this.onSoundComplete = null;
this.cbpath[func]();
};
}
function onCallbackSoundComplete(name) {
__callbackPath[__callbackFunc](name);
}
function queueSound(t_soundName) {
__a_soundQueue.push({soundName:t_soundName, isPlaying:false, doCallback:false});
__playQueue();
}
function __playQueue() {
if (__a_soundQueue.length == 0) {
return(undefined);
}
if (!__a_soundQueue[0].isPlaying) {
playSound(__a_soundQueue[0].soundName, 1, true);
__a_soundQueue[0].isPlaying = true;
}
}
function onQueuedSoundComplete() {
if (__a_soundQueue[0].doCallback) {
onCallbackSoundComplete(__a_soundQueue[0].soundName);
}
__a_soundQueue.splice(0, 1);
__playQueue();
}
function clearQueue() {
__a_soundQueue = [__a_soundQueue[0]];
}
function get queueLength() {
return(__a_soundQueue.length);
}
function get isQueuePlaying() {
if (__a_soundQueue.length == 0) {
return(false);
}
return(true);
}
var __DEFAULTMCNAME = "soundEngine_MC";
var __DEFAULTGROUPNAME = "sound";
}
Symbol 1312 MovieClip [__Packages.mx.utils.Delegate] Frame 0
class mx.utils.Delegate extends Object
{
var func;
function Delegate (f) {
super();
func = f;
}
static function create(obj, func) {
var _local2 = function () {
var _local2 = arguments.callee.target;
var _local3 = arguments.callee.func;
return(_local3.apply(_local2, arguments));
};
_local2.target = obj;
_local2.func = func;
return(_local2);
}
function createDelegate(obj) {
return(create(obj, func));
}
}
Symbol 1313 MovieClip [__Packages.nick.avatar.fortressfight2.Sounds] Frame 0
class nick.avatar.fortressfight2.Sounds extends smashing.sound.SoundEngine
{
static var __instance;
var createGroup, createSound, changeVolume, muteMusic, __currentMusic, muteSound, queueSound, callbackSound, stopSound, __get__isQueuePlaying;
function Sounds () {
super();
}
static function init() {
__instance = new nick.avatar.fortressfight2.Sounds();
}
static function getInstance() {
return(__instance);
}
function generateSounds(path) {
super.generateSounds(path, __DEPTH, __DO_OVERWRITE);
createGroup("music");
createSound("music1", "AvatarLoop1_050801.wav", "music");
changeVolume(60);
muteMusic = false;
__currentMusic = "";
}
function playSound(name, loops) {
if (muteSound == true) {
return(undefined);
}
super.playSound(name, loops);
}
function p(name) {
playSound(name, 1);
}
function q(name) {
queueSound(name);
}
function c(name, cbpath, cbfunc) {
callbackSound(name, 1, cbpath, cbfunc);
}
function playMusic(name) {
if (muteMusic) {
__currentMusic = name;
return(undefined);
}
if (name == undefined) {
name = __currentMusic;
}
if ((__currentMusic != "") && (__currentMusic != undefined)) {
stopMusic();
}
__currentMusic = name;
playSound(__currentMusic, 0);
}
function stopMusic() {
stopSound(__currentMusic);
}
function playOptional(t_name) {
if (!__get__isQueuePlaying()) {
queueSound(t_name);
}
}
var __DEPTH = 20;
var __DO_OVERWRITE = false;
}
Symbol 1314 MovieClip [__Packages.nick.avatar.fortressfight2.ui.UI] Frame 0
class nick.avatar.fortressfight2.ui.UI
{
static var __instance;
var engine, __nextScreenID, __hasActiveScreen, __doesActiveScreenUpdate, __activeScreen, __previousScreenID, __activeScreenID;
function UI () {
}
static function init() {
__instance = new nick.avatar.fortressfight2.ui.UI();
}
static function getInstance() {
return(__instance);
}
function linkEngine(t_engine) {
engine = t_engine;
smashing.rampage.Messenger.registerAddress("ui", this);
}
function reset() {
__nextScreenID = "";
__hasActiveScreen = false;
__doesActiveScreenUpdate = false;
}
function update(dt) {
if (__doesActiveScreenUpdate) {
__activeScreen.update(dt);
}
}
function returnToPreviousScreen() {
__nextScreenID = __previousScreenID;
__activeScreen.close();
}
function goScreen(id) {
if (__hasActiveScreen) {
__nextScreenID = id;
__activeScreen.close();
} else {
openScreen(id);
}
}
function openScreen(id) {
if (id == undefined) {
id = __nextScreenID;
}
if (id == "") {
return(undefined);
}
__nextScreenID = "";
__previousScreenID = __activeScreenID;
__activeScreenID = id;
engine.gotoAndStop(__activeScreenID);
switch (__activeScreenID) {
case "splash" :
__activeScreen = new nick.avatar.fortressfight2.ui.Splash(engine.screen_mc, this);
break;
case "gameplay" :
__activeScreen = new nick.avatar.fortressfight2.ui.GamePlay(engine.screen_mc, this);
break;
case "select" :
__activeScreen = new nick.avatar.fortressfight2.ui.Select(engine.screen_mc, this);
break;
case "end" :
__activeScreen = new nick.avatar.fortressfight2.ui.End(engine.screen_mc, this);
break;
case "shop" :
__activeScreen = new nick.avatar.fortressfight2.ui.Shop(engine.screen_mc, this);
break;
case "highscore" :
__activeScreen = new nick.avatar.fortressfight2.ui.Highscores(engine.highscore_mc, this);
break;
default :
trace("[UI] openScreen called with invalid id: " + __activeScreenID);
return(undefined);
}
smashing.rampage.Messenger.registerAddress("screen", __activeScreen);
__activeScreen.init();
__activeScreen.open();
__hasActiveScreen = true;
__doesActiveScreenUpdate = __activeScreen.DOES_UPDATE;
}
function onScreenClosed() {
if (__nextScreenID != "") {
openScreen(__nextScreenID);
}
}
function goScreenRemote(t_data) {
if (t_data.screen == undefined) {
trace("Error: Go screen remote requires data format {screen:string}");
return(undefined);
}
goScreen(t_data.screen);
}
function onMessageReceived(message, args) {
this[message](args);
}
function get currentScreenID() {
return(__activeScreenID);
}
}
Symbol 1315 MovieClip [__Packages.nick.avatar.fortressfight2.ui.Screen] Frame 0
class nick.avatar.fortressfight2.ui.Screen
{
var __mc, ui, __outroCallbackID, __outroCallbackPath, __isOpening, __isClosing, __isClosed, __outroCallbackArgs;
function Screen (mc, t_ui) {
__mc = mc;
ui = t_ui;
__outroCallbackID = (__outroCallbackPath = "");
}
function update(dt) {
if (__isOpening) {
if (__mc._currentFrame >= __OPENED_FRAME) {
onOpened();
}
} else if (__isClosing) {
if (__mc._currentFrame == __mc._totalFrames) {
onClosed();
}
}
}
function init() {
__isOpening = (__isClosing = false);
__isClosed = true;
}
function open() {
__isClosed = false;
if (__HAS_INTRO) {
__isOpening = true;
__mc.gotoAndPlay(__INTRO_FRAME);
} else {
onOpened();
}
}
function onOpened() {
__isOpening = false;
__mc.gotoAndStop(__OPENED_FRAME);
}
function close() {
if (__isClosed) {
ui.onScreenClosed();
return(undefined);
}
if (__HAS_OUTRO) {
__isClosing = true;
__mc.gotoAndPlay(__OUTRO_FRAME);
} else {
onClosed();
}
}
function onClosed() {
__isClosing = false;
__isClosed = true;
if (__outroCallbackID != "") {
smashing.rampage.Messenger.sendMessage(__outroCallbackPath, __outroCallbackID, __outroCallbackArgs);
__outroCallbackID = (__outroCallbackPath = "");
} else {
ui.onScreenClosed();
}
}
function closeThenCallback(callbackPath, callbackID, callbackArgs) {
__outroCallbackPath = callbackPath;
__outroCallbackID = callbackID;
__outroCallbackArgs = callbackArgs;
close();
}
function makeButton(mc) {
mc.screen = this;
}
function onMessageReceived(message, args) {
this[message](args);
}
function toString() {
return("Screen");
}
var __INTRO_FRAME = "intro";
var __OUTRO_FRAME = "outro";
var __HAS_INTRO = false;
var __HAS_OUTRO = false;
var __OPENED_FRAME = 10;
var DOES_UPDATE = true;
}
Symbol 1316 MovieClip [__Packages.nick.avatar.fortressfight2.ui.Splash] Frame 0
class nick.avatar.fortressfight2.ui.Splash extends nick.avatar.fortressfight2.ui.Screen
{
var __mc;
function Splash (mc, ui) {
super(mc, ui);
}
function onOpened() {
super.onOpened();
__mc.btn_1.onRelease = function () {
smashing.rampage.Messenger.sendMessage("engine", "onSelectSingleMode");
};
__mc.btn_2.onRelease = function () {
smashing.rampage.Messenger.sendMessage("engine", "onSelectVersusMode");
};
__mc.btn_view.onRelease = function () {
smashing.rampage.Messenger.sendMessage("engine", "onPressViewScores");
};
}
var __HAS_INTRO = false;
var __HAS_OUTRO = false;
var __OPENED_FRAME = 1;
}
Symbol 1317 MovieClip [__Packages.nick.avatar.fortressfight2.ui.GamePlay] Frame 0
class nick.avatar.fortressfight2.ui.GamePlay extends nick.avatar.fortressfight2.ui.Screen
{
var __UIState, __state, __isMenuOpen, __menuCallback, __mc, __isOpening, __loop;
function GamePlay (mc, ui, fromHelpScreen) {
super(mc, ui);
__UIState = "";
__state = nick.avatar.fortressfight2.GameState.getInstance();
__isMenuOpen = false;
__menuCallback = "";
}
function onOpened() {
hideRollOver();
__mc.leftInterface.interface_mc.gotoAndStop(__state.kingdom2);
__mc.leftInterface.interface_mc.gotoAndStop(__state.kingdom1);
__isOpening = false;
update(0, true);
}
function openPowers() {
if (!canCurrentUsePowers()) {
openWeapons();
return(undefined);
}
if (__isMenuOpen) {
__menuCallback = "openPowers";
return(undefined);
}
hideRollOver();
hidePopup();
var _local2 = ((__state.turn == 1) ? (__mc.leftInterface) : (__mc.rightInterface));
if (__UIState == "weapons") {
_local2.gotoAndPlay("closeWeapon");
_local2.followUp = "backToPower";
} else {
_local2.gotoAndPlay("openPower");
_local2.followUp = "";
}
__UIState = "powers";
_local2.btn.useHandCursor = false;
}
function closePowers() {
hideRollOver();
var _local2 = ((__state.turn == 1) ? (__mc.leftInterface) : (__mc.rightInterface));
_local2.gotoAndPlay("closePower");
_local2.followUp = "";
__UIState = "";
}
function openWeapons() {
if (__isMenuOpen) {
__menuCallback = "openWeapons";
return(undefined);
}
hideRollOver();
hidePopup();
var _local2 = ((__state.turn == 1) ? (__mc.leftInterface) : (__mc.rightInterface));
if (__UIState == "powers") {
_local2.gotoAndPlay("closePower");
_local2.followUp = "openWeapon";
} else {
_local2.gotoAndPlay("openWeapon");
_local2.followUp = "";
}
__UIState = "weapons";
_local2.btn.useHandCursor = false;
}
function closeWeapons() {
hideRollOver();
var _local2 = ((__state.turn == 1) ? (__mc.leftInterface) : (__mc.rightInterface));
_local2.gotoAndPlay("closeWeapon");
_local2.followUp = "";
__UIState = "";
}
function canCurrentUsePowers() {
var _local3 = ((__state.turn == 1) ? (__state.playerOne) : (__state.playerTwo));
var _local4 = 4;
do {
var _local2 = nick.avatar.fortressfight2.Library.retrievePowerCost(((__state.turn == 1) ? (__state.kingdom1) : (__state.kingdom2)), _local4);
trace(["cost", _local3.power, _local2]);
if ((_local2 != null) && (_local3.power >= _local2)) {
return(true);
}
_local4--;
} while (_local4 > 0);
return(false);
}
function prepPowers() {
var _local5 = ((__state.turn == 1) ? (__state.playerOne) : (__state.playerTwo));
var _local4 = ((__state.turn == 1) ? (__mc.leftInterface) : (__mc.rightInterface));
_local4.interface_mc.gotoAndStop(((__state.turn == 1) ? (__state.kingdom1) : (__state.kingdom2)));
_local4.interface_mc.skip_btn.onRelease = function () {
smashing.rampage.Messenger.sendMessage("screen", "onPressSkipPower");
};
_local4.interface_mc.skip_btn.onRollOver = function () {
smashing.rampage.Messenger.sendMessage("screen", "hideRollOver");
};
_local4.interface_mc.bendingMeter_mc.powerbar_mc.gotoAndStop(100 - (_local5.power - 1));
_local4.interface_mc.bendingMeter_mc.percent_txt.text = "Bending Power: " + _local5.power;
trace("power " + _local5.power);
var _local2;
var _local3 = 1;
while (_local3 < 4) {
_local2 = nick.avatar.fortressfight2.Library.retrievePowerCost(((__state.turn == 1) ? (__state.kingdom1) : (__state.kingdom2)), _local3);
_local2 = _local2 * _local5.bendingMultiplier;
if (__state.battlegroundKingdom == "air") {
_local2 = _local2 - 10;
} else if (__state.battlegroundKingdom == "earth") {
_local2 = _local2 + 10;
}
_local2 = Math.floor(_local2 / 10) * 10;
if (_local2 > 100) {
_local2 = 100;
}
if (_local2 <= _local5.power) {
generatePowerButton(_local4.interface_mc["spell" + _local3], _local3);
} else {
killButton(_local4.interface_mc["spell" + _local3]);
}
populatePowerCost(_local2, _local4.interface_mc["cost" + _local3], _local3);
_local3++;
}
}
function populatePowerCost(pCost, pText, pNum) {
pText.text = "Cost: " + pCost;
}
function clearPowers() {
var _local3 = ((__state.turn == 1) ? (__mc.leftInterface) : (__mc.rightInterface));
_local3.interface_mc.skip_btn.onRelease = function () {
};
hideRollOver();
var _local2 = 1;
while (_local2 < 4) {
_local3.interface_mc["spell" + _local2].onRelease = function () {
};
_local3.interface_mc["spell" + _local2].onRollOver = function () {
};
_local2++;
}
}
function prepWeapons() {
var _local4 = ((__state.turn == 1) ? (__state.playerOne) : (__state.playerTwo));
var _local3 = ((__state.turn == 1) ? (__mc.leftInterface) : (__mc.rightInterface));
var _local2 = 0;
while (_local2 < 4) {
if (_local4["ammo" + _local2] > 0) {
generateWeaponButton(_local3.interface_mc["weap" + _local2], _local2);
} else {
killButton(_local3.interface_mc["weap" + _local2]);
}
if (_local2 > 0) {
populateAmmoCount(_local3.interface_mc["countBox" + _local2], _local4["ammo" + _local2]);
}
_local2++;
}
}
function populateAmmoCount(pMc, pNum) {
if (pNum < 10) {
pMc.score1.gotoAndStop(1);
pMc.score0.gotoAndStop(pNum + 1);
} else {
pMc.score1.gotoAndStop(1 + Math.floor(pNum / 10));
pMc.score0.gotoAndStop((pNum % 10) + 1);
}
}
function clearWeapons() {
var _local3 = ((__state.turn == 1) ? (__mc.leftInterface) : (__mc.rightInterface));
_local3.interface_mc.skip_btn.onRelease = function () {
};
hideRollOver();
var _local2 = 0;
while (_local2 < 4) {
_local3.interface_mc["weap" + _local2].onRelease = function () {
};
_local3.interface_mc["weap" + _local2].onRollOver = function () {
};
_local2++;
}
}
function onPressSkipPower(pData) {
smashing.rampage.Messenger.sendMessage("world", "onSkipPower");
}
function onPressPower(pData) {
smashing.rampage.Messenger.sendMessage("world", "onSelectPower", {num:pData.num});
clearPowers();
}
function onPressWeapon(pData) {
smashing.rampage.Messenger.sendMessage("world", "onSelectWeapon", {num:pData.num});
clearWeapons();
}
function onRollOverPower(pData) {
var _local3 = ((__state.turn == 1) ? 470 : 660);
__mc.tooltip_mc._visible = true;
__mc.tooltip_mc._x = _local3 + ((pData.num - 1) * 115);
__mc.tooltip_mc._y = 280;
var _local2 = nick.avatar.fortressfight2.Library.retrievePowerDescription(((__state.turn == 1) ? (__state.kingdom1) : (__state.kingdom2)), pData.num);
__mc.tooltip_mc.txt_name.text = _local2.name;
__mc.tooltip_mc.txt_description.text = _local2.desc;
}
function onRollOverWeapon(pData) {
var _local3 = ((__state.turn == 1) ? 470 : 580);
__mc.tooltip_mc._visible = true;
__mc.tooltip_mc._x = _local3 + (pData.num * 100);
__mc.tooltip_mc._y = 280;
var _local2 = nick.avatar.fortressfight2.Library.retrieveWeaponDescription(((__state.turn == 1) ? (__state.kingdom1) : (__state.kingdom2)), pData.num);
__mc.tooltip_mc.txt_name.text = _local2.name;
__mc.tooltip_mc.txt_description.text = _local2.desc;
}
function hideRollOver() {
__mc.tooltip_mc._x = -600;
__mc.tooltip_mc._visible = false;
}
function generatePowerButton(pMC, pNum) {
pMC.useHandCursor = true;
pMC._alpha = 100;
pMC.onRelease = function () {
smashing.rampage.Messenger.sendMessage("screen", "onPressPower", {num:pNum});
};
pMC.onRollOver = function () {
smashing.rampage.Messenger.sendMessage("screen", "onRollOverPower", {num:pNum});
};
pMC.onRollOut = function () {
smashing.rampage.Messenger.sendMessage("screen", "hideRollOver");
};
pMC.createEmptyMovieClip("hitrect", 1);
pMC.beginFill(0, 0);
pMC.moveTo(-10, 0);
pMC.lineTo(80, 0);
pMC.lineTo(80, 90);
pMC.lineTo(-10, 90);
pMC.lineTo(-10, 0);
}
function generateWeaponButton(pMC, pNum) {
pMC.useHandCursor = true;
pMC._alpha = 100;
pMC.onRelease = function () {
smashing.rampage.Messenger.sendMessage("screen", "onPressWeapon", {num:pNum});
};
pMC.onRollOver = function () {
smashing.rampage.Messenger.sendMessage("screen", "onRollOverWeapon", {num:pNum});
};
pMC.onRollOut = function () {
smashing.rampage.Messenger.sendMessage("screen", "hideRollOver");
};
pMC.createEmptyMovieClip("hitrect", 1);
pMC.beginFill(0, 0);
pMC.moveTo(-10, 0);
pMC.lineTo(80, 0);
pMC.lineTo(80, 90);
pMC.lineTo(-10, 90);
pMC.lineTo(-10, 0);
}
function killButton(pMC) {
pMC.useHandCursor = false;
pMC.onRelease = function () {
};
pMC.onRollOver = function () {
};
pMC._alpha = 50;
if (pMC.hittect != undefined) {
pMC.hitrect.removeMovieClip();
}
}
function update(dt, forceUpdate) {
if (__state.hasChanged || (forceUpdate == true)) {
__mc.leftInterface.interface_mc.gotoAndStop(__state.kingdom1);
__mc.leftInterface.interface_mc.healthMeter.gotoAndStop(101 - Math.ceil(100 * __state.playerOne.getHealthAsPercent()));
__mc.rightInterface.interface_mc.gotoAndStop(__state.kingdom2);
__mc.rightInterface.interface_mc.healthMeter.gotoAndStop(101 - Math.ceil(100 * __state.playerTwo.getHealthAsPercent()));
__loop = 0;
while (__loop < 6) {
__mc.leftInterface.interface_mc.score_mc["score" + __loop].gotoAndStop(Math.floor(((__state.score1 % Math.pow(10, __loop + 1)) / Math.pow(10, __loop + 1)) * 10) + 1);
__loop++;
}
__loop = 0;
while (__loop < 6) {
__mc.rightInterface.interface_mc.score_mc["score" + __loop].gotoAndStop(Math.floor(((__state.score2 % Math.pow(10, __loop + 1)) / Math.pow(10, __loop + 1)) * 10) + 1);
__loop++;
}
__state.hasChanged = false;
}
if (__state.goldChanged) {
if (__mc.gold_mc._currentFrame < 5) {
__mc.gold_mc.gotoAndPlay("on");
} else {
__mc.gold_mc.gotoAndPlay("repeat");
}
__mc.gold_mc.gold_txt.text = __state.gold;
__state.goldChanged = false;
}
}
function playPowerIntro() {
var _local2 = ((__state.turn == 1) ? (__state.kingdom1) : (__state.kingdom2));
var _local3 = ((__state.turn == 1) ? (__mc.leftInterface) : (__mc.rightInterface));
_local3[_local2 + "Bending"].gotoAndPlay("ani");
}
function onOpenMenu() {
__isMenuOpen = true;
hideRollOver();
smashing.rampage.Messenger.sendMessage("engine", "pauseInGame");
__mc.menu_mc.gotoAndPlay("open");
__mc.menu_mc.menu_mc.btn_resume.onRelease = function () {
smashing.rampage.Messenger.sendMessage("screen", "onPressMenuResume");
};
__mc.menu_mc.menu_mc.btn_help.onRelease = function () {
smashing.rampage.Messenger.sendMessage("screen", "onPressMenuHelp");
};
__mc.menu_mc.menu_mc.btn_soundOn.onRelease = function () {
smashing.rampage.Messenger.sendMessage("screen", "onPressMenuSound");
};
__mc.menu_mc.menu_mc.btn_soundOff.onRelease = function () {
smashing.rampage.Messenger.sendMessage("screen", "onPressMenuSound");
};
__mc.menu_mc.menu_mc.btn_quit.onRelease = function () {
smashing.rampage.Messenger.sendMessage("screen", "onPressMenuQuit");
};
__mc.menu_mc.menu_mc.btn_soundOn._visible = !smashing.rampage.Messenger.getAddress("engine").__sounds.muteMusic;
trace(smashing.rampage.Messenger.getAddress("engine").__sounds.muteMusic);
}
function onPressMenuResume() {
__isMenuOpen = false;
smashing.rampage.Messenger.sendMessage("engine", "unpauseInGame");
__mc.menu_mc.gotoAndPlay("close");
if (__menuCallback != "") {
this[__menuCallback]();
__menuCallback = "";
}
}
function onPressMenuHelp() {
showHelp();
}
function onPressMenuSound() {
if (__mc.menu_mc.menu_mc.btn_soundOn._visible == true) {
__mc.menu_mc.menu_mc.btn_soundOn._visible = false;
} else {
__mc.menu_mc.menu_mc.btn_soundOn._visible = true;
}
smashing.rampage.Messenger.sendMessage("engine", "toggleMusic");
}
function onPressMenuQuit() {
showQuit();
}
function createHelpPowerButton(pData) {
var _local2 = pData.mc;
_local2.kingdom = pData.kingdom;
_local2.num = pData.num;
_local2.windowY = pData.y;
_local2.onRollOver = function () {
smashing.rampage.Messenger.sendMessage("screen", "onRollOverHelpPower", {kingdom:this.kingdom, num:this.num, mc:this, y:this.windowY});
};
_local2.onRollOut = function () {
smashing.rampage.Messenger.sendMessage("screen", "onRollOutHelp");
};
_local2.onDragOut = function () {
smashing.rampage.Messenger.sendMessage("screen", "onRollOutHelp");
};
_local2.useHandCursor = false;
}
function onRollOverHelpPower(pData) {
var _local2 = __mc.menus_mc.display_mc.tooltip_mc;
_local2._x = pData.mc._x - 125;
_local2._y = pData.y;
var _local3 = nick.avatar.fortressfight2.Library.retrievePowerDescription(pData.kingdom, pData.num);
_local2.txt_name.text = _local3.name;
_local2.txt_description.text = _local3.desc;
}
function createHelpWeaponButton(pData) {
var _local2 = pData.mc;
_local2.kingdom = pData.kingdom;
_local2.num = pData.num;
_local2.windowY = pData.y;
_local2.onRollOver = function () {
smashing.rampage.Messenger.sendMessage("screen", "onRollOverHelpWeapon", {kingdom:this.kingdom, num:this.num, mc:this, y:this.windowY});
};
_local2.onRollOut = function () {
smashing.rampage.Messenger.sendMessage("screen", "onRollOutHelp");
};
_local2.onDragOut = function () {
smashing.rampage.Messenger.sendMessage("screen", "onRollOutHelp");
};
_local2.useHandCursor = false;
}
function onRollOverHelpWeapon(pData) {
var _local2 = __mc.menus_mc.display_mc.tooltip_mc;
_local2._x = pData.mc._x - 115;
_local2._y = pData.y;
var _local3 = nick.avatar.fortressfight2.Library.retrieveWeaponDescription(pData.kingdom, pData.num);
_local2.txt_name.text = _local3.name;
_local2.txt_description.text = _local3.desc;
}
function onRollOutHelp(pData) {
__mc.menus_mc.display_mc.tooltip_mc._y = -200;
}
function hidePopup() {
__mc.menus_mc.gotoAndStop("off");
}
function onScrollClose() {
hidePopup();
}
function showIntro(pData) {
__mc.menus_mc.gotoAndStop("levelintro");
__mc.menus_mc.intro_mc.gotoAndPlay("on");
__mc.menus_mc.intro_mc.levelIntro.gotoAndStop(pData.bg);
if (__state.mode == 1) {
__mc.menus_mc.intro_mc.levelIntro.txt_level.text = "level " + __state.levelNum;
} else {
__mc.menus_mc.intro_mc.levelIntro.txt_level.text = "Fight!";
}
}
function requestIntroComplete() {
smashing.rampage.Messenger.sendMessage("world", "onRespondIntroComplete", {success:__mc.menus_mc.intro_mc._currentFrame < 5});
}
function showHelp() {
__mc.menus_mc.gotoAndStop("help");
}
function showQuit() {
__mc.menus_mc.gotoAndStop("quit");
}
var DOES_UPDATE = true;
}
Symbol 1318 MovieClip [__Packages.nick.avatar.fortressfight2.ui.Select] Frame 0
class nick.avatar.fortressfight2.ui.Select extends nick.avatar.fortressfight2.ui.Screen
{
var __state, __mc;
function Select (mc, ui) {
super(mc, ui);
__state = nick.avatar.fortressfight2.GameState.getInstance();
if (__state.mode == 1) {
__mc.txt_header.text = "Choose your fortress";
}
}
function onOpened() {
super.onOpened();
__mc.btn_water.onRelease = function () {
smashing.rampage.Messenger.sendMessage("engine", "onSelectKingdom", {kingdom:"water"});
};
__mc.btn_earth.onRelease = function () {
smashing.rampage.Messenger.sendMessage("engine", "onSelectKingdom", {kingdom:"earth"});
};
__mc.btn_fire.onRelease = function () {
smashing.rampage.Messenger.sendMessage("engine", "onSelectKingdom", {kingdom:"fire"});
};
adaptForPlayerTwo();
}
function adaptForPlayerTwo() {
if (__state.kingdom1 != "") {
__mc.txt_header.text = "Player 2 choose your fortress";
if (__state.kingdom1 == "water") {
__mc.btn_water._visible = false;
} else if (__state.kingdom1 == "earth") {
__mc.btn_earth._visible = false;
} else if (__state.kingdom1 == "fire") {
__mc.btn_fire._visible = false;
}
}
}
var __HAS_INTRO = false;
var __HAS_OUTRO = false;
var __OPENED_FRAME = 1;
}
Symbol 1319 MovieClip [__Packages.nick.avatar.fortressfight2.ui.End] Frame 0
class nick.avatar.fortressfight2.ui.End extends nick.avatar.fortressfight2.ui.Screen
{
var __state, __mc;
function End (mc, ui) {
super(mc, ui);
__state = nick.avatar.fortressfight2.GameState.getInstance();
}
function onOpened() {
super.onOpened();
var _local3 = (((!__state.quitGame) && (__state.turn == 1)) ? (__state.kingdom1) : (__state.kingdom2));
__mc.gotoAndStop(_local3);
__mc.btn_playAgain.onRelease = function () {
smashing.rampage.Messenger.sendMessage("engine", "onPressPlayAgain");
};
if (__state.mode == 1) {
if (nick.highscores.HighscoreEngine.__get__isLoggedIn()) {
__mc.btn_submit.onRelease = function () {
smashing.rampage.Messenger.sendMessage("engine", "onPressGameOverSubmitScore");
};
} else {
__mc.btn_submit._visible = false;
}
__mc.btn_view.onRelease = function () {
smashing.rampage.Messenger.sendMessage("engine", "onPressViewScores");
};
if (_local3 != __state.kingdom1) {
__mc.header.gotoAndStop("lose");
}
} else {
__mc.btn_submit._visible = false;
__mc.btn_view._visible = false;
}
}
var __HAS_INTRO = false;
var __HAS_OUTRO = false;
var __OPENED_FRAME = 1;
}
Symbol 1320 MovieClip [__Packages.nick.avatar.fortressfight2.ui.Shop] Frame 0
class nick.avatar.fortressfight2.ui.Shop extends nick.avatar.fortressfight2.ui.Screen
{
var __state, __mc, __player;
function Shop (mc, ui) {
super(mc, ui);
}
function onOpened() {
super.onOpened();
__state = nick.avatar.fortressfight2.GameState.getInstance();
__mc.gotoAndStop(__state.kingdom1);
__mc.txt_level.text = "level " + __state.levelNum;
__mc.txt_score.text = "score: " + __state.score1;
__mc.btn_next.onRelease = function () {
smashing.rampage.Messenger.sendMessage("engine", "goNextMatch");
};
__player = __state.playerOne;
hideRollOver();
onRefreshShop();
}
function onRefreshShop() {
hideRollOver();
__mc.txt_gold.text = __state.gold;
if (__player.getIsTowerDestroyed()) {
__mc.tower_mc._visible = false;
__mc.repairCost1.text = ("Repair Cost: " + __state.REPAIR_TOWER_COST) + "g";
if (__state.REPAIR_TOWER_COST > __state.gold) {
__mc.btn_repair0._visible = false;
__mc.btn_repair0.onRelease = function () {
};
} else {
__mc.btn_repair0.onRelease = function () {
smashing.rampage.Messenger.sendMessage("screen", "onPressRepairTower");
};
}
__mc.btn_repair0.onRollOver = function () {
smashing.rampage.Messenger.sendMessage("screen", "onRollOverTower");
};
__mc.btn_repair0.onRollOut = function () {
smashing.rampage.Messenger.sendMessage("screen", "hideRollOver");
};
__mc.btn_repair0.onDragOut = function () {
smashing.rampage.Messenger.sendMessage("screen", "hideRollOver");
};
} else {
__mc.tower_mc._visible = true;
__mc.repairCost1.text = "";
__mc.btn_repair0._visible = false;
}
if (__player.getIsArmoryDestroyed()) {
__mc.armory_mc._visible = false;
__mc.repairCost3.text = ("Repair Cost: " + __state.REPAIR_ARMORY_COST) + "g";
if (__state.REPAIR_ARMORY_COST > __state.gold) {
__mc.btn_repair2._visible = false;
__mc.btn_repair2.onRelease = function () {
};
} else {
__mc.btn_repair2.onRelease = function () {
smashing.rampage.Messenger.sendMessage("screen", "onPressRepairArmory");
};
}
__mc.btn_repair2.onRollOver = function () {
smashing.rampage.Messenger.sendMessage("screen", "onRollOverArmory");
};
__mc.btn_repair2.onRollOut = function () {
smashing.rampage.Messenger.sendMessage("screen", "hideRollOver");
};
__mc.btn_repair2.onDragOut = function () {
smashing.rampage.Messenger.sendMessage("screen", "hideRollOver");
};
} else {
__mc.armory_mc._visible = true;
__mc.repairCost3.text = "";
__mc.btn_repair2._visible = false;
}
var _local6 = __player.getHealthAsPercent();
var _local4 = Math.ceil(__state.REPAIR_KEEP_COST * (1 - _local6));
if (_local6 < 1) {
__mc.createEmptyMovieClip("keepmask_mc", 10000);
__mc.keepmask_mc.beginFill(16711680);
__mc.keepmask_mc.moveTo(331, 218);
__mc.keepmask_mc.lineTo(480, 218);
__mc.keepmask_mc.lineTo(480, 218 - (_local6 * 98));
__mc.keepmask_mc.lineTo(331, 218 - (_local6 * 98));
__mc.keepmask_mc.lineTo(331, 218);
__mc.keepmask_mc.endFill();
__mc.fortress_mc.setMask(__mc.keepmask_mc);
__mc.repairCost2.text = ("Repair Cost: " + _local4) + "g";
if (_local4 > __state.gold) {
__mc.btn_repair1._visible = false;
__mc.btn_repair1.onRelease = function () {
};
} else {
__mc.btn_repair1.onRelease = function () {
smashing.rampage.Messenger.sendMessage("screen", "onPressRepairKeep");
};
}
__mc.btn_repair1.onRollOver = function () {
smashing.rampage.Messenger.sendMessage("screen", "onRollOverKeep");
};
__mc.btn_repair1.onRollOut = function () {
smashing.rampage.Messenger.sendMessage("screen", "hideRollOver");
};
__mc.btn_repair1.onDragOut = function () {
smashing.rampage.Messenger.sendMessage("screen", "hideRollOver");
};
} else {
__mc.fortress_mc.setMask(null);
__mc.keepmask_mc.removeMovieClip();
__mc.repairCost2.text = "";
__mc.btn_repair1._visible = false;
}
var _local2 = 1;
var _local3;
while (_local2 < 4) {
_local4 = __state.AMMO_COST * __player[("ammo" + _local2) + "Value"];
__mc["cost" + _local2].text = ("Cost: " + _local4) + "g";
populateAmmoCount(__mc["box" + (_local2 - 1)], __player["ammo" + _local2]);
_local3 = __mc["btn_buy" + (_local2 - 1)];
if (_local4 > __state.gold) {
_local3._visible = false;
_local3.onRelease = function () {
};
} else {
_local3.weapNum = _local2;
_local3.onRelease = function () {
smashing.rampage.Messenger.sendMessage("screen", "onPressBuyWeapon", {num:this.weapNum});
};
}
_local3.onRollOver = function () {
smashing.rampage.Messenger.sendMessage("screen", "onRollOverWeapon", {num:this.weapNum});
};
_local3.onRollOut = function () {
smashing.rampage.Messenger.sendMessage("screen", "hideRollOver");
};
_local3.onDragOut = function () {
smashing.rampage.Messenger.sendMessage("screen", "hideRollOver");
};
_local2++;
}
}
function populateAmmoCount(pMc, pNum) {
if (pNum < 10) {
pMc.score0.gotoAndStop(pNum + 1);
} else {
pMc.score1.gotoAndStop(1 + Math.floor(pNum / 10));
pMc.score0.gotoAndStop((pNum % 10) + 1);
}
}
function onPressRepairTower() {
__player.onRepairTower();
__state.spendGold(__state.REPAIR_TOWER_COST);
onRefreshShop();
}
function onPressRepairArmory() {
__player.onRepairArmory();
__state.spendGold(__state.REPAIR_ARMORY_COST);
onRefreshShop();
}
function onPressRepairKeep() {
__state.spendGold(Math.ceil(__state.REPAIR_KEEP_COST * (1 - __player.getHealthAsPercent())));
__player.onRepairKeep();
onRefreshShop();
}
function onRollOverTower(pData) {
__mc.tooltip_mc._visible = true;
__mc.tooltip_mc._x = 135;
__mc.tooltip_mc._y = 227;
__mc.tooltip_mc.txt_name.text = "Bending Tower";
__mc.tooltip_mc.txt_description.text = "A functional bending tower will increase the speed at which your Bending Power regenerates.";
}
function onRollOverArmory(pData) {
__mc.tooltip_mc._visible = true;
__mc.tooltip_mc._x = 374;
__mc.tooltip_mc._y = 227;
__mc.tooltip_mc.txt_name.text = "Armory";
__mc.tooltip_mc.txt_description.text = "A functional Armory will increase the damage your Weapons deal by a small amount.";
}
function onRollOverWeapon(pData) {
__mc.tooltip_mc._visible = true;
__mc.tooltip_mc._x = 90 + ((pData.num - 1) * 137);
__mc.tooltip_mc._y = 390;
var _local2 = nick.avatar.fortressfight2.Library.retrieveWeaponDescription(((__state.turn == 1) ? (__state.kingdom1) : (__state.kingdom2)), pData.num);
__mc.tooltip_mc.txt_name.text = _local2.name;
__mc.tooltip_mc.txt_description.text = _local2.desc;
}
function onPressBuyWeapon(pData) {
trace("On Buy Weapon : " + pData.num);
trace("Cost : " + (__state.AMMO_COST * __player[("ammo" + pData.num) + "Value"]));
__player.onPurchaseAmmo(pData.num);
__state.spendGold(__state.AMMO_COST * __player[("ammo" + pData.num) + "Value"]);
onRefreshShop();
}
function hideRollOver() {
__mc.tooltip_mc._x = -600;
__mc.tooltip_mc._visible = false;
}
var __HAS_INTRO = false;
var __HAS_OUTRO = false;
var __OPENED_FRAME = 1;
}
Symbol 1321 MovieClip [__Packages.nick.avatar.fortressfight2.ui.Highscores] Frame 0
class nick.avatar.fortressfight2.ui.Highscores extends nick.avatar.fortressfight2.ui.Screen
{
var __isClosed, __isOpening;
function Highscores (mc, ui) {
super(mc, ui);
}
function open() {
__isClosed = false;
__isOpening = false;
}
function onOpened() {
}
function onBoardClosed() {
smashing.rampage.Messenger.sendMessage("engine", "onHighscoreBoardClosed");
}
var __HAS_INTRO = false;
var __HAS_OUTRO = false;
var __OPENED_FRAME = 1;
}
Symbol 91 MovieClip Frame 1
stop();
Symbol 91 MovieClip Frame 5
stop();
Symbol 91 MovieClip Frame 10
stop();
Symbol 95 MovieClip Frame 1
stop();
Symbol 95 MovieClip Frame 5
stop();
Symbol 95 MovieClip Frame 10
stop();
Symbol 99 MovieClip Frame 1
stop();
Symbol 99 MovieClip Frame 5
stop();
Symbol 99 MovieClip Frame 10
stop();
Symbol 161 MovieClip Frame 1
stop();
Symbol 161 MovieClip Frame 5
stop();
Symbol 161 MovieClip Frame 10
stop();
Symbol 161 MovieClip Frame 15
stop();
Symbol 163 MovieClip Frame 1
stop();
Symbol 163 MovieClip Frame 5
stop();
Symbol 163 MovieClip Frame 10
stop();
Symbol 163 MovieClip Frame 15
stop();
Symbol 165 MovieClip Frame 1
stop();
Symbol 165 MovieClip Frame 5
stop();
Symbol 165 MovieClip Frame 10
stop();
Symbol 165 MovieClip Frame 15
stop();
Symbol 179 MovieClip Frame 1
stop();
Symbol 179 MovieClip Frame 5
stop();
Symbol 179 MovieClip Frame 10
stop();
Symbol 181 MovieClip Frame 1
stop();
Symbol 181 MovieClip Frame 5
stop();
Symbol 181 MovieClip Frame 10
stop();
Symbol 206 MovieClip Frame 1
stop();
Symbol 212 MovieClip Frame 5
stop();
Symbol 213 MovieClip Frame 1
stop();
Symbol 213 MovieClip Frame 5
stop();
Symbol 213 MovieClip Frame 10
stop();
Symbol 234 MovieClip Frame 2
stop();
Symbol 236 MovieClip Frame 2
stop();
Symbol 237 MovieClip Frame 1
stop();
Symbol 237 MovieClip Frame 10
play();
Symbol 237 MovieClip Frame 14
stop();
Symbol 237 MovieClip Frame 20
stop();
Symbol 241 MovieClip Frame 1
stop();
Symbol 241 MovieClip Frame 10
play();
Symbol 241 MovieClip Frame 14
stop();
Symbol 241 MovieClip Frame 20
stop();
Symbol 245 MovieClip Frame 1
stop();
Symbol 245 MovieClip Frame 10
play();
Symbol 245 MovieClip Frame 14
stop();
Symbol 245 MovieClip Frame 20
stop();
Symbol 261 MovieClip Frame 1
stop();
Symbol 261 MovieClip Frame 6
play();
Symbol 261 MovieClip Frame 18
if ((stopLabel == 1) || (stopLabel == undefined)) {
stop();
} else {
play();
}
Symbol 261 MovieClip Frame 19
play();
Symbol 261 MovieClip Frame 31
if ((stopLabel == 2) || (stopLabel == undefined)) {
stop();
} else {
play();
}
Symbol 261 MovieClip Frame 32
play();
Symbol 261 MovieClip Frame 44
if ((stopLabel == 3) || (stopLabel == undefined)) {
stop();
} else {
play();
}
Symbol 261 MovieClip Frame 45
play();
Symbol 261 MovieClip Frame 58
stop();
Symbol 287 MovieClip Frame 22
stop();
Symbol 289 MovieClip Frame 1
stop();
Symbol 289 MovieClip Frame 6
play();
Symbol 289 MovieClip Frame 18
if ((stopLabel == 1) || (stopLabel == undefined)) {
stop();
} else {
play();
}
Symbol 289 MovieClip Frame 19
play();
Symbol 289 MovieClip Frame 31
if ((stopLabel == 2) || (stopLabel == undefined)) {
stop();
} else {
play();
}
Symbol 289 MovieClip Frame 32
play();
Symbol 289 MovieClip Frame 44
if ((stopLabel == 3) || (stopLabel == undefined)) {
stop();
} else {
play();
}
Symbol 289 MovieClip Frame 45
play();
Symbol 289 MovieClip Frame 58
stop();
Symbol 302 MovieClip Frame 1
stop();
Symbol 302 MovieClip Frame 6
play();
Symbol 302 MovieClip Frame 18
if ((stopLabel == 1) || (stopLabel == undefined)) {
stop();
} else {
play();
}
Symbol 302 MovieClip Frame 19
play();
Symbol 302 MovieClip Frame 31
if ((stopLabel == 2) || (stopLabel == undefined)) {
stop();
} else {
play();
}
Symbol 302 MovieClip Frame 32
play();
Symbol 302 MovieClip Frame 44
if ((stopLabel == 3) || (stopLabel == undefined)) {
stop();
} else {
play();
}
Symbol 302 MovieClip Frame 45
play();
Symbol 302 MovieClip Frame 58
stop();
Symbol 309 MovieClip [earth_armory] Frame 1
stop();
Symbol 309 MovieClip [earth_armory] Frame 6
play();
Symbol 309 MovieClip [earth_armory] Frame 21
stop();
Symbol 323 MovieClip Frame 6
stop();
Symbol 327 MovieClip Frame 1
stop();
Symbol 327 MovieClip Frame 10
play();
Symbol 327 MovieClip Frame 14
stop();
Symbol 327 MovieClip Frame 20
stop();
Symbol 331 MovieClip Frame 1
stop();
Symbol 331 MovieClip Frame 10
play();
Symbol 331 MovieClip Frame 14
stop();
Symbol 331 MovieClip Frame 20
stop();
Symbol 335 MovieClip Frame 1
stop();
Symbol 335 MovieClip Frame 10
play();
Symbol 335 MovieClip Frame 14
stop();
Symbol 335 MovieClip Frame 20
stop();
Symbol 342 MovieClip Frame 1
stop();
Symbol 342 MovieClip Frame 6
play();
Symbol 342 MovieClip Frame 18
if ((stopLabel == 1) || (stopLabel == undefined)) {
stop();
} else {
play();
}
Symbol 342 MovieClip Frame 19
play();
Symbol 342 MovieClip Frame 31
if ((stopLabel == 2) || (stopLabel == undefined)) {
stop();
} else {
play();
}
Symbol 342 MovieClip Frame 32
play();
Symbol 342 MovieClip Frame 44
if ((stopLabel == 3) || (stopLabel == undefined)) {
stop();
} else {
play();
}
Symbol 342 MovieClip Frame 45
play();
Symbol 342 MovieClip Frame 58
stop();
Symbol 348 MovieClip Frame 1
stop();
Symbol 348 MovieClip Frame 6
play();
Symbol 348 MovieClip Frame 18
if ((stopLabel == 1) || (stopLabel == undefined)) {
stop();
} else {
play();
}
Symbol 348 MovieClip Frame 19
play();
Symbol 348 MovieClip Frame 31
if ((stopLabel == 2) || (stopLabel == undefined)) {
stop();
} else {
play();
}
Symbol 348 MovieClip Frame 32
play();
Symbol 348 MovieClip Frame 44
if ((stopLabel == 3) || (stopLabel == undefined)) {
stop();
} else {
play();
}
Symbol 348 MovieClip Frame 45
play();
Symbol 348 MovieClip Frame 58
stop();
Symbol 352 MovieClip Frame 1
stop();
Symbol 352 MovieClip Frame 6
play();
Symbol 352 MovieClip Frame 18
if ((stopLabel == 1) || (stopLabel == undefined)) {
stop();
} else {
play();
}
Symbol 352 MovieClip Frame 19
play();
Symbol 352 MovieClip Frame 31
if ((stopLabel == 2) || (stopLabel == undefined)) {
stop();
} else {
play();
}
Symbol 352 MovieClip Frame 32
play();
Symbol 352 MovieClip Frame 44
if ((stopLabel == 3) || (stopLabel == undefined)) {
stop();
} else {
play();
}
Symbol 352 MovieClip Frame 45
play();
Symbol 352 MovieClip Frame 58
stop();
Symbol 357 MovieClip [fire_armory] Frame 1
stop();
Symbol 357 MovieClip [fire_armory] Frame 6
play();
Symbol 357 MovieClip [fire_armory] Frame 21
stop();
Symbol 363 MovieClip [fire_tower] Frame 1
stop();
Symbol 363 MovieClip [fire_tower] Frame 6
play();
Symbol 363 MovieClip [fire_tower] Frame 21
stop();
Symbol 370 MovieClip Frame 1
stop();
Symbol 370 MovieClip Frame 10
play();
Symbol 370 MovieClip Frame 14
stop();
Symbol 370 MovieClip Frame 20
stop();
Symbol 373 MovieClip Frame 1
stop();
Symbol 373 MovieClip Frame 10
play();
Symbol 373 MovieClip Frame 14
stop();
Symbol 373 MovieClip Frame 20
stop();
Symbol 377 MovieClip Frame 1
stop();
Symbol 377 MovieClip Frame 10
play();
Symbol 377 MovieClip Frame 14
stop();
Symbol 377 MovieClip Frame 20
stop();
Symbol 386 MovieClip Frame 1
stop();
Symbol 386 MovieClip Frame 6
play();
Symbol 386 MovieClip Frame 18
if ((stopLabel == 1) || (stopLabel == undefined)) {
stop();
} else {
play();
}
Symbol 386 MovieClip Frame 19
play();
Symbol 386 MovieClip Frame 31
if ((stopLabel == 2) || (stopLabel == undefined)) {
stop();
} else {
play();
}
Symbol 386 MovieClip Frame 32
play();
Symbol 386 MovieClip Frame 44
if ((stopLabel == 3) || (stopLabel == undefined)) {
stop();
} else {
play();
}
Symbol 386 MovieClip Frame 45
play();
Symbol 386 MovieClip Frame 58
stop();
Symbol 391 MovieClip Frame 1
stop();
Symbol 391 MovieClip Frame 6
play();
Symbol 391 MovieClip Frame 18
if ((stopLabel == 1) || (stopLabel == undefined)) {
stop();
} else {
play();
}
Symbol 391 MovieClip Frame 19
play();
Symbol 391 MovieClip Frame 31
if ((stopLabel == 2) || (stopLabel == undefined)) {
stop();
} else {
play();
}
Symbol 391 MovieClip Frame 32
play();
Symbol 391 MovieClip Frame 44
if ((stopLabel == 3) || (stopLabel == undefined)) {
stop();
} else {
play();
}
Symbol 391 MovieClip Frame 45
play();
Symbol 391 MovieClip Frame 58
stop();
Symbol 392 MovieClip Frame 1
stop();
Symbol 392 MovieClip Frame 6
play();
Symbol 392 MovieClip Frame 18
if ((stopLabel == 1) || (stopLabel == undefined)) {
stop();
} else {
play();
}
Symbol 392 MovieClip Frame 19
play();
Symbol 392 MovieClip Frame 31
if ((stopLabel == 2) || (stopLabel == undefined)) {
stop();
} else {
play();
}
Symbol 392 MovieClip Frame 32
play();
Symbol 392 MovieClip Frame 44
if ((stopLabel == 3) || (stopLabel == undefined)) {
stop();
} else {
play();
}
Symbol 392 MovieClip Frame 45
play();
Symbol 392 MovieClip Frame 58
stop();
Symbol 398 MovieClip [water_armory] Frame 1
stop();
Symbol 398 MovieClip [water_armory] Frame 6
play();
Symbol 398 MovieClip [water_armory] Frame 21
stop();
Symbol 403 MovieClip [water_tower] Frame 1
stop();
Symbol 403 MovieClip [water_tower] Frame 6
play();
Symbol 403 MovieClip [water_tower] Frame 21
stop();
Symbol 407 MovieClip Frame 1
stop();
Symbol 407 MovieClip Frame 5
stop();
Symbol 407 MovieClip Frame 10
stop();
Symbol 415 MovieClip Frame 1
stop();
Symbol 415 MovieClip Frame 5
stop();
Symbol 415 MovieClip Frame 10
stop();
Symbol 418 MovieClip Frame 1
stop();
Symbol 418 MovieClip Frame 5
stop();
Symbol 418 MovieClip Frame 10
stop();
Symbol 421 MovieClip Frame 1
stop();
Symbol 421 MovieClip Frame 10
stop();
Symbol 428 MovieClip Frame 1
stop();
Symbol 436 Button
on (release) {
smashing.rampage.Messenger.sendMessage("screen", "onOpenMenu");
}
Symbol 438 MovieClip Frame 1
stop();
Symbol 438 MovieClip Frame 5
stop();
Symbol 438 MovieClip Frame 10
stop();
Symbol 440 MovieClip Frame 1
stop();
Symbol 440 MovieClip Frame 5
stop();
Symbol 440 MovieClip Frame 10
stop();
Symbol 442 MovieClip Frame 1
stop();
Symbol 442 MovieClip Frame 5
stop();
Symbol 442 MovieClip Frame 10
stop();
Symbol 444 MovieClip Frame 1
stop();
Symbol 444 MovieClip Frame 5
stop();
Symbol 444 MovieClip Frame 10
stop();
Symbol 446 MovieClip Frame 1
stop();
Symbol 446 MovieClip Frame 5
stop();
Symbol 446 MovieClip Frame 10
stop();
Symbol 449 MovieClip Frame 1
stop();
Symbol 449 MovieClip Frame 15
stop();
Symbol 454 MovieClip Frame 1
stop();
Symbol 454 MovieClip Frame 22
smashing.rampage.Messenger.sendMessage("world", "onPowerIntroComplete");
Symbol 458 MovieClip Frame 1
stop();
Symbol 458 MovieClip Frame 22
smashing.rampage.Messenger.sendMessage("world", "onPowerIntroComplete");
Symbol 462 MovieClip Frame 1
stop();
Symbol 462 MovieClip Frame 22
smashing.rampage.Messenger.sendMessage("world", "onPowerIntroComplete");
Symbol 470 MovieClip Frame 2
stop();
Symbol 472 MovieClip Frame 2
stop();
Symbol 473 MovieClip Frame 1
stop();
Symbol 473 MovieClip Frame 10
play();
Symbol 473 MovieClip Frame 14
stop();
Symbol 473 MovieClip Frame 20
stop();
Symbol 477 MovieClip Frame 1
stop();
Symbol 477 MovieClip Frame 10
play();
Symbol 477 MovieClip Frame 14
stop();
Symbol 477 MovieClip Frame 20
stop();
Symbol 481 MovieClip Frame 1
stop();
Symbol 481 MovieClip Frame 10
play();
Symbol 481 MovieClip Frame 14
stop();
Symbol 481 MovieClip Frame 20
stop();
Symbol 500 MovieClip Frame 1
stop();
Symbol 500 MovieClip Frame 5
stop();
Symbol 500 MovieClip Frame 10
stop();
Symbol 505 MovieClip Frame 1
stop();
Symbol 505 MovieClip Frame 10
play();
Symbol 505 MovieClip Frame 14
stop();
Symbol 505 MovieClip Frame 20
stop();
Symbol 528 MovieClip Frame 1
stop();
Symbol 528 MovieClip Frame 10
play();
Symbol 528 MovieClip Frame 14
stop();
Symbol 528 MovieClip Frame 20
stop();
Symbol 532 MovieClip Frame 1
stop();
Symbol 532 MovieClip Frame 10
play();
Symbol 532 MovieClip Frame 14
stop();
Symbol 532 MovieClip Frame 20
stop();
Symbol 536 MovieClip Frame 1
stop();
Symbol 536 MovieClip Frame 10
play();
Symbol 536 MovieClip Frame 14
stop();
Symbol 536 MovieClip Frame 20
stop();
Symbol 550 MovieClip Frame 1
stop();
Symbol 550 MovieClip Frame 10
play();
Symbol 550 MovieClip Frame 14
stop();
Symbol 550 MovieClip Frame 20
stop();
Symbol 554 MovieClip Frame 1
stop();
Symbol 554 MovieClip Frame 10
play();
Symbol 554 MovieClip Frame 14
stop();
Symbol 554 MovieClip Frame 20
stop();
Symbol 560 MovieClip Frame 1
stop();
Symbol 560 MovieClip Frame 10
play();
Symbol 560 MovieClip Frame 14
stop();
Symbol 560 MovieClip Frame 20
stop();
Symbol 571 MovieClip Frame 1
stop();
Symbol 571 MovieClip Frame 5
stop();
Symbol 571 MovieClip Frame 10
stop();
Symbol 576 MovieClip Frame 53
stop();
Symbol 577 MovieClip Frame 1
stop();
Symbol 577 MovieClip Frame 5
play();
smashing.rampage.Messenger.sendMessage("screen", "prepPowers");
Symbol 577 MovieClip Frame 30
stop();
if ((followUp != "") && (followUp != undefined)) {
gotoAndPlay(followUp);
followUp = "";
}
Symbol 577 MovieClip Frame 31
play();
Symbol 577 MovieClip Frame 43
stop();
if ((followUp != "") && (followUp != undefined)) {
gotoAndPlay(followUp);
followUp = "";
}
Symbol 577 MovieClip Frame 45
play();
smashing.rampage.Messenger.sendMessage("screen", "prepWeapons");
Symbol 577 MovieClip Frame 56
stop();
if ((followUp != "") && (followUp != undefined)) {
gotoAndPlay(followUp);
followUp = "";
}
Symbol 577 MovieClip Frame 57
play();
Symbol 577 MovieClip Frame 68
if ((followUp != "") && (followUp != undefined)) {
gotoAndPlay(followUp);
followUp = "";
} else {
gotoAndStop ("off");
}
Symbol 577 MovieClip Frame 69
play();
smashing.rampage.Messenger.sendMessage("screen", "prepPowers");
Symbol 577 MovieClip Frame 86
stop();
if ((followUp != "") && (followUp != undefined)) {
gotoAndPlay(followUp);
followUp = "";
}
Symbol 581 MovieClip Frame 1
stop();
Symbol 581 MovieClip Frame 5
stop();
Symbol 581 MovieClip Frame 10
stop();
Symbol 582 MovieClip Frame 1
stop();
Symbol 582 MovieClip Frame 5
play();
smashing.rampage.Messenger.sendMessage("screen", "prepPowers");
Symbol 582 MovieClip Frame 30
stop();
if ((followUp != "") && (followUp != undefined)) {
gotoAndPlay(followUp);
followUp = "";
}
Symbol 582 MovieClip Frame 31
play();
Symbol 582 MovieClip Frame 43
stop();
if ((followUp != "") && (followUp != undefined)) {
gotoAndPlay(followUp);
followUp = "";
}
Symbol 582 MovieClip Frame 45
play();
smashing.rampage.Messenger.sendMessage("screen", "prepWeapons");
Symbol 582 MovieClip Frame 56
stop();
if ((followUp != "") && (followUp != undefined)) {
gotoAndPlay(followUp);
followUp = "";
}
Symbol 582 MovieClip Frame 57
play();
Symbol 582 MovieClip Frame 68
if ((followUp != "") && (followUp != undefined)) {
gotoAndPlay(followUp);
followUp = "";
} else {
gotoAndStop ("off");
}
Symbol 582 MovieClip Frame 69
play();
smashing.rampage.Messenger.sendMessage("screen", "prepPowers");
Symbol 582 MovieClip Frame 86
stop();
if ((followUp != "") && (followUp != undefined)) {
gotoAndPlay(followUp);
followUp = "";
}
Symbol 594 Button
on (release) {
_parent._parent.display_mc._visible = false;
gotoAndPlay (6);
}
Symbol 595 MovieClip Frame 1
state_mc.gotoAndStop(_parent.state);
trace(_parent.state);
Symbol 595 MovieClip Frame 5
_parent._parent.display_mc._visible = true;
stop();
Symbol 595 MovieClip Frame 8
_parent.gotoAndPlay("close");
gotoAndStop ("off");
Symbol 596 MovieClip Frame 6
stop();
Symbol 596 MovieClip Frame 11
stop();
smashing.rampage.Messenger.sendMessage("screen", "onScrollClose");
Symbol 632 MovieClip Frame 1
stop();
Symbol 643 MovieClip Frame 1
stop();
Symbol 651 MovieClip Frame 38
stop();
Symbol 674 MovieClip Frame 6
stop();
Symbol 675 MovieClip Frame 1
stop();
Symbol 675 MovieClip Frame 5
stop();
Symbol 675 MovieClip Frame 10
stop();
Symbol 698 MovieClip [pickup_damage_mc] Frame 1
stop();
Symbol 698 MovieClip [pickup_damage_mc] Frame 14
stop();
Symbol 714 MovieClip [pickup_health_mc] Frame 1
stop();
Symbol 714 MovieClip [pickup_health_mc] Frame 14
stop();
Symbol 719 MovieClip Frame 1
stop();
Symbol 723 MovieClip Frame 1
stop();
Symbol 725 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 725 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");
};
smashing.rampage.Messenger.sendMessage("screen", "createHelpPowerButton", {mc:water1_mc, num:1, kingdom:"water", y:168});
smashing.rampage.Messenger.sendMessage("screen", "createHelpPowerButton", {mc:water2_mc, num:2, kingdom:"water", y:168});
smashing.rampage.Messenger.sendMessage("screen", "createHelpPowerButton", {mc:water3_mc, num:3, kingdom:"water", y:168});
smashing.rampage.Messenger.sendMessage("screen", "createHelpPowerButton", {mc:earth1_mc, num:1, kingdom:"earth", y:239});
smashing.rampage.Messenger.sendMessage("screen", "createHelpPowerButton", {mc:earth2_mc, num:2, kingdom:"earth", y:239});
smashing.rampage.Messenger.sendMessage("screen", "createHelpPowerButton", {mc:earth3_mc, num:3, kingdom:"earth", y:239});
smashing.rampage.Messenger.sendMessage("screen", "createHelpPowerButton", {mc:fire1_mc, num:1, kingdom:"fire", y:300});
smashing.rampage.Messenger.sendMessage("screen", "createHelpPowerButton", {mc:fire2_mc, num:2, kingdom:"fire", y:300});
smashing.rampage.Messenger.sendMessage("screen", "createHelpPowerButton", {mc:fire3_mc, num:3, kingdom:"fire", y:300});
stop();
Instance of Symbol 559 MovieClip "water3_mc" in Symbol 725 MovieClip Frame 2
on (rollOver) {
smashing.rampage.Messenger.sendMessage("screen", "onRollOverHelpPower", {kingdom:"water", num:3, mc:this});
}
on (rollOut, dragOut) {
smashing.rampage.Messenger.sendMessage("screen", "onRollOutHelp");
}
Symbol 725 MovieClip Frame 3
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");
};
smashing.rampage.Messenger.sendMessage("screen", "createHelpWeaponButton", {mc:water0_mc, num:0, kingdom:"water", y:168});
smashing.rampage.Messenger.sendMessage("screen", "createHelpWeaponButton", {mc:water1_mc, num:1, kingdom:"water", y:168});
smashing.rampage.Messenger.sendMessage("screen", "createHelpWeaponButton", {mc:water2_mc, num:2, kingdom:"water", y:168});
smashing.rampage.Messenger.sendMessage("screen", "createHelpWeaponButton", {mc:water3_mc, num:3, kingdom:"water", y:168});
smashing.rampage.Messenger.sendMessage("screen", "createHelpWeaponButton", {mc:earth0_mc, num:0, kingdom:"earth", y:235});
smashing.rampage.Messenger.sendMessage("screen", "createHelpWeaponButton", {mc:earth1_mc, num:1, kingdom:"earth", y:235});
smashing.rampage.Messenger.sendMessage("screen", "createHelpWeaponButton", {mc:earth2_mc, num:2, kingdom:"earth", y:235});
smashing.rampage.Messenger.sendMessage("screen", "createHelpWeaponButton", {mc:earth3_mc, num:3, kingdom:"earth", y:235});
smashing.rampage.Messenger.sendMessage("screen", "createHelpWeaponButton", {mc:fire0_mc, num:0, kingdom:"fire", y:301});
smashing.rampage.Messenger.sendMessage("screen", "createHelpWeaponButton", {mc:fire1_mc, num:1, kingdom:"fire", y:301});
smashing.rampage.Messenger.sendMessage("screen", "createHelpWeaponButton", {mc:fire2_mc, num:2, kingdom:"fire", y:301});
smashing.rampage.Messenger.sendMessage("screen", "createHelpWeaponButton", {mc:fire3_mc, num:3, kingdom:"fire", y:301});
stop();
Symbol 725 MovieClip Frame 4
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 737 MovieClip Frame 1
stop();
Symbol 737 MovieClip Frame 5
stop();
Symbol 737 MovieClip Frame 10
stop();
Symbol 737 MovieClip Frame 15
stop();
Symbol 740 MovieClip Frame 2
stop();
Symbol 741 MovieClip Frame 1
state_mc.gotoAndStop(_parent.state);
trace(_parent.state);
Symbol 741 MovieClip Frame 5
_parent._parent.display_mc._visible = true;
stop();
Symbol 741 MovieClip Frame 8
_parent.gotoAndPlay("close");
gotoAndStop ("off");
Symbol 742 MovieClip Frame 6
stop();
Symbol 742 MovieClip Frame 11
stop();
_parent.gotoAndStop("off");
Symbol 746 MovieClip Frame 6
stop();
Symbol 747 MovieClip Frame 1
stop();
Symbol 747 MovieClip Frame 5
stop();
Symbol 747 MovieClip Frame 10
stop();
Instance of Symbol 747 MovieClip "btn_playAgain" in Symbol 749 MovieClip Frame 1
on (release) {
smashing.rampage.Messenger.sendMessage("engine", "onPressQuit");
}
Instance of Symbol 57 MovieClip "btn_back" in Symbol 749 MovieClip Frame 1
on (release) {
smashing.rampage.Messenger.sendMessage("screen", "hidePopup");
}
Symbol 750 MovieClip Frame 2
stop();
Symbol 750 MovieClip Frame 5
display_mc._visible = false;
btn.useHandCursor = false;
Symbol 750 MovieClip Frame 10
display_mc._visible = false;
btn.useHandCursor = false;
Symbol 750 MovieClip Frame 15
display_mc._visible = false;
btn.useHandCursor = false;
Symbol 752 MovieClip Frame 1
stop();
Symbol 752 MovieClip Frame 5
play();
Symbol 794 MovieClip [bonus_indicator] Frame 1
stop();
Symbol 796 MovieClip Frame 1
stop();
Symbol 808 MovieClip Frame 20
stop();
Symbol 810 MovieClip Frame 13
stop();
Symbol 823 MovieClip Frame 13
stop();
Symbol 828 MovieClip Frame 21
stop();
Symbol 841 MovieClip Frame 26
stop();
Symbol 842 MovieClip Frame 5
stop();
Symbol 851 MovieClip Frame 26
_parent.gotoAndStop("idle");
Symbol 856 MovieClip [earth_tower] Frame 1
stop();
Symbol 856 MovieClip [earth_tower] Frame 6
play();
Symbol 856 MovieClip [earth_tower] Frame 21
stop();
Symbol 902 MovieClip Frame 48
stop();
Symbol 931 MovieClip Frame 26
stop();
Symbol 934 MovieClip Frame 7
stop();
Symbol 941 MovieClip Frame 12
stop();
Symbol 945 MovieClip Frame 6
stop();
Symbol 966 MovieClip Frame 14
stop();
Symbol 971 MovieClip Frame 13
stop();
Symbol 987 MovieClip Frame 21
stop();
Symbol 999 MovieClip Frame 18
stop();
Symbol 1000 MovieClip Frame 5
stop();
Symbol 1003 MovieClip Frame 14
stop();
Symbol 1005 MovieClip [pickup_weapons_mc] Frame 1
stop();
Symbol 1005 MovieClip [pickup_weapons_mc] Frame 14
stop();
Symbol 1006 MovieClip [pickup_gold_mc] Frame 1
stop();
Symbol 1006 MovieClip [pickup_gold_mc] Frame 14
stop();
Symbol 1027 MovieClip Frame 13
stop();
Symbol 1053 MovieClip Frame 34
stop();
Symbol 1054 MovieClip Frame 34
stop();
Symbol 1096 MovieClip Frame 22
stop();
Symbol 1137 MovieClip Frame 41
stop();
Symbol 1154 MovieClip Frame 1
stop();
Symbol 1155 MovieClip Frame 1
stop();
Symbol 1165 MovieClip [firetemple_catapult] Frame 1
stop();
Symbol 1165 MovieClip [firetemple_catapult] Frame 134
stop();
Symbol 1181 MovieClip Frame 1
stop();
Symbol 1185 MovieClip [earthtemple_catapult] Frame 1
stop();
Symbol 1185 MovieClip [earthtemple_catapult] Frame 134
stop();
Symbol 1190 MovieClip Frame 1
stop();
Symbol 1197 MovieClip [watertemple_catapult] Frame 1
stop();
Symbol 1197 MovieClip [watertemple_catapult] Frame 134
stop();
Symbol 1200 MovieClip Frame 10
stop();
Symbol 1238 MovieClip [arrow_mc] Frame 1
stop();
Symbol 1238 MovieClip [arrow_mc] Frame 13
stop();
Symbol 1244 MovieClip [_project] Frame 1
#initclip 79
Object.registerClass("_project", nick.avatar.fortressfight2.Engine);
#endinitclip