Frame 1
Stage.showMenu = false;
_focusrect = false;
Frame 2
stop();
Instance of Symbol 44 MovieClip "contLoading" in Frame 2
onClipEvent (load) {
function fPreloadGame() {
var _local2 = (_parent.getBytesLoaded() / _parent.getBytesTotal()) * 100;
if (_local2 != 100) {
_local2 = Math.floor(_local2);
_parent.mcLoadingScreen.sPercent = _local2;
_parent.mcLoadingScreen.mcLoadBar.gotoAndStop(_local2);
} else {
_parent.mcLoadingScreen.sPercent = "100";
_parent.mcLoadingScreen.mcLoadBar.gotoAndStop(100);
nDelay++;
if (nDelay > 4) {
_parent.gotoAndStop("Loaded");
}
}
}
_visible = false;
var nDelay = 0;
}
onClipEvent (enterFrame) {
fPreloadGame();
}
Instance of Symbol 72 MovieClip "mcContSound" in Frame 8
onClipEvent (load) {
_visible = false;
_global.objSnd = this;
Items = new Object();
G_TabSonFade = new Array();
Mute = false;
bMusicPackPlaying = false;
Controlled = new Array("sMu_game", "sMu_pack", "sFx_btnOver", "sFx_btnDown", "sFx_btnOverMenu", "sFx_btnDownMenu", "sFx_bonus", "sFx_jump", "sFx_stomp", "sFx_transition", "sFx_gaz0", "sFx_gaz1", "sFx_gaz2", "sFx_enemyHit", "sFx_enemyHurt", "sFx_enemyWhip", "sFx_enemyDie", "sFx_enemyBoss", "sFx_jumpAttack1", "sFx_freeze", "sFx_burp", "sFx_clam", "sFx_clamThrow", "sFx_qTipHit", "sFx_ninja", "sFx_sword");
for (i in Controlled) {
this.createEmptyMovieClip(Controlled[i], i + 1);
this[Controlled[i]] = new Sound(Controlled[i]);
this[Controlled[i]].attachSound(Controlled[i]);
Items[Controlled[i]] = new Object();
Items[Controlled[i]].Nom = Controlled[i];
Items[Controlled[i]].Volume = 0;
}
fPlaySounds = function (l_Name, l_Vol, l_NbLoop) {
SetVolume(l_Name, l_Vol);
eval (l_Name).start(0, l_NbLoop);
};
fStopSounds = function (l_Name) {
SetVolume(l_Name, 0);
eval (l_Name).stop();
};
SetVolume = function (l_Name, l_Vol) {
Items[l_Name].Volume = l_Vol;
if (Mute) {
eval (l_Name).setVolume(0);
} else {
eval (l_Name).setVolume(l_Vol);
}
};
DoFade = function (l_Name, l_Vol, l_DirFade, l_SpdFade, l_Index) {
var _local1 = Items[l_Name].Volume;
if (l_DirFade == "In") {
if ((_local1 + l_SpdFade) < l_Vol) {
SetVolume(l_Name, _local1 + l_SpdFade);
} else {
SetVolume(l_Name, l_Vol);
G_TabSonFade.splice(l_Index, 1);
}
} else if ((_local1 - l_SpdFade) > l_Vol) {
SetVolume(l_Name, _local1 - l_SpdFade);
} else {
SetVolume(l_Name, l_Vol);
G_TabSonFade.splice(l_Index, 1);
if (l_Vol == 0) {
fStopSounds(l_Name);
}
}
};
Fade = function () {
for (i in G_TabSonFade) {
DoFade(G_TabSonFade[i][0], G_TabSonFade[i][1], G_TabSonFade[i][2], G_TabSonFade[i][3], i);
}
};
fDoMute = function () {
Mute = true;
for (i in Items) {
eval (Items[i].Nom).setVolume(0);
}
};
fUndoMute = function () {
Mute = false;
for (i in Items) {
SetVolume(Items[i].Nom, Items[i].Volume);
}
};
fCreateEnterframe = function () {
if (this.onEnterFrame == undefined) {
this.onEnterFrame = function () {
_global.objSnd.Fade();
};
}
};
fDeleteEnterframe = function () {
delete this.onEnterFrame;
};
}
Frame 9
stop();
if (_global.Param == undefined) {
_global.Param = new obj_MainParam(this);
}
_global.Param.fDoSectionActions("Loaded");
Frame 16
_global.Param.fDoSectionActions("Title");
Frame 25
_global.Param.fDoSectionActions("Help");
Frame 35
_global.Param.fDoSectionActions("Game");
Instance of Symbol 651 MovieClip "mcGame" in Frame 35
onClipEvent (keyDown) {
if (_global.Param.bPaused == false) {
_global.C.fCheckKeyPressed();
}
}
onClipEvent (keyUp) {
_global.C.fCheckKeyUnPressed();
}
Frame 45
_global.Param.fDoSectionActions("WinScreen");
Frame 55
_global.Param.fDoSectionActions("LoseScreen");
Frame 65
_global.Param.fDoSectionActions("HighScore");
Frame 75
_global.Param.fDoSectionActions("UnloadVar");
Symbol 7 Button
on (keyPress "<Left>") {
return(undefined);
}
on (keyPress "<Right>") {
return(undefined);
}
on (keyPress "<Up>") {
return(undefined);
}
on (keyPress "<Down>") {
return(undefined);
}
Symbol 707 MovieClip [__Packages.objState] Frame 0
class objState
{
var mcRef, sState, nFrTotalAnim;
function objState (P_mcRef) {
mcRef = P_mcRef;
}
function fDoAction() {
this[sState]();
}
function fPause() {
mcRef.mcState.stop();
}
function fUnPause() {
mcRef.mcState.play();
}
function fSetState(P_sState) {
if (sState != P_sState) {
sState = P_sState;
mcRef.gotoAndStop(sState);
nFrTotalAnim = mcRef.mcState._totalframes;
fDoStateInit(sState);
}
}
function fDoStateInit() {
}
}
Symbol 708 MovieClip [__Packages.obj_MainParam] Frame 0
class obj_MainParam extends objState
{
var mcRef, bPaused, nStageWidth, nStageHeight, nStageFPS, sCurrentSection, nPlayerScore, fSetState;
function obj_MainParam (P_mcRef) {
super(mcRef);
mcRef = P_mcRef;
fInitGameMain();
}
function fInitGameMain() {
bPaused = true;
nStageWidth = 600;
nStageHeight = 300;
nStageFPS = 35;
sCurrentSection = "Loaded";
nPlayerScore = 0;
}
function fDoSectionActions(P_sSection) {
fSetSection(P_sSection);
switch (P_sSection) {
case "Loaded" :
if (_global.objTrans == undefined) {
_global.objTrans = new obj_Transition(mcRef.mcTransition);
}
if (_global.objPopup == undefined) {
_global.objPopup = new obj_Popup(mcRef.mcPopup);
}
if (_global.objHS == undefined) {
_global.objHS = new objHSNick();
}
_global.objTrans.fSetTransition("UnloadVar");
break;
case "Title" :
if (_global.objSnd.bMusicPackPlaying == false) {
_global.objSnd.fCreateEnterframe();
_global.objSnd.bMusicPackPlaying = true;
_global.objSnd.fPlaySounds("sMu_pack", 0, 99999);
_global.objSnd.G_TabSonFade.push(["sMu_pack", 20, "In", 5]);
}
break;
case "Game" :
_global.objSnd.fDeleteEnterframe();
_global.objHUD = new obj_HUD(mcRef.mcHUD);
_global.objTimer = new obj_Timer();
_global.C = new obj_GameParam(mcRef.mcGame);
if (_global.objSnd.bMusicPackPlaying) {
_global.objSnd.bMusicPackPlaying = false;
_global.objSnd.G_TabSonFade.push(["sMu_pack", 0, "Out", 5]);
_global.objSnd.fPlaySounds("sMu_game", 0, 99999);
_global.objSnd.G_TabSonFade.push(["sMu_game", 20, "In", 4]);
}
break;
case "WinScreen" :
case "LoseScreen" :
mcRef.mcState.sScore = fStyleNumber(nPlayerScore);
if (_global.objHS.bHSAvailable) {
_global.objHS.fDoHSInit();
} else {
mcRef.btnViewHS._visible = false;
mcRef.btnSubmitHS._visible = false;
}
if (_global.objSnd.bMusicPackPlaying == false) {
_global.objSnd.fCreateEnterframe();
_global.objSnd.bMusicPackPlaying = true;
_global.objSnd.G_TabSonFade.push(["sMu_game", 0, "Out", 5]);
_global.objSnd.fPlaySounds("sMu_pack", 0, 99999);
_global.objSnd.G_TabSonFade.push(["sMu_pack", 20, "In", 5]);
}
break;
case "HighScore" :
mcRef.mcState.sScore = fStyleNumber(nPlayerScore);
_global.objHS.fSetHSBoard(mcRef.mcState.mcHS);
if (_global.objHS.bGetHS == true) {
_global.objHS.bGetHS = false;
_global.objHS.getScores();
}
if (_global.objHS.bSubmitHS == true) {
_global.objHS.bSubmitHS = false;
mcRef.btnSubmitHS._visible = false;
_global.objHS.submitScore(nPlayerScore);
}
if (_global.objSnd.bMusicPackPlaying == false) {
_global.objSnd.fCreateEnterframe();
_global.objSnd.bMusicPackPlaying = true;
_global.objSnd.G_TabSonFade.push(["sMu_game", 0, "Out", 5]);
_global.objSnd.fPlaySounds("sMu_pack", 0, 99999);
_global.objSnd.G_TabSonFade.push(["sMu_pack", 20, "In", 5]);
}
break;
case "UnloadVar" :
delete _global.C;
delete _global.objHUD;
delete _global.objLoad;
fSetState("Title");
fInitGameMain();
}
}
function fDoSectionActionsUnload(P_sSection) {
if (!(P_sSection === "Game")) {
} else {
delete _global.C;
delete _global.objHUD;
_global.objPopup.fSetState("Idle");
_global.objSnd.fStopSounds("sFx_freeze");
if (_global.objSnd.bMusicPackPlaying == false) {
_global.objSnd.bMusicPackPlaying = true;
_global.objSnd.fCreateEnterframe();
_global.objSnd.G_TabSonFade.push(["sMu_game", 0, "Out", 5]);
_global.objSnd.fPlaySounds("sMu_pack", 0, 99999);
_global.objSnd.G_TabSonFade.push(["sMu_pack", 40, "In", 4]);
}
}
}
function fPause() {
bPaused = true;
_global.C.mBroadcaster.broadcastMessage("fPause");
}
function fUnPause() {
bPaused = false;
_global.C.mBroadcaster.broadcastMessage("fUnPause");
_global.objPopup.fSetState("Idle");
}
function fWin() {
fPause();
_global.objTrans.fSetTransition("WinScreen");
}
function fQuit() {
fPause();
_global.objTrans.fSetTransition("LoseScreen");
}
function fPlayAgain() {
_global.objTrans.fSetTransition("UnloadVar");
}
function fHelp() {
_global.objPopup.fSetState("Help");
}
function fResumeHelp() {
if (sCurrentSection == "Game") {
_global.objPopup.fSetState("MenuOpen");
} else {
_global.objTrans.fSetTransition("Game");
}
}
function fResume() {
_global.objSnd.SetVolume("sFx_freeze", 50);
_global.objPopup.fSetState("EndMenu");
}
function fMenu() {
fPause();
_global.objSnd.SetVolume("sFx_freeze", 0);
_global.objPopup.fSetState("StartMenu");
}
function fSetSection(P_sSection) {
sCurrentSection = P_sSection;
}
function fStyleNumber(P_nNumber, P_nMinimumChar) {
var _local6 = false;
var _local1 = String(P_nNumber);
var _local7 = _local1;
do {
if (_local1.length < P_nMinimumChar) {
_local6 = true;
_local7 = "0" + _local7;
}
} while (_local7.length < P_nMinimumChar);
_local1 = _local7;
var _local3 = "";
var _local5 = _local1.length;
_local5 = _local5 / 3;
if (_local5 <= 1) {
return(_local1);
}
var _local2 = _local5;
while (_local2 > 1) {
_local3 = (" " + _local1.substr(-3)) + _local3;
_local1 = _local1.substr(0, -3);
_local2--;
}
_local7 = _local1 + _local3;
return(_local7);
}
function fSubLastNumberChar(P_sString) {
var _local3 = "";
var _local4 = P_sString.length;
var _local1 = _local4 - 1;
while (_local1 >= 0) {
var _local2 = P_sString.charAt(_local1);
if (isNaN(_local2)) {
return(_local3);
}
_local3 = _local2 + _local3;
_local1--;
}
}
}
Symbol 709 MovieClip [__Packages.obj_Transition] Frame 0
class obj_Transition
{
var mcRef, sState, mcInsideMovieClip, sNextFrameLabel, bStopSound;
function obj_Transition (P_mcRef) {
mcRef = P_mcRef;
fSetState("Idle");
fInitTrans();
}
function fDoAction() {
this[sState]();
}
function fInitTrans() {
mcInsideMovieClip = undefined;
sNextFrameLabel = "";
bStopSound = false;
}
function Idle() {
}
function StartTransition() {
if (mcRef.mcState._currentframe >= mcRef.mcState._totalframes) {
fChangeLabel();
fSetState("EndTransition");
}
}
function EndTransition() {
if (mcRef.mcState._currentframe >= mcRef.mcState._totalframes) {
fSetState("Idle");
}
}
function fSetTransition(P_sNextLabel, P_mcInsideMovieClip) {
sNextFrameLabel = P_sNextLabel;
if (P_mcInsideMovieClip != undefined) {
mcInsideMovieClip = P_mcInsideMovieClip;
}
fSetState("StartTransition");
}
function fChangeLabel() {
_global.Param.fDoSectionActionsUnload(_global.Param.sCurrentSection);
if (mcInsideMovieClip != undefined) {
var _local3 = mcInsideMovieClip;
_local3.gotoAndStop(sNextFrameLabel);
mcInsideMovieClip = undefined;
} else {
_global.Param.fSetState(sNextFrameLabel);
}
}
function fStopSound() {
if (bStopSound == true) {
bStopSound = false;
stopAllSounds();
}
}
function fSetState(P_sState) {
if (P_sState != "Idle") {
sState = P_sState;
mcRef.gotoAndStop(P_sState);
mcRef.onEnterFrame = mx.utils.Delegate.create(this, fDoAction);
} else {
sState = P_sState;
mcRef.gotoAndStop(P_sState);
delete mcRef.onEnterFrame;
}
fDoStateInit();
}
function fDoStateInit() {
mcRef.LockBtn.useHandCursor = false;
switch (sState) {
case "Idle" :
mcRef.stop();
break;
case "StartTransition" :
_global.objSnd.fPlaySounds("sFx_transition", 50, 1);
fStopSound();
}
}
}
Symbol 710 MovieClip [__Packages.mx.utils.Delegate] Frame 0
class mx.utils.Delegate extends Object
{
var func;
function Delegate (f) {
super();
func = f;
}
static function create(obj, func) {
var _local2 = function () {
var _local2 = arguments.callee.target;
var _local3 = arguments.callee.func;
return(_local3.apply(_local2, arguments));
};
_local2.target = obj;
_local2.func = func;
return(_local2);
}
function createDelegate(obj) {
return(create(obj, func));
}
}
Symbol 711 MovieClip [__Packages.obj_Popup] Frame 0
class obj_Popup extends objState
{
var mcRef, fSetState, sState, nFrTotalAnim;
function obj_Popup (P_mcRef) {
super(mcRef);
mcRef = P_mcRef;
fSetState("Idle");
}
function fDoUnpausableAction() {
this[sState]();
}
function StartMenu() {
if (mcRef.mcState._currentframe >= nFrTotalAnim) {
fSetState("MenuOpen");
}
}
function MenuOpen() {
}
function EndMenu() {
if (mcRef.mcState._currentframe >= nFrTotalAnim) {
_global.Param.fUnPause();
}
}
function Help() {
}
function Intro() {
if (mcRef.mcState._currentframe >= nFrTotalAnim) {
_global.Param.fUnPause();
}
}
function Blocker() {
}
function fDoStateInit() {
mcRef.mcBlocker.useHandCursor = false;
switch (sState) {
case "Idle" :
break;
case "Intro" :
break;
case "StartMenu" :
break;
case "MenuOpen" :
break;
case "EndMenu" :
}
}
}
Symbol 712 MovieClip [__Packages.objHSNick] Frame 0
class objHSNick
{
var bHSAvailable, bTestHighScore, bSubmitHS, bGetHS, sGameID, mcHSZone, NoTxtField, NameTxtField, ScoreTxtField;
function objHSNick () {
bHSAvailable = true;
bTestHighScore = false;
bSubmitHS = false;
bGetHS = false;
sGameID = "mm_fart";
mcHSZone = undefined;
if (bTestHighScore == true) {
_global.gProxyObj.setServer("www.nick.com");
_global.gProxyObj.setScreenName("programmer");
_global.gProxyObj.setIsLoggedIn(true);
}
}
function getScores() {
if (_global.gProxyObj == undefined) {
listScores();
} else {
_global.gProxyObj.getScores(cbFunc2);
}
}
function submitScore(theScore) {
NoTxtField.text = "";
NameTxtField.text = "The high score list is updating!";
ScoreTxtField.text = "";
_global.gProxyObj.submitScore(theScore, cbFunc);
}
function initHiScores() {
_global.gProxyObj.setGame_Id(sGameID);
}
function getScoreString() {
NoTxtField = mcHSZone.txtHSNumber;
NameTxtField = mcHSZone.txtHSName;
ScoreTxtField = mcHSZone.txtHSScore;
var _local11 = "Oops! The high score list is not available right now!";
if (_global.gProxyObj != undefined) {
var _local7 = _global.gProxyObj.getScoreCount();
if (_local7 > 0) {
var _local3;
var _local4;
var _local5;
var _local6;
_local11 = "";
var _local10 = "";
var _local9 = "";
var _local8 = "";
_local3 = 0;
while (_local3 < _local7) {
_local4 = _global.gProxyObj.getScoreItem(_local3);
_local5 = _local4[0];
_local6 = _global.Param.fStyleNumber(_local4[1]);
_local10 = _local10 + ((_local3 + 1) + newline);
_local9 = _local9 + (_local5 + newline);
_local8 = _local8 + ((_local6 + " pts") + newline);
_local3++;
}
NoTxtField.text = _local10;
NameTxtField.text = _local9;
ScoreTxtField.text = _local8;
} else {
NameTxtField.text = "Oops! The high score list is not available right now!";
}
} else {
NameTxtField.text = "Oops! The high score list is not available right now!";
}
return(_local11);
}
function listScores() {
getScoreString();
}
function cbFunc(thisBool) {
if (thisBool) {
_global.objHS.listScores();
} else {
_global.objHS.NameTxtField.text = "Oops! The high score list is not available right now!";
}
}
function cbFunc2(thisBool) {
if (thisBool) {
_global.objHS.listScores();
} else {
_global.objHS.NameTxtField.text = "Oops! The high score list is not available right now!";
}
}
function fDoHSInit() {
initHiScores();
if (_global.gProxyObj.getIsLoggedIn()) {
_global.Param.mcRef.btnSubmitHS._visible = true;
} else {
_global.Param.mcRef.btnSubmitHS._visible = false;
}
}
function fDoSubmitHS() {
_global.objTrans.fSetTransition("HighScore");
bSubmitHS = true;
}
function fDoViewHS() {
_global.objTrans.fSetTransition("HighScore");
bGetHS = true;
}
function fSetHSBoard(P_mcRef) {
if (_global.gProxyObj.getIsLoggedIn()) {
_global.Param.mcRef.btnSubmitHS._visible = true;
} else {
_global.Param.mcRef.btnSubmitHS._visible = false;
}
mcHSZone = P_mcRef;
}
}
Symbol 713 MovieClip [__Packages.obj_HUD] Frame 0
class obj_HUD
{
var mcRef, objGrossMeter, objPowerMeter, objFocusMeter, objAttack1, objAttack2, objAttack3;
function obj_HUD (P_mcRef) {
mcRef = P_mcRef;
}
function fInitHUDMeter() {
mcRef.mcNPC.gotoAndStop("Idle");
objGrossMeter = new obj_Meter(mcRef.mcGrossMeter, 100, "Fix", "Gross");
objPowerMeter = new obj_Meter(mcRef.mcPowerMeter, 100, "Add", "Power");
objFocusMeter = new obj_Meter(mcRef.mcFocusMeter, 100, "Fix", "Focus");
objAttack1 = new obj_AttackIcon(mcRef.mcAttack1, "Attack1", 10);
objAttack2 = new obj_AttackIcon(mcRef.mcAttack2, "Attack2", 20);
objAttack3 = new obj_AttackIcon(mcRef.mcAttack3, "Attack3", 60);
_global.C.fAddBroadcastObj(objGrossMeter);
_global.C.fAddBroadcastObj(objPowerMeter);
_global.C.fAddBroadcastObj(objFocusMeter);
_global.C.fAddBroadcastObj(objAttack1);
_global.C.fAddBroadcastObj(objAttack2);
_global.C.fAddBroadcastObj(objAttack3);
}
function fInitHUD() {
fSetMeter("Gross");
fSetMeter("Power");
fSetMeter("Focus");
fSetPoint();
fSetLevel();
}
function fSetPoint() {
mcRef.sScore = _global.Param.fStyleNumber(_global.Param.nPlayerScore);
}
function fSetLevel() {
mcRef.sLevel = _global.Param.fStyleNumber(_global.C.nCurrentLevel, 2);
}
function fSetMeter(P_sMeter) {
this[("obj" + P_sMeter) + "Meter"].mcRef.gotoAndStop(100);
}
function fAddMeter(P_sMeter, P_nValue) {
this[("obj" + P_sMeter) + "Meter"].fSetLife(P_nValue);
}
function fReturnMeterFill(P_sMeter) {
return(this[("obj" + P_sMeter) + "Meter"].nLifeToGo);
}
function fReturnPowerCost(P_sAttack) {
return(this["obj" + P_sAttack].fReturnPowerCost());
}
}
Symbol 714 MovieClip [__Packages.obj_Meter] Frame 0
class obj_Meter extends objState
{
var mcRef, sType, sMeter, nLifeToGo, nDelayToDo, nDelayDone, fSetState;
function obj_Meter (P_mcRef, P_nLife, P_sType, P_sMeter) {
super();
mcRef = P_mcRef;
sType = P_sType;
sMeter = P_sMeter;
mcRef.gotoAndStop(P_nLife);
nLifeToGo = mcRef._currentframe;
nDelayToDo = 15;
nDelayDone = 0;
fSetState("Idle");
}
function Idle() {
nDelayDone++;
if (nDelayDone >= nDelayToDo) {
nDelayDone = 0;
if (sType == "Sub") {
fSetLife(-1);
} else if (sType == "Add") {
fSetLife(1);
}
}
if (mcRef._currentframe < nLifeToGo) {
mcRef.nextFrame();
} else if (mcRef._currentframe > nLifeToGo) {
mcRef.prevFrame();
} else {
nLifeToGo = mcRef._currentframe;
}
if (mcRef._currentframe <= 1) {
switch (sMeter) {
case "Focus" :
_global.C.objNPCPlayer.fGetDie();
_global.C.fRemoveBroadcastObj(this);
break;
case "Gross" :
_global.C.objPlayer.fGetDie();
_global.C.fRemoveBroadcastObj(this);
break;
case "Power" :
}
}
}
function fSetLife(P_nLife) {
nLifeToGo = nLifeToGo + P_nLife;
if (nLifeToGo < 0) {
nLifeToGo = 0;
}
if (nLifeToGo > 100) {
nLifeToGo = 100;
}
_global.C.mBroadcaster.broadcastMessage("fCheckManaRemaining");
}
function fPause() {
mcRef.mcMeterEffect.stop();
}
function fUnPause() {
mcRef.mcMeterEffect.play();
}
}
Symbol 715 MovieClip [__Packages.obj_AttackIcon] Frame 0
class obj_AttackIcon extends objState
{
var mcRef, nAttackPowerCost, sAttackName, fSetState;
function obj_AttackIcon (P_mcRef, P_sAttackName, P_nAttackPowerCost) {
super();
mcRef = P_mcRef;
nAttackPowerCost = P_nAttackPowerCost;
sAttackName = P_sAttackName;
fSetState(sAttackName);
}
function fCheckManaRemaining() {
if (_global.objHUD.fReturnMeterFill("Power") < nAttackPowerCost) {
fSetState(sAttackName + "Mana");
} else {
fSetState(sAttackName);
}
}
function fReturnPowerCost(P_sAttack) {
return(nAttackPowerCost);
}
}
Symbol 716 MovieClip [__Packages.obj_Timer] Frame 0
class obj_Timer extends objState
{
var fSetState, nDelayToUpdate, nTickTime, nHour, nMinute, nSeconde, mcRefToSet, sTimerMode;
function obj_Timer () {
super();
fSetState("Stop");
}
function fInitTimer(P_nHour, P_nMinute, P_nSeconde, P_mcRef, P_sTimerMode) {
nDelayToUpdate = 0;
nTickTime = 0;
nHour = P_nHour;
nMinute = P_nMinute;
nSeconde = P_nSeconde;
fGetTickTime();
mcRefToSet = P_mcRef;
sTimerMode = P_sTimerMode;
fSetTimeStyle();
fSetState(sTimerMode);
}
function fGetTickTime() {
nTickTime = nTickTime + (nHour * 3600000);
nTickTime = nTickTime + (nMinute * 60000);
nTickTime = nTickTime + (nSeconde * 1000);
}
function Restricted() {
var _local3 = 1000 / _global.Param.nStageFPS;
nDelayToUpdate++;
fAddTime(-_local3);
if (nDelayToUpdate == 2) {
nDelayToUpdate = 0;
fSetTimeStyle();
fValidTimer();
}
}
function OpenUp() {
var _local3 = _global.Param.nStageFPS;
nDelayToUpdate++;
fAddTime(_local3);
if (nDelayToUpdate == 2) {
nDelayToUpdate = 0;
fSetTimeStyle();
}
}
function fValidTimer() {
if (sTimerMode == "Restricted") {
if (nTickTime <= 0) {
_global.C.fTimeOut();
}
}
}
function fAddTime(P_nTime) {
nTickTime = nTickTime + P_nTime;
}
function fSetTimeStyle() {
var _local6 = "";
var _local8 = "";
var _local10 = "";
var _local3 = nTickTime;
if (_local3 >= 0) {
if (_local3 >= 3600000) {
var _local5 = Math.floor(_local3 / 3600000);
_local3 = _local3 - (_local5 * 3600000);
nHour = _local5;
_local6 = _global.Param.fStyleNumber(_local5);
}
if (_local3 >= 60000) {
var _local9 = Math.floor(_local3 / 60000);
_local3 = _local3 - (_local9 * 60000);
nMinute = _local9;
_local8 = _global.Param.fStyleNumber(_local9, 2);
} else {
nMinute = 0;
_local8 = "00";
}
if (_local3 >= 1000) {
var _local7 = Math.floor(_local3 / 1000);
_local3 = _local3 - (_local7 * 1000);
nSeconde = _local7;
_local10 = _global.Param.fStyleNumber(_local7, 2);
} else {
nSeconde = 0;
_local10 = "00";
}
var _local4 = "";
if (_local6 != "") {
_local4 = _local6 + ":";
}
_local4 = _local4 + ((_local8 + " : ") + _local10);
mcRefToSet.sTimer = _local4;
} else {
var _local4 = "";
nTickTime = 0;
mcRefToSet.sTimer = "00 : 00";
}
}
}
Symbol 717 MovieClip [__Packages.obj_GameParam] Frame 0
class obj_GameParam extends objState
{
var mcRef, bInit, mBroadcaster, nCurrentLevel, nGravity, nObjectIndex, nEnemyKilled, nEnemyAdded, nCurrentEnemyActive, nPointToHad, aBonusItemPosY, bFreezeTimeActive, bCTRLReleased, nDelayFreezeEnemyDone, nDelayFreezeEnemyToDo, aIndexSwapDepth, objBKG, objPlayer, objNPCPlayer, nDelayAddEnemyToDo, nDelayAddEnemyDone;
function obj_GameParam (P_mcRef) {
super(mcRef);
mcRef = P_mcRef;
mcRef.onEnterFrame = mx.utils.Delegate.create(this, fEnterFrame);
fInitGameVars();
}
function fEnterFrame() {
if (bInit == false) {
bInit = true;
fInitGameLevel();
} else if (_global.Param.bPaused == false) {
_global.objSnd.Fade();
fManageEnemy();
fCheckFreezeTime();
fCheckPointToHad();
mBroadcaster.broadcastMessage("fDoAction");
} else {
_global.objSnd.Fade();
mBroadcaster.broadcastMessage("fDoUnpausableAction");
}
}
function fInitGameVars() {
nCurrentLevel = 0;
nGravity = 0.85;
nObjectIndex = 1;
nEnemyKilled = 0;
nEnemyAdded = 0;
nCurrentEnemyActive = 0;
nPointToHad = 0;
aBonusItemPosY = [40, 180];
bFreezeTimeActive = false;
bCTRLReleased = true;
nDelayFreezeEnemyDone = 0;
nDelayFreezeEnemyToDo = 200;
mBroadcaster = new Object();
AsBroadcaster.initialize(mBroadcaster);
bInit = false;
aIndexSwapDepth = new Array();
aIndexSwapDepth[0] = {sType:"BonusItem", nCurrentDepth:25000, nBaseDepth:25000, nLimitDepth:49999};
aIndexSwapDepth[1] = {sType:"EasterEgg", nCurrentDepth:50000, nBaseDepth:50000, nLimitDepth:99999};
aIndexSwapDepth[2] = {sType:"Enemy", nCurrentDepth:100000, nBaseDepth:100000, nLimitDepth:199999};
aIndexSwapDepth[3] = {sType:"Character", nCurrentDepth:200000, nBaseDepth:200000, nLimitDepth:299999};
aIndexSwapDepth[4] = {sType:"Player", nCurrentDepth:400000, nBaseDepth:400000, nLimitDepth:400000};
aIndexSwapDepth[5] = {sType:"Particle", nCurrentDepth:500000, nBaseDepth:500000, nLimitDepth:599999};
aIndexSwapDepth[6] = {sType:"Remove", nCurrentDepth:800000, nBaseDepth:800000, nLimitDepth:810000};
}
function fInitGameLevel() {
objBKG = new obj_BKG(_global.Param.mcRef.mcState);
fAddBroadcastObj(objBKG);
objPlayer = new obj_Player(objBKG.mcRef.mcPlayer);
fAddBroadcastObj(objPlayer);
objNPCPlayer = new obj_NPCPlayer(objBKG.mcRef.mcNPCPlayer);
fAddBroadcastObj(objNPCPlayer);
_global.objHUD.fInitHUDAttackMenu();
_global.objHUD.fInitHUDMeter();
_global.objHUD.fInitHUD();
fAddBroadcastObj(_global.objPopup);
objBKG.fZoomOnPlayer(objPlayer.mcRef);
fSetCurrentLevel(1);
_global.Param.fPause();
_global.objPopup.fSetState("Intro");
}
function fCheckKeyPressed() {
if (_global.Param.bPaused == false) {
switch (Key.getCode()) {
case 39 :
objPlayer.fSetKey("Right", true);
break;
case 37 :
objPlayer.fSetKey("Left", true);
break;
case 38 :
objPlayer.fSetKey("Up", true);
break;
case 40 :
objPlayer.fSetKey("Down", true);
break;
case 32 :
objPlayer.fSetKey("Attack1", true);
break;
case 16 :
objPlayer.fSetKey("Attack3", true);
break;
case 17 :
if (bCTRLReleased) {
objPlayer.fSetKey("Attack2", true);
bCTRLReleased = false;
} else {
objPlayer.fSetKey("Attack2", false);
}
}
}
}
function fCheckKeyUnPressed() {
switch (Key.getCode()) {
case 39 :
objPlayer.fSetKey("Right", false);
break;
case 37 :
objPlayer.fSetKey("Left", false);
break;
case 38 :
objPlayer.fSetKey("Up", false);
break;
case 40 :
objPlayer.fSetKey("Down", false);
break;
case 32 :
objPlayer.fSetKey("Attack1", false);
break;
case 16 :
objPlayer.fSetKey("Attack3", false);
break;
case 17 :
objPlayer.fSetKey("Attack2", false);
bCTRLReleased = true;
break;
case 69 :
mBroadcaster.broadcastMessage("fEasterEgg");
}
}
function fEndLevel() {
if (nCurrentLevel >= 20) {
_global.Param.fWin();
} else {
_global.Param.fQuit();
}
}
function fSetCurrentLevel(P_nValue) {
nCurrentLevel = nCurrentLevel + P_nValue;
_global.objHUD.fSetLevel();
nDelayAddEnemyToDo = 290;
if (nDelayAddEnemyToDo < 150) {
nDelayAddEnemyToDo = 150;
}
}
function fSetEnemyActive(P_nValue) {
nCurrentEnemyActive = nCurrentEnemyActive + P_nValue;
if (P_nValue < 0) {
nEnemyKilled++;
fAddBonusItem();
} else {
nEnemyAdded++;
}
}
function fManageEnemy() {
if (bFreezeTimeActive == false) {
nDelayAddEnemyDone++;
if (nDelayAddEnemyDone >= nDelayAddEnemyToDo) {
nDelayAddEnemyDone = 0;
if (nCurrentEnemyActive <= 5) {
fAddEnemy();
}
}
}
}
function fFreezeEnemy() {
nDelayFreezeEnemyDone = 0;
if (bFreezeTimeActive == false) {
_global.objSnd.fPlaySounds("sFx_freeze", 50, 999999);
}
bFreezeTimeActive = true;
_global.C.mBroadcaster.broadcastMessage("fFreeze");
}
function fCheckFreezeTime() {
if (bFreezeTimeActive) {
nDelayFreezeEnemyDone++;
if (nDelayFreezeEnemyDone >= nDelayFreezeEnemyToDo) {
nDelayFreezeEnemyDone = 0;
_global.objSnd.fStopSounds("sFx_freeze");
_global.C.mBroadcaster.broadcastMessage("fUnFreeze");
bFreezeTimeActive = false;
}
}
}
function fAddBroadcastObj(P_obj) {
mBroadcaster.addListener(P_obj);
}
function fRemoveBroadcastObj(P_obj) {
mBroadcaster.removeListener(P_obj);
}
function fManagePoint(P_nPoint) {
nPointToHad = nPointToHad + P_nPoint;
}
function fCheckPointToHad() {
if (nPointToHad > 0) {
var _local2 = 30;
if (nPointToHad < _local2) {
fAddPoint(nPointToHad);
nPointToHad = 0;
} else {
nPointToHad = nPointToHad - _local2;
fAddPoint(_local2);
}
}
}
function fAddPoint(P_nPoint) {
_global.Param.nPlayerScore = _global.Param.nPlayerScore + P_nPoint;
_global.objHUD.fSetPoint();
}
function fRemoveInstance(P_mcRef) {
P_mcRef.swapDepths(fReturnDepth("Remove"));
P_mcRef.removeMovieClip();
}
function fRemoveObject(P_sName) {
delete this[P_sName];
}
function fReturnDepth(P_sType) {
for (var _local3 in aIndexSwapDepth) {
if (aIndexSwapDepth[_local3].sType == P_sType) {
aIndexSwapDepth[_local3].nCurrentDepth++;
if (aIndexSwapDepth[_local3].nCurrentDepth > aIndexSwapDepth[_local3].nLimitDepth) {
aIndexSwapDepth[_local3].nCurrentDepth = aIndexSwapDepth[_local3].nBaseDepth;
}
return(aIndexSwapDepth[_local3].nCurrentDepth);
}
}
}
function fReturnCharacterDepth(P_mcRef) {
var _local5 = false;
var _local2 = 1;
var _local4 = 200000 /* 0x030D40 */;
while (_local5 == false) {
if (objBKG.mcRef.getInstanceAtDepth((_local4 + Math.floor(P_mcRef._y)) + _local2) == undefined) {
P_mcRef.swapDepths((_local4 + Math.floor(P_mcRef._y)) + _local2);
_local5 = true;
} else {
_local2++;
}
}
}
function fAddEnemy() {
var _local2 = "Object" + nObjectIndex;
var _local3 = objBKG.mcRef.attachMovie("mcEnemy", _local2, fReturnDepth("Enemy"));
var _local5 = objBKG.mcRef["mcEnemySP" + (random(4) + 1)];
_local3._x = _local5._x;
_local3._y = _local5._y;
if (((nEnemyAdded % 5) == 0) && (nEnemyAdded != 0)) {
var _local4 = 20 + random(nCurrentLevel * 4);
if (_local4 > 100) {
_local4 = 100;
}
this[_local2] = new obj_Enemy(_local3, _local4, true);
} else {
var _local4 = 10 + random(nCurrentLevel * 4);
if (_local4 > 100) {
_local4 = 100;
}
this[_local2] = new obj_Enemy(_local3, _local4, false);
}
fAddBroadcastObj(this[_local2]);
nObjectIndex++;
}
function fAddSlice(P_mcRef) {
var _local3 = "Object" + nObjectIndex;
var _local4 = objBKG.mcRef.attachMovie("mcAttack3Slice", _local3, fReturnDepth("Particle"));
_local4._x = P_mcRef._x;
_local4._y = P_mcRef._y;
this[_local3] = new obj_Slice(_local4);
fAddBroadcastObj(this[_local3]);
nObjectIndex++;
_global.objSnd.fPlaySounds("sFx_enemyHurt", 50, 1);
}
function fAddBonusItem() {
var _local4 = 2;
if (nCurrentLevel >= 12) {
_local4 = 1;
}
if ((nEnemyKilled % _local4) == 0) {
var _local2 = "Object" + nObjectIndex;
var _local3 = objBKG.mcRef.attachMovie("mcBonusItem", _local2, fReturnDepth("BonusItem"));
_local3._x = random(800) + 200;
_local3._y = aBonusItemPosY[random(aBonusItemPosY.length)];
this[_local2] = new obj_BonusItem(_local3);
fAddBroadcastObj(this[_local2]);
nObjectIndex++;
}
}
function fAddMeatExplosionSFX(P_mcRef, P_nDamage) {
_global.objSnd.fPlaySounds("sFx_enemyHurt", 30, 1);
var _local6 = 0;
while (_local6 < P_nDamage) {
var _local5 = "Object" + nObjectIndex;
var _local3 = objBKG.mcRef.attachMovie("mcMeatParticle" + random(2), _local5, fReturnDepth("Particle"));
_local3._x = P_mcRef._x;
_local3._y = P_mcRef._y - (P_mcRef._height / 2);
_local3._rotation = random(360);
_local3._xscale = (_local3._yscale = random(70) + 30);
this[_local5] = new obj_Particle(_local3, random(10) + 1, -10 + random(10), 1);
fAddBroadcastObj(this[_local5]);
nObjectIndex++;
_local5 = "Object" + nObjectIndex;
_local3 = objBKG.mcRef.attachMovie("mcMeatParticle" + random(2), _local5, fReturnDepth("Particle"));
_local3._x = P_mcRef._x;
_local3._y = P_mcRef._y - (P_mcRef._height / 2);
_local3._rotation = random(360);
_local3._xscale = (_local3._yscale = random(70) + 30);
this[_local5] = new obj_Particle(_local3, random(10) + 1, -8 + random(10), -1);
fAddBroadcastObj(this[_local5]);
nObjectIndex++;
_local6++;
}
}
function fAddEnemyExplosionSFX(P_mcRef) {
_global.objSnd.fPlaySounds("sFx_enemyDie", 30, 1);
var _local3 = 2;
while (_local3 < 4) {
var _local6 = "Object" + nObjectIndex;
var _local4 = objBKG.mcRef.attachMovie("mcMeatParticle" + _local3, _local6, fReturnDepth("Particle"));
_local4._x = P_mcRef._x;
_local4._y = P_mcRef._y - (P_mcRef._height / 2);
_local4._rotation = random(360);
var _local7 = 1;
if (_local3 == 3) {
_local7 = -1;
}
this[_local6] = new obj_Particle(_local4, random(10) + 1, (5 + random(8)) * _local7, 1);
fAddBroadcastObj(this[_local6]);
nObjectIndex++;
_local6 = "Object" + nObjectIndex;
_local4 = objBKG.mcRef.attachMovie("mcMeatParticle" + _local3, _local6, fReturnDepth("Particle"));
_local4._x = P_mcRef._x;
_local4._y = P_mcRef._y - (P_mcRef._height / 2);
_local4._rotation = random(360);
_local7 = 1;
if (_local3 == 3) {
_local7 = -1;
}
this[_local6] = new obj_Particle(_local4, random(10) + 1, (5 + random(8)) * _local7, -1);
fAddBroadcastObj(this[_local6]);
nObjectIndex++;
_local3++;
}
}
function fAddClamExplosionSFX(P_mcRef, P_nDirection) {
var _local4 = 0;
while (_local4 < 6) {
var _local3 = "Object" + nObjectIndex;
var _local2 = objBKG.mcRef.attachMovie("mcClamParticle", _local3, fReturnDepth("Particle"));
_local2._x = P_mcRef._x + (25 * P_nDirection);
_local2._y = (P_mcRef._y - P_mcRef._height) + 25;
_local2._rotation = random(360);
_local2._xscale = (_local2._yscale = random(70) + 30);
this[_local3] = new obj_Particle(_local2, random(7) + 1, -5 + random(2), P_nDirection);
fAddBroadcastObj(this[_local3]);
nObjectIndex++;
_local4++;
}
}
function fAddEasterEggSFX(P_mcRef, P_nDirection) {
var _local3 = "Object" + nObjectIndex;
var _local2 = objBKG.mcRef.attachMovie("mcEasterEgg", _local3, fReturnDepth("EasterEgg"));
_local2._x = P_mcRef._x;
_local2._y = (P_mcRef._y - (P_mcRef._height / 2)) + 20;
_local2._xscale = _local2._xscale * P_nDirection;
this[_local3] = new obj_EasterEgg(_local2);
fAddBroadcastObj(this[_local3]);
nObjectIndex++;
}
function fThrowProjectile(P_mcRef, P_sType, P_nDirection) {
switch (P_sType) {
case "Vomit" :
var _local3 = "Object" + nObjectIndex;
var _local4 = objBKG.mcRef.attachMovie("mcVomitProjectile", _local3, fReturnDepth("Particle"));
_local4._x = P_mcRef._x + (((P_mcRef._width / 2) - 10) * P_nDirection);
_local4._y = (P_mcRef._y - P_mcRef._height) + 30;
this[_local3] = new obj_Projectile(_local4, "Ballistic", false, 10, 7.5, -3.5, P_nDirection);
fAddBroadcastObj(this[_local3]);
nObjectIndex++;
break;
case "Clam" :
_local3 = "Object" + nObjectIndex;
_local4 = objBKG.mcRef.attachMovie("mcClamProjectile", _local3, fReturnDepth("Particle"));
_local4._x = P_mcRef._x + (((P_mcRef._width / 2) - 10) * P_nDirection);
_local4._y = (P_mcRef._y - P_mcRef._height) + 30;
this[_local3] = new obj_Projectile(_local4, "Direct", true, 20, 15, 0, P_nDirection);
fAddBroadcastObj(this[_local3]);
nObjectIndex++;
}
}
}
Symbol 718 MovieClip [__Packages.obj_BKG] Frame 0
class obj_BKG extends objState
{
var mcRef, mcZoomOn, fSetState, sState, nZoomSpeed, nZoomDirection, nStompPower, nStompDirection;
function obj_BKG (P_mcRef) {
super();
mcRef = P_mcRef;
mcZoomOn = undefined;
fSetState("Idle");
}
function fDoUnpausableAction() {
if (sState == "Zoom") {
this[sState]();
}
}
function Zoom() {
var _local4 = mcZoomOn.getBounds(_global.Param.mcRef);
var _local3 = (_local4.xMin + _local4.xMax) / 2;
nZoomSpeed = nZoomSpeed - 1;
if (nZoomSpeed < 15) {
nZoomSpeed = 15;
}
if ((_local3 >= ((_global.Param.nStageWidth / 2) - 30)) && (_local3 <= ((_global.Param.nStageWidth / 2) + 30))) {
fSetState("Idle");
} else if (nZoomDirection == 1) {
if ((_local3 + nZoomSpeed) >= (_global.Param.nStageWidth / 2)) {
var _local5 = Math.abs((_global.Param.nStageWidth / 2) - (_local3 + nZoomSpeed));
if ((mcRef._x + _local5) > 0) {
mcRef._x = 0;
} else {
mcRef._x = mcRef._x + _local5;
}
fSetState("Idle");
} else if ((mcRef._x + nZoomSpeed) > 0) {
mcRef._x = 0;
fSetState("Idle");
} else {
mcRef._x = mcRef._x + (nZoomSpeed * nZoomDirection);
}
} else if (nZoomDirection == -1) {
if ((_local3 - nZoomSpeed) <= (_global.Param.nStageWidth / 2)) {
var _local5 = Math.abs((_local3 - nZoomSpeed) - (_global.Param.nStageWidth / 2));
if ((mcRef._x - _local5) < -600) {
mcRef._x = -600;
} else {
mcRef._x = mcRef._x - _local5;
}
fSetState("Idle");
} else if ((mcRef._x - nZoomSpeed) < -600) {
mcRef._x = -600;
fSetState("Idle");
} else {
mcRef._x = mcRef._x + (nZoomSpeed * nZoomDirection);
}
}
}
function Stomp() {
if (nStompPower == 0) {
mcRef._y = 0;
fSetState("Idle");
} else {
mcRef._y = 0 + (nStompPower * nStompDirection);
nStompPower = nStompPower - (random(3) + 1);
nStompDirection = nStompDirection * (-nStompDirection);
if (nStompPower < 0) {
nStompPower = 0;
}
}
}
function fFollowPlayer(P_nMoveValue, P_nDirection) {
var _local3 = _global.C.objPlayer.mcRef.getBounds(_global.Param.mcRef);
var _local5 = (_local3.xMin + _local3.xMax) / 2;
if (((P_nDirection == -1) && (_local5 <= ((_global.Param.nStageWidth / 2) - 30))) || ((P_nDirection == 1) && (_local5 >= ((_global.Param.nStageWidth / 2) + 20)))) {
if (P_nDirection == -1) {
if ((mcRef._x + P_nMoveValue) > 0) {
mcRef._x = 0;
} else {
mcRef._x = mcRef._x + P_nMoveValue;
}
} else if ((mcRef._x + P_nMoveValue) < -600) {
mcRef._x = -600;
} else {
mcRef._x = mcRef._x + P_nMoveValue;
}
}
}
function fZoomOnPlayer(P_mcRef, P_nSpeed) {
mcZoomOn = P_mcRef;
var _local3 = mcZoomOn.getBounds(_global.Param.mcRef);
var _local4 = (_local3.xMin + _local3.xMax) / 2;
if (_local4 <= (_global.Param.nStageWidth / 2)) {
nZoomDirection = 1;
}
if (_local4 > (_global.Param.nStageWidth / 2)) {
nZoomDirection = -1;
}
mcRef._y = 0;
if (P_nSpeed == undefined) {
nZoomSpeed = 30;
} else {
nZoomSpeed = P_nSpeed;
}
fSetState("Zoom");
}
function fStartStomp(P_nStompPower) {
nStompPower = Math.floor(P_nStompPower / 40);
if (nStompPower < 0) {
nStompPower = 0;
}
if (nStompPower > 10) {
nStompPower = 10;
}
_global.objSnd.fPlaySounds("sFx_stomp", nStompPower * 10, 1);
nStompDirection = 1;
fSetState("Stomp");
}
}
Symbol 719 MovieClip [__Packages.obj_Player] Frame 0
class obj_Player extends objState
{
var mcRef, nHeightStomp, nDirection, nSpeed, nSpeedMax, nSpeedAccel, nBaseJumpPower, nAttack1Power, bSlideEnabled, bAddParticleToAttack, bKeyLeft, bKeyUp, bKeyRight, bKeyDown, bKeyAttack1, bKeyAttack2, bKeyAttack3, bDieOnGround, objStageLimit, fSetState, sState, nFrTotalAnim, nAttack3StartPosX, nAttack3StartPosY, nAttack3StartDepth, aEnemyActive, nJumpPower;
function obj_Player (P_mcRef) {
super();
mcRef = P_mcRef;
nHeightStomp = 0;
nDirection = 1;
nSpeed = 0;
nSpeedMax = 8;
nSpeedAccel = 0.8;
nBaseJumpPower = 11;
nAttack1Power = 15 + random(5);
bSlideEnabled = false;
bAddParticleToAttack = true;
bKeyLeft = false;
bKeyUp = false;
bKeyRight = false;
bKeyDown = false;
bKeyAttack1 = false;
bKeyAttack2 = false;
bKeyAttack3 = false;
bDieOnGround = false;
objStageLimit = new Object();
objStageLimit.nLeft = 20;
objStageLimit.nRight = 1100;
fSetState("Idle");
mcRef.swapDepths(_global.C.fReturnDepth("Player"));
}
function fDoUnpausableAction() {
if (sState == "Die") {
this[sState]();
}
}
function fSetKey(P_sKey, P_bPressed) {
this["bKey" + P_sKey] = P_bPressed;
}
function fCheckKey() {
switch (sState) {
case "Idle" :
if (bKeyUp) {
fStartJump(nBaseJumpPower);
} else if (bKeyDown) {
fSetState("Crouch");
} else if (bKeyAttack1) {
fStartAttack("Attack1");
} else if (bKeyAttack2) {
fStartAttack("Attack2");
} else if (bKeyAttack3) {
fStartAttack("Attack3");
} else if (bKeyLeft) {
if (nSpeed == 0) {
nDirection = -1;
}
fSetState("Run");
} else if (bKeyRight) {
if (nSpeed == 0) {
nDirection = 1;
}
fSetState("Run");
} else {
fDeccel();
}
break;
case "Run" :
if (bKeyAttack1) {
fStartAttack("Attack1");
} else if (bKeyAttack2) {
fStartAttack("Attack2");
} else if (bKeyAttack3) {
fStartAttack("Attack3");
}
if (bKeyUp) {
fStartJump(nBaseJumpPower);
}
if (bKeyDown) {
fSetState("Crouch");
} else if (bKeyLeft) {
fMoveLR(-1);
} else if (bKeyRight) {
fMoveLR(1);
} else {
fDeccel();
}
break;
case "Jump" :
case "HurtJump" :
case "Hurt" :
if (bKeyLeft) {
fMoveLR(-1);
} else if (bKeyRight) {
fMoveLR(1);
} else {
fDeccel();
}
break;
case "Crouch" :
if (bKeyDown == false) {
fSetState("Idle");
} else if (bKeyUp) {
fStartJump(nBaseJumpPower);
} else if (bKeyAttack1) {
fStartAttack("Attack1");
} else if (bKeyAttack2) {
fStartAttack("Attack2");
} else if (bKeyAttack3) {
fStartAttack("Attack3");
} else if (bKeyLeft) {
if (nSpeed == 0) {
nDirection = -1;
}
if (nDirection == -1) {
mcRef._xscale = -100;
}
} else {
if (!bKeyRight) {
break;
}
if (nSpeed == 0) {
nDirection = 1;
}
if (nDirection != 1) {
break;
}
mcRef._xscale = 100;
}
}
}
function Idle() {
fCheckKey();
}
function Run() {
fCheckKey();
var _local3 = {x:0, y:0};
_local3.x = mcRef._x;
_local3.y = mcRef._y;
_global.C.objBKG.mcRef.localToGlobal(_local3);
if (!_global.C.objBKG.mcRef.mcBKGHitArea.hitTest(_local3.x, _local3.y, true)) {
fStartJump(0);
}
}
function Jump() {
fCheckKey();
fCheckHitGround("Idle");
}
function HurtJump() {
fCheckKey();
fCheckHitGround("Idle");
}
function Crouch() {
fDeccel();
fCheckKey();
}
function Hurt() {
fCheckKey();
if (mcRef.mcState._currentframe >= nFrTotalAnim) {
fSetState("Idle");
}
}
function Die() {
if (mcRef.mcState._currentframe >= nFrTotalAnim) {
_global.C.fEndLevel();
_global.C.fRemoveBroadcastObj(this);
} else if (bDieOnGround == false) {
fCheckHitGround("Die");
}
}
function StartAttack1() {
fMoveLR(nDirection);
fCheckHitGround("Idle");
_global.C.mBroadcaster.broadcastMessage("fCheckEnemyCollide", this, true);
}
function StartAttack2() {
if (mcRef.mcState._currentframe >= nFrTotalAnim) {
_global.C.fThrowProjectile(mcRef, "Clam", nDirection);
if (bAddParticleToAttack) {
_global.C.fAddClamExplosionSFX(mcRef, nDirection);
}
bKeyAttack2 = false;
fSetState("EndAttack2");
} else {
fDeccel();
}
}
function EndAttack2() {
if (mcRef.mcState._currentframe >= nFrTotalAnim) {
fSetState("Idle");
} else {
fDeccel();
}
}
function StartAttack3() {
if (mcRef.mcState._currentframe >= nFrTotalAnim) {
nAttack3StartPosX = mcRef._x;
nAttack3StartPosY = mcRef._y;
nAttack3StartDepth = mcRef.getDepth();
mcRef.swapDepths(_global.C.fReturnDepth("Player"));
fGetNextEnemy();
}
}
function Attack3() {
if (mcRef.mcState._currentframe >= nFrTotalAnim) {
_global.C[aEnemyActive[0]].fSetState("Die");
_global.C.fAddSlice(_global.C[aEnemyActive[0]].mcRef);
aEnemyActive.splice(0, 1);
fSetState("Attack3Fade");
}
}
function Attack3Fade() {
if (mcRef.mcState._currentframe >= nFrTotalAnim) {
fGetNextEnemy();
}
}
function EndAttack3() {
if (mcRef.mcState._currentframe >= nFrTotalAnim) {
fSetState("Idle");
}
}
function fStartJump(P_nJumpPower) {
nJumpPower = P_nJumpPower;
nHeightStomp = 0;
fSetState("Jump");
if (P_nJumpPower != 0) {
_global.objSnd.fPlaySounds("sFx_jump", 80, 1);
}
}
function fStartAttack(P_sAttack) {
var _local3 = _global.objHUD.fReturnPowerCost(P_sAttack);
if ((_global.objHUD.fReturnMeterFill("Power") >= _local3) && (_local3 != undefined)) {
fSetState("Start" + P_sAttack);
_global.objHUD.fAddMeter("Power", -_local3);
}
}
function fGetNextEnemy() {
if (aEnemyActive.length > 0) {
mcRef._x = _global.C[aEnemyActive[0]].mcRef._x;
mcRef._y = _global.C[aEnemyActive[0]].mcRef._y;
_global.C.objBKG.fZoomOnPlayer(_global.C[aEnemyActive[0]].mcRef, 100);
fSetState("Attack3");
} else {
fSetState("EndAttack3");
}
_global.objSnd.fPlaySounds("sFx_ninja", 30, 1);
}
function fGetAllEnemy() {
aEnemyActive = new Array();
_global.C.mBroadcaster.broadcastMessage("fGetEnemyActive");
}
function fAddEnemyActive(P_sEnemyName) {
aEnemyActive.push(P_sEnemyName);
}
function fCheckHitGround(P_sNextState) {
var _local8 = false;
var _local7;
nJumpPower = nJumpPower - _global.C.nGravity;
if (nJumpPower < 0) {
var _local10 = mcRef._y;
var _local9 = mcRef._y - nJumpPower;
var _local4 = _local10;
while (_local4 <= _local9) {
var _local3 = {x:0, y:0};
_local3.x = mcRef._x;
_local3.y = _local4;
_global.C.objBKG.mcRef.localToGlobal(_local3);
if (_global.C.objBKG.mcRef.mcBKGHitArea.hitTest(_local3.x, _local3.y, true)) {
_local8 = true;
_local7 = _local4;
break;
}
_local4++;
}
}
if (_local8) {
mcRef._y = _local7;
fSetState(P_sNextState);
bDieOnGround = true;
_global.C.objBKG.fStartStomp(nHeightStomp);
_global.C.fReturnCharacterDepth(mcRef);
} else {
bDieOnGround = false;
mcRef._y = mcRef._y - nJumpPower;
if (nJumpPower < 0) {
nHeightStomp = nHeightStomp + Math.abs(nJumpPower);
}
}
}
function fCheckPlayerCollide(P_objCollider) {
if ((((mcRef.hitTest(P_objCollider.mcRef) && (sState != "HurtJump")) && (sState != "Hurt")) && (sState != "Die")) && (sState.indexOf("Attack3") == -1)) {
P_objCollider.fSetState("Hit");
fGetHurt(-P_objCollider.nAttackPower);
}
}
function fGetHurt(P_nLifeLose) {
_global.objHUD.fAddMeter("Gross", P_nLifeLose);
if (((sState == "Jump") || (sState == "StartAttack1")) || (sState == "EndAttack1")) {
fSetState("HurtJump");
} else {
fSetState("Hurt");
}
}
function fGetDie() {
_global.Param.fPause();
_global.objPopup.fSetState("Blocker");
_global.C.objBKG.fZoomOnPlayer(mcRef);
fSetState("Die");
}
function fDeccel() {
if (nSpeed >= 0) {
nSpeed = nSpeed - (nSpeedAccel * 2);
if (nSpeed < 0) {
nSpeed = 0;
if (sState == "Run") {
fSetState("Idle");
}
}
if ((mcRef._x + (nSpeed * nDirection)) < objStageLimit.nLeft) {
mcRef._x = objStageLimit.nLeft;
nSpeed = 0;
} else if ((mcRef._x + (nSpeed * nDirection)) > objStageLimit.nRight) {
mcRef._x = objStageLimit.nRight;
nSpeed = 0;
} else {
mcRef._x = mcRef._x + (nSpeed * nDirection);
}
_global.C.objBKG.fFollowPlayer((-nSpeed) * nDirection, nDirection);
}
}
function fMoveLR(P_nDirection) {
if (bSlideEnabled) {
if (((P_nDirection != nDirection) && (nSpeed > 0)) && (sState != "Jump")) {
nSpeed = nSpeed - (nSpeedAccel * 2);
if (nSpeed < 0) {
nSpeed = 0;
}
} else {
nSpeed = nSpeed + nSpeedAccel;
if (nSpeed > nSpeedMax) {
nSpeed = nSpeedMax;
}
nDirection = P_nDirection;
}
if ((mcRef._x + (nSpeed * nDirection)) < objStageLimit.nLeft) {
mcRef._x = objStageLimit.nLeft;
nSpeed = 0;
} else if ((mcRef._x + (nSpeed * nDirection)) > objStageLimit.nRight) {
mcRef._x = objStageLimit.nRight;
nSpeed = 0;
} else {
mcRef._x = mcRef._x + (nSpeed * nDirection);
}
if (nDirection == 1) {
mcRef._xscale = 100;
}
if (nDirection == -1) {
mcRef._xscale = -100;
}
_global.C.objBKG.fFollowPlayer((-nSpeed) * nDirection, nDirection);
} else {
nSpeed = nSpeedMax;
nDirection = P_nDirection;
if ((mcRef._x + (nSpeed * nDirection)) < objStageLimit.nLeft) {
mcRef._x = objStageLimit.nLeft;
nSpeed = 0;
} else if ((mcRef._x + (nSpeed * nDirection)) > objStageLimit.nRight) {
mcRef._x = objStageLimit.nRight;
nSpeed = 0;
} else {
mcRef._x = mcRef._x + (nSpeed * nDirection);
}
if (nDirection == 1) {
mcRef._xscale = 100;
}
if (nDirection == -1) {
mcRef._xscale = -100;
}
_global.C.objBKG.fFollowPlayer((-nSpeed) * nDirection, nDirection);
}
}
function fDoStateInit() {
switch (sState) {
case "Idle" :
break;
case "Run" :
if (nDirection == 1) {
mcRef._xscale = 100;
}
if (nDirection == -1) {
mcRef._xscale = -100;
}
break;
case "StartAttack1" :
nJumpPower = 9;
nHeightStomp = 0;
_global.objSnd.fPlaySounds("sFx_jumpAttack1", 75, 1);
break;
case "EndAttack2" :
_global.objSnd.fPlaySounds("sFx_clamThrow", 50, 1);
break;
case "StartAttack3" :
_global.objSnd.fPlaySounds("sFx_sword", 75, 1);
fGetAllEnemy();
break;
case "Attack3Fade" :
_global.objSnd.fPlaySounds("sFx_qTipHit", 100, 1);
break;
case "EndAttack3" :
mcRef._x = nAttack3StartPosX;
mcRef._y = nAttack3StartPosY;
mcRef.swapDepths(nAttack3StartDepth);
_global.C.objBKG.fZoomOnPlayer(mcRef, 60);
}
}
}
Symbol 720 MovieClip [__Packages.obj_NPCPlayer] Frame 0
class obj_NPCPlayer extends objState
{
var mcRef, fSetState, sState, nFrTotalAnim;
function obj_NPCPlayer (P_mcRef) {
super();
mcRef = P_mcRef;
fSetState("Idle");
}
function fDoUnpausableAction() {
if (sState == "Die") {
this[sState]();
}
}
function Hurt() {
if (mcRef.mcState._currentframe >= nFrTotalAnim) {
_global.objHUD.mcRef.mcNPC.gotoAndStop("Idle");
fSetState("Idle");
}
}
function Die() {
if (mcRef.mcState._currentframe >= nFrTotalAnim) {
_global.C.fEndLevel();
_global.C.fRemoveBroadcastObj(this);
}
}
function fCheckPlayerCollide(P_objCollider) {
if ((mcRef.hitTest(P_objCollider.mcRef) && (sState != "Hurt")) && (sState != "Die")) {
P_objCollider.fSetState("Hit");
fGetHurt(-P_objCollider.nAttackPower);
}
}
function fGetHurt(P_nLifeLose) {
_global.objHUD.fAddMeter("Focus", P_nLifeLose);
fSetState("Hurt");
_global.objHUD.mcRef.mcNPC.gotoAndStop("Hurt");
}
function fGetDie() {
_global.Param.fPause();
_global.objPopup.fSetState("Blocker");
_global.C.objBKG.fZoomOnPlayer(mcRef);
fSetState("Die");
_global.objHUD.mcRef.mcNPC.gotoAndStop("Hurt");
}
}
Symbol 721 MovieClip [__Packages.obj_Enemy] Frame 0
class obj_Enemy extends objState
{
var mcRef, bEnemySensai, nDirection, nSpeed, nSpeedMax, nSpeedAccel, bFreezed, bAddParticleToAttack, nAddedDamage, nDelayAttackDone, nDelayAttackToDo, nDistThrow, nDistAttack, nLife, fSetState, sState, nFrTotalAnim, nHeadType;
function obj_Enemy (P_mcRef, P_nLife, P_bEnemySensai) {
super();
mcRef = P_mcRef;
bEnemySensai = P_bEnemySensai;
fSetEnemyHead();
nDirection = 1;
nSpeed = 0;
nSpeedMax = 0.8 + (Math.floor(_global.C.nCurrentLevel / 10) * 0.1);
nSpeedAccel = 0.2;
bFreezed = false;
bAddParticleToAttack = true;
nAddedDamage = 0;
nDelayAttackDone = 0;
nDelayAttackToDo = 30;
nDistThrow = 150;
nDistAttack = 60;
nLife = P_nLife;
_global.C.fSetEnemyActive(1);
_global.C.fReturnCharacterDepth(mcRef);
fSetState("Run");
}
function fDoAction() {
if (((bFreezed == false) || (bFreezed && (sState == "Hurt"))) || (bFreezed && (sState == "Die"))) {
this[sState]();
}
}
function fDoUnpausableAction() {
if (_global.Param.bPaused == true) {
mcRef.mcState.stop();
}
}
function fFreeze() {
bFreezed = true;
if ((sState != "Die") || (sState != "Hurt")) {
mcRef.mcState.stop();
}
}
function fUnFreeze() {
bFreezed = false;
mcRef.mcState.play();
if (nAddedDamage != 0) {
fGetHurt(-nAddedDamage);
}
nAddedDamage = 0;
}
function fUnPause() {
if (bFreezed == false) {
mcRef.mcState.play();
}
}
function Idle() {
fManageAI();
}
function Run() {
fManageAI();
fMoveLR(nDirection);
}
function StartAttack1() {
if (mcRef.mcState._currentframe >= nFrTotalAnim) {
_global.C.fThrowProjectile(mcRef, "Vomit", nDirection);
if (bAddParticleToAttack) {
_global.C.fAddClamExplosionSFX(mcRef, nDirection);
}
fSetState("EndAttack1");
}
}
function EndAttack1() {
if (mcRef.mcState._currentframe >= nFrTotalAnim) {
fSetState("Idle");
}
}
function StartAttack2() {
if (mcRef.mcState._currentframe >= nFrTotalAnim) {
var _local3 = Math.abs(mcRef._x - _global.C.objPlayer.mcRef._x);
if ((((nDirection == -1) && (_local3 <= nDistAttack)) && (_global.C.objPlayer.mcRef._x <= mcRef._x)) && (sState.indexOf("Attack3") == -1)) {
_global.objSnd.fPlaySounds("sFx_enemyHit", 30, 1);
_global.C.objPlayer.fGetHurt(-30);
} else if ((((nDirection == 1) && (_local3 <= nDistAttack)) && (_global.C.objPlayer.mcRef._x >= mcRef._x)) && (sState.indexOf("Attack3") == -1)) {
_global.objSnd.fPlaySounds("sFx_enemyHit", 30, 1);
_global.C.objPlayer.fGetHurt(-30);
}
fSetState("EndAttack2");
}
}
function EndAttack2() {
if (mcRef.mcState._currentframe >= nFrTotalAnim) {
fSetState("Idle");
}
}
function Hurt() {
if (mcRef.mcState._currentframe >= nFrTotalAnim) {
if (nLife <= 0) {
if (bFreezed == false) {
fSetState("Die");
} else {
fSetState("Idle");
mcRef.mcState.stop();
}
} else if (bFreezed == false) {
fSetState("Run");
} else {
fSetState("Idle");
mcRef.mcState.stop();
}
}
}
function Die() {
if (mcRef.mcState._currentframe >= nFrTotalAnim) {
_global.C.fSetEnemyActive(-1);
if (bEnemySensai) {
_global.objSnd.fPlaySounds("sFx_enemyBoss", 50, 1);
_global.C.fSetCurrentLevel(1);
_global.C.fManagePoint(1000);
} else {
_global.C.fManagePoint(200);
}
var _local3 = mcRef._name;
_global.C.fRemoveInstance(mcRef);
_global.C.fRemoveBroadcastObj(this);
_global.C.fRemoveObject(_local3);
}
}
function fSetEnemyHead() {
if (bEnemySensai) {
nHeadType = random(2) + 3;
} else {
nHeadType = random(2) + 1;
}
}
function fManageAI() {
var _local4 = fCheckCanAttack();
var _local5 = Math.abs(mcRef._x - _global.C.objNPCPlayer.mcRef._x);
var _local3 = Math.abs(mcRef._x - _global.C.objPlayer.mcRef._x);
var _local6 = Math.abs(mcRef._y - _global.C.objPlayer.mcRef._y);
if ((_local6 < 35) && (_local3 <= nDistThrow)) {
if (mcRef._x < _global.C.objPlayer.mcRef._x) {
nDirection = 1;
} else if (mcRef._x > _global.C.objPlayer.mcRef._x) {
nDirection = -1;
}
if (_local3 < nDistAttack) {
if (_local4 && (_global.C.objPlayer.sState.indexOf("Attack3") == -1)) {
fStartAttack(2);
} else {
fSetState("Idle");
}
} else if ((_local3 <= nDistThrow) && (_local3 > nDistAttack)) {
if (_local4 && (_global.C.objPlayer.sState.indexOf("Attack3") == -1)) {
fStartAttack(1);
} else {
fSetState("Idle");
}
} else if (_local5 > 180) {
fSetState("Run");
}
} else if (_local5 < 180) {
if (mcRef._x < _global.C.objNPCPlayer.mcRef._x) {
nDirection = 1;
} else if (mcRef._x > _global.C.objNPCPlayer.mcRef._x) {
nDirection = -1;
}
if (_local4) {
fStartAttack(1);
} else {
fSetState("Idle");
}
} else {
if (mcRef._x < _global.C.objNPCPlayer.mcRef._x) {
nDirection = 1;
} else if (mcRef._x > _global.C.objNPCPlayer.mcRef._x) {
nDirection = -1;
}
fSetState("Run");
}
}
function fCheckCanAttack() {
nDelayAttackDone++;
if (nDelayAttackDone >= nDelayAttackToDo) {
nDelayAttackDone = 0;
return(true);
}
return(false);
}
function fChangeHead(P_mcRef) {
P_mcRef.gotoAndStop(nHeadType);
}
function fChangeTorso(P_mcRef) {
var _local2 = Math.ceil(nLife / 20);
if (_local2 < 1) {
_local2 = 1;
}
if (_local2 > 5) {
_local2 = 5;
}
P_mcRef.gotoAndStop(_local2);
}
function fEasterEgg() {
if (sState != "Die") {
_global.objSnd.fPlaySounds("sFx_gaz" + random(3), 50, 1);
_global.C.fAddEasterEggSFX(mcRef, nDirection);
}
}
function fStartAttack(P_nAttackNumber) {
fSetState("StartAttack" + P_nAttackNumber);
}
function fCheckEnemyCollide(P_objCollider, P_bPlayerAttack1) {
if (P_bPlayerAttack1 == true) {
if ((mcRef.hitTest(P_objCollider.mcRef.mcState.mcHitArea) && ((sState != "Hurt") || (bFreezed))) && (sState != "Die")) {
fGetHurt(-P_objCollider.nAttack1Power);
_global.C.fManagePoint(300);
}
} else if ((mcRef.hitTest(P_objCollider.mcRef) && ((sState != "Hurt") || (bFreezed))) && (sState != "Die")) {
P_objCollider.fSetState("Hit");
_global.C.fManagePoint(250);
if (bFreezed == false) {
fGetHurt(-P_objCollider.nAttackPower);
} else {
fGetHurt(-(P_objCollider.nAttackPower * 5));
}
}
}
function fGetHurt(P_nLifeLose) {
if (bFreezed == false) {
nLife = nLife + P_nLifeLose;
var _local3 = Math.floor((-P_nLifeLose) / 5);
if (_local3 <= 0) {
_local3 = 1;
}
_global.C.fAddMeatExplosionSFX(mcRef, _local3);
fSetState("Hurt");
} else {
nAddedDamage = nAddedDamage + Math.abs(P_nLifeLose / 5);
fSetState("Hurt");
}
}
function fMoveLR(P_nDirection) {
nSpeed = nSpeedMax;
nDirection = P_nDirection;
mcRef._x = mcRef._x + (nSpeed * nDirection);
if (nDirection == 1) {
mcRef._xscale = 100;
}
if (nDirection == -1) {
mcRef._xscale = -100;
}
}
function fGetEnemyActive() {
if ((((sState != "Die") && (nLife > 0)) && (mcRef._x >= 25)) && (mcRef._x <= 1125)) {
_global.C.objPlayer.fAddEnemyActive(mcRef._name);
}
}
function fDoStateInit() {
switch (sState) {
case "Idle" :
break;
case "StartAttack1" :
_global.objSnd.fPlaySounds("sFx_burp", 25, 1);
if (nDirection == 1) {
mcRef._xscale = 100;
}
if (nDirection == -1) {
mcRef._xscale = -100;
}
break;
case "StartAttack2" :
_global.objSnd.fPlaySounds("sFx_enemyWhip", 50, 1);
if (nDirection == 1) {
mcRef._xscale = 100;
}
if (nDirection != -1) {
break;
}
mcRef._xscale = -100;
}
}
}
Symbol 722 MovieClip [__Packages.obj_Slice] Frame 0
class obj_Slice extends objState
{
var mcRef, fSetState, nFrTotalAnim;
function obj_Slice (P_mcRef) {
super();
mcRef = P_mcRef;
fSetState("Idle");
}
function Idle() {
if (mcRef.mcState._currentframe >= nFrTotalAnim) {
var _local3 = mcRef._name;
_global.C.fRemoveInstance(mcRef);
_global.C.fRemoveBroadcastObj(this);
_global.C.fRemoveObject(_local3);
}
}
}
Symbol 723 MovieClip [__Packages.obj_Particle] Frame 0
class obj_Particle extends objState
{
var mcRef, nSpeedX, nDirectionX, nSpeedY, oStageBounds, fSetState;
function obj_Particle (P_mcRef, P_nSpeedX, P_nSpeedY, P_nDirectionX) {
super();
mcRef = P_mcRef;
nSpeedX = P_nSpeedX;
nDirectionX = P_nDirectionX;
nSpeedY = P_nSpeedY;
oStageBounds = new Object();
oStageBounds.nLeft = 0;
oStageBounds.nTop = 0;
oStageBounds.nRight = 1200;
oStageBounds.nBottom = 280;
fSetState("Idle");
}
function Idle() {
nSpeedX = nSpeedX - 0.1;
if (nSpeedX < 1) {
nSpeedX = 1;
}
nSpeedY = nSpeedY + _global.C.nGravity;
fDetectCollider("X", nSpeedX * nDirectionX);
fDetectCollider("Y", nSpeedY, false);
mcRef._rotation = mcRef._rotation + (8 * nDirectionX);
fSetScaleDown();
}
function fSetDirectionX(P_nDirection) {
nDirectionX = P_nDirection;
}
function fDetectCollider(P_sCoor, P_nMoveValue, P_bCheckHitArea) {
if (P_sCoor == "X") {
if ((mcRef._x + P_nMoveValue) <= oStageBounds.nLeft) {
fHitLimit("Left", P_nMoveValue);
} else if ((mcRef._x + P_nMoveValue) >= oStageBounds.nRight) {
fHitLimit("Right", P_nMoveValue);
} else {
mcRef._x = mcRef._x + P_nMoveValue;
}
} else if (P_sCoor == "Y") {
if ((mcRef._y + P_nMoveValue) <= oStageBounds.nTop) {
fHitLimit("Top", P_nMoveValue);
} else if ((P_bCheckHitArea == false) && ((mcRef._y + P_nMoveValue) >= (oStageBounds.nBottom + mcRef._height))) {
fHitLimit("Bottom", P_nMoveValue);
} else if (P_bCheckHitArea && (P_nMoveValue > 0)) {
var _local9 = false;
var _local8;
var _local11 = mcRef._y;
var _local10 = mcRef._y + P_nMoveValue;
var _local4 = _local11;
while (_local4 <= _local10) {
var _local3 = {x:0, y:0};
_local3.x = mcRef._x;
_local3.y = _local4;
_global.C.objBKG.mcRef.localToGlobal(_local3);
if (_global.C.objBKG.mcRef.mcBKGHitArea.hitTest(_local3.x, _local3.y, true)) {
_local9 = true;
_local8 = _local4;
break;
}
_local4++;
}
if (_local9) {
mcRef._y = _local8;
fHitLimit("Bottom", P_nMoveValue);
} else {
mcRef._y = mcRef._y + P_nMoveValue;
}
} else {
mcRef._y = mcRef._y + P_nMoveValue;
}
}
}
function fHitLimit(P_sLimit, P_nMoveValue) {
switch (P_sLimit) {
case "Left" :
mcRef._x = oStageBounds.nLeft;
fSetDirectionX(-nDirectionX);
break;
case "Top" :
mcRef._y = oStageBounds.nTop;
nSpeedY = (-P_nMoveValue) * 0.5;
break;
case "Right" :
mcRef._x = oStageBounds.nRight;
fSetDirectionX(-nDirectionX);
break;
case "Bottom" :
mcRef._y = oStageBounds.nBottom;
nSpeedY = (-P_nMoveValue) * 0.5;
}
}
function fSetScaleDown() {
var _local2 = mcRef._xscale - 2;
mcRef._xscale = (mcRef._yscale = _local2);
if (_local2 <= 5) {
fRemoveInstance();
}
}
function fRemoveInstance() {
var _local3 = mcRef._name;
_global.C.fRemoveInstance(mcRef);
_global.C.fRemoveBroadcastObj(this);
_global.C.fRemoveObject(_local3);
}
}
Symbol 724 MovieClip [__Packages.obj_BonusItem] Frame 0
class obj_BonusItem extends obj_Particle
{
var mcRef, bScalingDown, bActive, nSpeedX, nDirectionX, nSpeedY, fSetState, nFrTotalAnim, fDetectCollider, fSetScaleDown, fRemoveInstance, sType, oStageBounds, fSetDirectionX, sState;
function obj_BonusItem (P_mcRef) {
super(mcRef);
mcRef = P_mcRef;
bScalingDown = false;
bActive = true;
nSpeedX = 0;
nDirectionX = 1;
nSpeedY = 5;
fSetState("Appear");
fGetType();
}
function Appear() {
if (mcRef.mcState._currentframe >= nFrTotalAnim) {
fSetState("Idle");
}
}
function Idle() {
nSpeedY = nSpeedY + _global.C.nGravity;
fDetectCollider("X", nSpeedX * nDirectionX);
fDetectCollider("Y", nSpeedY, true);
if (bScalingDown) {
fSetScaleDown();
}
}
function IdleStop() {
fCheckCollidePlayer();
}
function Disappear() {
if (mcRef.mcState._currentframe >= nFrTotalAnim) {
fRemoveInstance();
}
}
function fCheckCollidePlayer() {
if (mcRef.hitTest(_global.C.objPlayer.mcRef.mcHitZone)) {
switch (sType) {
case "Energy" :
_global.objHUD.fAddMeter("Gross", 100);
_global.objHUD.fAddMeter("Focus", 25);
break;
case "Power" :
_global.objHUD.fAddMeter("Power", 100);
break;
case "Point" :
_global.C.fManagePoint(500);
break;
case "Freeze" :
_global.C.fFreezeEnemy();
}
_global.objSnd.fPlaySounds("sFx_bonus", 30, 1);
_global.C.fManagePoint(100);
bActive = false;
fSetState("Disappear");
}
}
function fHitLimit(P_sLimit, P_nMoveValue) {
switch (P_sLimit) {
case "Left" :
mcRef._x = oStageBounds.nLeft;
fSetDirectionX(-nDirectionX);
break;
case "Top" :
mcRef._y = oStageBounds.nTop;
nSpeedY = (-P_nMoveValue) * 0.5;
break;
case "Right" :
mcRef._x = oStageBounds.nRight;
fSetDirectionX(-nDirectionX);
break;
case "Bottom" :
fSetState("IdleStop");
}
}
function fGetType() {
switch (random(4) + 1) {
case 1 :
sType = "Energy";
break;
case 2 :
sType = "Power";
break;
case 3 :
sType = "Point";
break;
case 4 :
sType = "Freeze";
}
mcRef.mcState.mcType.gotoAndStop(sType);
}
function fDoStateInit() {
switch (sState) {
case "Appear" :
mcRef.mcState.mcType.gotoAndStop(sType);
break;
case "Idle" :
mcRef.mcState.mcType.gotoAndStop(sType);
break;
case "IdleStop" :
mcRef.mcState.mcType.gotoAndStop(sType);
break;
case "Disappear" :
mcRef.mcState.mcType.gotoAndStop(sType);
}
}
}
Symbol 725 MovieClip [__Packages.obj_EasterEgg] Frame 0
class obj_EasterEgg extends objState
{
var mcRef, fSetState, nFrTotalAnim;
function obj_EasterEgg (P_mcRef) {
super();
mcRef = P_mcRef;
fSetState("Idle");
}
function Idle() {
if (mcRef.mcState._currentframe >= nFrTotalAnim) {
fRemoveInstance();
}
}
function fRemoveInstance() {
var _local3 = mcRef._name;
_global.C.fRemoveInstance(mcRef);
_global.C.fRemoveBroadcastObj(this);
_global.C.fRemoveObject(_local3);
}
}
Symbol 726 MovieClip [__Packages.obj_Projectile] Frame 0
class obj_Projectile extends obj_Particle
{
var mcRef, sType, bAlly, bScalingDown, nAttackPower, bActive, nSpeedX, nDirectionX, nSpeedY, fSetState, fDetectCollider, fSetScaleDown, nFrTotalAnim, fRemoveInstance, oStageBounds, fSetDirectionX, sState;
function obj_Projectile (P_mcRef, P_sType, P_bAlly, P_nAttackPower, P_nSpeedX, P_nSpeedY, P_nDirectionX) {
super(mcRef);
mcRef = P_mcRef;
sType = P_sType;
bAlly = P_bAlly;
bScalingDown = false;
nAttackPower = P_nAttackPower;
bActive = true;
nSpeedX = P_nSpeedX;
nDirectionX = P_nDirectionX;
nSpeedY = P_nSpeedY;
fSetState("Idle");
}
function Idle() {
switch (sType) {
case "Ballistic" :
nSpeedX = nSpeedX - 0.1;
if (nSpeedX < 1) {
nSpeedX = 1;
}
nSpeedY = nSpeedY + _global.C.nGravity;
fDetectCollider("X", nSpeedX * nDirectionX);
fDetectCollider("Y", nSpeedY, false);
break;
case "Direct" :
nSpeedX = nSpeedX - 0.2;
if (nSpeedX < 3) {
nSpeedX = 3;
}
if (nSpeedX < 10) {
nSpeedY = nSpeedY + _global.C.nGravity;
}
fDetectCollider("X", nSpeedX * nDirectionX);
fDetectCollider("Y", nSpeedY, true);
}
if (bScalingDown) {
fSetScaleDown();
}
if (bAlly && (bActive)) {
_global.C.mBroadcaster.broadcastMessage("fCheckEnemyCollide", this);
} else if ((bAlly == false) && (bActive)) {
_global.C.mBroadcaster.broadcastMessage("fCheckPlayerCollide", this);
}
}
function Hit() {
if (mcRef.mcState._currentframe >= nFrTotalAnim) {
fRemoveInstance();
}
}
function fHitLimit(P_sLimit, P_nMoveValue) {
switch (sType) {
case "Ballistic" :
switch (P_sLimit) {
case "Left" :
mcRef._x = oStageBounds.nLeft;
fSetDirectionX(-nDirectionX);
break;
case "Top" :
mcRef._y = oStageBounds.nTop;
nSpeedY = (-P_nMoveValue) * 0.5;
break;
case "Right" :
mcRef._x = oStageBounds.nRight;
fSetDirectionX(-nDirectionX);
break;
case "Bottom" :
bActive = false;
bScalingDown = true;
mcRef._y = oStageBounds.nBottom;
nSpeedY = (-P_nMoveValue) * 0.5;
}
break;
case "Direct" :
switch (P_sLimit) {
case "Left" :
mcRef._x = oStageBounds.nLeft;
fSetDirectionX(-nDirectionX);
break;
case "Top" :
mcRef._y = oStageBounds.nTop;
nSpeedY = (-P_nMoveValue) * 0.5;
break;
case "Right" :
mcRef._x = oStageBounds.nRight;
fSetDirectionX(-nDirectionX);
break;
case "Bottom" :
bActive = false;
bScalingDown = true;
nSpeedY = (-P_nMoveValue) * 0.5;
}
}
}
function fDoStateInit() {
switch (sState) {
case "Idle" :
break;
case "Hit" :
_global.objSnd.fPlaySounds("sFx_clam", 50, 1);
}
}
}
Symbol 72 MovieClip Frame 1
stop();
Symbol 72 MovieClip Frame 2
gotoAndStop (1);
Symbol 106 Button
on (release) {
_global.objSnd.fPlaySounds("sFx_btnDown", 100, 1);
_global.Param.fResumeHelp();
}
on (rollOver) {
_global.objSnd.fPlaySounds("sFx_btnOver", 100, 1);
}
Symbol 116 Button
on (release) {
nextFrame();
_global.objSnd.fPlaySounds("sFx_btnDown", 100, 1);
}
on (rollOver) {
_global.objSnd.fPlaySounds("sFx_btnOver", 100, 1);
}
Symbol 152 Button
on (release) {
prevFrame();
_global.objSnd.fPlaySounds("sFx_btnDown", 100, 1);
}
on (rollOver) {
_global.objSnd.fPlaySounds("sFx_btnOver", 100, 1);
}
Symbol 162 MovieClip Frame 1
stop();
Symbol 171 Button
on (release) {
_global.objSnd.fPlaySounds("sFx_btnDown", 100, 1);
_global.Param.fHelp();
}
on (rollOver) {
_global.objSnd.fPlaySounds("sFx_btnOver", 100, 1);
}
Symbol 179 Button
on (release) {
_global.objSnd.fPlaySounds("sFx_btnDown", 100, 1);
_global.objPopup.fSetState("QuitOpen");
}
on (rollOver) {
_global.objSnd.fPlaySounds("sFx_btnOver", 100, 1);
}
Symbol 187 Button
on (release) {
_global.objSnd.fPlaySounds("sFx_btnDown", 100, 1);
_global.Param.fResume();
}
on (rollOver) {
_global.objSnd.fPlaySounds("sFx_btnOver", 100, 1);
}
Symbol 192 Button
on (release) {
_global.objSnd.fDoMute();
nextFrame();
}
on (rollOver) {
_global.objSnd.fPlaySounds("sFx_btnOverMenu", 50, 1);
}
Symbol 198 Button
on (release) {
_global.objSnd.fUndoMute();
prevFrame();
}
on (rollOver) {
_global.objSnd.fPlaySounds("sFx_btnOverMenu", 50, 1);
}
Symbol 200 MovieClip Frame 1
stop();
Instance of Symbol 200 MovieClip in Symbol 201 MovieClip Frame 1
onClipEvent (load) {
if (_global.objSnd.Mute) {
nextFrame();
}
}
Symbol 206 Button
on (release) {
_global.objSnd.fPlaySounds("sFx_btnDown", 100, 1);
_global.Param.fQuit();
}
on (rollOver) {
_global.objSnd.fPlaySounds("sFx_btnOver", 100, 1);
}
Symbol 208 Button
on (release) {
_global.objSnd.fPlaySounds("sFx_btnDown", 100, 1);
_global.objPopup.fSetState("MenuOpen");
}
on (rollOver) {
_global.objSnd.fPlaySounds("sFx_btnOver", 100, 1);
}
Symbol 216 MovieClip Frame 1
stop();
Symbol 247 Button
on (release) {
_global.objTrans.fSetTransition("Game");
_global.objSnd.fPlaySounds("sFx_btnDown", 100, 1);
}
on (rollOver) {
_global.objSnd.fPlaySounds("sFx_btnOver", 100, 1);
}
Symbol 248 Button
on (release) {
_global.objTrans.fSetTransition("Help");
_global.objSnd.fPlaySounds("sFx_btnDown", 100, 1);
}
on (rollOver) {
_global.objSnd.fPlaySounds("sFx_btnOver", 100, 1);
}
Symbol 265 MovieClip [mcVomitProjectile] Frame 1
stop();
Symbol 281 MovieClip Frame 1
_global.C[_parent._parent._name].fChangeTorso(this);
Symbol 285 MovieClip Frame 1
_global.C[_parent._parent._name].fChangeHead(this);
Symbol 309 MovieClip Frame 8
_global.C.fAddEnemyExplosionSFX(_parent);
Symbol 313 MovieClip [mcClamProjectile] Frame 1
stop();
Symbol 357 MovieClip Frame 1
_global.C.fRemoveInstance(this);
Symbol 427 MovieClip Frame 1
_visible = false;
Symbol 429 MovieClip Frame 1
_visible = false;
Symbol 508 MovieClip Frame 1
_visible = false;
Symbol 594 MovieClip Frame 2
_visible = false;
stop();
Instance of Symbol 590 MovieClip "mcPlayer" in Symbol 595 MovieClip Frame 1
on (release) {
_global.C.objPlayer.fGetHurt(-30);
}
Symbol 611 MovieClip Frame 1
if (pf == undefined) {
APE(this, 1);
}
Symbol 615 MovieClip Frame 1
if (pf == undefined) {
APE(this, 1);
}
Symbol 619 MovieClip Frame 1
if (pf == undefined) {
APE(this, 1);
}
Symbol 648 Button
on (release) {
_global.Param.fMenu();
_global.objSnd.fPlaySounds("sFx_btnDown", 100, 1);
}
on (rollOver) {
_global.objSnd.fPlaySounds("sFx_btnOver", 100, 1);
}
Symbol 669 Button
on (release) {
_global.objHS.fDoViewHS();
_global.objSnd.fPlaySounds("sFx_btnDown", 100, 1);
}
on (rollOver) {
_global.objSnd.fPlaySounds("sFx_btnOver", 100, 1);
}
Symbol 671 Button
on (release) {
_global.Param.fPlayAgain();
_global.objSnd.fPlaySounds("sFx_btnDown", 100, 1);
}
on (rollOver) {
_global.objSnd.fPlaySounds("sFx_btnOver", 100, 1);
}
Symbol 673 Button
on (release) {
_global.objHS.fDoSubmitHS();
_global.objSnd.fPlaySounds("sFx_btnDown", 100, 1);
}
on (rollOver) {
_global.objSnd.fPlaySounds("sFx_btnOver", 100, 1);
}
Symbol 702 Button
on (press) {
ControlScroll.scrollDown = true;
_global.objSnd.fPlaySounds("sFx_btnDownMenu", 50, 1);
}
on (release, releaseOutside) {
ControlScroll.scrollDown = false;
}
on (rollOver) {
_global.objSnd.fPlaySounds("sFx_btnOverMenu", 50, 1);
}
Symbol 703 Button
on (press) {
ControlScroll.scrollUp = true;
_global.objSnd.fPlaySounds("sFx_btnDownMenu", 50, 1);
}
on (release, releaseOutside) {
ControlScroll.scrollUp = false;
}
on (rollOver) {
_global.objSnd.fPlaySounds("sFx_btnOverMenu", 50, 1);
}
Instance of Symbol 693 MovieClip "ControlScroll" in Symbol 704 MovieClip Frame 1
onClipEvent (load) {
scrollUp = false;
scrollDown = false;
}
onClipEvent (enterFrame) {
if (scrollUp == true) {
_parent.txtHSNumber.scroll--;
_parent.txtHSName.scroll--;
_parent.txtHSScore.scroll--;
} else if (scrollDown == true) {
_parent.txtHSNumber.scroll++;
_parent.txtHSName.scroll++;
_parent.txtHSScore.scroll++;
}
}
Instance of Symbol 684 MovieClip in Symbol 705 MovieClip Frame 1
/* no clip actions */
Symbol 706 Button
on (release) {
btnSubmitHS._visible = false;
_global.objHS.submitScore(_global.Param.nPlayerScore);
_global.objSnd.fPlaySounds("sFx_btnDown", 100, 1);
}
on (rollOver) {
_global.objSnd.fPlaySounds("sFx_btnOver", 100, 1);
}