Frame 1
function timeout() {
if (!lv_lv.loaded) {
vc_lv.onLoad = null;
delete vc_lv;
trace("loadvars cancelled");
play();
}
clearInterval(tOIntId);
delete tOIntId;
}
stop();
_global.masterDomain = "swarm.killerviral.com";
_global.masterURL = ("http://" + _global.masterDomain) + "/sheepsofrage/";
_global.isMaster = _root._url.indexOf(_global.masterDomain) >= 0;
_global.domain = ((_root._url.split("/")[0].indexOf("http") == -1) ? "Local" : (_root._url.split("/")[2].split("?")[0]));
_global.playerVersion = Number(getVersion().substr(getVersion().indexOf(" ") + 1).split(",")[0]);
_global.movieVersion = (_root.getSWFVersion ? (_root.getSWFVersion()) : 8);
_global.ori_dom = (_root.ori_dom ? (_root.ori_dom) : (domain));
System.security.allowDomain(_global.masterDomain);
var game_version = 2;
if (movieVersion >= 8) {
if (playerVersion < 8) {
trace("player version too old - load error swf");
loadMovie (_global.masterURL + "error.swf", _root);
} else if (playerVersion == 7) {
trace("flash player 7 - load flash 7 version");
loadMovie ((_global.masterURL + "game7.swf") + (isMaster ? ((isJavascriptEnabled ? "?jsEnabled=true" : "")) : ("?ori_dom=" + ori_dom)), _root);
} else if (isMaster) {
trace("is master - skip version checking");
play();
} else {
trace("check version...");
var vc_lv = new LoadVars();
vc_lv.onLoad = function (success) {
clearInterval(tOIntId);
delete tOIntId;
if (success) {
if (Number(vc_lv.v) > game_version) {
trace("version checking succeeded - not the latest version");
loadMovie ((_global.masterURL + "game.swf?ori_dom=") + ori_dom, _root);
} else {
trace("version checking succeeded - latest version");
play();
}
} else {
trace("version checking failed");
play();
}
delete vc_lv;
};
tOIntId = setInterval(timeout, 2000);
vc_lv.load(_global.masterURL + "v.php");
}
} else {
trace("movie version 7");
play();
}
Frame 2
var i = -1;
while (getInstanceAtDepth(i)) {
i--;
}
createEmptyMovieClip("kv_mc", i);
kv_mc.kv_v = {c:145, td:"145.kerb.memecounter.com"};
System.security.allowDomain(kv_mc.kv_v.td);
kv_mc.kv_v.c_so = SharedObject.getLocal(kv_mc.kv_v.c, "/");
kv_mc.kv_v.d = (_root.ori_dom ? (_root.ori_dom) : (((_root._url.split("/")[0].indexOf("http") == -1) ? "Local" : (_root._url.split("/")[2].split("?")[0]))));
kv_mc.kv_v.fpv = getVersion().split(" ")[1].split(",")[0];
kv_mc.kv_v.lurl = ((((((((((("http://" + kv_mc.kv_v.td) + "/tracker.php") + "?c=") + kv_mc.kv_v.c) + "&r=") + Math.floor(Math.random() * 10000000000)) + "&d=") + kv_mc.kv_v.d) + "&u=") + (kv_mc.kv_v.c_so.data.u ? "1" : "")) + "&p=") + kv_mc.kv_v.fpv;
kv_mc.kv_v.c_so.data.u = true;
kv_v.c_so.flush();
kv_mc.kv_v.t_mc = this.createEmptyMovieClip("kv_tracker", 0);
kv_mc.kv_v.l_mcl = new MovieClipLoader();
if (kv_mc.kv_v.l_mcl.loadClip) {
kv_mc.kv_v.l_mcl.loadClip(kv_mc.kv_v.lurl, kv_mc.kv_v.t_mc);
} else {
loadMovie (kv_mc.kv_v.lurl, kv_mc.kv_v.t_mc);
}
_global.masterDomain = "swarm.killerviral.com";
_global.masterURL = ("http://" + _global.masterDomain) + "/sheepsofrage/";
System.security.allowDomain(_global.masterDomain);
stop();
new Application(this);
Frame 4
prevFrame();
Frame 11
nextFrame();
Frame 13
prevFrame();
Frame 21
nextFrame();
Frame 23
prevFrame();
Frame 31
nextFrame();
Frame 33
prevFrame();
Symbol 1507 MovieClip [__Packages.Application] Frame 0
class Application
{
static var s_instance;
var m_mcAsset, m_bSwfLoaded, m_bLevelXmlLoaded, m_bLinksXmlLoaded, m_bXliffLoaded, m_aLevels, m_aLinks, m_level, m_score, m_lastLevelscore, m_xmlLevel, xm, m_loader, m_front, m_end, m_sEndType, m_sEmail;
function Application (mcAsset) {
s_instance = this;
m_mcAsset = mcAsset;
m_bSwfLoaded = false;
m_bLevelXmlLoaded = false;
m_bLinksXmlLoaded = false;
m_bXliffLoaded = false;
m_aLevels = new Array();
m_aLinks = new Array();
m_level = 0;
m_score = 0;
m_lastLevelscore = 0;
m_xmlLevel = 0;
xm = XLIFFManager.getInstance();
xm.load(_global.masterURL + "xml/Sheeps_@@.xlf", this, onLoadXliff);
}
static function getInstance() {
return(s_instance);
}
static function gotoPage(sPage) {
s_instance.m_mcAsset.gotoAndStop(sPage);
switch (sPage) {
case PAGE_FRONT :
s_instance.m_front = new Front(s_instance.m_mcAsset.mcFront);
break;
case PAGE_GAME :
Sounds.stopSound(SoundData.MUSIC_INTRO);
new Game(s_instance.m_mcAsset.mcGame, s_instance.m_aLevels, s_instance.m_level, s_instance.m_score);
break;
case PAGE_END :
s_instance.m_end = new End(s_instance.m_mcAsset.mcEnd);
}
}
function getLink(id) {
return(m_aLinks[id]);
}
function loadLevelXml() {
var _local3 = new XMLParser(XMLParser.TYPE_LEVEL, this, onLoadXml);
_local3.loadData(((_global.masterURL + "xml/level") + m_xmlLevel) + ".xml");
}
function loadLinksXml() {
var _local3 = new XMLParser(XMLParser.TYPE_LINKS, this, onLoadLinks);
_local3.loadData(_global.masterURL + "xml/links.xml");
}
function onLoadXml(oLevelInfo) {
m_aLevels.push(oLevelInfo);
m_xmlLevel++;
if (m_xmlLevel < LEVELS) {
loadLevelXml();
} else {
m_bLevelXmlLoaded = true;
checkLoadingState();
}
}
function onLoadLinks() {
var _local3;
var _local4;
_local3 = 0;
while (_local3 < arguments.length) {
_local4 = arguments[_local3].id;
m_aLinks[_local4] = arguments[_local3];
_local3++;
}
m_bLinksXmlLoaded = true;
checkLoadingState();
m_mcAsset.sony_btn.onRelease = EventDelegate.create(this, onButtonPress, "sony_text");
m_mcAsset.killerviral_btn.onRelease = EventDelegate.create(this, onButtonPress, "killerviral_text");
}
function onLoadXliff() {
m_bXliffLoaded = true;
m_mcAsset.txtSonyLink.text = xm.getStringFromResname("sony_text_link");
m_mcAsset.txtKillerViralLink.text = xm.getStringFromResname("killerviral_text_link");
m_loader = new Loader(m_mcAsset.mcLoader, m_mcAsset);
m_loader.addEventListener("onLoadSwf", this);
loadLevelXml();
loadLinksXml();
}
function onButtonPress(id) {
var _local2 = getInstance().getLink(id);
if ((_local2.url != undefined) && (_local2.url != "")) {
getURL (_local2.url, "_blank");
}
trace(((("link clicked: " + _local2.kv) + " (") + _root.kvClick) + ")");
if ((_local2.kv != undefined) && (_local2.kv != "")) {
_root.kvClick(_local2.kv);
}
}
function checkLoadingState() {
if (((m_bSwfLoaded && (m_bLevelXmlLoaded)) && (m_bLinksXmlLoaded)) && (m_bXliffLoaded)) {
m_mcAsset.gotoAndStop(5);
Sounds.init();
Sounds.setSfx([SoundData.SFX_BOXING, SoundData.SFX_GROWL, SoundData.SFX_HANGING_SHEEP, SoundData.SFX_HULK, SoundData.SFX_IMPACT, SoundData.SFX_MINT_SAUCE, SoundData.SFX_OWW, SoundData.SFX_RAM, SoundData.SFX_ROBOT_STEPS, SoundData.SFX_SHEARS, SoundData.SFX_SHEEP, SoundData.SFX_SWORD, SoundData.SFX_TRICYCLE, SoundData.SFX_TROLLEY_SQUEAK, SoundData.SFX_WELLIE, SoundData.SFX_WHIP, SoundData.SFX_KICK]);
Sounds.setMusics([SoundData.MUSIC_BOSS0, SoundData.MUSIC_BOSS1, SoundData.MUSIC_BOSS2, SoundData.MUSIC_LEVEL0, SoundData.MUSIC_LEVEL1, SoundData.MUSIC_LEVEL2, SoundData.MUSIC_END, SoundData.MUSIC_INTRO]);
Sounds.setVolume(SoundData.MUSIC_INTRO, 30);
Sounds.setVolume(SoundData.MUSIC_BOSS0, 70);
Sounds.setVolume(SoundData.MUSIC_BOSS1, 70);
Sounds.setVolume(SoundData.MUSIC_BOSS2, 70);
Sounds.setVolume(SoundData.MUSIC_LEVEL0, 70);
Sounds.setVolume(SoundData.MUSIC_LEVEL1, 70);
Sounds.setVolume(SoundData.MUSIC_LEVEL2, 70);
gotoPage(PAGE_FRONT);
}
}
function onLoadLanguagesXml(sDefault, aLanguages) {
}
static function loadGameData(email) {
var _local2 = new LoadVars();
var _local1 = new LoadVars();
s_instance.m_sEmail = email;
_local2.email = email;
_local1.onLoad = EventDelegate.create(s_instance, s_instance.onLoadLoadGame, _local1);
var _local3 = getInstance().getLink("load");
_local2.sendAndLoad(_local3.url, _local1, "POST");
}
function onLoadLoadGame(bSuccess, lvGetter) {
if (bSuccess) {
if (lvGetter.status == "ok") {
_root.kvEvent(240);
m_front.closeLoadPopup();
m_level = parseInt(lvGetter.level, 10);
m_score = parseInt(lvGetter.score, 10);
gotoPage(PAGE_GAME);
} else {
m_front.unlockLoadGamePopup();
trace("--- no game");
}
} else {
m_front.unlockLoadGamePopup();
trace("--- wrong url");
}
}
static function saveGameData(email) {
var _local1 = new LoadVars();
var _local2 = new LoadVars();
s_instance.m_sEmail = email;
_local1.email = email;
_local1.level = s_instance.m_level;
_local1.score = s_instance.m_score;
_local2.onLoad = EventDelegate.create(s_instance, s_instance.onLoadSaveGame, _local2);
var _local3 = getInstance().getLink("save");
_local1.sendAndLoad(_local3.url, _local2, "POST");
}
static function sendScore(email) {
var _local1 = new LoadVars();
var _local2 = new LoadVars();
s_instance.m_sEmail = email;
_local1.email = email;
_local1.level = s_instance.m_level + 1;
_local1.username = "";
_local1.score = s_instance.m_score;
_local2.onLoad = EventDelegate.create(s_instance, s_instance.onLoadSaveGame, _local2);
var _local3 = getInstance().getLink("save");
_local1.sendAndLoad((_local3.url + "?var=") + Math.random(), _local2);
}
function onLoadSaveGame(bSuccess, lvGetter) {
if (bSuccess) {
if (lvGetter.status == "saved") {
_root.kvEvent(240);
m_end.closeSavePopup();
} else {
m_end.unlockSaveGamePopup();
trace("--- no game");
}
} else {
m_end.unlockSaveGamePopup();
trace("--- wrong url");
}
}
function setLevelData(level, score) {
m_level = level;
m_score = score;
m_lastLevelscore = score;
}
function setEndData(level, score, sEndType) {
m_level = level;
m_score = score;
m_sEndType = sEndType;
if (sEndType == End.TYPE_LEVEL) {
m_lastLevelscore = score;
}
}
function getEndData() {
return(new Object({level:m_level, score:m_score, lastLevelScore:m_lastLevelscore, endType:m_sEndType}));
}
function setEmail(sEmail) {
m_sEmail = sEmail;
}
function getEmail() {
return(m_sEmail);
}
function onLoadSwf(eventObject) {
m_loader.removeEventListener("onLoadSwf", this);
m_loader.remove();
m_bSwfLoaded = true;
checkLoadingState();
}
static var GOD_MODE = false;
static var PAGE_FRONT = "front";
static var PAGE_GAME = "game";
static var PAGE_END = "end";
static var LEVELS = 3;
}
Symbol 1508 MovieClip [__Packages.Loader] Frame 0
class Loader
{
var m_mcAsset, m_mcRoot, m_percentage;
function Loader (mcAsset, mcRoot) {
m_mcAsset = mcAsset;
m_mcRoot = mcRoot;
mx.events.EventDispatcher.initialize(this);
m_mcAsset.setText = EventDelegate.create(this, setText);
m_mcAsset.onEnterFrame = EventDelegate.create(this, progressLoop);
m_mcAsset.play();
}
function remove(Void) {
}
function addEventListener(event, scope) {
}
function removeEventListener(event, listener) {
}
function dispatchEvent(eventObject) {
}
function progressLoop(Void) {
var _local3 = m_mcRoot.getBytesLoaded();
var _local2 = m_mcRoot.getBytesTotal();
m_percentage = Math.round((100 * _local3) / _local2);
m_mcAsset.mcBar.gotoAndStop(m_percentage);
if ((_local3 == _local2) && (_local2 > 100)) {
dispatchEvent({type:"onLoadSwf"});
if (m_mcAsset._currentframe == m_mcAsset._totalframes) {
m_mcAsset.onEnterFrame = null;
dispatchEvent({type:"onLoadSwf"});
}
m_mcAsset.nextFrame();
}
}
function setText() {
var _local2 = XLIFFManager.getInstance();
m_mcAsset.mcTextLoading.txtLoading.text = _local2.getStringFromResname("loading");
m_mcAsset.mcWalkman.txtPresents.text = _local2.getStringFromResname("walkman_presents");
m_mcAsset.mcKillerViral.txtAnother.text = _local2.getStringFromResname("another_game_from");
}
}
Symbol 1509 MovieClip [__Packages.mx.events.EventDispatcher] Frame 0
class mx.events.EventDispatcher
{
function EventDispatcher () {
}
static function _removeEventListener(queue, event, handler) {
if (queue != undefined) {
var _local4 = queue.length;
var _local1;
_local1 = 0;
while (_local1 < _local4) {
var _local2 = queue[_local1];
if (_local2 == handler) {
queue.splice(_local1, 1);
return(undefined);
}
_local1++;
}
}
}
static function initialize(object) {
if (_fEventDispatcher == undefined) {
_fEventDispatcher = new mx.events.EventDispatcher();
}
object.addEventListener = _fEventDispatcher.addEventListener;
object.removeEventListener = _fEventDispatcher.removeEventListener;
object.dispatchEvent = _fEventDispatcher.dispatchEvent;
object.dispatchQueue = _fEventDispatcher.dispatchQueue;
}
function dispatchQueue(queueObj, eventObj) {
var _local7 = "__q_" + eventObj.type;
var _local4 = queueObj[_local7];
if (_local4 != undefined) {
var _local5;
for (_local5 in _local4) {
var _local1 = _local4[_local5];
var _local3 = typeof(_local1);
if ((_local3 == "object") || (_local3 == "movieclip")) {
if (_local1.handleEvent != undefined) {
_local1.handleEvent(eventObj);
}
if (_local1[eventObj.type] != undefined) {
if (exceptions[eventObj.type] == undefined) {
_local1[eventObj.type](eventObj);
}
}
} else {
_local1.apply(queueObj, [eventObj]);
}
}
}
}
function dispatchEvent(eventObj) {
if (eventObj.target == undefined) {
eventObj.target = this;
}
this[eventObj.type + "Handler"](eventObj);
dispatchQueue(this, eventObj);
}
function addEventListener(event, handler) {
var _local3 = "__q_" + event;
if (this[_local3] == undefined) {
this[_local3] = new Array();
}
_global.ASSetPropFlags(this, _local3, 1);
_removeEventListener(this[_local3], event, handler);
this[_local3].push(handler);
}
function removeEventListener(event, handler) {
var _local2 = "__q_" + event;
_removeEventListener(this[_local2], event, handler);
}
static var _fEventDispatcher = undefined;
static var exceptions = {move:1, draw:1, load:1};
}
Symbol 1510 MovieClip [__Packages.EventDelegate] Frame 0
class EventDelegate
{
function EventDelegate () {
}
static function create(scope, method) {
var params = arguments.splice(2, arguments.length - 2);
var _local2 = function () {
method.apply(scope, arguments.concat(params));
};
return(_local2);
}
}
Symbol 1511 MovieClip [__Packages.XLIFFManager] Frame 0
class XLIFFManager
{
static var instance;
var ready, defaultLanguage, language, url, returnObj, returnFunc, xliff;
function XLIFFManager () {
ready = false;
defaultLanguage = "en";
language = System.capabilities.language;
url = "";
}
static function getInstance() {
if (instance == undefined) {
instance = new XLIFFManager();
}
return(instance);
}
function load(url, returnObj, returnFunc) {
var _local2;
this.url = url;
this.returnObj = returnObj;
this.returnFunc = returnFunc;
_local2 = url.split("@@").join(language);
xliff = new XML();
xliff.addRequestHeader("Cache-Control", "no-cache, max-age=0");
xliff.addRequestHeader("Pragma", "no-cache");
xliff.ignoreWhite = true;
xliff.onLoad = EventDelegate.create(this, loadComplete);
xliff.load(_local2);
}
function getStringFromResname(resname) {
var _local3;
var _local2;
var _local4;
_local3 = "";
_local4 = xliff.childNodes.length;
_local2 = 0;
while (_local2 < _local4) {
if (xliff.childNodes[_local2].attributes.resname == resname) {
_local3 = xliff.childNodes[_local2].childNodes[0].childNodes[0].toString();
_local3 = convertEntityReferences(_local3);
break;
}
_local2++;
}
return(_local3);
}
function isReady() {
return(ready);
}
function setLanguage(lang) {
language = lang;
}
function getLanguage() {
return(language);
}
function setDefaultLanguage(lang) {
defaultLanguage = lang;
}
function getDefaultLanguage() {
return(defaultLanguage);
}
function loadComplete(ok) {
var _local2;
if (ok) {
xliff = xliff.childNodes[0].childNodes[0].childNodes[1];
ready = true;
returnFunc.apply(returnObj, [true]);
} else if (language != defaultLanguage) {
language = defaultLanguage;
_local2 = url.split("@@").join(defaultLanguage);
xliff.load(_local2);
} else {
returnFunc.apply(returnObj, [false]);
}
}
function convertEntityReferences(str) {
str = str.split("<").join("<");
str = str.split(">").join(">");
str = str.split("&").join("&");
str = str.split("'").join("'");
str = str.split(""").join("\"");
return(str);
}
}
Symbol 1512 MovieClip [__Packages.Front] Frame 0
class Front
{
var m_mcAsset;
function Front (mcAsset) {
m_mcAsset = mcAsset;
m_mcAsset.activateButtons = EventDelegate.create(this, activateButtons);
m_mcAsset.setText = EventDelegate.create(this, setText);
Sounds.playSound(SoundData.MUSIC_INTRO, 99999);
Sounds.setVolume(SoundData.MUSIC_INTRO, 0);
Sounds.fadeSound(SoundData.MUSIC_INTRO, 30, 3);
}
function remove() {
}
function activateButtons() {
m_mcAsset.mcTransition.transitionDone = null;
m_mcAsset.mcTransition.btnBlocking.useHandCursor = false;
m_mcAsset.mcLoadGamePopup._visible = false;
m_mcAsset.mcLoadGamePopup.btnLoad.onRelease = EventDelegate.create(this, loadGame);
m_mcAsset.mcLoadGamePopup.btnClose.onRelease = EventDelegate.create(this, closeLoadPopup);
m_mcAsset.btnPlay.onRelease = EventDelegate.create(this, onPlay, "play_button");
m_mcAsset.btnInstructions.onRelease = EventDelegate.create(this, onInstructions, "instructions_button");
m_mcAsset.btnLoadGame.onRelease = EventDelegate.create(this, onLoadGame, "loadGame");
m_mcAsset.btnSendFriend.onRelease = EventDelegate.create(this, onButtonPress, "send_to_friend");
m_mcAsset.btnHighScores.onRelease = EventDelegate.create(this, onButtonPress, "high_scores");
m_mcAsset.btnMusic.onRelease = EventDelegate.create(this, onButtonPress, "wildhearts");
m_mcAsset.btnKillerViral.onRelease = EventDelegate.create(this, onButtonPress, "killerviral_logo");
m_mcAsset.btnSony.onRelease = EventDelegate.create(this, onButtonPress, "sony_logo");
m_mcAsset.btnWalkman.onRelease = EventDelegate.create(this, onButtonPress, "walkman_logo");
m_mcAsset.mcWin.btnEnter.onRelease = EventDelegate.create(this, onButtonPress, "competition", 258);
m_mcAsset.mcWin.btnUKRange.onRelease = EventDelegate.create(this, onButtonPress, "uk_range");
m_mcAsset.mcWin.btnROIRange.onRelease = EventDelegate.create(this, onButtonPress, "roi_range");
m_mcAsset.mcWin.btnUKDealer.onRelease = EventDelegate.create(this, onButtonPress, "uk_dealer");
m_mcAsset.mcWin.btnROIDealer.onRelease = EventDelegate.create(this, onButtonPress, "roi_dealer");
setText();
}
function onButtonPress(id, event) {
var _local2 = Application.getInstance().getLink(id);
if ((_local2.url != undefined) && (_local2.url != "")) {
getURL (_local2.url, "_blank");
}
if ((_local2.kv != undefined) && (_local2.kv != "")) {
_root.kvClick(_local2.kv);
}
if (event != undefined) {
_root.kvEvent(event);
}
}
function onPlay(id) {
onButtonPress(id);
m_mcAsset.mcTransition.transitionDone = EventDelegate.create(this, showGameIntro);
m_mcAsset.mcTransition.gotoAndPlay("in");
Sounds.fadeSound(SoundData.MUSIC_INTRO, 100, 1.5);
_root.kvEvent(239);
}
function onInstructions(id) {
onButtonPress(id);
m_mcAsset.mcTransition.transitionDone = EventDelegate.create(this, showInstructions);
m_mcAsset.mcTransition.gotoAndPlay("in");
_root.kvEvent(238);
}
function onLoadGame(id) {
var _local2 = Application.getInstance().getEmail();
if ((_local2 != undefined) && (_local2 != "")) {
m_mcAsset.mcLoadGamePopup.txtEmail.text = _local2;
}
Selection.setFocus(m_mcAsset.mcLoadGamePopup.txtEmail);
m_mcAsset.mcLoadGamePopup._visible = true;
m_mcAsset.mcLoadGamePopup.btnBlockadeBig.useHandCursor = false;
m_mcAsset.mcLoadGamePopup.btnBlockadeSmall.useHandCursor = false;
m_mcAsset.mcLoadGamePopup.btnBlockadeSmall._visible = false;
onButtonPress(id);
}
function loadGame() {
var _local2 = m_mcAsset.mcLoadGamePopup.txtEmail.text;
var _local3 = EmailValidator.validate(_local2);
if (_local3) {
m_mcAsset.mcLoadGamePopup.btnBlockadeSmall._visible = true;
Application.loadGameData(_local2);
}
}
function closeLoadPopup() {
m_mcAsset.mcLoadGamePopup._visible = false;
}
function showInstructions() {
m_mcAsset.gotoAndStop("instructions");
m_mcAsset.mcTransition.transitionDone = null;
m_mcAsset.btnBack.onRelease = EventDelegate.create(this, hideInstructions);
m_mcAsset.btnPlay.onRelease = EventDelegate.create(this, onPlay, "play_button");
var _local2 = XLIFFManager.getInstance();
m_mcAsset.mcInstructions.txtInstructions.text = _local2.getStringFromResname("instructions");
m_mcAsset.mcInstructions.txtInstructions1.text = _local2.getStringFromResname("cursor_keys_instruction");
m_mcAsset.mcInstructions.txtInstructions2.text = _local2.getStringFromResname("p_key_instruction");
m_mcAsset.mcInstructions.txtInstructions3.text = _local2.getStringFromResname("space_bar_instruction");
m_mcAsset.mcInstructions.mcSpaceBar.mcKey.txtLabel.text = _local2.getStringFromResname("space_bar");
m_mcAsset.btnBack.mcText.txtLabel.text = _local2.getStringFromResname("back_button");
m_mcAsset.btnPlay.mcText.txtLabel.text = _local2.getStringFromResname("play_button");
m_mcAsset.mcTransition.gotoAndPlay("out");
}
function hideInstructions() {
m_mcAsset.mcTransition.transitionDone = EventDelegate.create(this, instructionsHidden);
m_mcAsset.mcTransition.gotoAndPlay("in");
}
function instructionsHidden() {
m_mcAsset.mcTransition.transitionDone = null;
m_mcAsset.gotoAndStop("intro");
activateButtons();
m_mcAsset.mcTransition.gotoAndPlay("out");
}
function showGameIntro() {
m_mcAsset.mcTransition.transitionDone = null;
m_mcAsset.gotoAndStop("game_intro");
m_mcAsset.mcTransition.gotoAndPlay("out");
m_mcAsset.btnSkip.onRelease = EventDelegate.create(Application, Application.gotoPage, Application.PAGE_GAME);
m_mcAsset.mcGameIntro.animationDone = EventDelegate.create(this, startGame);
Sounds.fadeSound(SoundData.MUSIC_INTRO, 70, 3);
}
function startGame() {
m_mcAsset.btnSkip._visible = false;
Sounds.fadeSound(SoundData.MUSIC_INTRO, 0, 4);
Application.gotoPage(Application.PAGE_GAME);
}
function setText() {
var _local2 = XLIFFManager.getInstance();
m_mcAsset.mcWidlhearts.txtLabel.text = _local2.getStringFromResname("wildhearts_credit");
m_mcAsset.btnPlay.mcText.txtLabel.text = _local2.getStringFromResname("play_button");
m_mcAsset.btnInstructions.mcText.txtLabel.text = _local2.getStringFromResname("instructions_button");
m_mcAsset.btnSendFriend.mcText.txtLabel.text = _local2.getStringFromResname("send_friend_button");
m_mcAsset.btnHighScores.mcText.txtLabel.text = _local2.getStringFromResname("high_scores_button");
m_mcAsset.btnLoadGame.mcText.txtLabel.text = _local2.getStringFromResname("load_game_button");
m_mcAsset.btnMusic.mcText.txtLabel.text = _local2.getStringFromResname("music_button");
m_mcAsset.mcWin.btnEnter.txtTitle.txtWinTitle.text = _local2.getStringFromResname("competition_title");
m_mcAsset.mcWin.btnEnter.txtWin.text = _local2.getStringFromResname("competition_details");
m_mcAsset.mcWin.txtSeeTheRange.text = _local2.getStringFromResname("range");
m_mcAsset.mcWin.txtFindADealer.text = _local2.getStringFromResname("dealer");
m_mcAsset.mcWin.btnUKRange.mcLabel.txtCountry.text = _local2.getStringFromResname("country1");
m_mcAsset.mcWin.btnUKDealer.mcLabel.txtCountry.text = _local2.getStringFromResname("country1");
m_mcAsset.mcWin.btnROIRange.mcLabel.txtCountry.text = _local2.getStringFromResname("country2");
m_mcAsset.mcWin.btnROIDealer.mcLabel.txtCountry.text = _local2.getStringFromResname("country2");
}
function lockLoadGamePopup() {
m_mcAsset.mcLoadGamePopup.btnBlockadeSmall._visible = true;
}
function unlockLoadGamePopup() {
m_mcAsset.mcLoadGamePopup.btnBlockadeSmall._visible = false;
}
}
Symbol 1513 MovieClip [__Packages.Sounds] Frame 0
class Sounds
{
static var s_mainSound, s_mcMusicHolder, s_mcSfxHolder, s_musicSound, s_sfxSound, s_mcSoundButton, s_oSoundsList, s_aRandomSoundNamesList, s_ambienceInterval;
function Sounds () {
}
static function init(Void) {
if (s_mainSound == undefined) {
s_mcMusicHolder = _root.createEmptyMovieClip("mcMusicHolder", _root.getNextHighestDepth());
s_mcSfxHolder = _root.createEmptyMovieClip("mcSfxHolder", _root.getNextHighestDepth());
s_mainSound = new Sound(_root);
s_musicSound = new Sound(s_mcMusicHolder);
s_sfxSound = new Sound(s_mcSfxHolder);
}
}
static function initButton(mcBtn) {
s_mcSoundButton = mcBtn;
if (s_mainSound.getVolume() == 0) {
mainSoundDown();
} else {
mainSoundUp();
}
}
static function mainSoundUp(Void) {
s_mcSoundButton.gotoAndStop("up");
s_mcSoundButton.btnSound.onRelease = mainSoundDown;
s_mainSound.setVolume(100);
_root.kvEvent(237);
}
static function mainSoundDown(Void) {
s_mcSoundButton.gotoAndStop("down");
s_mcSoundButton.btnSound.onRelease = mainSoundUp;
s_mainSound.setVolume(0);
_root.kvEvent(236);
}
static function setSfx(aNames) {
if (s_oSoundsList == undefined) {
s_oSoundsList = new Object();
}
var _local5 = aNames.length;
var _local2 = 0;
while (_local2 < _local5) {
var _local1 = aNames[_local2];
var _local3 = s_mcSfxHolder.getNextHighestDepth();
var _local4 = s_mcSfxHolder.createEmptyMovieClip("holder" + _local3, _local3);
s_oSoundsList[_local1] = new Sound(_local4);
s_oSoundsList[_local1].attachSound(_local1);
_local2++;
}
}
static function setMusics(aNames) {
if (s_oSoundsList == undefined) {
s_oSoundsList = new Object();
}
var _local5 = aNames.length;
var _local2 = 0;
while (_local2 < _local5) {
var _local1 = aNames[_local2];
var _local3 = s_mcMusicHolder.getNextHighestDepth();
var _local4 = s_mcMusicHolder.createEmptyMovieClip("holder" + _local3, _local3);
s_oSoundsList[_local1] = new Sound(_local4);
s_oSoundsList[_local1].attachSound(_local1);
s_oSoundsList[_local1].setVolume(100);
trace(("added music[" + _local1) + "]");
_local2++;
}
}
static function setRandomSounds(aNames) {
s_aRandomSoundNamesList = aNames;
if (s_oSoundsList == undefined) {
s_oSoundsList = new Object();
}
var _local5 = s_aRandomSoundNamesList.length;
var _local2 = 0;
while (_local2 < _local5) {
var _local1 = s_aRandomSoundNamesList[_local2];
if (s_oSoundsList[_local1] == undefined) {
var _local3 = s_mcSfxHolder.getNextHighestDepth();
var _local4 = s_mcSfxHolder.createEmptyMovieClip("holder" + _local3, _local3);
s_oSoundsList[_local1] = new Sound(_local4);
s_oSoundsList[_local1].attachSound(_local1);
}
_local2++;
}
}
static function playSound(sName, loops) {
if (loops == undefined) {
loops = 0;
}
s_oSoundsList[sName].start(0, loops);
return(s_oSoundsList[sName]);
}
static function stopSound(sName) {
s_oSoundsList[sName].stop();
}
static function stopAllSounds(aExceptions) {
for (var _local4 in s_oSoundsList) {
var _local2 = true;
var _local1 = 0;
while (_local1 < aExceptions.length) {
if (_local4 == aExceptions[_local1]) {
_local2 = true;
}
_local1++;
}
if (!_local2) {
stopSound(_local4);
}
}
}
static function fadeSound(sName, targetVolume, duration, easing) {
var _local2 = s_oSoundsList[sName].getVolume();
if (easing == undefined) {
easing = mx.transitions.easing.None.easeNone;
}
var _local1 = new mx.transitions.Tween(Sounds, "volume", easing, _local2, targetVolume, duration, true);
_local1.onMotionChanged = EventDelegate.create(Sounds, tweenVolume, sName);
}
static function tweenVolume(tween, volume, sName) {
setVolume(sName, volume);
}
static function setVolume(sName, volume) {
s_oSoundsList[sName].setVolume(volume);
}
static function getVolume(sName) {
return(s_oSoundsList[sName].getVolume());
}
static function setVolumeSfx(volume) {
s_sfxSound.setVolume(volume);
}
static function setVolumeMusic(volume) {
s_musicSound.setVolume(volume);
}
static function playAmbience(Void) {
var _local2 = s_aRandomSoundNamesList.length;
var _local3 = Math.floor(_local2 * Math.random());
var _local1 = s_aRandomSoundNamesList[_local3];
var _local4 = 30 + Math.floor(30 * Math.random());
setVolume(_local1, _local4);
playSound(_local1, 0);
stopAmbience();
startAmbience();
}
static function startAmbience(bFirst) {
var _local1;
if (bFirst) {
_local1 = 1000 + Math.round(1000 * Math.random());
} else {
_local1 = 750 + Math.round(750 * Math.random());
}
clearInterval(s_ambienceInterval);
s_ambienceInterval = setInterval(playAmbience, _local1);
}
static function stopAmbience() {
clearInterval(s_ambienceInterval);
}
}
Symbol 1514 MovieClip [__Packages.mx.transitions.easing.None] Frame 0
class mx.transitions.easing.None
{
function None () {
}
static function easeNone(t, b, c, d) {
return(((c * t) / d) + b);
}
static function easeIn(t, b, c, d) {
return(((c * t) / d) + b);
}
static function easeOut(t, b, c, d) {
return(((c * t) / d) + b);
}
static function easeInOut(t, b, c, d) {
return(((c * t) / d) + b);
}
static var version = "1.1.0.52";
}
Symbol 1515 MovieClip [__Packages.mx.transitions.OnEnterFrameBeacon] Frame 0
class mx.transitions.OnEnterFrameBeacon
{
function OnEnterFrameBeacon () {
}
static function init() {
var _local4 = _global.MovieClip;
if (!_root.__OnEnterFrameBeacon) {
mx.transitions.BroadcasterMX.initialize(_local4);
var _local3 = _root.createEmptyMovieClip("__OnEnterFrameBeacon", 9876);
_local3.onEnterFrame = function () {
_global.MovieClip.broadcastMessage("onEnterFrame");
};
}
}
static var version = "1.1.0.52";
}
Symbol 1516 MovieClip [__Packages.mx.transitions.BroadcasterMX] Frame 0
class mx.transitions.BroadcasterMX
{
var _listeners;
function BroadcasterMX () {
}
static function initialize(o, dontCreateArray) {
if (o.broadcastMessage != undefined) {
delete o.broadcastMessage;
}
o.addListener = mx.transitions.BroadcasterMX.prototype.addListener;
o.removeListener = mx.transitions.BroadcasterMX.prototype.removeListener;
if (!dontCreateArray) {
o._listeners = new Array();
}
}
function addListener(o) {
removeListener(o);
if (broadcastMessage == undefined) {
broadcastMessage = mx.transitions.BroadcasterMX.prototype.broadcastMessage;
}
return(_listeners.push(o));
}
function removeListener(o) {
var _local2 = _listeners;
var _local3 = _local2.length;
while (_local3--) {
if (_local2[_local3] == o) {
_local2.splice(_local3, 1);
if (!_local2.length) {
broadcastMessage = undefined;
}
return(true);
}
}
return(false);
}
function broadcastMessage() {
var _local5 = String(arguments.shift());
var _local4 = _listeners.concat();
var _local6 = _local4.length;
var _local3 = 0;
while (_local3 < _local6) {
_local4[_local3][_local5].apply(_local4[_local3], arguments);
_local3++;
}
}
static var version = "1.1.0.52";
}
Symbol 1517 MovieClip [__Packages.mx.transitions.Tween] Frame 0
class mx.transitions.Tween
{
var obj, prop, begin, useSeconds, _listeners, addListener, prevTime, _time, looping, _duration, broadcastMessage, isPlaying, _fps, prevPos, _pos, change, _intervalID, _startTime;
function Tween (obj, prop, func, begin, finish, duration, useSeconds) {
mx.transitions.OnEnterFrameBeacon.init();
if (!arguments.length) {
return;
}
this.obj = obj;
this.prop = prop;
this.begin = begin;
position = (begin);
this.duration = (duration);
this.useSeconds = useSeconds;
if (func) {
this.func = func;
}
this.finish = (finish);
_listeners = [];
addListener(this);
start();
}
function set time(t) {
prevTime = _time;
if (t > duration) {
if (looping) {
rewind(t - _duration);
update();
broadcastMessage("onMotionLooped", this);
} else {
if (useSeconds) {
_time = _duration;
update();
}
stop();
broadcastMessage("onMotionFinished", this);
}
} else if (t < 0) {
rewind();
update();
} else {
_time = t;
update();
}
//return(time);
}
function get time() {
return(_time);
}
function set duration(d) {
_duration = (((d == null) || (d <= 0)) ? (_global.Infinity) : (d));
//return(duration);
}
function get duration() {
return(_duration);
}
function set FPS(fps) {
var _local2 = isPlaying;
stopEnterFrame();
_fps = fps;
if (_local2) {
startEnterFrame();
}
//return(FPS);
}
function get FPS() {
return(_fps);
}
function set position(p) {
setPosition(p);
//return(position);
}
function setPosition(p) {
prevPos = _pos;
obj[prop] = (_pos = p);
broadcastMessage("onMotionChanged", this, _pos);
updateAfterEvent();
}
function get position() {
return(getPosition());
}
function getPosition(t) {
if (t == undefined) {
t = _time;
}
return(func(t, begin, change, _duration));
}
function set finish(f) {
change = f - begin;
//return(finish);
}
function get finish() {
return(begin + change);
}
function continueTo(finish, duration) {
begin = position;
this.finish = (finish);
if (duration != undefined) {
this.duration = (duration);
}
start();
}
function yoyo() {
continueTo(begin, time);
}
function startEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.addListener(this);
} else {
_intervalID = setInterval(this, "onEnterFrame", 1000 / _fps);
}
isPlaying = true;
}
function stopEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.removeListener(this);
} else {
clearInterval(_intervalID);
}
isPlaying = false;
}
function start() {
rewind();
startEnterFrame();
broadcastMessage("onMotionStarted", this);
}
function stop() {
stopEnterFrame();
broadcastMessage("onMotionStopped", this);
}
function resume() {
fixTime();
startEnterFrame();
broadcastMessage("onMotionResumed", this);
}
function rewind(t) {
_time = ((t == undefined) ? 0 : (t));
fixTime();
update();
}
function fforward() {
time = (_duration);
fixTime();
}
function nextFrame() {
if (useSeconds) {
time = ((getTimer() - _startTime) / 1000);
} else {
time = (_time + 1);
}
}
function onEnterFrame() {
nextFrame();
}
function prevFrame() {
if (!useSeconds) {
time = (_time - 1);
}
}
function toString() {
return("[Tween]");
}
function fixTime() {
if (useSeconds) {
_startTime = getTimer() - (_time * 1000);
}
}
function update() {
position = (getPosition(_time));
}
static var version = "1.1.0.52";
static var __initBeacon = mx.transitions.OnEnterFrameBeacon.init();
static var __initBroadcaster = mx.transitions.BroadcasterMX.initialize(mx.transitions.Tween.prototype, true);
function func(t, b, c, d) {
return(((c * t) / d) + b);
}
}
Symbol 1518 MovieClip [__Packages.SoundData] Frame 0
class SoundData
{
function SoundData () {
}
static var MUSIC_LEVEL0 = "music: level0";
static var MUSIC_BOSS0 = "music: boss0";
static var MUSIC_LEVEL1 = "music: level1";
static var MUSIC_BOSS1 = "music: boss1";
static var MUSIC_LEVEL2 = "music: level2";
static var MUSIC_BOSS2 = "music: boss2";
static var MUSIC_END = "music: end";
static var MUSIC_INTRO = "music: intro";
static var SFX_GROWL = "snd: growl";
static var SFX_BOXING = "snd: boxing";
static var SFX_IMPACT = "snd: impact";
static var SFX_HANGING_SHEEP = "snd: hangingSheep";
static var SFX_HULK = "snd: hulk";
static var SFX_MINT_SAUCE = "snd: mintSauce";
static var SFX_OWW = "snd: oww";
static var SFX_RAM = "snd: ram";
static var SFX_ROBOT_STEPS = "snd: robotSteps";
static var SFX_SHEARS = "snd: shears";
static var SFX_SHEEP = "snd: sheep";
static var SFX_SWORD = "snd: sword";
static var SFX_TRICYCLE = "snd: tricycle";
static var SFX_TROLLEY_SQUEAK = "snd: trolleySqueak";
static var SFX_WELLIE = "snd: wellie";
static var SFX_WHIP = "snd: whip";
static var SFX_KICK = "snd: kick";
}
Symbol 1519 MovieClip [__Packages.EmailValidator] Frame 0
class EmailValidator
{
function EmailValidator () {
}
static function validate(_xES) {
var _local1 = _xES.toLowerCase();
var _local2 = _local1.indexOf("@");
var _local6 = _local1.substring(0, _local2);
var _local4 = _local1.length - 1;
var _local3 = _local1.lastIndexOf(".");
var _local5 = _local1.substring(_local2 + 1, _local3);
var _local7 = _local4 - (_local3 + 1);
if (_local2 == -1) {
return(false);
}
if (_local2 != _local1.lastIndexOf("@")) {
return(false);
}
if (xCheckSUVC(_local6) != true) {
return(false);
}
if (_local6.length < 1) {
return(false);
}
if (xCheckSUVC(_local5) != true) {
return(false);
}
if (_local5.length < 2) {
return(false);
}
if (xCheckSUVC(_local1.substr(_local3 + 1, _local4)) != true) {
return(false);
}
if ((_local7 < 1) || (_local7 > 3)) {
return(false);
}
return(true);
}
static function xCheckSUVC(xESS) {
var _local3 = true;
var _local2 = new Array("!", "\u00A3", "$", "%", "^", "&", "*", "+", "=", "?", ":", ";", "'", "\t", " ", "\"", "~", "#", "/");
var _local1 = 0;
while (_local1 <= (_local2.length - 1)) {
if (xESS.indexOf(_local2[_local1], 0) != -1) {
_local3 = false;
break;
}
_local1++;
}
return(_local3);
}
}
Symbol 1520 MovieClip [__Packages.End] Frame 0
class End
{
var m_mcAsset;
function End (mcAsset) {
m_mcAsset = mcAsset;
m_mcAsset.setContent = EventDelegate.create(this, setContent);
m_mcAsset.panelOut = EventDelegate.create(this, panelOut);
var _local2 = Application.getInstance().getEndData();
if (_local2.endType != TYPE_SUCCESS) {
m_mcAsset.gotoAndPlay("panel");
}
trace("oInfo.endType : " + _local2.endType);
}
function setContent() {
var _local3 = Application.getInstance().getEndData();
m_mcAsset.mcContent.gotoAndStop(_local3.endType);
var _local2 = XLIFFManager.getInstance();
m_mcAsset.mcContent.tfScoreLabel.autoSize = "right";
m_mcAsset.mcContent.tfScoreLabel.text = _local2.getStringFromResname("end_score_label");
m_mcAsset.mcContent.tfScore.text = _local3.score + "!";
m_mcAsset.mcContent.mcBack.mcText.tfText.text = _local2.getStringFromResname("back_to_start");
m_mcAsset.mcContent.mcBack.mcText.tfText.autoSize = "center";
m_mcAsset.mcContent.mcBack.onRelease = EventDelegate.create(this, onReleaseBack);
trace("setContent " + _local3.endType);
switch (_local3.endType) {
case TYPE_LEVEL :
m_mcAsset.mcContent.tfTitle.text = (_local2.getStringFromResname("end_of_level") + " ") + (_local3.level + 1);
m_mcAsset.mcContent.tfTitle.autoSize = "center";
m_mcAsset.mcContent.mcSend.mcText.tfText.autoSize = "center";
m_mcAsset.mcContent.mcSend.mcText.tfText.text = _local2.getStringFromResname("submit_score_title");
m_mcAsset.mcContent.mcContinue.mcText.tfText.text = _local2.getStringFromResname("continue_game");
m_mcAsset.mcContent.mcContinue.mcText.tfText.autoSize = "center";
m_mcAsset.mcContent.tfDescription.text = _local2.getStringFromResname("end_description_level");
m_mcAsset.mcContent.mcSend.onRelease = EventDelegate.create(this, onReleaseSendScore);
m_mcAsset.mcContent.mcContinue.onRelease = EventDelegate.create(this, onReleaseNextLevel);
break;
case TYPE_SUCCESS :
m_mcAsset.mcContent.tfTitle.autoSize = "center";
m_mcAsset.mcContent.tfTitle.text = _local2.getStringFromResname("game_over");
m_mcAsset.mcContent.tfDescription.text = _local2.getStringFromResname("end_description_success");
m_mcAsset.mcContent.mcSend.mcText.tfText.autoSize = "center";
m_mcAsset.mcContent.mcSend.mcText.tfText.text = _local2.getStringFromResname("submit_score_title");
m_mcAsset.mcContent.mcHighscore.mcText.tfText.autoSize = "center";
m_mcAsset.mcContent.mcHighscore.mcText.tfText.text = _local2.getStringFromResname("view_highscores");
m_mcAsset.mcContent.mcCompetition.mcText.tfText.autoSize = "center";
m_mcAsset.mcContent.mcCompetition.mcText.tfText.text = _local2.getStringFromResname("enter_competition");
m_mcAsset.mcContent.mcContinue.mcText.tfText.autoSize = "center";
m_mcAsset.mcContent.mcContinue.mcText.tfText.text = _local2.getStringFromResname("next_level");
m_mcAsset.mcContent.mcSend.onRelease = EventDelegate.create(this, onReleaseSendScore);
m_mcAsset.mcContent.mcContinue.onRelease = EventDelegate.create(this, onReleasePlayAgain);
m_mcAsset.mcContent.mcHighscore.onRelease = EventDelegate.create(this, onButtonPress, "high_scores");
m_mcAsset.mcContent.mcCompetition.onRelease = EventDelegate.create(this, onButtonPress, "competition", 258);
break;
case TYPE_FAILED :
m_mcAsset.mcContent.tfTitle.autoSize = "center";
m_mcAsset.mcContent.tfTitle.text = _local2.getStringFromResname("game_over");
m_mcAsset.mcContent.mcSend.mcText.tfText.autoSize = "center";
m_mcAsset.mcContent.mcSend.mcText.tfText.text = _local2.getStringFromResname("submit_score_title");
m_mcAsset.mcContent.mcHighscore.mcText.tfText.autoSize = "center";
m_mcAsset.mcContent.mcHighscore.mcText.tfText.text = _local2.getStringFromResname("view_highscores");
m_mcAsset.mcContent.mcCompetition.mcText.tfText.autoSize = "center";
m_mcAsset.mcContent.mcCompetition.mcText.tfText.text = _local2.getStringFromResname("enter_competition");
m_mcAsset.mcContent.mcContent.mcContinue.mcText.tfText.autoSize = "center";
m_mcAsset.mcContent.mcContinue.mcText.tfText.text = _local2.getStringFromResname("continue_game");
m_mcAsset.mcContent.mcSend.onRelease = EventDelegate.create(this, onReleaseSendScore);
m_mcAsset.mcContent.mcContinue.onRelease = EventDelegate.create(this, onReleaseSameLevel);
m_mcAsset.mcContent.mcHighscore.onRelease = EventDelegate.create(this, onButtonPress, "high_scores");
m_mcAsset.mcContent.mcCompetition.onRelease = EventDelegate.create(this, onButtonPress, "competition");
}
}
function panelOut() {
}
function onReleaseBack() {
Sounds.stopSound(SoundData.MUSIC_END);
m_mcAsset.gotoAndPlay("out");
m_mcAsset.panelOut = EventDelegate.create(Application, Application.gotoPage, Application.PAGE_FRONT);
}
function onReleaseSaveProgress() {
var _local3 = XLIFFManager.getInstance();
var _local2 = m_mcAsset.mcContent.mcSaveGamePopup;
_local2.gotoAndStop("on");
_local2.tfTitle.autoSize = "center";
_local2.tfTitle.text = _local3.getStringFromResname("submit_score_title");
_local2.save_mc.tfEmailLabel.autoSize = "right";
_local2.save_mc.tfEmailLabel.text = _local3.getStringFromResname("enter_email_label");
_local2.save_mc.tfEmailLabel.autoSize = "right";
_local2.save_mc.tfUsernameLabel.text = _local3.getStringFromResname("enter_username_label");
_local2.save_mc.save_btn.tfText.autoSize = "center";
_local2.save_mc.save_btn.tfText.text = _local3.getStringFromResname("submit_button");
_local2.mcClose.mcText.tfText.autoSize = "center";
_local2.mcClose.mcText.tfText.text = _local3.getStringFromResname("cancel_button");
_local2.save_mc.tfEmailLabel.autoSize = "right";
_local2.save_mc.tfOptIn1stLabel.text = _local3.getStringFromResname("optIn1st_label");
_local2.save_mc.tfEmailLabel.autoSize = "right";
_local2.save_mc.tfOptInKVLabel.text = _local3.getStringFromResname("optInKV_label");
Selection.setFocus(_local2.save_mc.username_txt);
_local2.mcClose.onRelease = EventDelegate.create(this, onReleaseClose);
unlockSaveGamePopup();
}
function onReleaseNextLevel() {
Sounds.stopSound(SoundData.MUSIC_END);
m_mcAsset.gotoAndPlay("out");
var _local2 = Application.getInstance().getEndData();
Application.getInstance().setLevelData(_local2.level + 1, _local2.score);
m_mcAsset.panelOut = EventDelegate.create(Application, Application.gotoPage, Application.PAGE_GAME);
}
function onReleaseClose() {
m_mcAsset.mcContent.mcSaveGamePopup.gotoAndStop("off");
}
function onReleaseSaveProgress_Popup() {
var _local2 = m_mcAsset.mcContent.mcSaveGamePopup.tfEmail.text;
var _local3 = EmailValidator.validate(_local2);
if (_local3) {
m_mcAsset.mcContent.mcSaveGamePopup.btnBlockadeSmall._visible = true;
Application.saveGameData(_local2);
}
}
function onReleaseSameLevel() {
Sounds.stopSound(SoundData.MUSIC_END);
m_mcAsset.gotoAndPlay("out");
var _local2 = Application.getInstance().getEndData();
Application.getInstance().setLevelData(_local2.level, _local2.lastLevelScore);
m_mcAsset.panelOut = EventDelegate.create(Application, Application.gotoPage, Application.PAGE_GAME);
}
function onReleasePlayAgain() {
Sounds.stopSound(SoundData.MUSIC_END);
m_mcAsset.gotoAndPlay("out");
Application.getInstance().setLevelData(0, 0);
m_mcAsset.panelOut = EventDelegate.create(Application, Application.gotoPage, Application.PAGE_GAME);
_root.kvEvent(239);
}
function onButtonPress(id, event) {
var _local2 = Application.getInstance().getLink(id);
if ((_local2.url != undefined) && (_local2.url != "")) {
getURL (_local2.url, "_blank");
}
if ((_local2.kv != undefined) && (_local2.kv != "")) {
_root.kvClick(_local2.kv);
}
if (event != undefined) {
_root.kvEvent(event);
}
}
function closeSavePopup() {
m_mcAsset.mcContent.mcSaveGamePopup.gotoAndStop("off");
}
function lockSaveGamePopup() {
m_mcAsset.mcContent.mcSaveGamePopup.btnBlockadeSmall._visible = true;
}
function unlockSaveGamePopup() {
m_mcAsset.mcContent.mcSaveGamePopup.btnBlockadeSmall._visible = false;
}
function onReleaseSendScore() {
var _local3 = XLIFFManager.getInstance();
var _local2 = m_mcAsset.mcContent.mcSaveGamePopup;
_local2.gotoAndStop("on");
_local2.tfTitle.autoSize = "center";
_local2.tfTitle.text = _local3.getStringFromResname("send_score_title");
_local2.tfEmailLabel.autoSize = "center";
_local2.tfEmailLabel.text = _local3.getStringFromResname("enter_email_label");
_local2.save_mc.save_btn.mcText.tfText.autoSize = "center";
_local2.save_mc.save_btn.mcText.tfText.text = _local3.getStringFromResname("send_button");
_local2.mcClose.mcText.tfText.autoSize = "center";
_local2.mcClose.mcText.tfText.text = _local3.getStringFromResname("close_button");
var _local4 = Application.getInstance().getEmail();
if ((_local4 != undefined) && (_local4 != "")) {
_local2.tfEmail.text = _local4;
}
Selection.setFocus(_local2.tfEmail);
_local2.mcClose.onRelease = EventDelegate.create(this, onReleaseClose);
_local2.mcSave.onRelease = EventDelegate.create(this, onReleaseSendScore_Popup);
unlockSaveGamePopup();
}
function onReleaseSendScore_Popup() {
var _local2 = m_mcAsset.mcContent.mcSaveGamePopup.tfEmail.text;
var _local3 = EmailValidator.validate(_local2);
if (_local3) {
m_mcAsset.mcContent.mcSaveGamePopup.btnBlockadeSmall._visible = true;
Application.sendScore(_local2);
}
}
static var TYPE_LEVEL = "level";
static var TYPE_SUCCESS = "success";
static var TYPE_FAILED = "failed";
}
Symbol 1521 MovieClip [__Packages.Game] Frame 0
class Game
{
static var s_instance;
var m_mcAsset, m_aLevels, m_scene, m_mcBossIntro, m_mcGo, m_mcFade, m_mcPopUp, m_mcStatusBar, m_level, m_score, m_currentArea, m_bDead, m_aActiveObjs, m_aActiveObjsToRemove, m_aEnemiesDamaged, m_hero, m_bBetweenAreas, m_leftBorder, m_leftBorderNew, m_pauseListener, m_timer, m_aEnemies;
function Game (mcAsset, aLevels, level, score) {
s_instance = this;
m_mcAsset = mcAsset;
m_aLevels = aLevels;
m_scene = new Scene(m_mcAsset.mcScene);
m_mcBossIntro = m_mcAsset.mcIntros;
m_mcGo = m_mcAsset.mcGo;
m_mcFade = m_mcAsset.mcFade;
m_mcPopUp = m_mcAsset.mcPopUp;
m_mcStatusBar = m_mcAsset.mcStatusBar;
m_mcFade.fadeOutEnd = EventDelegate.create(this, fadeOutEnd);
m_mcFade.fadeInEnd = EventDelegate.create(this, fadeInEnd);
m_mcPopUp.popupOutEnd = EventDelegate.create(this, popupOutEnd);
_global.currentLevel = (m_level = level);
m_score = score;
createLevel();
stopGame();
}
function remove() {
}
function createLevel() {
m_currentArea = 0;
m_bDead = false;
m_aActiveObjs = new Array();
m_aActiveObjsToRemove = new Array();
m_aEnemiesDamaged = new Array();
m_scene.initLayers(m_aLevels[m_level].layers.front, m_aLevels[m_level].layers.middle, m_aLevels[m_level].layers.decors);
var _local2 = m_scene.addToStage("hero");
m_hero = new Hero(_local2);
m_hero.addListener(this);
m_hero.draw();
addActiveObj(m_hero);
setArea();
m_bBetweenAreas = false;
m_leftBorder = 0;
m_leftBorderNew = null;
mainLoop();
m_pauseListener = new Object();
m_pauseListener.onKeyDown = EventDelegate.create(this, onKeyDown);
Key.addListener(m_pauseListener);
m_timer = new Timer();
addActiveObj(m_timer);
Sounds.playSound(MUSIC_LEVEL[m_level], 99999);
}
static function getInstance() {
return(s_instance);
}
function startGame() {
m_mcAsset.onEnterFrame = EventDelegate.create(this, mainLoop);
var _local3 = m_aActiveObjs.length;
var _local2 = 0;
while (_local2 < _local3) {
m_aActiveObjs[_local2].startAnim();
_local2++;
}
}
function stopGame() {
m_mcAsset.onEnterFrame = null;
var _local3 = m_aActiveObjs.length;
var _local2 = 0;
while (_local2 < _local3) {
m_aActiveObjs[_local2].stopAnim();
_local2++;
}
}
function mainLoop() {
Debug.clear();
var _local3 = m_aActiveObjs.length;
var _local2 = 0;
while (_local2 < _local3) {
m_aActiveObjs[_local2].step();
Debug.trace((m_aActiveObjs[_local2].m_mcAsset._name + " step: ") + _local2);
m_aActiveObjs[_local2].draw();
Debug.trace("object draw: " + _local2);
_local2++;
}
Debug.trace("--- objects step");
m_scene.step();
Debug.trace("--- scene step");
if (m_bBetweenAreas) {
Debug.trace("--- between start");
var _local6;
if (m_leftBorderNew == null) {
var _local4 = {x:m_hero.getXPos(), y:0};
m_hero.m_mcAsset._parent.localToGlobal(_local4);
m_scene.m_mcAsset.globalToLocal(_local4);
m_leftBorder = m_hero.getXPos() - _local4.x;
m_leftBorderNew = m_hero.getXPos() - (Scene.SCENE_WIDTH / 2);
} else if ((m_leftBorderNew - m_leftBorder) > 3) {
m_leftBorder = m_leftBorder + ((m_leftBorderNew - m_leftBorder) * 0.2);
m_leftBorderNew = m_hero.getXPos() - (Scene.SCENE_WIDTH / 2);
} else {
_local6 = m_hero.getXPos() - (Scene.SCENE_WIDTH / 2);
if (m_leftBorder < _local6) {
m_leftBorder = _local6;
}
}
var _local5 = (m_leftBorder + Scene.SCENE_WIDTH) + 50;
m_scene.setBorders(m_leftBorder, _local5);
m_hero.setBorders(m_leftBorder, _local5);
var _local7 = m_aLevels[m_level].areas[m_currentArea];
if (m_leftBorder > _local7.left) {
m_bBetweenAreas = false;
m_leftBorderNew = null;
if (_local7.type == "boss") {
m_mcBossIntro.gotoAndStop("boss" + m_level);
m_mcBossIntro.mcAnim.animEnd = EventDelegate.create(this, onBossIntroEnd);
stopGame();
Sounds.stopSound(MUSIC_LEVEL[m_level]);
Sounds.playSound(MUSIC_BOSS[m_level], 99999);
} else {
setArea();
}
m_mcGo.gotoAndStop("off");
}
Debug.trace("--- between end");
}
m_scene.drawLayers(m_hero.getXPos(), m_hero.getYPos());
m_scene.sortOnStage();
Debug.trace("--- sorted");
_local2 = 0;
while (_local2 < m_aActiveObjsToRemove.length) {
removeActiveObj(m_aActiveObjsToRemove[_local2]);
_local2++;
}
Debug.trace("--- removed unused");
displayTime();
}
function removeActiveObj(obj) {
var _local3 = m_aActiveObjs.length;
var _local2 = 0;
while (_local2 < _local3) {
if (m_aActiveObjs[_local2] == obj) {
m_aActiveObjs[_local2].remove();
m_aActiveObjs.splice(_local2, 1);
break;
}
_local2++;
}
}
function addActiveObj(obj) {
m_aActiveObjs.push(obj);
obj.addListener(this);
}
function addEnemyToList(enemy) {
m_aEnemies.push(enemy);
enemy.addListener(this);
}
function setArea() {
m_aEnemies = new Array();
var _local11 = m_aLevels[m_level].areas[m_currentArea];
m_scene.setBorders(_local11.left, _local11.right);
m_hero.setBorders(_local11.left, _local11.right);
var _local17 = _local11.enemies;
var _local9 = 0;
while (_local9 < _local17.length) {
var _local8 = _local17[_local9];
var _local12 = _local8.name;
var _local14 = _local8.x;
var _local13 = _local8.y + Scene.HERO_MIN_Y;
var _local4 = _local8.dir;
var _local3 = m_scene.addToStage(_local12);
var _local2;
if (_local12 == Enemy.TYPE_ZOMBIE) {
_local2 = new EnemyZombie(_local3, _local14, _local13, _local4, EnemyZombie.HEALTH_WEAK, Enemy.DAMAGE_WEAK, POINTS_SMALL, true, _local12);
} else if (_local12 == Enemy.TYPE_RUN) {
_local2 = new EnemyRun(_local3, _local14, _local13, _local4, EnemyRun.HEALTH_WEAK, Enemy.DAMAGE_MEDIUM, POINTS_MEDIUM, false, _local12);
} else if (_local12 == Enemy.TYPE_CYCLE) {
_local2 = new EnemyRun(_local3, _local14, _local13, _local4, EnemyRun.HEALTH_MEDIUM, Enemy.DAMAGE_MEDIUM, POINTS_MEDIUM, false, _local12);
} else if (_local12 == Enemy.TYPE_BOSS0) {
_local2 = new EnemyBoss0(_local3, _local14, _local13, _local4, POINTS_BOSS, _local12);
} else if (_local12 == Enemy.TYPE_BOSS1) {
_local2 = new EnemyBoss1(_local3, _local14, _local13, _local4, POINTS_BOSS, _local12);
} else if (_local12 == Enemy.TYPE_BOSS2) {
_local2 = new EnemyBoss2(_local3, _local14, _local13, _local4, POINTS_BOSS, _local12);
} else if (_local12 == Enemy.TYPE_HORSE) {
_local2 = new EnemyRun(_local3, _local14, _local13, _local4, EnemyRun.HEALTH_MEDIUM, Enemy.DAMAGE_STRONG, POINTS_LOT, false, _local12);
} else if (_local12 == Enemy.TYPE_NINJA) {
_local2 = new EnemyRobo(_local3, _local14, _local13, _local4, EnemyZombie.HEALTH_MEDIUM, Enemy.DAMAGE_MEDIUM, POINTS_MEDIUM, false, _local12);
} else if (_local12 == Enemy.TYPE_ROPE) {
_local2 = new EnemyRope(_local3, _local14, _local13, _local4, Enemy.DAMAGE_MEDIUM, POINTS_MEDIUM, _local12);
} else if (_local12 == Enemy.TYPE_THRILLER) {
_local2 = new EnemyZombie(_local3, _local14, _local13, _local4, EnemyZombie.HEALTH_MEDIUM, Enemy.DAMAGE_MEDIUM, POINTS_MEDIUM, false, _local12);
} else if (_local12 == Enemy.TYPE_JACKASS) {
_local2 = new EnemyRun(_local3, _local14, _local13, _local4, EnemyRun.HEALTH_STRONG, Enemy.DAMAGE_STRONG, POINTS_LOT, false, _local12);
} else if (_local12 == Enemy.TYPE_BLACK) {
_local2 = new EnemyRun(_local3, _local14, _local13, _local4, EnemyRun.HEALTH_MEDIUM, Enemy.DAMAGE_STRONG, POINTS_MEDIUM, false, _local12);
} else if (_local12 == Enemy.TYPE_ROBO) {
_local2 = new EnemyRobo(_local3, _local14, _local13, _local4, EnemyRun.HEALTH_MEDIUM, Enemy.DAMAGE_MEDIUM, POINTS_MEDIUM, false, _local12);
}
_local2.setBorders(_local11.left, _local11.right);
addActiveObj(_local2);
addEnemyToList(_local2);
_local9++;
}
m_hero.setEnemies(m_aEnemies);
var _local16 = _local11.items;
_local9 = 0;
while (_local9 < _local16.length) {
var _local5 = _local16[_local9];
var _local12 = _local5.name;
var _local7;
var _local6;
if (_local5.name == "gun") {
_local7 = Item.ID_GUN;
_local6 = Item.GUN_AMMO;
} else if (_local5.name == "boot") {
_local7 = Item.ID_BOOT;
_local6 = Item.BOOT_AMMO;
} else if (_local5.name == "shaver") {
_local7 = Item.ID_SHAVER;
_local6 = Item.SHAVER_AMMO;
} else if (_local5.name == "medkit") {
_local7 = Item.ID_MEDKIT;
_local6 = 0;
}
var _local14 = _local5.x;
var _local13 = _local5.y + Scene.HERO_MIN_Y;
var _local15 = m_scene.addToStage(_local12);
var _local10 = new Item(_local7, _local15, _local14, _local13, _local6);
_local10.addListener("onPickUpItem", this);
addActiveObj(_local10);
_local9++;
}
}
function addDamagedEnemy(enemy) {
var _local2 = 0;
while (_local2 < m_aEnemiesDamaged.length) {
if (m_aEnemiesDamaged[_local2] == enemy) {
return(undefined);
}
_local2++;
}
m_aEnemiesDamaged.push(enemy);
}
function onBossIntroEnd() {
m_mcBossIntro.gotoAndStop("off");
setArea();
startGame();
}
function onLevelEnd() {
m_level++;
_global.submitLevel = m_level;
_global.submitScore = m_score;
var _local4 = 1000 - m_timer.getTimeInSeconds();
if (_local4 < 0) {
_local4 = 0;
}
m_score = m_score + _local4;
if (m_level == Application.LEVELS) {
Application.getInstance().setEndData(m_level - 1, m_score, End.TYPE_SUCCESS);
Application.gotoPage(Application.PAGE_END);
_root.kvEvent(235);
} else {
Application.getInstance().setEndData(m_level - 1, m_score, End.TYPE_LEVEL);
Application.gotoPage(Application.PAGE_END);
_root.kvEvent(232 + m_level);
}
remove();
}
function setText() {
var _local2 = XLIFFManager.getInstance();
m_mcStatusBar.mcBar.tfTimeLabel.text = _local2.getStringFromResname("time_label");
m_mcStatusBar.mcBar.tfEnergyLabel.text = _local2.getStringFromResname("energy_label");
m_mcStatusBar.mcBar.tfScoreLabel.text = _local2.getStringFromResname("score_label");
}
function fadeOutEnd() {
m_mcPopUp.gotoAndPlay("in");
var _local2 = XLIFFManager.getInstance();
var _local3 = _local2.getStringFromResname("level_text");
m_mcPopUp.mcBoard.tfLevel.text = (_local3 + " ") + (m_level + 1);
}
function fadeInEnd() {
Key.removeListener(m_pauseListener);
Sounds.stopSound(MUSIC_BOSS[m_level]);
Sounds.stopSound(MUSIC_LEVEL[m_level]);
if (!m_bDead) {
Sounds.playSound(SoundData.MUSIC_INTRO, 9999);
onLevelEnd();
} else {
Sounds.playSound(SoundData.MUSIC_END, 9999);
Application.gotoPage(Application.PAGE_END);
remove();
}
}
function popupOutEnd() {
var _local2 = XLIFFManager.getInstance();
m_mcStatusBar.gotoAndPlay("in");
m_mcStatusBar.mcBar.tfEnergyLabel.text = _local2.getStringFromResname("energy_label");
m_mcStatusBar.mcBar.tfScoreLabel.text = _local2.getStringFromResname("score_label");
m_mcStatusBar.mcBar.tfTimeLabel.text = _local2.getStringFromResname("time_label");
Sounds.initButton(m_mcStatusBar.mcBar.mcSoundButton);
setText();
displayScore();
displayEnergy();
displayTime();
startGame();
}
function displayEnergy() {
m_mcStatusBar.mcBar.mcEnergy.gotoAndStop(1 + m_hero.getEnergy());
}
function displayScore() {
m_mcStatusBar.mcBar.tfScore.text = m_score;
}
function displayTime() {
m_mcStatusBar.mcBar.tfTime.text = m_timer.getFormattedTime();
}
function onRemoveActiveObj(eventObject) {
m_aActiveObjsToRemove.push(eventObject.obj);
}
function onHitEnemy(eventObject) {
addDamagedEnemy(eventObject.enemy);
eventObject.enemy.onGetDamage(eventObject.damage);
if (Math.random() < 0.4) {
var _local3 = m_scene.addToStage("compact" + (1 + Math.floor(3 * Math.random())));
var _local4 = 0.3 * eventObject.enemy.m_mcAsset._width;
var _local5 = 0.7 * eventObject.enemy.m_mcAsset.mcHitArea._height;
_local3._x = (eventObject.enemy.getPosX() + (_local4 / 2)) - (_local4 * Math.random());
_local3._y = eventObject.enemy.getPosY() + 3;
_local3.mcAnim._y = (-0.5 * _local5) - ((0.5 * _local5) * Math.random());
_local3._xscale = (_local3._yscale = 30 + (70 * Math.random()));
}
m_score = m_score + POINTS_HIT;
displayScore();
}
function onFinalHit(eventObject) {
var _local2 = 0;
while (_local2 < m_aEnemiesDamaged.length) {
m_aEnemiesDamaged[_local2].onFinalHit(eventObject.power);
_local2++;
}
m_aEnemiesDamaged = new Array();
}
function onHitHero(eventObject) {
m_hero.onGetDamage(eventObject.damage, eventObject.dir);
displayEnergy();
m_aEnemiesDamaged = new Array();
}
function onEnemyDeath(eventObject) {
var _local2 = 0;
while (_local2 < m_aEnemies.length) {
if (m_aEnemies[_local2] == eventObject.obj) {
m_aEnemies.splice(_local2, 1);
break;
}
_local2++;
}
m_hero.setEnemies(m_aEnemies);
m_score = m_score + eventObject.points;
displayScore();
if (m_aEnemies.length == 0) {
onClearArea();
}
}
function onEnemySwitchToNormal(eventObject) {
var _local2 = 0;
while (_local2 < m_aEnemiesDamaged.length) {
if (m_aEnemiesDamaged[_local2] == eventObject.obj) {
m_aEnemiesDamaged.splice(_local2, 1);
break;
}
_local2++;
}
}
function onClearArea() {
if (m_aLevels[m_level].areas.length == (m_currentArea + 1)) {
m_mcFade.gotoAndPlay("in");
stopGame();
return(undefined);
}
m_scene.setMode(Scene.MODE_CENTER);
m_currentArea++;
m_bBetweenAreas = true;
m_mcGo.gotoAndStop("on");
}
function onPickUpItem(eventObject) {
var _local3 = eventObject.id;
var _local2 = eventObject.ammo;
switch (_local3) {
case Item.ID_BOOT :
m_hero.setBoot(_local2);
break;
case Item.ID_GUN :
m_hero.setGun(_local2);
break;
case Item.ID_SHAVER :
m_hero.setShaver(_local2);
break;
case Item.ID_MEDKIT :
m_hero.addHealth(Item.MEDKIT_HEALTH);
displayEnergy();
}
}
function onShot(eventObject) {
var _local7 = eventObject.x;
var _local6 = eventObject.y;
var _local3 = eventObject.dir;
var _local5 = m_scene.addToStage("shot");
var _local2 = new Shot(_local5, _local7 + (_local3 * 50), _local6, _local3, m_aEnemies);
_local2.addListener(this);
_local2.draw();
addActiveObj(_local2);
}
function onDropWeapon(eventObject) {
var _local2 = eventObject.id;
var _local4;
if (_local2 == Item.ID_GUN) {
_local4 = "item: gun";
} else if (_local2 == Item.ID_BOOT) {
_local4 = "item: boot";
} else if (_local2 == Item.ID_SHAVER) {
_local4 = "item: shaver";
}
var _local8 = eventObject.x;
var _local7 = eventObject.y;
var _local6 = eventObject.ammo;
var _local9 = m_scene.addToStage(_local4);
var _local5 = new Item(_local2, _local9, _local8, _local7, _local6);
_local5.addListener("onPickUpItem", this);
addActiveObj(_local5);
_local5.drop(eventObject.dir);
}
function onKeyDown() {
if (Key.getCode() == KEY_PAUSE) {
if (m_mcAsset.onEnterFrame != null) {
m_mcAsset.mcPaused.gotoAndStop("on");
stopGame();
} else {
m_mcAsset.mcPaused.gotoAndStop("off");
startGame();
}
}
}
function onDeath(eventObject) {
_global.submitLevel = m_level;
_global.submitScore = m_score;
Application.getInstance().setEndData(m_level, m_score, End.TYPE_FAILED);
m_bDead = true;
m_mcFade.gotoAndPlay("in");
stopGame();
}
static var MODE_FIGHT = 0;
static var MODE_GO = 1;
static var POINTS_SMALL = 50;
static var POINTS_MEDIUM = 100;
static var POINTS_LOT = 200;
static var POINTS_BOSS = 1000;
static var POINTS_HIT = 2;
static var KEY_PAUSE = 80;
static var MUSIC_LEVEL = new Array(SoundData.MUSIC_LEVEL0, SoundData.MUSIC_LEVEL1, SoundData.MUSIC_LEVEL2);
static var MUSIC_BOSS = new Array(SoundData.MUSIC_BOSS0, SoundData.MUSIC_BOSS1, SoundData.MUSIC_BOSS2);
}
Symbol 1522 MovieClip [__Packages.Hero] Frame 0
class Hero
{
static var s_instance;
var m_mcAsset, m_bKeyActionUp, m_borderTop, m_borderBottom, m_sAction, m_xPos, m_yPos, m_xVel, m_yVel, m_bOnBorder, m_keyLeftPressTime, m_keyRightPressTime, m_bGun, m_bBoot, m_bShaver, m_combo, m_attack, m_nextAttack, m_bCauseDamage, m_health, m_bProtected, m_time, m_smashVel, m_attackFrame, m_ammo, m_enemyToShave, m_dx, m_borderLeft, m_borderRight, m_borderType, m_bNextToItem, m_itemToPickUp, m_bRun, m_bKeyLeftUp, m_bKeyRightUp, m_sActionPrev, m_aEnemies;
function Hero (mcAsset) {
AsBroadcaster.initialize(this);
s_instance = this;
m_mcAsset = mcAsset;
m_bKeyActionUp = true;
m_borderTop = Scene.HERO_MIN_Y;
m_borderBottom = Scene.HERO_MAX_Y;
m_sAction = ACTION_STAND;
m_xPos = Scene.SCENE_WIDTH / 2;
m_yPos = m_borderBottom - 50;
m_xVel = 0;
m_yVel = 0;
m_bOnBorder = false;
m_keyLeftPressTime = 0;
m_keyRightPressTime = 0;
m_bGun = false;
m_bBoot = false;
m_bShaver = false;
m_combo = 0;
m_attack = null;
m_nextAttack = null;
m_bCauseDamage = false;
m_health = HEALTH;
}
function remove() {
m_mcAsset.removeMovieClip();
}
function addListener(scope) {
}
function removeListener(listener) {
}
function broadcastMessage(msg, eventObject) {
}
static function getInstance() {
return(s_instance);
}
function step() {
if (m_bProtected) {
if ((m_time--) <= 0) {
m_bProtected = false;
blink(0);
}
}
m_xVel = 0;
m_yVel = 0;
if (m_sAction == ACTION_DAMAGE) {
m_xPos = m_xPos + m_smashVel;
m_smashVel = m_smashVel - (m_smashVel * 0.5);
m_time--;
(((m_time % 4) < 2) ? (blink(0)) : (blink(120 + ((130 * m_time) / 20))));
if (m_time <= 0) {
if (m_health <= 0) {
broadcastMessage("onDeath");
} else {
m_sAction = ACTION_STAND;
m_time = PROTECTION_TIME;
m_bProtected = true;
}
}
return(undefined);
}
keyControl();
if (((m_sAction == ACTION_KICK) || (m_sAction == ACTION_PUNCH)) || (m_sAction == ACTION_SUPER)) {
if ((((m_sAction == ACTION_KICK) && (m_attackFrame == KICK_LENGTH)) || ((m_sAction == ACTION_PUNCH) && (m_attackFrame == PUNCH_LENGTH))) || ((m_sAction == ACTION_SUPER) && (m_attackFrame == SUPER_LENGTH))) {
if ((m_nextAttack == null) || (!m_bCauseDamage)) {
var _local5 = m_attack + 1;
if (_local5 < 1) {
_local5 = 1;
}
if (m_bCauseDamage) {
broadcastMessage("onFinalHit", {power:_local5});
}
m_sAction = ACTION_STAND;
m_attack = null;
} else if (m_bCauseDamage) {
m_attack = m_nextAttack;
m_nextAttack = null;
m_sAction = ATTACK_SEQUENCE[m_attack];
m_attackFrame = 1;
m_bCauseDamage = false;
}
}
checkEnemyDamage(DAMAGE_MELEE);
m_attackFrame++;
return(undefined);
}
if (m_sAction == ACTION_SMASH) {
if (m_attackFrame == SMASH_LENGTH) {
m_sAction = ACTION_STAND;
m_attack = null;
m_nextAttack = null;
} else if (m_attackFrame >= SMASH_END) {
if (m_nextAttack != null) {
m_attackFrame = 0;
m_mcAsset.mcAnim.gotoAndPlay(m_attackFrame + 1);
m_nextAttack = null;
}
} else {
checkEnemyDamage(DAMAGE_BOOT);
m_attack = 3;
m_bCauseDamage = false;
}
m_attackFrame++;
} else if (m_sAction == ACTION_SHOOT) {
if (m_attackFrame == SHOOT_LENGTH) {
m_sAction = ACTION_STAND;
m_attack = null;
m_nextAttack = null;
if (m_ammo <= 0) {
dropWeapon();
}
} else if (m_attackFrame == SHOOT_FRAME) {
broadcastMessage("onShot", {x:m_xPos, y:m_yPos, dir:m_mcAsset._xscale / 100});
m_ammo--;
} else if (m_attackFrame == SHOOT_UP_FRAME) {
if ((m_nextAttack != null) && (m_ammo > 0)) {
m_attackFrame = SHOOT_FRAME - 1;
m_mcAsset.mcAnim.gotoAndPlay(m_attackFrame);
m_nextAttack = null;
}
} else {
m_attack = 3;
m_bCauseDamage = false;
}
m_attackFrame++;
} else if (m_sAction == ACTION_SHAVE) {
if (m_attackFrame == SHAVE_LENGTH) {
m_sAction = ACTION_STAND;
m_bShaver = false;
} else if (m_attackFrame == SHAVE_START) {
m_enemyToShave.hide();
m_enemyToShave.stopToShave();
} else if (m_attackFrame == SHAVE_FINISH) {
m_enemyToShave.show();
m_enemyToShave.switchToNude();
}
m_attackFrame++;
} else {
m_attack = null;
m_nextAttack = null;
m_bCauseDamage = false;
}
m_xPos = m_xPos + m_xVel;
m_yPos = m_yPos + m_yVel;
m_dx = m_xVel;
if (m_xPos < m_borderLeft) {
m_xPos = m_borderLeft;
m_dx = 0;
} else if (m_xPos > m_borderRight) {
m_xPos = m_borderRight;
m_dx = 0;
}
if (m_yPos < m_borderTop) {
m_yPos = m_borderTop;
} else if (m_yPos > m_borderBottom) {
m_yPos = m_borderBottom;
}
m_bOnBorder = false;
var _local3 = Scene.SCENE_WIDTH / 2;
var _local2 = m_borderLeft + _local3;
var _local4 = m_borderRight - _local3;
if ((m_xPos < _local2) || ((Math.abs(m_xPos - _local2) < m_xVel) && (m_xVel > 0))) {
if ((m_xPos - _local2) >= m_xVel) {
m_dx = m_xPos - (m_borderLeft + _local3);
} else {
m_dx = 0;
}
m_borderType = BORDER_LEFT;
m_bOnBorder = true;
} else if ((m_xPos > _local4) || ((m_xPos == _local4) && (m_xVel < 0))) {
m_dx = 0;
m_borderType = BORDER_RIGHT;
m_bOnBorder = true;
}
m_bNextToItem = false;
m_itemToPickUp = null;
}
function draw() {
m_mcAsset._x = m_xPos;
m_mcAsset._y = m_yPos;
if (m_xVel < 0) {
m_mcAsset._xscale = -100;
} else if (m_xVel > 0) {
m_mcAsset._xscale = 100;
}
setAnim();
if (m_bProtected) {
(((m_time % 2) < 1) ? (blink(0)) : (blink((120 * m_time) / PROTECTION_TIME)));
}
}
function setBorders(left, right) {
m_borderLeft = left;
m_borderRight = right;
}
function keyControl() {
if (Key.isDown(KEY_ACTION)) {
if (m_bKeyActionUp) {
m_bKeyActionUp = false;
if (m_bNextToItem) {
m_itemToPickUp.pickUp();
m_itemToPickUp = null;
m_bNextToItem = false;
m_attack = -1;
} else if (m_bShaver && (canShave())) {
if (m_ammo > 0) {
m_sAction = ACTION_SHAVE;
m_attackFrame = 1;
m_attack = -1;
m_ammo--;
}
} else if (m_bBoot && (m_nextAttack == null)) {
if (m_sAction == ACTION_SMASH) {
m_nextAttack = -1;
} else {
m_sAction = ACTION_SMASH;
m_attackFrame = 1;
m_attack = -1;
}
} else if (m_bGun && (m_nextAttack == null)) {
if (m_sAction == ACTION_SHOOT) {
m_nextAttack = -1;
} else {
m_sAction = ACTION_SHOOT;
m_attackFrame = 1;
m_attack = -1;
}
} else if (m_attack == null) {
m_attack = 0;
m_sAction = ATTACK_SEQUENCE[0];
m_attackFrame = 1;
} else if (m_nextAttack == null) {
m_nextAttack = m_attack + 1;
if (m_nextAttack == ATTACK_SEQUENCE.length) {
m_nextAttack = null;
}
}
}
m_bRun = false;
} else {
m_bKeyActionUp = true;
}
if (m_attack != null) {
return(undefined);
}
if (Key.isDown(KEY_UP)) {
m_yVel = (m_bRun ? ((-VEL_Y) * 2) : (-VEL_Y));
if (!m_bRun) {
m_sAction = ACTION_WALK;
}
} else if (Key.isDown(KEY_DOWN)) {
m_yVel = (m_bRun ? (VEL_Y * 2) : (VEL_Y));
if (!m_bRun) {
m_sAction = ACTION_WALK;
}
}
if (Key.isDown(KEY_LEFT)) {
if (m_bKeyLeftUp) {
m_bKeyLeftUp = false;
var _local2 = getTimer();
if ((_local2 - m_keyLeftPressTime) < TAP_TIME_RUN) {
m_bRun = true;
m_sAction = ACTION_RUN;
}
m_keyLeftPressTime = _local2;
}
if (!m_bRun) {
m_sAction = ACTION_WALK;
}
m_xVel = (m_bRun ? ((-VEL_X) * 3) : (-VEL_X));
} else if (Key.isDown(KEY_RIGHT)) {
if (m_bKeyRightUp) {
m_bKeyRightUp = false;
var _local2 = getTimer();
if ((_local2 - m_keyRightPressTime) < TAP_TIME_RUN) {
m_bRun = true;
m_sAction = ACTION_RUN;
}
m_keyRightPressTime = _local2;
}
if (!m_bRun) {
m_sAction = ACTION_WALK;
}
m_xVel = (m_bRun ? (VEL_X * 3) : (VEL_X));
} else {
m_bRun = false;
}
if (!Key.isDown(KEY_LEFT)) {
m_bKeyLeftUp = true;
}
if (!Key.isDown(KEY_RIGHT)) {
m_bKeyRightUp = true;
}
if ((((((m_sAction == ACTION_WALK) || (m_sAction == ACTION_RUN)) && (!Key.isDown(KEY_UP))) && (!Key.isDown(KEY_DOWN))) && (!Key.isDown(KEY_LEFT))) && (!Key.isDown(KEY_RIGHT))) {
m_sAction = ACTION_STAND;
}
}
function getDx() {
return(m_dx);
}
function getXPos() {
return(m_xPos);
}
function getYPos() {
return(m_yPos);
}
function setAnim() {
if (m_bBoot && (((m_sAction == ACTION_WALK) || (m_sAction == ACTION_STAND)) || (m_sAction == ACTION_RUN))) {
m_mcAsset.gotoAndStop(m_sAction + "_boot");
} else if (m_bGun && (((m_sAction == ACTION_WALK) || (m_sAction == ACTION_STAND)) || (m_sAction == ACTION_RUN))) {
m_mcAsset.gotoAndStop(m_sAction + "_gun");
} else if (m_bShaver && ((m_sAction == ACTION_WALK) || (m_sAction == ACTION_STAND))) {
m_mcAsset.gotoAndStop(m_sAction + "_shaver");
} else {
m_mcAsset.gotoAndStop(m_sAction);
}
if ((m_sAction == ACTION_WALK) && (m_sAction != m_sActionPrev)) {
m_mcAsset.mcAnim.gotoAndPlay(WALK_FIRST_FRAME);
}
if (m_bBoot) {
var _local2 = 1 + Math.floor((Item.BOOT_AMMO - m_ammo) / (Item.BOOT_AMMO / Item.BOOT_FRAMES));
m_mcAsset.mcAnim.mcBoot.gotoAndStop(_local2);
m_mcAsset.mcBoot.gotoAndStop(_local2);
} else if (m_bGun) {
var _local2 = 1 + Math.floor((Item.GUN_AMMO - m_ammo) / (Item.GUN_AMMO / Item.GUN_FRAMES));
m_mcAsset.mcAnim.mcGun.gotoAndStop(_local2);
m_mcAsset.mcGun.gotoAndStop(_local2);
}
m_sActionPrev = m_sAction;
if (m_bShaver) {
m_mcAsset.mcAnim.mcHand.mcShaver._visible = true;
} else {
m_mcAsset.mcAnim.mcHand.mcShaver._visible = false;
}
}
function setEnemies(aEnemies) {
m_aEnemies = aEnemies;
}
function checkEnemyDamage(damage) {
var _local3 = 0;
while (_local3 < m_aEnemies.length) {
var _local5 = m_mcAsset.mcAnim.mcHitArea;
var _local4 = m_aEnemies[_local3].getPosY();
if (((!m_aEnemies[_local3].isProtected()) && (_local5.hitTest(m_aEnemies[_local3].m_mcAsset.mcHitArea))) && (Math.abs(m_yPos - _local4) < 10)) {
m_bCauseDamage = true;
broadcastMessage("onHitEnemy", {enemy:m_aEnemies[_local3], damage:damage});
if (m_bBoot) {
broadcastMessage("onFinalHit", {power:3});
m_ammo--;
if (m_ammo == 0) {
dropWeapon();
m_sAction = ACTION_STAND;
m_attack = null;
m_nextAttack = null;
}
Sounds.playSound(SoundData.SFX_WELLIE);
}
if (m_sAction == ACTION_KICK) {
var _local2 = 0;
while (_local2 < KICK_FRAMES.length) {
if (m_attackFrame == KICK_FRAMES[_local2]) {
Sounds.playSound(SoundData.SFX_KICK);
}
_local2++;
}
}
}
_local3++;
}
}
function onGetDamage(damage, dir) {
m_attack = null;
m_nextAttack = null;
m_bCauseDamage = false;
m_bRun = false;
m_dx = 0;
m_smashVel = dir * 10;
m_sAction = ACTION_DAMAGE;
m_time = 20;
if (!Application.GOD_MODE) {
m_health = m_health - damage;
}
if (m_health < 0) {
m_health = 0;
}
Sounds.playSound(SoundData.SFX_IMPACT);
}
function isProtected() {
if ((m_sAction == ACTION_DAMAGE) || (m_bProtected)) {
return(true);
}
return(false);
}
function blink(value) {
var _local3 = new Color(m_mcAsset);
var _local2 = _local3.getTransform();
_local2.rb = value;
_local2.gb = value;
_local2.bb = value;
_local3.setTransform(_local2);
}
function nextToItem(item) {
m_bNextToItem = true;
m_itemToPickUp = item;
}
function setGun(ammo) {
if (m_bBoot || (m_bShaver)) {
dropWeapon();
}
m_bGun = true;
m_ammo = ammo;
}
function setBoot(ammo) {
if (m_bGun || (m_bShaver)) {
dropWeapon();
}
m_bBoot = true;
m_ammo = ammo;
}
function setShaver(ammo) {
if (m_bGun || (m_bBoot)) {
dropWeapon();
}
m_bShaver = true;
m_ammo = Item.SHAVER_AMMO;
}
function dropWeapon() {
var _local5 = m_mcAsset._xscale / 100;
if (m_bBoot) {
m_bBoot = false;
broadcastMessage("onDropWeapon", {id:Item.ID_BOOT, x:m_xPos, y:m_yPos, ammo:m_ammo, dir:_local5});
} else if (m_bGun) {
m_bGun = false;
broadcastMessage("onDropWeapon", {id:Item.ID_GUN, x:m_xPos, y:m_yPos, ammo:m_ammo, dir:_local5});
} else if (m_bShaver) {
m_bShaver = false;
broadcastMessage("onDropWeapon", {id:Item.ID_SHAVER, x:m_xPos, y:m_yPos, ammo:m_ammo, dir:_local5});
}
}
function stopAnim() {
m_mcAsset.mcAnim.stop();
}
function startAnim() {
m_mcAsset.mcAnim.play();
}
function getEnergy() {
return(Math.round((100 * m_health) / HEALTH));
}
function canShave() {
var _local4 = 0;
while (_local4 < m_aEnemies.length) {
var _local3 = m_aEnemies[_local4];
if (_local3.canShave()) {
var _local2 = _local3.getPosX() - m_xPos;
var _local6 = _local3.getPosY() - m_yPos;
var _local5 = ((m_mcAsset._xscale == 100) ? 1 : -1);
if ((Math.abs(_local6) < 10) && ((((_local2 > 40) && (_local2 < 120)) && (_local5 == 1)) || (((_local2 < -40) && (_local2 > -120)) && (_local5 == -1)))) {
m_enemyToShave = _local3;
return(true);
}
}
_local4++;
}
m_enemyToShave = null;
return(false);
}
function addHealth(value) {
m_health = m_health + value;
if (m_health > HEALTH) {
m_health = HEALTH;
}
}
static var HEALTH = 50;
static var KEY_UP = 38;
static var KEY_DOWN = 40;
static var KEY_LEFT = 37;
static var KEY_RIGHT = 39;
static var KEY_ACTION = 32;
static var ACTION_STAND = "stand";
static var ACTION_WALK = "walk";
static var ACTION_RUN = "run";
static var ACTION_PUNCH = "punch";
static var ACTION_KICK = "kick";
static var ACTION_SUPER = "super";
static var ACTION_DAMAGE = "damage";
static var ACTION_SMASH = "smash";
static var ACTION_SHOOT = "shoot";
static var ACTION_SHAVE = "shave";
static var KICK_FRAMES = new Array(2, 4, 6);
static var KICK_LENGTH = 7;
static var PUNCH_FRAMES = new Array(1, 6, 10);
static var PUNCH_LENGTH = 10;
static var SUPER_LENGTH = 32;
static var SMASH_LENGTH = 16;
static var SMASH_FRAME = 5;
static var SMASH_END = 11;
static var SHOOT_LENGTH = 16;
static var SHOOT_FRAME = 4;
static var SHOOT_UP_FRAME = 11;
static var SHAVE_LENGTH = 40;
static var SHAVE_START = 8;
static var SHAVE_FINISH = 30;
static var ATTACK_SEQUENCE = new Array(ACTION_KICK, ACTION_PUNCH, ACTION_KICK, ACTION_PUNCH, ACTION_SUPER);
static var DAMAGE_MELEE = 1;
static var DAMAGE_BOOT = 15;
static var WALK_FIRST_FRAME = 8;
static var VEL_X = 7;
static var VEL_Y = 3.5;
static var BORDER_LEFT = 0;
static var BORDER_RIGHT = 1;
static var TAP_TIME_RUN = 500;
static var PROTECTION_TIME = 20;
}
Symbol 1523 MovieClip [__Packages.Item] Frame 0
class Item
{
var m_id, m_mcAsset, m_xPos, m_yPos, m_zPos, m_hero, m_time, m_mode, m_ammo, m_yVel, m_groundHits;
function Item (id, mcAsset, x, y, ammo) {
AsBroadcaster.initialize(this);
m_id = id;
m_mcAsset = mcAsset;
m_xPos = x;
m_yPos = y;
m_zPos = 0;
m_hero = Hero.getInstance();
m_time = TIME_GROUND;
m_mode = MODE_NORMAL;
m_ammo = ammo;
var _local3;
if (id == ID_BOOT) {
_local3 = 1 + Math.floor((BOOT_AMMO - m_ammo) / (BOOT_AMMO / BOOT_FRAMES));
} else if (id == ID_GUN) {
_local3 = 1 + Math.floor((GUN_AMMO - m_ammo) / (GUN_AMMO / GUN_FRAMES));
} else if (id == ID_SHAVER) {
_local3 = 1 + Math.floor((SHAVER_AMMO - m_ammo) / (SHAVER_AMMO / SHAVER_FRAMES));
}
m_mcAsset.mcItem.mcState.gotoAndStop(_local3);
}
function remove() {
m_mcAsset.removeMovieClip();
}
function addListener(scope) {
}
function removeListener(listener) {
}
function broadcastMessage(msg, eventObject) {
}
function step() {
if (m_mode == MODE_DROP) {
m_zPos = m_zPos + m_yVel;
m_yVel = m_yVel + GRAVITY;
if (m_zPos > 0) {
m_zPos = 0;
m_groundHits++;
if (m_groundHits >= 2) {
setMode(MODE_WAIT);
} else {
m_yVel = m_yVel * -0.4;
}
}
} else if (m_mode == MODE_NORMAL) {
var _local3 = Math.abs(m_xPos - m_hero.getXPos());
var _local2 = Math.abs(m_yPos - m_hero.getYPos());
if ((_local3 < 20) && (_local2 < 10)) {
if (m_id == ID_MEDKIT) {
pickUp();
} else {
m_hero.nextToItem(this);
}
}
} else if (m_mode == MODE_WAIT) {
m_time--;
if (m_time == 0) {
broadcastMessage("onRemoveActiveObj", {obj:this});
} else if (m_time < 8) {
m_mcAsset._alpha = (((m_time % 2) < 1) ? 0 : 100);
} else if ((m_time < 20) && (m_time > 8)) {
m_mcAsset._alpha = (((m_time % 4) < 2) ? 0 : 100);
} else {
var _local3 = Math.abs(m_xPos - m_hero.getXPos());
var _local2 = Math.abs(m_yPos - m_hero.getYPos());
if (((_local3 < 20) && (_local2 < 5)) && (m_ammo > 0)) {
m_hero.nextToItem(this);
}
}
}
}
function draw() {
m_mcAsset._x = m_xPos;
m_mcAsset._y = m_yPos;
m_mcAsset.mcItem._y = m_zPos;
}
function pickUp() {
broadcastMessage("onPickUpItem", {id:m_id, ammo:m_ammo});
broadcastMessage("onRemoveActiveObj", {obj:this});
}
function setMode(mode) {
m_mode = mode;
}
function drop(dir) {
setMode(MODE_DROP);
m_time = ((m_ammo <= 0) ? 20 : (TIME_GROUND));
if (m_id == ID_BOOT) {
m_zPos = BOOT_Z;
} else if (m_id == ID_GUN) {
m_zPos = GUN_Z;
} else if (m_id == ID_SHAVER) {
m_zPos = SHAVER_Z;
}
m_yVel = -5;
m_groundHits = 0;
m_mcAsset._xscale = dir * 100;
}
function setAmmo(ammo) {
m_ammo = ammo;
}
static var ID_GUN = 0;
static var ID_BOOT = 1;
static var ID_SHAVER = 2;
static var ID_MEDKIT = 3;
static var GUN_AMMO = 8;
static var GUN_FRAMES = 5;
static var BOOT_AMMO = 6;
static var BOOT_FRAMES = 3;
static var SHAVER_AMMO = 1;
static var SHAVER_FRAMES = 1;
static var MEDKIT_HEALTH = 30;
static var BOOT_Z = -110;
static var GUN_Z = -100;
static var SHAVER_Z = -70;
static var MODE_NORMAL = 0;
static var MODE_DROP = 1;
static var MODE_WAIT = 2;
static var TIME_GROUND = 100;
static var GRAVITY = 1;
}
Symbol 1524 MovieClip [__Packages.Enemy] Frame 0
class Enemy
{
var m_mcAsset, m_xPos, m_yPos, m_zPos, m_dir, m_xVel, m_yVel, m_time, m_blinkTime, m_bShaved, m_mcEnergy, m_yBar, m_barTime, m_borderTop, m_borderBottom, m_hero, m_bDamageSound, m_sType, m_mode, m_healthMax, m_health, m_borderLeft, m_borderRight, m_soundInterval, m_smashVel, m_totalTime, m_damage, m_points;
function Enemy (mcAsset, x, y, dir, bShaved) {
AsBroadcaster.initialize(this);
m_mcAsset = mcAsset;
m_xPos = x;
m_yPos = y;
m_zPos = 0;
m_dir = dir;
m_xVel = 0;
m_yVel = 0;
m_time = 0;
m_blinkTime = 0;
m_bShaved = ((bShaved == undefined) ? false : (bShaved));
m_mcEnergy = m_mcAsset.mcEnergy;
m_mcEnergy._alpha = 0;
m_yBar = m_mcEnergy._y;
m_barTime = null;
m_borderTop = Scene.HERO_MIN_Y;
m_borderBottom = Scene.HERO_MAX_Y;
m_hero = Hero.getInstance();
m_bDamageSound = false;
draw();
}
function remove() {
m_mcAsset.removeMovieClip();
}
function addListener(scope) {
}
function removeListener(listener) {
}
function broadcastMessage(msg, eventObject) {
}
function step() {
if (m_barTime > 0) {
m_barTime--;
} else if (m_barTime == 0) {
m_mcEnergy._alpha = 0;
}
Debug.trace((m_sType + " : ") + m_time);
}
function draw() {
m_mcAsset._x = m_xPos;
m_mcAsset._y = m_yPos;
m_mcAsset._xscale = (-m_dir) * 100;
if (m_mode == MODE_SMASHED) {
m_mcAsset.mcAnim._y = m_zPos;
}
setAnim();
m_mcEnergy._y = m_zPos + m_yBar;
m_mcEnergy._xscale = (60 * m_mcAsset._xscale) / 100;
m_mcEnergy.gotoAndStop(1 + Math.round((100 * m_health) / m_healthMax));
}
function setAnim() {
switch (m_mode) {
case MODE_FOLLOW :
case MODE_MOVE :
m_mcAsset.gotoAndStop("walk");
break;
case MODE_DAMAGED :
m_mcAsset.gotoAndStop("damaged");
break;
case MODE_ATTACK :
m_mcAsset.gotoAndStop("attack");
break;
case MODE_SMASHED :
m_mcAsset.gotoAndStop("flight");
break;
case MODE_STAND :
m_mcAsset.gotoAndStop("stand");
break;
case MODE_TRANSFORM :
m_mcAsset.gotoAndStop("transform");
}
}
function setBorders(left, right) {
m_borderLeft = left;
m_borderRight = right;
}
function getPosX() {
return(m_xPos);
}
function getPosY() {
return(m_yPos);
}
function onGetDamage(damage) {
m_mode = MODE_DAMAGED;
m_time = 10;
m_health = m_health - damage;
if (m_health <= 0) {
m_health = 0;
m_mcEnergy._visible = false;
}
m_barTime = BAR_TIME;
m_mcEnergy._alpha = 100;
if (!m_bDamageSound) {
m_bDamageSound = true;
var _local2 = Sounds.playSound(SoundData.SFX_SHEEP);
clearInterval(m_soundInterval);
m_soundInterval = setInterval(this, "resetSoundDamage", 1000);
}
}
function resetSoundDamage() {
m_bDamageSound = false;
}
function damageStep() {
if (m_time > 7) {
blink((200 * (m_time - 7)) / 3);
} else {
blink(0);
}
}
function blink(value) {
var _local3 = new Color(m_mcAsset);
var _local2 = _local3.getTransform();
_local2.rb = value;
_local2.gb = value;
_local2.bb = value;
_local3.setTransform(_local2);
}
function onFinalHit(power) {
m_mode = MODE_SMASHED;
m_smashVel = 6 + (power * 1);
m_time = 10 + (power * 2);
m_totalTime = m_time;
m_bDamageSound = false;
}
function smashStep() {
if ((m_totalTime - m_time) < 4) {
blink(200 * (1 - ((m_totalTime - m_time) / 3)));
} else {
blink(0);
}
var _local3 = m_hero.getXPos();
var _local4 = ((_local3 < m_xPos) ? -1 : 1);
m_xPos = m_xPos - (_local4 * m_smashVel);
var _local2 = (100 * m_time) / m_totalTime;
if (_local2 > 60) {
m_zPos = (-m_totalTime) * Math.sin((Math.PI * (_local2 - 60)) / 60);
} else if (m_time > 1) {
m_smashVel = m_smashVel - (m_smashVel * 0.2);
m_zPos = ((-m_totalTime) * 0.2) * Math.sin((Math.PI * _local2) / 60);
} else {
m_smashVel = 0;
m_zPos = 0;
m_mcAsset.mcAnim._y = 0;
if (m_health <= 0) {
die();
}
}
}
function isProtected() {
if (((m_mode == MODE_SMASHED) || (m_mode == MODE_DIE)) || (m_mode == MODE_SHAVED)) {
return(true);
}
return(false);
}
function checkHeroCollision() {
var _local2 = m_hero.getYPos();
if (((Math.abs(m_yPos - _local2) < 10) && (!m_hero.isProtected())) && (m_mcAsset.mcAttackArea.hitTest(m_hero.m_mcAsset.mcHitArea))) {
broadcastMessage("onHitHero", {damage:m_damage, dir:m_dir});
if (m_sType == TYPE_RUN) {
Sounds.playSound(SoundData.SFX_RAM);
}
}
}
function die() {
m_mode = MODE_DIE;
m_time = 20;
blink(0);
}
function dieStep() {
if (m_time > 6) {
if ((m_time % 4) < 2) {
m_mcAsset._alpha = 0;
} else {
m_mcAsset._alpha = 70;
}
} else {
if ((m_time % 2) == 0) {
m_mcAsset._alpha = 0;
} else {
m_mcAsset._alpha = m_time * 10;
}
if (m_time <= 1) {
broadcastMessage("onEnemyDeath", {obj:this, points:m_points});
broadcastMessage("onRemoveActiveObj", {obj:this});
m_time = 99;
}
}
}
function stopAnim() {
m_mcAsset.mcAnim.stop();
}
function startAnim() {
m_mcAsset.mcAnim.play();
}
function hide() {
m_mcAsset._visible = false;
}
function show() {
m_mcAsset._visible = true;
}
function switchToNude() {
m_mcAsset.removeMovieClip();
m_mcAsset = Scene.getInstance().addToStage("nude");
m_mode = MODE_SHAVED;
m_xVel = -3;
m_yVel = 0;
draw();
}
function canShave() {
return(m_bShaved);
}
function stopToShave() {
m_mode = MODE_STAND;
m_time = -1;
stopAnim();
}
static var TYPE_ZOMBIE = "zombie";
static var TYPE_RUN = "run";
static var TYPE_CYCLE = "cycle";
static var TYPE_BOSS0 = "boss0";
static var TYPE_HORSE = "horse";
static var TYPE_NINJA = "ninja";
static var TYPE_ROPE = "rope";
static var TYPE_BOSS1 = "boss1";
static var TYPE_JACKASS = "jackass";
static var TYPE_ROBO = "robo";
static var TYPE_BLACK = "black";
static var TYPE_THRILLER = "thriller";
static var TYPE_BOSS2 = "boss2";
static var MODE_STAND = 0;
static var MODE_MOVE = 1;
static var MODE_ATTACK = 2;
static var MODE_DAMAGED = 3;
static var MODE_SHAVED = 4;
static var MODE_FOLLOW = 5;
static var MODE_SMASHED = 6;
static var MODE_DIE = 7;
static var MODE_UP = 8;
static var MODE_TRANSFORM = 9;
static var DAMAGE_WEAK = 2;
static var DAMAGE_MEDIUM = 5;
static var DAMAGE_STRONG = 10;
static var BAR_TIME = 30;
}
Symbol 1525 MovieClip [__Packages.Scene] Frame 0
class Scene
{
static var s_instance;
var m_mcAsset, m_depthOnStage, m_mcMiddle, m_mcStage, m_mcFront, m_widthMiddle, m_widthFront, m_velMiddle, m_velFront, m_aOnStage, m_borderLeft, m_borderRight, m_mode, m_time;
function Scene (mcAsset) {
s_instance = this;
m_mcAsset = mcAsset;
m_depthOnStage = 0;
}
function remove() {
}
static function getInstance() {
return(s_instance);
}
function initLayers(aFrontNames, aMiddleNames, aDecors) {
m_mcMiddle = m_mcAsset.createEmptyMovieClip("mcMiddle", DEPTH_MIDDLE);
m_mcStage = m_mcAsset.createEmptyMovieClip("mcStage", DEPTH_STAGE);
m_mcFront = m_mcAsset.createEmptyMovieClip("mcFront", DEPTH_FRONT);
var _local2;
m_widthMiddle = 0;
var _local3 = 0;
while (_local3 < aMiddleNames.length) {
_local2 = m_mcMiddle.attachMovie(aMiddleNames[_local3], "layer" + _local3, _local3);
_local2._x = m_widthMiddle;
m_widthMiddle = m_widthMiddle + (_local2._width - 1);
_local2.cacheAsBitmap = true;
_local3++;
}
_local3 = 0;
while (_local3 < aDecors.length) {
var _local8 = aDecors[_local3].name;
var _local9 = aDecors[_local3].x;
var _local4 = aDecors[_local3].scale;
var _local5 = m_mcMiddle.getNextHighestDepth();
var _local7 = m_mcMiddle.attachMovie(_local8, "decor" + _local5, _local5, {_x:_local9, _y:DECORS_Y, _xscale:_local4, _yscale:_local4});
_local7.cacheAsBitmap = true;
_local3++;
}
m_widthFront = 0;
_local3 = 0;
while (_local3 < aFrontNames.length) {
_local2 = m_mcFront.attachMovie(aFrontNames[_local3], "layer" + _local3, _local3);
_local2._x = m_widthFront;
m_widthFront = m_widthFront + _local2._width;
_local2.cacheAsBitmap = true;
_local3++;
}
m_velMiddle = 1;
m_velFront = m_widthFront / m_widthMiddle;
m_aOnStage = new Array();
}
function addToStage(sName) {
var _local2 = m_mcStage.attachMovie(sName, sName + m_depthOnStage, m_depthOnStage);
m_aOnStage.push(_local2);
m_depthOnStage++;
return(_local2);
}
function removeFromStage(mcAsset) {
var _local2 = 0;
while (_local2 < m_aOnStage.length) {
if (m_aOnStage[_local2] == mcAsset) {
m_aOnStage.splice(_local2, 1);
return(true);
}
_local2++;
}
return(false);
}
function sortOnStage() {
var _local3 = new Array();
var _local2 = 0;
while (_local2 < m_aOnStage.length) {
if (m_aOnStage[_local2]._name == undefined) {
m_aOnStage[_local2] = null;
m_aOnStage.splice(_local2, 1);
_local2--;
} else {
_local3.push({y:Math.round(m_aOnStage[_local2]._y), ind:_local2});
}
_local2++;
}
_local3.sortOn("y", Array.NUMERIC);
Debug.trace("aTmp.length : " + _local3.length);
_local2 = 0;
while (_local2 < m_aOnStage.length) {
m_aOnStage[_local2].swapDepths(1000 + _local2);
_local2++;
}
_local2 = 0;
while (_local2 < _local3.length) {
m_aOnStage[_local3[_local2].ind].swapDepths(_local2);
Debug.trace((((((_local2 + ", ") + m_aOnStage[_local3[_local2].ind]._y) + ", ") + m_aOnStage[_local3[_local2].ind]._name) + ", ") + m_aOnStage[_local3[_local2].ind].getDepth());
_local2++;
}
}
function draw() {
}
function drawLayers(xHero, yHero) {
var _local3 = yHero - HERO_MIN_Y;
var _local2 = xHero - (SCENE_WIDTH / 2);
if (_local2 < m_borderLeft) {
_local2 = m_borderLeft;
} else if (_local2 > (m_borderRight - SCENE_WIDTH)) {
_local2 = m_borderRight - SCENE_WIDTH;
}
var _local4 = _local2 * m_velFront;
m_mcMiddle._x = -_local2;
m_mcMiddle._y = (-_local3) * VEL_Y_MIDDLE;
m_mcStage._x = -_local2;
m_mcStage._y = (-_local3) * VEL_Y_MIDDLE;
m_mcFront._x = -_local4;
m_mcFront._y = (-_local3) * VEL_Y_FRONT;
}
function setMode(mode) {
m_mode = mode;
}
function setBorders(left, right) {
m_borderLeft = left;
m_borderRight = right;
}
function shake() {
m_time = 10;
}
function step() {
if (m_time > 0) {
m_time--;
m_mcAsset._x = ((3 * (1 - (2 * Math.random()))) * m_time) / 10;
m_mcAsset._y = ((3 * (1 - (2 * Math.random()))) * m_time) / 10;
} else if (m_time == 0) {
m_mcAsset._x = 0;
m_mcAsset._y = 0;
m_time = null;
}
}
static var SCENE_WIDTH = 640;
static var SCENE_HEIGHT = 400;
static var DECORS_Y = 340;
static var LAYER_HEIGHT = 470;
static var LAYER_FRONT_HEIGHT = 550;
static var HERO_MIN_Y = 350;
static var HERO_MAX_Y = 460;
static var DEPTH_MIDDLE = 1;
static var DEPTH_STAGE = 2;
static var DEPTH_FRONT = 3;
static var MODE_NORMAL = 0;
static var MODE_CENTER = 1;
static var VEL_Y_MIDDLE = (LAYER_HEIGHT - SCENE_HEIGHT) / (HERO_MAX_Y - HERO_MIN_Y);
static var VEL_Y_FRONT = (LAYER_FRONT_HEIGHT - SCENE_HEIGHT) / (HERO_MAX_Y - HERO_MIN_Y);
}
Symbol 1526 MovieClip [__Packages.Debug] Frame 0
class Debug
{
static var s_instance;
var m_tfDebug;
function Debug () {
s_instance = this;
var _local4 = _root.createEmptyMovieClip("mcContainer", 9999);
m_tfDebug = _root.createTextField("tfDebug", 99, 0, 30, 200, 420);
m_tfDebug.border = true;
m_tfDebug.background = true;
m_tfDebug.backgroundColor = 16777215 /* 0xFFFFFF */;
var _local3 = new TextFormat();
_local3.size = 6;
_local3.font = "AndaleMono";
m_tfDebug.setTextFormat(_local3);
}
static function trace(msg) {
s_instance.m_tfDebug.text = s_instance.m_tfDebug.text + (msg + newline);
}
static function clear() {
s_instance.m_tfDebug.text = "";
}
}
Symbol 1527 MovieClip [__Packages.Timer] Frame 0
class Timer
{
var m_time, m_mcAsset;
function Timer () {
m_time = 0;
m_mcAsset = {_name:"timer"};
}
function step() {
m_time++;
}
function draw() {
}
function setTime(miliseconds) {
m_time = Math.round((FPS * miliseconds) / 1000);
}
function getTime() {
var _local2 = Math.round((1000 * m_time) / FPS);
return(_local2);
}
function getTimeInSeconds() {
var _local2 = Math.ceil(m_time / FPS);
return(_local2);
}
function getFormattedTime() {
var _local4 = Math.ceil(m_time / FPS);
var _local3 = Math.floor(_local4 / 60);
var _local2 = _local4 % 60;
var _local6 = ((_local3 < 10) ? ("0" + _local3) : ("" + _local3));
var _local5 = ((_local2 < 10) ? ("0" + _local2) : ("" + _local2));
return((_local6 + ":") + _local5);
}
static var FPS = 31;
}
Symbol 1528 MovieClip [__Packages.EnemyZombie] Frame 0
class EnemyZombie extends Enemy
{
var m_health, m_healthMax, m_damage, m_points, m_sType, m_mcAsset, m_mode, damageStep, smashStep, dieStep, m_hero, m_yPos, m_xPos, m_dir, m_time, checkHeroCollision, m_xVel, broadcastMessage, m_yVel, m_borderLeft, m_borderRight, m_borderTop, m_borderBottom;
function EnemyZombie (mcAsset, x, y, dir, health, damage, points, bShaved, sType) {
super(mcAsset, x, y, dir, bShaved);
m_health = health;
m_healthMax = health;
m_damage = damage;
m_points = points;
m_sType = sType;
m_mcAsset.mcAnim.gotoAndPlay(1 + Math.floor(Math.random() * m_mcAsset.mcAnim._totalframes));
setMode();
}
function step() {
super.step();
if (m_mode == Enemy.MODE_DAMAGED) {
damageStep();
} else {
if (m_mode == Enemy.MODE_STAND) {
return(undefined);
}
if (m_mode == Enemy.MODE_SMASHED) {
smashStep();
} else if (m_mode == Enemy.MODE_DIE) {
dieStep();
} else if (m_mode == Enemy.MODE_FOLLOW) {
var _local3 = m_hero.getXPos();
var _local5 = m_hero.getYPos();
var _local7 = false;
var _local6 = false;
if (Math.abs(_local5 - m_yPos) > 3) {
m_yPos = m_yPos + ((_local5 < m_yPos) ? (-VEL_Y) : (VEL_Y));
} else {
_local6 = true;
}
if (Math.abs(_local3 - m_xPos) > 40) {
m_dir = ((_local3 < m_xPos) ? -1 : 1);
m_xPos = m_xPos + (m_dir * VEL_X);
} else {
_local7 = true;
}
if ((_local7 && (_local6)) && (((m_dir > 0) && (_local3 > m_xPos)) || ((m_dir < 0) && (_local3 < m_xPos)))) {
m_mode = Enemy.MODE_ATTACK;
m_time = 30;
}
} else if (m_mode == Enemy.MODE_ATTACK) {
checkHeroCollision();
} else {
if (m_mode == Enemy.MODE_SHAVED) {
m_xPos = m_xPos + m_xVel;
var _local4 = {x:0, y:0};
m_mcAsset.localToGlobal(_local4);
if ((_local4.x < -50) || (_local4.x > (Scene.SCENE_WIDTH + 50))) {
broadcastMessage("onEnemyDeath", {obj:this, points:m_points});
broadcastMessage("onRemoveActiveObj", {obj:this});
}
return(undefined);
}
m_xPos = m_xPos + m_xVel;
m_yPos = m_yPos + m_yVel;
}
}
if (m_xPos < m_borderLeft) {
m_xPos = m_borderLeft;
m_xVel = Math.abs(m_xVel);
m_dir = 1;
} else if (m_xPos > m_borderRight) {
m_xPos = m_borderRight;
m_xVel = -Math.abs(m_xVel);
m_dir = -1;
}
if (m_yPos < m_borderTop) {
m_yPos = m_borderTop;
m_yVel = -m_yVel;
} else if (m_yPos > m_borderBottom) {
m_yPos = m_borderBottom;
m_yVel = -m_yVel;
}
m_time--;
if (m_time == 0) {
setMode();
}
}
function setMode() {
if (m_mode == Enemy.MODE_DAMAGED) {
broadcastMessage("onEnemySwitchToNormal", {obj:this});
}
var _local3 = 100 * Math.random();
if (_local3 < 50) {
m_mode = Enemy.MODE_FOLLOW;
m_time = 300;
} else {
m_mode = Enemy.MODE_MOVE;
m_time = 50 + Math.floor(100 * Math.random());
var _local4 = new Array([0, -1], [1, -1], [1, 0], [1, 1], [0, 1], [-1, 1], [-1, 0], [-1, -1]);
var _local2 = _local4[Math.floor(8 * Math.random())];
m_dir = ((_local2[0] == 0) ? (m_dir) : (_local2[0]));
m_xVel = _local2[0] * VEL_X;
m_yVel = _local2[1] * VEL_Y;
}
}
static var HEALTH_WEAK = 15;
static var HEALTH_MEDIUM = 40;
static var HEALTH_STRONG = 60;
static var VEL_X = 1;
static var VEL_Y = 1;
}
Symbol 1529 MovieClip [__Packages.EnemyRun] Frame 0
class EnemyRun extends Enemy
{
var m_health, m_healthMax, m_damage, m_points, m_sType, m_mcAsset, m_soundTimer, m_mode, damageStep, smashStep, dieStep, m_xPos, m_xVel, broadcastMessage, m_yPos, m_yVel, checkHeroCollision, m_borderBottom, m_borderTop, m_dir, m_time, m_hero;
function EnemyRun (mcAsset, x, y, dir, health, damage, points, bShaved, sType) {
super(mcAsset, x, y, dir, bShaved);
m_health = health;
m_healthMax = health;
m_damage = damage;
m_points = points;
m_sType = sType;
m_mcAsset.mcAnim.gotoAndPlay(1 + Math.floor(Math.random() * m_mcAsset.mcAnim._totalframes));
setNewVelocities();
m_soundTimer = getTimer() + (500 * Math.random());
}
function step() {
super.step();
if (m_mode == Enemy.MODE_DAMAGED) {
damageStep();
} else {
if (m_mode == Enemy.MODE_STAND) {
return(undefined);
}
if (m_mode == Enemy.MODE_SMASHED) {
smashStep();
} else if (m_mode == Enemy.MODE_DIE) {
dieStep();
} else {
if (m_mode == Enemy.MODE_SHAVED) {
m_xPos = m_xPos + m_xVel;
var _local3 = {x:0, y:0};
m_mcAsset.localToGlobal(_local3);
if ((_local3.x < -50) || (_local3.x > (Scene.SCENE_WIDTH + 50))) {
broadcastMessage("onEnemyDeath", {obj:this, points:m_points});
broadcastMessage("onRemoveActiveObj", {obj:this});
}
return(undefined);
}
m_xPos = m_xPos + m_xVel;
m_yPos = m_yPos + m_yVel;
checkHeroCollision();
}
}
if (m_yPos > m_borderBottom) {
m_yVel = -m_yVel;
} else if (m_yPos < m_borderTop) {
m_yVel = -m_yVel;
}
var _local3 = {x:0, y:0};
m_mcAsset.localToGlobal(_local3);
if ((m_xVel < 0) && (_local3.x < -200)) {
m_dir = 1;
setNewVelocities();
} else if ((m_xVel > 0) && (_local3.x > (Scene.SCENE_WIDTH + 200))) {
m_dir = -1;
setNewVelocities();
}
m_time--;
if (m_time == 0) {
setMode();
}
if ((m_sType == Enemy.TYPE_BLACK) && ((getTimer() - m_soundTimer) > 2000)) {
m_soundTimer = getTimer();
Sounds.playSound(SoundData.SFX_GROWL);
} else if ((m_sType == Enemy.TYPE_JACKASS) && ((getTimer() - m_soundTimer) > 1500)) {
m_soundTimer = getTimer();
Sounds.playSound(SoundData.SFX_TROLLEY_SQUEAK);
}
}
function setNewVelocities() {
var _local4 = m_borderBottom - m_borderTop;
m_yPos = m_borderTop + Math.floor(_local4 * Math.random());
m_xVel = m_dir * (MIN_VEL_X + ((MAX_VEL_X - MIN_VEL_X) * Math.random()));
var _local5 = m_hero.getXPos();
var _local3 = m_hero.getYPos();
var _local2 = Math.abs((m_xPos - _local5) / m_xVel);
m_yVel = (_local3 - m_yPos) / _local2;
}
function setMode() {
if (m_mode == Enemy.MODE_DAMAGED) {
broadcastMessage("onEnemySwitchToNormal", {obj:this});
}
m_mode = Enemy.MODE_MOVE;
m_time = 2;
}
static var HEALTH_WEAK = 20;
static var HEALTH_MEDIUM = 40;
static var HEALTH_STRONG = 60;
static var MIN_VEL_X = 5;
static var MAX_VEL_X = 9;
static var MAX_VEL_Y = 1;
}
Symbol 1530 MovieClip [__Packages.EnemyBoss0] Frame 0
class EnemyBoss0 extends Enemy
{
var m_health, m_healthMax, m_time, m_points, m_mode, damageStep, smashStep, dieStep, m_xPos, m_xVel, m_yPos, m_yVel, m_hero, m_dir, m_borderBottom, m_borderTop, m_mcAsset, m_mcEnergy, broadcastMessage;
function EnemyBoss0 (mcAsset, x, y, dir, points) {
super(mcAsset, x, y, dir);
m_health = HEALTH;
m_healthMax = HEALTH;
m_time = 0;
m_points = points;
setNewVelocities();
setNewMode();
}
function step() {
if (m_mode == Enemy.MODE_DAMAGED) {
damageStep();
} else if (m_mode == Enemy.MODE_SMASHED) {
smashStep();
} else if (m_mode == Enemy.MODE_DIE) {
dieStep();
} else if (m_mode == Enemy.MODE_STAND) {
m_time--;
} else if (m_mode == Enemy.MODE_MOVE) {
m_xPos = m_xPos + m_xVel;
m_yPos = m_yPos + m_yVel;
checkHeroCollision();
} else if (m_mode == Enemy.MODE_FOLLOW) {
var _local8 = m_hero.getXPos();
var _local5 = m_hero.getYPos();
var _local7 = false;
var _local6 = false;
var _local2 = _local8 - m_xPos;
if ((((_local2 > 0) && (_local2 < 200)) && (m_dir > 0)) || (((_local2 < 0) && (_local2 > -200)) && (m_dir < 0))) {
_local7 = true;
} else {
m_dir = ((_local2 < 0) ? -1 : 1);
m_xPos = m_xPos + (m_dir * MAX_VEL_X);
}
var _local4 = _local5 - m_yPos;
if ((_local4 > -80) && (_local4 < 80)) {
_local6 = true;
} else {
m_yPos = m_yPos + ((_local5 < m_yPos) ? (-MAX_VEL_Y) : MAX_VEL_Y);
}
if (_local7 && (_local6)) {
setMode(Enemy.MODE_ATTACK);
} else if (m_time <= 0) {
setMode(Enemy.MODE_ATTACK);
}
checkHeroCollision();
} else if (m_mode == Enemy.MODE_ATTACK) {
if ((m_time < 48) && (m_time > 12)) {
m_xPos = m_xPos + m_xVel;
m_yPos = m_yPos + m_yVel;
}
if ((m_time < 40) && (m_time > 12)) {
checkHeroCollision();
}
if (m_time == 22) {
Scene.getInstance().shake();
}
}
if (m_yPos > m_borderBottom) {
m_yPos = m_borderBottom;
m_yVel = -Math.abs(m_yVel);
} else if (m_yPos < m_borderTop) {
m_yPos = m_borderTop;
m_yVel = Math.abs(m_yVel);
}
var _local3 = {x:0, y:0};
m_mcAsset.localToGlobal(_local3);
if ((m_xVel < 0) && (_local3.x < -100)) {
m_dir = 1;
setNewVelocities();
} else if ((m_xVel > 0) && (_local3.x > (Scene.SCENE_WIDTH + 100))) {
m_dir = -1;
setNewVelocities();
}
m_time--;
if (m_time <= 0) {
setNewMode();
}
}
function draw() {
super.draw();
m_mcEnergy._xscale = (100 * m_mcAsset._xscale) / 100;
}
function setNewMode() {
if (m_mode == Enemy.MODE_ATTACK) {
m_mode = Enemy.MODE_FOLLOW;
}
var _local2 = new Array(Enemy.MODE_MOVE, Enemy.MODE_FOLLOW);
var _local3;
do {
_local3 = Math.floor(_local2.length * Math.random());
} while (_local2[_local3] == m_mode);
setMode(_local2[_local3]);
}
function setNewVelocities() {
var _local2 = m_hero.getXPos();
var _local4 = m_hero.getYPos();
if (m_mode == Enemy.MODE_ATTACK) {
m_xVel = m_dir * (Math.abs(_local2 - m_xPos) / 30);
} else if (m_mode == Enemy.MODE_MOVE) {
m_xVel = m_dir * MAX_VEL_X;
}
var _local3 = Math.abs((m_xPos - _local2) / m_xVel);
m_yVel = (_local4 - m_yPos) / _local3;
if (m_yVel > MAX_VEL_Y) {
m_yVel = MAX_VEL_Y;
} else if (m_yVel < (-MAX_VEL_Y)) {
m_yVel = -MAX_VEL_Y;
}
}
function setMode(mode) {
m_mode = mode;
switch (m_mode) {
case Enemy.MODE_STAND :
m_time = STAND_TIME;
break;
case Enemy.MODE_FOLLOW :
m_time = FOLLOW_TIME;
break;
case Enemy.MODE_MOVE :
m_time = MOVE_TIME;
setNewVelocities();
break;
case Enemy.MODE_ATTACK :
setNewVelocities();
m_time = ATTACK_TIME;
}
}
function checkHeroCollision() {
var _local2 = m_hero.getYPos();
if (((Math.abs(m_yPos - _local2) < 10) && (!m_hero.isProtected())) && (m_mcAsset.mcAttackArea.hitTest(m_hero.m_mcAsset.mcHitArea))) {
if (m_mode == Enemy.MODE_ATTACK) {
broadcastMessage("onHitHero", {dir:m_dir, damage:DAMAGE_JUMP});
} else {
broadcastMessage("onHitHero", {dir:m_dir, damage:DAMAGE_RUN});
}
}
}
function isProtected() {
if (((m_mode == Enemy.MODE_SMASHED) || (m_mode == Enemy.MODE_DIE)) || (m_mode == Enemy.MODE_ATTACK)) {
return(true);
}
return(false);
}
static var HEALTH = 120;
static var MIN_VEL_X = 7;
static var MAX_VEL_X = 9;
static var MAX_VEL_Y = 2;
static var ATTACK_TIME = 60;
static var FOLLOW_TIME = 150;
static var STAND_TIME = 30;
static var MOVE_TIME = 90;
static var DAMAGE_RUN = 5;
static var DAMAGE_JUMP = 8;
}
Symbol 1531 MovieClip [__Packages.EnemyBoss1] Frame 0
class EnemyBoss1 extends Enemy
{
var m_health, m_healthMax, m_time, m_points, m_mode, damageStep, smashStep, dieStep, m_xPos, m_xVel, m_yPos, m_yVel, m_mcAsset, m_hero, m_dir, m_borderBottom, m_borderTop, m_timeBeforeDamage, m_mcEnergy, m_modePrev, broadcastMessage;
function EnemyBoss1 (mcAsset, x, y, dir, points) {
super(mcAsset, x, y, dir);
m_health = HEALTH;
m_healthMax = HEALTH;
m_time = 0;
m_points = points;
setNewVelocities();
setNewMode();
}
function step() {
if (m_mode == Enemy.MODE_DAMAGED) {
damageStep();
} else if (m_mode == Enemy.MODE_SMASHED) {
smashStep();
} else if (m_mode == Enemy.MODE_DIE) {
dieStep();
} else if (m_mode == Enemy.MODE_MOVE) {
m_xPos = m_xPos + m_xVel;
m_yPos = m_yPos + m_yVel;
checkHeroCollision();
if ((m_mcAsset.mcAnim._currentframe == 2) || (m_mcAsset.mcAnim._currentframe == 15)) {
Scene.getInstance().shake();
}
} else if (m_mode == Enemy.MODE_FOLLOW) {
var _local8 = m_hero.getXPos();
var _local5 = m_hero.getYPos();
var _local7 = false;
var _local6 = false;
var _local2 = _local8 - m_xPos;
if ((((_local2 > 0) && (_local2 < 100)) && (m_dir > 0)) || (((_local2 < 0) && (_local2 > -100)) && (m_dir < 0))) {
_local7 = true;
} else {
m_dir = ((_local2 < 0) ? -1 : 1);
m_xPos = m_xPos + (m_dir * MAX_VEL_X);
}
var _local4 = _local5 - m_yPos;
if ((_local4 > -10) && (_local4 < 10)) {
_local6 = true;
} else {
m_yPos = m_yPos + ((_local5 < m_yPos) ? (-MAX_VEL_Y) : (MAX_VEL_Y));
}
if (_local7 && (_local6)) {
setMode(Enemy.MODE_ATTACK);
} else if (m_time <= 0) {
setNewMode();
}
checkHeroCollision();
if ((m_mcAsset.mcAnim._currentframe == 2) || (m_mcAsset.mcAnim._currentframe == 15)) {
Scene.getInstance().shake();
}
} else if (m_mode == Enemy.MODE_ATTACK) {
if ((m_time <= 119) && (m_time >= 117)) {
checkHeroCollision();
}
}
if (m_yPos > m_borderBottom) {
m_yPos = m_borderBottom;
m_yVel = -Math.abs(m_yVel);
} else if (m_yPos < m_borderTop) {
m_yPos = m_borderTop;
m_yVel = Math.abs(m_yVel);
}
var _local3 = {x:0, y:0};
m_mcAsset.localToGlobal(_local3);
if ((m_xVel < 0) && (_local3.x < -100)) {
m_dir = 1;
setNewVelocities();
} else if ((m_xVel > 0) && (_local3.x > (Scene.SCENE_WIDTH + 100))) {
m_dir = -1;
setNewVelocities();
}
m_timeBeforeDamage--;
m_time--;
if (m_time <= 0) {
setNewMode();
}
}
function draw() {
super.draw();
m_mcEnergy._xscale = (100 * m_mcAsset._xscale) / 100;
}
function setNewMode() {
if (m_mode == Enemy.MODE_ATTACK) {
m_mode = Enemy.MODE_FOLLOW;
} else if ((m_mode == Enemy.MODE_SMASHED) && (m_modePrev == Enemy.MODE_FOLLOW)) {
m_mode = Enemy.MODE_ATTACK;
m_time = m_timeBeforeDamage;
return(undefined);
}
var _local2 = new Array(Enemy.MODE_MOVE, Enemy.MODE_FOLLOW);
var _local3;
do {
_local3 = Math.floor(_local2.length * Math.random());
} while (_local2[_local3] == m_mode);
setMode(_local2[_local3]);
m_modePrev = m_mode;
}
function setNewVelocities() {
if (m_mode == Enemy.MODE_FOLLOW) {
m_xVel = m_dir * MIN_VEL_X;
} else if (m_mode == Enemy.MODE_MOVE) {
m_xVel = m_dir * MAX_VEL_X;
}
var _local4 = m_hero.getXPos();
var _local3 = m_hero.getYPos();
var _local2 = Math.abs((m_xPos - _local4) / m_xVel);
m_yVel = (_local3 - m_yPos) / _local2;
if (m_yVel > MAX_VEL_Y) {
m_yVel = MAX_VEL_Y;
} else if (m_yVel < (-MAX_VEL_Y)) {
m_yVel = -MAX_VEL_Y;
}
}
function setMode(mode) {
m_mode = mode;
switch (m_mode) {
case Enemy.MODE_FOLLOW :
m_time = FOLLOW_TIME;
break;
case Enemy.MODE_MOVE :
m_time = MOVE_TIME;
setNewVelocities();
break;
case Enemy.MODE_ATTACK :
m_time = ATTACK_TIME;
}
}
function checkHeroCollision() {
var _local2 = m_hero.getYPos();
if (((Math.abs(m_yPos - _local2) < 20) && (!m_hero.isProtected())) && (m_mcAsset.mcAttackArea.hitTest(m_hero.m_mcAsset.mcHitArea))) {
if (m_mode == Enemy.MODE_ATTACK) {
broadcastMessage("onHitHero", {dir:m_dir, damage:DAMAGE_KICK});
} else {
broadcastMessage("onHitHero", {dir:m_dir, damage:DAMAGE_WALK});
}
Scene.getInstance().shake();
}
}
function isProtected() {
if ((m_mode == Enemy.MODE_DAMAGED) || ((m_mode == Enemy.MODE_ATTACK) && (m_time < 90))) {
return(false);
}
return(true);
}
function onGetDamage(damage) {
if (m_mode == Enemy.MODE_ATTACK) {
m_timeBeforeDamage = m_time;
}
super.onGetDamage(damage);
}
static var HEALTH = 150;
static var MIN_VEL_X = 7;
static var MAX_VEL_X = 11;
static var MAX_VEL_Y = 3;
static var ATTACK_TIME = 148;
static var FOLLOW_TIME = 150;
static var STAND_TIME = 30;
static var MOVE_TIME = 90;
static var DAMAGE_WALK = 5;
static var DAMAGE_KICK = 10;
}
Symbol 1532 MovieClip [__Packages.EnemyBoss2] Frame 0
class EnemyBoss2 extends Enemy
{
var m_health, m_healthMax, m_time, m_attacks, m_points, m_mode, m_modePrev, damageStep, smashStep, dieStep, m_xPos, m_xVel, m_yPos, m_yVel, m_hero, m_dir, m_borderBottom, m_borderTop, m_mcAsset, m_timeBeforeDamage, m_mcEnergy, broadcastMessage;
function EnemyBoss2 (mcAsset, x, y, dir, points) {
super(mcAsset, x, y, dir);
m_health = HEALTH;
m_healthMax = HEALTH;
m_time = 0;
m_attacks = 0;
m_points = points;
m_mode = Enemy.MODE_STAND;
m_modePrev = Enemy.MODE_STAND;
m_time = STAND_TIME;
}
function step() {
super.step();
if (m_mode == Enemy.MODE_DAMAGED) {
damageStep();
} else if (m_mode == Enemy.MODE_SMASHED) {
smashStep();
} else if (m_mode == Enemy.MODE_DIE) {
dieStep();
} else if (m_mode == Enemy.MODE_MOVE) {
m_xPos = m_xPos + m_xVel;
m_yPos = m_yPos + m_yVel;
checkHeroCollision();
} else if (m_mode == Enemy.MODE_FOLLOW) {
var _local9 = m_hero.getXPos();
var _local6 = m_hero.getYPos();
var _local8 = false;
var _local7 = false;
var _local3 = _local9 - m_xPos;
if ((((_local3 > 0) && (_local3 < 140)) && (m_dir > 0)) || (((_local3 < 0) && (_local3 > -140)) && (m_dir < 0))) {
_local8 = true;
} else {
m_dir = ((_local3 < 0) ? -1 : 1);
m_xPos = m_xPos + (m_dir * MAX_VEL_X);
}
var _local5 = _local6 - m_yPos;
if ((_local5 > -10) && (_local5 < 10)) {
_local7 = true;
} else {
m_yPos = m_yPos + ((_local6 < m_yPos) ? (-MAX_VEL_Y) : (MAX_VEL_Y));
}
if (_local8 && (_local7)) {
setMode(Enemy.MODE_ATTACK);
} else if (m_time <= 0) {
setNewMode();
}
checkHeroCollision();
} else if (m_mode == Enemy.MODE_ATTACK) {
if ((m_time <= 48) && (m_time >= 40)) {
checkHeroCollision();
}
if (m_time == 47) {
Scene.getInstance().shake();
}
if (m_time == END_ATTACK_TIME) {
m_attacks++;
if (m_attacks == 2) {
m_attacks = 0;
m_mode = Enemy.MODE_FOLLOW;
setNewMode();
}
}
}
if (m_yPos > m_borderBottom) {
m_yPos = m_borderBottom;
m_yVel = -Math.abs(m_yVel);
} else if (m_yPos < m_borderTop) {
m_yPos = m_borderTop;
m_yVel = Math.abs(m_yVel);
}
var _local4 = {x:0, y:0};
m_mcAsset.localToGlobal(_local4);
if ((m_xVel < 0) && (_local4.x < -100)) {
m_dir = 1;
setNewVelocities();
} else if ((m_xVel > 0) && (_local4.x > (Scene.SCENE_WIDTH + 100))) {
m_dir = -1;
setNewVelocities();
}
m_timeBeforeDamage--;
m_time--;
if (m_time <= 0) {
setNewMode();
}
}
function draw() {
super.draw();
m_mcEnergy._xscale = (100 * m_mcAsset._xscale) / 100;
}
function setNewMode() {
if (m_mode == Enemy.MODE_ATTACK) {
m_mode = Enemy.MODE_STAND;
m_time = STAND_TIME;
m_modePrev = Enemy.MODE_STAND;
Sounds.playSound(SoundData.SFX_HULK);
return(undefined);
}
if (m_mode == Enemy.MODE_STAND) {
m_mode = Enemy.MODE_TRANSFORM;
m_time = TRANSFORM_TIME;
return(undefined);
}
if (m_mode == Enemy.MODE_TRANSFORM) {
m_mode = Enemy.MODE_FOLLOW;
} else {
if (((m_mode == Enemy.MODE_SMASHED) || (m_mode == Enemy.MODE_DAMAGED)) && (m_modePrev == Enemy.MODE_FOLLOW)) {
m_mode = Enemy.MODE_ATTACK;
m_time = m_timeBeforeDamage;
return(undefined);
}
if (((m_mode == Enemy.MODE_SMASHED) || (m_mode == Enemy.MODE_DAMAGED)) && (m_modePrev == Enemy.MODE_STAND)) {
m_mode = Enemy.MODE_STAND;
m_modePrev = Enemy.MODE_STAND;
m_time = m_timeBeforeDamage;
return(undefined);
}
}
var _local2 = new Array(Enemy.MODE_MOVE, Enemy.MODE_FOLLOW);
var _local3;
do {
_local3 = Math.floor(_local2.length * Math.random());
} while (_local2[_local3] == m_mode);
setMode(_local2[_local3]);
m_modePrev = m_mode;
}
function setNewVelocities() {
if (m_mode == Enemy.MODE_FOLLOW) {
m_xVel = m_dir * MIN_VEL_X;
} else if (m_mode == Enemy.MODE_MOVE) {
m_xVel = m_dir * MAX_VEL_X;
}
var _local4 = m_hero.getXPos();
var _local3 = m_hero.getYPos();
var _local2 = Math.abs((m_xPos - _local4) / m_xVel);
m_yVel = (_local3 - m_yPos) / _local2;
if (m_yVel > MAX_VEL_Y) {
m_yVel = MAX_VEL_Y;
} else if (m_yVel < (-MAX_VEL_Y)) {
m_yVel = -MAX_VEL_Y;
}
}
function setMode(mode) {
m_mode = mode;
switch (m_mode) {
case Enemy.MODE_FOLLOW :
m_time = FOLLOW_TIME;
break;
case Enemy.MODE_MOVE :
m_time = MOVE_TIME;
setNewVelocities();
break;
case Enemy.MODE_ATTACK :
m_time = ATTACK_TIME;
}
}
function checkHeroCollision() {
var _local2 = m_hero.getYPos();
if (((Math.abs(m_yPos - _local2) < 20) && (!m_hero.isProtected())) && (m_mcAsset.mcAttackArea.hitTest(m_hero.m_mcAsset.mcHitArea))) {
if (m_mode == Enemy.MODE_ATTACK) {
broadcastMessage("onHitHero", {dir:m_dir, damage:DAMAGE_PUNCH});
} else {
broadcastMessage("onHitHero", {dir:m_dir, damage:DAMAGE_WALK});
}
}
}
function isProtected() {
if (((m_mode == Enemy.MODE_DAMAGED) || (m_mode == Enemy.MODE_STAND)) || ((m_mode == Enemy.MODE_ATTACK) && (m_time < 30))) {
return(false);
}
return(true);
}
function onGetDamage(damage) {
if ((m_mode == Enemy.MODE_ATTACK) || (m_mode == Enemy.MODE_STAND)) {
m_timeBeforeDamage = m_time;
}
super.onGetDamage(damage);
}
static var HEALTH = 250;
static var MIN_VEL_X = 7;
static var MAX_VEL_X = 11;
static var MAX_VEL_Y = 3;
static var ATTACK_TIME = 75;
static var END_ATTACK_TIME = 35;
static var TRANSFORM_TIME = 75;
static var FOLLOW_TIME = 150;
static var STAND_TIME = 100;
static var MOVE_TIME = 90;
static var DAMAGE_WALK = 10;
static var DAMAGE_PUNCH = 15;
}
Symbol 1533 MovieClip [__Packages.EnemyRobo] Frame 0
class EnemyRobo extends EnemyZombie
{
var m_mode, checkHeroCollision;
function EnemyRobo (mcAsset, x, y, dir, health, damage, points, bShaved, sType) {
super(mcAsset, x, y, dir, health, damage, points, bShaved, sType);
}
function step() {
super.step();
if ((m_mode == Enemy.MODE_MOVE) || (m_mode == Enemy.MODE_FOLLOW)) {
checkHeroCollision();
}
}
static var VEL_X = 2;
}
Symbol 1534 MovieClip [__Packages.EnemyRope] Frame 0
class EnemyRope extends Enemy
{
var m_health, m_healthMax, m_damage, m_points, m_sType, m_mode, m_time, m_zPos, m_mcAsset, damageStep, smashStep, dieStep, checkHeroCollision, m_hero, m_dir, m_xPos, m_yPos, broadcastMessage;
function EnemyRope (mcAsset, x, y, dir, damage, points, sType) {
super(mcAsset, x, y, dir);
m_health = HEALTH;
m_healthMax = HEALTH;
m_damage = damage;
m_points = points;
m_sType = sType;
m_mode = Enemy.MODE_STAND;
m_time = Math.floor(WAIT_TIME * Math.random());
m_zPos = UPPER_Z;
m_mcAsset.mcAnim.gotoAndPlay(1 + Math.floor(Math.random() * m_mcAsset.mcAnim._totalframes));
}
function step() {
super.step();
if (m_mode == Enemy.MODE_DAMAGED) {
damageStep();
} else if (m_mode == Enemy.MODE_SMASHED) {
smashStep();
} else if (m_mode == Enemy.MODE_DIE) {
dieStep();
} else if (m_mode == Enemy.MODE_MOVE) {
m_zPos = m_zPos + 8;
if ((BOTTOM_Z - m_zPos) < 1) {
m_zPos = BOTTOM_Z;
setNextMode();
} else if ((BOTTOM_Z - m_zPos) < 20) {
checkHeroCollision();
}
} else if (m_mode == Enemy.MODE_ATTACK) {
checkHeroCollision();
} else if (m_mode == Enemy.MODE_UP) {
m_zPos = m_zPos + ((UPPER_Z - m_zPos) * 0.1);
if (Math.abs(UPPER_Z - m_zPos) < 2) {
m_zPos = UPPER_Z;
setNextMode();
}
}
if ((m_time == 0) || (m_time < -70)) {
setNextMode();
}
m_time--;
}
function draw() {
super.draw();
m_mcAsset.mcAnim._y = m_zPos;
var _local3 = 100 * (1 - (((-m_zPos) + BOTTOM_Z) / (BOTTOM_Z - UPPER_Z)));
m_mcAsset.mcShadow._xscale = (m_mcAsset.mcShadow._yscale = _local3);
}
function setNextMode() {
switch (m_mode) {
case Enemy.MODE_STAND :
var _local3 = m_hero.getXPos();
var _local2 = m_hero.getYPos();
m_dir = ((Math.random() < 0.5) ? -1 : 1);
m_xPos = _local3 - (m_dir * 40);
m_yPos = _local2 + 1;
m_time = -1;
m_mode = Enemy.MODE_MOVE;
break;
case Enemy.MODE_MOVE :
m_time = ATTACK_TIME;
m_mode = Enemy.MODE_ATTACK;
Sounds.playSound(SoundData.SFX_HANGING_SHEEP);
break;
case Enemy.MODE_DAMAGED :
broadcastMessage("onEnemySwitchToNormal", {obj:this});
case Enemy.MODE_ATTACK :
case Enemy.MODE_SMASHED :
m_time = -1;
m_mode = Enemy.MODE_UP;
break;
case Enemy.MODE_UP :
m_time = Math.floor(WAIT_TIME * Math.random());
m_mode = Enemy.MODE_STAND;
}
}
function isProtected() {
if (((((m_mode == Enemy.MODE_STAND) || (m_mode == Enemy.MODE_MOVE)) || (m_mode == Enemy.MODE_SMASHED)) || (m_mode == Enemy.MODE_DIE)) || (m_mode == Enemy.MODE_UP)) {
return(true);
}
return(false);
}
static var HEALTH = 25;
static var WAIT_TIME = 90;
static var ATTACK_TIME = 60;
static var UPPER_Z = -450;
static var BOTTOM_Z = -40;
}
Symbol 1535 MovieClip [__Packages.Shot] Frame 0
class Shot
{
var m_mcAsset, m_xPos, m_yPos, m_vel, m_aEnemies, m_bSplashed, m_hero;
function Shot (mcAsset, x, y, dir, aEnemies) {
AsBroadcaster.initialize(this);
m_mcAsset = mcAsset;
m_xPos = x;
m_yPos = y;
m_vel = dir * VEL;
m_mcAsset._xscale = dir * 100;
m_aEnemies = aEnemies;
m_bSplashed = false;
m_hero = Hero.getInstance();
}
function remove() {
m_mcAsset.removeMovieClip();
}
function addListener(scope) {
}
function removeListener(listener) {
}
function broadcastMessage(msg, eventObject) {
}
function step() {
if (!m_bSplashed) {
m_xPos = m_xPos + m_vel;
var _local8 = {x:0, y:0};
m_mcAsset.localToGlobal(_local8);
if ((_local8.x < -100) || (_local8.x > (Scene.SCENE_WIDTH + 100))) {
broadcastMessage("onRemoveActiveObj", {obj:this});
return(undefined);
}
var _local2 = 0;
while (_local2 < m_aEnemies.length) {
var _local3 = Math.abs(m_yPos - m_aEnemies[_local2].getPosY());
if (((!m_aEnemies[_local2].isProtected()) && (m_mcAsset.hitTest(m_aEnemies[_local2].m_mcAsset))) && (_local3 < 10)) {
broadcastMessage("onHitEnemy", {enemy:m_aEnemies[_local2], damage:DAMAGE});
broadcastMessage("onFinalHit", {power:2});
m_bSplashed = true;
m_mcAsset.gotoAndStop("splash");
m_mcAsset.mcSplash.animEnd = EventDelegate.create(this, broadcastMessage, "onRemoveActiveObj", {obj:this});
Sounds.playSound(SoundData.SFX_MINT_SAUCE);
}
_local2++;
}
}
}
function draw() {
m_mcAsset._x = m_xPos;
m_mcAsset._y = m_yPos;
}
static var VEL = 20;
static var DAMAGE = 10;
}
Symbol 1536 MovieClip [__Packages.XMLParser] Frame 0
class XMLParser
{
var m_oScope, m_onLoadFunction, m_type, m_xmlData, m_oData;
function XMLParser (type, oScope, onLoadFunction) {
m_oScope = oScope;
m_onLoadFunction = onLoadFunction;
m_type = type;
m_xmlData = new XML();
m_xmlData.ignoreWhite = true;
}
function loadData(sUrl) {
m_xmlData.onLoad = EventDelegate.create(this, onLoadData);
m_xmlData.load(sUrl);
}
function onLoadData(bSuccess) {
parseData();
}
function assignData(sData) {
m_xmlData.parseXML(sData);
return(parseData());
}
function parseData(Void) {
m_oData = new Object();
var _local2 = m_xmlData.firstChild;
switch (m_type) {
case TYPE_LEVEL :
traverseLevel(_local2, null);
var _local3 = new Array();
_local3.push(m_oData);
m_onLoadFunction.apply(m_oScope, _local3);
break;
case TYPE_LINKS :
m_oData.links = new Array();
traverseLinks(_local2);
m_onLoadFunction.apply(m_oScope, m_oData.links);
}
return(m_oData);
}
function traverseLevel(node, parent) {
var _local4 = null;
switch (node.nodeName) {
case "level" :
m_oData.nr = Number(node.attributes.nr);
break;
case "layers" :
m_oData.layers = {front:new Array(), middle:new Array(), decors:new Array()};
break;
case "front" :
_local4 = m_oData.layers.front;
break;
case "middle" :
_local4 = m_oData.layers.middle;
break;
case "decors" :
_local4 = m_oData.layers.decors;
break;
case "asset" :
parent.push(node.attributes.name);
break;
case "decor" :
parent.push({name:node.attributes.name, x:parseInt(node.attributes.x), scale:parseInt(node.attributes.scale)});
break;
case "enemies" :
_local4 = parent;
break;
case "enemy" :
var _local5 = new Object();
_local5.x = Number(node.attributes.x);
_local5.y = Number(node.attributes.y);
_local5.dir = Number(node.attributes.dir);
_local5.name = node.attributes.name;
parent.enemies.push(_local5);
break;
case "fightingArea" :
m_oData.areas = new Array();
_local4 = m_oData.areas;
break;
case "area" :
parent.push({left:Number(node.attributes.left), right:Number(node.attributes.right), type:node.attributes.type, enemies:new Array(), items:new Array()});
_local4 = parent[parent.length - 1];
break;
case "items" :
_local4 = parent;
break;
case "item" :
_local5 = new Object();
_local5.x = Number(node.attributes.x);
_local5.y = Number(node.attributes.y);
_local5.name = node.attributes.name;
parent.items.push(_local5);
}
if (node.firstChild != null) {
traverseLevel(node.firstChild, _local4);
}
if (node.nextSibling != null) {
traverseLevel(node.nextSibling, parent);
}
}
function traverseError(node, parent) {
var _local3 = null;
if (!(node.nodeName === "Error")) {
} else {
m_oData.nr = Number(node.attributes.nr);
m_oData.description = node.attributes.description;
}
if (node.firstChild != null) {
traverseError(node.firstChild, _local3);
}
if (node.nextSibling != null) {
traverseError(node.nextSibling, parent);
}
}
function traverseLinks(node) {
if (!(node.nodeName === "link")) {
} else {
var _local3 = new Object();
_local3.id = node.attributes.id;
_local3.kv = node.attributes.kv;
_local3.url = node.attributes.url;
m_oData.links.push(_local3);
}
if (node.firstChild != null) {
traverseLinks(node.firstChild);
}
if (node.nextSibling != null) {
traverseLinks(node.nextSibling);
}
}
static var TYPE_LEVEL = 0;
static var TYPE_LINKS = 1;
}
Symbol 16 MovieClip Frame 1
setText();
stop();
Symbol 22 MovieClip Frame 1
stop();
Symbol 22 MovieClip Frame 19
stop();
setText();
Symbol 22 MovieClip Frame 39
setText();
Symbol 22 MovieClip Frame 119
setText();
Symbol 133 MovieClip Frame 1
mcShaver._visible = false;
Symbol 246 MovieClip Frame 1
stop();
Symbol 292 MovieClip Frame 1
stop();
Symbol 375 MovieClip [hero] Frame 1
stop();
Symbol 397 MovieClip Frame 16
animEnd();
Symbol 398 MovieClip [shot] Frame 1
stop();
Symbol 405 MovieClip Frame 11
removeMovieClip(_parent);
Symbol 409 MovieClip Frame 6
removeMovieClip(_parent);
Symbol 415 MovieClip Frame 10
removeMovieClip(_parent);
Symbol 494 MovieClip [boss0] Frame 1
stop();
Symbol 573 MovieClip [zombie] Frame 1
stop();
Symbol 635 MovieClip Frame 148
stop();
Symbol 881 MovieClip Frame 75
stop();
Symbol 962 MovieClip [thriller] Frame 1
stop();
Symbol 1089 MovieClip Frame 1
stop();
Symbol 1092 MovieClip Frame 1
stop();
Symbol 1098 MovieClip Frame 1
stop();
Symbol 1102 MovieClip Frame 1
stop();
Symbol 1110 MovieClip Frame 1
stop();
Symbol 1138 MovieClip Frame 1
stop();
Symbol 1148 MovieClip Frame 1
stop();
Symbol 1153 MovieClip Frame 1
stop();
Symbol 1159 MovieClip Frame 1
stop();
transitionDone();
Symbol 1159 MovieClip Frame 19
stop();
transitionDone();
Symbol 1219 MovieClip Frame 1
stop();
Symbol 1225 MovieClip Frame 1
stop();
Symbol 1312 MovieClip Frame 250
stop();
animationDone();
Symbol 1321 MovieClip Frame 288
setText();
Symbol 1321 MovieClip Frame 291
setText();
Symbol 1321 MovieClip Frame 309
setText();
Symbol 1321 MovieClip Frame 315
stop();
activateButtons();
Symbol 1321 MovieClip Frame 348
_parent.play();
Symbol 1329 MovieClip Frame 1
stop();
Symbol 1344 MovieClip Frame 1
stop();
Symbol 1346 MovieClip Frame 1
stop();
Symbol 1346 MovieClip Frame 20
stop();
Symbol 1355 MovieClip Frame 1
stop();
Symbol 1355 MovieClip Frame 2
stop();
Symbol 1355 MovieClip Frame 3
stop();
Symbol 1356 MovieClip Frame 1
stop();
Instance of Symbol 1355 MovieClip in Symbol 1356 MovieClip Frame 22
onClipEvent (load) {
gotoAndStop(_global.currentLevel + 1);
}
Symbol 1356 MovieClip Frame 60
popupOutEnd();
Symbol 1368 MovieClip Frame 80
animEnd();
Symbol 1379 MovieClip Frame 85
animEnd();
Symbol 1383 MovieClip Frame 85
animEnd();
Symbol 1384 MovieClip Frame 1
stop();
Symbol 1387 MovieClip Frame 12
stop();
fadeOutEnd();
Symbol 1387 MovieClip Frame 27
stop();
fadeInEnd();
Symbol 1393 MovieClip Frame 1
stop();
Symbol 1453 Button
on (release) {
getURL ("http://www.sony.co.uk", "_blank");
_root.kvClick(299);
}
Symbol 1456 MovieClip Frame 1
stop();
Symbol 1460 MovieClip Frame 1
stop();
Symbol 1463 MovieClip Frame 1
stop();
Symbol 1473 MovieClip Frame 1
stop();
Symbol 1487 MovieClip Frame 1
function onRelease() {
play();
_value = !_value;
}
stop();
Symbol 1487 MovieClip Frame 2
stop();
Symbol 1494 MovieClip Frame 1
stop();
Symbol 1495 MovieClip Frame 1
function onhttpstatus(httpStatus) {
var _local1;
if (httpStatus < 100) {
_local1 = "flashError";
} else if (httpStatus < 200) {
_local1 = "informational";
} else if (httpStatus < 300) {
_local1 = "successful";
} else if (httpStatus < 400) {
_local1 = "redirection";
} else if (httpStatus < 500) {
_local1 = "clientError";
} else if (httpStatus < 600) {
_local1 = "serverError";
}
trace((("HTTP stauts code: " + httpStatus) + ", type: ") + _local1);
}
function onload(success) {
if (success) {
if (this.status == "saved") {
trace("game saved");
_parent.gotoAndStop("off");
} else {
feedback_txt.text = this.feedback;
}
} else {
trace("save game failed");
feedback_txt.text = "unable to save game - please check your internet connection";
}
}
save_btn.onRelease = function () {
var _local2 = new LoadVars();
var _local3 = new LoadVars();
_local2.score = (isNaN(_global.submitScore) ? 0 : (_global.submitScore));
_local2.level = (isNaN(_global.submitLevel) ? 1 : (_global.submitLevel));
trace(_global.submitScore);
trace(_global.submitLevel);
_local2.email = email_txt.text;
_local2.username = username_txt.text;
_local2.optIn1st = (optIn1st_mc._value ? true : false);
_local2.optInKV = (optInKV_mc._value ? true : false);
_local3.onLoad = onload;
_local3.onHTTPStatus = onhttpstatus;
_local2.sendAndLoad("http://highscores.killerviral.com/sheepsofrage/save.php?var=" + Math.random(), _local3);
};
Symbol 1496 MovieClip Frame 1
stop();
Symbol 1496 MovieClip Frame 11
btnBlockade.useHandCursor = false;
btnBlockadeSmall.useHandCursor = false;
Symbol 1497 Button
on (release) {
getURL ("http://www.sony.co.uk/view/ShowProductCategory.action?site=odw_en_GB&category=Audio", "_blank");
_root.kvClick(264);
}
Symbol 1500 MovieClip Frame 1
stop();
Symbol 1503 MovieClip Frame 1
stop();
Symbol 1504 MovieClip Frame 1
stop();
Symbol 1506 MovieClip Frame 106
setContent();
Symbol 1506 MovieClip Frame 115
setContent();
stop();
panelEnd();
Symbol 1506 MovieClip Frame 147
panelOut();