Frame 1
stop();
Instance of Symbol 25 MovieClip in Frame 1
onClipEvent (enterFrame) {
var l_pc = Math.ceil((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
if (l_pc == 100) {
_parent.gotoAndStop(8);
} else {
this.gotoAndStop(l_pc);
}
this.pc = l_pc + "%";
}
Instance of Symbol 34 MovieClip in Frame 1
/* no clip actions */
Frame 8
new Controller(this);
Frame 9
stop();
Frame 10
stop();
Frame 19
stop();
this.gotoAndStop(10);
Symbol 31 Button
on (keyPress "<Left>") {
return(undefined);
}
on (keyPress "<Right>") {
return(undefined);
}
on (keyPress "<Up>") {
return(undefined);
}
on (keyPress "<Down>") {
return(undefined);
}
on (keyPress "<Space>") {
return(undefined);
}
on (keyPress "z") {
return(undefined);
}
on (keyPress "x") {
return(undefined);
}
on (keyPress "c") {
return(undefined);
}
Symbol 55 MovieClip [cloud_parts] Frame 1
stop();
Symbol 84 MovieClip [powerUp_parts] Frame 1
stop();
Symbol 645 MovieClip [parts_fire] Frame 1
stop();
Symbol 661 MovieClip [missile_states] Frame 1
stop();
Symbol 666 MovieClip [mine_states] Frame 1
stop();
Symbol 676 MovieClip [ball_states] Frame 1
stop();
Symbol 682 MovieClip Frame 1
stop();
Symbol 1270 MovieClip [__Packages.Controller] Frame 0
class Controller
{
var nLastFRate, oSky, oPlayer, oSoundCTRL, nTimeCount, mcTimeLine, oLeaderBoard, bGamePaused, oBuilder;
function Controller (l_mcTimeLine) {
var _local1 = this;
var _local2 = l_mcTimeLine;
Stage.showMenu = false;
_focusrect = false;
_global.C = _local1;
_local2.onEnterFrame = mx.utils.Delegate.create(_local1, _local1.onEnterFrame);
_local1.mcTimeLine = _local2;
ship.ShipDatas.init();
_local1.oBuilder = new ship.ShipBuilder(_local1.mcTimeLine);
_local1.sCurrentScreen = "title";
_local1.oSoundCTRL = new SoundController(_local2);
_local1.oLeaderBoard = new LeaderBoard(_global.gProxyObj, "dp_fight");
_local1.oLeaderBoard.addEventListener("onLoadScore", mx.utils.Delegate.create(_local1, _local1.init));
_local1.oLeaderBoard.init();
_local1.nLastFRate = 40;
_local1.oSoundCTRL.playSound("musicMenu", 65, 100000);
}
function setNewQuality(l_nNewFrate) {
if (nLastFRate > l_nNewFrate) {
_global.FR.enableReport = true;
if (l_nNewFrate < 20) {
oSky.dropQuality();
}
}
}
function setKeyUp(keyCode) {
oPlayer.setKeyUp(keyCode);
}
function setKeyDown(keyCode) {
oPlayer.setKeyDown(keyCode);
}
function init() {
var _local1 = this;
_local1.bGameStarted = false;
_local1.bGamePaused = false;
_local1.nOpponentPos = 20;
_local1.oProjectileList = new weapons.ProjectileList();
_local1.mcTimeLine.play();
_local1.sPlayerName = _local1.oLeaderBoard.getPlayerName();
_local1.oLeaderBoard.removeEventListener("onLoadScore");
_local1.oBuilder.checkUnlock(_local1.oLeaderBoard.getMaxScore(), true);
}
function onEnterFrame() {
var _local1 = this;
var _local2;
if ((_local1.bGameStarted && (!_local1.bGamePaused)) && (_local1.sCurrentScreen == "game")) {
_local1.nTimeCount++;
_local2 = new Object();
_local1.oPlayer.actions();
_local1.oOpponent.actions();
_local2 = _local1.oPlayer.getSpeed();
_local1.oProjectileList.update(_local2.x + BASE_SPEED, _local2.y);
_local1.oBackCloudManager.update(_local2.x + BASE_SPEED, _local2.y);
_local1.oPowerUpManager.update(_local2.x + BASE_SPEED, _local2.y);
_local1.oSky.update(_local2.x + BASE_SPEED, _local2.y);
} else if (_local1.oLeaderBoard.bWaitingResponse) {
_local1.oLeaderBoard.checkTimeOut(_local1.mcTimeLine.screens.content);
}
}
function clickSound() {
oSoundCTRL.playSound("click", 100, 0);
}
function gotoScreen(l_sScreenID) {
var _local1 = this;
var _local2 = _local1.sCurrentScreen;
if ((_local2 == "endBad") || (_local2 == "endGood")) {
_local1.oSoundCTRL.playSound("musicMenu", 65, 100000);
}
_local1.sCurrentScreen = l_sScreenID;
if (!_local1.bGamePaused) {
_local1.mcTimeLine.screens.gotoAndStop(l_sScreenID);
}
if (_local1.sCurrentScreen == "title") {
_local1.init();
} else if (_local1.sCurrentScreen == "builder") {
if (!_local1.bGameStarted) {
_local1.oBuilder.init(0);
} else {
_local1.oBuilder.reactivate(_local1.oPlayer.getPoints());
}
_local1.oBuilder.setShip(_local1.oLeaderBoard.getPlayerShip());
_local1.showBuilderNav();
} else if (_local1.sCurrentScreen == "instructions") {
_local1.showInstructions();
} else if (_local1.sCurrentScreen == "context") {
_local1.showContext();
} else if (_local1.sCurrentScreen == "leaderBoard") {
_local1.showLeaderBoardNav(_local2);
} else if (_local1.sCurrentScreen == "game") {
if (!_local1.bGamePaused) {
_local1.initGame(!_local1.bGameStarted);
} else {
_local1.resumeGame();
}
} else if (_local1.sCurrentScreen == "duelEnd") {
if (_local1.nOpponentPos == 0) {
_local1.mcTimeLine.screens.content.gotoAndStop(3);
} else if (_local1.oBuilder.checkUnlock(_local1.oPlayer.getPoints())) {
_local1.mcTimeLine.screens.content.gotoAndStop(2);
} else {
_local1.mcTimeLine.screens.content.gotoAndStop(1);
}
_local1.showStats();
_local1.renderShip();
} else if (_local1.sCurrentScreen == "endGood") {
_local1.oSoundCTRL.fadeOutSound("musicMenu");
_local1.oSoundCTRL.playSound("win", 100, 0);
}
}
function showStats() {
var _local1 = this;
var _local3 = _local1.oPlayer.getAccuracy();
var l_nPlayerEnergy = _local1.oPlayer.getEnergy();
var l_sTimeFormat = _local1.getTime();
var _local2 = 10000 - (_local1.nTimeCount * 5);
var l_nPlayerAccuracyPoints = ((_local3 / 100) * 20000);
var l_nPlayerEnergyPoints = ((l_nPlayerEnergy / 100) * 20000);
var l_nDuelPoints;
if (_local2 < 0) {
_local2 = 0;
}
l_nDuelPoints = (l_nPlayerAccuracyPoints + l_nPlayerEnergyPoints) + _local2;
_local1.oPlayer.addPoints(l_nDuelPoints);
_local1.showField("accuracy", _local3, l_nPlayerAccuracyPoints);
_local1.showField("energy", l_nPlayerEnergy, l_nPlayerEnergyPoints);
_local1.showField("time", l_sTimeFormat, _local2);
_local1.showField("duel", 0, l_nDuelPoints);
_local1.showField("total", 0, _local1.oPlayer.getPoints());
_local1.mcTimeLine.screens.content.player.name_txt.text = _local1.sPlayerName;
}
function getTime() {
var _local2 = nTimeCount / 35;
var _local1 = Math.floor(_local2 / 60);
var _local3 = Math.round(_local2 - (_local1 * 60));
return((pad(_local1, 2) + ":") + pad(_local3, 2));
}
function pad(l_nToPad, l_nMinLength) {
var _local2 = l_nMinLength;
var _local1 = String(l_nToPad);
while (_local1.length < _local2) {
_local1 = "0" + _local1;
}
return(_local1);
}
function showField(l_sFieldName, l_nResults, l_nPoints) {
var _local1 = this;
var _local2 = l_sFieldName;
_local1.mcTimeLine.screens.content.stats[_local2 + "Points_txt"].text = l_nPoints;
_local1.mcTimeLine.screens.content.stats[_local2 + "_txt"].text = l_nResults;
_local1.mcTimeLine.screens.content.stats_shadow[_local2 + "Points_txt"].text = l_nPoints;
_local1.mcTimeLine.screens.content.stats_shadow[_local2 + "_txt"].text = l_nResults;
}
function renderShip() {
oPlayer.showPlayerShip(mcTimeLine.screens.content.container);
}
function showBuilderNav() {
var _local1 = this;
_local1.mcTimeLine.screens.content.player.name_txt.text = _local1.sPlayerName;
if (_local1.bGameStarted) {
_local1.mcTimeLine.screens.content.btnReadyStart._visible = false;
_local1.mcTimeLine.screens.content.btnBackStart._visible = false;
_local1.mcTimeLine.screens.content.btnReadyInGame._visible = true;
} else {
_local1.mcTimeLine.screens.content.btnReadyStart._visible = true;
_local1.mcTimeLine.screens.content.btnBackStart._visible = true;
_local1.mcTimeLine.screens.content.btnReadyInGame._visible = false;
}
}
function showInstructions() {
var _local1 = this;
if (!_local1.bGamePaused) {
if (_local1.mcTimeLine.screens.content._currentframe != 2) {
_local1.mcTimeLine.screens.content.gotoAndStop("instructions1");
} else {
_local1.mcTimeLine.screens.content.gotoAndStop("instructions2");
}
} else {
_local1.mcTimeLine.screens.content.hud.menu.menu.enabled = false;
if (_local1.mcTimeLine.screens.content.help._currentframe != 2) {
_local1.mcTimeLine.screens.content.help.gotoAndStop("instructions1");
_local1.mcTimeLine.screens.content.help.btnBackStart._visible = false;
} else {
_local1.mcTimeLine.screens.content.help.gotoAndStop("instructions2");
}
}
}
function showContext() {
var _local1 = this;
if (_local1.mcTimeLine.screens.content._currentframe != 2) {
_local1.mcTimeLine.screens.content.gotoAndStop("context01");
} else {
_local1.mcTimeLine.screens.content.gotoAndStop("context02");
}
}
function submitScore(l_nScore) {
var _local1 = this;
if (l_nScore) {
_local1.oLeaderBoard.submitScore(_local1.oPlayer.getShipCode(), l_nScore);
} else {
_local1.oLeaderBoard.submitScore(_local1.oPlayer.getShipCode(), _local1.oPlayer.getPoints());
}
}
function showLeaderBoardNav(l_sOldScreen) {
var _local1 = this;
var _local2 = l_sOldScreen;
var l_mcList;
if (_local2 == "title") {
_local1.oLeaderBoard.retry();
_local1.mcTimeLine.screens.content.btnBack._visible = true;
_local1.mcTimeLine.screens.content.btnTryAgain._visible = false;
_local1.mcTimeLine.screens.content.btnPlayAgain._visible = false;
} else if (_local2 == "endBad") {
_local1.mcTimeLine.screens.content.btnBack._visible = false;
_local1.mcTimeLine.screens.content.btnTryAgain._visible = true;
_local1.mcTimeLine.screens.content.btnPlayAgain._visible = false;
} else if (_local2 == "endGood") {
_local1.mcTimeLine.screens.content.btnBack._visible = false;
_local1.mcTimeLine.screens.content.btnTryAgain._visible = false;
_local1.mcTimeLine.screens.content.btnPlayAgain._visible = true;
}
_local1.initHSList();
}
function initHSList() {
var _local1 = this;
Debug.trace("INIT HS LIST");
if (_local1.oLeaderBoard.bWaitingResponse) {
_local1.oLeaderBoard.addEventListener("onLoadScore", mx.utils.Delegate.create(_local1, _local1.initHSList));
} else {
_local1.oLeaderBoard.writeList(_local1.mcTimeLine.screens.content);
_local1.mcTimeLine.screens.content.btnScroll.onPress = mx.utils.Delegate.create(_local1, _local1.scrollDragPress);
_local1.mcTimeLine.screens.content.btnScroll.onRelease = mx.utils.Delegate.create(_local1, _local1.scrollDragRelease);
_local1.mcTimeLine.screens.content.btnScroll.onEnterFrame = mx.utils.Delegate.create(_local1, _local1.scrollDrag);
_local1.mcTimeLine.screens.content.btnScrollDown.onPress = mx.utils.Delegate.create(_local1, _local1.scrollListDown);
_local1.mcTimeLine.screens.content.btnScrollUp.onPress = mx.utils.Delegate.create(_local1, _local1.scrollListUp);
}
}
function scrollListDown() {
var _local1 = oLeaderBoard.getListMovie();
var _local2 = _local1._y - 25;
if (_local2 < _local1.maxY) {
_local2 = _local1.maxY;
}
_local1._y = _local2;
adjustScrollBar();
}
function scrollListUp() {
var _local1 = oLeaderBoard.getListMovie();
var _local2 = _local1._y + 25;
if (_local2 > _local1.initY) {
_local2 = _local1.initY;
}
_local1._y = _local2;
adjustScrollBar();
}
function adjustScrollBar() {
var mcScrollBar = mcTimeLine.screens.content.btnScroll;
var _local1 = oLeaderBoard.getListMovie();
var _local2;
var _local3;
_local3 = (_local1.initY - _local1._y) / (_local1._height - 215);
_local2 = 100 + (220 * _local3);
mcScrollBar._y = _local2;
}
function scrollDrag() {
var _local2 = mcTimeLine.screens.content.btnScroll;
var _local1 = oLeaderBoard.getListMovie();
var _local3;
var nPctScroll;
if (_local2.bDrag) {
nPctScroll = Math.round(((_local2._y - 100) / 220) * 100);
_local3 = _local1.initY - ((_local1._height - 215) * (nPctScroll / 100));
_local1._y = _local3;
}
}
function scrollDragPress() {
var _local1 = mcTimeLine.screens.content.btnScroll;
var mcToScroll = oLeaderBoard.getListMovie();
_local1.startDrag(false, _local1._x, 100, _local1._x, 320);
_local1.bDrag = true;
}
function scrollDragRelease() {
var _local1 = mcTimeLine.screens.content.btnScroll;
var mcToScroll = oLeaderBoard.getListMovie();
_local1.stopDrag();
_local1.bDrag = false;
}
function addProjectile(l_oArg) {
var _local1 = l_oArg;
var _local2 = this;
_local2.oProjectileList.addToList(_local1.projectile);
_local1.projectile.setTarget(_local1.targetFighter);
_local1.projectile.setLauncher(_local1.target);
if (_local1.target == _local2.oPlayer) {
_local2.mcTimeLine.screens.content.hud[_local1.projectile.getType() + "Indicator"].gotoAndPlay(1);
}
}
function initGame(l_bFirst) {
var _local1 = this;
var _local2;
_local1.bGameStarted = true;
_local1.oBackCloudManager = new background.CloudManager(_local1.mcTimeLine.screens.content.backgroundCloud);
_local1.oSky = new background.BackgroundScroller(_local1.mcTimeLine.screens.content.skyBg);
if (l_bFirst) {
_local1.oOpponent = new fighter.Opponent();
_local1.oPlayer = new fighter.Player();
_local1.oPlayer.addEventListener("addProjectile", mx.utils.Delegate.create(_local1, _local1.addProjectile));
_local1.oOpponent.addEventListener("addProjectile", mx.utils.Delegate.create(_local1, _local1.addProjectile));
}
_local1.oLeaderBoard.setPlayerShip(_local1.oBuilder.getSaveCode());
_local1.oPlayer.init(_local1.mcTimeLine.screens.content.player, _local1.oBuilder.getSaveCode(), _local1.mcTimeLine.screens.content.hud.playerEnergyBar, _local1.mcTimeLine.screens.content.hud.nitroBar);
_local2 = new ArrowIndicator(_local1.oOpponent, _local1.mcTimeLine.screens.content.arrowIndicator, _local1.mcTimeLine.screens.content.hud.playerEnergyBar, _local1.mcTimeLine.screens.content.hud.nitroBar);
_local1.oOpponent.init(_local1.mcTimeLine.screens.content.opponent, _local1.oLeaderBoard.getFighterCode(_local1.nOpponentPos), _local1.mcTimeLine.screens.content.hud.opponentEnergyBar, _local2, _local1.nOpponentPos);
_local1.oPlayer.setOpponent(_local1.oOpponent);
_local1.oOpponent.setPlayer(_local1.oPlayer);
_local1.mcTimeLine.screens.content.hud.player.name_txt.text = _local1.sPlayerName;
_local1.mcTimeLine.screens.content.hud.opponent.name_txt.text = _local1.oLeaderBoard.getOpponentName(_local1.nOpponentPos);
_local1.mcTimeLine.screens.content.hud.playerFace.gotoAndStop(_local1.oPlayer.getPilotID());
_local1.mcTimeLine.screens.content.hud.mineIndicator.gotoAndStop("Ready");
_local1.mcTimeLine.screens.content.hud.missileIndicator.gotoAndStop("Ready");
_local1.mcTimeLine.screens.content.hud.opponentFace.gotoAndStop(_local1.oOpponent.getPilotID());
_local1.mcTimeLine.screens.content.help.gotoAndStop(1);
_local1.oPowerUpManager = new powerUp.PowerUpManager(_local1.mcTimeLine.screens.content.powerUp, [_local1.oOpponent, _local1.oPlayer]);
_local1.nTimeCount = 0;
_local1.bGamePaused = true;
_local1.oSoundCTRL.playSound("musicInGame", 70, 100000);
_local1.oSoundCTRL.fadeOutSound("musicMenu");
_local1.updatePoints();
}
function Go() {
bGamePaused = false;
}
function updatePoints() {
mcTimeLine.screens.content.hud.score_txt.text = oPlayer.getPoints();
}
function pauseGame() {
var _local1 = this;
_local1.bGamePaused = true;
_local1.oPlayer.pause();
_local1.oOpponent.pause();
_local1.oProjectileList.pause();
}
function resumeGame() {
var _local1 = this;
_local1.bGamePaused = false;
_local1.mcTimeLine.screens.content.help.gotoAndStop(1);
_local1.mcTimeLine.screens.content.hud.menu.menu.enabled = true;
_local1.oPlayer.resume();
_local1.oOpponent.resume();
_local1.oProjectileList.resume();
}
function fighterDie() {
var _local1 = this;
trace("DIE!!");
_local1.oPlayer.lock();
_local1.oOpponent.lock();
_local1.oSoundCTRL.fadeOutSound("musicInGame");
}
function fighterDeath(oLooser) {
var _local1 = this;
_local1.oSky.lock();
if (oLooser == _local1.oPlayer) {
_local1.gotoScreen("endBad");
_local1.oSoundCTRL.playSound("loose", 100, 0);
} else {
_local1.nOpponentPos--;
_local1.gotoScreen("duelEnd");
_local1.oSoundCTRL.playSound("musicMenu", 65, 100000);
}
}
function colorMe(mcToColor) {
var _local2 = new utils.ColorSetter();
var _local1 = oBuilder.getColorPalette();
trace(_local1.color1);
_local2.setColorPalette(_local1.color1, _local1.color2, _local1.color3);
_local2.colorPart(mcToColor, false);
}
function getRoot() {
trace("mcTimeLine: " + mcTimeLine);
return(mcTimeLine);
}
static var SCREEN_TOP = 0;
static var SCREEN_BOTTOM = 400;
static var SCREEN_LEFT = 0;
static var SCREEN_RIGHT = 540;
static var BASE_SPEED = 75;
var SHAREDOBJECT_NAME = "dp_fight";
}
Symbol 1271 MovieClip [__Packages.ship.ShipBuilder] Frame 0
class ship.ShipBuilder
{
var mcTimeLine, aPartSets, nPilotID, oShip;
function ShipBuilder (l_mcTimeLine) {
mcTimeLine = l_mcTimeLine;
aPartSets = [["A1", false], ["B1", false], ["C1", false], ["D1", false], ["A2", true], ["B2", true], ["C2", true], ["D2", true], ["A3", true], ["B3", true], ["C3", true], ["D3", true]];
}
function setPilot(l_nPilotID) {
nPilotID = l_nPilotID;
_global.C.gotoScreen("builder");
}
function getPilot() {
return(nPilotID);
}
function init(l_nScore) {
var _local1 = this;
_local1.oShip = new ship.Ship(_local1.mcTimeLine.screens.content.container);
_local1.mcTimeLine.screens.content.container._xscale = 65;
_local1.mcTimeLine.screens.content.container._yscale = 65;
_local1.oShip.setColorPalette(ship.ShipDatas.aPalettes[_local1.nPilotID - 1][0], ship.ShipDatas.aPalettes[_local1.nPilotID - 1][1], ship.ShipDatas.aPalettes[_local1.nPilotID - 1][2]);
_local1.oShip.render("NOFIRE");
_local1.initAllBtn();
_local1.adjustAllPoints();
}
function checkUnlock(l_nScore, l_bInit) {
var _local1 = this;
var _local3 = l_nScore;
var _local2 = false;
for (var i in _local1.aPartSets) {
_local1.aPartSets[i][2] = false;
if ((_local3 >= ship.ShipDatas.oUnlockScore[_local1.aPartSets[i][0]]) && (_local1.aPartSets[i][1])) {
_local1.aPartSets[i][1] = false;
if (!l_bInit) {
_local1.aPartSets[i][2] = true;
}
_local2 = true;
}
}
return(_local2);
}
function setShip(l_sShipCode) {
var _local2 = this;
if (l_sShipCode != "") {
var _local1 = ship.ShipCodec.decode(l_sShipCode);
_local2.oShip.setHull(_local1.hullID);
_local2.oShip.setWing(_local1.wingID);
_local2.oShip.setNose(_local1.noseID);
_local2.oShip.setTail(_local1.tailID);
_local2.oShip.render("NOFIRE");
}
}
function reactivate(l_nScore) {
var _local1 = this;
_local1.mcTimeLine.screens.content.container._xscale = 65;
_local1.mcTimeLine.screens.content.container._yscale = 65;
_local1.oShip.render("NOFIRE");
_local1.initAllBtn();
_local1.adjustAllPoints();
}
function initAllBtn() {
var _local1 = this;
var _local3 = _global;
var _local2 = new Array("Hull", "Nose", "Tail", "Wing");
var l_mcCurrent;
for (var i in _local2) {
l_mcCurrent = _local1.mcTimeLine.screens.content["btn" + _local2[i]];
l_mcCurrent.partType = _local2[i];
l_mcCurrent.onRelease = function () {
_global.C.oBuilder["next" + this.partType]();
_global.C.oSoundCTRL.playSound("select" + this.partType, 75, 0);
};
l_mcCurrent.onRollOver = function () {
l_mcCurrent._parent["btnRond" + this.partType].gotoAndStop("_over");
};
l_mcCurrent.onRollOut = function () {
l_mcCurrent._parent["btnRond" + this.partType].gotoAndStop("_up");
};
}
}
function adjustAllPoints() {
var _local1 = this;
var _local2 = false;
if (_local1.adjustPoint("Hull", "Hull", {x:435, y:320})) {
_local2 = true;
}
if (_local1.adjustPoint("Wing", "Missile", {x:220, y:365})) {
_local2 = true;
}
if (_local1.adjustPoint("Nose", "Cannon", {x:505, y:75})) {
_local2 = true;
}
if (_local1.adjustPoint("Tail", "Mine", {x:30, y:65})) {
_local2 = true;
}
_local1.adjustStats();
_local1.adjustStatsPossible();
if (!_local2) {
_local1.mcTimeLine.screens.content.btnReadyStart.enabled = true;
_local1.mcTimeLine.screens.content.btnReadyInGame.enabled = true;
} else {
_local1.mcTimeLine.screens.content.btnReadyStart.enabled = false;
_local1.mcTimeLine.screens.content.btnReadyInGame.enabled = false;
}
}
function adjustPoint(l_sPartType, l_sPointType, l_oStartPos) {
var _local2 = this;
var _local3 = l_sPartType;
var _local1 = new Object();
var l_mc = _local2.oShip["getReg" + l_sPointType]();
var l_mcLine = _local2.mcTimeLine.screens.content[_local3 + "Line"];
_local1.x = l_mc._x;
_local1.y = l_mc._y;
l_mc._parent._parent.localToGlobal(_local1);
_local2.mcTimeLine.screens.content["btnRond" + _local3]._x = _local1.x;
_local2.mcTimeLine.screens.content["btnRond" + _local3]._y = _local1.y;
l_mcLine.clear();
l_mcLine.lineStyle(2, 10664987, 100);
l_mcLine.moveTo(l_oStartPos.x, l_oStartPos.y);
if (_local3 == "Hull") {
l_mcLine.lineTo(_local1.x, l_oStartPos.y);
l_mcLine.lineTo(_local1.x, _local1.y);
} else {
l_mcLine.lineTo(l_oStartPos.x, _local1.y);
l_mcLine.lineTo(_local1.x, _local1.y);
}
if (_local2.isPartNew(_local2.oShip["get" + _local3]())) {
_local2.mcTimeLine.screens.content["btnRond" + _local3].isNew._visible = true;
} else {
_local2.mcTimeLine.screens.content["btnRond" + _local3].isNew._visible = false;
}
if (_local2.isPartLocked(_local2.oShip["get" + _local3]())) {
_local2.mcTimeLine.screens.content["btnRond" + _local3].isLocked._visible = true;
return(true);
}
_local2.mcTimeLine.screens.content["btnRond" + _local3].isLocked._visible = false;
return(false);
}
function adjustStats() {
var _local1 = this;
var l_nEnergy = ship.ShipDatas.aHull[_local1.oShip.getHull()].energy;
var l_nSpeed = ship.ShipDatas.aHull[_local1.oShip.getHull()].movement;
var _local3 = ship.ShipDatas.aWingWeapon[_local1.oShip.getWing()].damage;
var _local2 = ship.ShipDatas.aWingWeapon[_local1.oShip.getWing()].speed;
var l_nMineForce = ship.ShipDatas.aTailWeapon[_local1.oShip.getTail()].damage;
var l_nCannonForce = ship.ShipDatas.aNoseWeapon[_local1.oShip.getNose()].damage;
_local1.mcTimeLine.screens.content.stats.energy.gotoAndStop(l_nEnergy);
_local1.mcTimeLine.screens.content.statsShadow.energy.gotoAndStop(l_nEnergy);
_local1.mcTimeLine.screens.content.stats.speed.gotoAndStop(l_nSpeed * 2);
_local1.mcTimeLine.screens.content.statsShadow.speed.gotoAndStop(l_nSpeed * 2);
_local1.mcTimeLine.screens.content.stats.missileForce.gotoAndStop(_local3 * 2);
_local1.mcTimeLine.screens.content.statsShadow.missileForce.gotoAndStop(_local3 * 2);
_local1.mcTimeLine.screens.content.stats.missileSpeed.gotoAndStop(_local2);
_local1.mcTimeLine.screens.content.statsShadow.missileSpeed.gotoAndStop(_local2);
_local1.mcTimeLine.screens.content.stats.mineForce.gotoAndStop(l_nMineForce);
_local1.mcTimeLine.screens.content.statsShadow.mineForce.gotoAndStop(l_nMineForce);
_local1.mcTimeLine.screens.content.stats.cannonForce.gotoAndStop(l_nCannonForce);
_local1.mcTimeLine.screens.content.statsShadow.cannonForce.gotoAndStop(l_nCannonForce);
}
function adjustStatsPossible() {
var _local1 = this;
var _local2 = 5;
var l_nSpeedMax = 8;
var l_nMissileForceMax = 6;
var _local3 = 8;
var l_nCannonForceMax = 3;
_local1.mcTimeLine.screens.content.statsPossible.energy.gotoAndStop(_local2);
_local1.mcTimeLine.screens.content.statsPossible.speed.gotoAndStop(l_nSpeedMax);
_local1.mcTimeLine.screens.content.statsPossible.missileForce.gotoAndStop(l_nMissileForceMax);
_local1.mcTimeLine.screens.content.statsPossible.mineForce.gotoAndStop(_local3);
_local1.mcTimeLine.screens.content.statsPossible.cannonForce.gotoAndStop(l_nCannonForceMax);
}
function nextHull() {
var _local1 = this;
var _local2 = _local1.getNextPart(_local1.oShip.getHull());
_local1.oShip.setHull(_local2, _local1.isPartLocked(_local2));
_local1.oShip.render("NOFIRE");
_local1.adjustAllPoints();
}
function nextWing() {
var _local1 = this;
var _local2 = _local1.getNextPart(_local1.oShip.getWing());
_local1.oShip.setWing(_local2, _local1.isPartLocked(_local2));
_local1.oShip.render("NOFIRE");
_local1.adjustAllPoints();
}
function nextNose() {
var _local1 = this;
var _local2 = _local1.getNextPart(_local1.oShip.getNose());
_local1.oShip.setNose(_local2, _local1.isPartLocked(_local2));
_local1.oShip.render("NOFIRE");
_local1.adjustAllPoints();
}
function nextTail() {
var _local1 = this;
var _local2 = _local1.getNextPart(_local1.oShip.getTail());
_local1.oShip.setTail(_local2, _local1.isPartLocked(_local2));
_local1.oShip.render("NOFIRE");
_local1.adjustAllPoints();
}
function getSaveCode() {
var _local1 = this;
var _local2;
_local2 = ship.ShipCodec.encode(_local1.nPilotID, _local1.oShip.getHull(), _local1.oShip.getWing(), _local1.oShip.getTail(), _local1.oShip.getNose());
return(_local2);
}
function getColorPalette() {
return(oShip.getColorPalette());
}
function getNextPart(l_nCurrentPart) {
var _local1 = l_nCurrentPart + 1;
if (_local1 >= aPartSets.length) {
_local1 = 0;
}
return(_local1);
}
function isPartLocked(l_nPartID) {
return(aPartSets[l_nPartID][1]);
}
function isPartNew(l_nPartID) {
return(aPartSets[l_nPartID][2]);
}
}
Symbol 1272 MovieClip [__Packages.ship.Ship] Frame 0
class ship.Ship
{
var mcContainer, nHullID, bHullLocked, nTailID, bTailLocked, nWingID, bWingLocked, nNoseID, bNoseLocked, oColorSetter;
function Ship (l_mcContainer) {
var _local1 = this;
_local1.mcContainer = l_mcContainer;
_local1.setHull(0);
_local1.setTail(0);
_local1.setWing(0);
_local1.setNose(0);
_local1.oColorSetter = new utils.ColorSetter();
}
function render(l_sFireType) {
var _local1 = this;
var _local2 = l_sFireType;
_local1.mcContainer.attachMovie("parts_hulls", "hull", 2);
_local1.mcContainer.attachMovie("parts_wings", "wing", 3);
_local1.mcContainer.attachMovie("parts_tails", "tail", 1);
_local1.mcContainer.attachMovie("parts_noses", "nose", 4);
if (_local2 != "NOFIRE") {
_local1.mcContainer.attachMovie("parts_fire", "fire", 0);
}
_local1.mcContainer.hull.gotoAndStop(_local1.nHullID + 1);
_local1.mcContainer.hull.part.boundingBox._visible = false;
_local1.mcContainer.hull.part.mainPoint._visible = false;
_local1.mcContainer.wing.gotoAndStop(_local1.nWingID + 1);
_local1.mcContainer.wing.part.regLaunchPoint._visible = false;
_local1.mcContainer.tail.gotoAndStop(_local1.nTailID + 1);
if (_local2 != "NOFIRE") {
_local1.mcContainer.fire.gotoAndStop(_local1.nTailID + 1);
}
_local1.mcContainer.tail.part.boundingBox._visible = false;
_local1.mcContainer.tail.part.regLaunchPoint._visible = false;
_local1.mcContainer.tail.part.firePoint._visible = false;
_local1.mcContainer.nose.gotoAndStop(_local1.nNoseID + 1);
_local1.mcContainer.nose.part.boundingBox._visible = false;
_local1.mcContainer.nose.part.regLaunchPoint._visible = false;
_local1.movePart(_local1.mcContainer.wing, _local1.mcContainer.hull.part.wingPoint);
_local1.movePart(_local1.mcContainer.tail, _local1.mcContainer.hull.part.tailPoint);
_local1.movePart(_local1.mcContainer.nose, _local1.mcContainer.hull.part.nosePoint);
if (_local2 != "NOFIRE") {
_local1.moveFire(_local1.mcContainer.fire, _local1.mcContainer.tail.part.firePoint);
}
_local1.colorPart(_local1.mcContainer.hull, _local1.bHullLocked);
_local1.colorPart(_local1.mcContainer.wing, _local1.bWingLocked);
_local1.colorPart(_local1.mcContainer.tail, _local1.bTailLocked);
_local1.colorPart(_local1.mcContainer.nose, _local1.bNoseLocked);
}
function pause() {
mcContainer.fire.part.stop();
}
function setHull(l_nHullID, l_bLocked) {
nHullID = l_nHullID;
bHullLocked = l_bLocked;
}
function setTail(l_nTailID, l_bLocked) {
nTailID = l_nTailID;
bTailLocked = l_bLocked;
}
function setWing(l_nWingID, l_bLocked) {
nWingID = l_nWingID;
bWingLocked = l_bLocked;
}
function setNose(l_nNoseID, l_bLocked) {
nNoseID = l_nNoseID;
bNoseLocked = l_bLocked;
}
function getHull() {
return(nHullID);
}
function getTail() {
return(nTailID);
}
function getWing() {
return(nWingID);
}
function getNose() {
return(nNoseID);
}
function getRegMissile() {
return(mcContainer.wing.part.regLaunchPoint);
}
function getRegMine() {
return(mcContainer.tail.part.firePoint);
}
function getRegCannon() {
return(mcContainer.nose.part.regLaunchPoint);
}
function getRegHull() {
return(mcContainer.hull.part.mainPoint);
}
function getBoundingBox() {
var _local1 = this;
return([_local1.mcContainer.tail.part.boundingBox, _local1.mcContainer.hull.part.boundingBox, _local1.mcContainer.nose.part.boundingBox]);
}
function movePart(mcPart, mcPoint) {
var _local1 = mcPoint;
_local1._visible = false;
mcPart._x = _local1._x;
mcPart._y = _local1._y;
}
function moveFire(mcPart, mcPoint) {
var _local1 = mcPoint;
_local1._visible = false;
mcPart._x = _local1._x + mcContainer.tail._x;
mcPart._y = _local1._y + mcContainer.tail._y;
}
function colorPart(mcPart, l_bLocked) {
oColorSetter.colorPart(mcPart, l_bLocked);
}
function setColorPalette(l_oColor1, l_oColor2, l_oColor3) {
oColorSetter.setColorPalette(l_oColor1, l_oColor2, l_oColor3);
}
function getColorPalette() {
return(oColorSetter.getColorPalette());
}
}
Symbol 1273 MovieClip [__Packages.utils.ColorSetter] Frame 0
class utils.ColorSetter
{
function ColorSetter () {
}
function setColorPalette(l_oColor1, l_oColor2, l_oColor3) {
var _local1 = this;
_local1.oColor1 = l_oColor1;
_local1.oColor2 = l_oColor2;
_local1.oColor3 = l_oColor3;
_local1.oColorLocked = {ra:0, rb:-255, ga:0, gb:-255, ba:0, bb:-255, aa:100, ab:0};
}
function getColorPalette() {
var _local1 = this;
return({color1:_local1.oColor1, color2:_local1.oColor2, color3:_local1.oColor3});
}
function colorPart(mcPart, l_bLocked) {
var _local3 = this;
var _local2;
var _local1;
if (l_bLocked) {
_local1 = _local3.oColorLocked;
} else {
_local1 = _local3.oColor1;
}
_local2 = new Color(mcPart.part.col1);
_local2.setTransform(_local1);
if (l_bLocked) {
_local1 = _local3.oColorLocked;
} else {
_local1 = _local3.oColor2;
}
_local2 = new Color(mcPart.part.col2);
_local2.setTransform(_local1);
if (l_bLocked) {
_local1 = _local3.oColorLocked;
} else {
_local1 = _local3.oColor3;
}
_local2 = new Color(mcPart.part.col3);
_local2.setTransform(_local1);
}
}
Symbol 1274 MovieClip [__Packages.ship.ShipDatas] Frame 0
class ship.ShipDatas
{
static var oUnlockScore, aVoices, aPalettes, aHull, aTailWeapon, aNoseWeapon, aWingWeapon;
function ShipDatas () {
}
static function init() {
oUnlockScore = {A1:0, B1:0, C1:0, D1:0, A2:10000, B2:25000, C2:50000, D2:75000, A3:150000, B3:250000, C3:350000, D3:500000};
aVoices = ["danny_voice", "sam_voice", "skulker_voice", "desiree_voice", "vlad_voice", "technus_voice"];
aPalettes = [[{ra:100, rb:0, ga:100, gb:0, ba:100, bb:0, aa:100, ab:0}, {ra:40, rb:0, ga:40, gb:0, ba:65, bb:0, aa:100, ab:0}, {ra:100, rb:-25, ga:100, gb:255, ba:100, bb:255, aa:100, ab:0}], [{ra:-100, rb:-255, ga:-64, gb:168, ba:-30, bb:229, aa:100, ab:0}, {ra:-100, rb:-31, ga:-90, gb:-87, ba:-100, bb:122, aa:100, ab:0}, {ra:98, rb:-82, ga:92, gb:-97, ba:76, bb:102, aa:100, ab:0}], [{ra:100, rb:-255, ga:100, gb:5, ba:100, bb:-255, aa:100, ab:0}, {ra:-100, rb:255, ga:45, gb:112, ba:-100, bb:255, aa:100, ab:0}, {ra:60, rb:0, ga:85, gb:0, ba:100, bb:0, aa:100, ab:0}], [{ra:-100, rb:0, ga:100, gb:0, ba:100, bb:0, aa:100, ab:0}, {ra:-100, rb:0, ga:100, gb:112, ba:100, bb:-57, aa:100, ab:0}, {ra:-100, rb:255, ga:-57, gb:255, ba:100, bb:255, aa:100, ab:0}], [{ra:100, rb:-255, ga:100, gb:-255, ba:100, bb:-85, aa:100, ab:0}, {ra:100, rb:-45, ga:-100, gb:-255, ba:-100, bb:-255, aa:100, ab:0}, {ra:100, rb:0, ga:25, gb:0, ba:-15, bb:0, aa:100, ab:0}], [{ra:-100, rb:-255, ga:-100, gb:180, ba:50, bb:75, aa:100, ab:0}, {ra:-100, rb:-255, ga:-100, gb:-180, ba:50, bb:75, aa:100, ab:0}, {ra:-100, rb:255, ga:-100, gb:255, ba:-100, bb:-180, aa:100, ab:0}]];
aHull = [{energy:2, movement:2, size:"Med", damage:2, scaling:120}, {energy:1, movement:3, size:"Sma", damage:1, scaling:160}, {energy:3, movement:1, size:"Big", damage:3, scaling:70}, {energy:2, movement:2, size:"Med", damage:2, scaling:110}, {energy:1, movement:2, size:"Sma", damage:1, scaling:115}, {energy:2, movement:3, size:"Med", damage:2, scaling:190}, {energy:3, movement:1, size:"Big", damage:3, scaling:80}, {energy:2, movement:2, size:"Med", damage:2, scaling:110}, {energy:2, movement:2, size:"Med", damage:2, scaling:105}, {energy:3, movement:2, size:"Med", damage:2, scaling:160}, {energy:5, movement:1.5, size:"Big", damage:4, scaling:80}, {energy:1, movement:4, size:"Sma", damage:2, scaling:100}];
aTailWeapon = [{damage:4}, {damage:4}, {damage:4}, {damage:4}, {damage:6}, {damage:6}, {damage:6}, {damage:6}, {damage:8}, {damage:8}, {damage:8}, {damage:8}];
aNoseWeapon = [{damage:1}, {damage:1}, {damage:1}, {damage:1}, {damage:2}, {damage:2}, {damage:2}, {damage:2}, {damage:3}, {damage:3}, {damage:3}, {damage:3}];
aWingWeapon = [{damage:1, speed:2}, {damage:1, speed:3}, {damage:1, speed:1}, {damage:1, speed:2}, {damage:2, speed:3}, {damage:2, speed:2}, {damage:2, speed:1}, {damage:2, speed:2}, {damage:3, speed:2}, {damage:3, speed:2}, {damage:3, speed:3}, {damage:3, speed:1}];
}
}
Symbol 1275 MovieClip [__Packages.ship.ShipCodec] Frame 0
class ship.ShipCodec
{
function ShipCodec () {
}
static function getRandomCode() {
var _local3 = Math.ceil(Math.random() * nMaxPilot);
var _local2 = Math.floor(Math.random() * nMaxPart);
var _local1 = Math.floor(Math.random() * nMaxPart);
var l_nTail = Math.floor(Math.random() * nMaxPart);
var l_nNose = Math.floor(Math.random() * nMaxPart);
return(encode(_local3, _local2, _local1, l_nTail, l_nNose));
}
static function encode(l_nPilotID, l_nHull, l_nWing, l_nTail, l_nNose) {
var _local1 = "";
_local1 = _local1 + padZero(l_nPilotID);
_local1 = _local1 + padZero(l_nHull);
_local1 = _local1 + padZero(l_nWing);
_local1 = _local1 + padZero(l_nTail);
_local1 = _local1 + padZero(l_nNose);
return(_local1);
}
static function decode(shipID) {
var _local2 = shipID;
var _local1 = new Object();
_local1.pilotID = Number(_local2.substr(0, 2));
_local1.hullID = Number(_local2.substr(2, 2));
_local1.wingID = Number(_local2.substr(4, 2));
_local1.tailID = Number(_local2.substr(6, 2));
_local1.noseID = Number(_local2.substr(8, 2));
return(_local1);
}
static function padZero(l_nNum) {
var _local1 = l_nNum;
if (_local1 < 10) {
return("0" + _local1);
}
return(String(_local1));
}
static var nMaxPilot = 6;
static var nMaxPart = 12;
}
Symbol 1276 MovieClip [__Packages.utils.Stater] Frame 0
class utils.Stater
{
var sCurrentState, mcContainer, render;
function Stater () {
mx.events.EventDispatcher.initialize(this);
}
function setState(l_sState) {
var _local1 = this;
var _local2 = l_sState;
var _local3;
if (_local1.sCurrentState != _local2) {
_local1.dispatchEvent({type:"changeState", target:_local1, newState:_local2, oldState:_local1.sCurrentState});
_local1.sCurrentState = _local2;
_local3 = _local1.mcContainer._currentframe;
_local1.mcContainer.gotoAndStop(_local1.sCurrentState);
if (_local1.mcContainer._currentframe == _local3) {
_local1.mcContainer.gotoAndStop("Idle");
}
_local1.nFrTotalAnim = _local1.mcContainer.state._totalframes;
_local1.render();
}
}
function getState() {
return(sCurrentState);
}
function actions() {
this[sCurrentState]();
}
function pause() {
mcContainer.state.stop();
}
function resume() {
mcContainer.state.play();
render();
}
}
Symbol 1277 MovieClip [__Packages.mx.events.EventDispatcher] Frame 0
class mx.events.EventDispatcher
{
function EventDispatcher () {
}
static function _removeEventListener(queue, event, handler) {
var _local3 = queue;
if (_local3 != undefined) {
var l = _local3.length;
var _local1;
_local1 = 0;
while (_local1 < l) {
var _local2 = _local3[_local1];
if (_local2 == handler) {
_local3.splice(_local1, 1);
return;
}
_local1++;
}
}
}
static function initialize(object) {
var _local1 = object;
if (_fEventDispatcher == undefined) {
_fEventDispatcher = new mx.events.EventDispatcher();
}
_local1.addEventListener = _fEventDispatcher.addEventListener;
_local1.removeEventListener = _fEventDispatcher.removeEventListener;
_local1.dispatchEvent = _fEventDispatcher.dispatchEvent;
_local1.dispatchQueue = _fEventDispatcher.dispatchQueue;
}
function dispatchQueue(queueObj, eventObj) {
var _local2 = eventObj;
var queueName = ("__q_" + _local2.type);
var queue = queueObj[queueName];
if (queue != undefined) {
var i;
for (i in queue) {
var _local1 = queue[i];
var _local3 = typeof(_local1);
if ((_local3 == "object") || (_local3 == "movieclip")) {
if (_local1.handleEvent != undefined) {
_local1.handleEvent(_local2);
}
if (_local1[_local2.type] != undefined) {
if (exceptions[_local2.type] == undefined) {
_local1[_local2.type](_local2);
}
}
} else {
_local1.apply(queueObj, [_local2]);
}
}
}
}
function dispatchEvent(eventObj) {
var _local1 = eventObj;
var _local2 = this;
if (_local1.target == undefined) {
_local1.target = _local2;
}
_local2[_local1.type + "Handler"](_local1);
_local2.dispatchQueue(_local2, _local1);
}
function addEventListener(event, handler) {
var _local2 = this;
var _local1 = "__q_" + event;
if (_local2[_local1] == undefined) {
_local2[_local1] = new Array();
}
_global.ASSetPropFlags(_local2, _local1, 1);
_removeEventListener(_local2[_local1], event, handler);
_local2[_local1].push(handler);
}
function removeEventListener(event, handler) {
var _local1 = "__q_" + event;
_removeEventListener(this[_local1], event, handler);
}
static var _fEventDispatcher = undefined;
static var exceptions = {move:1, draw:1};
}
Symbol 1278 MovieClip [__Packages.fighter.Fighter] Frame 0
class fighter.Fighter extends utils.Stater
{
var oEnergyBar, setState, mcHitLeft, aBoundingBoxList, mcHitRight, mcRegMissile, oShip, mcRegMine, mcRegCannon, nPilotID, sSize, nHit, mcHitTop, nYPos, nXPos, bLocked;
function Fighter () {
var _local1 = this;
super();
_local1.nXMove = 0;
_local1.nYMove = 0;
_local1.SCALING_RATE = 0.4;
_local1.BOOST_SPEED = 10;
_local1.BOUNCE_SPEED = 15;
_local1.frMineDelayCount = 0;
_local1.frMissileDelayCount = 0;
_local1.frCannonDelayCount = 0;
_local1.nDistortEnd = 525;
_local1.aProjectile = new Array();
}
function showPlayerShip(l_mcContainer) {
var _local2 = this;
var _local3 = l_mcContainer;
var _local1 = ship.ShipCodec.decode(_local2.sShipCode);
_local3._xscale = ship.ShipDatas.aHull[_local1.hullID].scaling;
_local3._yscale = ship.ShipDatas.aHull[_local1.hullID].scaling;
_local2.oShip = new ship.Ship(_local3);
_local2.oShip.setColorPalette(ship.ShipDatas.aPalettes[_local1.pilotID - 1][0], ship.ShipDatas.aPalettes[_local1.pilotID - 1][1], ship.ShipDatas.aPalettes[_local1.pilotID - 1][2]);
_local2.oShip.setHull(_local1.hullID);
_local2.oShip.setWing(_local1.wingID);
_local2.oShip.setNose(_local1.noseID);
_local2.oShip.setTail(_local1.tailID);
_local2.oShip.render("NOFIRE");
}
function init(l_mcContainer, l_sShipCode, l_mcEnergyBar) {
var _local1 = this;
_local1.mcContainer = l_mcContainer;
_local1.sShipCode = l_sShipCode;
_local1.initShip();
_local1.initHitLimit();
_local1.initRegMissile();
_local1.initRegMine();
_local1.initRegCannon();
_local1.initEnergyBar(l_mcEnergyBar);
_local1.setState("Idle");
_local1.bLocked = false;
_local1.bDistorted = false;
_local1.nHit = 0;
_local1.nShot = 0;
}
function modifyParts(l_sShipCode) {
var _local1 = this;
var _local2 = ship.ShipCodec.decode(l_sShipCode);
_local1.oShip.setHull(_local2.hullID);
_local1.oShip.setWing(_local2.wingID);
_local1.oShip.setNose(_local2.noseID);
_local1.oShip.setTail(_local2.tailID);
_local1.initHitLimit();
_local1.initRegMissile();
_local1.initRegMine();
_local1.initRegCannon();
_local1.initSpec(_local2);
}
function initEnergyBar(l_mcEnergyBar) {
var _local1 = this;
_local1.oEnergyBar = new fighter.Bar();
_local1.oEnergyBar.init(l_mcEnergyBar, _local1.nMaxEnergy);
}
function looseEnergy(l_nAmount) {
if (oEnergyBar.looseEnergy(l_nAmount)) {
setState("Die");
_global.C.oSoundCTRL.playSound("explodes", 100, 0);
_global.C.fighterDie();
}
}
function addEnergy(l_nAmount) {
oEnergyBar.addEnergy(l_nAmount);
}
function initHitLimit() {
var _local1 = this;
_local1.aBoundingBoxList = _local1.oShip.getBoundingBox();
_local1.initHitTop();
_local1.initHitBottom();
_local1.initHitLeft();
_local1.initHitRight();
}
function initHitTop() {
var _local3 = this;
var nCurrentMax = 10000;
var _local2;
var _local1;
for (var i in _local3.aBoundingBoxList) {
_local1 = _local3.aBoundingBoxList[i];
_local2 = _local1._parent._y + _local1._y;
if (_local2 < nCurrentMax) {
nCurrentMax = _local2;
_local3.mcHitTop = _local1;
}
}
}
function initHitBottom() {
var _local3 = this;
var nCurrentMax = -10000;
var _local2;
var _local1;
for (var i in _local3.aBoundingBoxList) {
_local1 = _local3.aBoundingBoxList[i];
_local2 = (_local1._parent._y + _local1._y) + _local1._height;
if (_local2 > nCurrentMax) {
nCurrentMax = _local2;
_local3.mcHitBottom = _local1;
}
}
}
function initHitLeft() {
mcHitLeft = aBoundingBoxList[0];
}
function initHitRight() {
mcHitRight = aBoundingBoxList[2];
}
function initRegMissile() {
mcRegMissile = oShip.getRegMissile();
}
function initRegMine() {
mcRegMine = oShip.getRegMine();
}
function initRegCannon() {
mcRegCannon = oShip.getRegCannon();
}
function initShip() {
var _local1 = this;
var _local2 = ship.ShipCodec.decode(_local1.sShipCode);
_local1.oShip = new ship.Ship(_local1.mcContainer.state.container);
_local1.oShip.setColorPalette(ship.ShipDatas.aPalettes[_local2.pilotID - 1][0], ship.ShipDatas.aPalettes[_local2.pilotID - 1][1], ship.ShipDatas.aPalettes[_local2.pilotID - 1][2]);
_local1.oShip.setHull(_local2.hullID);
_local1.oShip.setWing(_local2.wingID);
_local1.oShip.setNose(_local2.noseID);
_local1.oShip.setTail(_local2.tailID);
_local1.oShip.render();
_local1.initSpec(_local2);
_local1.mcContainer._xscale = _local1.SCALING_RATE * 100;
_local1.mcContainer._yscale = _local1.SCALING_RATE * 100;
_local1.nXPos = _local1.mcContainer._x;
_local1.nYPos = _local1.mcContainer._y;
}
function initDistort() {
var _local1 = this;
_local1.setState("Distort");
_global.C.oSoundCTRL.playSound("distorting", 100, 0);
_local1.nDistortCount = 0;
_local1.bDistorted = true;
_local1.mcContainer.state.distorter._width = _local1.mcContainer.state._width * 1.5;
_local1.mcContainer.state.distorter._height = _local1.mcContainer.state._height * 1.5;
}
function endDistort() {
var _local1 = this;
if ((_local1.getState() != "Die") && (_local1.getState() != "Loop")) {
_local1.setState("Rebuild");
_global.C.oSoundCTRL.playSound("distorting", 100, 0);
_local1.bDistorted = false;
_local1.mcContainer.state.distorter._width = _local1.mcContainer.state._width * 1.5;
_local1.mcContainer.state.distorter._height = _local1.mcContainer.state._height * 1.5;
}
}
function getPilotID() {
return(nPilotID);
}
function getAccuracy() {
var _local1 = this;
if (_local1.nShot == 0) {
return(100);
}
return(Math.round((_local1.nHit / _local1.nShot) * 100));
}
function getEnergy() {
return(oEnergyBar.getEnergy());
}
function actions() {
var _local1 = this;
super.actions();
if (_local1.frMissileDelayCount > 0) {
_local1.frMissileDelayCount--;
}
if (_local1.frMineDelayCount > 0) {
_local1.frMineDelayCount--;
}
if (_local1.frCannonDelayCount > 0) {
_local1.frCannonDelayCount--;
}
if (_local1.bDistorted && (!_local1.bLocked)) {
_local1.nDistortCount++;
if (_local1.nDistortCount > _local1.nDistortEnd) {
_local1.endDistort();
}
}
}
function render() {
oShip.render();
}
function pause() {
super.pause();
oShip.pause();
}
function initSpec(l_oShipInfos) {
var _local1 = this;
var _local2 = l_oShipInfos;
_local1.nMaxSpeed = ship.ShipDatas.aHull[_local2.hullID].movement * 2.5;
_local1.nMaxEnergy = ship.ShipDatas.aHull[_local2.hullID].energy * 20;
_local1.sSize = ship.ShipDatas.aHull[_local2.hullID].size;
_local1.nPilotID = Number(_local2.pilotID);
}
function getSize() {
return(sSize);
}
function setMove() {
}
function setMoveAuto() {
var _local1 = this;
_local1.nXMove = _local1.nXSpeed;
_local1.nYMove = _local1.nYSpeed;
}
function setSpeedBounce() {
var _local1 = this;
_local1.nXSpeed = _local1.nXSpeed * 0.95;
if (Math.abs(_local1.nXSpeed) < _local1.nMaxSpeed) {
_local1.endBounce();
}
}
function endBounce() {
setState("Idle");
}
function initLoop() {
var _local1 = this;
_local1.setState("Loop");
_local1.sLoopState = "loopPhase1";
_global.C.oSoundCTRL.playSound("loop", 50, 0);
_local1.nLoopAngle = (Math.PI/2);
_local1.nXRadiusLoop = 1000 - _local1.nXPos;
_local1.nYRadiusLoop = _local1.nYPos;
_local1.nXCenterLoop = _local1.nXPos;
_local1.nYCenterLoop = _local1.nYPos - _local1.nYRadiusLoop;
}
function loopPhase1() {
var _local1 = this;
var _local2 = _local1.nXCenterLoop + (Math.cos(_local1.nLoopAngle) * _local1.nXRadiusLoop);
var _local3 = _local1.nYCenterLoop + (Math.sin(_local1.nLoopAngle) * _local1.nYRadiusLoop);
_local1.nLoopAngle = _local1.nLoopAngle - 0.1;
_local1.nXSpeed = _local2 - _local1.nXPos;
_local1.nYSpeed = _local3 - _local1.nYPos;
_local1.mcContainer._rotation = (_local1.nLoopAngle * 57.2957795130823) - 90;
if (_local1.nLoopAngle < -1.5707963267949) {
_local1.sLoopState = "loopPhase2";
}
}
function loopPhase2() {
var _local1 = this;
_local1.nXSpeed = -15;
_local1.nYSpeed = 0;
if (_local1.nXPos <= _local1.LOOP_TARGET.x) {
_local1.nXRadiusLoop = 200;
_local1.nYRadiusLoop = (_local1.LOOP_TARGET.y - _local1.nYPos) / 2;
_local1.nXCenterLoop = _local1.LOOP_TARGET.x;
_local1.nYCenterLoop = _local1.nYPos + _local1.nYRadiusLoop;
_local1.sLoopState = "loopPhase3";
}
}
function loopPhase3() {
var _local1 = this;
var _local2 = _local1.nXCenterLoop + (Math.cos(_local1.nLoopAngle) * _local1.nXRadiusLoop);
var _local3 = _local1.nYCenterLoop + (Math.sin(_local1.nLoopAngle) * _local1.nYRadiusLoop);
_local1.nLoopAngle = _local1.nLoopAngle - 0.15;
_local1.nXSpeed = _local2 - _local1.nXPos;
_local1.nYSpeed = _local3 - _local1.nYPos;
_local1.mcContainer._rotation = (_local1.nLoopAngle * 57.2957795130823) - 90;
if (_local1.nLoopAngle < -4.71238898038469) {
_local1.mcContainer._rotation = 0;
_local1.sLoopState = "";
_local1.endLoop();
}
}
function endLoop() {
setState("Idle");
}
function moveToPos() {
var _local1 = this;
_local1.mcContainer._x = _local1.nXPos;
_local1.mcContainer._y = _local1.nYPos;
}
function setBounceForward(l_nDamage) {
var _local1 = this;
var _local2 = _local1.getState();
_local1.nXBounceStart = _local1.nXPos;
_local1.setState("HurtBounce");
_local1.nHorizontalDir = 1;
_local1.nXSpeed = _local1.BOUNCE_SPEED * _local1.nHorizontalDir;
_local1.nYSpeed = 0;
if (_local2 != "HurtBounce") {
_local1.looseEnergy(l_nDamage);
}
}
function setBounceBack(l_nDamage) {
var _local1 = this;
var _local2 = _local1.getState();
_local1.nXBounceStart = _local1.nXPos;
_local1.setState("HurtBounce");
_local1.nHorizontalDir = -1;
_local1.nXSpeed = _local1.BOUNCE_SPEED * _local1.nHorizontalDir;
_local1.nYSpeed = 0;
if (_local2 != "HurtBounce") {
_local1.looseEnergy(l_nDamage);
}
}
function setPos() {
var _local1 = this;
if (_local1.sLoopState != "loopPhase2Pause") {
_local1.nXPos = Math.round(_local1.nXPos + _local1.nXMove);
_local1.nYPos = Math.round(_local1.nYPos + _local1.nYMove);
}
}
function hitTarget() {
nHit++;
}
function createProjectile(sProjectileType) {
var _local1 = this;
var _local2;
var _local3 = _local1.oShip.getColorPalette();
_local1.nShot++;
if (sProjectileType == "Missile") {
_local2 = new weapons.Missile(_local1.mcContainer._parent.projectile, _local1.getPosMissile(), _local1.nXSpeed + Controller.BASE_SPEED);
_local2.setID(_local1.oShip.getWing());
_global.C.oSoundCTRL.playSound("missileLaunch", 100, 0);
_local1.frMissileDelayCount = 80;
} else if (sProjectileType == "Mine") {
_local2 = new weapons.Mine(_local1.mcContainer._parent.projectile, _local1.getPosMine());
_local2.setID(_local1.oShip.getTail());
_global.C.oSoundCTRL.playSound("missileLaunch", 100, 0);
_local1.frMineDelayCount = 110;
} else {
_local2 = new weapons.Ball(_local1.mcContainer._parent.projectile, _local1.getPosBall(), _local1.nXSpeed + Controller.BASE_SPEED);
_local2.setID(_local1.oShip.getNose());
_global.C.oSoundCTRL.playSound("cannonShot", 100, 0);
_local1.frCannonDelayCount = 5;
}
_local2.setColorPalette(_local3.color1, _local3.color2, _local3.color3);
return(_local2);
}
function getPosMissile(l_bFinalLaunchPoint) {
var _local2 = this;
var _local1 = new Object();
_local1.x = _local2.mcRegMissile._x;
_local1.y = _local2.mcRegMissile._y;
_local2.mcRegMissile._parent._parent.localToGlobal(_local1);
if (l_bFinalLaunchPoint) {
_local1.y = _local1.y + weapons.Missile.YSTARTMOVE;
}
return(_local1);
}
function getPosMine() {
var _local2 = this;
var _local1 = new Object();
_local1.x = _local2.mcRegMine._x;
_local1.y = _local2.mcRegMine._y;
_local2.mcRegMine._parent._parent.localToGlobal(_local1);
return(_local1);
}
function getPosBall() {
var _local2 = this;
var _local1 = new Object();
_local1.x = _local2.mcRegCannon._x;
_local1.y = _local2.mcRegCannon._y;
_local2.mcRegCannon._parent._parent.localToGlobal(_local1);
return(_local1);
}
function getName() {
return(sName);
}
function getBoundingBox() {
return(aBoundingBoxList);
}
function getMaxBottom() {
var _local2 = this;
var _local1 = new Object();
_local1.x = 0;
_local1.y = _local2.mcHitBottom._y + _local2.mcHitBottom._height;
_local2.mcHitBottom._parent._parent.localToGlobal(_local1);
return(_local1.y);
}
function getMaxTop() {
var _local1 = new Object();
_local1.x = 0;
_local1.y = mcHitTop._y;
mcHitTop._parent._parent.localToGlobal(_local1);
return(_local1.y);
}
function getMaxLeft() {
var _local1 = new Object();
_local1.x = mcHitLeft._x;
_local1.y = 0;
mcHitLeft._parent._parent.localToGlobal(_local1);
return(_local1.x);
}
function getMaxRight() {
var _local2 = this;
var _local1 = new Object();
_local1.x = _local2.mcHitRight._x + _local2.mcHitRight._width;
_local1.y = 0;
_local2.mcHitRight._parent._parent.localToGlobal(_local1);
return(_local1.x);
}
function getPos() {
return({x:nXPos, y:nYPos});
}
function lock() {
bLocked = true;
}
function Idle() {
}
function Move() {
setMove();
}
function Loop() {
var _local1 = this;
_local1[_local1.sLoopState]();
_local1.setMoveAuto();
_local1.setPos();
_local1.moveToPos();
}
function HurtMissile() {
var _local1 = this;
if (_local1.mcContainer.state._currentframe >= _local1.nFrTotalAnim) {
_local1.setState("Idle");
}
}
function HurtMine() {
var _local1 = this;
if (_local1.mcContainer.state._currentframe >= _local1.nFrTotalAnim) {
_local1.setState("Idle");
}
}
function HurtBall() {
var _local1 = this;
if (_local1.mcContainer.state._currentframe >= _local1.nFrTotalAnim) {
_local1.setState("Idle");
}
}
function Die() {
var _local1 = this;
if (_local1.mcContainer.state._currentframe >= _local1.nFrTotalAnim) {
_global.C.fighterDeath(_local1);
_local1.setState("Idle");
}
}
function HurtBounce() {
var _local1 = this;
_local1.setSpeedBounce();
_local1.setMoveAuto();
_local1.setPos();
_local1.moveToPos();
}
function Distort() {
var _local1 = this;
if (_local1.mcContainer.state._currentframe >= _local1.nFrTotalAnim) {
_local1.modifyParts(ship.ShipCodec.getRandomCode());
_local1.oEnergyBar.reInit(_local1.nMaxEnergy);
_local1.setState("Idle");
}
}
function Rebuild() {
var _local1 = this;
if (_local1.mcContainer.state._currentframe >= _local1.nFrTotalAnim) {
_local1.modifyParts(_local1.sShipCode);
_local1.oEnergyBar.reInit(_local1.nMaxEnergy);
_local1.setState("Idle");
}
}
var sName = "";
}
Symbol 1279 MovieClip [__Packages.fighter.Bar] Frame 0
class fighter.Bar
{
var nEnergyFull, nEnergyCurrent;
function Bar () {
}
function init(l_mcContainer, l_nBarValue) {
var _local1 = this;
var _local2 = l_nBarValue;
_local1.mcContainer = l_mcContainer;
if (_local2 == undefined) {
_local2 = 100;
}
_local1.nEnergyFull = _local2;
_local1.mcContainer.initBar._xscale = _local1.nEnergyFull;
_local1.mcContainer.Bar._xscale = _local1.nEnergyFull;
_local1.mcContainer.Bar.gotoAndStop(100);
_local1.nEnergyCurrent = _local1.nEnergyFull;
}
function reInit(l_nBarValue) {
var _local1 = this;
var _local2;
_local2 = Math.round((_local1.nEnergyCurrent / _local1.nEnergyFull) * 100);
_local1.nEnergyFull = l_nBarValue;
_local1.mcContainer.initBar._xscale = _local1.nEnergyFull;
_local1.mcContainer.Bar._xscale = _local1.nEnergyFull;
_local1.nEnergyCurrent = Math.round((l_nBarValue * _local2) / 100);
_local1.mcContainer.Bar.gotoAndStop(_local2);
}
function looseEnergy(l_nAmount) {
var _local1 = this;
var _local2;
_local1.nEnergyCurrent = _local1.nEnergyCurrent - l_nAmount;
_local2 = Math.round((_local1.nEnergyCurrent / _local1.nEnergyFull) * 100);
if (_local1.nEnergyCurrent <= 0) {
trace("nEnergyCurrent: " + _local1.nEnergyCurrent);
_local1.mcContainer.Bar.gotoAndStop(1);
_local1.nEnergyCurrent = 0;
return(true);
}
_local1.mcContainer.Bar.gotoAndStop(_local2);
return(false);
}
function addEnergy(l_nAmount) {
var _local1 = this;
var _local2;
_local1.nEnergyCurrent = _local1.nEnergyCurrent + l_nAmount;
_local2 = Math.round((_local1.nEnergyCurrent / _local1.nEnergyFull) * 100);
if (_local2 >= 100) {
_local1.mcContainer.Bar.gotoAndStop(100);
_local1.nEnergyCurrent = _local1.nEnergyFull;
} else {
_local1.mcContainer.Bar.gotoAndStop(_local2);
}
}
function getEnergy() {
var _local1 = Math.round((nEnergyCurrent / nEnergyFull) * 100);
return(_local1);
}
}
Symbol 1280 MovieClip [__Packages.weapons.Projectile] Frame 0
class weapons.Projectile extends utils.Stater
{
var oColorSetter, nXBGSpeed, nYBGSpeed, oTarget, oLauncher, sProjectileType, nYPos, nXPos, mcContainer;
function Projectile () {
super();
mx.events.EventDispatcher.initialize(this);
oColorSetter = new utils.ColorSetter();
}
function setCurrentBGSpeed(l_nXSpeed, l_nYSpeed) {
nXBGSpeed = -1 * (l_nXSpeed / 2);
nYBGSpeed = -1 * (l_nYSpeed / 2);
}
function setTarget(l_oTarget) {
oTarget = l_oTarget;
}
function setLauncher(l_oLauncher) {
oLauncher = l_oLauncher;
}
function setSpeed() {
}
function setMove() {
var _local1 = this;
_local1.nXPos = _local1.nXPos + (_local1.nXBGSpeed + _local1.nXSpeed);
_local1.nYPos = _local1.nYPos + 0;
}
function setPos() {
var _local1 = this;
_local1.mcContainer._x = Math.round(_local1.nXPos);
_local1.mcContainer._y = Math.round(_local1.nYPos);
_local1.detectCollides();
}
function setID(l_nProjectileID) {
var _local1 = this;
_local1.nProjectileID = l_nProjectileID;
_local1.setData();
_local1.render();
}
function setData() {
}
function setProjectileType(l_sProjectileType) {
sProjectileType = l_sProjectileType;
}
function getType() {
return(sProjectileType);
}
function getPos() {
return({x:nXPos, y:nYPos});
}
function render() {
var _local1 = this;
_local1.mcContainer.state.container.attachMovie(("parts_" + _local1.sProjectileType) + "s", _local1.sProjectileType, 1);
_local1.mcContainer.state.container[_local1.sProjectileType].gotoAndStop(_local1.nProjectileID + 1);
_local1.colorPart(_local1.mcContainer.state.container[_local1.sProjectileType], false);
}
function detectCollides() {
var _local1 = this;
var _local3 = _global;
var _local2 = _local1.oTarget.getBoundingBox();
if (((_local1.oTarget.getState() != "Loop") && (_local1.oTarget.getState() != "Die")) && (_local1.oTarget.getState() != "Distort")) {
for (var i in _local2) {
if (_local1.mcContainer.hitTest(_local2[i])) {
_local1.oTarget.setState("Hurt" + _local1.sProjectileType);
_local3.C.oSoundCTRL.playSound("hit" + _local1.sProjectileType, 75, 0);
trace("sProjectileType: " + _local1.sProjectileType);
_local1.oTarget.looseEnergy(_local1.nDamage * 2);
_local1.oLauncher.hitTarget();
_local1.setState("Explodes");
break;
}
}
}
}
function Explodes() {
var _local1 = this;
if (_local1.mcContainer.state._currentframe >= _local1.nFrTotalAnim) {
_local1.setState("DELETE");
}
}
function DELETE() {
mcContainer.removeMovieClip();
}
function colorPart(mcPart) {
oColorSetter.colorPart(mcPart, false);
}
function setColorPalette(l_oColor1, l_oColor2, l_oColor3) {
oColorSetter.setColorPalette(l_oColor1, l_oColor2, l_oColor3);
}
function getColorPalette() {
return(oColorSetter.getColorPalette());
}
var SCREEN_TOP = Controller.SCREEN_TOP;
var SCREEN_BOTTOM = Controller.SCREEN_BOTTOM;
var SCREEN_LEFT = Controller.SCREEN_LEFT;
var SCREEN_RIGHT = Controller.SCREEN_RIGHT;
static var nProjectileDepth = 0;
}
Symbol 1281 MovieClip [__Packages.weapons.Missile] Frame 0
class weapons.Missile extends weapons.Projectile
{
var mcContainer;
function Missile (l_mcContainer, l_oPos, l_nCurrentSpeed) {
var _local1 = this;
super();
weapons.Projectile.nProjectileDepth++;
_local1.mcContainer = l_mcContainer.attachMovie("missile_states", "missile" + weapons.Projectile.nProjectileDepth, weapons.Projectile.nProjectileDepth);
_local1.nXPos = l_oPos.x;
_local1.nYPos = l_oPos.y;
_local1.nXSpeed = l_nCurrentSpeed / 2;
_local1.setPos();
_local1.setState("Launch");
_local1.frTotalAnim = _local1.mcContainer.state._totalframes;
_local1.setProjectileType("Missile");
}
function checkScene() {
var _local1 = this;
if (_local1.nXPos > (_local1.SCREEN_RIGHT + 20)) {
_local1.setState("DELETE");
}
}
function render() {
super.render();
}
function pause() {
super.pause();
mcContainer.state.fire.stop();
}
function setSpeed() {
var _local1 = this;
_local1.nXSpeed = _local1.nXSpeed * _local1.nSpeedFactor;
_local1.nYSpeed = 0;
}
function setData() {
var _local1 = this;
_local1.nSpeedFactor = ship.ShipDatas.aWingWeapon[_local1.nProjectileID].speed;
_local1.nSpeedFactor = 1 + (_local1.nSpeedFactor / 50);
_local1.nDamage = ship.ShipDatas.aWingWeapon[_local1.nProjectileID].damage;
}
function actions() {
super.actions();
}
function Launch() {
var _local1 = this;
_local1.render();
_local1.nYPos = _local1.nYPos - _local1.nYBGSpeed;
if (_local1.mcContainer.state._currentframe >= _local1.frTotalAnim) {
_local1.nXPos = _local1.nXPos + XSTARTMOVE;
_local1.nYPos = _local1.nYPos + YSTARTMOVE;
_local1.setState("Idle");
}
_local1.setPos();
}
function Idle() {
var _local1 = this;
_local1.setSpeed();
_local1.setMove();
_local1.checkScene();
_local1.setPos();
}
function DELETE() {
mcContainer.removeMovieClip();
}
static var XSTARTMOVE = -20;
static var YSTARTMOVE = 40;
}
Symbol 1282 MovieClip [__Packages.weapons.Mine] Frame 0
class weapons.Mine extends weapons.Projectile
{
var nXSpeed, nDamage, nProjectileID, mcContainer;
function Mine (l_mcContainer, l_oPos) {
var _local1 = this;
super();
weapons.Projectile.nProjectileDepth++;
_local1.mcContainer = l_mcContainer.attachMovie("mine_states", "mine" + weapons.Projectile.nProjectileDepth, weapons.Projectile.nProjectileDepth);
_local1.nXPos = l_oPos.x;
_local1.nYPos = l_oPos.y;
_local1.setPos();
_local1.setState("Launch");
_local1.frTotalAnim = _local1.mcContainer.state._totalframes;
_local1.setProjectileType("Mine");
}
function checkScene() {
var _local1 = this;
if (_local1.nXPos < (_local1.SCREEN_LEFT - 20)) {
_local1.setState("DELETE");
}
}
function render() {
super.render();
}
function setSpeed() {
nXSpeed = 10;
}
function setData() {
nDamage = ship.ShipDatas.aTailWeapon[nProjectileID].damage;
}
function actions() {
super.actions();
}
function Idle() {
var _local1 = this;
_local1.setSpeed();
_local1.setMove();
_local1.checkScene();
_local1.render();
_local1.setPos();
}
function Launch() {
var _local1 = this;
_local1.render();
if (_local1.mcContainer.state._currentframe >= _local1.frTotalAnim) {
_local1.nXPos = _local1.nXPos - 60;
_local1.setState("Idle");
}
_local1.setPos();
}
function DELETE() {
mcContainer.removeMovieClip();
}
}
Symbol 1283 MovieClip [__Packages.weapons.Ball] Frame 0
class weapons.Ball extends weapons.Projectile
{
var nDamage, nProjectileID, mcContainer;
function Ball (l_mcContainer, l_oPos, l_nCurrentSpeed) {
var _local1 = this;
super();
weapons.Projectile.nProjectileDepth++;
_local1.mcContainer = l_mcContainer.attachMovie("ball_states", "ball" + weapons.Projectile.nProjectileDepth, weapons.Projectile.nProjectileDepth);
_local1.nXPos = l_oPos.x;
_local1.nYPos = l_oPos.y;
_local1.setPos();
_local1.setState("Idle");
_local1.setProjectileType("Ball");
}
function checkScene() {
var _local1 = this;
if (_local1.nXPos > (_local1.SCREEN_RIGHT + 20)) {
_local1.setState("DELETE");
}
}
function render() {
super.render();
}
function setSpeed() {
var _local1 = this;
_local1.nXSpeed = -1 * (_local1.nXBGSpeed * 1.5);
_local1.nYSpeed = 0;
}
function setData() {
nDamage = ship.ShipDatas.aNoseWeapon[nProjectileID].damage / 4;
}
function actions() {
super.actions();
}
function Idle() {
var _local1 = this;
_local1.setSpeed();
_local1.setMove();
_local1.checkScene();
_local1.setPos();
}
function DELETE() {
mcContainer.removeMovieClip();
}
}
Symbol 1284 MovieClip [__Packages.fighter.Player] Frame 0
class fighter.Player extends fighter.Fighter
{
var nTotalPoints, oOpponent, oNitroBar, nYSpeed, nXSpeed, sShipCode, oKey;
function Player () {
var _local1 = this;
super();
_local1.frRushLoopStart = 15;
_local1.frRushLoopCount = 0;
_local1.frMissileDelay = 60;
_local1.nTotalPoints = 0;
mx.events.EventDispatcher.initialize(_local1);
}
function addPoints(l_nPoints) {
nTotalPoints = nTotalPoints + l_nPoints;
_global.C.updatePoints();
}
function getPoints() {
return(nTotalPoints);
}
function init(l_mcContainer, l_sShipCode, l_mcEnergyBar, l_mcNitroBar) {
var _local1 = this;
super.init(l_mcContainer, l_sShipCode, l_mcEnergyBar);
_local1.oKeyListener = new Object();
_local1.oKey = new Object();
_local1.oKey.Up = false;
_local1.oKey.Down = false;
_local1.oKey.Right = false;
_local1.oKey.Left = false;
_local1.oKey.Boost = false;
_local1.oKey.Mine = false;
_local1.oKey.Missile = false;
_local1.oKey.Cannon = false;
_local1.oKey.EasterEgg = false;
_local1.initNitroBar(l_mcNitroBar);
}
function lock() {
var _local1 = this;
Key.removeListener();
for (var _local2 in _local1.oKey) {
_local1.oKey[_local2] = false;
}
}
function setOpponent(l_oOpponent) {
oOpponent = l_oOpponent;
}
function initNitroBar(l_mcNitroBar) {
oNitroBar = new fighter.Bar();
oNitroBar.init(l_mcNitroBar, 100);
}
function checkBoost() {
var _local1 = this;
if (_local1.oKey.Boost) {
if (_local1.frRushLoopCount >= _local1.frRushLoopStart) {
if (_local1.oNitroBar.getEnergy() > 5) {
_local1.setState("Boost");
_global.C.oSoundCTRL.playSound("boost", 60, 0);
}
} else {
if (_local1.frRushLoopCount >= (_local1.frRushLoopStart / 2)) {
if (_local1.oNitroBar.getEnergy() > 5) {
_local1.setState("Boost");
_global.C.oSoundCTRL.playSound("boost", 60, 0);
}
}
_local1.frRushLoopCount++;
}
} else if (_local1.frRushLoopCount > 0) {
_local1.frRushLoopCount--;
} else {
_local1.oKey.BoostHit = 0;
}
}
function checkLoop() {
var _local1 = this;
if (_local1.oKey.BoostHit == 2) {
if (_local1.oNitroBar.getEnergy() > 85) {
_local1.initLoop();
}
}
}
function checkBoostRelease() {
var _local1 = this;
if (!_local1.oKey.Boost) {
if (_local1.oKey.Left) {
_local1.setState("Move");
} else {
_local1.setState("Idle");
}
_local1.frRushLoopCount = 0;
}
}
function setKey() {
var _local1 = this;
if (Key.isDown(_local1.nUpKey)) {
_local1.oKey.Up = true;
} else {
_local1.oKey.Up = false;
}
if (Key.isDown(_local1.nDownKey)) {
_local1.oKey.Down = true;
} else {
_local1.oKey.Down = false;
}
if (Key.isDown(_local1.nRightKey)) {
_local1.oKey.Right = true;
} else {
_local1.oKey.Right = false;
}
if (Key.isDown(_local1.nLeftKey)) {
_local1.oKey.Left = true;
} else {
_local1.oKey.Left = false;
}
if (Key.isDown(_local1.nBoostKey)) {
if (!_local1.oKey.Boost) {
_local1.oKey.BoostHit++;
}
_local1.oKey.Boost = true;
} else {
_local1.oKey.Boost = false;
}
if (Key.isDown(_local1.nMineKey)) {
_local1.oKey.Mine = true;
} else {
_local1.oKey.Mine = false;
}
if (Key.isDown(_local1.nMissileKey)) {
_local1.oKey.Missile = true;
} else {
_local1.oKey.Missile = false;
}
if (Key.isDown(_local1.nCannonKey)) {
_local1.oKey.Cannon = true;
} else {
_local1.oKey.Cannon = false;
}
if (Key.isDown(_local1.nEasterEggKey)) {
_local1.oKey.EasterEgg = true;
} else {
_local1.oKey.EasterEgg = false;
}
}
function setKeyDown(keyCode) {
var _local1 = this;
var _local2 = keyCode;
if (_local2 == _local1.nUpKey) {
_local1.oKey.Up = true;
}
if (_local2 == _local1.nDownKey) {
_local1.oKey.Down = true;
}
if (_local2 == _local1.nRightKey) {
_local1.oKey.Right = true;
}
if (_local2 == _local1.nLeftKey) {
_local1.oKey.Left = true;
}
if (_local2 == _local1.nBoostKey) {
if (!_local1.oKey.Boost) {
_local1.oKey.BoostHit++;
}
_local1.oKey.Boost = true;
}
if (_local2 == _local1.nMineKey) {
_local1.oKey.Mine = true;
}
if (_local2 == _local1.nMissileKey) {
_local1.oKey.Missile = true;
}
if (_local2 == _local1.nCannonKey) {
_local1.oKey.Cannon = true;
}
if (_local2 == _local1.nEasterEggKey) {
_local1.oKey.EasterEgg = true;
}
}
function setKeyUp(keyCode) {
var _local1 = this;
var _local2 = keyCode;
if (_local2 == _local1.nUpKey) {
_local1.oKey.Up = false;
}
if (_local2 == _local1.nDownKey) {
_local1.oKey.Down = false;
}
if (_local2 == _local1.nRightKey) {
_local1.oKey.Right = false;
}
if (_local2 == _local1.nLeftKey) {
_local1.oKey.Left = false;
}
if (_local2 == _local1.nBoostKey) {
if (!_local1.oKey.Boost) {
_local1.oKey.BoostHit++;
}
_local1.oKey.Boost = false;
}
if (_local2 == _local1.nMineKey) {
_local1.oKey.Mine = false;
}
if (_local2 == _local1.nMissileKey) {
_local1.oKey.Missile = false;
}
if (_local2 == _local1.nCannonKey) {
_local1.oKey.Cannon = false;
}
if (_local2 == _local1.nEasterEggKey) {
_local1.oKey.EasterEgg = false;
}
}
function checkMove() {
var _local1 = this;
if (((_local1.oKey.Up || (_local1.oKey.Down)) || (_local1.oKey.Right)) || (_local1.oKey.Left)) {
_local1.setState("Move");
}
}
function checkIdle() {
var _local1 = this;
if ((((!_local1.oKey.Up) && (!_local1.oKey.Down)) && (!_local1.oKey.Right)) && (!_local1.oKey.Left)) {
_local1.setState("Idle");
}
}
function checkMissileLaunched() {
var _local1 = this;
if (_local1.oKey.Missile) {
if (_local1.frMissileDelayCount <= 0) {
_local1.createProjectile("Missile");
}
}
}
function checkMineDropped() {
var _local1 = this;
if (_local1.oKey.Mine) {
if (_local1.frMineDelayCount <= 0) {
_local1.createProjectile("Mine");
}
}
}
function checkCannonFire() {
var _local1 = this;
if (_local1.oKey.Cannon) {
if (_local1.frCannonDelayCount <= 0) {
_local1.createProjectile("Ball");
}
}
}
function createProjectile(sProjectileType) {
var _local1 = this;
var _local2 = super.createProjectile(sProjectileType);
_local1.dispatchEvent({target:_local1, type:"addProjectile", projectile:_local2, targetFighter:_local1.oOpponent});
}
function checkScene() {
var _local1 = this;
var _local2;
if (_local1.oKey.Up || (_local1.sCurrentState == "HurtBounce")) {
_local2 = _local1.getMaxTop();
if ((_local2 + _local1.nYMove) <= _local1.SCREEN_TOP) {
_local1.nYMove = _local1.SCREEN_TOP - _local2;
}
}
if (_local1.oKey.Down || (_local1.sCurrentState == "HurtBounce")) {
_local2 = _local1.getMaxBottom();
if ((_local2 + _local1.nYMove) >= _local1.SCREEN_BOTTOM) {
_local1.nYMove = _local1.SCREEN_BOTTOM - _local2;
}
}
if ((_local1.oKey.Right || (_local1.oKey.Boost)) || (_local1.sCurrentState == "HurtBounce")) {
_local2 = _local1.getMaxRight();
if ((_local2 + _local1.nXMove) >= _local1.SCREEN_RIGHT) {
_local1.nXMove = _local1.SCREEN_RIGHT - _local2;
}
}
if (_local1.oKey.Left || (_local1.sCurrentState == "HurtBounce")) {
_local2 = _local1.getMaxLeft();
if ((_local2 + _local1.nXMove) <= _local1.SCREEN_LEFT) {
_local1.nXMove = _local1.SCREEN_LEFT - _local2;
}
}
}
function checkHitOpponent() {
var _local1 = this;
var l_nMaxTop;
var l_nMaxTopOpponent;
var l_nMaxBottom;
var l_nMaxBottomOpponent;
var l_nMaxLeft;
var l_nMaxLeftOpponent;
var l_nMaxRight;
var l_nMaxRightOpponent;
var _local2 = _local1.oOpponent.getBoundingBox();
var _local3 = _local1.oOpponent.getPos().x;
if (((_local1.oOpponent.getState() != "Die") && (_local1.getState() != "Die")) && (_local1.oOpponent.getState() != "Loop")) {
l_nMaxTop = _local1.getMaxTop();
l_nMaxTopOpponent = _local1.oOpponent.getMaxTop();
l_nMaxBottom = _local1.getMaxBottom();
l_nMaxBottomOpponent = _local1.oOpponent.getMaxBottom();
l_nMaxLeft = _local1.getMaxLeft();
l_nMaxLeftOpponent = _local1.oOpponent.getMaxLeft();
l_nMaxRight = _local1.getMaxRight();
l_nMaxRightOpponent = _local1.oOpponent.getMaxRight();
if ((l_nMaxTop < l_nMaxBottomOpponent) && (l_nMaxBottom > l_nMaxTopOpponent)) {
if ((l_nMaxLeft < l_nMaxRightOpponent) && (l_nMaxRight > l_nMaxLeftOpponent)) {
for (var i in _local1.aBoundingBoxList) {
for (var j in _local2) {
if (_local1.aBoundingBoxList[i].hitTest(_local2[j])) {
_global.C.oSoundCTRL.playSound("shipImpact", 60, 0);
if (_local3 > _local1.nXPos) {
_local1.oOpponent.setBounceForward(ship.ShipDatas.aHull[_local1.oShip.getHull()].damage * 1);
_local1.setBounceBack(ship.ShipDatas.aHull[_local1.oOpponent.oShip.getHull()].damage * 1);
} else {
_local1.setBounceForward(ship.ShipDatas.aHull[_local1.oOpponent.oShip.getHull()].damage * 1);
_local1.oOpponent.setBounceBack(ship.ShipDatas.aHull[_local1.oShip.getHull()].damage * 1);
}
}
}
}
}
}
}
}
function getSpeed() {
return({x:nXSpeed, y:nYSpeed});
}
function getShipCode() {
return(sShipCode);
}
function addNitro(l_nNitroPoints) {
oNitroBar.addEnergy(l_nNitroPoints);
}
function setMove() {
var _local1 = this;
if (_local1.oKey.Up) {
_local1.nVerticalDir = -1;
_local1.nYMove = _local1.nYSpeed;
} else if (_local1.oKey.Down) {
_local1.nVerticalDir = 1;
_local1.nYMove = _local1.nYSpeed;
} else {
_local1.nVerticalDir = 0;
_local1.nYMove = 0;
}
if (_local1.oKey.Right || (_local1.oKey.Boost)) {
_local1.nHorizontalDir = 1;
_local1.nXMove = _local1.nXSpeed;
} else if (_local1.oKey.Left) {
_local1.nHorizontalDir = -1;
_local1.nXMove = _local1.nXSpeed;
} else {
_local1.nHorizontalDir = 0;
_local1.nXMove = 0;
}
}
function setSpeedIdle() {
nXSpeed = 0;
nYSpeed = 0;
}
function setSpeedMove() {
var _local1 = this;
_local1.nXSpeed = _local1.nHorizontalDir * _local1.nMaxSpeed;
_local1.nYSpeed = _local1.nVerticalDir * _local1.nMaxSpeed;
}
function setSpeedBoost() {
var _local1 = this;
_local1.nXSpeed = _local1.nMaxSpeed + _local1.BOOST_SPEED;
_local1.nYSpeed = _local1.nVerticalDir * _local1.nMaxSpeed;
}
function setSpeedBoostRelease() {
var _local1 = this;
_local1.nXSpeed = _local1.nMaxSpeed + _local1.BOOST_SPEED;
_local1.nYSpeed = _local1.nVerticalDir * _local1.nMaxSpeed;
}
function initLoop() {
var _local1 = this;
super.initLoop();
_local1.dispatchEvent({target:_local1, type:"Loop"});
_local1.oKey.BoostHit = 0;
}
function moveToPos() {
super.moveToPos();
}
function checkEasterEgg() {
var _local1;
if (oKey.EasterEgg) {
_local1 = ship.ShipDatas.aVoices[_global.C.oBuilder.getPilot() - 1];
_global.C.oSoundCTRL.playSound(_local1, 100, 0, true);
oKey.EasterEgg = false;
}
}
function actions() {
var _local1 = this;
super.actions();
_local1.addNitro(0.075);
_local1.setKey();
_local1.checkEasterEgg();
}
function Idle() {
var _local1 = this;
_local1.setSpeedIdle();
_local1.setMove();
_local1.checkMissileLaunched();
_local1.checkMineDropped();
_local1.checkCannonFire();
_local1.checkBoost();
_local1.checkLoop();
_local1.checkHitOpponent();
_local1.checkMove();
}
function Move() {
var _local1 = this;
_local1.setSpeedMove();
super.Move();
_local1.checkIdle();
_local1.checkLoop();
_local1.checkMissileLaunched();
_local1.checkMineDropped();
_local1.checkCannonFire();
_local1.checkBoost();
_local1.checkScene();
_local1.setPos();
_local1.moveToPos();
_local1.checkHitOpponent();
}
function HurtBounce() {
var _local1 = this;
_local1.setSpeedBounce();
_local1.setMoveAuto();
_local1.checkScene();
_local1.setPos();
_local1.moveToPos();
}
function Boost() {
var _local1 = this;
_local1.setSpeedBoost();
_local1.setMove();
_local1.checkScene();
_local1.setPos();
_local1.moveToPos();
_local1.checkBoostRelease();
_local1.checkHitOpponent();
if (_local1.oNitroBar.looseEnergy(1)) {
_local1.setState("Idle");
}
}
function loopPhase2() {
var _local1 = this;
_local1.nXSpeed = -15;
_local1.nYSpeed = 0;
if (_local1.nXPos <= _local1.LOOP_TARGET.x) {
_local1.sLoopState = "loopPhase2Pause";
}
}
function loopPhase2Pause() {
var _local1 = this;
var _local2 = _local1.oOpponent.getPos();
_local1.nXSpeed = -50;
_local1.nYSpeed = 0;
if (_local1.nXPos <= (_local2.x - Controller.SCREEN_RIGHT)) {
_local1.nXRadiusLoop = 200;
_local1.nYRadiusLoop = (_local1.LOOP_TARGET.y - _local1.nYPos) / 2;
_local1.nXCenterLoop = _local1.LOOP_TARGET.x;
_local1.nYCenterLoop = _local1.nYPos + _local1.nYRadiusLoop;
_local1.sLoopState = "loopPhase3";
}
}
function Loop() {
super.Loop();
oNitroBar.looseEnergy(2);
}
var nUpKey = 38;
var nDownKey = 40;
var nRightKey = 39;
var nLeftKey = 37;
var nBoostKey = 32;
var nMineKey = 90;
var nMissileKey = 88;
var nCannonKey = 67;
var nEasterEggKey = 84;
var SCREEN_TOP = Controller.SCREEN_TOP + 50;
var SCREEN_BOTTOM = Controller.SCREEN_BOTTOM - 25;
var SCREEN_LEFT = Controller.SCREEN_LEFT + 40;
var SCREEN_RIGHT = Controller.SCREEN_RIGHT - 25;
var LOOP_TARGET = {x:150, y:200};
var sName = "Player";
}
Symbol 1285 MovieClip [__Packages.background.BackgroundManager] Frame 0
class background.BackgroundManager
{
var mcContainer, nXMove, nYMove;
function BackgroundManager (l_mcTarget) {
AsBroadcaster.initialize(oBroadcaster);
l_mcTarget.createEmptyMovieClip("mcContainer", 1);
mcContainer = l_mcTarget.mcContainer;
}
function addItem(l_BGItem) {
var _local1 = this;
_local1.oBroadcaster.addListener(l_BGItem);
l_BGItem.addEventListener("removeItem", mx.utils.Delegate.create(_local1, _local1.removeItem));
return(true);
}
function removeItem(l_oEvent) {
var _local1 = l_oEvent.target;
oBroadcaster.removeListener(_local1);
_local1.removeEventListener("removeItem");
}
function update(l_nXSpeed, l_nYSpeed) {
var _local1 = this;
_local1.setMove(l_nXSpeed, l_nYSpeed);
_local1.setPos();
_local1.moveToPos();
_local1.oBroadcaster.broadcastMessage("update");
}
function setMove(l_nXSpeed, l_nYSpeed) {
nXMove = -1 * l_nXSpeed;
nYMove = -1 * l_nYSpeed;
}
function setPos() {
var _local1 = this;
_local1.nXPos = Math.round(_local1.nXPos + _local1.nXMove);
_local1.nYPos = Math.round(_local1.nYPos + _local1.nYMove);
}
function moveToPos() {
var _local1 = this;
_local1.mcContainer._x = _local1.nXPos;
_local1.mcContainer._y = _local1.nYPos;
}
var oBroadcaster = new Object();
var SCREEN_TOP = Controller.SCREEN_TOP;
var SCREEN_BOTTOM = Controller.SCREEN_BOTTOM;
var SCREEN_LEFT = Controller.SCREEN_LEFT;
var SCREEN_RIGHT = Controller.SCREEN_RIGHT;
static var nItemDepth = 0;
}
Symbol 1286 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 = func;
var _local3 = arguments;
var _local1 = function () {
var _local1 = arguments;
var _local2 = _local1.callee.target;
var _local3 = _local1.callee.func;
return(_local3.apply(_local2, _local1));
};
_local1.target = obj;
_local1.func = _local2;
return(_local1);
}
function createDelegate(obj) {
return(create(obj, func));
}
}
Symbol 1287 MovieClip [__Packages.background.BackgroundItem] Frame 0
class background.BackgroundItem
{
var bRemoved, mcContainer;
function BackgroundItem () {
mx.events.EventDispatcher.initialize(this);
bRemoved = false;
}
function update() {
var _local1 = this;
var _local2 = new Object();
_local2.x = _local1.mcContainer._x;
_local2.y = _local1.mcContainer._y;
_local1.mcContainer._parent.localToGlobal(_local2);
if ((_local2.x - _local1.nHalfWidth) > (_local1.SCREEN_RIGHT + 100)) {
_local1.remove();
} else if ((_local2.x + _local1.nHalfWidth) < (_local1.SCREEN_LEFT - 100)) {
_local1.remove();
} else if (_local2.y > (_local1.SCREEN_BOTTOM + 100)) {
_local1.remove();
} else if (_local2.y < (_local1.SCREEN_TOP - 100)) {
_local1.remove();
}
}
function remove() {
var _local1 = this;
if (!_local1.bRemoved) {
_local1.bRemoved = true;
_local1.mcContainer.removeMovieClip();
_local1.dispatchEvent({target:_local1, type:"removeItem"});
}
}
function toString() {
return(mcContainer._name);
}
var SCREEN_TOP = Controller.SCREEN_TOP;
var SCREEN_BOTTOM = Controller.SCREEN_BOTTOM;
var SCREEN_LEFT = Controller.SCREEN_LEFT;
var SCREEN_RIGHT = Controller.SCREEN_RIGHT;
}
Symbol 1288 MovieClip [__Packages.background.BackgroundScroller] Frame 0
class background.BackgroundScroller extends background.BackgroundManager
{
var bLocked, oBottom, bDropped;
function BackgroundScroller (l_mcTarget) {
var _local1 = this;
super();
AsBroadcaster.initialize(_local1.oBroadcaster);
_local1.mcContainer = l_mcTarget;
_local1.oBottom = new background.BottomManager(_local1.mcContainer);
_local1.nXPos = _local1.mcContainer._x;
_local1.nYPos = _local1.mcContainer._y;
_local1.nYMin = -1 * (_local1.mcContainer._height - (_local1.SCREEN_BOTTOM - _local1.SCREEN_TOP));
_local1.nYBottom = -1 * ((_local1.mcContainer._height - (_local1.SCREEN_BOTTOM - _local1.SCREEN_TOP)) - 400);
_local1.nYMax = 0;
_local1.bDropped = false;
_local1.bLocked = false;
}
function update(l_nXSpeed, l_nYSpeed) {
var _local1 = this;
_local1.checkBottom(_local1.bDropped);
_local1.setMove(0, l_nYSpeed);
_local1.oBottom.update(l_nXSpeed, 0);
if (!_local1.bDropped) {
_local1.checkMax();
_local1.setPos();
_local1.moveToPos();
}
}
function lock() {
bLocked = true;
oBottom.lock();
}
function dropQuality() {
bDropped = true;
}
function checkMax() {
var _local1 = this;
if ((_local1.nYPos + _local1.nYMove) < _local1.nYMin) {
_local1.nYMove = _local1.nYMin - _local1.nYPos;
} else if ((_local1.nYPos + _local1.nYMove) > _local1.nYMax) {
_local1.nYMove = _local1.nYMax - _local1.nYPos;
}
}
function checkBottom(l_bDropped) {
var _local1 = this;
if ((_local1.nYPos + _local1.nYMove) < _local1.nYBottom) {
_local1.oBottom.activate(l_bDropped);
} else {
_local1.oBottom.desactivate();
}
}
static var nItemDepth = 0;
}
Symbol 1289 MovieClip [__Packages.background.BottomManager] Frame 0
class background.BottomManager extends background.BackgroundManager
{
var bLocked, bActive, nActiveItem;
function BottomManager (l_mcTarget) {
var _local1 = this;
super(l_mcTarget);
_local1.nActiveItem = 0;
_local1.nYPosBottom = _local1.mcContainer._parent._height;
_local1.aItemType = ["Forest", "Building", "Mountains"];
_local1.nCurrentType = 0;
_local1.nTypeDelay = 200;
_local1.nTypeSwitcher = 0;
_local1.bLocked = false;
}
function update(l_nXSpeed, l_nYSpeed) {
var _local1 = this;
super.update(l_nXSpeed / 1.5, 0);
_local1.nTypeSwitcher++;
if (_local1.nTypeSwitcher >= _local1.nTypeDelay) {
_local1.nCurrentType++;
if (_local1.aItemType[_local1.nCurrentType] == undefined) {
_local1.nCurrentType = 0;
}
_local1.nTypeSwitcher = 0;
}
}
function activate(l_bDropped) {
var _local1 = this;
_local1.bActive = true;
if ((_local1.nActiveItem < 1) && (!l_bDropped)) {
_local1.addItem();
} else if (l_bDropped) {
_local1.bActive = false;
}
}
function lock() {
bLocked = true;
}
function desactivate() {
bActive = false;
}
function addItem() {
var _local1 = this;
var _local2;
if (_local1.bActive && (!_local1.bLocked)) {
background.BackgroundManager.nItemDepth++;
_local1.nActiveItem++;
trace(_local1.mcContainer);
switch (_local1.aItemType[_local1.nCurrentType]) {
case "Forest" :
_local2 = new background.BottomItem(_local1.mcContainer, _local1.SCREEN_RIGHT - _local1.nXPos, _local1.nYPosBottom, background.BackgroundManager.nItemDepth, 1);
break;
case "Building" :
_local2 = new background.BottomItem(_local1.mcContainer, _local1.SCREEN_RIGHT - _local1.nXPos, _local1.nYPosBottom, background.BackgroundManager.nItemDepth, 2);
break;
case "Mountains" :
_local2 = new background.BottomItem(_local1.mcContainer, _local1.SCREEN_RIGHT - _local1.nXPos, _local1.nYPosBottom, background.BackgroundManager.nItemDepth, 3);
}
_local2.addEventListener("addItem", mx.utils.Delegate.create(_local1, _local1.addItem));
super.addItem(_local2);
return(true);
}
return(undefined);
}
function removeItem(l_oEvent) {
super.removeItem(l_oEvent);
nActiveItem--;
}
}
Symbol 1290 MovieClip [__Packages.background.BottomItem] Frame 0
class background.BottomItem extends background.BackgroundItem
{
function BottomItem (l_mcAttachTarget, l_nXPos, l_nYPos, l_nDepth, l_nType) {
var _local1 = this;
var _local2 = l_nDepth;
super();
_local1.GAP_WIDTH = 150;
_local1.GAP_HEIGHT = 20;
l_mcAttachTarget.attachMovie("bottom_parts", "bottom" + _local2, _local2);
_local1.mcContainer = l_mcAttachTarget["bottom" + _local2];
_local1.nHalfWidth = _local1.mcContainer._width / 2;
_local1.nHalfHeight = _local1.mcContainer._height / 2;
_local1.mcContainer._x = l_nXPos + (_local1.nHalfWidth * 3);
_local1.mcContainer._y = (l_nYPos - _local1.nHalfHeight) + _local1.GAP_HEIGHT;
_local1.mcContainer.gotoAndStop(l_nType);
_local1.bNextItem = false;
}
function update() {
var _local1 = this;
var _local2 = new Object();
_local2.x = _local1.mcContainer._x;
_local2.y = _local1.mcContainer._y;
_local1.mcContainer._parent.localToGlobal(_local2);
if ((_local2.x - _local1.nHalfWidth) > (_local1.SCREEN_RIGHT + 100)) {
_local1.remove();
} else if ((_local2.x + _local1.nHalfWidth) < (_local1.SCREEN_LEFT - 100)) {
_local1.remove();
} else if ((((_local2.x + _local1.nHalfWidth) - _local1.GAP_WIDTH) < _local1.SCREEN_RIGHT) && (!_local1.bNextItem)) {
trace(_local2.x);
trace("---");
_local1.dispatchEvent({target:_local1, type:"addItem"});
_local1.bNextItem = true;
}
}
}
Symbol 1291 MovieClip [__Packages.background.CloudManager] Frame 0
class background.CloudManager extends background.BackgroundManager
{
var nActiveCloud;
function CloudManager (l_mcTarget) {
var _local1 = this;
super(l_mcTarget);
_local1.nActiveCloud = 0;
_local1.nFrRespawnCount = 0;
_local1.nFrRespawnMax = 2;
_local1.addItem();
}
function update(l_nXSpeed, l_nYSpeed) {
var _local1 = this;
super.update(l_nXSpeed, l_nYSpeed);
_local1.nFrRespawnCount++;
if (_local1.nActiveCloud < _local1.MAX_ACTIVE_CLOUD) {
if (_local1.nFrRespawnCount >= _local1.nFrRespawnMax) {
_local1.nFrRespawnCount = 0;
if (Math.round(Math.random() * 2) == 1) {
_local1.addItem();
}
}
}
}
function addItem() {
var _local1 = this;
var _local3;
var l_nCloudType = _local1.getRandomCloudType();
var _local2 = _local1.getRandomCloudPos();
background.BackgroundManager.nItemDepth++;
_local1.nActiveCloud++;
_local3 = new background.Cloud(l_nCloudType, _local1.mcContainer, _local2.x - _local1.nXPos, _local2.y - _local1.nYPos, background.BackgroundManager.nItemDepth);
super.addItem(_local3);
return(true);
}
function removeItem(l_oEvent) {
super.removeItem(l_oEvent);
nActiveCloud--;
}
function getRandomCloudType() {
var _local1 = Math.ceil(Math.random() * CLOUD_TYPE_NUMBER);
return(_local1);
}
function getRandomCloudPos() {
var _local2 = this;
var _local1 = new Object();
_local1.x = _local2.SCREEN_RIGHT;
_local1.y = Math.round(Math.random() * (_local2.SCREEN_BOTTOM - _local2.SCREEN_TOP));
return(_local1);
}
var CLOUD_TYPE_NUMBER = 3;
var MAX_ACTIVE_CLOUD = 10;
}
Symbol 1292 MovieClip [__Packages.background.Cloud] Frame 0
class background.Cloud extends background.BackgroundItem
{
function Cloud (l_nType, l_mcAttachTarget, l_nXPos, l_nYPos, l_nDepth) {
var _local1 = this;
var _local3 = l_nDepth;
super();
var _local2 = Math.ceil(Math.random() * 2);
l_mcAttachTarget.attachMovie("cloud_parts", "cloud" + _local3, _local3);
_local1.mcContainer = l_mcAttachTarget["cloud" + _local3];
_local1.nHalfWidth = _local1.mcContainer._width / 2;
_local1.mcContainer._x = l_nXPos + _local1.nHalfWidth;
_local1.mcContainer._y = l_nYPos;
if (_local2 == 1) {
_local1.mcContainer._xscale = _local1.mcContainer._xscale * -1;
}
_local1.mcContainer.gotoAndStop(l_nType);
}
}
Symbol 1293 MovieClip [__Packages.fighter.Opponent] Frame 0
class fighter.Opponent extends fighter.Fighter
{
var nPosInList, oAIManager, setState, sSubState;
function Opponent () {
super();
mx.events.EventDispatcher.initialize(this);
}
function init(l_mcContainer, l_sShipCode, l_mcEnergyBar, l_oArrowIndicator, l_nPosInList) {
var _local1 = this;
super.init(l_mcContainer, String(l_sShipCode), l_mcEnergyBar);
_local1.oArrowIndicator = l_oArrowIndicator;
_local1.nCannonBurstCount = 0;
_local1.nCannonBurstLength = 10 - Math.round(l_nPosInList / 3);
_local1.nLeftLimit = Controller.SCREEN_LEFT - (_local1.nXPos - _local1.getMaxLeft());
_local1.nRightLimit = Controller.SCREEN_RIGHT - (_local1.nXPos - _local1.getMaxRight());
_local1.nBottomLimit = Controller.SCREEN_BOTTOM - (_local1.nYPos - _local1.getMaxBottom());
_local1.nTopLimit = Controller.SCREEN_TOP - (_local1.nYPos - _local1.getMaxTop());
_local1.nPosInList = l_nPosInList;
}
function getPosInList() {
return(nPosInList);
}
function setPlayer(l_oPlayer) {
var _local1 = this;
_local1.oPlayer = l_oPlayer;
_local1.oAIManager = new AIManager();
_local1.oAIManager.init(_local1.oPlayer, _local1, _local1.sShipCode);
}
function lock() {
super.lock();
oAIManager.lock();
}
function checkCannonFire() {
var _local1 = this;
if (_local1.frCannonDelayCount <= 0) {
_local1.createProjectile("Ball");
_local1.nCannonBurstCount++;
}
}
function checkMissileLaunched() {
var _local1 = this;
if (_local1.frMissileDelayCount <= 0) {
_local1.createProjectile("Missile");
_local1.bLockTarget = true;
}
}
function checkMineDropped() {
var _local1 = this;
if (_local1.frMineDelayCount <= 0) {
_local1.createProjectile("Mine");
_local1.bLockTarget = true;
}
}
function createProjectile(sProjectileType) {
var _local1 = this;
var _local2 = super.createProjectile(sProjectileType);
_local1.dispatchEvent({target:_local1, type:"addProjectile", projectile:_local2, targetFighter:_local1.oPlayer});
}
function setSpeedPlayer() {
var _local2 = this;
var _local1 = _local2.oPlayer.getSpeed();
_local2.nXSpeed = (-1 * _local1.x) / 2;
_local2.nYSpeed = (-1 * _local1.y) / 2;
}
function setSpeedIdle() {
setSpeedPlayer();
}
function setSpeedToLaunchPoint(sPointType) {
var _local1 = this;
var l_oPlayerPos = _local1.oPlayer.getPos();
var _local2;
var l_nXDelay = (_local1.getPos().x - _local1["getPos" + sPointType]().x);
var l_oCurrentPoint = _local1["getPos" + sPointType](true);
if ((sPointType == "Missile") || (sPointType == "Ball")) {
_local2 = {x:50 - l_nXDelay, y:l_oPlayerPos.y};
} else {
_local2 = {x:550 - l_nXDelay, y:l_oPlayerPos.y};
}
var l_nDistance = utils.Trig.pointsGetDistance(l_oCurrentPoint, _local2);
var l_nAngleToTarget;
var l_nXTempSpeed = 0;
var _local3 = 0;
var l_bPositionReach = false;
if (l_nDistance > _local1.nMaxSpeed) {
l_nAngleToTarget = utils.Trig.pointsGetRadian(l_oCurrentPoint, _local2);
l_nXTempSpeed = Math.cos(l_nAngleToTarget) * _local1.nMaxSpeed;
_local3 = Math.sin(l_nAngleToTarget) * _local1.nMaxSpeed;
} else {
l_bPositionReach = true;
}
_local1.setSpeedPlayer();
_local1.nXSpeed = _local1.nXSpeed + l_nXTempSpeed;
_local1.nYSpeed = _local1.nYSpeed + _local3;
return(l_bPositionReach);
}
function setSpeedTo(l_nSide) {
var _local1 = this;
var _local2 = _local1.oPlayer.getPos();
_local2.y = _local2.y + (l_nSide * 150);
var l_oCurrentPoint = _local1.getPos();
var l_nDistance = utils.Trig.pointsGetDistance(l_oCurrentPoint, _local2);
var l_nAngleToTarget;
var l_nXTempSpeed = 0;
var _local3 = 0;
var l_bPositionReach = false;
if (l_nDistance > ((Math.random() * 30) - 15)) {
l_nAngleToTarget = utils.Trig.pointsGetRadian(l_oCurrentPoint, _local2);
l_nXTempSpeed = Math.cos(l_nAngleToTarget) * _local1.nMaxSpeed;
_local3 = Math.sin(l_nAngleToTarget) * _local1.nMaxSpeed;
} else {
_local1.oAIManager.nextAction();
}
_local1.setSpeedPlayer();
_local1.nXSpeed = _local1.nXSpeed + l_nXTempSpeed;
_local1.nYSpeed = _local1.nYSpeed + _local3;
return(l_bPositionReach);
}
function setSpeedTo2(l_nSide) {
var _local1 = this;
var _local2 = _local1.oPlayer.getPos();
_local2.x = _local2.x - 200;
_local2.y = _local2.y + (l_nSide * 150);
var l_oCurrentPoint = _local1.getPos();
var l_nDistance = utils.Trig.pointsGetDistance(l_oCurrentPoint, _local2);
var l_nAngleToTarget;
var l_nXTempSpeed = 0;
var _local3 = 0;
var l_bPositionReach = false;
if (l_nDistance > ((Math.random() * 30) - 15)) {
l_nAngleToTarget = utils.Trig.pointsGetRadian(l_oCurrentPoint, _local2);
l_nXTempSpeed = Math.cos(l_nAngleToTarget) * _local1.nMaxSpeed;
_local3 = Math.sin(l_nAngleToTarget) * _local1.nMaxSpeed;
} else {
_local1.oAIManager.nextAction();
}
_local1.setSpeedPlayer();
_local1.nXSpeed = _local1.nXSpeed + l_nXTempSpeed;
_local1.nYSpeed = _local1.nYSpeed + _local3;
return(l_bPositionReach);
}
function setSpeedDodge(l_nSide) {
var _local1 = this;
var _local2 = _local1.oPlayer.getPos();
_local1.setSpeedPlayer();
_local1.nYSpeed = _local1.nYSpeed + (_local1.nMaxSpeed * l_nSide);
if (Math.abs(_local2.y - _local1.nYPos) > 100) {
_local1.oAIManager.nextAction();
}
}
function setSpeedBoost() {
var _local1 = this;
_local1.setSpeedPlayer();
_local1.nXSpeed = _local1.nXSpeed + _local1.BOOST_SPEED;
}
function setSpeedBoostToHit() {
var _local1 = this;
_local1.setSpeedPlayer();
_local1.nXSpeed = _local1.nXSpeed + _local1.BOOST_SPEED;
var _local2 = _local1.oPlayer.getPos();
if (_local2.y > (_local1.nYPos - _local1.nMaxSpeed)) {
_local1.nYSpeed = _local1.nYSpeed + _local1.nMaxSpeed;
} else if (_local2.y > (_local1.nYPos + _local1.nMaxSpeed)) {
_local1.nYSpeed = _local1.nYSpeed - _local1.nMaxSpeed;
}
}
function isOnScreen() {
var _local1 = this;
if (_local1.nXPos < _local1.nLeftLimit) {
return(true);
}
if (_local1.nXPos > _local1.nRightLimit) {
return(true);
}
if (_local1.nYPos < _local1.nTopLimit) {
return(true);
}
if (_local1.nYPos > _local1.nBottomLimit) {
return(true);
}
return(false);
}
function Idle() {
var _local1 = this;
_local1.setSpeedIdle();
_local1.setMoveAuto();
_local1.setPos();
_local1.moveToPos();
}
function CannonTarget() {
var _local1 = this;
_local1.checkCannonFire();
_local1.setSpeedToLaunchPoint("Ball");
if (_local1.nCannonBurstCount >= _local1.nCannonBurstLength) {
_local1.nCannonBurstCount = 0;
_local1.bLockTarget = false;
_local1.oAIManager.nextAction();
}
_local1.setMoveAuto();
_local1.setPos();
_local1.moveToPos();
}
function MissileTarget() {
var _local1 = this;
if (_local1.setSpeedToLaunchPoint("Missile")) {
_local1.checkMissileLaunched();
_local1.bLockTarget = false;
_local1.oAIManager.nextAction();
}
_local1.setMoveAuto();
_local1.setPos();
_local1.moveToPos();
}
function MineTarget() {
var _local1 = this;
if (_local1.setSpeedToLaunchPoint("Mine")) {
_local1.checkMineDropped();
_local1.bLockTarget = false;
_local1.oAIManager.nextAction();
}
_local1.setMoveAuto();
_local1.setPos();
_local1.moveToPos();
}
function initDodge(l_sDodgeDir, l_oProjectile) {
setState("Dodge" + l_sDodgeDir);
}
function DodgeDown() {
var _local1 = this;
_local1.setSpeedDodge(1);
_local1.setMoveAuto();
_local1.setPos();
_local1.moveToPos();
}
function DodgeUp() {
var _local1 = this;
_local1.setSpeedDodge(-1);
_local1.setMoveAuto();
_local1.setPos();
_local1.moveToPos();
}
function initBoostAway() {
setState("Boost");
_global.C.oSoundCTRL.playSound("boost", 60, 0);
}
function initBoostToHit() {
setState("Boost");
_global.C.oSoundCTRL.playSound("boost", 60, 0);
sSubState = "ToHit";
}
function endLoop() {
trace("endLoop: ");
oAIManager.nextAction();
}
function endBounce() {
oAIManager.resume();
}
function checkBoostToHitEnd() {
var _local1 = this;
var _local2 = _local1.oPlayer.getPos();
if (_local2.x < _local1.nXPos) {
_local1.oAIManager.nextAction();
_local1.sSubState = "";
}
}
function Boost() {
var _local1 = this;
if (_local1.sSubState == "") {
_local1.setSpeedBoost();
} else {
_local1["setSpeedBoost" + _local1.sSubState]();
}
_local1.setMoveAuto();
_local1.setPos();
_local1.moveToPos();
_local1[(("check" + _local1.sCurrentState) + _local1.sSubState) + "End"]();
}
function Loop() {
super.Loop();
}
function MoveToBack() {
var _local1 = this;
_local1.setSpeedTo2(1);
_local1.setMoveAuto();
_local1.setPos();
_local1.moveToPos();
}
function MoveToTop() {
var _local1 = this;
_local1.setSpeedTo(-1);
_local1.setMoveAuto();
_local1.setPos();
_local1.moveToPos();
}
function MoveToBottom() {
var _local1 = this;
_local1.setSpeedTo(1);
_local1.setMoveAuto();
_local1.setPos();
_local1.moveToPos();
}
function HurtMissile() {
var _local1 = this;
if (_local1.mcContainer.state._currentframe >= _local1.nFrTotalAnim) {
_local1.oAIManager.resume();
}
}
function HurtMine() {
var _local1 = this;
if (_local1.mcContainer.state._currentframe >= _local1.nFrTotalAnim) {
_local1.oAIManager.resume();
}
}
function HurtBall() {
var _local1 = this;
if (_local1.mcContainer.state._currentframe >= _local1.nFrTotalAnim) {
_local1.oAIManager.resume();
}
}
function Distort() {
var _local1 = this;
if (_local1.mcContainer.state._currentframe >= _local1.nFrTotalAnim) {
_local1.modifyParts(ship.ShipCodec.getRandomCode());
_local1.setState("Idle");
_local1.oAIManager.nextAction();
}
}
function Rebuild() {
var _local1 = this;
if (_local1.mcContainer.state._currentframe >= _local1.nFrTotalAnim) {
_local1.modifyParts(_local1.sShipCode);
_local1.setState("Idle");
_local1.oAIManager.nextAction();
}
}
function initMoveToBack() {
setState("MoveToBack");
}
function initMoveToTop() {
setState("MoveToTop");
}
function initMoveToBottom() {
setState("MoveToBottom");
}
function actions() {
var _local1 = this;
super.actions();
if (!_local1.bLocked) {
_local1.oArrowIndicator.update();
if (_local1.getState() != "Loop") {
_local1.oAIManager.update();
}
}
}
var LOOP_TARGET = {x:-100, y:200};
var sName = "Opponent";
}
Symbol 1294 MovieClip [__Packages.AIManager] Frame 0
class AIManager
{
var nMaxDecisionCount, sActionToResume, oOpponent, sCurrentDecision;
function AIManager () {
nMaxDecisionCount = 0;
}
function init(l_oPlayer, l_oOpponent, l_sShipCode) {
var _local1 = this;
_local1.oPlayer = l_oPlayer;
_local1.oOpponent = l_oOpponent;
_local1.oPlayer.addEventListener("changeState", mx.utils.Delegate.create(_local1, _local1.reactTo));
_local1.oPlayer.addEventListener("Loop", mx.utils.Delegate.create(_local1, _local1.reactTo));
_local1.oPlayer.addEventListener("addProjectile", mx.utils.Delegate.create(_local1, _local1.reactTo));
_local1.oOpponent.addEventListener("changeState", mx.utils.Delegate.create(_local1, _local1.reactTo));
_local1.oDecisionMaker = new decisions.DecisionMaker(_local1.oOpponent);
_local1.oDecisionMaker.setController(_local1);
}
function lock() {
var _local1 = this;
_local1.oPlayer.removeEventListener("changeState", mx.utils.Delegate.create(_local1, _local1.reactTo));
_local1.oPlayer.removeEventListener("Loop", mx.utils.Delegate.create(_local1, _local1.reactTo));
_local1.oPlayer.removeEventListener("addProjectile", mx.utils.Delegate.create(_local1, _local1.reactTo));
_local1.oOpponent.removeEventListener("changeState", mx.utils.Delegate.create(_local1, _local1.reactTo));
}
function reactTo(l_oArg) {
var _local1 = this;
var _local2 = l_oArg;
var _local3 = _local1.oOpponent.getState();
if (!_local1.oOpponent.bLocked) {
if (((((_local3 != "Loop") && (_local3 != "Die")) && (_local3 != "Death")) && (_local3 != "Rebuild")) && (_local3 != "Distort")) {
switch (_local2.type) {
case "addProjectile" :
switch (_local2.projectile.getType()) {
case "Missile" :
_local1.reactToMissile(_local2.projectile);
break;
case "Mine" :
_local1.reactToMine(_local2.projectile);
break;
case "Ball" :
_local1.reactToBall(_local2.projectile);
}
return;
case "Boost" :
_local1.reactToBoost();
return;
case "Loop" :
_local1.reactToLoop();
return;
case "changeState" :
if (_local2.target == _local1.oOpponent) {
_local1.reactToChangeState(_local2.oldState, _local2.newState);
} else {
_local1.reactToPlayerChangeState(_local2.oldState, _local2.newState);
}
}
}
}
}
function reactToPlayerChangeState(l_sOldState, l_sNewState) {
if (l_sNewState == "Move") {
}
}
function reactToChangeState(l_sOldState, l_sNewState) {
if (l_sNewState.indexOf("Hurt") != -1) {
sActionToResume = l_sOldState;
}
}
function resume() {
var _local1 = this;
if (_local1.sActionToResume.indexOf("Dodge") != -1) {
_local1.oOpponent.setState(_local1.sActionToResume);
} else {
_local1.nextAction();
}
}
function reactToBoost() {
}
function reactToLoop() {
oOpponent.setState("Boost");
setDelay(35);
}
function reactToMissile(l_oProjectile) {
var _local1 = this;
var _local2 = l_oProjectile;
var _local3 = _local1.oOpponent.getState();
if (_local3.indexOf("Dodge") == -1) {
_local1.oDecisionMaker.clearDecisionList();
_local1.oDecisionMaker.addDecision(new decisions.DecisionLoopAway(_local1.oPlayer, _local1.oOpponent, _local2));
_local1.oDecisionMaker.addDecision(new decisions.DecisionBoostAway(_local1.oPlayer, _local1.oOpponent, _local2));
_local1.oDecisionMaker.addDecision(new decisions.DecisionDodgeUp(_local1.oPlayer, _local1.oOpponent, _local2));
_local1.oDecisionMaker.addDecision(new decisions.DecisionDodgeDown(_local1.oPlayer, _local1.oOpponent, _local2));
_local1.oDecisionMaker.addDecision(new decisions.DecisionMissileTarget(_local1.oPlayer, _local1.oOpponent));
_local1.setDecision(_local1.oDecisionMaker.makeDecision());
}
}
function reactToMine(l_oProjectile) {
var _local1 = this;
var _local2 = _local1.oOpponent.getState();
if (_local2.indexOf("Dodge") == -1) {
_local1.oDecisionMaker.clearDecisionList();
_local1.oDecisionMaker.addDecision(new decisions.DecisionDodgeUp(_local1.oPlayer, _local1.oOpponent, l_oProjectile));
_local1.oDecisionMaker.addDecision(new decisions.DecisionDodgeDown(_local1.oPlayer, _local1.oOpponent, l_oProjectile));
_local1.setDecision(_local1.oDecisionMaker.makeDecision());
}
}
function reactToBall(l_oProjectile) {
var _local1 = this;
var _local2 = l_oProjectile;
var _local3 = _local1.oOpponent.getState();
if (_local3.indexOf("Dodge") == -1) {
_local1.oDecisionMaker.clearDecisionList();
_local1.oDecisionMaker.addDecision(new decisions.DecisionBoostAway(_local1.oPlayer, _local1.oOpponent, _local2));
_local1.oDecisionMaker.addDecision(new decisions.DecisionDodgeUp(_local1.oPlayer, _local1.oOpponent, _local2));
_local1.oDecisionMaker.addDecision(new decisions.DecisionDodgeDown(_local1.oPlayer, _local1.oOpponent, _local2));
_local1.oDecisionMaker.addDecision(new decisions.DecisionMineTarget(_local1.oPlayer, _local1.oOpponent));
_local1.setDecision(_local1.oDecisionMaker.makeDecision());
}
}
function setStandardDecisionList() {
var _local1 = this;
var _local2 = _local1.oOpponent.getState();
if ((_local2 != "Rebuild") && (_local2 != "Distort")) {
_local1.oDecisionMaker.clearDecisionList();
_local1.oDecisionMaker.addDecision(new decisions.DecisionGoToTop(_local1.oPlayer, _local1.oOpponent));
_local1.oDecisionMaker.addDecision(new decisions.DecisionGoToBack(_local1.oPlayer, _local1.oOpponent));
_local1.oDecisionMaker.addDecision(new decisions.DecisionGoToBottom(_local1.oPlayer, _local1.oOpponent));
_local1.oDecisionMaker.addDecision(new decisions.DecisionBoostToHit(_local1.oPlayer, _local1.oOpponent));
_local1.oDecisionMaker.addDecision(new decisions.DecisionCannonTarget(_local1.oPlayer, _local1.oOpponent));
_local1.oDecisionMaker.addDecision(new decisions.DecisionMissileTarget(_local1.oPlayer, _local1.oOpponent));
_local1.oDecisionMaker.addDecision(new decisions.DecisionMineTarget(_local1.oPlayer, _local1.oOpponent));
_local1.oDecisionMaker.addDecision(new decisions.DecisionIdle(_local1.oOpponent));
_local1.setDecision(_local1.oDecisionMaker.makeDecision());
} else {
_local1.setDelay(5);
}
}
function setDecision(l_sDecision) {
if (sCurrentDecision != l_sDecision) {
sCurrentDecision = l_sDecision;
return(true);
}
return(false);
}
function setDelay(l_nNewDelay) {
nMaxDecisionCount = l_nNewDelay;
}
function nextAction() {
oOpponent.setState("Idle");
setDelay(15);
}
function getDecision() {
return(sCurrentDecision);
}
function nextDecision() {
setStandardDecisionList();
}
function checkFear() {
var _local1 = this;
var _local2;
var l_oPlayerPos;
var _local3;
if (_local1.oPlayer.getState() == "Move") {
if (_local1.oOpponent.getSize() == "Sma") {
l_oPlayerPos = _local1.oPlayer.getPos();
_local3 = _local1.oOpponent.getPos();
_local2 = utils.Trig.pointsGetDistance(_local3, l_oPlayerPos);
if (_local2 < 300) {
return(true);
}
}
}
return(undefined);
}
function update() {
var _local1 = this;
_local1.checkFear();
if (_local1.nMaxDecisionCount == 0) {
_local1.setStandardDecisionList();
_local1.nMaxDecisionCount--;
} else if (_local1.nMaxDecisionCount > 0) {
_local1.nMaxDecisionCount--;
}
}
}
Symbol 1295 MovieClip [__Packages.decisions.DecisionMaker] Frame 0
class decisions.DecisionMaker
{
var oController, aDecisionList, bDebugMode;
function DecisionMaker (l_oOpponent) {
var _local1 = this;
_local1.oOpponent = l_oOpponent;
_local1.aDecisionList = new Array();
_local1.disableDebug();
}
function setController(l_oDecisionControl) {
oController = l_oDecisionControl;
}
function addDecision(l_oDecision) {
aDecisionList.push(l_oDecision);
}
function addDecisionFirst(l_oDecision) {
aDecisionList.unshift(l_oDecision);
}
function addDecisionList(l_aDecision) {
aDecisionList = aDecisionList.concat(l_aDecision);
}
function clearDecisionList() {
var _local1 = this;
var _local2;
while (_local1.aDecisionList.length > 0) {
_local2 = _local1.aDecisionList[0].getType();
_local1.aDecisionList.splice(0, 1);
_local1.removeDecision(_local2);
}
}
function removeDecision(l_sDecisionType) {
var _local2 = this;
var _local3;
var _local1 = 0;
while (_local1 < _local2.aDecisionList.length) {
if (_local2.aDecisionList[_local1].getType() == l_sDecisionType) {
_local2.aDecisionList.splice(_local1, 1);
_local3 = true;
break;
}
_local1++;
}
if (_local3) {
_local2.removeDecision(l_sDecisionType);
}
}
function makeDecision() {
var _local1 = this;
if (_local1.bDebugMode) {
trace(_local1.oOpponent.getName() + " is making a decision:");
}
var _local3 = false;
var _local2 = 0;
while (_local2 < _local1.aDecisionList.length) {
_local3 = _local1.aDecisionList[_local2].make();
if (_local3) {
_local1.oController.setDelay(_local1.aDecisionList[_local2].getDelay());
_local1.lastDecision = _local1.aDecisionList[_local2];
if (_local1.bDebugMode) {
trace("\t" + _local1.aDecisionList[_local2]);
}
return(_local1.aDecisionList[_local2].toString());
}
_local2++;
}
return(undefined);
}
function resumeDecision() {
var _local2 = this;
if (_local2.bDebugMode) {
trace(_local2.oOpponent.getName() + " is making a decision:");
}
var _local3 = false;
var _local1 = 0;
while (_local1 < _local2.aDecisionList.length) {
_local3 = _local2.aDecisionList[_local1].make();
if (_local3) {
_local2.oController.setDelay(_local2.aDecisionList[_local1].getDelay());
if (_local2.bDebugMode) {
trace("\t" + _local2.aDecisionList[_local1]);
}
return(_local2.aDecisionList[_local1].toString());
}
_local1++;
}
return(undefined);
}
function traceDecisionList() {
var _local2 = this;
trace(("Decision list for " + _local2.oOpponent.getName()) + ":");
var _local1 = 0;
while (_local1 < _local2.aDecisionList.length) {
trace("\t" + _local2.aDecisionList[_local1]);
_local1++;
}
}
function enableDebug() {
bDebugMode = true;
}
function disableDebug() {
bDebugMode = false;
}
}
Symbol 1296 MovieClip [__Packages.decisions.Decision] Frame 0
class decisions.Decision
{
var nDelay;
function Decision () {
}
function Make() {
var _local1;
_local1 = CheckConditions();
return(_local1);
}
function toString() {
return(("[Decision " + getType()) + "]");
}
function getType() {
return(sType);
}
function getDelay() {
return(nDelay);
}
function getRandom(l_nRangeSize, l_nRangePos) {
var _local1 = l_nRangePos;
var _local2 = l_nRangeSize;
if (_local1 == undefined) {
_local1 = 1;
}
if (_local2 == undefined) {
_local2 = 1;
}
if (Math.ceil(Math.random() * _local1) == 1) {
if (Math.ceil(Math.random() * _local2) == 1) {
return(true);
}
return(false);
}
return(false);
}
function CheckConditions() {
return(false);
}
var sType = "Decision";
var aRangePos = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
}
Symbol 1297 MovieClip [__Packages.decisions.DecisionLoopAway] Frame 0
class decisions.DecisionLoopAway extends decisions.Decision
{
function DecisionLoopAway (l_oPlayer, l_oOpponent, l_oProjectile) {
var _local1 = this;
super();
_local1.oOpponent = l_oOpponent;
_local1.oPlayer = l_oPlayer;
_local1.oProjectile = l_oProjectile;
}
function checkConditions() {
var _local1 = this;
var l_sProjectileType = _local1.oProjectile.getType();
var _local3 = false;
var _local2 = _local1.oPlayer["getPos" + l_sProjectileType](true);
var l_nOpponentPosTop = (_local1.oOpponent.getMaxTop() - 10);
var l_nOpponentPosBottom = (_local1.oOpponent.getMaxBottom() + 10);
var l_nOpponentPos = _local1.oOpponent.getPos();
var l_nRandomRange;
var l_nPosInList;
var l_bRandomResult;
if (((_local1.oOpponent.getSize() == "Big") && (_local1.oProjectile.getType() != "Ball")) || (_local1.oOpponent.getSize() != "Big")) {
if ((_local2.y < l_nOpponentPosBottom) && (_local2.y > l_nOpponentPosTop)) {
if (Math.abs(_local2.y - l_nOpponentPosBottom) < Math.abs(_local2.y - l_nOpponentPosTop)) {
if (_local2.x < l_nOpponentPos.x) {
l_nRandomRange = _local1["nRange" + _local1.oOpponent.getSize()];
l_nPosInList = _local1.oOpponent.getPosInList();
l_bRandomResult = _local1.getRandom(1, _local1.aRangePos[l_nPosInList - 1]);
if (l_bRandomResult) {
_local1.oOpponent.initLoop();
_local3 = true;
}
}
}
}
}
return(_local3);
}
var nRangeBig = 3;
var nRangeMed = 5;
var nRangeSma = 10;
var aRangePos = [1, 1, 1, 1, 1, 2, 3, 4, 5, 6, 10, 11, 12, 13, 14, 15, 15, 20, 25, 30];
var sType = "LoopAway";
var nDelay = -1;
}
Symbol 1298 MovieClip [__Packages.decisions.DecisionBoostAway] Frame 0
class decisions.DecisionBoostAway extends decisions.Decision
{
function DecisionBoostAway (l_oPlayer, l_oOpponent, l_oProjectile) {
var _local1 = this;
super();
_local1.oOpponent = l_oOpponent;
_local1.oPlayer = l_oPlayer;
_local1.oProjectile = l_oProjectile;
}
function checkConditions() {
var _local1 = this;
var l_sProjectileType = _local1.oProjectile.getType();
var _local3 = false;
var _local2 = _local1.oPlayer["getPos" + l_sProjectileType](true);
var l_nOpponentPosTop = (_local1.oOpponent.getMaxTop() - 10);
var l_nOpponentPosBottom = (_local1.oOpponent.getMaxBottom() + 10);
var l_nOpponentPos = _local1.oOpponent.getPos();
var l_nRandomRange;
var l_nPosInList;
var l_bRandomResult;
if ((_local2.y < l_nOpponentPosBottom) && (_local2.y > l_nOpponentPosTop)) {
if (Math.abs(_local2.y - l_nOpponentPosBottom) < Math.abs(_local2.y - l_nOpponentPosTop)) {
if (_local2.x < l_nOpponentPos.x) {
l_nRandomRange = _local1["nRange" + _local1.oOpponent.getSize()];
l_nPosInList = _local1.oOpponent.getPosInList();
l_bRandomResult = _local1.getRandom(l_nRandomRange, _local1.aRangePos[l_nPosInList - 1]);
if (l_bRandomResult) {
_local1.oOpponent.initBoostAway();
_local3 = true;
}
}
}
}
return(_local3);
}
var nRangeBig = 10;
var nRangeMed = 10;
var nRangeSma = 5;
var aRangePos = [1, 1, 1, 1, 1, 2, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 10, 10];
var sType = "BoostAway";
var nDelay = 50;
}
Symbol 1299 MovieClip [__Packages.decisions.DecisionDodgeUp] Frame 0
class decisions.DecisionDodgeUp extends decisions.Decision
{
function DecisionDodgeUp (l_oPlayer, l_oOpponent, l_oProjectile) {
var _local1 = this;
super();
_local1.oOpponent = l_oOpponent;
_local1.oPlayer = l_oPlayer;
_local1.oProjectile = l_oProjectile;
}
function checkConditions() {
var _local1 = this;
var _local3 = _local1.oProjectile.getType();
var l_bCondition = false;
var _local2 = _local1.oPlayer["getPos" + _local3](true);
var l_nOpponentPosTop = (_local1.oOpponent.getMaxTop() - 20);
var l_nOpponentPosBottom = (_local1.oOpponent.getMaxBottom() + 20);
var l_nOpponentPos = _local1.oOpponent.getPos();
var l_nRandomRange;
var l_nPosInList;
var l_bRandomResult;
var l_nMinDistToDodge;
if ((_local2.y < l_nOpponentPosBottom) && (_local2.y > l_nOpponentPosTop)) {
if (Math.abs(_local2.y - l_nOpponentPosBottom) < Math.abs(_local2.y - l_nOpponentPosTop)) {
l_nRandomRange = _local1["nRange" + _local1.oOpponent.getSize()];
l_nPosInList = _local1.oOpponent.getPosInList();
l_bRandomResult = _local1.getRandom(l_nRandomRange, _local1.aRangePos[l_nPosInList - 1]);
l_nMinDistToDodge = l_nOpponentPosBottom - _local2.y;
if (l_bRandomResult) {
if (((_local3 == "Missile") || (_local3 == "Ball")) && (_local2.x < l_nOpponentPos.x)) {
if ((_local3 == "Missile") || (((_local3 == "Ball") && (_local1.oOpponent.getSize() != "Big")) || (l_nMinDistToDodge < 10))) {
_local1.oOpponent.initDodge("Up", _local1.oProjectile);
l_bCondition = true;
}
} else if ((_local3 == "Mine") && (_local2.x > l_nOpponentPos.x)) {
_local1.oOpponent.initDodge("Up", _local1.oProjectile);
l_bCondition = true;
}
}
}
}
return(l_bCondition);
}
var sType = "DodgeUp";
var nDelay = -1;
var nRangeBig = 1;
var nRangeMed = 5;
var nRangeSma = 5;
var aRangePos = [1, 1, 1, 1, 1, 2, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 10, 10];
}
Symbol 1300 MovieClip [__Packages.decisions.DecisionDodgeDown] Frame 0
class decisions.DecisionDodgeDown extends decisions.Decision
{
function DecisionDodgeDown (l_oPlayer, l_oOpponent, l_oProjectile) {
var _local1 = this;
super();
_local1.oOpponent = l_oOpponent;
_local1.oPlayer = l_oPlayer;
_local1.oProjectile = l_oProjectile;
}
function checkConditions() {
var _local1 = this;
var _local3 = _local1.oProjectile.getType();
var l_bCondition = false;
var _local2 = _local1.oPlayer["getPos" + _local3](true);
var l_nOpponentPosTop = (_local1.oOpponent.getMaxTop() - 15);
var l_nOpponentPosBottom = (_local1.oOpponent.getMaxBottom() + 15);
var l_nOpponentPos = _local1.oOpponent.getPos();
var l_nRandomRange;
var l_bRandomResult;
var l_nMinDistToDodge;
var l_nPosInList;
var l_bRandomResult;
if ((_local2.y < l_nOpponentPosBottom) && (_local2.y > l_nOpponentPosTop)) {
if (Math.abs(_local2.y - l_nOpponentPosBottom) > Math.abs(_local2.y - l_nOpponentPosTop)) {
l_nRandomRange = _local1["nRange" + _local1.oOpponent.getSize()];
l_nPosInList = _local1.oOpponent.getPosInList();
l_bRandomResult = _local1.getRandom(l_nRandomRange, _local1.aRangePos[l_nPosInList - 1]);
l_nMinDistToDodge = Math.abs(l_nOpponentPosTop - _local2.y);
if (l_bRandomResult) {
if (((_local3 == "Missile") || (_local3 == "Ball")) && (_local2.x < l_nOpponentPos.x)) {
if ((_local3 == "Missile") || (((_local3 == "Ball") && (_local1.oOpponent.getSize() != "Big")) || (l_nMinDistToDodge < 10))) {
_local1.oOpponent.initDodge("Down", _local1.oProjectile);
l_bCondition = true;
}
} else if ((_local3 == "Mine") && (_local2.x > l_nOpponentPos.x)) {
_local1.oOpponent.initDodge("Down", _local1.oProjectile);
l_bCondition = true;
}
}
}
}
return(l_bCondition);
}
var sType = "DodgeDown";
var nDelay = -1;
var nRangeBig = 1;
var nRangeMed = 5;
var nRangeSma = 5;
var aRangePos = [1, 1, 1, 1, 1, 2, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 10, 10];
}
Symbol 1301 MovieClip [__Packages.decisions.DecisionMissileTarget] Frame 0
class decisions.DecisionMissileTarget extends decisions.Decision
{
var oPlayer, oOpponent;
function DecisionMissileTarget (l_oPlayer, l_oOpponent) {
super();
oPlayer = l_oPlayer;
oOpponent = l_oOpponent;
}
function checkConditions() {
var _local1 = this;
var _local2 = false;
var l_nPosInList;
var _local3;
var l_oPlayerPos = _local1.oPlayer.getPos();
var l_oOpponentPos = _local1.oOpponent.getPos();
if (l_oOpponentPos.x < l_oPlayerPos.x) {
l_nPosInList = _local1.oOpponent.getPosInList();
_local3 = _local1.getRandom(1, _local1.aRangePos[l_nPosInList - 1]);
if (_local3) {
_local1.oOpponent.setState("MissileTarget");
_local2 = true;
}
}
return(_local2);
}
var sType = "MissileTarget";
var nDelay = -1;
var aRangePos = [1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4];
}
Symbol 1302 MovieClip [__Packages.decisions.DecisionMineTarget] Frame 0
class decisions.DecisionMineTarget extends decisions.Decision
{
var oPlayer, oOpponent;
function DecisionMineTarget (l_oPlayer, l_oOpponent) {
super();
oPlayer = l_oPlayer;
oOpponent = l_oOpponent;
}
function checkConditions() {
var _local1 = this;
var _local2 = false;
var l_nPosInList;
var _local3;
var l_oPlayerPos = _local1.oPlayer.getPos();
var l_oOpponentPos = _local1.oOpponent.getPos();
if (l_oOpponentPos.x > l_oPlayerPos.x) {
l_nPosInList = _local1.oOpponent.getPosInList();
_local3 = _local1.getRandom(1, _local1.aRangePos[l_nPosInList - 1]);
if (_local3) {
_local1.oOpponent.setState("MineTarget");
_local2 = true;
}
}
return(_local2);
}
var sType = "MineTarget";
var nDelay = -1;
var aRangePos = [1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3];
}
Symbol 1303 MovieClip [__Packages.decisions.DecisionGoToTop] Frame 0
class decisions.DecisionGoToTop extends decisions.Decision
{
var oOpponent, oPlayer;
function DecisionGoToTop (l_oPlayer, l_oOpponent) {
super();
oOpponent = l_oOpponent;
oPlayer = l_oPlayer;
}
function checkConditions() {
var _local2 = this;
var _local1 = false;
var l_nRandomRange;
var _local3;
l_nRandomRange = _local2["nRange" + _local2.oOpponent.getSize()];
_local3 = _local2.getRandom(l_nRandomRange);
if (_local3) {
_local2.oOpponent.initMoveToTop();
_local1 = true;
}
return(_local1);
}
var nRangeBig = 0;
var nRangeMed = 10;
var nRangeSma = 5;
var sType = "GoToTop";
var nDelay = 200;
}
Symbol 1304 MovieClip [__Packages.decisions.DecisionGoToBack] Frame 0
class decisions.DecisionGoToBack extends decisions.Decision
{
var oOpponent, oPlayer;
function DecisionGoToBack (l_oPlayer, l_oOpponent) {
super();
oOpponent = l_oOpponent;
oPlayer = l_oPlayer;
}
function checkConditions() {
var _local1 = this;
var _local2 = false;
var l_nRandomRange;
var l_nPosInList;
var _local3;
var l_oOpponentPos = _local1.oOpponent.getPos();
var l_oPlayerPos = _local1.oPlayer.getPos();
l_nRandomRange = _local1["nRange" + _local1.oOpponent.getSize()];
l_nPosInList = _local1.oOpponent.getPosInList();
_local3 = _local1.getRandom(l_nRandomRange, _local1.aRangePos[l_nPosInList - 1]);
if (l_oOpponentPos.x > l_oPlayerPos.x) {
if (_local3) {
_local1.oOpponent.initMoveToBack();
_local2 = true;
}
}
return(_local2);
}
var nRangeBig = 2;
var nRangeMed = 15;
var nRangeSma = 15;
var sType = "GoToBack";
}
Symbol 1305 MovieClip [__Packages.decisions.DecisionGoToBottom] Frame 0
class decisions.DecisionGoToBottom extends decisions.Decision
{
var oOpponent, oPlayer;
function DecisionGoToBottom (l_oPlayer, l_oOpponent) {
super();
oOpponent = l_oOpponent;
oPlayer = l_oPlayer;
}
function checkConditions() {
var _local2 = this;
var _local1 = false;
var l_nRandomRange;
var _local3;
l_nRandomRange = _local2["nRange" + _local2.oOpponent.getSize()];
_local3 = _local2.getRandom(l_nRandomRange);
if (_local3) {
_local2.oOpponent.initMoveToBottom();
_local1 = true;
}
return(_local1);
}
var nRangeBig = 0;
var nRangeMed = 10;
var nRangeSma = 4;
var sType = "GoToBottom";
var nDelay = 200;
}
Symbol 1306 MovieClip [__Packages.decisions.DecisionBoostToHit] Frame 0
class decisions.DecisionBoostToHit extends decisions.Decision
{
var oOpponent, oPlayer;
function DecisionBoostToHit (l_oPlayer, l_oOpponent) {
super();
oOpponent = l_oOpponent;
oPlayer = l_oPlayer;
}
function checkConditions() {
var _local1 = this;
var _local2 = false;
var l_nRandomRange;
var _local3;
var l_oPlayerPos = _local1.oPlayer.getPos();
var l_oOpponentPos = _local1.oOpponent.getPos();
var l_nPosInList;
if (l_oOpponentPos.x < l_oPlayerPos.x) {
if ((_local1.oOpponent.getSize() == "Big") && ((_local1.oPlayer.getSize() == "Med") || (_local1.oPlayer.getSize() == "Sma"))) {
l_nRandomRange = _local1["nRange" + _local1.oOpponent.getSize()];
}
l_nPosInList = _local1.oOpponent.getPosInList();
_local3 = _local1.getRandom(l_nRandomRange, l_nPosInList);
if (_local3) {
_local1.oOpponent.initBoostToHit();
_local2 = true;
}
}
return(_local2);
}
var nRangeBig = 3;
var nRangeMed = 10;
var nRangeSma = 0;
var aRangePos = [1, 1, 1, 1, 1, 2, 3, 4, 5, 6, 10, 11, 12, 13, 14, 15, 15, 15, 15, 15];
var sType = "BoostToHit";
var nDelay = 200;
}
Symbol 1307 MovieClip [__Packages.decisions.DecisionCannonTarget] Frame 0
class decisions.DecisionCannonTarget extends decisions.Decision
{
var oPlayer, oOpponent;
function DecisionCannonTarget (l_oPlayer, l_oOpponent) {
super();
oPlayer = l_oPlayer;
oOpponent = l_oOpponent;
}
function checkConditions() {
var _local3 = this;
var _local1 = false;
var l_oPlayerPos = _local3.oPlayer.getPos();
var _local2 = _local3.oOpponent.getPos();
if ((_local2.x < l_oPlayerPos.x) && ((Math.random() * 3) < 1)) {
_local3.oOpponent.setState("CannonTarget");
_local1 = true;
}
return(_local1);
}
var sType = "CannonTarget";
var nDelay = -1;
}
Symbol 1308 MovieClip [__Packages.decisions.DecisionIdle] Frame 0
class decisions.DecisionIdle extends decisions.Decision
{
var oOpponent, nDelay;
function DecisionIdle (l_oOpponent) {
super();
oOpponent = l_oOpponent;
nDelay = 15;
}
function checkConditions() {
var _local2 = this;
var _local1 = true;
_local2.nDelay = _local2.nDelay + _local2.oOpponent.getPosInList();
trace("nDelay: " + _local2.nDelay);
return(_local1);
}
var sType = "Idle";
}
Symbol 1309 MovieClip [__Packages.utils.Trig] Frame 0
class utils.Trig
{
function Trig () {
}
static function pointsGetDistance(l_oPt1, l_oPt2) {
var _local1 = Math.sqrt(Math.pow(Math.abs(l_oPt2.x - l_oPt1.x), 2) + Math.pow(Math.abs(l_oPt2.y - l_oPt1.y), 2));
return(_local1);
}
static function pointsGetAngle(l_oPt1, l_oPt2) {
var l_x = 0;
var _local3 = 0;
var _local1 = 0;
var _local2 = 0;
l_x = (l_oPt1.x - l_oPt2.x) * -1;
_local3 = (l_oPt1.y - l_oPt2.y) * -1;
_local1 = Math.atan2(_local3, l_x);
_local1 = (_local1 * 180) / Math.PI;
if (_local1 < 0) {
_local1 = _local1 * -1;
_local2 = 180 - _local1;
_local1 = 180 + _local2;
}
if (_local1 < 0) {
_local1 = _local1 + 360;
}
return(_local1);
}
static function pointsGetRadian(l_oPt1, l_oPt2) {
var _local3 = 0;
var _local2 = 0;
var _local1 = 0;
_local3 = (l_oPt1.x - l_oPt2.x) * -1;
_local2 = (l_oPt1.y - l_oPt2.y) * -1;
_local1 = Math.atan2(_local2, _local3);
return(_local1);
}
}
Symbol 1310 MovieClip [__Packages.ArrowIndicator] Frame 0
class ArrowIndicator
{
var nSize, mcContainer, bVisible;
function ArrowIndicator (l_oFighter, l_mcContainer) {
var _local1 = this;
_local1.oFighter = l_oFighter;
_local1.mcContainer = l_mcContainer;
_local1.nSize = 100;
_local1.bVisible = true;
_local1.hide();
}
function setCoord() {
var _local1 = this;
var _local2 = utils.Trig.pointsGetRadian(_local1.CENTER_POINT, _local1.oFighter.getPos());
var _local3 = utils.Trig.pointsGetDistance(_local1.CENTER_POINT, _local1.oFighter.getPos());
_local1.nSize = 130 - ((_local3 - 350) / 5);
if (_local1.nSize < 50) {
_local1.nSize = 50;
}
_local1.nRotation = (_local2 * 180) / Math.PI;
if (_local1.nRotation < 0) {
_local1.nRotation = _local1.nRotation + 360;
}
_local1.mcContainer.gotoAndStop(Math.round(_local1.nRotation * 2));
}
function moveToCoord() {
mcContainer.arrow.arrow._yscale = nSize;
}
function hide() {
var _local1 = this;
if (_local1.bVisible) {
_local1.bVisible = false;
_local1.mcContainer.gotoAndStop(721);
}
}
function show() {
if (!bVisible) {
bVisible = true;
}
}
function update() {
var _local1 = this;
if (_local1.oFighter.isOnScreen()) {
_local1.show();
_local1.setCoord();
_local1.moveToCoord();
} else {
_local1.hide();
}
}
var CENTER_POINT = {x:270, y:200};
var LEFT_POS = 25;
var RIGHT_POS = 490;
var BOTTOM_POS = 375;
var TOP_POS = 75;
}
Symbol 1311 MovieClip [__Packages.LeaderBoard] Frame 0
class LeaderBoard
{
var sXMLFeedURL, nTickTimeout, oProxy, sGameID, aLeaderList, sPlayerName, nMaxScore, sPlayerShip, mcList;
function LeaderBoard (l_oProxy, l_sGameID) {
var _local1 = this;
mx.events.EventDispatcher.initialize(_local1);
_local1.bSuccessLoadHS = null;
_local1.bSuccessLoadTop20 = null;
_local1.bSuccessLoadStatus = null;
_local1.bWaitingResponse = false;
_local1.sPlayerName = "PLAYER";
_local1.sPlayerShip = "";
_local1.oProxy = l_oProxy;
_local1.sGameID = l_sGameID;
}
function setTextFeedURL() {
var _local1 = this;
Debug.trace("LOAD TXT");
_local1.lvTextFeed = new LoadVars();
_local1.lvTextFeed.onLoad = mx.utils.Delegate.create(_local1, _local1.onLoadTextFeed);
_local1.lvTextFeed.load("feed.txt");
}
function onLoadTextFeed(l_bSucces) {
var _local1 = this;
Debug.trace("TXT LOADED");
if (l_bSucces) {
_local1.sXMLFeedURL = _local1.getServerName() + String(_local1.lvTextFeed.feed);
} else {
_local1.setDefaultFeed();
}
_local1.retrieveList();
_local1.retrieveTop20();
_local1.retrieveStatus();
Debug.trace("FEED : " + _local1.sXMLFeedURL);
}
function setDefaultFeed() {
Debug.trace("DEFAULT FEED");
sXMLFeedURL = getServerName() + "/games/danny_phantom/feed/frightFlight/";
}
function setRelativeFeed() {
var _local1;
var _local2;
var _local3;
_local1 = new String(_global.C.getRoot()._url);
if (_local1.lastIndexOf("/") == -1) {
_local2 = _local1.lastIndexOf("\\");
} else {
_local2 = _local1.lastIndexOf("/");
if (_local2 <= 10) {
_local2 = _local1.lastIndexOf("\\");
}
}
_local3 = _local1.substring(0, _local2 + 1);
sXMLFeedURL = _local3 + "../../danny_phantom/feed/frightFlight/";
Debug.trace("FEED : " + sXMLFeedURL);
}
function getServerName() {
var _local1;
var _local3;
var l_nEndCar;
var _local2;
_local1 = new String(_global.C.getRoot()._url);
_local3 = _local1.indexOf("nick");
if (_local3 != -1) {
l_nEndCar = _local1.indexOf("/", _local3);
_local2 = _local1.substring(0, l_nEndCar);
} else {
_local2 = "http://www.nick.com";
}
return(_local2);
}
function init() {
var _local1 = this;
_local1.sState = "init";
_local1.setTextFeedURL();
_local1.bWaitingResponse = true;
_local1.bHiScoreEnabled = _local1.detectProxyObj();
_local1.initHiScores();
_local1.setTimeOut(10);
}
function setTimeOut(nSeconds) {
nTickTimeout = getTimer() + (nSeconds * 1000);
}
function checkTimeOut(l_mcTarget) {
var _local1 = this;
if (getTimer() >= _local1.nTickTimeout) {
Debug.trace("HS 100 : " + _local1.bSuccessLoadHS);
Debug.trace("HS 20 : " + _local1.bSuccessLoadTop20);
Debug.trace("Status : " + _local1.bSuccessLoadStatus);
if (_local1.sState == "submitScore") {
l_mcTarget.txtLoading.text = "Sorry, we were unable to submit and load your score!";
} else {
_local1.loadScore();
}
_local1.loadScore();
}
}
function detectProxyObj() {
var _local1 = this;
if (_local1.oProxy == undefined) {
return(false);
}
Debug.trace("Logged in? :" + _local1.oProxy.getIsLoggedIn());
return(_local1.oProxy.getIsLoggedIn());
}
function initHiScores() {
oProxy.setGame_Id(sGameID);
}
function retrieveSharedObject() {
var _local1 = this;
_local1.oSO = SharedObject.getLocal(_local1.sGameID, "/");
_local1.nMaxScore = _local1.oSO.data.maxScore;
if (_local1.oSO.data.playerShip != undefined) {
_local1.sPlayerShip = _local1.oSO.data.playerShip;
}
if (_local1.nMaxScore == undefined) {
_local1.nMaxScore = 0;
}
}
function retrieveList() {
var _local1 = this;
if (_local1.bHiScoreEnabled) {
_local1.bWaitingResponse = true;
_local1.oProxy.getScores(mx.utils.Delegate.create(_local1, _local1.retrieveList_callback));
} else {
Debug.trace("NO PROXY");
_local1.retrieveSharedObject();
_local1.bSuccessLoadHS = false;
}
}
function retrieveList_callback(l_bSuccess) {
var _local1 = this;
_local1.bSuccessLoadHS = l_bSuccess;
Debug.trace("HS(top 100) loaded");
if ((_local1.bSuccessLoadTop20 && (_local1.bSuccessLoadHS != null)) && (_local1.bSuccessLoadStatus != null)) {
_local1.loadScore();
}
}
function retrieveTop20() {
var _local1 = this;
_local1.xmlTop20 = new XML();
_local1.xmlTop20.ignoreWhite = true;
_local1.xmlTop20.load(_local1.sXMLFeedURL + "top20.jhtml");
_local1.xmlTop20.onLoad = mx.utils.Delegate.create(_local1, _local1.retrieveTop20_callBack);
}
function retrieveTop20_callBack(l_bSuccess) {
var _local1 = this;
_local1.bSuccessLoadTop20 = l_bSuccess;
if (l_bSuccess) {
Debug.trace("XML(top 20) loaded");
}
if ((_local1.bSuccessLoadTop20 && (_local1.bSuccessLoadHS != null)) && (_local1.bSuccessLoadStatus != null)) {
_local1.loadScore();
}
}
function retrieveStatus() {
var _local1 = this;
if (_local1.bHiScoreEnabled) {
_local1.xmlMonster = new XML();
_local1.xmlMonster.ignoreWhite = true;
_local1.xmlMonster.load(_local1.sXMLFeedURL + "userstatus.jhtml");
_local1.xmlMonster.onLoad = mx.utils.Delegate.create(_local1, _local1.retrieveStatus_callBack);
} else {
_local1.bSuccessLoadStatus = false;
}
}
function retrieveStatus_callBack(l_bSuccess) {
var _local1 = this;
var _local2;
_local1.bSuccessLoadStatus = l_bSuccess;
if (_local1.bSuccessLoadStatus) {
Debug.trace("XML(status) loaded");
}
if (_local1.xmlMonster.firstChild.firstChild.attributes.loggedin == "yes") {
_local1.sPlayerName = _local1.xmlMonster.firstChild.firstChild.attributes.name;
_local2 = _local1.xmlMonster.firstChild.firstChild.attributes.monster;
_local1.sPlayerShip = _local2.substr(0, 10);
_local1.nMaxScore = Number(_local2.substr(11));
} else {
_local1.retrieveSharedObject();
}
if ((_local1.bSuccessLoadTop20 && (_local1.bSuccessLoadHS != null)) && (_local1.bSuccessLoadStatus != null)) {
_local1.loadScore();
}
}
function loadScore() {
var _local1 = this;
_local1.bWaitingResponse = false;
if (_local1.bSuccessLoadHS == null) {
trace("bSuccessLoadHS: " + _local1.bSuccessLoadHS);
_local1.setDefaultList();
} else {
_local1.parseList();
}
_local1.dispatchEvent({target:_local1, type:"onLoadScore"});
}
function submitScore(l_sShipCode, l_nScore) {
var _local1 = this;
var _local2 = new LoadVars();
_local1.sState = "submitScore";
_local1.setTimeOut(10);
_local1.bWaitingResponse = true;
_local2.username = _local1.sPlayerName;
_local2.score = l_nScore;
_local2.monster = l_sShipCode;
_local1.setMaxScore(l_nScore);
_local1.bSuccessLoadHS = false;
_local1.bSuccessLoadStatus = false;
_local1.xmlMonster = new XML();
_local1.xmlMonster.ignoreWhite = true;
_local1.xmlMonster.onLoad = mx.utils.Delegate.create(_local1, _local1.submitShip_callback);
_local2.sendAndLoad(_local1.sXMLFeedURL + "sendscore.jhtml", _local1.xmlMonster, "GET");
Debug.trace(((((((_local1.sXMLFeedURL + "sendscore.jhtml?") + "username=") + _local2.username) + "&score=") + _local2.score) + "&monster=") + _local2.monster);
_local1.bSuccessLoadHS = true;
}
function submitScore_callback(l_bSuccess) {
var _local1 = this;
Debug.trace("PROXY OK");
_local1.bSuccessLoadHS = l_bSuccess;
if (_local1.bSuccessLoadHS && (_local1.bSuccessLoadStatus)) {
_local1.sState = "loadScore";
_local1.setTimeOut(10);
_local1.bSuccessLoadHS = false;
_local1.bSuccessLoadTop20 = false;
_local1.retrieveList();
_local1.retrieveTop20();
}
}
function submitShip_callback(l_bSuccess) {
var _local1 = this;
_local1.bSuccessLoadStatus = l_bSuccess;
if (_local1.bSuccessLoadStatus) {
Debug.trace("SEND SHIP OK");
Debug.trace("xmlMonster: " + _local1.xmlMonster.firstChild);
_local1.sPlayerName = _local1.xmlMonster.firstChild.firstChild.attributes.name;
_local1.setPlayerShip();
}
if (_local1.bSuccessLoadHS && (_local1.bSuccessLoadStatus)) {
_local1.bSuccessLoadHS = false;
_local1.bSuccessLoadTop20 = false;
_local1.retrieveList();
_local1.retrieveTop20();
}
}
function setDefaultList() {
var _local3 = this;
var _local1;
_local3.aLeaderList = new Array();
var _local2 = 0;
while (_local2 < 100) {
_local1 = new Object();
_local1.name = "ROBOT" + (_local2 + 1);
_local1.code = ship.ShipCodec.getRandomCode();
_local1.score = 0;
_local3.aLeaderList.push(_local1);
_local2++;
}
}
function parseList() {
var _local3 = this;
var _local1;
var l_aTempData;
var nScoreCount = _local3.oProxy.getScoreCount();
_local3.aLeaderList = new Array();
var _local2 = 0;
while (_local2 < 100) {
_local1 = new Object();
if (_local2 >= 20) {
if (_local2 >= nScoreCount) {
_local1.name = "ROBOT" + (_local2 + 1);
_local1.code = ship.ShipCodec.getRandomCode();
_local1.score = 0;
} else {
l_aTempData = _local3.oProxy.getScoreItem(_local2);
_local1.name = l_aTempData[0];
_local1.code = ship.ShipCodec.getRandomCode();
_local1.score = l_aTempData[1];
}
} else if ((!_local3.bSuccessLoadTop20) || (_local3.xmlTop20.firstChild.childNodes[_local2].childNodes[1].firstChild == undefined)) {
_local1.code = ship.ShipCodec.getRandomCode();
_local1.name = "ROBOT" + (_local2 + 1);
_local1.score = 0;
} else {
_local1.code = String(_local3.xmlTop20.firstChild.childNodes[_local2].childNodes[3].firstChild.nodeValue);
if (_local1.code) {
while (_local1.code.charCodeAt(0) == 10) {
_local1.code = _local1.code.substr(1);
}
} else {
_local1.code = ship.ShipCodec.getRandomCode();
}
_local1.name = String(_local3.xmlTop20.firstChild.childNodes[_local2].childNodes[1].firstChild.nodeValue);
_local1.score = String(_local3.xmlTop20.firstChild.childNodes[_local2].childNodes[2].firstChild.nodeValue);
}
_local3.aLeaderList.push(_local1);
_local2++;
}
}
function getFighterCode(nPosition) {
return(String(aLeaderList[nPosition - 1].code));
}
function getOpponentName(nPosition) {
return(aLeaderList[nPosition - 1].name);
}
function getPlayerName() {
return(sPlayerName);
}
function getMaxScore() {
if (nMaxScore) {
return(nMaxScore);
}
return(0);
}
function setMaxScore(l_nNewScore) {
var _local1 = this;
if (l_nNewScore > _local1.getMaxScore()) {
_local1.nMaxScore = l_nNewScore;
_local1.oSO.data.maxScore = _local1.nMaxScore;
_local1.oSO.flush();
}
}
function setPlayerShip(l_sShipCode) {
var _local1 = this;
var _local2 = new LoadVars();
if (l_sShipCode) {
_local1.sPlayerShip = l_sShipCode;
}
if (_local1.sPlayerShip.length < 10) {
_local1.sPlayerShip = "0000000000";
}
Debug.trace("sPlayerShip: " + _local1.sPlayerShip);
_local1.oSO.data.playerShip = _local1.sPlayerShip;
_local2.monsterCode = (_local1.sPlayerShip + "|") + _local1.getMaxScore();
_local2.sendAndLoad(_local1.sXMLFeedURL + "savemonster.jhtml", _local2, "GET");
}
function getPlayerShip() {
return(sPlayerShip);
}
function writeList(l_mcTarget) {
var _local3 = this;
var nXStartPos = 15;
var nYStartPos = 0;
var sItemToDuplicate20 = "_hsItem20";
var sItemToDuplicate100 = "_hsItem100";
var sCurrenItem;
var mcCurrentPlayerNormal;
var mcCurrentPlayerShadow;
var _local2;
l_mcTarget.txtLoading.text = "";
var _local1 = 0;
while (_local1 < 100) {
_local2 = new Object();
_local2._x = nXStartPos;
_local2._y = nYStartPos + (_local1 * 24);
if (_local1 < 20) {
sCurrenItem = sItemToDuplicate20;
} else {
sCurrenItem = sItemToDuplicate100;
}
mcCurrentPlayerNormal = l_mcTarget.hsList.scoreListNormal.attachMovie(sCurrenItem, "player" + _local1, _local1 + 5, _local2);
mcCurrentPlayerShadow = l_mcTarget.hsList.scoreListShadow.attachMovie(sCurrenItem, "player" + _local1, _local1 + 5, _local2);
mcCurrentPlayerNormal.txtPlayer.text = _local3.aLeaderList[_local1].name;
mcCurrentPlayerShadow.txtPlayer.text = _local3.aLeaderList[_local1].name;
mcCurrentPlayerNormal.txtScore.text = _local3.aLeaderList[_local1].score;
mcCurrentPlayerShadow.txtScore.text = _local3.aLeaderList[_local1].score;
_local1++;
}
_local3.mcList = l_mcTarget.hsList;
_local3.mcList.initY = 110;
_local3.mcList.maxY = (_local3.mcList.initY - _local3.mcList._height) + 215;
}
function retry() {
var _local1 = this;
if ((!_local1.bSuccessLoadHS) && (!_local1.bSuccessLoadTop20)) {
_local1.bSuccessLoadHS = false;
_local1.bSuccessLoadTop20 = false;
_local1.bWaitingResponse = true;
_local1.retrieveList();
_local1.retrieveTop20();
}
}
function getListMovie() {
return(mcList);
}
}
Symbol 1312 MovieClip [__Packages.Debug] Frame 0
class Debug
{
static var lc;
function Debug () {
}
static function clear() {
lc = new LocalConnection();
lc.send("trace", "clear");
}
static function setLevel(pLvl) {
level = pLvl;
}
static function trace(pMsg, pLvl) {
var _local1;
if (pLvl != undefined) {
_local1 = pLvl;
} else {
_local1 = level;
}
lc = new LocalConnection();
lc.send("trace", "trace", pMsg, _local1);
}
static function traceObject(o, pRecurseDepth, pLvl, pIndent) {
var recurseDepth;
var indent;
var tLvl;
if (pLvl != undefined) {
tLvl = pLvl;
} else {
tLvl = level;
}
if (pRecurseDepth == undefined) {
recurseDepth = 0;
} else {
recurseDepth = pRecurseDepth;
}
if (pIndent == undefined) {
indent = 0;
} else {
indent = pIndent;
}
for (var prop in o) {
var _local3 = "";
var _local1 = 0;
while (_local1 < indent) {
_local3 = _local3 + " ";
_local1++;
}
var _local2 = o[prop].toString();
if (o[prop] instanceof Array) {
_local2 = "[Array]";
}
if (_local2 == "[object Object]") {
_local2 = "[Object]";
}
trace(((_local3 + prop) + ": ") + _local2, tLvl);
if (recurseDepth > 0) {
traceObject(o[prop], recurseDepth - 1, tLvl, indent + 1);
}
}
}
static var level = 0;
static var DEBUG = 0;
static var INFO = 1;
static var WARN = 2;
static var ERROR = 3;
static var FATAL = 4;
}
Symbol 1313 MovieClip [__Packages.weapons.ProjectileList] Frame 0
class weapons.ProjectileList
{
var aList;
function ProjectileList () {
aList = new Array();
}
function addToList(l_newProjectile) {
aList.push(l_newProjectile);
l_newProjectile.render();
}
function pause() {
var _local2 = this;
var _local1;
for (var _local3 in _local2.aList) {
_local1 = _local2.aList[_local3];
_local1.pause();
}
}
function resume() {
var _local2 = this;
var _local1;
for (var _local3 in _local2.aList) {
_local1 = _local2.aList[_local3];
_local1.resume();
}
}
function update(l_nXSpeed, l_nYSpeed) {
var _local2 = this;
var _local3 = l_nYSpeed;
var _local1;
for (var i in _local2.aList) {
_local1 = _local2.aList[i];
if (_local1.getState() != "DELETE") {
_local1.setCurrentBGSpeed(l_nXSpeed, _local3);
_local1.actions();
} else {
_local1.actions();
delete _local2.aList[i];
}
}
}
}
Symbol 1314 MovieClip [__Packages.powerUp.PowerUpManager] Frame 0
class powerUp.PowerUpManager extends background.BackgroundManager
{
var aPowerUpType;
function PowerUpManager (l_mcContainer, l_aFighter) {
var _local1 = this;
super();
_local1.aFighter = l_aFighter;
_local1.mcContainer = l_mcContainer;
_local1.aList = new Array();
_local1.nFrRespawnMax = 45;
_local1.nFrRespawnCount = 0;
_local1.nItemDepth = 0;
_local1.aPowerUpType = ["NitroBonus", "NitroBonus", "NitroBonus", "NitroBonus", "EnergyBonus", "PointBonus", "ShapeDistorter"];
}
function init() {
}
function update(l_nXSpeed, l_nYSpeed) {
super.update(l_nXSpeed - (Controller.BASE_SPEED - 15), l_nYSpeed);
createNewItem();
}
function createNewItem() {
var _local1 = this;
_local1.nFrRespawnCount++;
if (_local1.nFrRespawnCount >= _local1.nFrRespawnMax) {
_local1.nFrRespawnCount = 0;
if (Math.round(Math.random() * 2) == 1) {
_local1.addItem();
}
}
}
function addItem() {
var _local1 = this;
var _local3 = _local1.getRandomType();
var _local2 = _local1.getRandomPos();
var l_Item;
if ((((_local3 == 1) || (_local3 == 2)) || (_local3 == 3)) || (_local3 == 4)) {
l_Item = new powerUp.NitroBonus(_local1.mcContainer, _local2.x - _local1.nXPos, _local2.y - _local1.nYPos, _local1.nItemDepth);
} else if (_local3 == 5) {
l_Item = new powerUp.EnergyBonus(_local1.mcContainer, _local2.x - _local1.nXPos, _local2.y - _local1.nYPos, _local1.nItemDepth);
} else if (_local3 == 6) {
l_Item = new powerUp.PointBonus(_local1.mcContainer, _local2.x - _local1.nXPos, _local2.y - _local1.nYPos, _local1.nItemDepth);
} else if (_local3 == 7) {
l_Item = new powerUp.ShapeDistorter(_local1.mcContainer, _local2.x - _local1.nXPos, _local2.y - _local1.nYPos, _local1.nItemDepth);
}
_local1.nItemDepth++;
_local1.oBroadcaster.addListener(l_Item);
l_Item.addEventListener("removeItem", mx.utils.Delegate.create(_local1, _local1.removeItem));
l_Item.setTarget(_local1.aFighter);
trace("l_Item: " + l_Item);
}
function getRandomType() {
var _local1 = Math.ceil(Math.random() * aPowerUpType.length);
trace("POWER UP: " + _local1);
return(_local1);
}
function getRandomPos() {
var _local2 = this;
var _local1 = new Object();
_local1.x = _local2.SCREEN_RIGHT;
_local1.y = Math.round(Math.random() * (_local2.SCREEN_BOTTOM - _local2.SCREEN_TOP));
return(_local1);
}
var oBroadcaster = new Object();
}
Symbol 1315 MovieClip [__Packages.powerUp.PowerUp] Frame 0
class powerUp.PowerUp
{
var bRemoved, aTarget;
function PowerUp () {
mx.events.EventDispatcher.initialize();
bRemoved = false;
}
function update() {
var _local1 = this;
var _local2 = new Object();
_local2.x = _local1.mcContainer._x;
_local2.y = _local1.mcContainer._y;
_local1.mcContainer._parent.localToGlobal(_local2);
if ((_local2.x - _local1.nHalfWidth) > (_local1.SCREEN_RIGHT + 100)) {
_local1.remove();
} else if ((_local2.x + _local1.nHalfWidth) < (_local1.SCREEN_LEFT - 100)) {
_local1.remove();
} else if (_local2.y > (_local1.SCREEN_BOTTOM + 100)) {
_local1.remove();
} else if (_local2.y < (_local1.SCREEN_TOP - 100)) {
_local1.remove();
}
_local1.detectCollides();
}
function detectCollides() {
var _local1 = this;
var _local2;
for (var i in _local1.aTarget) {
_local2 = _local1.aTarget[i].getBoundingBox();
for (var _local3 in _local2) {
if (_local1.mcContainer.hitTest(_local2[_local3])) {
if ((_local1.aTarget[i].getState() != "Die") && (_local1.aTarget[i].getState() != "Loop")) {
_local1.getBonus(_local1.aTarget[i]);
_local1.remove();
}
break;
}
}
}
}
function getBonus() {
}
function setTarget(l_aTarget) {
aTarget = l_aTarget;
}
function remove() {
var _local1 = this;
trace("REMOVE!");
if (!_local1.bRemoved) {
_local1.bRemoved = true;
_local1.mcContainer.removeMovieClip();
_local1.dispatchEvent({target:_local1, type:"removeItem"});
}
}
var SCREEN_TOP = Controller.SCREEN_TOP;
var SCREEN_BOTTOM = Controller.SCREEN_BOTTOM;
var SCREEN_LEFT = Controller.SCREEN_LEFT;
var SCREEN_RIGHT = Controller.SCREEN_RIGHT;
}
Symbol 1316 MovieClip [__Packages.powerUp.NitroBonus] Frame 0
class powerUp.NitroBonus extends powerUp.PowerUp
{
function NitroBonus (l_mcAttachTarget, l_nXPos, l_nYPos, l_nDepth) {
var _local1 = this;
var _local2 = l_nDepth;
super();
var l_nSide = Math.ceil(Math.random() * 2);
l_mcAttachTarget.attachMovie("powerUp_parts", "nitroBonus" + _local2, _local2);
_local1.mcContainer = l_mcAttachTarget["nitroBonus" + _local2];
_local1.nHalfWidth = _local1.mcContainer._width / 2;
_local1.mcContainer._x = l_nXPos + _local1.nHalfWidth;
_local1.mcContainer._y = l_nYPos;
_local1.mcContainer.gotoAndStop(1);
}
function init() {
}
function getBonus(l_oTarget) {
l_oTarget.addNitro(100);
_global.C.oSoundCTRL.playSound("getNitro", 100, 0);
}
}
Symbol 1317 MovieClip [__Packages.powerUp.EnergyBonus] Frame 0
class powerUp.EnergyBonus extends powerUp.PowerUp
{
function EnergyBonus (l_mcAttachTarget, l_nXPos, l_nYPos, l_nDepth) {
var _local1 = this;
var _local2 = l_nDepth;
super();
var l_nSide = Math.ceil(Math.random() * 2);
l_mcAttachTarget.attachMovie("powerUp_parts", "energyBonus" + _local2, _local2);
_local1.mcContainer = l_mcAttachTarget["energyBonus" + _local2];
_local1.nHalfWidth = _local1.mcContainer._width / 2;
_local1.mcContainer._x = l_nXPos + _local1.nHalfWidth;
_local1.mcContainer._y = l_nYPos;
_local1.mcContainer.gotoAndStop(2);
}
function init() {
}
function getBonus(l_oTarget) {
l_oTarget.addEnergy(20);
_global.C.oSoundCTRL.playSound("getEnergy", 100, 0);
}
}
Symbol 1318 MovieClip [__Packages.powerUp.PointBonus] Frame 0
class powerUp.PointBonus extends powerUp.PowerUp
{
function PointBonus (l_mcAttachTarget, l_nXPos, l_nYPos, l_nDepth) {
var _local1 = this;
var _local2 = l_nDepth;
super();
var l_nSide = Math.ceil(Math.random() * 2);
l_mcAttachTarget.attachMovie("powerUp_parts", "pointBonus" + _local2, _local2);
_local1.mcContainer = l_mcAttachTarget["pointBonus" + _local2];
_local1.nHalfWidth = _local1.mcContainer._width / 2;
_local1.mcContainer._x = l_nXPos + _local1.nHalfWidth;
_local1.mcContainer._y = l_nYPos;
_local1.mcContainer.gotoAndStop(3);
}
function init() {
}
function getBonus(l_oTarget) {
l_oTarget.addPoints(100);
_global.C.oSoundCTRL.playSound("getPoint", 100, 0);
}
}
Symbol 1319 MovieClip [__Packages.powerUp.ShapeDistorter] Frame 0
class powerUp.ShapeDistorter extends powerUp.PowerUp
{
function ShapeDistorter (l_mcAttachTarget, l_nXPos, l_nYPos, l_nDepth) {
var _local1 = this;
var _local2 = l_nDepth;
super();
var l_nSide = Math.ceil(Math.random() * 2);
l_mcAttachTarget.attachMovie("powerUp_parts", "nitroBonus" + _local2, _local2);
_local1.mcContainer = l_mcAttachTarget["nitroBonus" + _local2];
_local1.nHalfWidth = _local1.mcContainer._width / 2;
_local1.mcContainer._x = l_nXPos + _local1.nHalfWidth;
_local1.mcContainer._y = l_nYPos;
_local1.mcContainer.gotoAndStop(4);
}
function init() {
}
function getBonus(l_oTarget) {
var _local1 = l_oTarget;
if ((_local1.getState() != "Loop") && (_local1.getState() != "Die")) {
_local1.initDistort();
_global.C.oSoundCTRL.playSound("getDistort", 100, 0);
}
}
}
Symbol 1320 MovieClip [__Packages.SoundController] Frame 0
class SoundController
{
function SoundController (l_mcContainer) {
var _local1 = l_mcContainer;
var _local2 = this;
_local1.createEmptyMovieClip("soundFX", 2);
_local1.createEmptyMovieClip("music", 3);
_local2.mcSoundFX = _local1.soundFX;
_local2.SOUND_FADE_SPEED = 5;
_local2.bMute = false;
}
function clearSound() {
var _local1 = this;
for (var _local2 in _local1.mcSoundFX) {
_local1.mcSoundFX[_local2].onEnterFrame = function () {
var _local1 = this;
_local1.oSound.setVolume(_local1.oSound.getVolume() - _local1.oSound.SOUND_FADE_SPEED);
if (_local1.oSound.getVolume() <= 0) {
_local1.oSound.stop();
_local1.removeMovieClip();
}
};
}
}
function fadeOutSound(l_sLinkage) {
var _local1 = this;
_local1.mcSoundFX["oClip" + l_sLinkage].onEnterFrame = function () {
var _local1 = this;
_local1.oSound.setVolume(_local1.oSound.getVolume() - _local1.oSound.SOUND_FADE_SPEED);
if (_local1.oSound.getVolume() <= 0) {
_local1.oSound.stop();
_local1.removeMovieClip();
}
};
}
function muteAllSounds() {
var _local1 = this;
_local1.bMute = true;
for (var _local2 in _local1.mcSoundFX) {
_local1.mcSoundFX[_local2].initVolume = _local1.mcSoundFX[_local2].oSound.getVolume();
_local1.mcSoundFX[_local2].onEnterFrame = function () {
var _local1 = this;
_local1.oSound.setVolume(_local1.oSound.getVolume() - _local1.oSound.SOUND_FADE_SPEED);
if (_local1.oSound.getVolume() <= 0) {
delete _local1.onEnterFrame;
}
};
}
}
function unmuteAllSounds() {
var _local1 = this;
_local1.bMute = false;
for (var _local2 in _local1.mcSoundFX) {
_local1.mcSoundFX[_local2].onEnterFrame = function () {
var _local1 = this;
_local1.oSound.setVolume(_local1.oSound.getVolume() + _local1.oSound.SOUND_FADE_SPEED);
if (_local1.oSound.getVolume() >= _local1.initVolume) {
delete _local1.onEnterFrame;
}
};
}
}
function playSound(l_sLinkage, l_nVolume, l_nLoop, l_bUnique) {
var _local2 = this;
var _local3 = l_sLinkage;
nNextDepth++;
if (l_nLoop == undefined) {
l_nLoop = 0;
}
if (_local2.mcSoundFX["oClip" + _local3] == undefined) {
_local2.mcSoundFX.createEmptyMovieClip("oClip" + _local3, nNextDepth);
var l_oClip = _local2.mcSoundFX["oClip" + _local3];
} else if (!l_bUnique) {
_local2.mcSoundFX.createEmptyMovieClip("oClip" + nNextDepth, nNextDepth);
var l_oClip = _local2.mcSoundFX["oClip" + nNextDepth];
}
l_oClip.oSound = new Sound(l_oClip);
var _local1 = l_oClip.oSound;
_local1.attachSound(_local3);
_local1.onSoundComplete = function () {
l_oClip.removeMovieClip();
delete l_oClip;
};
_local1.maxVolume = l_nVolume;
_local1.SOUND_FADE_SPEED = _local2.SOUND_FADE_SPEED;
if (_local2.bMute) {
l_oClip.initVolume = l_nVolume;
_local1.setVolume(0);
} else {
_local1.setVolume(l_nVolume);
}
_local1.start(0, l_nLoop);
return(_local1);
}
static var nNextDepth = 0;
}
Symbol 1321 MovieClip [__Packages.utils.RollFX] Frame 0
class utils.RollFX extends MovieClip
{
var gotoAndStop, gotoAndPlay;
function RollFX () {
super();
(gotoAndStop("Idle"));// not popped
}
function onRollOver() {
(gotoAndPlay("RollOver"));// not popped
}
function onRollOut() {
(gotoAndPlay("RollOut"));// not popped
}
function onPress() {
(gotoAndPlay("Clicked"));// not popped
}
}
Instance of Symbol 25 MovieClip in Symbol 683 MovieClip Frame 1
onClipEvent (enterFrame) {
var l_pc = Math.ceil((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
if (l_pc == 100) {
_parent.gotoAndStop(2);
} else {
this.pc = l_pc + "%";
this.gotoAndStop(l_pc);
}
}
Symbol 719 MovieClip Frame 1
stop();
Symbol 727 MovieClip Frame 1
stop();
Symbol 728 MovieClip Frame 80
_parent.nextFrame();
Instance of Symbol 727 MovieClip in Symbol 729 MovieClip Frame 1
on (release) {
_global.C.clickSound();
_global.C.gotoScreen("leaderBoard");
}
Instance of Symbol 719 MovieClip in Symbol 729 MovieClip Frame 1
on (release) {
_global.C.clickSound();
_global.C.gotoScreen("context");
}
Symbol 786 MovieClip Frame 1
stop();
Instance of Symbol 786 MovieClip in Symbol 796 MovieClip Frame 2
on (release) {
_global.C.clickSound();
_global.C.gotoScreen("context");
}
Instance of Symbol 786 MovieClip in Symbol 796 MovieClip Frame 5
on (release) {
_global.C.clickSound();
_global.C.gotoScreen("pilots");
}
Symbol 804 MovieClip Frame 1
_visible = false;
_parent.hitArea = this;
Symbol 805 MovieClip [ChooseTechnus] Frame 1
#initclip 58
Object.registerClass("ChooseTechnus", utils.RollFX);
#endinitclip
stop();
Symbol 805 MovieClip [ChooseTechnus] Frame 24
stop();
Symbol 805 MovieClip [ChooseTechnus] Frame 39
stop();
Symbol 805 MovieClip [ChooseTechnus] Frame 54
stop();
Symbol 806 MovieClip [ChooseSkulker] Frame 1
#initclip 53
Object.registerClass("ChooseSkulker", utils.RollFX);
#endinitclip
stop();
Symbol 806 MovieClip [ChooseSkulker] Frame 24
stop();
Symbol 806 MovieClip [ChooseSkulker] Frame 39
stop();
Symbol 806 MovieClip [ChooseSkulker] Frame 54
stop();
Symbol 807 MovieClip [ChooseVlad] Frame 1
#initclip 54
Object.registerClass("ChooseVlad", utils.RollFX);
#endinitclip
stop();
Symbol 807 MovieClip [ChooseVlad] Frame 24
stop();
Symbol 807 MovieClip [ChooseVlad] Frame 39
stop();
Symbol 807 MovieClip [ChooseVlad] Frame 54
stop();
Symbol 808 MovieClip [ChooseDesiree] Frame 1
#initclip 55
Object.registerClass("ChooseDesiree", utils.RollFX);
#endinitclip
stop();
Symbol 808 MovieClip [ChooseDesiree] Frame 24
stop();
Symbol 808 MovieClip [ChooseDesiree] Frame 39
stop();
Symbol 808 MovieClip [ChooseDesiree] Frame 54
stop();
Symbol 809 MovieClip [ChooseSamantha] Frame 1
#initclip 56
Object.registerClass("ChooseSamantha", utils.RollFX);
#endinitclip
stop();
Symbol 809 MovieClip [ChooseSamantha] Frame 24
stop();
Symbol 809 MovieClip [ChooseSamantha] Frame 39
stop();
Symbol 809 MovieClip [ChooseSamantha] Frame 54
stop();
Symbol 810 MovieClip [ChooseDanny] Frame 1
#initclip 57
Object.registerClass("ChooseDanny", utils.RollFX);
#endinitclip
stop();
Symbol 810 MovieClip [ChooseDanny] Frame 24
stop();
Symbol 810 MovieClip [ChooseDanny] Frame 39
stop();
Symbol 810 MovieClip [ChooseDanny] Frame 54
stop();
Instance of Symbol 805 MovieClip [ChooseTechnus] in Symbol 817 MovieClip Frame 1
on (release) {
_global.C.clickSound();
_global.C.oBuilder.setPilot(6);
}
Instance of Symbol 806 MovieClip [ChooseSkulker] in Symbol 817 MovieClip Frame 1
on (release) {
_global.C.clickSound();
_global.C.oBuilder.setPilot(3);
}
Instance of Symbol 807 MovieClip [ChooseVlad] in Symbol 817 MovieClip Frame 1
on (release) {
_global.C.clickSound();
_global.C.oBuilder.setPilot(5);
}
Instance of Symbol 808 MovieClip [ChooseDesiree] in Symbol 817 MovieClip Frame 1
on (release) {
_global.C.clickSound();
_global.C.oBuilder.setPilot(4);
}
Instance of Symbol 809 MovieClip [ChooseSamantha] in Symbol 817 MovieClip Frame 1
on (release) {
_global.C.clickSound();
_global.C.oBuilder.setPilot(2);
}
Instance of Symbol 810 MovieClip [ChooseDanny] in Symbol 817 MovieClip Frame 1
on (release) {
_global.C.clickSound();
_global.C.oBuilder.setPilot(1);
}
Symbol 822 MovieClip Frame 1
stop();
Symbol 828 MovieClip Frame 1
stop();
Symbol 834 MovieClip Frame 1
stop();
Symbol 844 MovieClip Frame 1
stop();
Symbol 850 MovieClip Frame 1
stop();
Symbol 856 MovieClip Frame 1
stop();
Symbol 865 MovieClip Frame 1
stop();
Symbol 871 MovieClip Frame 1
stop();
Symbol 878 MovieClip Frame 1
stop();
Symbol 884 MovieClip Frame 1
_global.C.initBuilderBtns();
Instance of Symbol 822 MovieClip "btnReadyInGame" in Symbol 884 MovieClip Frame 1
on (release) {
_global.C.gotoScreen("game");
}
Instance of Symbol 822 MovieClip "btnReadyStart" in Symbol 884 MovieClip Frame 1
on (release) {
_global.C.clickSound();
_global.C.gotoScreen("instructions");
}
Instance of Symbol 878 MovieClip "btnBackStart" in Symbol 884 MovieClip Frame 1
on (release) {
_global.C.clickSound();
_global.C.gotoScreen("pilots");
}
Symbol 893 MovieClip Frame 1
stop();
Symbol 941 MovieClip Frame 1
stop();
Symbol 963 MovieClip Frame 2
stop();
Instance of Symbol 878 MovieClip "btnBackStart" in Symbol 963 MovieClip Frame 2
on (release) {
_global.C.clickSound();
_global.C.gotoScreen("builder");
}
Instance of Symbol 941 MovieClip in Symbol 963 MovieClip Frame 2
on (release) {
_global.C.clickSound();
_global.C.gotoScreen("game");
}
Instance of Symbol 786 MovieClip in Symbol 963 MovieClip Frame 2
on (release) {
_global.C.clickSound();
_global.C.gotoScreen("instructions");
}
Instance of Symbol 878 MovieClip in Symbol 963 MovieClip Frame 10
on (release) {
_global.C.clickSound();
_global.C.gotoScreen("instructions");
}
Symbol 969 MovieClip Frame 1
stop();
Symbol 974 MovieClip Frame 1
function getReport() {
var _local1 = _parent;
if (frate < minForBest) {
if (frate < minForHigh) {
vQuality = "MEDIUM";
}
}
nbReport++;
_local1.txtFrameRate.text = frate;
_local1.txtQuality.text = vQuality;
_local1.txtFrameRate.textColor = "0";
_local1.txtQuality.textColor = "0";
_quality = vQuality;
enableReport = false;
gotoAndPlay (2);
}
_global.FR = this;
fcount = 0;
offset = getTimer();
vQuality = "HIGH";
_quality = vQuality;
_parent._visible = false;
minForMedium = 25;
minForHigh = 30;
minForBest = 35;
nbReport = 0;
enableReport = false;
Symbol 974 MovieClip Frame 2
fcount = 0;
offset = getTimer();
Symbol 974 MovieClip Frame 3
fcount++;
Symbol 974 MovieClip Frame 4
call(3);
Symbol 974 MovieClip Frame 5
call(3);
Symbol 974 MovieClip Frame 6
call(3);
Symbol 974 MovieClip Frame 7
call(3);
Symbol 974 MovieClip Frame 8
call(3);
Symbol 974 MovieClip Frame 9
call(3);
Symbol 974 MovieClip Frame 10
call(3);
Symbol 974 MovieClip Frame 11
call(3);
Symbol 974 MovieClip Frame 12
call(3);
Symbol 974 MovieClip Frame 13
call(3);
Symbol 974 MovieClip Frame 14
call(3);
Symbol 974 MovieClip Frame 15
call(3);
Symbol 974 MovieClip Frame 16
call(3);
Symbol 974 MovieClip Frame 17
call(3);
Symbol 974 MovieClip Frame 18
call(3);
Symbol 974 MovieClip Frame 19
call(3);
Symbol 974 MovieClip Frame 20
call(3);
Symbol 974 MovieClip Frame 21
call(3);
Symbol 974 MovieClip Frame 22
call(3);
Symbol 974 MovieClip Frame 23
call(3);
Symbol 974 MovieClip Frame 24
call(3);
Symbol 974 MovieClip Frame 25
call(3);
Symbol 974 MovieClip Frame 26
call(3);
Symbol 974 MovieClip Frame 27
call(3);
Symbol 974 MovieClip Frame 28
call(3);
Symbol 974 MovieClip Frame 29
call(3);
Symbol 974 MovieClip Frame 30
call(3);
Symbol 974 MovieClip Frame 31
call(3);
curtime = (getTimer() - offset) / 1000;
frate = Math.ceil(fcount / curtime);
_parent.pointer.play();
if (enableReport) {
getReport();
} else {
_parent.txtFrameRate.text = frate;
_parent.txtQuality.text = _quality;
_parent.txtFrameRate.textColor = "16777215";
_parent.txtQuality.textColor = "16777215";
_global.C.setNewQuality(frate);
gotoAndPlay (2);
}
Symbol 983 MovieClip Frame 51
_global.C.Go();
stop();
Symbol 1007 Button
on (release) {
_global.C.clickSound();
_global.C.oSoundCTRL.muteAllSounds();
gotoAndStop (2);
}
Symbol 1008 Button
on (release) {
_global.C.clickSound();
_global.C.oSoundCTRL.unmuteAllSounds();
gotoAndStop (1);
}
Symbol 1009 MovieClip Frame 1
if (_global.C.oSoundCTRL.bMute) {
gotoAndStop (2);
} else {
gotoAndStop (1);
}
Symbol 1013 MovieClip Frame 1
stop();
Symbol 1018 MovieClip Frame 1
stop();
Symbol 1021 MovieClip Frame 1
stop();
Symbol 1025 MovieClip Frame 1
stop();
Instance of Symbol 1025 MovieClip in Symbol 1032 MovieClip Frame 1
on (release) {
_global.C.clickSound();
_global.C.resumeGame();
_parent._parent.gotoAndPlay("CloseMenu");
}
Instance of Symbol 1018 MovieClip in Symbol 1032 MovieClip Frame 1
on (release) {
_global.C.clickSound();
_global.C.oSoundCTRL.fadeOutSound("musicInGame");
_global.C.oSoundCTRL.playSound("musicMenu", 80, 100000);
_global.C.resumeGame();
_global.C.gotoScreen("title");
this.enabled = false;
}
Instance of Symbol 1021 MovieClip in Symbol 1032 MovieClip Frame 1
on (release) {
_global.C.clickSound();
_global.C.showInstructions();
_parent._parent.gotoAndPlay("CloseMenu");
}
Instance of Symbol 1013 MovieClip in Symbol 1032 MovieClip Frame 1
on (release) {
_global.C.clickSound();
_global.C.resumeGame();
_parent._parent.gotoAndPlay("CloseMenu");
}
Symbol 1038 MovieClip Frame 1
stop();
Instance of Symbol 986 MovieClip "menu" in Symbol 1038 MovieClip Frame 1
on (release) {
_global.C.clickSound();
_global.C.pauseGame();
_parent.gotoAndPlay("OpenMenu");
}
Symbol 1038 MovieClip Frame 13
stop();
Symbol 1043 MovieClip Frame 100
stop();
Symbol 1045 MovieClip Frame 100
stop();
Symbol 1047 MovieClip Frame 110
stop();
Symbol 1049 MovieClip Frame 80
stop();
Symbol 1050 MovieClip Frame 1
stop();
Symbol 1091 MovieClip Frame 1
stop();
Symbol 1100 MovieClip Frame 1
stop();
Symbol 1107 MovieClip Frame 1
stop();
Symbol 1133 MovieClip Frame 1
stop();
Symbol 1140 MovieClip Frame 1
stop();
Instance of Symbol 1100 MovieClip in Symbol 1141 MovieClip Frame 1
on (release) {
_global.C.clickSound();
_global.C.gotoScreen("builder");
}
Instance of Symbol 1107 MovieClip in Symbol 1141 MovieClip Frame 1
on (release) {
_global.C.clickSound();
_global.C.gotoScreen("game");
}
Instance of Symbol 1133 MovieClip in Symbol 1141 MovieClip Frame 2
on (release) {
_global.C.clickSound();
_global.C.gotoScreen("builder");
}
Instance of Symbol 1140 MovieClip in Symbol 1141 MovieClip Frame 3
on (release) {
_global.C.clickSound();
_global.C.gotoScreen("endGood");
}
Instance of Symbol 1140 MovieClip in Symbol 1142 MovieClip Frame 46
on (release) {
_global.C.clickSound();
_global.C.submitScore();
_global.C.gotoScreen("leaderBoard");
}
Instance of Symbol 1140 MovieClip in Symbol 1142 MovieClip Frame 59
on (release) {
_global.C.clickSound();
_global.C.submitScore();
_global.C.gotoScreen("leaderBoard");
}
Symbol 1142 MovieClip Frame 86
stop();
Symbol 1148 MovieClip Frame 94
if ((Math.random() * 50) < 35) {
gotoAndPlay ("idle");
} else {
gotoAndPlay ("glow");
}
Symbol 1184 MovieClip Frame 1
_global.C.colorMe(this);
Symbol 1185 MovieClip Frame 1
winner.gotoAndStop(_global.C.oBuilder.getPilot());
Symbol 1203 MovieClip Frame 1
stop();
Symbol 1217 MovieClip Frame 347
stop();
Instance of Symbol 727 MovieClip in Symbol 1244 MovieClip Frame 1
on (release) {
_global.C.clickSound();
_global.C.submitScore();
_global.C.gotoScreen("leaderBoard");
}
Instance of Symbol 1203 MovieClip "btnTryAgain" in Symbol 1244 MovieClip Frame 1
on (release) {
_global.C.clickSound();
_global.C.gotoScreen("title");
}
Symbol 1257 MovieClip Frame 1
stop();
Symbol 1260 MovieClip Frame 1
stop();
Symbol 1266 MovieClip Frame 1
stop();
Instance of Symbol 1254 MovieClip "btnScroll" in Symbol 1268 MovieClip Frame 1
on (release) {
}
Instance of Symbol 1257 MovieClip "btnScrollDown" in Symbol 1268 MovieClip Frame 1
on (release) {
}
Instance of Symbol 1260 MovieClip "btnScrollUp" in Symbol 1268 MovieClip Frame 1
on (release) {
}
Instance of Symbol 878 MovieClip "btnBack" in Symbol 1268 MovieClip Frame 1
on (release) {
_global.C.clickSound();
_global.C.gotoScreen("title");
}
Instance of Symbol 1203 MovieClip "btnTryAgain" in Symbol 1268 MovieClip Frame 1
on (release) {
_global.C.clickSound();
_global.C.gotoScreen("title");
}
Instance of Symbol 1266 MovieClip "btnPlayAgain" in Symbol 1268 MovieClip Frame 1
on (release) {
_global.C.clickSound();
_global.C.gotoScreen("title");
}
Symbol 1269 MovieClip Frame 1
stop();
Instance of Symbol 976 MovieClip in Symbol 1269 MovieClip Frame 49
/* no clip actions */