Frame 1
function init() {
Button.prototype.tabEnabled = false;
MovieClip.prototype.tabEnabled = false;
_global.g_kApplication._lockroot = true;
_global.g_kApplication.m_kSettings = new Settings();
_global.g_kApplication.m_kApplicationState = new ApplicationState();
_global.g_kApplication.m_kPlayerState = new PlayerState();
_global.g_kApplication.m_kGameTimer = new LRG.Utils.LRGGameTimer();
LRG.Utils.LRGGameTimer(_global.getGameTimer()).startClock(true);
_global.g_kApplication.stop();
}
function start() {
_global.g_kApplication.m_kGui.m_kPlayGui.gotoAndStop("Hide");
_global.g_kApplication.m_kGui.m_kPlayGui._visible = false;
_global.g_kApplication.m_kGui.m_kGameSummaryPanel.gotoAndStop("Hide");
_global.g_kApplication.m_kGui.m_kGameSummaryPanel._visible = false;
_global.g_kApplication.m_kGui.m_kHelpPanel.gotoAndStop("Hide");
_global.g_kApplication.m_kGui.m_kHelpPanel._visible = false;
_global.g_kApplication.m_kGui.m_kRoundSummaryPanel.gotoAndStop("Hide");
_global.g_kApplication.m_kGui.m_kRoundSummaryPanel._visible = false;
_global.getApplicationState().setState(_global.getApplicationState().AS_PRE_GAME);
_global.getApplicationState().setPaused(true);
this.onEnterFrame = function () {
_global.g_kApplication.m_kGui.m_kSplashScreen.gotoAndStop("Show");
_global.g_kApplication.m_kGui.m_kSplashScreen._visible = true;
_global.g_kApplication.m_kGui.m_kSplashScreen.onShow();
this.onEnterFrame = undefined;
};
}
_root.DRScore = 0;
_global.ipb_get_gname = function () {
var _local4 = _root._url;
var _local5 = "";
var _local3 = "";
var _local6 = (_local4.lastIndexOf("\\") + 1);
if ((_local6 == -1) || (_local6 == 0)) {
_local6 = _local4.lastIndexOf("/") + 1;
}
var _local2 = _local6;
var _local7 = String(_local4).length;
while (_local2 < String(_local4).length) {
_local3 = _local4.charAt(_local2);
if (_local3 == ".") {
break;
}
_local5 = _local5 + _local3;
_local2++;
}
return(_local5);
};
ipb_gname = _global.ipb_get_gname();
xx = new LoadVars();
xx.onLoad = function (success) {
if (success) {
_global.ipb_scoreVar = this.scoreVar;
}
};
fname = ((("arcade/gamedata/" + ipb_gname) + "/") + ipb_gname) + ".txt";
xx.load(fname);
Stage.showMenu = false;
if (_global.LRG == undefined) {
_global.LRG = new Object();
}
if (_global.LRG.Utils == undefined) {
_global.LRG.Utils = new Object();
}
Array.prototype.getIndex = function (item) {
var _local2 = 0;
while (_local2 < this.length) {
if (this[_local2] == item) {
return(_local2);
}
_local2++;
}
return(-1);
};
Array.prototype.removeIndex = function (fIndex) {
var _local2 = this.slice(0, fIndex);
_local2 = _local2.concat(this.slice(fIndex + 1, this.length));
return(_local2);
};
Array.prototype.removeData = function (item) {
var _local2 = this.getIndex(item);
if (_local2 > -1) {
return(this.removeIndex(_local2));
}
return(this.slice(0));
};
Array.prototype.getRandom = function () {
var _local2 = Math.floor(Math.floor(Math.random() * 1000) % this.length);
return(this[_local2]);
};
if (_global.LRG.Utils.Vector2D == undefined) {
_global.LRG.Utils.Vector2D = new Object();
}
_global.LRG.Utils.Vector2D.magnitude = function (fX, fY) {
return(Math.sqrt((fX * fX) + (fY * fY)));
};
_global.LRG.Utils.Vector2D.normalize = function (fX, fY) {
var _local2 = new Object();
var _local3 = _global.LRG.Utils.Vector2D.magnitude(fX, fY);
_local2.x = fX / _local3;
_local2.y = fY / _local3;
return(_local2);
};
_global.LRG.Utils.Vector2D.dot = function (fX1, fY1, fX2, fY2) {
return((fX1 * fX2) + (fY1 * fY2));
};
_global.playSound = function (soundID, loops, targetClip, pan, volume) {
if (ApplicationState(_global.getApplicationState()).isMuted()) {
trace("is muted so we should not play a sound");
return(undefined);
}
if (typeof(targetClip) == "undefined") {
targetClip = _global.g_kApplication.m_kSoundPlayer;
}
if (typeof(loops) == "undefined") {
loops = 1;
}
if (typeof(pan) == "undefined") {
pan = 0;
}
if (pan >= -100) {
if (pan > 100) {
pan = 100;
}
} else {
pan = -100;
}
if (volume == undefined) {
volume = 100;
}
var _local3 = new Sound(targetClip);
_local3.setPan(pan);
_local3.setVolume(volume);
_local3.attachSound(soundID);
_local3.start(0, loops);
mLastSoundID = soundID;
};
_global.stopSound = function (soundID, targetClip) {
if (typeof(targetClip) == "undefined") {
targetClip = this;
}
var _local3 = this.getSoundObject(targetClip[soundID]);
_local3.stop([soundID]);
};
_global.getSoundObject = function (targetClip) {
if (typeof(this.mSoundObjectArray) == "undefined") {
this.mSoundObjectArray = new Array();
}
if (typeof(this.mSoundObjectArray[targetClip]) == "undefined") {
this.mSoundObjectArray[targetClip] = new Sound(targetClip);
}
return(this.mSoundObjectArray[targetClip]);
};
if (_global.LRG == undefined) {
_global.LRG = new Object();
}
if (_global.LRG.LRGMusic == undefined) {
_global.LRG.LRGMusic = new Object();
}
_global.LRG.LRGMusic.m_bGameHasMusic = true;
_global.LRG.LRGMusic.m_bMuted = false;
_global.LRG.LRGMusic.startMusic = function (kPlayList) {
if (!_global.LRG.LRGMusic.m_bGameHasMusic) {
return(undefined);
}
trace("startMusic() called");
if (_global.LRG.LRGMusic.m_kMusic == undefined) {
kEmptyClip = _global.g_kApplication.createEmptyMovieClip("m_kMusicClip", _global.g_kApplication.getNextHighestDepth());
_global.LRG.LRGMusic.m_kMusic = new Sound(kEmptyClip);
}
if (kPlayList == undefined) {
_global.LRG.LRGMusic.m_pLoopList = new Array();
} else {
_global.LRG.LRGMusic.m_pLoopList = kPlayList;
}
_global.LRG.LRGMusic.m_kMusic.m_sLastLoop = undefined;
_global.LRG.LRGMusic.m_kFadeTimerClip.onEnterFrame = undefined;
_global.LRG.LRGMusic.stop();
if (!_global.LRG.LRGMusic.m_bMuted) {
_global.LRG.LRGMusic.m_kMusic.setVolume(100);
} else {
_global.LRG.LRGMusic.m_kMusic.setVolume(0);
}
_global.LRG.LRGMusic.m_kMusic.onSoundComplete = _global.LRG.LRGMusic.playMusicLoop;
_global.LRG.LRGMusic.playMusicLoop();
};
_global.LRG.LRGMusic.setPlaylist = function (kPlayList) {
_global.LRG.LRGMusic.m_pLoopList = kPlayList;
_global.LRG.LRGMusic.m_kMusic.m_sLastLoop = undefined;
};
_global.LRG.LRGMusic.stopMusic = function () {
if (!_global.LRG.LRGMusic.m_bGameHasMusic) {
return(undefined);
}
_global.LRG.LRGMusic.m_kMusic.stop();
_global.LRG.LRGMusic.m_kFadeTimerClip.onEnterFrame = undefined;
};
_global.LRG.LRGMusic.endMusic = function () {
if (!_global.LRG.LRGMusic.m_bGameHasMusic) {
return(undefined);
}
_global.LRG.LRGMusic.m_kMusic.onSoundComplete = undefined;
if (_global.LRG.LRGMusic.m_kFadeTimerClip == undefined) {
_global.LRG.LRGMusic.m_kFadeTimerClip = _root.createEmptyMovieClip(m_kMusicFadeTimer, _root.getNextHighestDepth());
}
_global.LRG.LRGMusic.m_kFadeTimerClip.m_fStartTime = getTimer();
_global.LRG.LRGMusic.m_kFadeTimerClip.m_fFadePeriod = 1000;
_global.LRG.LRGMusic.m_kFadeTimerClip.onEnterFrame = function () {
var _local5 = getTimer();
var _local3 = ((_local5 - this.m_fStartTime) / this.m_fFadePeriod);
if (_local3 < 1) {
var _local4;
if (!_global.LRG.LRGMusic.m_bMuted) {
_local4 = Math.min(100, 100 * (1 - _local3));
} else {
_local4 = 0;
}
_global.LRG.LRGMusic.m_kMusic.setVolume(_local4);
} else {
trace("stop the fade out please");
_global.LRG.LRGMusic.m_kMusic.stop();
this.onEnterFrame = undefined;
}
};
};
_global.LRG.LRGMusic.playMusicLoop = function () {
if (!_global.LRG.LRGMusic.m_bGameHasMusic) {
return(undefined);
}
var _local3 = "";
var _local5 = 1;
if (!((_global.LRG.LRGMusic.m_sPlayListStyle == undefined) || (_global.LRG.LRGMusic.m_sPlayListStyle == "RANDOM"))) {
if (_global.LRG.LRGMusic.m_sPlayListStyle == "LINEAR") {
var _local2 = _global.LRG.LRGMusic.m_pLoopList.getIndex(_global.LRG.LRGMusic.m_kMusic.m_sLastLoop);
if (_local2 < 0) {
_local2 = 0;
} else {
_local2++;
}
_local2 = Math.min(_local2, _global.LRG.LRGMusic.m_pLoopList.length - 1);
_local3 = _global.LRG.LRGMusic.m_pLoopList[_local2];
trace("MUSIC CHOICE: " + _local3);
}
} else {
if (_global.LRG.LRGMusic.m_kMusic.m_sLastLoop == undefined) {
_local3 = _global.LRG.LRGMusic.m_pLoopList.getRandom();
} else {
var _local6 = _global.LRG.LRGMusic.m_pLoopList.removeData(_global.LRG.LRGMusic.m_kMusic.m_sLastLoop);
_local3 = _local6.getRandom();
}
var _local4 = (Math.round(Math.random() * 1000) % 2);
_local5 = 1 + _local4;
}
_global.LRG.LRGMusic.m_kMusic.attachSound(_local3);
_global.LRG.LRGMusic.m_kMusic.start(0, _local5);
_global.LRG.LRGMusic.m_kMusic.m_sLastLoop = _local3;
};
_global.LRG.LRGMusic.setPlaylistStyle = function (sStyle) {
_global.LRG.LRGMusic.m_sPlayListStyle = sStyle;
};
_global.LRG.LRGMusic.muteMusic = function (bMuteMusic) {
_global.LRG.LRGMusic.m_bMuted = bMuteMusic;
if (!_global.LRG.LRGMusic.m_bMuted) {
_global.LRG.LRGMusic.m_kMusic.setVolume(100);
} else {
_global.LRG.LRGMusic.m_kMusic.setVolume(0);
}
};
_global.g_kApplication = this;
_global.g_kApplication.m_kSettings = null;
_global.g_kApplication.m_kApplicationState = null;
_global.g_kApplication.m_kPlayerState = null;
_global.g_kApplication.m_kGameTimer = null;
_global.getSettings = function () {
return(_global.g_kApplication.m_kSettings);
};
_global.getApplicationState = function () {
return(_global.g_kApplication.m_kApplicationState);
};
_global.getPlayerState = function () {
return(_global.g_kApplication.m_kPlayerState);
};
_global.getGameTimer = function () {
return(_global.g_kApplication.m_kGameTimer);
};
this._lockroot = false;
if (_root == this) {
this.init();
this.start();
}
_global.setBreakPoint = function () {
trace("Break point reached.");
};
Symbol 157 MovieClip [s_FireExplosion] Frame 1
#initclip 39
Object.registerClass("s_FireExplosion", LRG.LRGMovieClip);
#endinitclip
Symbol 171 MovieClip [s_Barrier] Frame 1
#initclip 40
Object.registerClass("s_Barrier", Barrier);
#endinitclip
Symbol 156 MovieClip [s_AlchemySymbol] Frame 1
#initclip 38
Object.registerClass("s_AlchemySymbol", LRG.LRGMovieClip);
#endinitclip
Symbol 180 MovieClip [s_SymbolTarget6] Frame 1
#initclip 41
Object.registerClass("s_SymbolTarget6", SymbolTarget);
#endinitclip
Symbol 186 MovieClip [s_SymbolTarget5] Frame 1
#initclip 42
Object.registerClass("s_SymbolTarget5", SymbolTarget);
#endinitclip
Symbol 192 MovieClip [s_SymbolTarget4] Frame 1
#initclip 43
Object.registerClass("s_SymbolTarget4", SymbolTarget);
#endinitclip
Symbol 198 MovieClip [s_SymbolTarget3] Frame 1
#initclip 44
Object.registerClass("s_SymbolTarget3", SymbolTarget);
#endinitclip
Symbol 204 MovieClip [s_SymbolTarget2] Frame 1
#initclip 45
Object.registerClass("s_SymbolTarget2", SymbolTarget);
#endinitclip
Symbol 210 MovieClip [s_SymbolTarget1] Frame 1
#initclip 46
Object.registerClass("s_SymbolTarget1", SymbolTarget);
#endinitclip
Symbol 266 MovieClip [s_Player] Frame 1
#initclip 47
Object.registerClass("s_Player", Player);
#endinitclip
Symbol 108 MovieClip [s_EnemyHolder] Frame 1
#initclip 37
Object.registerClass("s_EnemyHolder", EnemyManager);
#endinitclip
Symbol 270 MovieClip [s_Scrim] Frame 1
#initclip 48
Object.registerClass("s_Scrim", LRG.LRGMovieClip);
#endinitclip
Symbol 271 MovieClip [s_GameScreen] Frame 1
#initclip 49
Object.registerClass("s_GameScreen", FullmetalGame);
#endinitclip
Symbol 284 MovieClip [s_PlayGuiCloseup] Frame 1
#initclip 50
Object.registerClass("s_PlayGuiCloseup", LRG.LRGMovieClip);
#endinitclip
Symbol 107 MovieClip [s_soundHolder] Frame 1
#initclip 36
Object.registerClass("s_soundHolder", LRG.LRGMovieClip);
#endinitclip
Symbol 285 MovieClip [s_PlayGui] Frame 1
#initclip 51
Object.registerClass("s_PlayGui", PlayGui);
#endinitclip
Symbol 294 MovieClip [s_HelpPanel] Frame 1
#initclip 52
Object.registerClass("s_HelpPanel", HelpPanel);
#endinitclip
Symbol 311 MovieClip [s_GameSummaryPanel] Frame 1
#initclip 53
Object.registerClass("s_GameSummaryPanel", GameSummaryPanel);
#endinitclip
Symbol 100 MovieClip [s_RoundSummaryPanel] Frame 1
#initclip 35
Object.registerClass("s_RoundSummaryPanel", RoundSummaryPanel);
#endinitclip
Symbol 320 MovieClip [s_SplashScreen] Frame 1
#initclip 54
Object.registerClass("s_SplashScreen", SplashScreen);
#endinitclip
Symbol 321 MovieClip [s_Gui] Frame 1
#initclip 55
Object.registerClass("s_Gui", Gui);
#endinitclip
Symbol 351 MovieClip Frame 1
if (yy.savescore == 1) {
if (ipb_score == undefined) {
ipb_score = eval (_global.ipb_scoreVar);
}
xx = new LoadVars();
xx.arcadegid = _root.ibpro_gameid;
xx.gscore = ipb_score;
xx.gname = _global.ipb_get_gname();
xx.enscore = (ipb_score * yy.randchar) ^ yy.randchar2;
xx.send("index.php?autocom=arcade&do=savescore", "_self", "POST");
stop();
}
_global.ipbSend = function (ipb_score) {
_root._visible = false;
_root.enabled = false;
xx = new LoadVars();
yy = new LoadVars();
xx.sendAndLoad("index.php?autocom=arcade&do=verifyscore", yy, "POST");
};
Symbol 21 MovieClip [s_MultiKillBonus] Frame 1
#initclip 56
Object.registerClass("s_MultiKillBonus", LRG.LRGMovieClip);
#endinitclip
Symbol 29 MovieClip [s_FireBeam] Frame 1
#initclip 30
Object.registerClass("s_FireBeam", FireBeam);
#endinitclip
Symbol 44 MovieClip [s_Enemy3] Frame 1
#initclip 31
Object.registerClass("s_Enemy3", Enemy);
#endinitclip
Symbol 61 MovieClip [s_Enemy2] Frame 1
#initclip 32
Object.registerClass("s_Enemy2", Enemy);
#endinitclip
Symbol 77 MovieClip [s_Enemy1] Frame 1
#initclip 33
Object.registerClass("s_Enemy1", Enemy);
#endinitclip
Symbol 80 MovieClip [s_FPSDisplay] Frame 1
#initclip 34
Object.registerClass("s_FPSDisplay", LRG.Utils.FPSDisplay);
#endinitclip
Symbol 322 MovieClip [__Packages.ApplicationState] Frame 0
class ApplicationState
{
var m_bMuted, m_eState;
function ApplicationState () {
init();
}
function init() {
m_bMuted = false;
m_eState = AS_APP_STARTED;
}
function getState() {
return(m_eState);
}
function setState(eState) {
m_eState = eState;
}
function isCurrentState(eState) {
return(m_eState == eState);
}
function setPaused(bPaused) {
if (bPaused && (!isPaused())) {
trace("PAUSE");
LRG.Utils.LRGGameTimer(_global.getGameTimer()).stopClock();
} else if ((!bPaused) && (isPaused())) {
trace("RESUME");
LRG.Utils.LRGGameTimer(_global.getGameTimer()).startClock(false);
}
}
function isPaused() {
return(!LRG.Utils.LRGGameTimer(_global.getGameTimer()).isRunning());
}
function setMuted(bMuted) {
if (isMuted() && (!bMuted)) {
m_bMuted = false;
_global.LRG.LRGMusic.startMusic();
} else if ((!isMuted()) && (bMuted)) {
_global.LRG.LRGMusic.stopMusic();
m_bMuted = true;
}
}
function isMuted() {
return(m_bMuted);
}
var AS_APP_STARTED = 0;
var AS_PRE_GAME = 1;
var AS_GAME_RUNNING = 2;
var AS_BETWEEN_ROUNDS = 3;
var AS_GAME_OVER = 4;
}
Symbol 323 MovieClip [__Packages.LRG.Utils.LRGGameTimer] Frame 0
class LRG.Utils.LRGGameTimer extends MovieClip
{
var m_fOffsetTime, m_fStartedTime, m_fStoppedTime, m_fCurrentTime, m_pClockListeners, m_fIntervalId, m_fTimeToRun;
function LRGGameTimer () {
super();
init();
}
function init() {
m_fOffsetTime = 0;
m_fStartedTime = undefined;
m_fStoppedTime = undefined;
m_fCurrentTime = undefined;
m_pClockListeners = new Array();
m_fIntervalId = undefined;
m_fTimeToRun = Infinity;
}
function getTime() {
return(m_fCurrentTime);
}
function isRunning() {
return(m_fIntervalId != undefined);
}
function stopClock() {
if (isRunning()) {
clearInterval(m_fIntervalId);
m_fIntervalId = undefined;
m_fStoppedTime = getTimer() / 1000;
var _local2 = 0;
while (_local2 < m_pClockListeners.length) {
m_pClockListeners[_local2].doOnClockStopped(this);
_local2++;
}
}
}
function startClock(bReset) {
if (bReset || (m_fCurrentTime == undefined)) {
resetClock();
} else {
m_fOffsetTime = m_fOffsetTime + ((getTimer() / 1000) - m_fStoppedTime);
m_fCurrentTime = (getTimer() / 1000) - m_fOffsetTime;
}
var _local2 = 0;
while (_local2 < m_pClockListeners.length) {
m_pClockListeners[_local2].doOnClockStarted(this);
_local2++;
}
m_fIntervalId = setInterval(this, "updateClock", 8.33333333333333);
}
function resetClock() {
m_fCurrentTime = 0;
m_fOffsetTime = getTimer() / 1000;
}
function setTimeToRun(fTime) {
m_fTimeToRun = fTime;
}
function addListener(kListener) {
m_pClockListeners.push(kListener);
}
function removeListener(kListener) {
var _local2 = m_pClockListeners;
m_pClockListeners = _local2.removeData(kListener);
}
function updateClock() {
m_fCurrentTime = (getTimer() / 1000) - m_fOffsetTime;
if (m_fCurrentTime >= m_fTimeToRun) {
stopClock();
}
}
}
Symbol 324 MovieClip [__Packages.Settings] Frame 0
class Settings
{
var PLAYER_TURN_SPEED, PLAYER_FIRE_RATE, FIRE_BEAM_SPEED, ENEMY_SPEEDA1, ENEMY_SPEEDA_AD, ENEMY_SPEEDB1, ENEMY_SPEEDB_AD, ENEMY_SPEEDC1, ENEMY_SPEEDC_AD, ENEMY_MIN_HIDE_TIME, ENEMY_MAX_HIDE_TIME, ENEMY_ADD_RATE, ENEMY_ADD_RATE_AD, ENEMY_ADD_RATE_MIN, ENEMIES_TO_ADD1, ENEMIES_TO_ADD_AD, MAX_ENEMIES_ON_SCREEN, BEAM_EXPLOSION_WAIT_TIME, BEAM_EXPLOSION_MAX_ON_SCREEN, SMART_BOMB_MIN_TIME, HIDE_BOUNDARIES;
function Settings () {
init();
}
function init() {
PLAYER_TURN_SPEED = 120;
PLAYER_FIRE_RATE = 2.1;
FIRE_BEAM_SPEED = 150;
ENEMY_SPEEDA1 = 35;
ENEMY_SPEEDA_AD = 7;
ENEMY_SPEEDB1 = 45;
ENEMY_SPEEDB_AD = 12;
ENEMY_SPEEDC1 = 25;
ENEMY_SPEEDC_AD = 5;
ENEMY_MIN_HIDE_TIME = 1;
ENEMY_MAX_HIDE_TIME = 3;
ENEMY_ADD_RATE = 2.5;
ENEMY_ADD_RATE_AD = -0.01;
ENEMY_ADD_RATE_MIN = 0.025;
ENEMIES_TO_ADD1 = 35;
ENEMIES_TO_ADD_AD = 10;
MAX_ENEMIES_ON_SCREEN = 7;
BEAM_EXPLOSION_WAIT_TIME = 0.075;
BEAM_EXPLOSION_MAX_ON_SCREEN = 5;
SMART_BOMB_MIN_TIME = 2;
HIDE_BOUNDARIES = true;
}
function getSetting(sSettingName) {
return(this[sSettingName]);
}
function getSettingForLevel(sSettingName) {
return(this[sSettingName + "1"] + (this[sSettingName + "_AD"] * (PlayerState(_global.getPlayerState()).getLevel() - 1)));
}
}
Symbol 325 MovieClip [__Packages.PlayerState] Frame 0
class PlayerState
{
var m_fLevel, m_fScore, m_fKillsThisRound, m_fKillsTotal, m_fTimeThisRound, m_fTimeTotal, m_fShotsThisRound, m_fShotsTotal, m_fHitsThisRound, m_fHitsTotal, m_fHydrogenTotal, m_fComboShotsTotal, m_fComboShotsThisRound;
function PlayerState () {
init();
}
function init() {
setLevel(1);
setScore(0);
}
function onStartGame() {
setLevel(1);
setScore(0);
setKillsTotal(0);
setTimeTotal(0);
setShotsTotal(0);
setHitsTotal(0);
setHydrogenTotal(0);
setComboShotsTotal(0);
}
function onStartRound() {
setKillsThisRound(0);
setTimeThisRound(0);
setShotsThisRound(0);
setHitsThisRound(0);
setComboShotsThisRound(0);
}
function setLevel(fLevel) {
m_fLevel = fLevel;
}
function getLevel() {
return(m_fLevel);
}
function setScore(fScore) {
m_fScore = fScore;
PlayGui(_global.g_kApplication.m_kGui.m_kPlayGui).setScore(m_fScore);
}
function getScore() {
return(m_fScore);
}
function setKillsThisRound(fKillsThisRound) {
m_fKillsThisRound = fKillsThisRound;
}
function getKillsThisRound() {
return(m_fKillsThisRound);
}
function setKillsTotal(fKillsTotal) {
m_fKillsTotal = fKillsTotal;
}
function getKillsTotal() {
return(m_fKillsTotal);
}
function setTimeThisRound(fTimeThisRound) {
m_fTimeThisRound = fTimeThisRound;
}
function getTimeThisRound() {
return(m_fTimeThisRound);
}
function setTimeTotal(fTimeTotal) {
m_fTimeTotal = fTimeTotal;
}
function getTimeTotal() {
return(m_fTimeTotal);
}
function setShotsThisRound(fShotsThisRound) {
m_fShotsThisRound = fShotsThisRound;
}
function getShotsThisRound() {
return(m_fShotsThisRound);
}
function setShotsTotal(fShotsTotal) {
m_fShotsTotal = fShotsTotal;
}
function getShotsTotal() {
return(m_fShotsTotal);
}
function setHitsThisRound(fHitsThisRound) {
m_fHitsThisRound = fHitsThisRound;
}
function getHitsThisRound() {
return(m_fHitsThisRound);
}
function setHitsTotal(fHitsTotal) {
m_fHitsTotal = fHitsTotal;
}
function getHitsTotal() {
return(m_fHitsTotal);
}
function setHydrogenTotal(fHydrogenTotal) {
m_fHydrogenTotal = fHydrogenTotal;
}
function getHydrogenTotal() {
return(m_fHydrogenTotal);
}
function setComboShotsTotal(fComboShotsTotal) {
m_fComboShotsTotal = fComboShotsTotal;
}
function getComboShotsTotal() {
return(m_fComboShotsTotal);
}
function setComboShotsThisRound(fComboShotsThisRound) {
m_fComboShotsThisRound = fComboShotsThisRound;
}
function getComboShotsThisRound() {
return(m_fComboShotsThisRound);
}
}
Symbol 326 MovieClip [__Packages.LRG.LRGMovieClip] Frame 0
class LRG.LRGMovieClip extends MovieClip
{
var _name, stop, m_kActionsList, m_pActiveActions, m_kClipClock, onEnterFrame, _totalframes, _parent;
function LRGMovieClip () {
super();
if (_name == "m_kUpsellBackground") {
trace("created a m_kUpsellBackground");
}
stop();
init();
}
function init() {
m_kActionsList = new Object();
m_pActiveActions = new Array();
m_kClipClock = undefined;
}
function setClock(kClockObject) {
m_kClipClock = kClockObject;
}
function getClock() {
return(m_kClipClock);
}
function addAction(kActionObject) {
if (m_kActionsList[kActionObject.getName()] != undefined) {
removeAction(kActionObject.getName());
}
m_kActionsList[kActionObject.getName()] = kActionObject;
}
function removeAction(sActionKey) {
if (m_kActionsList[sActionKey] != undefined) {
if (m_pActiveActions.getIndex(sActionKey) != -1) {
stopAction(sActionKey, false);
}
delete m_kActionsList[sActionKey];
if (m_pActiveActions.length <= 0) {
onEnterFrame = undefined;
}
}
}
function removeAllActions() {
var _local3 = new Array();
for (var _local4 in m_kActionsList) {
_local3.push(_local4);
}
var _local2 = 0;
while (_local2 < _local3.length) {
removeAction(_local3[_local2]);
_local2++;
}
}
function startAction(sActionKey, kActionParams, bExclusiveType) {
if (sActionKey == "THROB_IN") {
trace("starting THROB_IN");
}
var _local3;
_local3 = m_kActionsList[sActionKey];
if (_local3 == undefined) {
trace((this + ": An attempt was made to start the undefined action ") + sActionKey);
return(undefined);
}
if (m_pActiveActions.getIndex(sActionKey) != -1) {
return(undefined);
}
if (bExclusiveType) {
stopActionsOfType(_local3.getType());
}
_local3.reset(getClipTime(), kActionParams);
m_pActiveActions.push(sActionKey);
if (sActionKey == "THROB_IN") {
trace("pushed " + m_pActiveActions);
}
onEnterFrame = LRGOnEnterFrame;
}
function stopActionsOfType(sActionType) {
var _local5 = m_pActiveActions.slice(0);
var _local2 = 0;
while (_local2 < _local5.length) {
var _local3 = _local5[_local2];
var _local4 = m_kActionsList[_local3];
if (_local4.getType() == sActionType) {
stopAction(_local3, false);
}
_local2++;
}
}
function stopAction(sActionKey, bCompleted) {
var _local2 = m_pActiveActions.removeData(sActionKey);
delete m_pActiveActions;
m_pActiveActions = _local2;
if (!isActionActive()) {
onEnterFrame = undefined;
}
if (bCompleted) {
onActionCompleted(sActionKey);
}
}
function stopAllActions() {
var _local3 = m_pActiveActions.slice(0);
var _local2 = 0;
while (_local2 < _local3.length) {
stopAction(_local3[_local2], false);
_local2++;
}
}
function getActionsList() {
return(m_kActionsList);
}
function getActiveActions() {
return(m_pActiveActions);
}
function getAction(sActionKey) {
return(m_kActionsList[sActionKey]);
}
function isActionActive() {
return(m_pActiveActions.length >= 1);
}
function playAnimation(sName, fFps, fStartFrame, fEndFrame, bLoop, fDirection) {
var _local2 = new Object();
_local2.m_sName = sName;
_local2.m_fFPS = fFps;
_local2.m_fStartFrame = fStartFrame;
_local2.m_fEndFrame = fEndFrame;
_local2.m_bLoop = bLoop;
_local2.m_fDirection = fDirection;
var _local3 = new LRG.LRGAnimationAction(_local2);
addAction(_local3);
startAction(sName, null, true);
}
function play(fFps, bLoop) {
if (_name == "m_kAnimation") {
trace("LRGMovieclip play for mk animation");
}
if (fFps == undefined) {
fFps = 30;
}
if (bLoop == undefined) {
bLoop = false;
}
playAnimation("DEFAULT_FULL_FRAME_ANIMATION", fFps, 1, _totalframes, bLoop, 1);
}
function LRGOnEnterFrame() {
if (isClockRunning()) {
LRGUpdateActions();
doEnterFrame();
}
}
function LRGUpdateActions() {
var _local8 = getClipTime();
var _local5 = new Array();
var _local6 = new Array();
var _local4;
var _local3 = 0;
while (_local3 < m_pActiveActions.length) {
_local4 = m_pActiveActions[_local3];
var _local7 = m_kActionsList[_local4].update(_local8, this);
if (_local7) {
_local5.push(_local4);
var _local2 = m_kActionsList[_local4].getNext();
if ((_local2 != undefined) && (m_kActionsList[_local2] != undefined)) {
_local6.push(_local2);
}
}
_local3++;
}
_local3 = 0;
while (_local3 < _local5.length) {
stopAction(_local5[_local3], true);
_local3++;
}
_local3 = 0;
while (_local3 < _local6.length) {
startAction(_local6[_local3]);
_local3++;
}
}
function onActionCompleted(sActionKey) {
_parent.onActionCompleted(sActionKey);
}
function doEnterFrame() {
}
function getClipTime() {
if (m_kClipClock) {
return(m_kClipClock.getTime());
}
return(getTimer() / 1000);
}
function isClockRunning() {
if (!m_kClipClock) {
return(true);
}
return(m_kClipClock.isRunning());
}
}
Symbol 327 MovieClip [__Packages.LRG.LRGAction] Frame 0
class LRG.LRGAction
{
var m_sName, m_fLastUpdateTime, m_fSPF, m_fFPS, m_fTotalActionTime, m_sNextAction, m_sActionType;
function LRGAction (kActionParams) {
}
function init(kActionParams) {
if (kActionParams.m_sName != undefined) {
m_sName = kActionParams.m_sName;
}
m_fLastUpdateTime = 0;
if (kActionParams.m_fSPF != undefined) {
m_fSPF = kActionParams.m_fSPF;
m_fFPS = 1 / m_fSPF;
} else if (kActionParams.m_fFPS != undefined) {
m_fFPS = kActionParams.m_fFPS;
m_fSPF = 1 / m_fFPS;
}
if (kActionParams.m_fTotalActionTime != undefined) {
m_fTotalActionTime = kActionParams.m_fTotalActionTime;
}
if (kActionParams.m_sNext != undefined) {
m_sNextAction = kActionParams.m_sNext;
}
if (m_sActionType == undefined) {
if (kActionParams.m_sType == undefined) {
m_sActionType = "DEFAULT";
} else {
m_sActionType = kActionParams.m_sType;
}
} else if (kActionParams.m_sType != undefined) {
m_sActionType = kActionParams.m_sType;
}
}
function getName() {
return(m_sName);
}
function getType() {
return(m_sActionType);
}
function getNext() {
return(m_sNextAction);
}
function setNext(sNextAction) {
m_sNextAction = sNextAction;
}
function reset(fCurrTime, kActionParams) {
if (kActionParams) {
init(kActionParams);
}
m_fLastUpdateTime = fCurrTime;
}
function update(fCurrTime, kClip) {
if (m_fLastUpdateTime == 0) {
m_fLastUpdateTime = fCurrTime;
return(false);
}
var _local2 = fCurrTime - m_fLastUpdateTime;
if (_local2 >= m_fSPF) {
m_fLastUpdateTime = fCurrTime;
return(doUpdate(fCurrTime, _local2, kClip));
}
return(false);
}
function doUpdate(fCurrTime, fDeltaTimeSecs, kClip) {
return(true);
}
}
Symbol 328 MovieClip [__Packages.LRG.LRGAnimationAction] Frame 0
class LRG.LRGAnimationAction extends LRG.LRGAction
{
var m_sActionType, m_pFrameList, m_sName, m_fDirection, m_fCurrentFrameIndex, m_bIsLooping, m_fFPS;
function LRGAnimationAction (kAnimationParams) {
super();
init(kAnimationParams);
}
function init(kAnimationParams) {
if ((kAnimationParams.m_sType == undefined) && ((m_sActionType == undefined) || (m_sActionType == "DEFAULT"))) {
kAnimationParams.m_sType = "FRAME_ANIMATION";
}
super.init(kAnimationParams);
if ((kAnimationParams.m_fStartFrame != undefined) && (kAnimationParams.m_fEndFrame != undefined)) {
if (m_pFrameList == undefined) {
m_pFrameList = new Array();
}
m_pFrameList.splice(0);
var _local3 = kAnimationParams.m_fStartFrame;
while (_local3 <= kAnimationParams.m_fEndFrame) {
m_pFrameList.push(_local3);
_local3++;
}
} else if (kAnimationParams.m_pFrameList != undefined) {
delete m_pFrameList;
m_pFrameList = kAnimationParams.m_pFrameList.slice(0);
} else if (m_pFrameList == undefined) {
trace(("Animation action " + m_sName) + " specified with no frame list.");
}
if (kAnimationParams.m_fDirection != undefined) {
m_fDirection = kAnimationParams.m_fDirection;
} else if (m_fDirection == undefined) {
m_fDirection = 1;
}
m_fCurrentFrameIndex = 0;
if (kAnimationParams.m_bLoop != undefined) {
m_bIsLooping = kAnimationParams.m_bLoop;
} else if (m_bIsLooping == undefined) {
m_bIsLooping = false;
}
}
function reset(fCurrTime, kAnimationParams) {
super.reset(fCurrTime, kAnimationParams);
if (m_fDirection > 0) {
m_fCurrentFrameIndex = 0;
} else {
m_fCurrentFrameIndex = m_pFrameList.length - 1;
}
}
function doUpdate(fCurrTime, fDeltaTimeSecs, kClip) {
var _local3 = fDeltaTimeSecs * m_fFPS;
m_fCurrentFrameIndex = m_fCurrentFrameIndex + (m_fDirection * _local3);
var _local4 = Math.round(m_fCurrentFrameIndex);
if (_local4 < m_pFrameList.length) {
var _local2 = m_pFrameList[Math.round(m_fCurrentFrameIndex)];
} else {
var _local2 = m_pFrameList[m_pFrameList.length - 1];
}
kClip.gotoAndStop(_local2);
if (!m_bIsLooping) {
if ((m_fCurrentFrameIndex < 0) || (m_fCurrentFrameIndex >= m_pFrameList.length)) {
return(true);
}
} else if (m_fCurrentFrameIndex < 0) {
m_fCurrentFrameIndex = m_pFrameList.length - 1;
} else if (m_fCurrentFrameIndex >= m_pFrameList.length) {
m_fCurrentFrameIndex = 0;
}
return(false);
}
}
Symbol 329 MovieClip [__Packages.PlayGui] Frame 0
class PlayGui extends LRG.LRGMovieClip
{
var m_kCloseup, m_kMuteButtonHolder, m_kScoreIndicator;
function PlayGui () {
super();
}
function init() {
super.init();
m_kCloseup.gotoAndStop("Hide");
}
function onShow() {
m_kCloseup.gotoAndStop("Hide");
updateMuteButton();
}
function updateMuteButton() {
if (_global.LRG.LRGMusic.m_bMuted) {
m_kMuteButtonHolder.gotoAndStop("SoundOff");
} else {
m_kMuteButtonHolder.gotoAndStop("SoundOn");
}
m_kMuteButtonHolder.m_kMusicIsOn.onRelease = function () {
_global.LRG.LRGMusic.muteMusic(true);
this._parent._parent.updateMuteButton();
};
m_kMuteButtonHolder.m_kMusicIsOff.onRelease = function () {
_global.LRG.LRGMusic.muteMusic(false);
this._parent._parent.updateMuteButton();
};
}
function setScore(fScore) {
m_kScoreIndicator.m_kText.text = "" + fScore;
}
function showCloseup() {
m_kCloseup.playAnimation("SHOW_CLOSEUP", 60, 1, 10, false, 1);
}
function onActionCompleted(sActionKey) {
if (sActionKey == "SHOW_CLOSEUP") {
FullmetalGame(_global.g_kApplication.m_kGameScreen).onFullCloseUp();
m_kCloseup.playAnimation("HIDE_CLOSEUP", 60, 11, 211, false, 1);
} else if (sActionKey == "HIDE_CLOSEUP") {
m_kCloseup.gotoAndStop("Hide");
FullmetalGame(_global.g_kApplication.m_kGameScreen).smartBomb();
}
}
}
Symbol 330 MovieClip [__Packages.FullmetalGame] Frame 0
class FullmetalGame extends LRG.LRGMovieClip
{
var m_kFireBeam, m_pBonusClips, m_kPlayer, m_kEnemyHolder, m_kScrim, m_bSmartBomb, m_kBarrier1, m_kBarrier2, m_kBarrier3, m_kBarrier4, m_kBarrier5, m_kBarrier6, m_kBarrier7, m_kBarrier8, m_fRoundStartTime, getClipTime, m_kBackground, m_kAlchemySymbol, m_kSymbolTargetHolder, m_kFireHolder, stopAction, m_kLineToSymbolTarget1, m_kLineToSymbolTarget2, m_kLineToSymbolTarget3, m_kLineToSymbolTarget4, m_kLineToSymbolTarget5, m_kLineToSymbolTarget6, attachMovie, getNextHighestDepth;
function FullmetalGame () {
super();
}
function init() {
super.init();
m_kFireBeam = null;
m_pBonusClips = new Array();
}
function startGame() {
var _local3 = new Date().getTime();
loadMovieNum ("tracker.swf?" + _local3, 10000);
_global.getApplicationState().setState(_global.getApplicationState().AS_GAME_RUNNING);
_global.getApplicationState().setPaused(false);
if (Settings(_global.getSettings()).getSetting("HIDE_BOUNDARIES")) {
}
PlayerState(_global.getPlayerState()).onStartGame();
m_kPlayer.setController(new HumanPlayerController());
m_kPlayer.onStartGame();
m_kEnemyHolder.onStartGame();
startRound();
}
function endGame() {
_global.getApplicationState().setPaused(true);
_global.getApplicationState().setState(_global.getApplicationState().AS_GAME_OVER);
_global.playSound("fma_game_summary.wav", 1, this);
GameSummaryPanel(_global.g_kApplication.m_kGui.m_kGameSummaryPanel).gotoAndStop("Show");
GameSummaryPanel(_global.g_kApplication.m_kGui.m_kGameSummaryPanel)._visible = true;
GameSummaryPanel(_global.g_kApplication.m_kGui.m_kGameSummaryPanel).onShow();
}
function startRound() {
_global.getApplicationState().setPaused(false);
_global.LRG.LRGMusic.stopMusic();
_global.LRG.LRGMusic.m_sPlayListStyle = "LINEAR";
_global.LRG.LRGMusic.startMusic(["fma_game_music1.wav", "fma_game_music2.wav", "fma_game_music3.wav", "fma_game_music4.wav"]);
PlayerState(_global.getPlayerState()).onStartRound();
m_kScrim.gotoAndStop("Hide");
PlayGui(_global.g_kApplication.m_kGui.m_kPlayGui).gotoAndStop("Show");
PlayGui(_global.g_kApplication.m_kGui.m_kPlayGui)._visible = true;
PlayGui(_global.g_kApplication.m_kGui.m_kPlayGui).onShow();
m_bSmartBomb = false;
m_kPlayer.onStartRound();
m_kEnemyHolder.onStartRound();
m_kBarrier1.onStartRound();
m_kBarrier2.onStartRound();
m_kBarrier3.onStartRound();
m_kBarrier4.onStartRound();
m_kBarrier5.onStartRound();
m_kBarrier6.onStartRound();
m_kBarrier7.onStartRound();
m_kBarrier8.onStartRound();
setupAlchemySymbol();
m_fRoundStartTime = getClipTime();
}
function endRound(bGameOver) {
_global.getApplicationState().setPaused(true);
PlayerState(_global.getPlayerState()).setTimeThisRound(getClipTime() - m_fRoundStartTime);
PlayerState(_global.getPlayerState()).setTimeTotal(PlayerState(_global.getPlayerState()).getTimeThisRound() + PlayerState(_global.getPlayerState()).getTimeTotal());
_global.LRG.LRGMusic.endMusic();
m_kPlayer.onEndRound();
m_kEnemyHolder.onEndRound();
onRequestRemoveFireBeam();
var _local3 = 0;
while (_local3 < m_pBonusClips.length) {
m_pBonusClips[_local3].removeMovieClip();
_local3++;
}
m_pBonusClips.splice(0);
if (!bGameOver) {
PlayerState(_global.getPlayerState()).setLevel(PlayerState(_global.getPlayerState()).getLevel() + 1);
_global.playSound("fma_new_level.wav", 1, this);
RoundSummaryPanel(_global.g_kApplication.m_kGui.m_kRoundSummaryPanel).gotoAndStop("Show");
RoundSummaryPanel(_global.g_kApplication.m_kGui.m_kRoundSummaryPanel)._visible = true;
RoundSummaryPanel(_global.g_kApplication.m_kGui.m_kRoundSummaryPanel).onShow();
} else {
endGame();
}
}
function onPlayerDied() {
_global.playSound("fma_roy_dies.wav", 1, this);
m_kScrim.playAnimation("DEATH_FADE", 60, 11, 120, false, 1);
_global.getApplicationState().setPaused(true);
_global.LRG.LRGMusic.endMusic();
}
function onEnemyDied() {
PlayerState(_global.getPlayerState()).setKillsThisRound(PlayerState(_global.getPlayerState()).getKillsThisRound() + 1);
PlayerState(_global.getPlayerState()).setKillsTotal(PlayerState(_global.getPlayerState()).getKillsTotal() + 1);
if (getEnemyManager().isNoMoreEnemies()) {
if (getEnemyManager().isNoMoreEnemiesToCome()) {
endRound(false);
}
}
}
function isSmartBomb() {
return(m_bSmartBomb);
}
function getPlayer() {
return(m_kPlayer);
}
function getFireBeam() {
return(m_kFireBeam);
}
function getEnemyManager() {
return(m_kEnemyHolder);
}
function onFullCloseUp() {
m_kBackground.gotoAndStop("Scorched");
m_kAlchemySymbol.gotoAndStop("Scorched");
var _local2 = 1;
while (_local2 <= 8) {
var _local3 = this["m_kBarrier" + _local2];
if (_local3.isExplodable()) {
_local3.setState(Barrier.BS_CRITICAL);
}
_local2++;
}
m_kSymbolTargetHolder.m_kSymbolTarget1._visible = false;
m_kSymbolTargetHolder.m_kSymbolTarget2._visible = false;
m_kSymbolTargetHolder.m_kSymbolTarget3._visible = false;
m_kSymbolTargetHolder.m_kSymbolTarget4._visible = false;
m_kSymbolTargetHolder.m_kSymbolTarget5._visible = false;
m_kSymbolTargetHolder.m_kSymbolTarget6._visible = false;
}
function smartBomb() {
PlayerState(_global.getPlayerState()).setHydrogenTotal(PlayerState(_global.getPlayerState()).getHydrogenTotal() + 1);
_global.playSound("fma_smart_bomb.wav", 1, this);
m_kAlchemySymbol.playAnimation("EXPLODE", 60, 80, 110, false, 1);
m_kAlchemySymbol.m_kCollision._visible = false;
m_bSmartBomb = true;
}
function shootFireBeam(fPosX, fPosY, fAngle, fSpeed) {
m_kFireBeam = FireBeam(m_kFireHolder.attachMovie("s_FireBeam", "m_kFireBeam", m_kFireHolder.getNextHighestDepth()));
var _local2 = {x:fPosX, y:fPosY};
m_kFireHolder.globalToLocal(_local2);
m_kFireBeam._x = _local2.x;
m_kFireBeam._y = _local2.y;
m_kFireBeam._rotation = fAngle;
m_kFireBeam.setSpeed(fSpeed);
m_kFireBeam.onAdd();
}
function onRequestRemoveFireBeam() {
if (m_kFireBeam.isHitSomething()) {
PlayerState(_global.getPlayerState()).setHitsThisRound(PlayerState(_global.getPlayerState()).getHitsThisRound() + 1);
PlayerState(_global.getPlayerState()).setHitsTotal(PlayerState(_global.getPlayerState()).getHitsTotal() + 1);
}
m_kFireBeam.onRemove();
m_kFireBeam.removeMovieClip();
m_kFireBeam = null;
}
function setupAlchemySymbol() {
m_bSmartBomb = false;
stopAction("EXPLODE", false);
stopAction("EXPLODE2", false);
stopAction("END_SMART_BOMB", false);
m_kAlchemySymbol.stopAction("SYMBOL_PULSATE", false);
m_kAlchemySymbol.gotoAndStop("Off");
m_kBackground.gotoAndStop("Normal");
m_kAlchemySymbol.m_kCollision.gotoAndStop("Hide");
if (Settings(_global.getSettings()).getSetting("HIDE_BOUNDARIES")) {
m_kAlchemySymbol.m_kCollision._visible = false;
}
m_kSymbolTargetHolder.m_kSymbolTarget1.setLineToTarget(m_kLineToSymbolTarget1);
m_kSymbolTargetHolder.m_kSymbolTarget2.setLineToTarget(m_kLineToSymbolTarget2);
m_kSymbolTargetHolder.m_kSymbolTarget3.setLineToTarget(m_kLineToSymbolTarget3);
m_kSymbolTargetHolder.m_kSymbolTarget4.setLineToTarget(m_kLineToSymbolTarget4);
m_kSymbolTargetHolder.m_kSymbolTarget5.setLineToTarget(m_kLineToSymbolTarget5);
m_kSymbolTargetHolder.m_kSymbolTarget6.setLineToTarget(m_kLineToSymbolTarget6);
m_kSymbolTargetHolder.m_kSymbolTarget1.onStartRound();
m_kSymbolTargetHolder.m_kSymbolTarget2.onStartRound();
m_kSymbolTargetHolder.m_kSymbolTarget3.onStartRound();
m_kSymbolTargetHolder.m_kSymbolTarget4.onStartRound();
m_kSymbolTargetHolder.m_kSymbolTarget5.onStartRound();
m_kSymbolTargetHolder.m_kSymbolTarget6.onStartRound();
}
function onSymbolTargetActivated(kTarget) {
if (((((m_kSymbolTargetHolder.m_kSymbolTarget1.isActive() && (m_kSymbolTargetHolder.m_kSymbolTarget2.isActive())) && (m_kSymbolTargetHolder.m_kSymbolTarget3.isActive())) && (m_kSymbolTargetHolder.m_kSymbolTarget4.isActive())) && (m_kSymbolTargetHolder.m_kSymbolTarget5.isActive())) && (m_kSymbolTargetHolder.m_kSymbolTarget6.isActive())) {
_global.getApplicationState().setPaused(true);
m_bSmartBomb = true;
m_kAlchemySymbol.m_kCollision._visible = false;
m_kAlchemySymbol.playAnimation("SYMBOL_ACTIVATE", 30, 11, 40, false, 1);
}
}
function addBonusAnimation(fX, fY) {
var _local2 = LRG.LRGMovieClip(attachMovie("s_MultiKillBonus", "m_kMultiKillBonus" + getNextHighestDepth(), getNextHighestDepth()));
_local2._x = fX;
_local2._y = fY;
_local2.playAnimation("BONUS_ANIMATION", 30, 1, 30, false, 1);
m_pBonusClips.push(_local2);
}
function onActionCompleted(sActionKey) {
if (sActionKey == "SYMBOL_ACTIVATE") {
_global.getApplicationState().setPaused(true);
PlayGui(_global.g_kApplication.m_kGui.m_kPlayGui).showCloseup();
_global.playSound("fma_popup.wav", 1, this);
} else if (sActionKey == "DEATH_FADE") {
endRound(true);
} else if (sActionKey == "BONUS_ANIMATION") {
m_pBonusClips.shift().removeMovieClip();
} else if (sActionKey == "EXPLODE") {
m_kAlchemySymbol.playAnimation("EXPLODE2", 60, 111, 244, false, 1);
_global.getApplicationState().setPaused(false);
m_kAlchemySymbol.m_kCollision.gotoAndStop("Show");
getEnemyManager().explodeAll();
var _local3 = 1;
while (_local3 <= 8) {
var _local4 = this["m_kBarrier" + _local3];
if (_local4.isExplodable()) {
_local4.explode();
}
_local3++;
}
} else if (sActionKey == "EXPLODE2") {
m_kAlchemySymbol.m_kCollision.gotoAndStop("Hide");
m_bSmartBomb = false;
m_kBackground.gotoAndStop("Scorched");
m_kAlchemySymbol.gotoAndStop("Scorched");
}
}
}
Symbol 331 MovieClip [__Packages.PlayerController] Frame 0
class PlayerController
{
var m_kPlayer;
function PlayerController () {
init();
}
function init() {
m_kPlayer = undefined;
}
function setPlayer(kPlayer) {
m_kPlayer = kPlayer;
}
function onStartGame() {
}
function onStartRound() {
}
function onEndRound() {
}
function update(fDeltaSecs) {
}
}
Symbol 332 MovieClip [__Packages.Player] Frame 0
class Player extends LRG.LRGMovieClip
{
var setClock, addAction, m_kController, m_fAngularVelocity, m_fSpeed, m_fLastUpdateTime, getClipTime, m_fLastShootTime, m_bTurningLeft, m_bTurningRight, m_bEndingTurn, startAction, m_fLastRotation, m_bFiring, gotoAndStop, stopAction, m_fFireRate, playAnimation, _rotation, m_kFireBeamEmissionPoint, localToGlobal;
function Player () {
super();
}
function init() {
super.init();
setClock(_global.getGameTimer());
var _local4 = new Object();
_local4.m_sName = "GENERIC";
_local4.m_fFPS = 120;
var _local5 = new LRG.LRGGenericAction(_local4);
addAction(_local5);
setupTurnAnimationActions();
m_kController = undefined;
m_fAngularVelocity = 0;
m_fSpeed = 0;
m_fLastUpdateTime = getClipTime();
m_fLastShootTime = getClipTime();
m_bTurningLeft = false;
m_bTurningRight = false;
m_bEndingTurn = false;
}
function setupTurnAnimationActions() {
var _local6 = new Object();
_local6.m_sName = "START_LEFT_TURN";
_local6.m_fFPS = 120;
_local6.m_fStartFrame = 83;
_local6.m_fEndFrame = 112;
_local6.m_bLoop = false;
_local6.m_fDirection = 1;
var _local12 = new LRG.LRGAnimationAction(_local6);
addAction(_local12);
var _local4 = new Object();
_local4.m_sName = "LOOP_LEFT_TURN";
_local4.m_fFPS = 120;
_local4.m_fStartFrame = 113;
_local4.m_fEndFrame = 142;
_local4.m_bLoop = false;
_local4.m_fDirection = 1;
var _local13 = new LRG.LRGAnimationAction(_local4);
addAction(_local13);
var _local5 = new Object();
_local5.m_sName = "STOP_LEFT_TURN";
_local5.m_fFPS = 20;
_local5.m_fStartFrame = 83;
_local5.m_fEndFrame = 112;
_local5.m_bLoop = false;
_local5.m_fDirection = -1;
var _local8 = new LRG.LRGAnimationAction(_local5);
addAction(_local8);
var _local2 = new Object();
_local2.m_sName = "START_RIGHT_TURN";
_local2.m_fFPS = 120;
_local2.m_fStartFrame = 23;
_local2.m_fEndFrame = 52;
_local2.m_bLoop = false;
_local2.m_fDirection = 1;
var _local9 = new LRG.LRGAnimationAction(_local2);
addAction(_local9);
var _local3 = new Object();
_local3.m_sName = "LOOP_RIGHT_TURN";
_local3.m_fFPS = 120;
_local3.m_fStartFrame = 53;
_local3.m_fEndFrame = 82;
_local3.m_bLoop = false;
_local3.m_fDirection = 1;
var _local10 = new LRG.LRGAnimationAction(_local3);
addAction(_local10);
var _local7 = new Object();
_local7.m_sName = "STOP_RIGHT_TURN";
_local7.m_fFPS = 20;
_local7.m_fStartFrame = 23;
_local7.m_fEndFrame = 52;
_local7.m_bLoop = false;
_local7.m_fDirection = -1;
var _local11 = new LRG.LRGAnimationAction(_local7);
addAction(_local11);
}
function onStartGame() {
m_kController.onStartGame();
}
function onStartRound() {
setSpeed(Settings(_global.getSettings()).getSetting("PLAYER_TURN_SPEED"));
setFireRate(Settings(_global.getSettings()).getSetting("PLAYER_FIRE_RATE"));
m_fLastUpdateTime = getClipTime();
m_fLastShootTime = 0;
startAction("GENERIC", null, true);
m_kController.onStartRound();
m_fLastRotation = 0;
m_bFiring = false;
gotoAndStop("Normal");
}
function onEndRound() {
m_kController.onEndRound();
stopAction("GENERIC", false);
}
function setController(kController) {
m_kController = kController;
m_kController.setPlayer(this);
}
function setAngularVelocity(fVel) {
m_fAngularVelocity = fVel;
}
function getAngularVelocity() {
return(m_fAngularVelocity);
}
function setSpeed(fSpeed) {
m_fSpeed = fSpeed;
}
function getSpeed() {
return(m_fSpeed);
}
function setFireRate(fFireRate) {
m_fFireRate = fFireRate;
}
function getFireRate() {
return(m_fFireRate);
}
function isFiring() {
return(m_bFiring);
}
function onRequestTurnLeft() {
setAngularVelocity(-m_fSpeed);
}
function onRequestTurnRight() {
setAngularVelocity(m_fSpeed);
}
function onRequestStop() {
setAngularVelocity(0);
}
function onRequestShootFireBeam() {
if (!m_bFiring) {
var _local4 = _global.g_kApplication.m_kGameScreen;
var _local3 = getClipTime() - m_fLastShootTime;
if (_local3 > (1 / m_fFireRate)) {
playAnimation("SHOOT_FIRE", 45, 11, 21, false, 1);
m_bFiring = true;
}
}
}
function doEnterFrame() {
if (ApplicationState(_global.getApplicationState()).isPaused()) {
return(undefined);
}
var _local3 = getClipTime() - m_fLastUpdateTime;
m_kController.update(_local3);
_rotation = _rotation + (m_fAngularVelocity * _local3);
if ((_rotation != m_fLastRotation) && (!m_bFiring)) {
if ((!m_bTurningLeft) && (!m_bTurningRight)) {
var _local5 = Math.abs((_rotation - m_fLastRotation) + 360) % 360;
var _local4 = Math.abs((m_fLastRotation - _rotation) + 360) % 360;
if (_local5 < _local4) {
if (m_bEndingTurn) {
m_bEndingTurn = false;
startAction("LOOP_RIGHT_TURN", null, true);
} else {
startAction("START_RIGHT_TURN", null, true);
}
m_bTurningRight = true;
} else {
if (m_bEndingTurn) {
m_bEndingTurn = false;
startAction("LOOP_LEFT_TURN", null, true);
} else {
startAction("START_LEFT_TURN", null, true);
}
m_bTurningLeft = true;
}
}
}
m_fLastRotation = _rotation;
m_fLastUpdateTime = getClipTime();
}
function onActionCompleted(sActionKey) {
switch (sActionKey) {
case "SHOOT_FIRE" :
var _local4 = _global.g_kApplication.m_kGameScreen;
m_bFiring = false;
if (_local4.getFireBeam()) {
_local4.onRequestRemoveFireBeam();
}
_global.playSound("fma_roy_shoots.wav", 1, this);
PlayerState(_global.getPlayerState()).setShotsThisRound(PlayerState(_global.getPlayerState()).getShotsThisRound() + 1);
PlayerState(_global.getPlayerState()).setShotsTotal(PlayerState(_global.getPlayerState()).getShotsTotal() + 1);
m_fLastShootTime = getClipTime();
var _local3 = {x:m_kFireBeamEmissionPoint._x, y:m_kFireBeamEmissionPoint._y};
localToGlobal(_local3);
_local4.shootFireBeam(_local3.x, _local3.y, _rotation, Settings(_global.getSettings()).getSetting("FIRE_BEAM_SPEED"));
case "START_LEFT_TURN" :
case "START_RIGHT_TURN" :
case "LOOP_LEFT_TURN" :
case "LOOP_RIGHT_TURN" :
if (_rotation != m_fLastRotation) {
var _local6 = Math.abs((_rotation - m_fLastRotation) + 360) % 360;
var _local5 = Math.abs((m_fLastRotation - _rotation) + 360) % 360;
if (_local6 < _local5) {
startAction("LOOP_RIGHT_TURN", null, true);
m_bTurningRight = true;
m_bTurningLeft = false;
} else {
startAction("LOOP_LEFT_TURN", null, true);
m_bTurningLeft = true;
m_bTurningRight = false;
}
} else {
if (m_bTurningLeft) {
startAction("STOP_LEFT_TURN", null, true);
} else {
startAction("STOP_RIGHT_TURN", null, true);
}
m_bEndingTurn = true;
m_bTurningLeft = false;
m_bTurningRight = false;
}
break;
case "STOP_LEFT_TURN" :
case "STOP_RIGHT_TURN" :
m_bEndingTurn = false;
gotoAndStop("Stand");
}
}
}
Symbol 333 MovieClip [__Packages.LRG.LRGGenericAction] Frame 0
class LRG.LRGGenericAction extends LRG.LRGAction
{
var init;
function LRGGenericAction (kActionParams) {
super();
init(kActionParams);
}
function doUpdate(fCurrTime, fDeltaTimeSecs, kClip) {
return(false);
}
}
Symbol 334 MovieClip [__Packages.HumanPlayerController] Frame 0
class HumanPlayerController extends PlayerController
{
var m_bFireKeyDown, m_kPlayer;
function HumanPlayerController () {
super();
}
function init() {
super.init();
m_bFireKeyDown = false;
Key.addListener(this);
Mouse.addListener(this);
}
function onStartGame() {
}
function onStartRound() {
m_bFireKeyDown = false;
m_kPlayer.setAngularVelocity(0);
}
function onEndRound() {
}
function onMouseMove() {
if (ApplicationState(_global.getApplicationState()).isPaused()) {
return(undefined);
}
m_kPlayer._rotation = (Math.atan2(m_kPlayer._parent._ymouse - m_kPlayer._y, m_kPlayer._parent._xmouse - m_kPlayer._x) / Math.PI) * 180;
}
function onMouseDown() {
if (ApplicationState(_global.getApplicationState()).isPaused()) {
return(undefined);
}
if (_global.g_kApplication.m_kGui.m_kPlayGui.m_kMuteButtonHolder.hitTest(_root._xmouse, _root._ymouse, false)) {
return(undefined);
}
m_kPlayer.onRequestShootFireBeam();
}
function onKeyUp() {
if (!Key.isDown(32)) {
m_bFireKeyDown = false;
}
}
function update(fDeltaSecs) {
if (ApplicationState(_global.getApplicationState()).isPaused()) {
return(undefined);
}
if (Key.isDown(37)) {
m_kPlayer.onRequestTurnLeft();
} else if (Key.isDown(39)) {
m_kPlayer.onRequestTurnRight();
} else {
m_kPlayer.onRequestStop();
}
if ((!m_bFireKeyDown) && (Key.isDown(32))) {
m_bFireKeyDown = true;
m_kPlayer.onRequestShootFireBeam();
}
}
}
Symbol 335 MovieClip [__Packages.GameSummaryPanel] Frame 0
class GameSummaryPanel extends LRG.LRGMovieClip
{
var m_kKillsText, m_kSurvivalText, m_kAccuracyText, m_kScoreText, m_kHydrogenText, m_kComboShotsText, m_kRankText, m_kBackground, m_kOkButton, m_kHelpButton;
function GameSummaryPanel () {
super();
}
function init() {
super.init();
}
function onShow() {
m_kKillsText.text = PlayerState(_global.getPlayerState()).getKillsTotal();
if (PlayerState(_global.getPlayerState()).getTimeTotal() >= 60) {
var _local4 = Math.round(PlayerState(_global.getPlayerState()).getTimeTotal()) % 60;
if (_local4 < 10) {
m_kSurvivalText.text = (Math.floor(PlayerState(_global.getPlayerState()).getTimeTotal() / 60) + ":0") + (Math.round(PlayerState(_global.getPlayerState()).getTimeTotal()) % 60);
} else {
m_kSurvivalText.text = (Math.floor(PlayerState(_global.getPlayerState()).getTimeTotal() / 60) + ":") + (Math.round(PlayerState(_global.getPlayerState()).getTimeTotal()) % 60);
}
} else {
m_kSurvivalText.text = Math.round(PlayerState(_global.getPlayerState()).getTimeTotal()) + " sec";
}
if (PlayerState(_global.getPlayerState()).getShotsTotal() > 0) {
m_kAccuracyText.text = Math.round((PlayerState(_global.getPlayerState()).getHitsTotal() / PlayerState(_global.getPlayerState()).getShotsTotal()) * 100) + " %";
} else {
m_kAccuracyText.text = "0 %";
}
m_kScoreText.text = PlayerState(_global.getPlayerState()).getScore();
m_kHydrogenText.text = PlayerState(_global.getPlayerState()).getHydrogenTotal();
m_kComboShotsText.text = PlayerState(_global.getPlayerState()).getComboShotsTotal();
gname = "fullmetalalchemistDR_v2";
_root.DRScore = m_kScoreText.text;
gscore = _root.DRScore;
_global.ipbSend();
switch (PlayerState(_global.getPlayerState()).getLevel()) {
case 1 :
m_kRankText.text = "Chimera Fodder";
break;
case 2 :
m_kRankText.text = "Aspirant";
break;
case 3 :
m_kRankText.text = "Pupil";
break;
case 4 :
m_kRankText.text = "Combatant";
break;
case 5 :
m_kRankText.text = "Marksman";
break;
case 6 :
m_kRankText.text = "Informant";
break;
case 7 :
m_kRankText.text = "Operative";
break;
case 8 :
m_kRankText.text = "Striker";
break;
case 9 :
m_kRankText.text = "Guardian";
break;
case 10 :
m_kRankText.text = "Executor";
break;
case 11 :
m_kRankText.text = "Templar";
break;
default :
m_kRankText.text = "Harbinger";
}
m_kBackground.onPress = function () {
};
m_kBackground.onRelease = function () {
};
m_kBackground.useHandCursor = false;
m_kOkButton.onRelease = function () {
_global.playSound("fma_button.wav", 1, _global.g_kApplication);
this.onKeyUp = undefined;
Key.removeListener(this);
_global.g_kApplication.m_kGui.m_kGameSummaryPanel.gotoAndStop("Hide");
_global.g_kApplication.m_kGui.m_kGameSummaryPanel._visible = false;
_global.g_kApplication.m_kGameScreen.startGame();
};
Key.addListener(m_kOkButton);
m_kOkButton.onKeyUp = function () {
if (Key.getCode() == 13) {
this.onRelease();
}
};
m_kHelpButton.onRelease = function () {
_global.g_kApplication.m_kGui.m_kGameSummaryPanel.gotoAndStop("Hide");
_global.g_kApplication.m_kGui.m_kGameSummaryPanel._visible = false;
_global.g_kApplication.m_kGui.m_kHelpPanel.gotoAndStop("Hide");
_global.g_kApplication.m_kGui.m_kHelpPanel._visible = false;
_global.g_kApplication.m_kGui.m_kHelpPanel.onShow();
};
}
}
Symbol 336 MovieClip [__Packages.RoundSummaryPanel] Frame 0
class RoundSummaryPanel extends LRG.LRGMovieClip
{
var m_kLevelNumberText, m_kKillsText, m_kSurvivalText, m_kAccuracyText, m_kComboShotsText, m_kScoreText, m_kBackground, m_kOkButton;
function RoundSummaryPanel () {
super();
}
function init() {
super.init();
}
function onShow() {
trace("RoundSummaryPanel::onShow()");
m_kLevelNumberText.text = PlayerState(_global.getPlayerState()).getLevel();
m_kKillsText.text = PlayerState(_global.getPlayerState()).getKillsThisRound();
if (PlayerState(_global.getPlayerState()).getTimeTotal() >= 60) {
var _local3 = Math.round(PlayerState(_global.getPlayerState()).getTimeTotal()) % 60;
if (_local3 < 10) {
m_kSurvivalText.text = (Math.floor(PlayerState(_global.getPlayerState()).getTimeTotal() / 60) + ":0") + (Math.round(PlayerState(_global.getPlayerState()).getTimeTotal()) % 60);
} else {
m_kSurvivalText.text = (Math.floor(PlayerState(_global.getPlayerState()).getTimeTotal() / 60) + ":") + (Math.round(PlayerState(_global.getPlayerState()).getTimeTotal()) % 60);
}
} else {
m_kSurvivalText.text = Math.round(PlayerState(_global.getPlayerState()).getTimeTotal()) + " sec";
}
m_kAccuracyText.text = Math.round((PlayerState(_global.getPlayerState()).getHitsThisRound() / PlayerState(_global.getPlayerState()).getShotsThisRound()) * 100) + " %";
m_kComboShotsText.text = PlayerState(_global.getPlayerState()).getComboShotsThisRound();
m_kScoreText.text = PlayerState(_global.getPlayerState()).getScore();
m_kBackground.onPress = function () {
};
m_kBackground.onRelease = function () {
};
m_kBackground.useHandCursor = false;
m_kOkButton.onRelease = function () {
trace("CLICKED!");
_global.playSound("fma_button.wav", 1, _global.g_kApplication);
this.onKeyUp = undefined;
Key.removeListener(this);
_global.g_kApplication.m_kGui.m_kRoundSummaryPanel.gotoAndStop("Hide");
_global.g_kApplication.m_kGui.m_kRoundSummaryPanel._visible = false;
_global.g_kApplication.m_kGameScreen.startRound();
};
Key.addListener(m_kOkButton);
m_kOkButton.onKeyUp = function () {
if (Key.getCode() == 13) {
this.onRelease();
}
};
}
}
Symbol 337 MovieClip [__Packages.FireBeam] Frame 0
class FireBeam extends LRG.LRGMovieClip
{
var setClock, m_kGlobalBeamEndPosition, m_bCollided, m_pExplosionArray, m_bHitSomething, m_fEnemiesHit, m_fNumberExplosions, addAction, m_fSpeed, playAnimation, startAction, stopAction, m_kBeamEndPosition, localToGlobal, attachMovie, getNextHighestDepth;
function FireBeam () {
super();
}
function init() {
super.init();
setClock(_global.getGameTimer());
m_kGlobalBeamEndPosition = new Object();
m_bCollided = false;
m_pExplosionArray = new Array();
m_bHitSomething = false;
m_fEnemiesHit = 0;
m_fNumberExplosions = 0;
var _local4 = new Object();
_local4.m_sName = "ADD_EXPLOSIONS";
_local4.m_fSPF = Settings(_global.getSettings()).getSetting("BEAM_EXPLOSION_WAIT_TIME");
_local4.m_kCallback = addExplosionCallback;
var _local5 = new LRG.LRGRepeatedCallbackAction(_local4);
addAction(_local5);
}
function setSpeed(fSpeed) {
m_fSpeed = fSpeed;
}
function onAdd() {
playAnimation("FIRE_ANIMATION", m_fSpeed, 1, 100, false, 1);
startAction("ADD_EXPLOSIONS", null, false);
}
function onRemove() {
if (m_fEnemiesHit > 1) {
PlayerState(_global.getPlayerState()).setComboShotsThisRound(PlayerState(_global.getPlayerState()).getComboShotsThisRound() + 1);
PlayerState(_global.getPlayerState()).setComboShotsTotal(PlayerState(_global.getPlayerState()).getComboShotsTotal() + 1);
}
stopAction("ADD_EXPLOSIONS", false);
var _local3 = new Sound(this);
_local3.stop();
}
function fadeOut() {
var _local2 = new Object();
_local2.m_sName = "FADE_OUT";
_local2.m_fTotalActionTime = 0.15;
_local2.m_fFPS = 60;
_local2.m_bFadeIn = false;
var _local3 = new LRG.LRGFadeAction(_local2);
addAction(_local3);
stopAction("FIRE_ANIMATION", false);
startAction("FADE_OUT", null, true);
}
function doEnterFrame() {
if ((m_bCollided || (!m_kGlobalBeamEndPosition)) || (ApplicationState(_global.getApplicationState()).isPaused())) {
return(undefined);
}
m_kGlobalBeamEndPosition.x = m_kBeamEndPosition._x;
m_kGlobalBeamEndPosition.y = m_kBeamEndPosition._y;
localToGlobal(m_kGlobalBeamEndPosition);
if (barriersCollisionTest()) {
return(undefined);
}
symbolTargetsCollisionTest();
var _local4 = {x:-20, y:0};
localToGlobal(_local4);
var _local3 = FullmetalGame(_global.g_kApplication.m_kGameScreen).getEnemyManager().checkCollision(_local4, m_kGlobalBeamEndPosition);
if (_local3) {
m_fEnemiesHit++;
_local3.explode(m_fEnemiesHit);
m_bHitSomething = true;
return(undefined);
}
}
function barriersCollisionTest() {
var _local3 = _global.g_kApplication.m_kGameScreen;
if (barrierCollisionTest(_local3.m_kBarrier1)) {
return(true);
}
if (barrierCollisionTest(_local3.m_kBarrier2)) {
return(true);
}
if (barrierCollisionTest(_local3.m_kBarrier3)) {
return(true);
}
if (barrierCollisionTest(_local3.m_kBarrier4)) {
return(true);
}
if (barrierCollisionTest(_local3.m_kBarrier5)) {
return(true);
}
if (barrierCollisionTest(_local3.m_kBarrier6)) {
return(true);
}
if (barrierCollisionTest(_local3.m_kBarrier7)) {
return(true);
}
if (barrierCollisionTest(_local3.m_kBarrier8)) {
return(true);
}
return(false);
}
function barrierCollisionTest(kBarrier) {
if (kBarrier.isExplodable() && (kBarrier.hitTest(m_kGlobalBeamEndPosition.x, m_kGlobalBeamEndPosition.y, true))) {
m_bCollided = true;
m_bHitSomething = true;
kBarrier.explode();
fadeOut();
return(true);
}
return(false);
}
function symbolTargetsCollisionTest() {
var _local3 = _global.g_kApplication.m_kGameScreen;
if (symbolTargetCollisionTest(_local3.m_kSymbolTargetHolder.m_kSymbolTarget1)) {
return(true);
}
if (symbolTargetCollisionTest(_local3.m_kSymbolTargetHolder.m_kSymbolTarget2)) {
return(true);
}
if (symbolTargetCollisionTest(_local3.m_kSymbolTargetHolder.m_kSymbolTarget3)) {
return(true);
}
if (symbolTargetCollisionTest(_local3.m_kSymbolTargetHolder.m_kSymbolTarget4)) {
return(true);
}
if (symbolTargetCollisionTest(_local3.m_kSymbolTargetHolder.m_kSymbolTarget5)) {
return(true);
}
if (symbolTargetCollisionTest(_local3.m_kSymbolTargetHolder.m_kSymbolTarget6)) {
return(true);
}
return(false);
}
function symbolTargetCollisionTest(kSymbolTarget) {
if ((!kSymbolTarget.isActive()) && (kSymbolTarget.hitTest(m_kGlobalBeamEndPosition.x, m_kGlobalBeamEndPosition.y, true))) {
m_bHitSomething = true;
kSymbolTarget.explode();
return(true);
}
return(false);
}
function addExplosionCallback() {
if (m_pExplosionArray.length < Settings(_global.getSettings()).getSetting("BEAM_EXPLOSION_MAX_ON_SCREEN")) {
var _local3 = {x:m_kBeamEndPosition._x, y:m_kBeamEndPosition._y};
localToGlobal(_local3);
if ((((_local3.x < -10) || (_local3.x > 610)) || (_local3.y < -10)) || (_local3.y > 410)) {
return(undefined);
}
m_fNumberExplosions++;
var _local4 = LRG.LRGMovieClip(attachMovie("s_FireExplosion", "", getNextHighestDepth()));
_local4._x = m_kBeamEndPosition._x;
_local4._y = m_kBeamEndPosition._y;
_local4.playAnimation("EXPLODE", 40, 1, 16, false, 1);
var _local5 = (_local3.x / 3) - 100;
if (((m_fNumberExplosions % 2) == 0) && (Math.random() > 0.3)) {
if ((m_fNumberExplosions % 4) == 0) {
_global.playSound("fma_fire_beam_explosion1.wav", 1, _local4, _local5);
} else {
_global.playSound("fma_fire_beam_explosion2.wav", 1, _local4, _local5);
}
}
m_pExplosionArray.push(_local4);
}
}
function isHitSomething() {
return(m_bHitSomething);
}
function onActionCompleted(sActionKey) {
if (sActionKey == "FIRE_ANIMATION") {
fadeOut();
} else if (sActionKey == "FADE_OUT") {
FullmetalGame(_global.g_kApplication.m_kGameScreen).onRequestRemoveFireBeam();
} else if (sActionKey == "EXPLODE") {
var _local3 = LRG.LRGMovieClip(m_pExplosionArray.shift());
_local3.removeMovieClip();
}
}
}
Symbol 338 MovieClip [__Packages.LRG.LRGRepeatedCallbackAction] Frame 0
class LRG.LRGRepeatedCallbackAction extends LRG.LRGAction
{
var m_fSPF, m_sActionType, m_kCallback, m_sName;
function LRGRepeatedCallbackAction (kAnimationParams) {
super();
init(kAnimationParams);
}
function init(kActionParams) {
if ((kActionParams.m_fSPF == undefined) && (m_fSPF == undefined)) {
kActionParams.m_fSPF = 0;
trace(("Repeated callback action " + kActionParams.m_sName) + " created with no SPF specified.");
}
if ((kActionParams.m_sType == undefined) && ((m_sActionType == undefined) || (m_sActionType == "DEFAULT"))) {
kActionParams.m_sType = "REPEATED_CALLBACK";
}
super.init(kActionParams);
if (kActionParams.m_kCallback != undefined) {
m_kCallback = kActionParams.m_kCallback;
} else if (m_kCallback == undefined) {
trace(("LRGRepeatedCallbackAction " + m_sName) + " initialized without callback.");
}
}
function reset(fCurrTime, kActionParams) {
super.reset(fCurrTime, kActionParams);
}
function doUpdate(fCurrTime, fDeltaTimeSecs, kClip) {
if (fDeltaTimeSecs >= m_fSPF) {
m_kCallback.apply(kClip);
}
return(false);
}
}
Symbol 339 MovieClip [__Packages.LRG.LRGFadeAction] Frame 0
class LRG.LRGFadeAction extends LRG.LRGAction
{
var m_sActionType, m_bFadeIn, m_sName, m_fTimePassedSinceStart, m_fTotalActionTime;
function LRGFadeAction (kAnimationParams) {
super();
init(kAnimationParams);
}
function init(kActionParams) {
if ((kActionParams.m_sType == undefined) && ((m_sActionType == undefined) || (m_sActionType == "DEFAULT"))) {
kActionParams.m_sType = "FADE";
}
super.init(kActionParams);
if ((kActionParams.m_bFadeIn == undefined) && (m_bFadeIn == undefined)) {
m_bFadeIn = false;
trace(("Fade action " + m_sName) + " initialized without specified direction.");
} else {
m_bFadeIn = kActionParams.m_bFadeIn;
}
m_fTimePassedSinceStart = 0;
}
function reset(fCurrTime, kActionParams) {
super.reset(fCurrTime, kActionParams);
m_fTimePassedSinceStart = 0;
}
function doUpdate(fCurrTime, fDeltaTimeSecs, kClip) {
m_fTimePassedSinceStart = m_fTimePassedSinceStart + fDeltaTimeSecs;
var _local2 = m_fTimePassedSinceStart / m_fTotalActionTime;
if (_local2 > 1) {
_local2 = 1;
}
if (m_bFadeIn) {
kClip._alpha = _local2 * 100;
} else {
kClip._alpha = 100 - (_local2 * 100);
}
if (_local2 == 1) {
return(true);
}
return(false);
}
}
Symbol 340 MovieClip [__Packages.Enemy] Frame 0
class Enemy extends LRG.LRGMovieClip
{
var setClock, m_fPointValue, m_bExploding, m_kHidingBehindBarrier, m_fTimesWaited, m_kCollision, m_fRadius, m_fLastUpdateTime, getClipTime, playAnimation, m_fRotation, _y, _x, _rotation, _parent, stopAction, m_fDestinationX, m_fDestinationY, addAction, startAction, m_fSpeed, getActiveActions, m_fType, hitTest;
function Enemy () {
super();
}
function init() {
super.init();
setClock(_global.getGameTimer());
m_fPointValue = 0;
m_bExploding = false;
m_kHidingBehindBarrier = null;
m_fTimesWaited = 0;
}
function onAdd() {
if (Settings(_global.getSettings()).getSetting("HIDE_BOUNDARIES")) {
m_kCollision._visible = false;
}
m_fRadius = (m_kCollision._width + m_kCollision._height) / 4;
m_fLastUpdateTime = getClipTime();
playAnimation("STAND", 60, 1, 14, true, 1);
var _local4 = _global.g_kApplication.m_kGameScreen;
var _local3 = {x:_local4.getPlayer()._x, y:_local4.getPlayer()._y};
m_fRotation = (Math.atan2(_local3.y - _y, _local3.x - _x) / Math.PI) * 180;
_rotation = m_fRotation;
_local4.localToGlobal(_local3);
_parent.globalToLocal(_local3);
setDestination(_local3.x, _local3.y, true);
}
function onRemove() {
stopAction("MOVE_TO_DESTINATION", false);
stopAction("STAND", false);
stopAction("WALK", false);
stopAction("UNHIDE", false);
}
function setDestination(fDestX, fDestY, bMeander) {
if (bMeander && (!m_kHidingBehindBarrier)) {
var _local9 = _global.LRG.Utils.Vector2D.normalize(fDestX - _x, fDestY - _y);
if ((m_kHidingBehindBarrier = checkBarriers(_x + (_local9.x * 25), _y + (_local9.y * 25)))) {
var _local8 = {x:m_kHidingBehindBarrier.m_kEnemyStandPoint._x, y:m_kHidingBehindBarrier.m_kEnemyStandPoint._y};
m_kHidingBehindBarrier.localToGlobal(_local8);
_parent.globalToLocal(_local8);
hideBehindBarrier();
return(undefined);
}
var _local5 = (Math.atan2(fDestY - _y, fDestX - _x) / Math.PI) * 180;
if (Math.round(_local5) == Math.round(m_fRotation)) {
m_fRotation = m_fRotation + ((Math.random() * 60) - 30);
} else {
m_fRotation = _local5;
}
var _local7 = (m_fRotation / 180) * Math.PI;
var _local6 = (Math.random() * 30) + 20;
m_fDestinationX = _x + (Math.cos(_local7) * _local6);
m_fDestinationY = _y + (Math.sin(_local7) * _local6);
} else {
m_fDestinationX = fDestX;
m_fDestinationY = fDestY;
m_fRotation = (Math.atan2(m_fDestinationY - _y, m_fDestinationX - _x) / Math.PI) * 180;
}
var _local14;
if ((m_fTimesWaited <= 5) && (_local14 = FullmetalGame(_global.g_kApplication.m_kGameScreen).getEnemyManager().checkCollision({x:_x, y:_y}, {x:m_fDestinationX, y:m_fDestinationY}, this))) {
m_fTimesWaited++;
var _local4 = new Object();
_local4.m_sName = "WAIT_TO_MOVE";
_local4.m_fTotalActionTime = (Math.random() * 5) + 0.5;
var _local12 = new LRG.LRGWaitAction(_local4);
addAction(_local12);
startAction("WAIT_TO_MOVE", null, true);
playAnimation("STAND", 60, 1, 14, true, 1);
return(undefined);
}
m_fTimesWaited = 0;
var _local3 = new Object();
_local3.m_sName = "MOVE_TO_DESTINATION";
_local3.m_fFPS = 45;
_local3.m_fSpeed = m_fSpeed;
_local3.m_kGoal = {x:m_fDestinationX, y:m_fDestinationY};
_local3.m_fGoalRotation = m_fRotation;
var _local13 = new LRG.LRGMoveAction(_local3);
addAction(_local13);
startAction("MOVE_TO_DESTINATION", null, true);
if (getActiveActions().getIndex("WALK") == -1) {
playAnimation("WALK", 30, 15, 24, true, 1);
}
}
function checkBarriers(fXPos, fYPos) {
var _local4 = {x:fXPos, y:fYPos};
_parent.localToGlobal(_local4);
var _local3 = _global.g_kApplication.m_kGameScreen;
if (_local3.m_kBarrier1.isExplodable() && (_local3.m_kBarrier1.hitTest(_local4.x, _local4.y, true))) {
return(_local3.m_kBarrier1);
}
if (_local3.m_kBarrier2.isExplodable() && (_local3.m_kBarrier2.hitTest(_local4.x, _local4.y, true))) {
return(_local3.m_kBarrier2);
}
if (_local3.m_kBarrier3.isExplodable() && (_local3.m_kBarrier3.hitTest(_local4.x, _local4.y, true))) {
return(_local3.m_kBarrier3);
}
if (_local3.m_kBarrier4.isExplodable() && (_local3.m_kBarrier4.hitTest(_local4.x, _local4.y, true))) {
return(_local3.m_kBarrier4);
}
if (_local3.m_kBarrier5.isExplodable() && (_local3.m_kBarrier5.hitTest(_local4.x, _local4.y, true))) {
return(_local3.m_kBarrier5);
}
if (_local3.m_kBarrier6.isExplodable() && (_local3.m_kBarrier6.hitTest(_local4.x, _local4.y, true))) {
return(_local3.m_kBarrier6);
}
if (_local3.m_kBarrier7.isExplodable() && (_local3.m_kBarrier7.hitTest(_local4.x, _local4.y, true))) {
return(_local3.m_kBarrier7);
}
if (_local3.m_kBarrier8.isExplodable() && (_local3.m_kBarrier8.hitTest(_local4.x, _local4.y, true))) {
return(_local3.m_kBarrier8);
}
}
function hideBehindBarrier() {
stopAction("WALK", false);
playAnimation("STAND", 3, 1, 14, true, 1);
var _local3 = new Object();
_local3.m_sName = "UNHIDE";
_local3.m_fTotalActionTime = (Math.random() * Settings(_global.getSettings()).getSetting("ENEMY_MAX_HIDE_TIME")) + Settings(_global.getSettings()).getSetting("ENEMY_MIN_HIDE_TIME");
_local3.m_kCallback = unhideCallback;
var _local4 = new LRG.LRGDelayedCallbackAction(_local3);
addAction(_local4);
startAction("UNHIDE", null, true);
}
function unhideCallback() {
var _local4 = Math.floor(Math.random() * 2) + 1;
var _local3 = m_kHidingBehindBarrier["m_kWaypoint" + _local4];
var _local2 = {x:_local3._x, y:_local3._y};
m_kHidingBehindBarrier.localToGlobal(_local2);
_parent.globalToLocal(_local2);
m_kHidingBehindBarrier = null;
setDestination(_local2.x, _local2.y, false);
}
function getDestinationX() {
return(m_fDestinationX);
}
function getDestinationY() {
return(m_fDestinationY);
}
function isDestinationReached() {
return(getActiveActions().getIndex("MOVE_TO_DESTINATION") != -1);
}
function setSpeed(fSpeed) {
m_fSpeed = fSpeed;
}
function getSpeed() {
return(m_fSpeed);
}
function setType(fType) {
m_fType = fType;
}
function getType() {
return(m_fType);
}
function getRadius() {
return(m_fRadius);
}
function setPointValue(fPointValue) {
m_fPointValue = fPointValue;
}
function getPointValue() {
return(m_fPointValue);
}
function explode(fNumberInChain) {
if (fNumberInChain > 1) {
FullmetalGame(_global.g_kApplication.m_kGameScreen).addBonusAnimation(_x, _y);
}
m_bExploding = true;
PlayerState(_global.getPlayerState()).setScore(PlayerState(_global.getPlayerState()).getScore() + (getPointValue() * fNumberInChain));
var _local3 = {x:_x, y:_y};
_parent.localToGlobal(_local3);
var _local4 = (_local3.x / 3) - 100;
_global.playSound(("fma_npc_dies" + m_fType) + ".wav", 1, this, _local4);
stopAction("MOVE_TO_DESTINATION", false);
stopAction("STAND", false);
stopAction("WALK", false);
stopAction("UNHIDE", false);
playAnimation("EXPLODE", 30, 25, 43, false, 1);
}
function isExploding() {
return(m_bExploding);
}
function onActionCompleted(sActionKey) {
if (sActionKey == "EXPLODE") {
m_bExploding = false;
FullmetalGame(_global.g_kApplication.m_kGameScreen).getEnemyManager().onRequestRemoveEnemy(this);
FullmetalGame(_global.g_kApplication.m_kGameScreen).onEnemyDied();
} else if (sActionKey == "MOVE_TO_DESTINATION") {
if (m_kHidingBehindBarrier) {
hideBehindBarrier();
return(undefined);
}
var _local5 = _global.g_kApplication.m_kGameScreen;
var _local4 = {x:_x, y:_y};
_parent.localToGlobal(_local4);
if (_local5.isSmartBomb() && (_local5.m_kAlchemySymbol.m_kCollision.hitTest(_local4.x, _local4.y, true))) {
explode(1);
return(undefined);
}
var _local3 = {x:_local5.getPlayer()._x, y:_local5.getPlayer()._y};
_local5.localToGlobal(_local3);
_parent.globalToLocal(_local3);
if (hitTest(_local3.x, _local3.y, true)) {
if (!_local5.getPlayer().isFiring()) {
_local5.onPlayerDied();
return(undefined);
}
setDestination(_x, _y, true);
return(undefined);
}
setDestination(_local3.x, _local3.y, true);
} else if (sActionKey == "WAIT_TO_MOVE") {
if (m_bExploding) {
return(undefined);
}
if (m_kHidingBehindBarrier) {
unhideCallback();
} else {
var _local5 = _global.g_kApplication.m_kGameScreen;
var _local3 = {x:_local5.getPlayer()._x, y:_local5.getPlayer()._y};
_local5.localToGlobal(_local3);
_parent.globalToLocal(_local3);
setDestination(_local3.x, _local3.y, true);
}
}
}
}
Symbol 341 MovieClip [__Packages.LRG.LRGWaitAction] Frame 0
class LRG.LRGWaitAction extends LRG.LRGAction
{
var m_fTotalActionTime, m_sActionType;
function LRGWaitAction (kAnimationParams) {
super();
init(kAnimationParams);
}
function init(kActionParams) {
if ((kActionParams.m_fTotalActionTime == undefined) && (m_fTotalActionTime == undefined)) {
kActionParams.m_fTotalActionTime = 0;
trace(("Wait action " + kActionParams.m_sName) + " created with no wait time specified.");
}
kActionParams.m_fSPF = kActionParams.m_fTotalActionTime;
if ((kActionParams.m_sType == undefined) && ((m_sActionType == undefined) || (m_sActionType == "DEFAULT"))) {
kActionParams.m_sType = "WAIT";
}
super.init(kActionParams);
}
function reset(fCurrTime, kActionParams) {
super.reset(fCurrTime, kActionParams);
}
function doUpdate(fCurrTime, fDeltaTimeSecs, kClip) {
if (fDeltaTimeSecs >= m_fTotalActionTime) {
return(true);
}
return(false);
}
}
Symbol 342 MovieClip [__Packages.LRG.LRGMoveAction] Frame 0
class LRG.LRGMoveAction extends LRG.LRGAction
{
var m_sActionType, m_fCurrSpeed, m_fGoalRotation, m_kGoal, m_fCosine, m_fSine, m_kObjPos, m_fRotationSpeed;
function LRGMoveAction (kAnimationParams) {
super();
init(kAnimationParams);
}
function init(kActionParams) {
if ((kActionParams.m_sType == undefined) && ((m_sActionType == undefined) || (m_sActionType == "DEFAULT"))) {
kActionParams.m_sType = "MOVE_ACTION";
}
super.init(kActionParams);
if (kActionParams.m_fSpeed != undefined) {
m_fCurrSpeed = kActionParams.m_fSpeed;
} else if (m_fCurrSpeed == undefined) {
m_fCurrSpeed = 0;
}
if (kActionParams.m_fGoalRotation != undefined) {
m_fGoalRotation = kActionParams.m_fGoalRotation;
} else if (m_fGoalRotation == undefined) {
m_fGoalRotation = undefined;
}
if (kActionParams.m_kGoal != undefined) {
m_kGoal = kActionParams.m_kGoal;
} else if (m_kGoal == undefined) {
m_kGoal = {x:0, y:0};
}
}
function setCurrSpeed(fSpeed) {
m_fCurrSpeed = fSpeed;
}
function reset(fCurrTime, kActionParams) {
super.reset(fCurrTime, kActionParams);
m_fCosine = undefined;
m_fSine = undefined;
m_kObjPos = undefined;
}
function getTurn(fDegrees, fGoalDegrees) {
var _local2 = Math.abs((fGoalDegrees - fDegrees) + 360) % 360;
var _local1 = Math.abs((fDegrees - fGoalDegrees) + 360) % 360;
if (_local2 < _local1) {
return(_local2);
}
return(-_local1);
}
function doUpdate(fCurrTime, fDeltaTimeSecs, kClip) {
if (m_kObjPos == undefined) {
m_kObjPos = new Object();
m_kObjPos.x = kClip._x;
m_kObjPos.y = kClip._y;
}
var _local3 = new Object();
_local3.x = m_kGoal.x - m_kObjPos.x;
_local3.y = m_kGoal.y - m_kObjPos.y;
if ((m_kObjPos.x == m_kGoal.x) && (m_kObjPos.y == m_kGoal.y)) {
if (!(m_fGoalRotation === undefined)) {
kClip._rotation = m_fGoalRotation;
}
return(true);
}
if (m_fCosine == undefined) {
var _local5 = Math.atan2(_local3.y, _local3.x);
m_fCosine = Math.cos(_local5);
m_fSine = Math.sin(_local5);
}
var _local4 = fDeltaTimeSecs * m_fCurrSpeed;
var _local6 = Math.sqrt(Math.pow(_local3.x, 2) + Math.pow(_local3.y, 2));
if (!(m_fGoalRotation === undefined)) {
if (m_fRotationSpeed === undefined) {
var _local7 = _local6 / m_fCurrSpeed;
m_fRotationSpeed = getTurn(kClip._rotation, m_fGoalRotation) / _local7;
}
kClip._rotation = kClip._rotation + (m_fRotationSpeed * fDeltaTimeSecs);
}
if (_local4 >= _local6) {
if (!(m_fGoalRotation === undefined)) {
kClip._rotation = m_fGoalRotation;
}
kClip._x = m_kGoal.x;
kClip._y = m_kGoal.y;
return(true);
}
m_kObjPos.x = m_kObjPos.x + (_local4 * m_fCosine);
m_kObjPos.y = m_kObjPos.y + (_local4 * m_fSine);
kClip._x = m_kObjPos.x;
kClip._y = m_kObjPos.y;
return(false);
}
}
Symbol 343 MovieClip [__Packages.Barrier] Frame 0
class Barrier extends LRG.LRGMovieClip
{
var setClock, m_bExplodable, m_fState, m_kCollision, _y, _x, _parent, playAnimation, gotoAndStop;
function Barrier () {
super();
}
function init() {
super.init();
setClock(_global.getGameTimer());
m_bExplodable = true;
m_fState = BS_NORMAL;
}
function onStartRound() {
setState(Math.floor(Math.random() * 5));
if (Settings(_global.getSettings()).getSetting("HIDE_BOUNDARIES")) {
m_kCollision._visible = false;
}
}
function explode() {
var _local3 = {x:_x, y:_y};
_parent.localToGlobal(_local3);
var _local4 = (_local3.x / 3) - 100;
_global.playSound("fma_obstacle_hit.wav", 1, this, _local4);
switch (m_fState) {
case BS_NORMAL :
playAnimation("WEAKEND_EXPLOSION", 40, 11, 30, false, 1);
m_fState = BS_WEAKENED;
break;
case BS_WEAKENED :
playAnimation("CRITICAL_EXPLOSION", 40, 39, 58, false, 1);
m_fState = BS_CRITICAL;
break;
case BS_CRITICAL :
playAnimation("DESTROY_EXPLOSION", 40, 66, 84, false, 1);
m_fState = BS_DESTROYED;
m_bExplodable = false;
break;
}
}
function setState(fState) {
switch ((m_fState = fState)) {
case BS_NORMAL :
gotoAndStop("Normal");
m_bExplodable = true;
break;
case BS_WEAKENED :
gotoAndStop("Weakened");
m_bExplodable = true;
break;
case BS_CRITICAL :
gotoAndStop("Critical");
m_bExplodable = true;
break;
default :
gotoAndStop("NotPresent");
m_bExplodable = false;
}
}
function isExplodable() {
return(m_bExplodable);
}
function onActionCompleted(sActionKey) {
}
static var BS_NORMAL = 0;
static var BS_WEAKENED = 1;
static var BS_CRITICAL = 2;
static var BS_DESTROYED = 3;
static var BS_NOT_PRESENT = 4;
}
Symbol 344 MovieClip [__Packages.LRG.LRGDelayedCallbackAction] Frame 0
class LRG.LRGDelayedCallbackAction extends LRG.LRGAction
{
var m_fTotalActionTime, m_sActionType, m_kCallback, m_sName;
function LRGDelayedCallbackAction (kAnimationParams) {
super();
init(kAnimationParams);
}
function init(kActionParams) {
if ((kActionParams.m_fTotalActionTime == undefined) && (m_fTotalActionTime == undefined)) {
kActionParams.m_fTotalActionTime = 0;
trace(("Delayed callback action " + kActionParams.m_sName) + " created with no wait time specified.");
}
kActionParams.m_fSPF = kActionParams.m_fTotalActionTime;
if ((kActionParams.m_sType == undefined) && ((m_sActionType == undefined) || (m_sActionType == "DEFAULT"))) {
kActionParams.m_sType = "DELAYED_CALLBACK";
}
if (kActionParams.m_kCallback != undefined) {
m_kCallback = kActionParams.m_kCallback;
} else if (m_kCallback == undefined) {
trace(("LRGDelayedCallbackAction " + m_sName) + " initialized without callback.");
}
super.init(kActionParams);
}
function reset(fCurrTime, kActionParams) {
super.reset(fCurrTime, kActionParams);
}
function doUpdate(fCurrTime, fDeltaTimeSecs, kClip) {
if (fDeltaTimeSecs >= m_fTotalActionTime) {
m_kCallback.apply(kClip);
return(true);
}
return(false);
}
}
Symbol 345 MovieClip [__Packages.SymbolTarget] Frame 0
class SymbolTarget extends LRG.LRGMovieClip
{
var setClock, m_kLine, _visible, m_bActive, gotoAndStop, m_kCollision, _y, _x, _parent, playAnimation;
function SymbolTarget () {
super();
}
function init() {
super.init();
setClock(_global.getGameTimer());
}
function setLineToTarget(kLine) {
m_kLine = kLine;
}
function getLineToTarget() {
return(m_kLine);
}
function onStartRound() {
_visible = true;
m_bActive = false;
gotoAndStop("Off");
m_kLine.gotoAndStop("Off");
if (Settings(_global.getSettings()).getSetting("HIDE_BOUNDARIES")) {
m_kCollision._visible = false;
}
}
function explode() {
var _local3 = {x:_x, y:_y};
_parent.localToGlobal(_local3);
var _local4 = (_local3.x / 3) - 100;
_global.playSound("fma_point_hit.wav", 1, this, _local4);
m_bActive = true;
playAnimation("ACTIVATE", 40, 11, 30, false, 1);
m_kLine.playAnimation("ACTIVATE", 40, 11, 31, false, 1);
FullmetalGame(_global.g_kApplication.m_kGameScreen).onSymbolTargetActivated(this);
}
function isActive() {
return(m_bActive);
}
function onActionCompleted(sActionKey) {
}
}
Symbol 346 MovieClip [__Packages.EnemyManager] Frame 0
class EnemyManager extends LRG.LRGMovieClip
{
var setClock, m_pEnemyArray, addAction, m_fEnemiesToAdd, m_fEnemiesAdded, startAction, stopAction, localToGlobal, attachMovie, getNextHighestDepth;
function EnemyManager () {
super();
}
function init() {
super.init();
setClock(_global.getGameTimer());
m_pEnemyArray = new Array();
var _local4 = new Object();
_local4.m_sName = "ADD_ENEMIES";
_local4.m_fSPF = 1;
_local4.m_kCallback = addCallback;
var _local5 = new LRG.LRGRepeatedCallbackAction(_local4);
addAction(_local5);
}
function onStartGame() {
}
function onStartRound() {
m_fEnemiesToAdd = Settings(_global.getSettings()).getSettingForLevel("ENEMIES_TO_ADD");
m_fEnemiesAdded = 0;
var _local3 = new Object();
_local3.m_fSPF = Settings(_global.getSettings()).getSettingForLevel("ENEMY_ADD_RATE");
if (_local3.m_fSPF < Settings(_global.getSettings()).getSetting("ENEMY_ADD_RATE_MIN")) {
_local3.m_fSPF = Settings(_global.getSettings()).getSetting("ENEMY_ADD_RATE_MIN");
}
startAction("ADD_ENEMIES", _local3, true);
}
function onEndRound() {
stopAction("ADD_ENEMIES", false);
var _local2 = 0;
while (_local2 < m_pEnemyArray.length) {
Enemy(m_pEnemyArray[_local2]).onRemove();
Enemy(m_pEnemyArray[_local2]).removeMovieClip();
_local2++;
}
m_pEnemyArray.splice(0);
}
function isNoMoreEnemies() {
return(m_pEnemyArray.length <= 0);
}
function isNoMoreEnemiesToCome() {
return(m_fEnemiesAdded > m_fEnemiesToAdd);
}
function isNoMoreEnemiesInSymbol() {
var _local3 = 0;
while (_local3 < m_pEnemyArray.length) {
var _local5 = Enemy(m_pEnemyArray[_local3]);
var _local4 = {x:_local5._x, y:_local5._y};
localToGlobal(_local4);
if (FullmetalGame(_global.g_kApplication.m_kGameScreen).m_kAlchemySymbol.m_kCollision.hitTest(_local4.x, _local4.y, true)) {
return(false);
}
_local3++;
}
return(true);
}
function explodeAll() {
var _local2 = 0;
while (_local2 < m_pEnemyArray.length) {
var _local3 = Enemy(m_pEnemyArray[_local2]);
if (!_local3.isExploding()) {
_local3.explode(1);
}
_local2++;
}
}
function checkCollision(kBeamStart, kBeamEnd, kIgnore) {
var _local8 = 0;
while (_local8 < m_pEnemyArray.length) {
var _local4 = Enemy(m_pEnemyArray[_local8]);
if (_local4.isExploding() || (_local4 == kIgnore)) {
} else {
var _local5 = {x:_local4._x, y:_local4._y};
localToGlobal(_local5);
var _local7 = (((_local5.x - kBeamStart.x) * (kBeamEnd.x - kBeamStart.x)) + ((_local5.y - kBeamStart.y) * (kBeamEnd.y - kBeamStart.y))) / (Math.pow(kBeamEnd.x - kBeamStart.x, 2) + Math.pow(kBeamEnd.y - kBeamStart.y, 2));
if ((_local7 >= 0) && (_local7 <= 1)) {
var _local11 = kBeamStart.x + (_local7 * (kBeamEnd.x - kBeamStart.x));
var _local10 = kBeamStart.y + (_local7 * (kBeamEnd.y - kBeamStart.y));
var _local9 = _global.LRG.Utils.Vector2D.magnitude(_local5.x - _local11, _local5.y - _local10);
if (_local9 < _local4.getRadius()) {
return(_local4);
}
}
}
_local8++;
}
return(null);
}
function addCallback() {
if (isNoMoreEnemiesToCome()) {
stopAction("ADD_ENEMIES", false);
} else {
if (m_pEnemyArray.length >= Settings(_global.getSettings()).getSetting("MAX_ENEMIES_ON_SCREEN")) {
return(undefined);
}
var _local3 = _global.g_kApplication.m_kGameScreen;
if (_local3.isSmartBomb()) {
return(undefined);
}
switch (Math.floor(Math.random() * 4)) {
case 0 :
addEnemy(-25, Math.round(Math.random() * 400), 1000);
break;
case 1 :
addEnemy(650, Math.round(Math.random() * 400), 1000);
break;
case 2 :
addEnemy(Math.round(Math.random() * 600), -20, 1000);
break;
case 3 :
addEnemy(Math.round(Math.random() * 600), 420, 1000);
break;
}
}
}
function addEnemy(fPosX, fPosY, fPointValue) {
var _local6 = _global.g_kApplication.m_kGameScreen;
var _local4 = Math.floor(Math.random() * 3) + 1;
var _local3 = Enemy(attachMovie("s_Enemy" + _local4, "m_kEnemy" + getNextHighestDepth(), getNextHighestDepth()));
_local3._x = fPosX;
_local3._y = fPosY;
_local3.setPointValue(fPointValue);
_local3.setType(_local4);
m_pEnemyArray.push(_local3);
var _local5;
if (_local4 == 1) {
_local5 = Settings(_global.getSettings()).getSettingForLevel("ENEMY_SPEEDA");
} else if (_local4 == 2) {
_local5 = Settings(_global.getSettings()).getSettingForLevel("ENEMY_SPEEDB");
} else if (_local4) {
_local5 = Settings(_global.getSettings()).getSettingForLevel("ENEMY_SPEEDC");
}
_local3.setSpeed(_local5);
_local3.onAdd();
m_fEnemiesAdded++;
}
function onRequestRemoveEnemy(kEnemy) {
var _local2 = m_pEnemyArray.getIndex(kEnemy);
if (_local2 != -1) {
m_pEnemyArray.splice(_local2, 1);
kEnemy.onRemove();
kEnemy.removeMovieClip();
}
}
}
Symbol 347 MovieClip [__Packages.LRG.Utils.FPSDisplay] Frame 0
class LRG.Utils.FPSDisplay extends MovieClip
{
var m_fUpdatePeriod, m_fNumUpdates, m_fTotalFramesTime, m_fLastTime, m_fLastUpdateTime, onEnterFrame, m_kTimeDisplay;
function FPSDisplay () {
super();
init();
}
function init() {
m_fUpdatePeriod = 250;
m_fNumUpdates = 0;
m_fTotalFramesTime = 0;
m_fLastTime = getTimer();
m_fLastUpdateTime = getTimer();
onEnterFrame = updateFPS;
}
function updateFPS() {
m_fNumUpdates++;
var _local2 = getTimer();
m_fTotalFramesTime = m_fTotalFramesTime + (_local2 - m_fLastTime);
m_fLastTime = _local2;
if ((_local2 - m_fLastUpdateTime) > m_fUpdatePeriod) {
m_fLastUpdateTime = _local2;
var _local3 = m_fTotalFramesTime / m_fNumUpdates;
var _local4 = 1000 / _local3;
m_fNumUpdates = 0;
m_fTotalFramesTime = 0;
m_kTimeDisplay.text = "fps: " + Math.floor(_local4);
}
}
}
Symbol 348 MovieClip [__Packages.HelpPanel] Frame 0
class HelpPanel extends LRG.LRGMovieClip
{
var m_kBackground, m_kOkButton;
function HelpPanel () {
super();
}
function init() {
super.init();
}
function onShow() {
_global.getApplicationState().setPaused(true);
m_kBackground.onPress = function () {
};
m_kBackground.onRelease = function () {
};
m_kBackground.useHandCursor = false;
m_kOkButton.onRelease = function () {
_global.playSound("fma_button.wav", 1, _global.g_kApplication);
this.onKeyUp = undefined;
Key.removeListener(this);
_global.g_kApplication.m_kGui.m_kHelpPanel.gotoAndStop("Hide");
_global.g_kApplication.m_kGui.m_kHelpPanel._visible = false;
if (_global.getApplicationState().isCurrentState(_global.getApplicationState().AS_PRE_GAME)) {
_global.g_kApplication.m_kGameScreen.startGame();
} else {
_global.g_kApplication.m_kGameScreen.startGame();
}
};
Key.addListener(m_kOkButton);
m_kOkButton.onKeyUp = function () {
if (Key.getCode() == 13) {
this.onRelease();
}
};
}
}
Symbol 349 MovieClip [__Packages.SplashScreen] Frame 0
class SplashScreen extends LRG.LRGMovieClip
{
var m_kBackground, m_kStartButton;
function SplashScreen () {
super();
}
function init() {
super.init();
}
function onShow() {
_global.LRG.LRGMusic.startMusic(["fma_titlescreen_music.wav"]);
m_kBackground.onPress = function () {
};
m_kBackground.onRelease = function () {
};
m_kBackground.useHandCursor = false;
m_kStartButton.onRelease = function () {
_global.playSound("fma_button.wav", 1, _global.g_kApplication);
this.onKeyUp = undefined;
Key.removeListener(this);
_global.g_kApplication.m_kGui.m_kSplashScreen.gotoAndStop("Hide");
_global.g_kApplication.m_kGui.m_kSplashScreen._visible = false;
_global.g_kApplication.m_kGui.m_kHelpPanel.gotoAndStop("Show");
_global.g_kApplication.m_kGui.m_kHelpPanel._visible = true;
_global.g_kApplication.m_kGui.m_kHelpPanel.onShow();
};
Key.addListener(m_kStartButton);
m_kStartButton.onKeyUp = function () {
if (Key.getCode() == 13) {
this.onRelease();
}
};
}
}
Symbol 350 MovieClip [__Packages.Gui] Frame 0
class Gui extends LRG.LRGMovieClip
{
function Gui () {
super();
}
}