Frame 1
function doLoad() {
if (tHasLoaded) {
if (loader_mc._currentframe == loader_mc._totalframes) {
clearInterval(tLoader);
gotoAndStop ("game");
}
} else {
tRatio = getBytesLoaded() / getBytesTotal();
loader_mc.art_mc.txt_percent.text = Math.floor(tRatio * 100);
if (tRatio == 1) {
tHasLoaded = true;
loader_mc.gotoAndPlay("out");
}
}
}
stop();
var tLoader = setInterval(this, "doLoad", 0);
var tRatio = 0;
var tHasLoaded = false;
Symbol 29 MovieClip Frame 1
stop();
Symbol 29 MovieClip Frame 9
play();
Symbol 29 MovieClip Frame 33
stop();
Symbol 963 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 sendMessage(id, message, args) {
if ((_addresses[id] != "") && (_addresses[id] != undefined)) {
_addresses[id].onMessageReceived(message, args);
return(undefined);
}
}
}
Symbol 964 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) {
}
_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);
}
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;
}
}
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);
}
}
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 965 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 966 MovieClip [__Packages.nick.avatar.tentpole.Sounds] Frame 0
class nick.avatar.tentpole.Sounds extends smashing.sound.SoundEngine
{
static var _instance;
var createGroup, createSound, changeVolume, _currentMusic, muteSound, queueSound, callbackSound, muteMusic, stopSound, __get__isQueuePlaying;
function Sounds () {
super();
}
static function getInstance() {
if (_instance == null) {
_instance = new nick.avatar.tentpole.Sounds();
}
return(_instance);
}
function generateSounds(path) {
super.generateSounds(path, _DEPTH, _DO_OVERWRITE);
createGroup("music");
createSound("music", "sfx_AvatarLoop2.wav", "music");
changeVolume(45, "music");
_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) {
if (name != "undefined") {
_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);
}
}
function toggleMusic() {
if (muteMusic) {
muteMusic = false;
playMusic();
} else {
muteMusic = true;
stopMusic();
}
}
var _DEPTH = 20;
var _DO_OVERWRITE = false;
}
Symbol 967 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 968 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 969 MovieClip [__Packages.nick.avatar.tentpole.Engine] Frame 0
class nick.avatar.tentpole.Engine extends smashing.rampage.BaseEngine
{
var _parent, _secretCode, pause, _UI, _sounds, viewport_mc, _state, isPaused, activeWorld, unpause, key, _lastCode, screen_mc, _gameStartTime;
function Engine () {
super();
init();
}
function init() {
super.init();
nick.highscores.HighscoreEngine.init(_parent.gxml.xdata);
_secretCode = 0;
nick.avatar.tentpole.Sounds.getInstance().playMusic("music");
pause();
_UI.goScreen("splash");
}
function _initSounds() {
_sounds = nick.avatar.tentpole.Sounds.getInstance();
_sounds.generateSounds(viewport_mc);
if (!_PLAY_MUSIC) {
_sounds.muteMusic = true;
}
}
function _initGameState() {
_state = nick.avatar.tentpole.GameState.getInstance();
}
function _initUI() {
nick.avatar.tentpole.ui.UI.init();
_UI = nick.avatar.tentpole.ui.UI.getInstance();
_UI.linkEngine(this);
_UI.reset();
}
function _initViewport() {
smashing.rampage.viewport.Viewport.init(viewport_mc, 2, nick.avatar.tentpole.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:"grid", index:1, slots:1000, scrollport:true});
_local2.createGroup({id:"highlights", index:2, slots:500});
_local2.createGroup({id:"obstacle", index:3, slots:500});
_local2.createGroup({id:"units", index:4, slots:500});
_local2.createGroup({id:"battlements", index:5, slots:100});
_local2.createGroup({id:"overlay", index:6, slots:400});
_local2.createGroup({id:"actionline", index:7, slots:400});
_local2.createGroup({id:"effects", index:8, slots:500});
_local2.createGroup({id:"floatText", index:9, slots:500, reverse:true});
_local2.initGroups();
nick.avatar.tentpole.GameCamera.init();
}
function update(dt) {
if (!isPaused) {
activeWorld.update(dt);
}
_UI.update(dt);
updateAfterEvent();
}
function startGame() {
_state.resetGame();
if (activeWorld != null) {
activeWorld.clear();
}
activeWorld = new nick.avatar.tentpole.World();
activeWorld.init(this);
startWorld();
}
function startWorld() {
_state.resetLevel();
_UI.goScreen("gameplay");
smashing.rampage.viewport.Viewport.getInstance().newView();
activeWorld.generate();
activeWorld.start();
smashing.rampage.Messenger.sendMessage("screen", "showIntro");
unpause();
}
function clear() {
activeWorld.clear();
smashing.rampage.viewport.Viewport.getInstance().newView();
}
function destroy() {
_clearMouse();
_clearKey();
}
function onPressSplashPlay() {
_UI.goScreen("select");
}
function onSelectWater() {
_state.selectWaterStrength();
_UI.goScreen("help");
}
function onSelectEarth() {
_state.selectEarthStrength();
_UI.goScreen("help");
}
function onSelectBalance() {
_state.selectBalanceStrength();
_UI.goScreen("help");
}
function onPressDoneHelp() {
if (_state.helpFromGameplay) {
closeGameHelp();
} else {
startGame();
}
}
function onPressPlayAgain() {
_UI.goScreen("select");
}
function onGoGameOver() {
pause();
_UI.goScreen("lose");
smashing.rampage.viewport.Viewport.getInstance().newView();
}
function onGoWin() {
pause();
_UI.goScreen("win");
smashing.rampage.viewport.Viewport.getInstance().newView();
}
function goInGameHelp() {
_state.helpFromGameplay = true;
_UI.goScreen("help");
}
function closeGameHelp() {
_UI.goScreen("gameplay");
}
function _initMouse() {
}
function _clearMouse() {
}
function mouse_up() {
if (!isPaused) {
}
}
function mouse_down() {
if (!isPaused) {
}
}
function _initKey() {
key = {};
key.owner = this;
key.onKeyDown = function () {
this.owner.key_down(Key.getCode());
};
key.onKeyUp = function () {
this.owner.key_up(Key.getCode());
};
Key.addListener(key);
}
function _clearKey() {
Key.removeListener(key);
}
function key_down(pCode) {
_lastCode = pCode;
if (_lastCode == 37) {
_state.onLeftDown();
} else if (_lastCode == 39) {
_state.onRightDown();
} else if (_lastCode == 40) {
_state.onDownDown();
} else if (_lastCode == 38) {
_state.onUpDown();
}
}
function key_up(pCode) {
_lastCode = pCode;
if (_lastCode == 32) {
if (isPaused) {
return(undefined);
}
} else if ((_lastCode > 64) && (_lastCode < 91)) {
_secretCode = _secretCode + Key.getCode();
} else if (_lastCode == 37) {
_state.onLeftUp();
} else if (_lastCode == 39) {
_state.onRightUp();
} else if (_lastCode == 40) {
_state.onDownUp();
} else if (_lastCode == 38) {
_state.onUpUp();
}
}
function onDumpCode() {
_secretCode = 0;
}
function onPressSoundToggle() {
nick.avatar.tentpole.Sounds.getInstance().toggleMusic();
if (nick.avatar.tentpole.Sounds.getInstance().muteMusic) {
screen_mc.hud_mc.menu_popup.btn_menu.btn_sound.gotoAndStop("off");
} else {
screen_mc.hud_mc.menu_popup.btn_menu.btn_sound.gotoAndStop("on");
}
smashing.rampage.Messenger.sendMessage("screen", "updateSoundArt");
}
function testShowSubmitScoreButton() {
return(nick.highscores.HighscoreEngine.__get__isLoggedIn());
}
function onPressGameOverSubmitScore() {
if (!nick.highscores.HighscoreEngine.__get__isLoggedIn()) {
return(undefined);
}
_state.highscoreType = "submit";
_UI.goScreen("highscore");
}
function onPressViewScores() {
_state.highscoreType = "view";
_UI.goScreen("highscore");
}
function get gameStartTime() {
return(_gameStartTime);
}
function isMusicMuted() {
return(_sounds.muteMusic);
}
var _PLAY_MUSIC = true;
}
Symbol 970 MovieClip [__Packages.nick.avatar.tentpole.World] Frame 0
class nick.avatar.tentpole.World
{
var engine, _state, _bossKillCount, _actionState, _isUnitSelected, _hasHighlight, _hasAttackHighlight, _effects, _isGameWon, _gameState, _loop, _friendlyUnits, _enemyUnits, _scenery, _attackQueue, _attackQueueIndex, _attackTimer, _camera, _bloop, _activeHighlight, _attackHighlight, _gridDisplay, _groundDisplay, _floatingText, _actDone, _selectedUnit, _grid;
function World () {
}
function init(t_engine) {
engine = t_engine;
_state = nick.avatar.tentpole.GameState.getInstance();
smashing.rampage.Messenger.registerAddress("world", this);
_bossKillCount = 0;
_actionState = "";
_isUnitSelected = false;
_hasHighlight = false;
_hasAttackHighlight = false;
_effects = [];
_isGameWon = false;
}
function goIntroState() {
_gameState = "player";
update = updatePlayer;
_loop = _friendlyUnits.length;
while (_loop--) {
_friendlyUnits[_loop].prepForInteraction();
}
_loop = _enemyUnits.length;
while (_loop--) {
_enemyUnits[_loop].prepForInteraction();
}
}
function goPlayerState() {
if (_friendlyUnits.length == 0) {
smashing.rampage.Messenger.sendMessage("engine", "onGoGameOver");
return(undefined);
}
_gameState = "player";
smashing.rampage.Messenger.sendMessage("screen", "goResume");
_loop = _friendlyUnits.length;
while (_loop--) {
_friendlyUnits[_loop].prepForInteraction();
}
_loop = _enemyUnits.length;
while (_loop--) {
_enemyUnits[_loop].prepForInteraction();
}
_loop = _scenery.length;
while (_loop--) {
_scenery[_loop].decay();
if (_scenery[_loop].doRemove) {
_scenery[_loop].kill();
_scenery.splice(_loop, 1);
}
}
update = updatePlayer;
_zoomToHighestUnit(_friendlyUnits);
}
function goActState() {
onDeselectUnit();
_attackQueue = [];
_loop = _friendlyUnits.length;
while (_loop--) {
_friendlyUnits[_loop].prepForAction();
if ((_friendlyUnits[_loop].pendingAction != "move") && (_friendlyUnits[_loop].pendingAction != "")) {
_attackQueue.push(_friendlyUnits[_loop]);
}
}
_loop = _enemyUnits.length;
while (_loop--) {
_enemyUnits[_loop].removeInteraction();
}
_attackQueueIndex = _attackQueue.length - 1;
_attackTimer = 0;
_gameState = "animate";
_actionState = "";
_isUnitSelected = false;
_hasHighlight = false;
_hasAttackHighlight = false;
update = updateAct;
if (_attackQueue.length == 0) {
_zoomToHighestUnit(_friendlyUnits);
}
smashing.rampage.Messenger.sendMessage("screen", "goAction");
}
function _zoomToHighestUnit(pArray) {
var _local2 = 1000000 /* 0x0F4240 */;
_loop = _friendlyUnits.length;
while (_loop--) {
if (_friendlyUnits[_loop].hex.y < _local2) {
_local2 = _friendlyUnits[_loop].hex.y;
}
}
_camera.zoomToPoint(_local2 - 10);
}
function _zoomToLowestUnit(pArray) {
if (_gameState == "player") {
return(undefined);
}
var _local3 = 1;
_loop = pArray.length;
while (_loop--) {
if ((pArray[_loop].hex.y > _local3) && (pArray[_loop].move > 0)) {
_local3 = pArray[_loop].hex.y;
}
}
_camera.zoomToPoint(_local3 + 85);
}
function _cancelZoom() {
_camera.cancelZoom();
}
function goEnemyState() {
if (_isGameWon) {
smashing.rampage.Messenger.sendMessage("engine", "onGoWin");
return(undefined);
}
_gameState = "enemy";
_attackQueue = [];
_attackTimer = 0;
var _local2;
var _local4;
var _local3;
var _local5;
_loop = _enemyUnits.length;
while (_loop--) {
_local4 = -1;
_local3 = 10000;
_local5 = false;
_local2 = _getReachableFriendlyUnits(_enemyUnits[_loop]);
if (_local2.length == 0) {
} else {
_bloop = _local2.length;
while (_bloop--) {
if (_enemyUnits[_loop].canMeleeHex(_local2[_bloop].targetUnit.hex)) {
if (!_local5) {
_local5 = true;
_local4 = _bloop;
_local3 = _local2[_bloop].targetUnit.health;
} else if ((_local2[_bloop].targetUnit.health < _local3) || ((_local2[_bloop].targetUnit.health == _local3) && (Math.random() < 0.3))) {
_local4 = _bloop;
_local3 = _local2[_bloop].targetUnit.health;
}
} else if ((!_local5) && ((_local2[_bloop].targetUnit.health < _local3) || ((_local2[_bloop].targetUnit.health == _local3) && (Math.random() < 0.3)))) {
_local4 = _bloop;
_local3 = _local2[_bloop].targetUnit.health;
}
}
if (_enemyUnits[_loop].canAttackHex(_local2[_local4].targetUnit.hex)) {
_enemyUnits[_loop].onSelectAttackHex(_local2[_local4].targetUnit.hex);
} else {
_enemyUnits[_loop].onSelectMoveHex(_local2[_local4].adjacentHex);
}
}
_enemyUnits[_loop].prepForAction();
if (_enemyUnits[_loop].pendingAction == "attack") {
_attackQueue.push(_enemyUnits[_loop]);
}
}
_attackQueueIndex = _attackQueue.length - 1;
if (_attackQueue.length == 0) {
_zoomToLowestUnit(_enemyUnits);
}
smashing.rampage.Messenger.sendMessage("screen", "goEnemy");
update = updateEnemy;
}
function start() {
}
function update(dt) {
}
function updatePlayer(dt) {
_camera.update(dt);
_loop = _friendlyUnits.length;
while (_loop--) {
_friendlyUnits[_loop].render(dt);
}
_loop = _enemyUnits.length;
while (_loop--) {
_enemyUnits[_loop].render(dt);
}
if (_hasHighlight) {
_activeHighlight.render(dt);
}
if (_hasAttackHighlight) {
_attackHighlight.render(dt);
}
_gridDisplay.render(dt);
_groundDisplay.render(dt);
_loop = _scenery.length;
while (_loop--) {
_scenery[_loop].render(dt);
}
_loop = _floatingText.length;
while (_loop--) {
_floatingText[_loop].updateAndRender(dt);
if (_floatingText[_loop].doRemove) {
_floatingText[_loop].kill();
_floatingText.splice(_loop, 1);
}
}
}
function updateAct(dt) {
_camera.update(dt);
_actDone = true;
_loop = _friendlyUnits.length;
while (_loop--) {
_friendlyUnits[_loop].act(dt);
_friendlyUnits[_loop].render(dt);
if (_friendlyUnits[_loop].isActing) {
_actDone = false;
}
}
_loop = _enemyUnits.length;
while (_loop--) {
_enemyUnits[_loop].react(dt);
if (_enemyUnits[_loop].isReacting) {
_actDone = false;
}
if (_enemyUnits[_loop].doRemove) {
_enemyUnits[_loop].kill();
_enemyUnits.splice(_loop, 1);
} else {
_enemyUnits[_loop].render(dt);
}
}
if (_effects.length > 0) {
_actDone = false;
}
_updateAttackQueueAndEffects(dt);
_gridDisplay.render(dt);
_groundDisplay.render(dt);
_loop = _scenery.length;
while (_loop--) {
_scenery[_loop].render(dt);
}
_loop = _floatingText.length;
while (_loop--) {
_floatingText[_loop].updateAndRender(dt);
if (_floatingText[_loop].doRemove) {
_floatingText[_loop].kill();
_floatingText.splice(_loop, 1);
}
}
if (_actDone) {
goEnemyState();
}
}
function updateEnemy(dt) {
if (dt > 0.13) {
dt = 0.13;
}
_camera.update(dt);
_actDone = true;
_loop = _enemyUnits.length;
while (_loop--) {
_enemyUnits[_loop].act(dt);
_enemyUnits[_loop].render(dt);
if (_enemyUnits[_loop].isActing) {
_actDone = false;
}
}
_loop = _friendlyUnits.length;
while (_loop--) {
_friendlyUnits[_loop].react(dt);
if (_friendlyUnits[_loop].isReacting) {
_actDone = false;
}
if (_friendlyUnits[_loop].doRemove) {
_friendlyUnits[_loop].kill();
_friendlyUnits.splice(_loop, 1);
} else {
_friendlyUnits[_loop].render(dt);
}
}
if (_effects.length > 0) {
_actDone = false;
}
_updateAttackQueueAndEffects(dt);
_gridDisplay.render(dt);
_groundDisplay.render(dt);
_loop = _scenery.length;
while (_loop--) {
_scenery[_loop].render(dt);
}
_loop = _floatingText.length;
while (_loop--) {
_floatingText[_loop].updateAndRender(dt);
if (_floatingText[_loop].doRemove) {
_floatingText[_loop].kill();
_floatingText.splice(_loop, 1);
}
}
if (_actDone) {
_cancelZoom();
goPlayerState();
}
}
function _updateAttackQueueAndEffects(dt) {
if (_attackQueueIndex > -1) {
_attackTimer = _attackTimer - dt;
if (_attackTimer <= 0) {
_executeAttack(_attackQueue[_attackQueueIndex]);
_attackQueueIndex--;
_attackTimer = _ATTACK_QUEUE_DELAY;
if (_attackQueueIndex < 0) {
if (_gameState == "enemy") {
} else {
_zoomToHighestUnit(_friendlyUnits);
}
}
}
}
_loop = _effects.length;
while (_loop--) {
_effects[_loop].updateAndRender(dt);
if (_effects[_loop].doRemove) {
_effects[_loop].kill();
_effects.splice(_loop, 1);
}
}
}
function _executeAttack(pUnit) {
pUnit.playAttackAnimation();
if (pUnit.__get__pendingAction() == "attack") {
_playAttackEffect(pUnit.getActionEffect(), pUnit);
} else if (pUnit.__get__pendingAction() == "cyclone") {
_playCycloneEffect(pUnit);
} else if (pUnit.__get__pendingAction() == "freeze") {
_playFreezeEffect(pUnit);
} else if (pUnit.__get__pendingAction() == "barricade") {
_playBarricadeEffect(pUnit);
}
pUnit.completeAction();
}
function _playAttackEffect(pEffectID, pUnit) {
_effects.push(new nick.avatar.tentpole.ents.AttackEffect(pEffectID, pUnit, pUnit.__get__actionHex()));
_camera.zoomToPoint(pUnit.getAttackCameraY());
}
function _playCycloneEffect(pUnit) {
_effects.push(new nick.avatar.tentpole.ents.CycloneEffect(pUnit));
_camera.zoomToPoint(pUnit.__get__hex().y);
}
function _playFreezeEffect(pUnit) {
_effects.push(new nick.avatar.tentpole.ents.FreezeEffect(pUnit, pUnit.__get__actionHex()));
_camera.zoomToPoint(pUnit.__get__actionHex().y);
}
function _playBarricadeEffect(pUnit) {
_effects.push(new nick.avatar.tentpole.ents.BarricadeEffect(pUnit, pUnit.__get__actionHex()));
_camera.zoomToPoint(pUnit.__get__actionHex().y);
}
function onAttackCollided(pData) {
if (pData.caster.FRIENDLY) {
var _local3 = _enemyUnits.length;
while (_local3--) {
if (_enemyUnits[_local3].hex == pData.target) {
_enemyUnits[_local3].takeDamage(pData.caster);
}
}
} else {
var _local3 = _friendlyUnits.length;
while (_local3--) {
if (_friendlyUnits[_local3].hex == pData.target) {
_friendlyUnits[_local3].takeDamage(pData.caster);
}
}
}
}
function onUnitDefeated(pData) {
if (!pData.unit.FRIENDLY) {
nick.avatar.tentpole.GameState.getInstance().addScore(pData.unit.VALUE);
}
if (pData.unit.IS_BOSS) {
_bossKillCount++;
if (_bossKillCount >= 3) {
var _local2 = _friendlyUnits.length;
while (_local2--) {
if (_friendlyUnits[_local2].health >= 1) {
_state.bonus = _state.bonus + 200;
}
}
_state.addScore(_state.bonus);
_isGameWon = true;
}
}
}
function showFloatingText(pData) {
_floatingText.push(new nick.avatar.tentpole.ents.FloatingText({x:pData.unit.x, y:pData.unit.y, friendly:pData.unit.FRIENDLY, val:pData.val}));
}
function onCycloneCollided(pData) {
var _local2 = _enemyUnits.length;
while (_local2--) {
if (pData.caster.canMeleeHex(_enemyUnits[_local2].hex)) {
_enemyUnits[_local2].takeNumericalDamage(5);
}
}
}
function onFreezeCollided(pData) {
var _local2 = _enemyUnits.length;
while (_local2--) {
if (_enemyUnits[_local2].hex == pData.target) {
_enemyUnits[_local2].onFreeze();
}
}
}
function onBarricadeCollided(pData) {
_scenery.push(new nick.avatar.tentpole.ents.Barricade(pData.target));
}
function clear() {
_loop = _friendlyUnits.length;
while (_loop--) {
_friendlyUnits[_loop].kill();
}
_loop = _enemyUnits.length;
while (_loop--) {
_enemyUnits[_loop].kill();
}
_loop = _effects.length;
while (_loop--) {
_effects[_loop].kill();
}
}
function onReturnFromHelp() {
smashing.rampage.Messenger.sendMessage("screen", "onSelectUnit", {unit:_selectedUnit});
}
function onSelectUnit(pData) {
if (_gameState != "player") {
return(undefined);
}
if (_isUnitSelected) {
onDeselectUnit();
}
_selectedUnit = pData.unit;
_selectedUnit.onSelected();
_isUnitSelected = true;
smashing.rampage.Messenger.sendMessage("screen", "onSelectUnit", pData);
_camera.zoomToPoint(_selectedUnit.y + (_selectedUnit.FRIENDLY ? 0 : 110));
if (_selectedUnit.FRIENDLY) {
if (((_selectedUnit.__get__pendingAction() == "") || (_selectedUnit.__get__pendingAction() == "move")) || (_selectedUnit.__get__pendingAction() == "attack")) {
triggerAction({action:_selectedUnit.__get__primaryAction()});
} else {
triggerAction({action:_selectedUnit.__get__pendingAction()});
}
} else {
triggerAction({action:"displayEnemyMove"});
}
}
function onCancelUnitActions(pData) {
pData.unit.onClearAction(false);
onDeselectUnit();
smashing.rampage.Messenger.sendMessage("screen", "onDeselectUnit");
}
function onDeselectUnit() {
_isUnitSelected = false;
_selectedUnit.onDeselected();
if (_hasHighlight || (_hasAttackHighlight)) {
_hideHighlight();
}
}
function triggerAction(pData) {
if (_actionState != "") {
cancelAction();
}
_actionState = pData.action;
switch (_actionState) {
case "move" :
activateMove();
break;
case "displayEnemyMove" :
activateEnemyMoveHighlight();
break;
case "attackmove" :
activateMove();
activateAttack();
break;
case "attack" :
activateAttack();
break;
case "cyclone" :
activateCyclone();
break;
case "freeze" :
activateFreeze();
break;
case "barricade" :
activateBarricade();
}
}
function activateMove() {
_showMoveHighlight(_selectedUnit);
}
function activateCyclone() {
_showCycloneHighlight(_selectedUnit);
selectCyclone();
}
function activateFreeze() {
_showFreezeHighlight(_selectedUnit);
}
function activateBarricade() {
_showBarricadeHighlight(_selectedUnit);
}
function activateAttack() {
_showAttackHighlight(_selectedUnit);
}
function activateEnemyMoveHighlight() {
_showEnemyMoveHighlight(_selectedUnit);
}
function cancelAction() {
_actionState = "";
}
function onPressHighlightHex(pData) {
switch (_actionState) {
case "move" :
selectMove(pData.hex);
break;
case "attack" :
selectAttack(pData.hex);
break;
case "attackmove" :
if (pData.type == "move") {
selectMove(pData.hex);
} else {
selectAttack(pData.hex);
}
break;
case "enemyMove" :
break;
case "cyclone" :
selectCyclone();
break;
case "freeze" :
selectFreeze(pData.hex);
break;
case "barricade" :
selectBarricade(pData.hex);
}
_activeHighlight.refresh();
}
function onConfirmCommands() {
_loop = _friendlyUnits.length;
while (_loop--) {
if (!_friendlyUnits[_loop].isActing) {
smashing.rampage.Messenger.sendMessage("screen", "popupActionConfirm");
return(undefined);
}
}
goActState();
}
function onForceConfirmCommands() {
goActState();
}
function selectMove(pHex) {
_selectedUnit.onSelectMoveHex(pHex);
_onActionSelected();
}
function selectCyclone() {
_selectedUnit.onSelectCyclone();
_onActionSelected();
}
function selectAttack(pHex) {
_selectedUnit.onSelectAttackHex(pHex);
_onActionSelected();
}
function selectFreeze(pHex) {
_selectedUnit.onSelectFreeze(pHex);
_onActionSelected();
}
function selectBarricade(pHex) {
_selectedUnit.onSelectBarricade(pHex);
_onActionSelected();
}
function _onActionSelected() {
if (_findNextActionableCharacter() == null) {
smashing.rampage.Messenger.sendMessage("screen", "highlightEndTurn");
} else {
smashing.rampage.Messenger.sendMessage("screen", "highlightNextSquad");
}
}
function onPressNextSquad() {
_loop = _friendlyUnits.length;
while (_loop--) {
if ((!_isUnitSelected) || (_friendlyUnits[_loop] == _selectedUnit)) {
if (_loop == 0) {
onSelectUnit({unit:_friendlyUnits[_friendlyUnits.length - 1]});
} else {
onSelectUnit({unit:_friendlyUnits[_loop - 1]});
}
return(undefined);
}
}
}
function _findNextActionableCharacter() {
if (!_isUnitSelected) {
return(null);
}
var _local3;
_loop = _friendlyUnits.length;
while (_loop--) {
if (_friendlyUnits[_loop] == _selectedUnit) {
_local3 = _loop;
_loop = 0;
}
}
if (_local3 == null) {
return(null);
}
var _local2 = _local3 + 1;
_loop = 0;
while (_loop < _friendlyUnits.length) {
if (_local2 == _friendlyUnits.length) {
_local2 = 0;
}
if (_friendlyUnits[_local2].isActing) {
if (_loop < (_friendlyUnits.length - 1)) {
_local2++;
}
} else {
_loop = 1000;
}
_loop++;
}
if (_local2 == _local3) {
return(null);
}
return(_friendlyUnits[_local2]);
}
function _showMoveHighlight(pUnit) {
if (_hasHighlight) {
_hideHighlight();
}
_hasHighlight = true;
_activeHighlight = new nick.avatar.tentpole.ents.Highlight(pUnit.x, pUnit.y, "move", _getMoveableSpaces(pUnit));
}
function _showCycloneHighlight(pUnit) {
if (_hasHighlight) {
_hideHighlight();
}
if (_hasAttackHighlight) {
_hideHighlight();
}
_hasHighlight = true;
_activeHighlight = new nick.avatar.tentpole.ents.Highlight(pUnit.x, pUnit.y, "cyclone", _getCycloneableSpaces(pUnit));
}
function _showFreezeHighlight(pUnit) {
if (_hasHighlight) {
_hideHighlight();
}
if (_hasAttackHighlight) {
_hideHighlight();
}
_hasHighlight = true;
_activeHighlight = new nick.avatar.tentpole.ents.Highlight(pUnit.x, pUnit.y, "freeze", _getFreezableSpaces(pUnit));
}
function _showBarricadeHighlight(pUnit) {
if (_hasHighlight) {
_hideHighlight();
}
if (_hasAttackHighlight) {
_hideHighlight();
}
_hasHighlight = true;
_activeHighlight = new nick.avatar.tentpole.ents.Highlight(pUnit.x, pUnit.y, "barricade", _getMoveableSpaces(pUnit));
}
function _showAttackHighlight(pUnit) {
if (_hasAttackHighlight) {
_hideHighlight();
}
_hasAttackHighlight = true;
_attackHighlight = new nick.avatar.tentpole.ents.Highlight(pUnit.x, pUnit.y, "attack", _getAttackableSpaces(pUnit));
}
function _showEnemyMoveHighlight(pUnit) {
if (_hasHighlight) {
_hideHighlight();
}
_hasHighlight = true;
_activeHighlight = new nick.avatar.tentpole.ents.Highlight(pUnit.x, pUnit.y, "enemyMove", _getMoveableSpaces(pUnit));
}
function _hideHighlight() {
if (_hasHighlight) {
_hasHighlight = false;
_activeHighlight.kill();
}
if (_hasAttackHighlight) {
_hasAttackHighlight = false;
_attackHighlight.kill();
}
}
function _getFreezableSpaces(pUnit) {
var _local3 = [];
var _local2;
_local2 = _enemyUnits.length;
while (_local2--) {
if (_enemyUnits[_local2].CAN_FREEZE && (pUnit.canAttackHex(_enemyUnits[_local2].hex))) {
_local3.push(_enemyUnits[_local2].hex);
}
}
return(_local3);
}
function _getAttackableSpaces(pUnit) {
var _local9 = [];
var _local8 = [];
var _local2;
var _local10 = pUnit.__get__range();
var _local3;
var _local4;
var _local5 = [pUnit.__get__hex()];
var _local6;
while (_local10--) {
_local3 = _local5.length;
_local6 = [];
while (_local3--) {
_local4 = _evenHexAdjacentMap.length;
while (_local4--) {
_local2 = getHex(_local5[_local3].xCoord + (((_local5[_local3].yCoord % 2) == 0) ? (_evenHexAdjacentMap[_local4].x) : (_oddHexAdjacentMap[_local4].x)), _local5[_local3].yCoord + _evenHexAdjacentMap[_local4].y);
if ((((_local2 != null) && (!_local2.__get__isPinged())) && (!_local2.__get__isOccupiedObstacle())) && ((pUnit.FRIENDLY && (_local2.__get__isOccupiedHostile())) || ((!pUnit.FRIENDLY) && (_local2.__get__isOccupiedFriendly())))) {
_local9.push(_local2);
}
_local6.push(_local2);
_local8.push(_local2);
_local2.ping();
}
}
_local5 = [];
_local3 = _local6.length;
while (_local3--) {
_local5.push(_local6[_local3]);
}
}
_local3 = _local8.length;
while (_local3--) {
_local8[_local3].clearPing();
}
return(_local9);
}
function _getCycloneableSpaces(pUnit) {
var _local5 = [];
var _local2;
var _local3 = (((pUnit.__get__hex().yCoord % 2) == 0) ? (_evenHexAdjacentMap) : (_oddHexAdjacentMap));
_local2 = _local3.length;
while (_local2--) {
if (((pUnit.__get__hex().xCoord + _local3[_local2].x) >= 0) && ((pUnit.__get__hex().xCoord + _local3[_local2].x) < _HEXES_WIDE)) {
_local5.push(getHex(pUnit.__get__hex().xCoord + _local3[_local2].x, pUnit.__get__hex().yCoord + _local3[_local2].y));
}
}
return(_local5);
}
function _getMoveableSpaces(pUnit) {
var _local7 = [];
var _local2;
var _local9 = pUnit.__get__move();
var _local3;
var _local4;
var _local5 = [pUnit.__get__hex()];
var _local6;
while (_local9--) {
_local3 = _local5.length;
_local6 = [];
while (_local3--) {
_local4 = _evenHexAdjacentMap.length;
while (_local4--) {
_local2 = getHex(_local5[_local3].xCoord + (((_local5[_local3].yCoord % 2) == 0) ? (_evenHexAdjacentMap[_local4].x) : (_oddHexAdjacentMap[_local4].x)), _local5[_local3].yCoord + _evenHexAdjacentMap[_local4].y);
if (((_local2 != null) && (((!_local2.__get__isOccupied()) || (pUnit.__get__actionHex() == _local2)) || ((pUnit.FRIENDLY && (_local2.__get__isOccupiedFriendly())) && (!_local2.__get__isOccupiedObstacle())))) && (!_local2.__get__isPinged())) {
_local7.push(_local2);
_local6.push(_local2);
_local2.ping();
}
}
}
_local5 = [];
_local3 = _local6.length;
while (_local3--) {
_local5.push(_local6[_local3]);
}
}
_local3 = _local7.length;
while (_local3--) {
if (!_local7[_local3].isOpen) {
_local7[_local3].clearPing();
_local7.splice(_local3, 1);
}
}
return(_local7);
}
function _getReachableFriendlyUnits(pUnit) {
var _local12 = [];
var _local13;
var _local4;
var _local7;
var _local5;
var _local2;
var _local8;
var _local6;
var _local10;
var _local9;
var _local15;
var _local14;
var _local11 = _getAttackableSpaces(pUnit);
_local13 = _friendlyUnits.length;
while (_local13--) {
_local4 = _friendlyUnits[_local13];
_local6 = [];
_local2 = _local11.length;
while (_local2--) {
if (_local4.__get__hex() == _local11[_local2]) {
_local2 = 0;
_local12.push({targetUnit:_local4, adjacentHex:pUnit.__get__hex()});
continue;
}
}
if (pUnit.canReachHex(_local4.__get__hex())) {
if (pUnit.canReachMeleeHex(_local4.__get__hex())) {
_local7 = _local4.hex;
} else {
_local15 = (((_local4.__get__hex().xCoord - pUnit.__get__hex().xCoord) < 0) ? (pUnit.__get__hex().xCoord - pUnit.__get__move()) : (pUnit.__get__hex().xCoord + pUnit.__get__move()));
_local14 = (((_local4.__get__hex().yCoord - pUnit.__get__hex().yCoord) < 0) ? (pUnit.__get__hex().yCoord - pUnit.__get__move()) : (pUnit.__get__hex().yCoord + pUnit.__get__move()));
_local7 = getHex(_local15, _local14);
}
_local2 = _evenHexAdjacentMap.length;
while (_local2--) {
_local5 = getHex(_local7.xCoord + (((_local7.yCoord % 2) == 0) ? (_evenHexAdjacentMap[_local2].x) : (_oddHexAdjacentMap[_local2].x)), _local7.yCoord + _evenHexAdjacentMap[_local2].y);
if ((((_local5 != null) && (_local5.__get__isOpen())) && (pUnit.canMoveToHex(_local5))) && (pUnit.canAttackHexFrom(_local5, _local4.__get__hex()))) {
_local6.push(_local5);
}
}
if (_local6.length > 0) {
_local2 = _local6.length;
_local10 = 1000;
_local9 = -1;
while (_local2--) {
_local8 = Math.abs(pUnit.__get__hex().xCoord - _local6[_local2].xCoord) + Math.abs(pUnit.__get__hex().yCoord - _local6[_local2].yCoord);
if (_local8 < _local10) {
_local10 = _local8;
_local9 = _local2;
}
}
if (_local9 > -1) {
_local12.push({targetUnit:_local4, adjacentHex:_local6[_local9]});
}
}
}
}
return(_local12);
}
function generate() {
_camera = nick.avatar.tentpole.GameCamera.getInstance();
_camera.generate({x:_state.HALF_WIDTH, y:1000});
_grid = new Array(_HEXES_WIDE);
_loop = _grid.length;
while (_loop--) {
_grid[_loop] = new Array(_HEXES_LONG);
_bloop = _HEXES_LONG;
while (_bloop--) {
_grid[_loop][_bloop] = new nick.avatar.tentpole.ents.Hex(_loop, _bloop);
}
}
_gridDisplay = new nick.avatar.tentpole.ents.GridDisplay();
_groundDisplay = new nick.avatar.tentpole.ents.GroundDisplay();
var _local3;
if (_state.strength == "water") {
_local3 = ["catapult", "katara", "sokka", "waterSoldier", "waterSoldier", "aang", "earthSoldier", "earthSoldier", "toph"];
} else if (_state.strength == "earth") {
_local3 = ["katara", "waterSoldier", "waterSoldier", "aang", "earthSoldier", "earthSoldier", "toph", "fong", "earthCatapult"];
} else {
_local3 = ["catapult", "katara", "waterSoldier", "waterSoldier", "aang", "earthSoldier", "earthSoldier", "toph", "earthCatapult"];
}
_friendlyUnits = [];
_loop = _local3.length;
while (_loop--) {
_friendlyUnits.push(generateUnit(_local3[_loop], _grid[_loop][_HEXES_LONG - 3]));
}
_scenery = [];
_enemyUnits = [];
var _local2 = 1;
_enemyUnits.push(generateUnit("elite", _grid[3][_local2]));
_enemyUnits.push(generateUnit("elite", _grid[4][_local2 + 2]));
_enemyUnits.push(generateUnit("elite", _grid[6][_local2]));
_enemyUnits.push(generateUnit("wimp", _grid[5][_local2 + 2]));
_enemyUnits.push(generateUnit("fire", _grid[1][_local2 + 1]));
_enemyUnits.push(generateUnit("fire", _grid[7][_local2 + 1]));
_scenery.push(generateObstacle(_grid[0][_local2 + 2]));
_scenery.push(generateObstacle(_grid[9][_local2 + 2]));
_local2 = 6;
_enemyUnits.push(generateUnit("fire", _grid[1][_local2 + 1]));
_enemyUnits.push(generateBattlement(_grid[9][_local2 + 1]));
_scenery.push(generateObstacle(_grid[6][_local2 + 1]));
_scenery.push(generateObstacle(_grid[7][_local2 + 3]));
_local2 = 10;
_enemyUnits.push(generateUnit("rhino", _grid[0][_local2]));
_enemyUnits.push(generateUnit("fireCatapult", _grid[1][_local2]));
_scenery.push(generateObstacle(_grid[0][_local2 + 1]));
_scenery.push(generateObstacle(_grid[1][_local2 + 1]));
_scenery.push(generateObstacle(_grid[2][_local2 + 1]));
_scenery.push(generateObstacle(_grid[4][_local2]));
_scenery.push(generateObstacle(_grid[4][_local2 + 1]));
_scenery.push(generateObstacle(_grid[4][_local2 + 2]));
_enemyUnits.push(generateUnit("fire", _grid[2][_local2 + 4]));
_enemyUnits.push(generateUnit("fire", _grid[1][_local2 + 3]));
_local2 = 17;
_enemyUnits.push(generateUnit("fire", _grid[5][_local2 - 1]));
_enemyUnits.push(generateUnit("fire", _grid[4][_local2 - 1]));
_scenery.push(generateObstacle(_grid[8][_local2]));
_scenery.push(generateObstacle(_grid[7][_local2]));
_enemyUnits.push(generateUnit("fireCatapult", _grid[7][_local2 - 1]));
_local2 = 21;
_enemyUnits.push(generateBattlement(_grid[0][_local2]));
_scenery.push(generateObstacle(_grid[7][_local2 + 2]));
_enemyUnits.push(generateUnit("wimp", _grid[3][_local2]));
_enemyUnits.push(generateUnit("wimp", _grid[4][_local2 - 1]));
_enemyUnits.push(generateUnit("wimp", _grid[3][_local2 - 1]));
_enemyUnits.push(generateUnit("wimp", _grid[5][_local2]));
_local2 = 25;
_scenery.push(generateObstacle(_grid[5][_local2]));
_scenery.push(generateObstacle(_grid[5][_local2 + 1]));
_scenery.push(generateObstacle(_grid[6][_local2 + 3]));
_scenery.push(generateObstacle(_grid[7][_local2 + 3]));
_scenery.push(generateObstacle(_grid[8][_local2 + 3]));
_scenery.push(generateObstacle(_grid[9][_local2 + 3]));
_enemyUnits.push(generateUnit("rhino", _grid[7][_local2 + 1]));
_enemyUnits.push(generateUnit("rhino", _grid[8][_local2 + 1]));
_local2 = 30;
_scenery.push(generateObstacle(_grid[2][_local2]));
_scenery.push(generateObstacle(_grid[2][_local2 + 1]));
_scenery.push(generateObstacle(_grid[7][_local2 + 3]));
_enemyUnits.push(generateUnit("fire", _grid[2][_local2 - 1]));
_enemyUnits.push(generateUnit("fire", _grid[8][_local2]));
_enemyUnits.push(generateUnit("wimp", _grid[4][_local2 + 3]));
_camera.y = _friendlyUnits[0].y;
_scenery.push(new nick.avatar.tentpole.ents.Scenery({x:300, y:_HEXES_LONG * 50.8}));
_scenery.push(new nick.avatar.tentpole.ents.Scenery({x:0, y:0, asset:"bmp_tower"}));
_lockHexRow(0);
_lockHexRow(_HEXES_LONG - 2);
_lockHexCol(9);
_floatingText = [];
goIntroState();
}
function getHex(pX, pY) {
if ((((pX < 0) || (pX > (_HEXES_WIDE - 1))) || (pY < 0)) || (pY > (_HEXES_LONG - 1))) {
return(null);
}
return(_grid[pX][pY]);
}
function getHexPosFromCoord(pX, pY) {
return(getHexPos(_grid[pX][pY]));
}
function getHexPos(pHex) {
return(new smashing.Point3D(pHex.x, pHex.y));
}
function _lockHexRow(pRow) {
_loop = _grid.length;
while (_loop--) {
_grid[_loop][pRow].lock();
}
}
function _lockHexCol(pCol) {
_loop = _grid[0].length;
while (_loop--) {
if ((_loop % 2) == 0) {
_grid[pCol][_loop].lock();
}
}
}
function generateBattlement(pHex) {
return(new nick.avatar.tentpole.ents.units.Battlement(pHex));
}
function generateUnit(pType, pHex) {
switch (pType) {
case "aang" :
return(new nick.avatar.tentpole.ents.units.Aang(pHex));
case "katara" :
return(new nick.avatar.tentpole.ents.units.Katara(pHex));
case "toph" :
return(new nick.avatar.tentpole.ents.units.Toph(pHex));
case "sokka" :
return(new nick.avatar.tentpole.ents.units.Sokka(pHex));
case "fong" :
return(new nick.avatar.tentpole.ents.units.Fong(pHex));
case "catapult" :
return(new nick.avatar.tentpole.ents.units.Catapult(pHex));
case "earthCatapult" :
return(new nick.avatar.tentpole.ents.units.CatapultEarth(pHex));
case "waterSoldier" :
return(new nick.avatar.tentpole.ents.units.WaterSoldier(pHex));
case "earthSoldier" :
return(new nick.avatar.tentpole.ents.units.EarthSoldier(pHex));
case "fire" :
return(new nick.avatar.tentpole.ents.units.FireBender(pHex));
case "wimp" :
return(new nick.avatar.tentpole.ents.units.FireBender(pHex, true));
case "fireCatapult" :
return(new nick.avatar.tentpole.ents.units.FireCatapult(pHex));
case "elite" :
return(new nick.avatar.tentpole.ents.units.FireElite(pHex));
case "rhino" :
return(new nick.avatar.tentpole.ents.units.Rhino(pHex));
}
}
function generateObstacle(pHex) {
return(new nick.avatar.tentpole.ents.Obstacle(pHex));
}
function beginScrollUp() {
_camera.setScrollDir(-1);
}
function endScrollUp() {
_camera.setScrollDir(0);
}
function beginScrollDown() {
_camera.setScrollDir(1);
}
function endScrollDown() {
_camera.setScrollDir(0);
}
function get camera() {
return(_camera);
}
function onMessageReceived(message, args) {
this[message](args);
}
var _ATTACK_QUEUE_DELAY = 1.5;
var _HEXES_WIDE = 10;
var _HEXES_LONG = 38;
var _evenHexAdjacentMap = [{x:-1, y:0}, {x:0, y:-1}, {x:1, y:-1}, {x:1, y:0}, {x:0, y:1}, {x:1, y:1}];
var _oddHexAdjacentMap = [{x:-1, y:0}, {x:0, y:-1}, {x:-1, y:-1}, {x:1, y:0}, {x:0, y:1}, {x:-1, y:1}];
}
Symbol 971 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 (pData) {
}
static function init(t_path, t_depth, dimensions) {
_instance = new smashing.rampage.BaseCamera(t_path, t_depth, dimensions);
}
static function getInstance() {
return(_instance);
}
function generate(pData) {
_gameState = getGameState();
x = (y = (z = 0));
if (pData.x != undefined) {
x = pData.x;
}
if (pData.y != undefined) {
y = pData.y;
}
if (pData.z != undefined) {
z = pData.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 972 MovieClip [__Packages.nick.avatar.tentpole.GameCamera] Frame 0
class nick.avatar.tentpole.GameCamera extends smashing.rampage.BaseCamera
{
static var _instance;
var _scrollRate, _scrollDirection, y, _zoomRate, _targetY, _zoomDirection;
function GameCamera () {
super();
}
static function init(t_path, t_depth, dimensions) {
_instance = new nick.avatar.tentpole.GameCamera(t_path, t_depth, dimensions);
}
static function getInstance() {
return(_instance);
}
function getGameState() {
return(nick.avatar.tentpole.GameState.getInstance());
}
function generate(t_data) {
super.generate(t_data);
goManualMode();
}
function goManualMode() {
_scrollRate = _MANUAL_SCROLL_RATE;
_scrollDirection = 0;
update = updateManual;
}
function goZoomMode(pY) {
if (Math.abs(pY - y) < 25) {
return(undefined);
}
_scrollDirection = 0;
_zoomRate = _ZOOM_BASE;
_targetY = pY;
_zoomDirection = ((_targetY < y) ? -1 : 1);
update = updateZoom;
}
function cancelZoom() {
_targetY = y;
_zoomRate = 0;
}
function zoomToPoint(pY) {
goZoomMode(pY);
}
function setScrollDir(pDir) {
_scrollDirection = pDir;
_scrollRate = _MANUAL_SCROLL_RATE;
}
function update(dt) {
}
function updateManual(dt) {
y = y + ((_scrollDirection * _scrollRate) * dt);
_scrollRate = _scrollRate + (_MANUAL_SCROLL_ACCEL * dt);
if (_scrollRate > _MANUAL_SCROLL_MAX) {
_scrollRate = _MANUAL_SCROLL_MAX;
}
if (y > _BOUNDS_BOTTOM) {
y = _BOUNDS_BOTTOM;
}
if (y < _BOUNDS_TOP) {
y = _BOUNDS_TOP;
}
}
function updateZoom(dt) {
y = y + ((_zoomDirection * _zoomRate) * dt);
_zoomRate = _zoomRate + (_ZOOM_ACCEL * dt);
if (((_zoomDirection > 0) && (y >= _targetY)) || ((_zoomDirection < 0) && (y <= _targetY))) {
y = _targetY;
finishZoom();
return(undefined);
}
if (y > _BOUNDS_BOTTOM) {
y = _BOUNDS_BOTTOM;
finishZoom();
}
if (y < _BOUNDS_TOP) {
y = _BOUNDS_TOP;
finishZoom();
}
}
function finishZoom() {
goManualMode();
}
function updateShake() {
}
var _ENFORCE_BOUNDS = true;
var _MANUAL_SCROLL_RATE = 150;
var _MANUAL_SCROLL_ACCEL = 150;
var _MANUAL_SCROLL_MAX = 400;
var _ZOOM_BASE = 75;
var _ZOOM_ACCEL = 375;
var _BOUNDS_TOP = 200;
var _BOUNDS_BOTTOM = 1900;
}
Symbol 973 MovieClip [__Packages.nick.avatar.tentpole.GameState] Frame 0
class nick.avatar.tentpole.GameState
{
static var _instance;
var levelNum, score, bonus, hasChanged, helpFromGameplay, left, right, up, down, strength;
function GameState () {
}
static function getInstance() {
if (_instance == null) {
_instance = new nick.avatar.tentpole.GameState();
}
return(_instance);
}
function resetGame() {
levelNum = 0;
score = 0;
bonus = 0;
hasChanged = true;
helpFromGameplay = false;
left = (right = (up = (down = false)));
}
function resetLevel() {
left = (right = (up = (down = false)));
}
function selectEarthStrength() {
strength = "earth";
}
function selectWaterStrength() {
strength = "water";
}
function selectBalanceStrength() {
strength = "balance";
}
function addScore(val) {
score = score + val;
hasChanged = true;
}
function onLeftDown() {
left = true;
}
function onLeftUp() {
left = false;
}
function onRightDown() {
right = true;
}
function onRightUp() {
right = false;
}
function onDownDown() {
down = true;
}
function onDownUp() {
down = false;
}
function onUpDown() {
up = true;
}
function onUpUp() {
up = false;
}
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 HEX_WIDTH = 60.2;
var HEX_HEIGHT = 52;
}
Symbol 974 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 (pData) {
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(pData);
}
function init(pData) {
if (pData.asset == undefined) {
pData.asset = _DEF_ASSET;
}
assetID = pData.asset;
if (pData.x == undefined) {
pData.x = 0;
}
startX = pData.x;
if (pData.y == undefined) {
pData.y = 0;
}
startY = pData.y;
if (pData.z == undefined) {
pData.z = _DEF_Z;
}
startZ = pData.z;
if (_camera != undefined) {
initScale();
}
x = startX;
y = startY;
z = startZ;
if (pData.depthInfluence == undefined) {
pData.depthInfluence = 0;
}
depthInfluence = pData.depthInfluence;
if (pData.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 = Math.ceil((((x - _camera.x) * scale) + _camera.__get__sc().x) * 100) / 100;
mc._y = Math.ceil((((y - _camera.y) * scale) + _camera.__get__sc().y) * 100) / 100;
}
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;
}
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() {
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 975 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 = [];
}
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
}
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) {
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 976 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 (pData) {
id = pData.id;
elements = [];
index = pData.index;
totalSlots = pData.slots;
if (pData.scrollport == undefined) {
pData.scrollport = false;
}
scrollport = pData.scrollport;
if (pData.sortAxis == undefined) {
pData.sortAxis = "";
}
sortAxis = pData.sortAxis;
if (sortAxis == "") {
if (pData.reverse == undefined) {
pData.reverse = false;
}
reverse = pData.reverse;
ascending = false;
_sortRate = 0;
doSort = false;
doActiveSort = false;
} else {
doSort = true;
reverse = false;
if (totalSlots < 10000) {
totalSlots = 10000;
}
if (pData.ascending == undefined) {
pData.ascending = false;
}
ascending = pData.ascending;
if (pData.sortRate == undefined) {
pData.sortRate = 0;
doActiveSort = false;
} else {
doActiveSort = true;
}
_sortRate = pData.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() {
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);
}
}
}
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() {
_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) {
}
} else {
_targetDepth++;
if (_targetDepth > _max) {
}
}
}
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) {
}
}
_current = _max;
_sortTimer = _sortRate;
awaitingSort = false;
}
}
Symbol 977 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 978 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() {
return(((((("Point3D (" + x) + ",") + y) + ",") + z) + ")");
}
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 979 MovieClip [__Packages.nick.avatar.tentpole.GameRenderable] Frame 0
class nick.avatar.tentpole.GameRenderable extends smashing.rampage.Renderable
{
var linkCamera, _gravity;
function GameRenderable (pData) {
super(pData);
}
function init(pData) {
super.init(pData);
linkCamera(nick.avatar.tentpole.GameCamera.getInstance());
if (pData.gravity != undefined) {
_gravity = pData.gravity;
}
}
}
Symbol 980 MovieClip [__Packages.nick.avatar.tentpole.ents.GridDisplay] Frame 0
class nick.avatar.tentpole.ents.GridDisplay extends nick.avatar.tentpole.GameRenderable
{
var _hexWidth, _hexHeight, mc, _camera;
function GridDisplay () {
super({});
smashing.rampage.viewport.Viewport.getInstance().draw({element:this});
_hexWidth = nick.avatar.tentpole.GameState.getInstance().HEX_WIDTH;
_hexHeight = nick.avatar.tentpole.GameState.getInstance().HEX_HEIGHT;
mc._x = nick.avatar.tentpole.GameState.getInstance().HALF_WIDTH;
}
function update(dt) {
}
function render(dt) {
var _local2 = Math.floor(_camera.y / _hexHeight);
var _local3 = _local2 * _hexHeight;
var _local4 = (((_local2 % 2) == 0) ? 0 : (-_hexHeight));
mc._y = _local4 - (_camera.y - _local3);
}
function updateDraw() {
}
function onDraw(pNewMC) {
super.onDraw(pNewMC);
mc.cacheAsBitmap = true;
}
var TYPE = "gridDisplay";
var DRAWTYPE = "grid";
var _DEF_ASSET = "grid";
}
Symbol 981 MovieClip [__Packages.nick.avatar.tentpole.ents.GroundDisplay] Frame 0
class nick.avatar.tentpole.ents.GroundDisplay extends nick.avatar.tentpole.GameRenderable
{
var _width, _height, _hexWidth, _hexHeight, mc, _camera;
function GroundDisplay () {
super({});
smashing.rampage.viewport.Viewport.getInstance().draw({element:this});
_width = nick.avatar.tentpole.GameState.getInstance().SCREEN_WIDTH;
_height = nick.avatar.tentpole.GameState.getInstance().SCREEN_HEIGHT;
_hexWidth = nick.avatar.tentpole.GameState.getInstance().HEX_WIDTH;
_hexHeight = nick.avatar.tentpole.GameState.getInstance().HEX_HEIGHT;
mc._x = _width / 2;
mc._y = 0;
}
function update(dt) {
}
function render(dt) {
mc._y = -_camera.y;
}
function updateDraw() {
}
function onDraw(pNewMC) {
super.onDraw(pNewMC);
mc.cacheAsBitmap = true;
}
var TYPE = "groundDisplay";
var DRAWTYPE = "bg";
var _DEF_ASSET = "ground";
}
Symbol 982 MovieClip [__Packages.nick.avatar.tentpole.ents.Entity] Frame 0
class nick.avatar.tentpole.ents.Entity extends nick.avatar.tentpole.GameRenderable
{
var doRemove, DRAWTYPE, specialDepth;
function Entity (pData) {
super(pData);
}
function init(pData) {
doRemove = false;
super.init(pData);
}
function updateDraw() {
if (doRemove) {
return(undefined);
}
super.updateDraw();
}
function getDrawType() {
return(((HAS_SPECIAL_DEPTH == true) ? ((DRAWTYPE + "_") + specialDepth) : (DRAWTYPE)));
}
var _USE_ACTUAL_DIMENSIONS = false;
var _USE_DIMENSIONS_AS_HD = false;
var HAS_SPECIAL_DEPTH = false;
var FRIENDLY = true;
var OBSTACLE = false;
}
Symbol 983 MovieClip [__Packages.nick.avatar.tentpole.ents.Unit] Frame 0
class nick.avatar.tentpole.ents.Unit extends nick.avatar.tentpole.ents.Entity
{
var _currentHex, _interactable, _pendingAction, _health, alive, _isAnimating, _actionHex, mc, _motionLine, x, y, doRemove, _isFrozen, _freezeDuration, _actionLineMC;
function Unit (pHex) {
super({x:pHex.x, y:pHex.y});
_currentHex = pHex;
_currentHex.occupy(this);
_interactable = false;
_pendingAction = "";
_health = _HEALTH;
alive = true;
_isAnimating = false;
}
function get frame() {
return(_FRAME);
}
function get health() {
return(_health);
}
function get force() {
return(_FORCE);
}
function get move() {
return(_MOVE);
}
function get range() {
return(_RANGE);
}
function get unitType() {
return(_UNIT_TYPE);
}
function get unitClass() {
return(_UNIT_CLASS);
}
function get unitName() {
return(_FRAME);
}
function get action1() {
return(_ACTION_1);
}
function get action2() {
return(_ACTION_2);
}
function get action3() {
return(_ACTION_3);
}
function get primaryAction() {
return(_ACTION_1);
}
function get hex() {
return(_currentHex);
}
function get actionHex() {
return(_actionHex);
}
function get pendingAction() {
return(_pendingAction);
}
function get isActing() {
return(_pendingAction != "");
}
function get isReacting() {
return(_isAnimating);
}
function prepForAction() {
_clearActionLine();
if (_interactable) {
removeInteraction();
}
if (!(_pendingAction === "move")) {
} else {
_currentHex.vacate();
mc.piece.gotoAndStop("move");
_updateHealth();
}
}
function removeInteraction() {
_clearButtonActions();
_interactable = false;
}
function prepForInteraction() {
_interactable = true;
_createButtonActions();
}
function act(dt) {
if (!(_pendingAction === "move")) {
} else {
_motionLine = new smashing.Point3D(_actionHex.x - x, _actionHex.y - y, 0);
if (_motionLine.__get__length() <= (_MOVE_SPEED * dt)) {
x = _actionHex.x;
y = _actionHex.y;
completeAction();
} else {
_motionLine.__set__length(_MOVE_SPEED);
x = x + (_motionLine.x * dt);
y = y + (_motionLine.y * dt);
}
}
}
function react(dt) {
if (_isAnimating) {
if (!alive) {
if (mc.piece.anim._currentframe == mc.piece.anim._totalframes) {
smashing.rampage.Messenger.sendMessage("world", "onUnitDefeated", {unit:this});
doRemove = true;
_isAnimating = false;
}
}
}
}
function playAttackAnimation() {
mc.attack_mc.gotoAndPlay("attack");
}
function takeDamage(pCause) {
if (!alive) {
return(undefined);
}
if (_isFrozen) {
onFreezeEnd();
}
smashing.rampage.Messenger.sendMessage("world", "showFloatingText", {unit:this, val:pCause.__get__force()});
_health = _health - pCause.force;
_updateHealth();
if (health <= 0) {
die();
}
}
function takeNumericalDamage(pNumber) {
if (!alive) {
return(undefined);
}
if (_isFrozen) {
onFreezeEnd();
}
smashing.rampage.Messenger.sendMessage("world", "showFloatingText", {unit:this, val:pNumber});
_health = _health - pNumber;
_updateHealth();
if (health <= 0) {
die();
}
}
function _updateHealth() {
mc.piece.txt_health.text = _health;
}
function die() {
alive = false;
_isAnimating = true;
mc.piece.gotoAndStop("die");
}
function completeAction() {
if (!(_pendingAction === "move")) {
} else {
_currentHex = _actionHex;
_currentHex.occupy(this);
mc.piece.gotoAndStop("idle");
_updateHealth();
}
onClearAction(false);
}
function onSelected() {
_createCancelButton();
mc.piece.gotoAndStop("selected");
_updateHealth();
}
function onDeselected() {
mc.piece.gotoAndStop("idle");
_updateHealth();
_createButtonActions();
}
function onSelectMoveHex(pHex) {
if (_pendingAction != "") {
onClearAction(true);
}
if (_isFrozen) {
_freezeDuration--;
if (_freezeDuration <= 0) {
onFreezeEnd();
}
return(undefined);
}
_pendingAction = "move";
_actionHex = pHex;
_actionHex.claim();
_updateActionLine();
}
function onSelectAttackHex(pHex) {
if (_pendingAction != "") {
onClearAction(true);
}
if (_isFrozen) {
_freezeDuration--;
if (_freezeDuration <= 0) {
onFreezeEnd();
}
return(undefined);
}
_pendingAction = "attack";
_actionHex = pHex;
_updateActionLine();
}
function onSelectFreeze(pHex) {
if (_pendingAction != "") {
onClearAction(true);
}
_pendingAction = "freeze";
_actionHex = pHex;
_updateActionLine();
}
function onSelectBarricade(pHex) {
if (_pendingAction != "") {
onClearAction(true);
}
_pendingAction = "barricade";
_actionHex = pHex;
_actionHex.claim();
_updateActionLine();
}
function onSelectCyclone() {
if (_pendingAction != "") {
onClearAction(false);
}
_pendingAction = "cyclone";
_actionHex = _currentHex;
}
function onClearAction(pSkipDraw) {
if (pSkipDraw == undefined) {
pSkipDraw = false;
}
if ((_pendingAction == "move") || (_pendingAction == "barricade")) {
_actionHex.clearClaim();
}
_pendingAction = "";
_actionHex = null;
if (!pSkipDraw) {
_updateActionLine();
}
}
function canMoveToHex(pHex) {
return(canMoveToHexFrom(_currentHex, pHex));
}
function canMoveToHexFrom(pFromHex, pTargetHex) {
return(((Math.abs(pFromHex.xCoord - pTargetHex.xCoord) <= move) && (Math.abs(pFromHex.yCoord - pTargetHex.yCoord) <= move)) && ((Math.abs(pFromHex.xCoord - pTargetHex.xCoord) + Math.abs(pFromHex.yCoord - pTargetHex.yCoord)) <= (move + 1)));
}
function canAttackHex(pHex) {
return(canAttackHexFrom(_currentHex, pHex));
}
function canAttackHexFrom(pFromHex, pTargetHex) {
return(((Math.abs(pFromHex.xCoord - pTargetHex.xCoord) <= range) && (Math.abs(pFromHex.yCoord - pTargetHex.yCoord) <= range)) && ((Math.abs(pFromHex.xCoord - pTargetHex.xCoord) + Math.abs(pFromHex.yCoord - pTargetHex.yCoord)) <= (range + ((move == 0) ? 2 : 1))));
}
function canMeleeHex(pHex) {
return(canMeleeHexFrom(_currentHex, pHex));
}
function canMeleeHexFrom(pFromHex, pTargetHex) {
return(((Math.abs(pFromHex.xCoord - pTargetHex.xCoord) <= 1) && (Math.abs(pFromHex.yCoord - pTargetHex.yCoord) <= 1)) && ((Math.abs(pFromHex.xCoord - pTargetHex.xCoord) + Math.abs(pFromHex.yCoord - pTargetHex.yCoord)) <= 2));
}
function canReachMeleeHex(pHex) {
return(canReachMeleeHexFrom(_currentHex, pHex));
}
function canReachMeleeHexFrom(pFromHex, pTargetHex) {
return(((Math.abs(pFromHex.xCoord - pTargetHex.xCoord) <= (move + 1)) && (Math.abs(pFromHex.yCoord - pTargetHex.yCoord) <= (move + 1))) && ((Math.abs(pFromHex.xCoord - pTargetHex.xCoord) + Math.abs(pFromHex.yCoord - pTargetHex.yCoord)) <= (move + 2)));
}
function canReachHex(pHex) {
return(canReachHexFrom(_currentHex, pHex));
}
function canReachHexFrom(pFromHex, pTargetHex) {
return(((Math.abs(pFromHex.xCoord - pTargetHex.xCoord) <= (range + move)) && (Math.abs(pFromHex.yCoord - pTargetHex.yCoord) <= (range + move))) && ((Math.abs(pFromHex.xCoord - pTargetHex.xCoord) + Math.abs(pFromHex.yCoord - pTargetHex.yCoord)) <= ((range + move) + 1)));
}
function _updateActionLine() {
_clearActionLine();
if ((_pendingAction == "") || (!FRIENDLY)) {
return(undefined);
}
var _local2;
if (_pendingAction == "move") {
_local2 = 5617147 /* 0x55B5FB */;
} else if (_pendingAction == "attack") {
_local2 = 10027008 /* 0x990000 */;
} else if (_pendingAction == "freeze") {
_local2 = 1572606 /* 0x17FEFE */;
} else if (_pendingAction == "barricade") {
_local2 = 16759413 /* 0xFFBA75 */;
} else {
_local2 = 52224;
}
_actionLineMC = new nick.avatar.tentpole.ents.ActionLine(this, _actionHex, _local2);
}
function _clearActionLine() {
if (_actionLineMC != null) {
_actionLineMC.kill();
delete _actionLineMC;
}
}
function onDraw(pNewMc) {
super.onDraw(pNewMc);
mc.gotoAndStop(_FRAME);
mc.cacheAsBitmap = true;
if (_interactable) {
_createButtonActions();
}
_updateHealth();
}
function onFreeze() {
mc.piece.gotoAndStop("freeze");
_isFrozen = true;
_freezeDuration = _FREEZE_DURATION;
_updateHealth();
_clearButtonActions();
_createButtonActions();
}
function onFreezeEnd() {
mc.piece.gotoAndStop("unfreeze");
_updateHealth();
_isFrozen = false;
_clearButtonActions();
_createButtonActions();
}
function getAttackCameraY() {
return(_actionHex.y + 45);
}
function getActionEffect() {
return(_ATTACK_EFFECT);
}
function _createButtonActions() {
if (mc == null) {
return(undefined);
}
mc.piece.myUnit = this;
mc.piece.onRelease = function () {
smashing.rampage.Messenger.sendMessage("world", "onSelectUnit", {unit:this.myUnit});
};
if (_isFrozen) {
return(undefined);
}
mc.piece.onRollOver = function () {
this.myUnit.onRollOverUnit();
};
mc.piece.onRollOut = (mc.piece.onDragOut = function () {
this.myUnit.onRollOutUnit();
});
}
function onRollOverUnit() {
mc.piece.gotoAndStop("over");
_updateHealth();
}
function onRollOutUnit() {
if (mc.piece._currentFrame <= 9) {
mc.piece.gotoAndStop("idle");
}
_updateHealth();
}
function _createCancelButton() {
if (mc == null) {
return(undefined);
}
mc.piece.myUnit = this;
mc.piece.onRelease = function () {
smashing.rampage.Messenger.sendMessage("world", "onCancelUnitActions", {unit:this.myUnit});
};
delete mc.piece.onRollOver;
delete mc.piece.onRollOut;
delete mc.piece.onDragOut;
}
function _clearButtonActions() {
delete mc.piece.onRelease;
delete mc.piece.onRollOver;
delete mc.piece.onRollOut;
delete mc.piece.onDragOut;
delete mc.piece.myUnit;
}
function requestErase() {
_clearButtonActions();
super.requestErase();
}
function render(dt) {
super.render(dt);
if (_actionLineMC != null) {
_actionLineMC.render(dt);
}
}
function kill() {
_currentHex.vacate();
_clearActionLine();
requestErase();
}
function toString() {
return(((((("Unit : " + _FRAME) + " , (") + _currentHex.xCoord) + " , ") + _currentHex.yCoord) + ")");
}
var TYPE = "unit";
var DRAWTYPE = "units";
var _DEF_ASSET = "unit";
var _DEF_WIDTH = 50;
var _DEF_HEIGHT = 100;
var _FRAME = "";
var _UNIT_TYPE = "";
var _UNIT_CLASS = "";
var _FORCE = 5;
var _HEALTH = 5;
var _MOVE = 5;
var _RANGE = 5;
var FRIENDLY = true;
var OBSTACLE = false;
var IS_BOSS = false;
var VALUE = 0;
var _ACTION_1 = "attackmove";
var _ACTION_2 = "";
var _ACTION_3 = "";
var _ATTACK_EFFECT = "";
var _SPECIAL_EFFECT = "";
var _MOVE_SPEED = 50;
var CAN_FREEZE = true;
var _FREEZE_DURATION = 1;
}
Symbol 984 MovieClip [__Packages.nick.avatar.tentpole.ents.Hex] Frame 0
class nick.avatar.tentpole.ents.Hex
{
var xCoord, yCoord, _state, _isOffset, x, y, _occupiedFriendly, _occupiedHostile, _occupiedObstacle, _claimed, _pinged, _isLocked;
function Hex (pX, pY) {
xCoord = pX;
yCoord = pY;
_state = nick.avatar.tentpole.GameState.getInstance();
if ((yCoord % 2) != 0) {
_isOffset = true;
} else {
_isOffset = false;
}
x = (xCoord * _state.HEX_WIDTH) + (_state.HEX_WIDTH / (_isOffset ? 2 : 1));
y = yCoord * _state.HEX_HEIGHT;
_occupiedFriendly = (_occupiedHostile = (_occupiedObstacle = false));
_claimed = false;
_pinged = false;
}
function get isOccupied() {
return(((_occupiedFriendly || (_occupiedHostile)) || (_occupiedObstacle)) || (_isLocked));
}
function get isOccupiedHostile() {
return(_occupiedHostile);
}
function get isOccupiedFriendly() {
return(_occupiedFriendly);
}
function get isOccupiedObstacle() {
return(_occupiedObstacle);
}
function get isClaimed() {
return(_claimed || (_isLocked));
}
function get isPinged() {
return(_pinged || (_isLocked));
}
function get isOpen() {
return((!isOccupied) && (!isClaimed));
}
function lock() {
_isLocked = true;
_occupiedFriendly = false;
_occupiedHostile = false;
}
function occupy(pUnit) {
if (pUnit.FRIENDLY) {
_occupiedFriendly = true;
_occupiedHostile = false;
} else {
_occupiedFriendly = false;
_occupiedHostile = true;
}
if (pUnit.OBSTACLE) {
_occupiedObstacle = true;
}
_claimed = false;
}
function vacate() {
_occupiedFriendly = false;
_occupiedHostile = false;
_occupiedObstacle = false;
}
function ping() {
_pinged = true;
}
function clearPing() {
_pinged = false;
}
function claim() {
_claimed = true;
}
function clearClaim() {
_claimed = false;
}
function toString() {
return((("Hex : " + xCoord) + " , ") + yCoord);
}
}
Symbol 985 MovieClip [__Packages.nick.avatar.tentpole.ents.ActionLine] Frame 0
class nick.avatar.tentpole.ents.ActionLine extends nick.avatar.tentpole.ents.Entity
{
var _caster, _target, _color, render, mc, x, y, requestErase;
function ActionLine (pCaster, pTarget, pColor) {
super({x:pCaster.x, y:pCaster.y, caster:pCaster, targ:pTarget, color:pColor});
}
function init(pData) {
_caster = pData.caster;
_target = pData.targ;
_color = pData.color;
super.init(pData);
render(0);
}
function onDraw(pNewMC) {
super.onDraw(pNewMC);
mc.lineStyle(2, _color);
mc.moveTo(0, 0);
mc.lineTo(_target.x - x, _target.y - y);
mc._cacheAsBitmap = true;
}
function kill() {
requestErase();
}
var TYPE = "actionline";
var DRAWTYPE = "actionline";
var _DEF_ASSET = "_empty";
var CUSTOM_DRAW = true;
}
Symbol 986 MovieClip [__Packages.nick.avatar.tentpole.ents.Highlight] Frame 0
class nick.avatar.tentpole.ents.Highlight extends nick.avatar.tentpole.ents.Entity
{
var _hexWidth, _hexHeight, _hexes, _highlights, _color, _infiniteCounter, render, _loop, x, y, mc, requestErase;
function Highlight (pX, pY, pType, pOptions) {
super({x:pX, y:pY});
_hexWidth = nick.avatar.tentpole.GameState.getInstance().HEX_WIDTH;
_hexHeight = nick.avatar.tentpole.GameState.getInstance().HEX_HEIGHT;
_hexes = pOptions;
_highlights = [];
_color = pType;
_infiniteCounter = 1;
smashing.rampage.viewport.Viewport.getInstance().draw({element:this});
}
function onDraw(pNewMC) {
super.onDraw(pNewMC);
render(0);
_loop = _hexes.length;
while (_loop--) {
createHighlightHex(_hexes[_loop].x - x, _hexes[_loop].y - y, _hexes[_loop]);
}
}
function createHighlightHex(pX, pY, pHex) {
pHex.clearPing();
_highlights.push(new nick.avatar.tentpole.ents.HighlightHex(mc.attachMovie("hex", "hex" + _infiniteCounter, _infiniteCounter), pX, pY, pHex, _color));
_infiniteCounter++;
}
function refresh() {
_loop = _highlights.length;
while (_loop--) {
_highlights[_loop].refreshState();
}
}
function updateDraw() {
}
function getDrawType() {
return((((_color == "attack") || "cyclone") ? "overlay" : "highlights"));
}
function kill() {
_loop = _highlights.length;
while (_loop--) {
_highlights[_loop].kill();
}
requestErase();
}
var TYPE = "highlight";
var _DEF_ASSET = "_empty";
}
Symbol 987 MovieClip [__Packages.nick.avatar.tentpole.ents.HighlightHex] Frame 0
class nick.avatar.tentpole.ents.HighlightHex
{
var mc, hexRef, color, _outFrame, _overFrame, _selectFrame, _lastFrame, _isSelected;
function HighlightHex (pMC, pX, pY, pHex, pColor) {
mc = pMC;
x = (pX);
y = (pY);
hexRef = pHex;
color = pColor;
if (color == "move") {
_outFrame = "moveHighlight";
_overFrame = "moveOver";
_selectFrame = "moveSelect";
} else if (color == "enemyMove") {
_outFrame = "enemyHighlight";
_overFrame = "enemyHighlight";
_selectFrame = "enemyHighlight";
} else if (color == "attack") {
_outFrame = "attackHighlight";
_overFrame = "attackOver";
_selectFrame = "attackSelect";
} else if (color == "cyclone") {
_outFrame = "cyclone";
_overFrame = "cyclone";
_selectFrame = "cyclone";
} else if (color == "freeze") {
_outFrame = "freezeHighlight";
_overFrame = "freezeOver";
_selectFrame = "freezeSelect";
} else if (color == "barricade") {
_outFrame = "barricadeHighlight";
_overFrame = "barricadeOver";
_selectFrame = "barricadeSelect";
}
mc.owner = this;
mc.onRelease = function () {
this.owner.onSelect();
};
mc.onRollOver = (mc.onDragOver = function () {
this.owner.onOver();
});
mc.onRollOut = (mc.onDragOut = function () {
this.owner.onOut();
});
_lastFrame = "";
refreshState();
}
function refreshState() {
if ((color != "attack") && (color != "freeze")) {
if (hexRef.__get__isClaimed()) {
_isSelected = true;
mc.gotoAndStop(_selectFrame);
} else {
_isSelected = false;
if ((_lastFrame == _selectFrame) || (_lastFrame == "")) {
_lastFrame = _outFrame;
}
mc.gotoAndStop(_lastFrame);
}
} else {
if (_lastFrame == "") {
_lastFrame = _outFrame;
}
mc.gotoAndStop(_lastFrame);
}
}
function get x() {
return(mc._x);
}
function set x(pX) {
mc._x = pX;
//return(x);
}
function get y() {
return(mc._y);
}
function set y(pY) {
mc._y = pY;
//return(y);
}
function onOver() {
if (_isSelected) {
return(undefined);
}
_lastFrame = _overFrame;
mc.gotoAndStop(_lastFrame);
}
function onOut() {
if (_isSelected) {
return(undefined);
}
_lastFrame = _outFrame;
mc.gotoAndStop(_lastFrame);
}
function onSelect() {
if (_isSelected) {
return(undefined);
}
_lastFrame = _selectFrame;
mc.gotoAndStop(_lastFrame);
_isSelected = true;
smashing.rampage.Messenger.sendMessage("world", "onPressHighlightHex", {hex:hexRef, type:color});
}
function kill() {
mc.removeMovieClip();
}
}
Symbol 988 MovieClip [__Packages.nick.avatar.tentpole.ents.AttackEffect] Frame 0
class nick.avatar.tentpole.ents.AttackEffect extends nick.avatar.tentpole.ents.Entity
{
var _caster, _target, _isFlying, _motionLine, x, y, mc, doRemove, render, requestErase;
function AttackEffect (pEffectID, pUnit, pTarget) {
super({x:pUnit.x, y:pUnit.y, asset:pEffectID});
_caster = pUnit;
_target = pTarget;
_isFlying = true;
}
function updateAndRender(dt) {
if (_isFlying) {
_motionLine = new smashing.Point3D(_target.x - x, _target.y - y, 0);
if (_motionLine.__get__length() <= (_MOVE_SPEED * dt)) {
x = _target.x;
y = _target.y;
_completeFlight();
} else {
_motionLine.__set__length(_MOVE_SPEED);
x = x + (_motionLine.x * dt);
y = y + (_motionLine.y * dt);
mc._rotation = Math.atan2(_motionLine.y, _motionLine.x) * 57.2957795130823;
}
} else if (mc.anim._currentframe == mc.anim._totalframes) {
_caster.completeAction();
smashing.rampage.Messenger.sendMessage("world", "onAttackCollided", {caster:_caster, target:_target});
doRemove = true;
}
render(dt);
}
function _completeFlight() {
_isFlying = false;
mc._rotation = 0;
mc.gotoAndStop("hit");
}
function onDraw(pNewMC) {
super.onDraw(pNewMC);
mc.gotoAndStop("launch");
}
function kill() {
requestErase();
}
var TYPE = "effect";
var DRAWTYPE = "effects";
var _MOVE_SPEED = 300;
var CUSTOM_DRAW = true;
}
Symbol 989 MovieClip [__Packages.nick.avatar.tentpole.ents.CycloneEffect] Frame 0
class nick.avatar.tentpole.ents.CycloneEffect extends nick.avatar.tentpole.ents.Entity
{
var render, _caster, mc, doRemove, requestErase;
function CycloneEffect (pUnit) {
super({x:pUnit.x, y:pUnit.y, asset:"specialAang"});
render(0);
_caster = pUnit;
}
function updateAndRender(dt) {
if (mc._currentframe == mc._totalframes) {
_caster.completeAction();
smashing.rampage.Messenger.sendMessage("world", "onCycloneCollided", {caster:_caster});
doRemove = true;
} else {
render(dt);
}
}
function kill() {
requestErase();
}
var TYPE = "effect";
var DRAWTYPE = "effects";
var CUSTOM_DRAW = true;
}
Symbol 990 MovieClip [__Packages.nick.avatar.tentpole.ents.FreezeEffect] Frame 0
class nick.avatar.tentpole.ents.FreezeEffect extends nick.avatar.tentpole.ents.Entity
{
var render, _caster, _target, mc, doRemove, requestErase;
function FreezeEffect (pUnit, pTarget) {
super({x:pTarget.x, y:pTarget.y, asset:"specialWater"});
render(0);
_caster = pUnit;
_target = pTarget;
}
function updateAndRender(dt) {
if (mc._currentframe == mc._totalframes) {
_caster.completeAction();
smashing.rampage.Messenger.sendMessage("world", "onFreezeCollided", {target:_target});
doRemove = true;
} else {
render(dt);
}
}
function kill() {
requestErase();
}
var TYPE = "effect";
var DRAWTYPE = "effects";
var CUSTOM_DRAW = true;
}
Symbol 991 MovieClip [__Packages.nick.avatar.tentpole.ents.BarricadeEffect] Frame 0
class nick.avatar.tentpole.ents.BarricadeEffect extends nick.avatar.tentpole.ents.Entity
{
var _caster, _target, render, mc, doRemove, requestErase;
function BarricadeEffect (pUnit, pTarget) {
super({x:pTarget.x, y:pTarget.y, asset:"specialEarth"});
_caster = pUnit;
_target = pTarget;
render(0);
}
function updateAndRender(dt) {
if (mc.anim._currentframe == mc.anim._totalframes) {
_caster.completeAction();
smashing.rampage.Messenger.sendMessage("world", "onBarricadeCollided", {target:_target});
doRemove = true;
} else {
render(dt);
}
}
function kill() {
requestErase();
}
var TYPE = "effect";
var DRAWTYPE = "effects";
var CUSTOM_DRAW = true;
}
Symbol 992 MovieClip [__Packages.nick.avatar.tentpole.ents.FloatingText] Frame 0
class nick.avatar.tentpole.ents.FloatingText extends nick.avatar.tentpole.ents.Entity
{
var _value, _lifespan, _suffix, y, isDrawn, mc, doRemove, render, requestErase;
function FloatingText (pData) {
super(pData);
_value = pData.val;
_lifespan = _LIFESPAN;
}
function init(pData) {
_suffix = (pData.friendly ? "Friendly" : "Hostile");
super.init(pData);
}
function updateAndRender(dt) {
y = y - (_FLOAT_RATE * dt);
if (isDrawn) {
mc._xscale = (mc._yscale = mc._xscale + (_SCALE_RATE * dt));
}
_lifespan = _lifespan - dt;
if (_lifespan <= 0) {
doRemove = true;
}
render(dt);
}
function onDraw(pNewMC) {
super.onDraw(pNewMC);
if (_value == 0) {
mc.gotoAndStop("miss" + _suffix);
} else {
mc.gotoAndStop("dam" + _suffix);
mc.txt.text = _value;
}
}
function kill() {
requestErase();
}
var TYPE = "floatText";
var DRAWTYPE = "floatText";
var _DEF_ASSET = "effect_floatingText";
var CUSTOM_DRAW = true;
var _FLOAT_RATE = 65;
var _SCALE_RATE = 60;
var _LIFESPAN = 1.2;
}
Symbol 993 MovieClip [__Packages.nick.avatar.tentpole.ents.Obstacle] Frame 0
class nick.avatar.tentpole.ents.Obstacle extends nick.avatar.tentpole.ents.Entity
{
var _currentHex, _frame, mc, requestErase;
function Obstacle (pHex) {
super({x:pHex.x, y:pHex.y});
_currentHex = pHex;
_currentHex.occupy(this);
_frame = Math.floor(_FRAME_MIN + (Math.random() * (_FRAME_MAX - _FRAME_MIN)));
}
function onDraw(pNewmc) {
super.onDraw(pNewmc);
mc.gotoAndStop(_frame);
mc.cacheAsBitmap = true;
}
function decay() {
}
function kill() {
_currentHex.vacate();
requestErase();
}
var TYPE = "obstacle";
var DRAWTYPE = "obstacle";
var _DEF_ASSET = "obstacle";
var _DEF_WIDTH = 50;
var _DEF_HEIGHT = 100;
var FRIENDLY = true;
var OBSTACLE = true;
var _FRAME_MIN = 4;
var _FRAME_MAX = 9;
}
Symbol 994 MovieClip [__Packages.nick.avatar.tentpole.ents.Barricade] Frame 0
class nick.avatar.tentpole.ents.Barricade extends nick.avatar.tentpole.ents.Obstacle
{
var _lifespan, mc, _currentHex, doRemove;
function Barricade (pHex) {
super(pHex);
_lifespan = _LIFESPAN;
}
function onDraw(pNewmc) {
super.onDraw(pNewmc);
mc.gotoAndStop("idle");
}
function decay() {
_lifespan--;
if (_lifespan <= 0) {
_currentHex.vacate();
doRemove = true;
}
}
var _DEF_ASSET = "specialEarth";
var _LIFESPAN = 3;
}
Symbol 995 MovieClip [__Packages.nick.avatar.tentpole.ents.Scenery] Frame 0
class nick.avatar.tentpole.ents.Scenery extends nick.avatar.tentpole.ents.Entity
{
function Scenery (pData) {
super(pData);
}
var TYPE = "unit";
var DRAWTYPE = "battlements";
var _DEF_ASSET = "harbor";
var _DEF_WIDTH = 100;
var _DEF_HEIGHT = 270;
}
Symbol 996 MovieClip [__Packages.nick.avatar.tentpole.ents.units.Battlement] Frame 0
class nick.avatar.tentpole.ents.units.Battlement extends nick.avatar.tentpole.ents.Unit
{
var _currentHex, _frame, mc;
function Battlement (pHex) {
super(pHex);
if (_currentHex.xCoord == 0) {
_frame = "left";
} else {
_frame = "right";
}
}
function onDraw(pNewMc) {
super.onDraw(pNewMc);
mc.gotoAndStop(_frame);
}
var TYPE = "battlement";
var DRAWTYPE = "battlements";
var _DEF_ASSET = "battlement";
var _DEF_WIDTH = 100;
var _DEF_HEIGHT = 400;
var CAN_FREEZE = false;
var _FRAME = "battlement";
var _FORCE = 3;
var _HEALTH = 18;
var _MOVE = 0;
var _RANGE = 4;
var _UNIT_TYPE = "Fire";
var _UNIT_CLASS = "BATTLEMENT";
var VALUE = 1200;
var _ATTACK_EFFECT = "attackFireElite";
var FRIENDLY = false;
var _ACTION_1 = "";
var _ACTION_2 = "";
var _ACTION_3 = "";
}
Symbol 997 MovieClip [__Packages.nick.avatar.tentpole.ents.units.Aang] Frame 0
class nick.avatar.tentpole.ents.units.Aang extends nick.avatar.tentpole.ents.Unit
{
function Aang (pHex) {
super(pHex);
}
var _FRAME = "aang";
var _UNIT_TYPE = "Air";
var _UNIT_CLASS = "BENDER HERO";
var _ATTACK_EFFECT = "attackAang";
var _SPECIAL_EFFECT = "specialAang";
var _FORCE = 6;
var _HEALTH = 10;
var _MOVE = 3;
var _RANGE = 4;
var FRIENDLY = true;
var _ACTION_2 = "cyclone";
}
Symbol 998 MovieClip [__Packages.nick.avatar.tentpole.ents.units.WaterBender] Frame 0
class nick.avatar.tentpole.ents.units.WaterBender extends nick.avatar.tentpole.ents.Unit
{
function WaterBender (pHex) {
super(pHex);
}
var _ATTACK_EFFECT = "attackWater";
var _SPECIAL_EFFECT = "specialWater";
var _UNIT_TYPE = "Water";
var _UNIT_CLASS = "BENDER SQUADRON";
var _ACTION_2 = "freeze";
}
Symbol 999 MovieClip [__Packages.nick.avatar.tentpole.ents.units.Katara] Frame 0
class nick.avatar.tentpole.ents.units.Katara extends nick.avatar.tentpole.ents.units.WaterBender
{
function Katara (pHex) {
super(pHex);
}
var _FRAME = "katara";
var _FORCE = 5;
var _HEALTH = 8;
var _MOVE = 4;
var _RANGE = 3;
var FRIENDLY = true;
}
Symbol 1000 MovieClip [__Packages.nick.avatar.tentpole.ents.units.EarthBender] Frame 0
class nick.avatar.tentpole.ents.units.EarthBender extends nick.avatar.tentpole.ents.Unit
{
function EarthBender (pHex) {
super(pHex);
}
var _UNIT_TYPE = "Earth";
var _UNIT_CLASS = "BENDER SQUADRON";
var _ACTION_2 = "barricade";
var _ATTACK_EFFECT = "attackEarth";
var _SPECIAL_EFFECT = "specialEarth";
}
Symbol 1001 MovieClip [__Packages.nick.avatar.tentpole.ents.units.Toph] Frame 0
class nick.avatar.tentpole.ents.units.Toph extends nick.avatar.tentpole.ents.units.EarthBender
{
function Toph (pHex) {
super(pHex);
}
var _FRAME = "toph";
var _FORCE = 4;
var _HEALTH = 10;
var _MOVE = 4;
var _RANGE = 3;
var FRIENDLY = true;
}
Symbol 1002 MovieClip [__Packages.nick.avatar.tentpole.ents.units.Sokka] Frame 0
class nick.avatar.tentpole.ents.units.Sokka extends nick.avatar.tentpole.ents.units.WaterBender
{
function Sokka (pHex) {
super(pHex);
}
var _FRAME = "sokka";
var _FORCE = 5;
var _HEALTH = 12;
var _MOVE = 3;
var _RANGE = 3;
var FRIENDLY = true;
}
Symbol 1003 MovieClip [__Packages.nick.avatar.tentpole.ents.units.Fong] Frame 0
class nick.avatar.tentpole.ents.units.Fong extends nick.avatar.tentpole.ents.units.EarthBender
{
function Fong (pHex) {
super(pHex);
}
var _FRAME = "fong";
var _FORCE = 6;
var _HEALTH = 14;
var _MOVE = 2;
var _RANGE = 2;
var FRIENDLY = true;
}
Symbol 1004 MovieClip [__Packages.nick.avatar.tentpole.ents.units.Catapult] Frame 0
class nick.avatar.tentpole.ents.units.Catapult extends nick.avatar.tentpole.ents.Unit
{
function Catapult (pHex) {
super(pHex);
}
var _FRAME = "waterCatapult";
var _ATTACK_EFFECT = "attackWater";
var _UNIT_TYPE = "Water";
var _UNIT_CLASS = "CATAPULT";
var FRIENDLY = true;
var _FORCE = 4;
var _HEALTH = 12;
var _MOVE = 2;
var _RANGE = 4;
}
Symbol 1005 MovieClip [__Packages.nick.avatar.tentpole.ents.units.CatapultEarth] Frame 0
class nick.avatar.tentpole.ents.units.CatapultEarth extends nick.avatar.tentpole.ents.Unit
{
function CatapultEarth (pHex) {
super(pHex);
}
var _FRAME = "earthCatapult";
var _ATTACK_EFFECT = "attackEarth";
var _UNIT_TYPE = "earth";
var _UNIT_CLASS = "CATAPULT";
var FRIENDLY = true;
var _FORCE = 4;
var _HEALTH = 12;
var _MOVE = 2;
var _RANGE = 4;
}
Symbol 1006 MovieClip [__Packages.nick.avatar.tentpole.ents.units.WaterSoldier] Frame 0
class nick.avatar.tentpole.ents.units.WaterSoldier extends nick.avatar.tentpole.ents.Unit
{
function WaterSoldier (pHex) {
super(pHex);
}
var _FRAME = "waterSoldier";
var _FORCE = 2;
var _HEALTH = 8;
var _MOVE = 4;
var _RANGE = 2;
var _UNIT_TYPE = "Water";
var _UNIT_CLASS = "SOLDIER UNIT";
var FRIENDLY = true;
var _ATTACK_EFFECT = "cavalryAttack";
var _ACTION_2 = "";
var _ACTION_3 = "";
}
Symbol 1007 MovieClip [__Packages.nick.avatar.tentpole.ents.units.EarthSoldier] Frame 0
class nick.avatar.tentpole.ents.units.EarthSoldier extends nick.avatar.tentpole.ents.Unit
{
function EarthSoldier (pHex) {
super(pHex);
}
var _FRAME = "earthSoldier";
var _FORCE = 2;
var _HEALTH = 12;
var _MOVE = 3;
var _RANGE = 2;
var _UNIT_TYPE = "Earth";
var _UNIT_CLASS = "SOLDIER UNIT";
var FRIENDLY = true;
var _ATTACK_EFFECT = "cavalryAttack";
var _ACTION_2 = "";
var _ACTION_3 = "";
}
Symbol 1008 MovieClip [__Packages.nick.avatar.tentpole.ents.units.FireBender] Frame 0
class nick.avatar.tentpole.ents.units.FireBender extends nick.avatar.tentpole.ents.Unit
{
var _health;
function FireBender (pHex, pIsWimp) {
super(pHex);
if (pIsWimp) {
_health = 3;
}
}
var _FRAME = "fireSoldier";
var _FORCE = 2;
var _HEALTH = 6;
var _MOVE = 3;
var _RANGE = 1;
var VALUE = 100;
var _UNIT_TYPE = "Fire";
var _UNIT_CLASS = "BENDER SQUADRON";
var _ATTACK_EFFECT = "attackFire";
var FRIENDLY = false;
var _ACTION_1 = "";
var _ACTION_2 = "";
var _ACTION_3 = "";
}
Symbol 1009 MovieClip [__Packages.nick.avatar.tentpole.ents.units.FireCatapult] Frame 0
class nick.avatar.tentpole.ents.units.FireCatapult extends nick.avatar.tentpole.ents.units.Catapult
{
function FireCatapult (pHex) {
super(pHex);
}
var _FRAME = "fireCatapult";
var _ATTACK_EFFECT = "attackFireBattlement";
var _UNIT_TYPE = "Fire";
var VALUE = 200;
var _FORCE = 3;
var _HEALTH = 10;
var _MOVE = 2;
var _RANGE = 4;
var FRIENDLY = false;
var _ACTION_1 = "";
var _ACTION_2 = "";
var _ACTION_3 = "";
}
Symbol 1010 MovieClip [__Packages.nick.avatar.tentpole.ents.units.FireElite] Frame 0
class nick.avatar.tentpole.ents.units.FireElite extends nick.avatar.tentpole.ents.units.FireBender
{
function FireElite (pHex) {
super(pHex);
}
var _FRAME = "fireElite";
var _FORCE = 3;
var _HEALTH = 14;
var _MOVE = 0;
var _RANGE = 4;
var _UNIT_TYPE = "Fire";
var _UNIT_CLASS = "BENDER SQUADRON";
var _ATTACK_EFFECT = "attackFireElite";
var FRIENDLY = false;
var IS_BOSS = true;
var VALUE = 500;
var _ACTION_1 = "";
var _ACTION_2 = "";
var _ACTION_3 = "";
}
Symbol 1011 MovieClip [__Packages.nick.avatar.tentpole.ents.units.Rhino] Frame 0
class nick.avatar.tentpole.ents.units.Rhino extends nick.avatar.tentpole.ents.Unit
{
function Rhino (pHex) {
super(pHex);
}
var _FRAME = "rhino";
var _ATTACK_EFFECT = "attackRhino";
var _FORCE = 4;
var _HEALTH = 12;
var _MOVE = 2;
var _RANGE = 1;
var VALUE = 300;
var FRIENDLY = false;
var _UNIT_TYPE = "Fire";
var _UNIT_CLASS = "RHINO UNIT";
var _ACTION_1 = "";
var _ACTION_2 = "";
var _ACTION_3 = "";
}
Symbol 1012 MovieClip [__Packages.nick.avatar.tentpole.ui.UI] Frame 0
class nick.avatar.tentpole.ui.UI
{
static var _instance;
var engine, _nextScreenID, _hasActiveScreen, _doesActiveScreenUpdate, _activeScreen, _previousScreenID, _activeScreenID;
function UI () {
}
static function init() {
_instance = new nick.avatar.tentpole.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.tentpole.ui.Splash(engine.screen_mc, this);
break;
case "gameplay" :
_activeScreen = new nick.avatar.tentpole.ui.GamePlay(engine.screen_mc, this);
break;
case "select" :
_activeScreen = new nick.avatar.tentpole.ui.Select(engine.screen_mc, this, false);
break;
case "lose" :
_activeScreen = new nick.avatar.tentpole.ui.Lose(engine.screen_mc, this);
break;
case "help" :
_activeScreen = new nick.avatar.tentpole.ui.Help(engine.screen_mc, this);
break;
case "win" :
_activeScreen = new nick.avatar.tentpole.ui.Win(engine.screen_mc, this);
break;
case "highscore" :
_activeScreen = new nick.avatar.tentpole.ui.Highscores(engine.screen_mc, this);
break;
default :
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) {
return(undefined);
}
goScreen(t_data.screen);
}
function onMessageReceived(message, args) {
this[message](args);
}
function get currentScreenID() {
return(_activeScreenID);
}
}
Symbol 1013 MovieClip [__Packages.nick.avatar.tentpole.ui.Screen] Frame 0
class nick.avatar.tentpole.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 = true;
var _HAS_OUTRO = true;
var _OPENED_FRAME = 10;
var DOES_UPDATE = true;
}
Symbol 1014 MovieClip [__Packages.nick.avatar.tentpole.ui.Splash] Frame 0
class nick.avatar.tentpole.ui.Splash extends nick.avatar.tentpole.ui.Screen
{
var _mc;
function Splash (mc, ui) {
super(mc, ui);
}
function onOpened() {
super.onOpened();
_mc.btn_play.onRelease = function () {
smashing.rampage.Messenger.sendMessage("engine", "onPressSplashPlay");
};
_mc.btn_highscore.onRelease = function () {
smashing.rampage.Messenger.sendMessage("engine", "onPressViewScores");
};
}
var _HAS_INTRO = true;
var _HAS_OUTRO = true;
var _OPENED_FRAME = 67;
}
Symbol 1015 MovieClip [__Packages.nick.avatar.tentpole.ui.GamePlay] Frame 0
class nick.avatar.tentpole.ui.GamePlay extends nick.avatar.tentpole.ui.Screen
{
var _state, _isUnitSelected, _mc, _selectedUnit, _menuMode;
function GamePlay (mc, ui, fromHelpScreen) {
super(mc, ui);
_state = nick.avatar.tentpole.GameState.getInstance();
}
function onOpened() {
super.onOpened();
update(0, true);
hidePopup();
_isUnitSelected = false;
if (_state.helpFromGameplay) {
smashing.rampage.Messenger.sendMessage("world", "onReturnFromHelp");
_state.helpFromGameplay = false;
} else {
showIntro();
}
}
function showIntro() {
_mc.gotoAndStop("gameBegin");
}
function onSelectUnit(pArgs) {
if (!_isUnitSelected) {
_mc.gotoAndPlay("hudIn");
} else {
_mc.gotoAndStop("hud");
}
_isUnitSelected = true;
_selectedUnit = pArgs.unit;
activateScrollButtons();
if (_mc.hud_mc.btn_next._currentframe >= 25) {
_mc.hud_mc.btn_next.gotoAndStop("_up");
}
_mc.hud_mc.btn_next.onRelease = function () {
smashing.rampage.Messenger.sendMessage("world", "onPressNextSquad");
};
_populateHud();
}
function onDeselectUnit() {
_clearHUDButtons();
_mc.gotoAndPlay("action");
}
function activateScrollButtons() {
_mc.btn_up.onRollOver = function () {
smashing.rampage.Messenger.sendMessage("world", "beginScrollUp");
};
_mc.btn_up.onRollOut = (_mc.btn_up.onDragOut = function () {
smashing.rampage.Messenger.sendMessage("world", "endScrollUp");
});
_mc.btn_down.onRollOver = function () {
smashing.rampage.Messenger.sendMessage("world", "beginScrollDown");
};
_mc.btn_down.onRollOut = (_mc.btn_down.onDragOut = function () {
smashing.rampage.Messenger.sendMessage("world", "endScrollDown");
});
}
function highlightNextSquad() {
_mc.hud_mc.btn_next.gotoAndStop("alert");
}
function highlightEndTurn() {
_mc.hud_mc.btn_confirm.gotoAndStop("_over");
}
function _makeActionButton(pMC, pAction) {
pMC.action = pAction;
pMC.onRelease = function () {
smashing.rampage.Messenger.sendMessage("world", "triggerAction", {action:this.action});
};
}
function _populateHud() {
_mc.hud_mc.thumb_mc.gotoAndStop(_selectedUnit.__get__frame());
if (_selectedUnit.__get__action1() == "") {
_mc.hud_mc.btn_1.gotoAndStop("enemyUnit");
_clearButton(_mc.hud_mc.btn_1.btn);
} else {
_mc.hud_mc.btn_1.gotoAndStop(_selectedUnit.__get__action1());
_mc.hud_mc.btn_1._visible = true;
_makeActionButton(_mc.hud_mc.btn_1.btn, _selectedUnit.__get__action1());
}
if (_selectedUnit.__get__action2() == "") {
_hideButton(_mc.hud_mc.btn_2);
} else {
_mc.hud_mc.btn_2.gotoAndStop(_selectedUnit.__get__action2());
_mc.hud_mc.btn_2._visible = true;
_makeActionButton(_mc.hud_mc.btn_2.btn, _selectedUnit.__get__action2());
}
_mc.hud_mc.btn_confirm.onRelease = function () {
smashing.rampage.Messenger.sendMessage("world", "onConfirmCommands");
};
_mc.hud_mc.btn_menu.onRollOver = function () {
smashing.rampage.Messenger.sendMessage("screen", "onOpenMenu");
};
_mc.hud_mc.stats_mc.txt_class.text = _selectedUnit.unitClass;
_mc.hud_mc.stats_mc.txt_type.text = _selectedUnit.unitType;
_mc.hud_mc.stats_mc.txt_health.text = _selectedUnit.health;
_mc.hud_mc.stats_mc.txt_force.text = _selectedUnit.force;
_mc.hud_mc.stats_mc.txt_move.text = _selectedUnit.move;
_mc.hud_mc.stats_mc.txt_range.text = _selectedUnit.range;
}
function onOpenMenu() {
_mc.hud_mc.menu_popup.gotoAndPlay(2);
_menuMode = true;
_mc.hud_mc.menu_popup.bg_hd.onRelease = function () {
};
_mc.hud_mc.menu_popup.bg_hd.useHandCursor = false;
}
function onCloseMenu() {
_mc.hud_mc.menu_popup.gotoAndStop(1);
_menuMode = false;
}
function _clearHUDButtons() {
_clearButton(_mc.hud_mc.btn_1.btn);
_clearButton(_mc.hud_mc.btn_2.btn);
_clearButton(_mc.hud_mc.btn_confirm);
_clearButton(_mc.hud_mc.btn_menu);
}
function _clearButton(pMC) {
delete pMC.onRelease;
}
function _hideButton(pMC) {
_clearButton(pMC);
pMC._visible = false;
}
function goResume() {
_mc.gotoAndPlay("resume");
activateScrollButtons();
_isUnitSelected = false;
}
function goAction() {
_clearHUDButtons();
_mc.gotoAndPlay("action");
_isUnitSelected = false;
}
function goEnemy() {
_mc.gotoAndPlay("enemy");
}
function popupActionConfirm() {
_mc.popup_mc.gotoAndStop("confirmCommands2");
_mc.popup_mc.hd.useHandCursor = false;
onCloseMenu();
}
function onPressHelp() {
smashing.rampage.Messenger.sendMessage("engine", "goInGameHelp");
onCloseMenu();
}
function onPressQuit() {
_mc.popup_mc.gotoAndStop("quitConfirm");
_mc.popup_mc.hd.useHandCursor = false;
}
function onPressConfirmYes() {
hidePopup();
smashing.rampage.Messenger.sendMessage("world", "onForceConfirmCommands");
}
function onPressConfirmNo() {
hidePopup();
}
function onPressQuitYes() {
hidePopup();
smashing.rampage.Messenger.sendMessage("engine", "onGoGameOver");
}
function onPressQuitNo() {
hidePopup();
}
function hidePopup() {
_mc.popup_mc.gotoAndStop("hidden");
}
function updateSoundArt() {
if (nick.avatar.tentpole.Sounds.getInstance().muteMusic) {
_mc.hud_mc.menu_popup.btn_sound.gotoAndStop("off");
} else {
_mc.hud_mc.menu_popup.btn_sound.gotoAndStop("on");
}
}
function update(dt, forceUpdate) {
super.update(dt);
if (_menuMode) {
if ((((_xmouse < 480) || (_xmouse > 590)) || (_ymouse < 142)) || (_ymouse > 297)) {
onCloseMenu();
}
}
if (_state.hasChanged || (forceUpdate == true)) {
_mc.txt_score.text = _state.score;
}
}
var DOES_UPDATE = true;
var _OPENED_FRAME = 0;
var _HAS_INTRO = false;
}
Symbol 1016 MovieClip [__Packages.nick.avatar.tentpole.ui.Select] Frame 0
class nick.avatar.tentpole.ui.Select extends nick.avatar.tentpole.ui.Screen
{
var _mc;
function Select (mc, ui) {
super(mc, ui);
}
function onOpened() {
super.onOpened();
_mc.btn_balance.onRelease = function () {
smashing.rampage.Messenger.sendMessage("engine", "onSelectBalance");
};
_mc.btn_water.onRelease = function () {
smashing.rampage.Messenger.sendMessage("engine", "onSelectWater");
};
_mc.btn_earth.onRelease = function () {
smashing.rampage.Messenger.sendMessage("engine", "onSelectEarth");
};
}
function close() {
delete _mc.btn_balance.onRelease;
delete _mc.btn_water.onRelease;
delete _mc.btn_earth.onRelease;
super.close();
}
var _HAS_INTRO = true;
var _HAS_OUTRO = true;
var _OPENED_FRAME = 37;
}
Symbol 1017 MovieClip [__Packages.nick.avatar.tentpole.ui.Lose] Frame 0
class nick.avatar.tentpole.ui.Lose extends nick.avatar.tentpole.ui.Screen
{
var _state, _isOpening, _mc;
function Lose (mc, ui) {
super(mc, ui);
_state = nick.avatar.tentpole.GameState.getInstance();
}
function onOpened() {
_isOpening = false;
_mc.score_mc.txt_score.text = _state.score;
_mc.btn_play.onRelease = function () {
smashing.rampage.Messenger.sendMessage("engine", "onPressPlayAgain");
};
_mc.btn_view.onRelease = function () {
smashing.rampage.Messenger.sendMessage("engine", "onPressViewScores");
};
if (nick.highscores.HighscoreEngine.__get__isLoggedIn()) {
_mc.btn_submit.onRelease = function () {
smashing.rampage.Messenger.sendMessage("engine", "onPressGameOverSubmitScore");
};
} else {
_mc.btn_submit._visible = false;
}
}
var _HAS_INTRO = true;
var _HAS_OUTRO = false;
var _OPENED_FRAME = 61;
}
Symbol 1018 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) {
_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.showLoading();
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.showLoading();
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();
}
static var _USE_XML = true;
static var _XML_FILE_URL = "config.xml";
static var _SCORE_CALL = "onHighscores";
static var _DO_DEBUG = false;
}
Symbol 1019 MovieClip [__Packages.nick.highscores.HighscoreTable] Frame 0
class nick.highscores.HighscoreTable extends MovieClip
{
var gotoAndStop, _currentframe, gotoAndPlay, btn_next, btn_back, btn_submit, _scores, _player, _page, _totalPages, 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();
btn_next.onRelease = function () {
this._parent.nextPage();
};
btn_back.onRelease = function () {
this._parent.prevPage();
};
btn_submit.onRelease = function () {
nick.highscores.HighscoreEngine.submitFromBoard();
};
}
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();
}
var _SCORES_PER_PAGE = 10;
}
Symbol 1020 MovieClip [__Packages.nick.avatar.tentpole.ui.Help] Frame 0
class nick.avatar.tentpole.ui.Help extends nick.avatar.tentpole.ui.Screen
{
var _mc, _currentScreen, _selectedButton, _storedOnRelease;
function Help (mc, ui) {
super(mc, ui);
}
function onOpened() {
super.onOpened();
_mc.btn_back.onRelease = function () {
smashing.rampage.Messenger.sendMessage("screen", "onPressBack");
};
_mc.btn_next.onRelease = function () {
smashing.rampage.Messenger.sendMessage("screen", "onPressNext");
};
_mc.btns_mc.btn_basics.onRelease = function () {
smashing.rampage.Messenger.sendMessage("screen", "onPressBasics");
};
_mc.btns_mc.btn_water.onRelease = function () {
smashing.rampage.Messenger.sendMessage("screen", "onPressWater");
};
_mc.btns_mc.btn_earth.onRelease = function () {
smashing.rampage.Messenger.sendMessage("screen", "onPressEarth");
};
_mc.btns_mc.btn_fire.onRelease = function () {
smashing.rampage.Messenger.sendMessage("screen", "onPressFire");
};
_mc.btns_mc.btn_air.onRelease = function () {
smashing.rampage.Messenger.sendMessage("screen", "onPressAir");
};
_mc.btns_mc.btn_done.onRelease = function () {
smashing.rampage.Messenger.sendMessage("engine", "onPressDoneHelp");
};
onPressBasics();
}
function close() {
_clearButtons();
super.close();
}
function _clearButtons() {
delete _mc.btn_back.onRelease;
delete _mc.btn_next.onRelease;
delete _mc.btns_mc.btn_basics.onRelease;
delete _mc.btns_mc.btn_water.onRelease;
delete _mc.btns_mc.btn_earth.onRelease;
delete _mc.btns_mc.btn_fire.onRelease;
delete _mc.btns_mc.btn_air.onRelease;
delete _mc.btns_mc.btn_done.onRelease;
}
function onPressBasics() {
updateScreen("basics");
}
function onPressWater() {
updateScreen("water");
}
function onPressEarth() {
updateScreen("earth");
}
function onPressFire() {
updateScreen("fire");
}
function onPressAir() {
updateScreen("air");
}
function onPressNext() {
var _local2 = _screenOrder.length;
while (_local2--) {
if (_screenOrder[_local2] == _currentScreen) {
updateScreen(_screenOrder[_local2 + 1]);
return(undefined);
}
}
}
function onPressBack() {
var _local2 = _screenOrder.length;
while (_local2--) {
if (_screenOrder[_local2] == _currentScreen) {
updateScreen(_screenOrder[_local2 - 1]);
return(undefined);
}
}
}
function updateScreen(tScreen) {
_currentScreen = tScreen;
releaseSelectedButton();
_mc.gotoAndStop(_currentScreen);
updateDirectionButtons();
hilightSelectedButton();
}
function updateDirectionButtons() {
if (_currentScreen == _screenOrder[0]) {
_mc.btn_back._visible = false;
_mc.btn_next._visible = true;
} else if (_currentScreen == _screenOrder[_screenOrder.length - 1]) {
_mc.btn_back._visible = true;
_mc.btn_next._visible = false;
} else {
_mc.btn_back._visible = true;
_mc.btn_next._visible = true;
}
}
function hilightSelectedButton() {
_selectedButton = _findButton(_currentScreen);
_storedOnRelease = _selectedButton.onRelease;
_selectedButton.onRelease = null;
_selectedButton.enabled = false;
_selectedButton.gotoAndStop("_down");
}
function releaseSelectedButton() {
if (_selectedButton == null) {
return(undefined);
}
_selectedButton.onRelease = _storedOnRelease;
_selectedButton.enabled = true;
_selectedButton.gotoAndStop("_up");
}
function _findButton(pScreen) {
switch (pScreen) {
case "basics" :
return(_mc.btns_mc.btn_basics);
case "water" :
return(_mc.btns_mc.btn_water);
case "earth" :
return(_mc.btns_mc.btn_earth);
case "air" :
return(_mc.btns_mc.btn_air);
case "fire" :
return(_mc.btns_mc.btn_fire);
}
}
var _HAS_INTRO = true;
var _HAS_OUTRO = true;
var _OPENED_FRAME = 32;
var _screenOrder = ["basics", "water", "earth", "air", "fire"];
}
Symbol 1021 MovieClip [__Packages.nick.avatar.tentpole.ui.Win] Frame 0
class nick.avatar.tentpole.ui.Win extends nick.avatar.tentpole.ui.Screen
{
var _state, _isOpening, _mc;
function Win (mc, ui) {
super(mc, ui);
_state = nick.avatar.tentpole.GameState.getInstance();
}
function onOpened() {
_isOpening = false;
_mc.scores_mc.txt_bonus.text = _state.bonus;
_mc.scores_mc.txt_score.text = _state.score;
_mc.btn_play.onRelease = function () {
smashing.rampage.Messenger.sendMessage("engine", "onPressPlayAgain");
};
_mc.btn_view.onRelease = function () {
smashing.rampage.Messenger.sendMessage("engine", "onPressViewScores");
};
if (nick.highscores.HighscoreEngine.__get__isLoggedIn()) {
_mc.btn_submit.onRelease = function () {
smashing.rampage.Messenger.sendMessage("engine", "onPressGameOverSubmitScore");
};
} else {
_mc.btn_submit._visible = false;
}
}
var _HAS_INTRO = true;
var _HAS_OUTRO = false;
var _OPENED_FRAME = 61;
}
Symbol 1022 MovieClip [__Packages.nick.avatar.tentpole.ui.Highscores] Frame 0
class nick.avatar.tentpole.ui.Highscores extends nick.avatar.tentpole.ui.Screen
{
var _isClosed, _isOpening, _state, _mc;
function Highscores (mc, ui) {
super(mc, ui);
}
function open() {
_isClosed = false;
_isOpening = false;
_state = nick.avatar.tentpole.GameState.getInstance();
if (_state.highscoreType == "view") {
nick.highscores.HighscoreEngine.viewScores(_mc.highscore_mc, _state.score);
} else {
nick.highscores.HighscoreEngine.sendAndViewScore(_mc.highscore_mc, _state.score);
}
}
function onOpened() {
}
var _HAS_INTRO = false;
var _HAS_OUTRO = false;
var _OPENED_FRAME = 1;
}
Symbol 92 MovieClip Frame 1
play();
Symbol 92 MovieClip Frame 34
stop();
Symbol 96 MovieClip Frame 1
stop();
Symbol 96 MovieClip Frame 5
play();
Symbol 96 MovieClip Frame 35
stop();
Symbol 96 MovieClip Frame 36
play();
Symbol 96 MovieClip Frame 55
stop();
Symbol 96 MovieClip Frame 56
play();
Symbol 96 MovieClip Frame 72
stop();
Symbol 99 MovieClip Frame 1
stop();
Symbol 99 MovieClip Frame 5
play();
Symbol 99 MovieClip Frame 23
stop();
Symbol 99 MovieClip Frame 24
play();
Symbol 99 MovieClip Frame 43
stop();
Symbol 99 MovieClip Frame 44
play();
Symbol 99 MovieClip Frame 60
stop();
Symbol 105 MovieClip Frame 1
play();
Symbol 105 MovieClip Frame 67
stop();
Symbol 105 MovieClip Frame 73
play();
Symbol 105 MovieClip Frame 102
stop();
Symbol 113 MovieClip Frame 1
stop();
Symbol 145 MovieClip Frame 1
stop();
Symbol 145 MovieClip Frame 5
play();
Symbol 145 MovieClip Frame 10
stop();
Symbol 145 MovieClip Frame 11
play();
Symbol 145 MovieClip Frame 17
stop();
Symbol 145 MovieClip Frame 18
play();
Symbol 145 MovieClip Frame 24
stop();
Symbol 148 MovieClip Frame 1
stop();
Symbol 148 MovieClip Frame 5
play();
Symbol 148 MovieClip Frame 10
stop();
Symbol 148 MovieClip Frame 11
play();
Symbol 148 MovieClip Frame 17
stop();
Symbol 148 MovieClip Frame 18
play();
Symbol 148 MovieClip Frame 24
stop();
Symbol 151 MovieClip Frame 1
stop();
Symbol 151 MovieClip Frame 5
play();
Symbol 151 MovieClip Frame 35
stop();
Symbol 151 MovieClip Frame 36
play();
Symbol 151 MovieClip Frame 55
stop();
Symbol 151 MovieClip Frame 56
play();
Symbol 151 MovieClip Frame 72
stop();
Symbol 153 MovieClip [_nick_highscore_board] Frame 1
#initclip 62
Object.registerClass("_nick_highscore_board", nick.highscores.HighscoreTable);
#endinitclip
stop();
Instance of Symbol 113 MovieClip "btn_play" in Symbol 153 MovieClip [_nick_highscore_board] Frame 1
on (release) {
smashing.rampage.Messenger.sendMessage("engine", "onPressSplashPlay");
}
Symbol 153 MovieClip [_nick_highscore_board] Frame 19
play();
Symbol 153 MovieClip [_nick_highscore_board] Frame 47
stop();
onOutroComplete();
Symbol 175 MovieClip Frame 1
stop();
Symbol 175 MovieClip Frame 5
play();
Symbol 175 MovieClip Frame 10
stop();
Symbol 175 MovieClip Frame 11
play();
Symbol 175 MovieClip Frame 16
stop();
Symbol 175 MovieClip Frame 17
play();
Symbol 175 MovieClip Frame 24
stop();
Symbol 180 MovieClip Frame 1
stop();
Symbol 180 MovieClip Frame 5
play();
Symbol 180 MovieClip Frame 10
stop();
Symbol 180 MovieClip Frame 11
play();
Symbol 180 MovieClip Frame 16
stop();
Symbol 180 MovieClip Frame 17
play();
Symbol 180 MovieClip Frame 24
stop();
Symbol 185 MovieClip Frame 1
stop();
Symbol 185 MovieClip Frame 5
play();
Symbol 185 MovieClip Frame 10
stop();
Symbol 185 MovieClip Frame 11
play();
Symbol 185 MovieClip Frame 16
stop();
Symbol 185 MovieClip Frame 17
play();
Symbol 185 MovieClip Frame 24
stop();
Symbol 193 MovieClip Frame 1
play();
Symbol 193 MovieClip Frame 37
stop();
Symbol 193 MovieClip Frame 43
play();
Symbol 193 MovieClip Frame 72
stop();
Symbol 206 MovieClip Frame 1
stop();
Symbol 206 MovieClip Frame 5
play();
Symbol 206 MovieClip Frame 10
stop();
Symbol 206 MovieClip Frame 11
play();
Symbol 206 MovieClip Frame 17
stop();
Symbol 206 MovieClip Frame 18
play();
Symbol 206 MovieClip Frame 24
stop();
Symbol 209 MovieClip Frame 1
stop();
Symbol 209 MovieClip Frame 5
play();
Symbol 209 MovieClip Frame 10
stop();
Symbol 209 MovieClip Frame 11
play();
Symbol 209 MovieClip Frame 17
stop();
Symbol 209 MovieClip Frame 18
play();
Symbol 209 MovieClip Frame 24
stop();
Symbol 212 MovieClip Frame 1
stop();
Symbol 212 MovieClip Frame 5
play();
Symbol 212 MovieClip Frame 10
stop();
Symbol 212 MovieClip Frame 11
play();
Symbol 212 MovieClip Frame 17
stop();
Symbol 212 MovieClip Frame 18
play();
Symbol 212 MovieClip Frame 24
stop();
Symbol 215 MovieClip Frame 1
stop();
Symbol 215 MovieClip Frame 5
play();
Symbol 215 MovieClip Frame 10
stop();
Symbol 215 MovieClip Frame 11
play();
Symbol 215 MovieClip Frame 17
stop();
Symbol 215 MovieClip Frame 18
play();
Symbol 215 MovieClip Frame 24
stop();
Symbol 218 MovieClip Frame 1
stop();
Symbol 218 MovieClip Frame 5
play();
Symbol 218 MovieClip Frame 10
stop();
Symbol 218 MovieClip Frame 11
play();
Symbol 218 MovieClip Frame 17
stop();
Symbol 218 MovieClip Frame 18
play();
Symbol 218 MovieClip Frame 24
stop();
Symbol 221 MovieClip Frame 1
stop();
Symbol 221 MovieClip Frame 5
play();
Symbol 221 MovieClip Frame 10
stop();
Symbol 221 MovieClip Frame 11
play();
Symbol 221 MovieClip Frame 17
stop();
Symbol 221 MovieClip Frame 18
play();
Symbol 221 MovieClip Frame 24
stop();
Symbol 242 MovieClip Frame 1
stop();
Symbol 242 MovieClip Frame 5
play();
Symbol 242 MovieClip Frame 10
stop();
Symbol 242 MovieClip Frame 11
play();
Symbol 242 MovieClip Frame 17
stop();
Symbol 242 MovieClip Frame 18
play();
Symbol 242 MovieClip Frame 24
stop();
Symbol 247 MovieClip Frame 76
stop();
Symbol 248 MovieClip Frame 1
stop();
Symbol 248 MovieClip Frame 5
play();
Symbol 248 MovieClip Frame 10
stop();
Symbol 248 MovieClip Frame 11
play();
Symbol 248 MovieClip Frame 16
stop();
Symbol 248 MovieClip Frame 17
play();
Symbol 248 MovieClip Frame 24
stop();
Symbol 248 MovieClip Frame 25
play();
Symbol 248 MovieClip Frame 40
stop();
Symbol 258 MovieClip Frame 1
stop();
Symbol 258 MovieClip Frame 5
play();
Symbol 258 MovieClip Frame 10
stop();
Symbol 258 MovieClip Frame 11
play();
Symbol 258 MovieClip Frame 17
stop();
Symbol 258 MovieClip Frame 18
play();
Symbol 258 MovieClip Frame 24
stop();
Symbol 287 MovieClip Frame 18
stop();
Symbol 289 MovieClip Frame 1
stop();
Symbol 289 MovieClip Frame 5
stop();
Symbol 289 MovieClip Frame 11
stop();
Symbol 289 MovieClip Frame 24
stop();
Symbol 289 MovieClip Frame 25
play();
Symbol 289 MovieClip Frame 34
stop();
Symbol 289 MovieClip Frame 50
stop();
Symbol 295 MovieClip Frame 18
stop();
Symbol 296 MovieClip Frame 1
stop();
Symbol 296 MovieClip Frame 5
stop();
Symbol 296 MovieClip Frame 11
stop();
Symbol 296 MovieClip Frame 17
play();
Symbol 296 MovieClip Frame 24
stop();
Symbol 296 MovieClip Frame 46
stop();
Symbol 302 MovieClip Frame 18
stop();
Symbol 303 MovieClip Frame 1
stop();
Symbol 303 MovieClip Frame 5
stop();
Symbol 303 MovieClip Frame 11
stop();
Symbol 303 MovieClip Frame 17
play();
Symbol 303 MovieClip Frame 24
stop();
Symbol 303 MovieClip Frame 34
stop();
Symbol 303 MovieClip Frame 50
stop();
Symbol 309 MovieClip Frame 1
stop();
Symbol 309 MovieClip Frame 5
play();
Symbol 309 MovieClip Frame 10
stop();
Symbol 309 MovieClip Frame 11
play();
Symbol 309 MovieClip Frame 17
stop();
Symbol 309 MovieClip Frame 18
play();
Symbol 309 MovieClip Frame 24
stop();
Symbol 338 MovieClip Frame 16
stop();
Symbol 339 MovieClip Frame 1
stop();
Symbol 339 MovieClip Frame 5
stop();
Symbol 339 MovieClip Frame 11
stop();
Symbol 339 MovieClip Frame 17
play();
Symbol 339 MovieClip Frame 24
stop();
Symbol 339 MovieClip Frame 25
play();
Symbol 339 MovieClip Frame 34
stop();
Symbol 339 MovieClip Frame 45
stop();
Symbol 348 MovieClip Frame 16
stop();
Symbol 349 MovieClip Frame 1
stop();
Symbol 349 MovieClip Frame 5
play();
Symbol 349 MovieClip Frame 10
stop();
Symbol 349 MovieClip Frame 11
play();
Symbol 349 MovieClip Frame 16
stop();
Symbol 349 MovieClip Frame 17
play();
Symbol 349 MovieClip Frame 24
stop();
Symbol 349 MovieClip Frame 25
stop();
Symbol 349 MovieClip Frame 34
stop();
Symbol 349 MovieClip Frame 35
play();
Symbol 349 MovieClip Frame 45
stop();
Symbol 355 MovieClip Frame 16
stop();
Symbol 356 MovieClip Frame 1
stop();
Symbol 356 MovieClip Frame 5
stop();
Symbol 356 MovieClip Frame 11
stop();
Symbol 356 MovieClip Frame 17
play();
Symbol 356 MovieClip Frame 24
stop();
Symbol 356 MovieClip Frame 25
play();
Symbol 356 MovieClip Frame 33
stop();
Symbol 356 MovieClip Frame 45
stop();
Symbol 364 MovieClip Frame 1
stop();
Symbol 364 MovieClip Frame 5
play();
Symbol 364 MovieClip Frame 10
stop();
Symbol 364 MovieClip Frame 11
play();
Symbol 364 MovieClip Frame 17
stop();
Symbol 364 MovieClip Frame 18
play();
Symbol 364 MovieClip Frame 24
stop();
Symbol 371 MovieClip Frame 5
stop();
Symbol 372 MovieClip Frame 5
stop();
Symbol 381 MovieClip Frame 10
stop();
Symbol 382 MovieClip Frame 1
stop();
Symbol 382 MovieClip Frame 5
stop();
Symbol 382 MovieClip Frame 11
stop();
Symbol 382 MovieClip Frame 17
play();
Symbol 382 MovieClip Frame 24
stop();
Symbol 382 MovieClip Frame 25
stop();
Symbol 382 MovieClip Frame 44
stop();
Symbol 382 MovieClip Frame 45
stop();
Symbol 382 MovieClip Frame 55
stop();
Symbol 398 MovieClip Frame 8
stop();
Symbol 400 MovieClip Frame 10
stop();
Symbol 409 MovieClip Frame 6
stop();
Symbol 410 MovieClip Frame 1
stop();
Symbol 410 MovieClip Frame 5
stop();
Symbol 410 MovieClip Frame 11
stop();
Symbol 410 MovieClip Frame 17
play();
Symbol 410 MovieClip Frame 25
stop();
Symbol 410 MovieClip Frame 26
play();
Symbol 410 MovieClip Frame 33
stop();
Symbol 410 MovieClip Frame 34
play();
Symbol 410 MovieClip Frame 41
stop();
Symbol 410 MovieClip Frame 42
play();
Symbol 410 MovieClip Frame 49
stop();
Symbol 410 MovieClip Frame 56
stop();
Symbol 417 MovieClip Frame 6
stop();
Symbol 418 MovieClip Frame 1
stop();
Symbol 418 MovieClip Frame 5
stop();
Symbol 418 MovieClip Frame 11
stop();
Symbol 418 MovieClip Frame 17
play();
Symbol 418 MovieClip Frame 24
stop();
Symbol 418 MovieClip Frame 25
play();
Symbol 418 MovieClip Frame 32
stop();
Symbol 418 MovieClip Frame 33
stop();
Symbol 418 MovieClip Frame 40
stop();
Symbol 418 MovieClip Frame 41
stop();
Symbol 418 MovieClip Frame 48
stop();
Symbol 418 MovieClip Frame 55
stop();
Symbol 428 MovieClip Frame 6
stop();
Symbol 429 MovieClip Frame 1
stop();
Symbol 429 MovieClip Frame 5
stop();
Symbol 429 MovieClip Frame 11
stop();
Symbol 429 MovieClip Frame 17
play();
Symbol 429 MovieClip Frame 24
stop();
Symbol 429 MovieClip Frame 25
play();
Symbol 429 MovieClip Frame 32
stop();
Symbol 429 MovieClip Frame 33
stop();
Symbol 429 MovieClip Frame 40
stop();
Symbol 429 MovieClip Frame 41
stop();
Symbol 429 MovieClip Frame 48
stop();
Symbol 429 MovieClip Frame 55
stop();
Symbol 436 MovieClip Frame 6
stop();
Symbol 437 MovieClip Frame 1
stop();
Symbol 437 MovieClip Frame 5
stop();
Symbol 437 MovieClip Frame 11
stop();
Symbol 437 MovieClip Frame 17
play();
Symbol 437 MovieClip Frame 24
stop();
Symbol 437 MovieClip Frame 25
play();
Symbol 437 MovieClip Frame 32
stop();
Symbol 437 MovieClip Frame 33
stop();
Symbol 437 MovieClip Frame 40
stop();
Symbol 437 MovieClip Frame 41
stop();
Symbol 437 MovieClip Frame 48
stop();
Symbol 437 MovieClip Frame 55
stop();
Symbol 443 MovieClip Frame 6
stop();
Symbol 444 MovieClip Frame 1
stop();
Symbol 444 MovieClip Frame 5
stop();
Symbol 444 MovieClip Frame 11
stop();
Symbol 444 MovieClip Frame 17
play();
Symbol 444 MovieClip Frame 24
stop();
Symbol 444 MovieClip Frame 35
stop();
Symbol 448 MovieClip Frame 1
play();
hd.useHandCursor = false;
Symbol 448 MovieClip Frame 32
stop();
Symbol 448 MovieClip Frame 65
play();
Symbol 448 MovieClip Frame 95
stop();
Symbol 456 MovieClip Frame 1
play();
Symbol 456 MovieClip Frame 11
stop();
Symbol 461 MovieClip Frame 1
stop();
Symbol 461 MovieClip Frame 5
stop();
Symbol 461 MovieClip Frame 11
stop();
Symbol 461 MovieClip Frame 17
play();
Symbol 461 MovieClip Frame 25
stop();
Symbol 461 MovieClip Frame 26
play();
Symbol 461 MovieClip Frame 33
stop();
Symbol 461 MovieClip Frame 34
play();
Symbol 461 MovieClip Frame 41
stop();
Symbol 461 MovieClip Frame 42
play();
Symbol 461 MovieClip Frame 49
stop();
Symbol 461 MovieClip Frame 56
stop();
Symbol 462 MovieClip Frame 1
stop();
Symbol 462 MovieClip Frame 5
play();
Symbol 462 MovieClip Frame 10
stop();
Symbol 462 MovieClip Frame 11
play();
Symbol 462 MovieClip Frame 16
stop();
Symbol 462 MovieClip Frame 17
play();
Symbol 462 MovieClip Frame 24
stop();
Symbol 464 MovieClip Frame 1
play();
Symbol 464 MovieClip Frame 11
stop();
Symbol 467 MovieClip Frame 1
play();
Symbol 467 MovieClip Frame 11
stop();
Symbol 477 MovieClip Frame 1
stop();
Symbol 477 MovieClip Frame 5
play();
Symbol 477 MovieClip Frame 10
stop();
Symbol 477 MovieClip Frame 11
play();
Symbol 477 MovieClip Frame 17
stop();
Symbol 477 MovieClip Frame 18
play();
Symbol 477 MovieClip Frame 24
stop();
Symbol 480 MovieClip Frame 1
stop();
Symbol 480 MovieClip Frame 5
play();
Symbol 480 MovieClip Frame 10
stop();
Symbol 480 MovieClip Frame 11
play();
Symbol 480 MovieClip Frame 17
stop();
Symbol 480 MovieClip Frame 18
play();
Symbol 480 MovieClip Frame 24
stop();
Symbol 481 MovieClip Frame 1
play();
Symbol 481 MovieClip Frame 11
stop();
Instance of Symbol 477 MovieClip in Symbol 481 MovieClip Frame 11
on (release) {
smashing.rampage.Messenger.sendMessage("screen", "onPressQuitNo");
}
Instance of Symbol 480 MovieClip in Symbol 481 MovieClip Frame 11
on (release) {
smashing.rampage.Messenger.sendMessage("screen", "onPressQuitYes");
}
Symbol 484 MovieClip Frame 1
play();
Symbol 484 MovieClip Frame 11
stop();
Symbol 487 MovieClip Frame 1
play();
Symbol 487 MovieClip Frame 11
stop();
Instance of Symbol 477 MovieClip in Symbol 487 MovieClip Frame 11
on (release) {
smashing.rampage.Messenger.sendMessage("screen", "onPressConfirmNo");
}
Instance of Symbol 480 MovieClip in Symbol 487 MovieClip Frame 11
on (release) {
smashing.rampage.Messenger.sendMessage("screen", "onPressConfirmYes");
}
Symbol 489 MovieClip Frame 29
stop();
Symbol 547 MovieClip Frame 1
stop();
Symbol 547 MovieClip Frame 10
stop();
Symbol 547 MovieClip Frame 17
stop();
Symbol 547 MovieClip Frame 23
stop();
Symbol 547 MovieClip Frame 31
stop();
Symbol 547 MovieClip Frame 37
stop();
Symbol 547 MovieClip Frame 47
stop();
Symbol 547 MovieClip Frame 56
stop();
Symbol 547 MovieClip Frame 64
stop();
Symbol 547 MovieClip Frame 72
stop();
Symbol 547 MovieClip Frame 80
stop();
Symbol 547 MovieClip Frame 88
stop();
Symbol 547 MovieClip Frame 95
stop();
Symbol 550 MovieClip Frame 1
stop();
Symbol 550 MovieClip Frame 5
play();
Symbol 550 MovieClip Frame 10
stop();
Symbol 550 MovieClip Frame 11
play();
Symbol 550 MovieClip Frame 17
stop();
Symbol 550 MovieClip Frame 18
play();
Symbol 550 MovieClip Frame 24
stop();
Symbol 553 MovieClip Frame 1
stop();
Symbol 553 MovieClip Frame 5
play();
Symbol 553 MovieClip Frame 10
stop();
Symbol 553 MovieClip Frame 11
play();
Symbol 553 MovieClip Frame 17
stop();
Symbol 553 MovieClip Frame 18
play();
Symbol 553 MovieClip Frame 24
stop();
Symbol 556 MovieClip Frame 1
stop();
Symbol 556 MovieClip Frame 5
play();
Symbol 556 MovieClip Frame 10
stop();
Symbol 556 MovieClip Frame 11
play();
Symbol 556 MovieClip Frame 17
stop();
Symbol 556 MovieClip Frame 18
play();
Symbol 556 MovieClip Frame 24
stop();
Symbol 561 MovieClip Frame 1
stop();
Symbol 571 MovieClip Frame 1
stop();
Symbol 571 MovieClip Frame 5
stop();
Symbol 574 MovieClip Frame 1
stop();
Symbol 574 MovieClip Frame 5
play();
Symbol 574 MovieClip Frame 10
stop();
Symbol 574 MovieClip Frame 11
play();
Symbol 574 MovieClip Frame 17
stop();
Symbol 574 MovieClip Frame 18
play();
Symbol 574 MovieClip Frame 24
stop();
Symbol 577 MovieClip Frame 1
stop();
Symbol 577 MovieClip Frame 5
play();
Symbol 577 MovieClip Frame 10
stop();
Symbol 577 MovieClip Frame 11
play();
Symbol 577 MovieClip Frame 17
stop();
Symbol 577 MovieClip Frame 18
play();
Symbol 577 MovieClip Frame 24
stop();
Symbol 580 MovieClip Frame 1
stop();
Symbol 580 MovieClip Frame 5
play();
Symbol 580 MovieClip Frame 9
play();
Symbol 580 MovieClip Frame 15
stop();
Symbol 580 MovieClip Frame 16
play();
Symbol 580 MovieClip Frame 22
stop();
Symbol 583 MovieClip Frame 1
play();
Symbol 583 MovieClip Frame 31
stop();
Symbol 584 MovieClip Frame 1
stop();
Instance of Symbol 577 MovieClip in Symbol 584 MovieClip Frame 19
on (release) {
smashing.rampage.Messenger.sendMessage("screen", "onPressQuit");
}
Instance of Symbol 574 MovieClip in Symbol 584 MovieClip Frame 27
on (release) {
smashing.rampage.Messenger.sendMessage("screen", "onPressHelp");
}
Symbol 584 MovieClip Frame 31
if (nick.avatar.tentpole.Sounds.getInstance().muteMusic) {
btn_sound.gotoAndStop("off");
} else {
btn_sound.gotoAndStop("on");
}
Symbol 584 MovieClip Frame 35
stop();
if (nick.avatar.tentpole.Sounds.getInstance().muteMusic) {
btn_sound.gotoAndStop("off");
} else {
btn_sound.gotoAndStop("on");
}
Instance of Symbol 571 MovieClip "btn_sound" in Symbol 584 MovieClip Frame 35
on (release) {
smashing.rampage.Messenger.sendMessage("engine", "onPressSoundToggle");
}
Symbol 597 MovieClip Frame 1
stop();
Symbol 602 MovieClip Frame 1
stop();
Symbol 602 MovieClip Frame 5
play();
Symbol 602 MovieClip Frame 10
stop();
Symbol 602 MovieClip Frame 11
play();
Symbol 602 MovieClip Frame 16
stop();
Symbol 602 MovieClip Frame 17
play();
Symbol 602 MovieClip Frame 24
stop();
Symbol 603 MovieClip Frame 1
stop();
Symbol 603 MovieClip Frame 5
play();
Symbol 603 MovieClip Frame 10
stop();
Symbol 603 MovieClip Frame 11
play();
Symbol 603 MovieClip Frame 16
stop();
Symbol 603 MovieClip Frame 17
play();
Symbol 603 MovieClip Frame 24
stop();
Symbol 608 MovieClip Frame 1
stop();
Symbol 608 MovieClip Frame 18
stop();
Symbol 608 MovieClip Frame 27
play();
Symbol 608 MovieClip Frame 37
stop();
Symbol 608 MovieClip Frame 51
play();
Symbol 608 MovieClip Frame 71
stop();
Symbol 608 MovieClip Frame 72
play();
Symbol 608 MovieClip Frame 90
stop();
Symbol 608 MovieClip Frame 91
play();
Symbol 608 MovieClip Frame 110
stop();
Symbol 608 MovieClip Frame 111
play();
Symbol 608 MovieClip Frame 121
stop();
Symbol 618 MovieClip Frame 1
stop();
Symbol 618 MovieClip Frame 5
play();
Symbol 618 MovieClip Frame 35
stop();
Symbol 618 MovieClip Frame 36
play();
Symbol 618 MovieClip Frame 55
stop();
Symbol 618 MovieClip Frame 56
play();
Symbol 618 MovieClip Frame 72
stop();
Symbol 625 MovieClip Frame 1
play();
Symbol 625 MovieClip Frame 61
stop();
Symbol 625 MovieClip Frame 67
play();
Symbol 625 MovieClip Frame 97
stop();
Symbol 642 MovieClip Frame 1
play();
Symbol 642 MovieClip Frame 61
stop();
Symbol 642 MovieClip Frame 67
play();
Symbol 642 MovieClip Frame 97
stop();
Symbol 657 MovieClip Frame 1
stop();
Symbol 657 MovieClip Frame 5
stop();
Symbol 657 MovieClip Frame 11
stop();
Symbol 657 MovieClip Frame 17
play();
Symbol 657 MovieClip Frame 24
stop();
Symbol 657 MovieClip Frame 25
stop();
Symbol 657 MovieClip Frame 44
stop();
Symbol 657 MovieClip Frame 45
stop();
Symbol 657 MovieClip Frame 55
stop();
Symbol 658 MovieClip Frame 1
stop();
Symbol 658 MovieClip Frame 2
play();
Symbol 661 MovieClip Frame 1
stop();
Symbol 661 MovieClip Frame 5
stop();
Symbol 661 MovieClip Frame 11
stop();
Symbol 661 MovieClip Frame 24
stop();
Symbol 661 MovieClip Frame 25
play();
Symbol 661 MovieClip Frame 34
stop();
Symbol 661 MovieClip Frame 50
stop();
Symbol 664 MovieClip Frame 1
stop();
Symbol 664 MovieClip Frame 5
stop();
Symbol 664 MovieClip Frame 11
stop();
Symbol 664 MovieClip Frame 17
play();
Symbol 664 MovieClip Frame 24
stop();
Symbol 664 MovieClip Frame 46
stop();
Symbol 667 MovieClip Frame 1
stop();
Symbol 667 MovieClip Frame 5
stop();
Symbol 667 MovieClip Frame 11
stop();
Symbol 667 MovieClip Frame 17
play();
Symbol 667 MovieClip Frame 24
stop();
Symbol 667 MovieClip Frame 25
play();
Symbol 667 MovieClip Frame 34
stop();
Symbol 667 MovieClip Frame 45
stop();
Symbol 670 MovieClip Frame 1
stop();
Symbol 670 MovieClip Frame 5
stop();
Symbol 670 MovieClip Frame 12
stop();
Symbol 670 MovieClip Frame 18
play();
Symbol 670 MovieClip Frame 25
stop();
Symbol 670 MovieClip Frame 26
play();
Symbol 670 MovieClip Frame 35
stop();
Symbol 673 MovieClip Frame 1
stop();
Symbol 673 MovieClip Frame 5
stop();
Symbol 673 MovieClip Frame 11
stop();
Symbol 673 MovieClip Frame 17
play();
Symbol 673 MovieClip Frame 24
stop();
Symbol 673 MovieClip Frame 25
play();
Symbol 673 MovieClip Frame 33
stop();
Symbol 673 MovieClip Frame 45
stop();
Symbol 680 MovieClip Frame 18
stop();
Symbol 681 MovieClip Frame 1
stop();
Symbol 681 MovieClip Frame 5
stop();
Symbol 681 MovieClip Frame 11
stop();
Symbol 681 MovieClip Frame 17
play();
Symbol 681 MovieClip Frame 24
stop();
Symbol 681 MovieClip Frame 25
play();
Symbol 681 MovieClip Frame 33
stop();
Symbol 681 MovieClip Frame 49
stop();
Symbol 685 MovieClip Frame 18
stop();
Symbol 686 MovieClip Frame 1
stop();
Symbol 686 MovieClip Frame 5
stop();
Symbol 686 MovieClip Frame 11
stop();
Symbol 686 MovieClip Frame 17
play();
Symbol 686 MovieClip Frame 24
stop();
Symbol 686 MovieClip Frame 25
play();
Symbol 686 MovieClip Frame 33
stop();
Symbol 686 MovieClip Frame 49
stop();
Symbol 689 MovieClip Frame 1
stop();
Symbol 689 MovieClip Frame 5
stop();
Symbol 689 MovieClip Frame 11
stop();
Symbol 689 MovieClip Frame 17
play();
Symbol 689 MovieClip Frame 24
stop();
Symbol 689 MovieClip Frame 34
stop();
Symbol 689 MovieClip Frame 50
stop();
Symbol 693 MovieClip Frame 1
stop();
Symbol 693 MovieClip Frame 5
stop();
Symbol 693 MovieClip Frame 11
stop();
Symbol 693 MovieClip Frame 17
play();
Symbol 693 MovieClip Frame 24
stop();
Symbol 693 MovieClip Frame 25
play();
Symbol 693 MovieClip Frame 32
stop();
Symbol 693 MovieClip Frame 33
stop();
Symbol 693 MovieClip Frame 40
stop();
Symbol 693 MovieClip Frame 41
stop();
Symbol 693 MovieClip Frame 48
stop();
Symbol 693 MovieClip Frame 55
stop();
Symbol 695 MovieClip Frame 1
stop();
Symbol 695 MovieClip Frame 5
stop();
Symbol 695 MovieClip Frame 11
stop();
Symbol 695 MovieClip Frame 17
play();
Symbol 695 MovieClip Frame 24
stop();
Symbol 695 MovieClip Frame 35
stop();
Symbol 699 MovieClip Frame 1
stop();
Symbol 699 MovieClip Frame 5
stop();
Symbol 699 MovieClip Frame 11
stop();
Symbol 699 MovieClip Frame 17
play();
Symbol 699 MovieClip Frame 24
stop();
Symbol 699 MovieClip Frame 25
play();
Symbol 699 MovieClip Frame 32
stop();
Symbol 699 MovieClip Frame 33
stop();
Symbol 699 MovieClip Frame 40
stop();
Symbol 699 MovieClip Frame 41
stop();
Symbol 699 MovieClip Frame 48
stop();
Symbol 699 MovieClip Frame 55
stop();
Symbol 703 MovieClip Frame 1
stop();
Symbol 703 MovieClip Frame 5
stop();
Symbol 703 MovieClip Frame 11
stop();
Symbol 703 MovieClip Frame 17
play();
Symbol 703 MovieClip Frame 24
stop();
Symbol 703 MovieClip Frame 25
play();
Symbol 703 MovieClip Frame 32
stop();
Symbol 703 MovieClip Frame 33
stop();
Symbol 703 MovieClip Frame 40
stop();
Symbol 703 MovieClip Frame 41
stop();
Symbol 703 MovieClip Frame 48
stop();
Symbol 703 MovieClip Frame 55
stop();
Symbol 704 MovieClip [unit] Frame 1
stop();
Symbol 730 MovieClip [obstacle] Frame 1
stop();
Symbol 731 MovieClip Frame 1
stop();
Symbol 731 MovieClip Frame 5
play();
Symbol 731 MovieClip Frame 10
stop();
Symbol 731 MovieClip Frame 11
play();
Symbol 731 MovieClip Frame 16
stop();
Symbol 731 MovieClip Frame 17
play();
Symbol 731 MovieClip Frame 24
stop();
Symbol 732 MovieClip Frame 1
stop();
Symbol 732 MovieClip Frame 5
play();
Symbol 732 MovieClip Frame 10
stop();
Symbol 732 MovieClip Frame 11
play();
Symbol 732 MovieClip Frame 16
stop();
Symbol 732 MovieClip Frame 17
play();
Symbol 732 MovieClip Frame 24
stop();
Symbol 733 MovieClip Frame 1
stop();
Symbol 733 MovieClip Frame 5
play();
Symbol 733 MovieClip Frame 10
stop();
Symbol 733 MovieClip Frame 11
play();
Symbol 733 MovieClip Frame 16
stop();
Symbol 733 MovieClip Frame 17
play();
Symbol 733 MovieClip Frame 24
stop();
Symbol 736 MovieClip Frame 1
stop();
Symbol 736 MovieClip Frame 5
play();
Symbol 736 MovieClip Frame 10
stop();
Symbol 736 MovieClip Frame 11
play();
Symbol 736 MovieClip Frame 16
stop();
Symbol 736 MovieClip Frame 17
play();
Symbol 736 MovieClip Frame 24
stop();
Symbol 737 MovieClip Frame 1
stop();
Symbol 737 MovieClip Frame 5
play();
Symbol 737 MovieClip Frame 10
stop();
Symbol 737 MovieClip Frame 11
play();
Symbol 737 MovieClip Frame 16
stop();
Symbol 737 MovieClip Frame 17
play();
Symbol 737 MovieClip Frame 24
stop();
Symbol 738 MovieClip Frame 1
stop();
Symbol 738 MovieClip Frame 5
play();
Symbol 738 MovieClip Frame 10
stop();
Symbol 738 MovieClip Frame 11
play();
Symbol 738 MovieClip Frame 16
stop();
Symbol 738 MovieClip Frame 17
play();
Symbol 738 MovieClip Frame 24
stop();
Symbol 741 MovieClip Frame 1
stop();
Symbol 741 MovieClip Frame 5
play();
Symbol 741 MovieClip Frame 10
stop();
Symbol 741 MovieClip Frame 11
play();
Symbol 741 MovieClip Frame 16
stop();
Symbol 741 MovieClip Frame 17
play();
Symbol 741 MovieClip Frame 24
stop();
Symbol 742 MovieClip Frame 1
stop();
Symbol 742 MovieClip Frame 5
play();
Symbol 742 MovieClip Frame 10
stop();
Symbol 742 MovieClip Frame 11
play();
Symbol 742 MovieClip Frame 16
stop();
Symbol 742 MovieClip Frame 17
play();
Symbol 742 MovieClip Frame 24
stop();
Symbol 743 MovieClip Frame 1
stop();
Symbol 743 MovieClip Frame 5
play();
Symbol 743 MovieClip Frame 10
stop();
Symbol 743 MovieClip Frame 11
play();
Symbol 743 MovieClip Frame 16
stop();
Symbol 743 MovieClip Frame 17
play();
Symbol 743 MovieClip Frame 24
stop();
Symbol 744 MovieClip Frame 1
stop();
Symbol 744 MovieClip Frame 5
play();
Symbol 744 MovieClip Frame 10
stop();
Symbol 744 MovieClip Frame 11
play();
Symbol 744 MovieClip Frame 16
stop();
Symbol 744 MovieClip Frame 17
play();
Symbol 744 MovieClip Frame 24
stop();
Symbol 748 MovieClip Frame 1
stop();
Symbol 748 MovieClip Frame 5
play();
Symbol 748 MovieClip Frame 10
stop();
Symbol 748 MovieClip Frame 11
play();
Symbol 748 MovieClip Frame 16
stop();
Symbol 748 MovieClip Frame 17
play();
Symbol 748 MovieClip Frame 24
stop();
Symbol 749 MovieClip Frame 1
stop();
Symbol 749 MovieClip Frame 5
play();
Symbol 749 MovieClip Frame 10
stop();
Symbol 749 MovieClip Frame 11
play();
Symbol 749 MovieClip Frame 16
stop();
Symbol 749 MovieClip Frame 17
play();
Symbol 749 MovieClip Frame 24
stop();
Symbol 752 MovieClip Frame 1
stop();
Symbol 752 MovieClip Frame 5
play();
Symbol 752 MovieClip Frame 10
stop();
Symbol 752 MovieClip Frame 11
play();
Symbol 752 MovieClip Frame 16
stop();
Symbol 752 MovieClip Frame 17
play();
Symbol 752 MovieClip Frame 24
stop();
Symbol 760 MovieClip Frame 7
stop();
Symbol 773 MovieClip Frame 23
stop();
Symbol 774 MovieClip Frame 25
stop();
Symbol 775 MovieClip [attackRhino] Frame 1
stop();
Symbol 784 MovieClip [effect_floatingText] Frame 1
stop();
Symbol 784 MovieClip [effect_floatingText] Frame 3
stop();
Symbol 794 MovieClip Frame 5
stop();
Symbol 816 MovieClip Frame 22
stop();
Symbol 818 MovieClip [attackWater] Frame 1
stop();
Symbol 819 MovieClip [specialWater] Frame 25
stop();
Symbol 828 MovieClip Frame 5
stop();
Symbol 862 MovieClip Frame 29
stop();
Symbol 864 MovieClip [attackEarth] Frame 1
stop();
Symbol 866 MovieClip Frame 24
stop();
Symbol 867 MovieClip Frame 12
stop();
Symbol 868 MovieClip [specialEarth] Frame 1
stop();
Symbol 868 MovieClip [specialEarth] Frame 20
stop();
Symbol 875 MovieClip Frame 5
stop();
Symbol 884 MovieClip Frame 9
stop();
Symbol 885 MovieClip Frame 12
stop();
Symbol 887 MovieClip [attackFire] Frame 1
stop();
Symbol 894 MovieClip Frame 6
stop();
Symbol 896 MovieClip [attackFireElite] Frame 1
stop();
Symbol 897 MovieClip Frame 4
stop();
Symbol 898 MovieClip [attackFireBattlement] Frame 1
stop();
Symbol 915 MovieClip Frame 5
stop();
Symbol 917 MovieClip [attackAang] Frame 1
stop();
Symbol 929 MovieClip [specialAang] Frame 45
stop();
Symbol 944 MovieClip Frame 8
stop();
Symbol 947 MovieClip Frame 4
stop();
Symbol 948 MovieClip Frame 5
stop();
Symbol 949 MovieClip Frame 6
stop();
Symbol 950 MovieClip Frame 37
stop();
Symbol 952 MovieClip [cavalryAttack] Frame 1
stop();
Symbol 960 MovieClip [battlement] Frame 1
stop();
Symbol 960 MovieClip [battlement] Frame 7
stop();
Symbol 962 MovieClip [_project] Frame 1
#initclip 61
Object.registerClass("_project", nick.avatar.tentpole.Engine);
#endinitclip
stop();