Frame 1
function CleanName(nm) {
nm = com.gamebrew.Common.StringReplace(nm, " ", "_");
nm = com.gamebrew.Common.StringReplace(nm, "-", "_");
nm = com.gamebrew.Common.StringReplace(nm, "__", "_");
if (com.gamebrew.Common.StringStartsWith(nm, "_") && (nm.length > 1)) {
nm = nm.substr(1);
}
if (com.gamebrew.Common.StringEndsWith(nm, "_") && (nm.length > 1)) {
nm = nm.substr(0, nm.length - 1);
}
var _local3 = "";
var _local4 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_";
var _local1 = 0;
while (_local1 < nm.length) {
if (com.gamebrew.Common.StringContains(_local4, nm.charAt(_local1))) {
_local3 = _local3 + nm.charAt(_local1);
}
_local1++;
}
if (_local3.length == 0) {
_local3 = "IBPro Arcade";
}
return(com.gamebrew.Common.StringUpperCaseFirst(_local3));
}
function AttachFooter(game_title, game_version, url, email_url, d) {
if (_root.mc_footer != null) {
return(undefined);
}
_root.attachMovie("mc_footer", "mc_footer", com.gamebrew.Common.MovieGetNextDepthAt(_root, d));
_root.mc_footer._x = 0;
_root.mc_footer._y = Stage.height - 16;
_root.mc_footer.msg = ((((game_title + " v") + game_version) + " (c) ") + new Date().getFullYear()) + " <FONT COLOR='#FFFF00'>gamebrew.com</FONT> - created by t.suriyathep";
_root.mc_footer.url = url;
_root.mc_footer.email_url = email_url;
}
function MovieRemoveAllExceptFooter() {
com.gamebrew.Common.MovieRemoveAllExcept(_root, new Array("mc_fader", "mc_footer"));
}
function ShowTooltip(txt, mcp, px, py) {
if ((txt == "") || (txt == null)) {
return(undefined);
}
if (_root.mc_tooltip != undefined) {
_root.mc_tooltip.removeMovieClip();
}
var _local2 = {x:0, y:0};
mcp.localToGlobal(_local2);
mc = _root.attachMovie("mc_tooltip", "mc_tooltip", _root.getNextHighestDepth());
mc._x = (_root._xmouse + 2) + px;
mc._y = (_root._ymouse - 16) + py;
mc.new_text = txt;
mc.frames = 0;
mc.owner = mcp;
return(mc);
}
function ClearTooltip(mcp) {
if (mcp == null) {
_root.mc_tooltip.removeMovieClip();
return(undefined);
}
if (_root.mc_tooltip != undefined) {
if (_root.mc_tooltip.owner == mcp) {
_root.mc_tooltip.removeMovieClip();
}
}
}
function ButtonOver() {
this.is_over = true;
}
function ButtonOut() {
this.is_over = false;
}
function ButtonPress() {
this.is_pressed = true;
}
function ButtonRelease() {
this.is_pressed = false;
}
function ButtonReleaseOutside() {
this.is_pressed = false;
this.is_over = false;
}
function ButtonDisable(mc) {
delete mc.onRollOver;
delete mc.onRollOut;
delete mc.onPress;
delete mc.onRelease;
delete mc.onReleaseOutside;
delete mc.onEnterFrame;
mc.is_over = false;
mc.is_pressed = false;
}
function ButtonRollOver(mc, tooltip) {
var _local6 = mc.transform.colorTransform.redOffset;
if (_local6 == 64) {
return(undefined);
}
if ((tooltip != null) || (tooltip != undefined)) {
mc.txt_tooltip = tooltip;
_root.ShowTooltip(mc.txt_tooltip, mc, 0, 0);
}
mc.onEnterFrame = function () {
var _local2 = this.transform.colorTransform.redOffset;
if (_local2 < 64) {
_local2 = _local2 + 32;
if (_local2 >= 64) {
_local2 = 64;
delete this.onEnterFrame;
}
this.transform.colorTransform = new flash.geom.ColorTransform(1, 1, 1, 1, _local2, _local2, _local2, 0);
}
};
}
function ButtonRollOut(mc) {
_root.ClearTooltip(mc);
var _local5 = mc.transform.colorTransform.redOffset;
if (_local5 == 0) {
return(undefined);
}
mc.onEnterFrame = function () {
var _local2 = this.transform.colorTransform.redOffset;
if (_local2 > 0) {
_local2 = _local2 - 16;
if (_local2 <= 0) {
_local2 = 0;
delete this.onEnterFrame;
}
this.transform.colorTransform = new flash.geom.ColorTransform(1, 1, 1, 1, _local2, _local2, _local2, 0);
}
};
}
function EnterFrameRoll(mc, txt) {
if (mc.is_over == true) {
var _local2 = mc.transform.colorTransform.redOffset;
if (_local2 < 64) {
_local2 = _local2 + 32;
if (_local2 >= 64) {
_local2 = 64;
_root.ShowTooltip(txt, mc, 0, 0);
}
mc.transform.colorTransform = new flash.geom.ColorTransform(1, 1, 1, 1, _local2, _local2, _local2, 0);
}
} else {
var _local2 = mc.transform.colorTransform.redOffset;
if (_local2 > 0) {
_local2 = _local2 - 16;
if (_local2 <= 0) {
_local2 = 0;
_root.ClearTooltip(mc);
}
mc.transform.colorTransform = new flash.geom.ColorTransform(1, 1, 1, 1, _local2, _local2, _local2, 0);
}
}
}
function FadeOutIn(colin, colout, callfunc) {
var _local5 = com.gamebrew.Common.MovieGetNextDepthAt(_root, 40000);
var _local3 = _root.createEmptyMovieClip("mc_fader", _local5);
_local3.callfunc = callfunc;
_local3.colout = colout;
_local3._x = 0;
_local3._y = 0;
_local3.clear();
_local3.beginFill(colin);
_local3.moveTo(0, 0);
_local3.lineTo(_root.GB_GAME_WIDTH, 0);
_local3.lineTo(_root.GB_GAME_WIDTH, _root.GB_GAME_HEIGHT);
_local3.lineTo(0, _root.GB_GAME_HEIGHT);
_local3.lineTo(0, 0);
_local3.endFill();
_local3._alpha = 0;
delete _root.onMouseUp;
delete _root.onMouseDown;
delete _root.onMouseMove;
_local3.onEnterFrame = function () {
var _local3 = this._alpha + 20;
if (_local3 > 100) {
com.gamebrew.Common.MovieRemoveAllExcept(_root, new Array("mc_fader", "mc_footer"));
this.callfunc();
this._alpha = 100;
delete this.onEnterFrame;
this.clear();
this.beginFill(this.colout);
this.moveTo(0, 0);
this.lineTo(_root.GB_GAME_WIDTH, 0);
this.lineTo(_root.GB_GAME_WIDTH, _root.GB_GAME_HEIGHT);
this.lineTo(0, _root.GB_GAME_HEIGHT);
this.lineTo(0, 0);
this.endFill();
this.onEnterFrame = function () {
var _local2 = this._alpha - 20;
if (_local2 < 0) {
this._alpha = 0;
delete this.onEnterFrame;
this.removeMovieClip();
} else {
this._alpha = _local2;
}
};
} else {
this._alpha = _local3;
}
};
}
function OpenWindow(win) {
if (_root.mc_win_fader == null) {
mc = _root.attachMovie("mc_fader", "mc_win_fader", com.gamebrew.Common.MovieGetNextDepthAt(_root, GB_POPUP_DEPTH));
mc._x = 0;
mc._y = 0;
mc._alpha = 50;
}
_root.mc_win.removeMovieClip();
mc = _root.attachMovie(win, "mc_win", com.gamebrew.Common.MovieGetNextDepthAt(_root, GB_POPUP_DEPTH));
mc._x = (GB_GAME_WIDTH / 2) - (mc._width / 2);
mc._y = (GB_GAME_HEIGHT / 2) - (mc._height / 2);
return(mc);
}
function CloseWindow() {
_root.mc_win_fader.removeMovieClip();
_root.mc_win.removeMovieClip();
}
function ErrorLog(str) {
_root.txt_error.text = _root.txt_error.text + (str + newline);
}
function GotoMenu() {
MovieRemoveAllExceptFooter();
gotoAndPlay (80);
return(undefined);
}
function GotoAfterInit() {
if (GB_DEBUG == false) {
gotoAndPlay (35);
} else {
gotoAndPlay (80);
}
}
function LoadCookie() {
var _local2 = new LoadVars();
_local2.decode(com.gamebrew.Common.GetCookie(_root.GB_GAME_SHORT, "player", "&nm=Guest&col=0&tm="));
_root.gb_name = _local2.nm;
_root.color_id = _local2.col;
_root.gb_team = _local2.tm;
}
function SaveCookie() {
com.gamebrew.Common.SetCookie(_root.GB_GAME_SHORT, "player", (((("&nm=" + _root.gb_name) + "&col=") + _root.color_id) + "&tm=") + _root.gb_team);
}
_root.GB_URL = "";
cmif = function () {
getURL (_root.GB_URL, "_blank");
};
cm = new ContextMenu();
cm.hideBuiltInItems();
cmi = new ContextMenuItem("Visit Gamebrew.com", cmif);
cm.customItems.push(cmi);
_root.menu = cm;
_root.kongregateServices.connect();
_root.KONG_GAME_ID = 2390;
_root.GB_ZONE_NAME = "Artillery";
_root.GB_ZONE_VERSION = "2.1";
_root.GB_GAME_TITLE = "Artillery Live";
_root.GB_GAME_ID = 3503;
_root.GB_GAME_SHORT = "artillery-live-v2";
_root.GB_GAME_WIDTH = 720;
_root.GB_GAME_HEIGHT = 560;
_root.GB_REDIRECT_URL = "" + _root.GB_GAME_SHORT;
_root.GB_CONTACT_URL = "";
_root.GB_SCORE_VERSION = "2.0";
_root.GB_SCORE_CGI = "";
_root.GB_SCORE_URL = "";
_root.GB_DEBUG = false;
_root.GB_GAME_VERSION = "2.13";
_root.GB_SERVER_IP = "";
_root.GB_SERVER_PORT = 1127;
_root.GB_GAME_DEPTH = 100;
_root.GB_POPUP_DEPTH = 300;
_root.gb_redirect = false;
LoadCookie();
qs = com.gamebrew.Common.GetQueryString();
if (qs.lock == 1) {
_root.gb_name_locked = true;
} else {
_root.gb_name_locked = false;
}
if (_root.kongregate_username != null) {
_root.gb_name = com.gamebrew.Common.StringTrim(_root.kongregate_username);
_root.gb_name_locked = true;
} else if (qs.nm != null) {
_root.gb_name = com.gamebrew.Common.StringTrim(qs.nm);
_root.gb_name_locked = true;
SaveCookie();
}
if ((_root.gb_name == null) || (_root.gb_name == "")) {
_root.gb_name = "IBPro Arcade";
} else if (_root.gb_name_locked == true) {
_root.gb_name = CleanName(_root.gb_name);
}
ErrorLog((((((_root.GB_GAME_TITLE + " v") + _root.GB_GAME_VERSION) + " z") + _root.GB_ZONE_VERSION) + " s") + _root.GB_SCORE_VERSION);
ErrorLog("Copyright 2007 Gamebrew Inc.");
ErrorLog(("SWF hosted at [" + com.gamebrew.Common.GetHost()) + "]");
AttachFooter(_root.GB_GAME_TITLE, _root.GB_GAME_VERSION, _root.GB_URL, _root.GB_CONTACT_URL, _root.GB_POPUP_DEPTH);
_global.ipb_get_gname = function () {
var _local4 = _root._url;
var _local5 = "";
var _local3 = "";
var _local6 = _local4.lastIndexOf("\\") + 1;
if ((_local6 == -1) || (_local6 == 0)) {
_local6 = _local4.lastIndexOf("/") + 1;
}
var _local2 = _local6;
var _local7 = String(_local4).length;
while (_local2 < String(_local4).length) {
_local3 = _local4.charAt(_local2);
if (_local3 == ".") {
break;
}
_local5 = _local5 + _local3;
_local2++;
}
return(_local5);
};
ipb_gname = _global.ipb_get_gname();
xx = new LoadVars();
xx.onLoad = function (success) {
if (success) {
_global.ipb_scoreVar = this.scoreVar;
}
};
fname = ((("arcade/gamedata/" + ipb_gname) + "/") + ipb_gname) + ".txt";
xx.load(fname);
Frame 2
_root.gotoAndPlay("mochibot");
Frame 8
_root.gotoAndPlay("pause?");
Frame 17
ErrorLog("END");
Frame 19
if (Key.isDown(16)) {
txt_error.textColor = 16777215 /* 0xFFFFFF */;
gotoAndPlay(_currentframe - 1);
}
Frame 24
_root.gotoAndPlay("done");
_root.game_type = 0;
_root.mu = new ArtilleryZone(_root.GB_SERVER_IP, _root.GB_SERVER_PORT, _root.GB_DEBUG);
_root.COLOR_NAME = ["Green", "Forest", "Blue", "Red", "Desert"];
_root.COLOR_FILTER = [null, [new flash.filters.ColorMatrixFilter([0.33, 0.33, 0.33, 0, 32, 0.33, 0.33, 0.33, 0, 64, 0.33, 0.33, 0.33, 0, -16, 0, 0, 0, 1, 0])], [new flash.filters.ColorMatrixFilter([0.33, 0.33, 0.33, 0, 0, 0.33, 0.33, 0.33, 0, 0, 0.33, 0.33, 0.33, 0, 128, 0, 0, 0, 1, 0])], [new flash.filters.ColorMatrixFilter([0.33, 0.33, 0.33, 0, 128, 0.33, 0.33, 0.33, 0, 0, 0.33, 0.33, 0.33, 0, 0, 0, 0, 0, 1, 0])], [new flash.filters.ColorMatrixFilter([0.33, 0.33, 0.33, 0, 96, 0.33, 0.33, 0.33, 0, 64, 0.33, 0.33, 0.33, 0, 32, 0, 0, 0, 1, 0])]];
_root.GLOW_FILTER = new Array(new flash.filters.GlowFilter(16776960, 0.9, 3, 3, 3, 3, false, false));
Frame 29
stop();
FadeOutIn(0, 0, _root.GotoAfterInit);
Frame 35
function GotoAfterGamebrew() {
gotoAndPlay (80);
}
var mouse_listener = new Object();
mouse_listener.onMouseUp = function () {
if (_root._ymouse >= 560) {
return(undefined);
}
com.gamebrew.Common.SoundPlay("click.wav");
};
Mouse.addListener(mouse_listener);
Frame 79
stop();
Mouse.removeListener(mouse_listener);
delete mouse_listener;
FadeOutIn(0, 16777215, _root.GotoAfterGamebrew);
Frame 80
com.gamebrew.Common.MusicStop();
_root.onMouseUp = function () {
if (_root._ymouse >= GB_GAME_HEIGHT) {
return(undefined);
}
_root.gotoAndStop("menu");
};
var key_listener = new Object();
key_listener.onKeyUp = function () {
_root.gotoAndStop("menu");
};
Key.addListener(key_listener);
Frame 103
function EnableColors() {
i = 0;
while (i <= 4) {
var _local3 = _root["mc_color_" + i];
_local3.gotoAndStop(i + 1);
_local3.color_id = i;
if (_root.color_id == i) {
_local3.filters = _root.GLOW_FILTER;
} else {
_local3.filters = null;
}
_local3.transform.colorTransform = new flash.geom.ColorTransform(1, 1, 1, 1, 0, 0, 0, 0);
_local3.onRollOver = function () {
_root.ButtonRollOver(this, _root.COLOR_NAME[this.color_id]);
};
_local3.onRollOut = function () {
_root.ButtonRollOut(this);
};
_local3.onRelease = function () {
com.gamebrew.Common.SoundPlay("click.wav");
_root.color_id = this.color_id;
_root.EnableColors();
_root.ClearTooltip();
};
i++;
}
}
function DisableColors() {
i = 0;
while (i <= 4) {
var _local2 = _root["mc_color_" + i];
_root.ButtonDisable(_local2);
i++;
}
}
function EnableMainMenu() {
txt_name_listener = new Object();
txt_name_listener.field_path = _root.txt_name;
txt_name_listener.onKeyDown = function () {
if (Key.getAscii() == 13) {
if (Selection.getFocus() == String(this.field_path)) {
_root.mc_but_play.onRelease();
}
}
};
Key.addListener(txt_name_listener);
if (_root.gb_name_locked == true) {
com.gamebrew.Common.EnableTextField(txt_name, false);
} else {
com.gamebrew.Common.EnableTextField(txt_name, true);
}
mc_but_1p.onRollOver = function () {
_root.ButtonRollOver(this);
};
mc_but_1p.onRollOut = function () {
_root.ButtonRollOut(this);
};
mc_but_1p.onRelease = function () {
if (server_timer != null) {
clearInterval(server_timer);
}
com.gamebrew.Common.SoundPlay("click.wav");
com.gamebrew.Common.MusicStop();
delete this.onRelease;
_root.gb_name = _root.CleanName(_root.txt_name.text);
_root.txt_name.text = _root.gb_name;
_root.SaveCookie();
_root.FadeOutIn(0, 0, _root.Goto1P);
delete this.onRelease;
};
mc_but_play.onRollOver = function () {
_root.ButtonRollOver(this);
};
mc_but_play.onRollOut = function () {
_root.ButtonRollOut(this);
};
mc_but_play.onRelease = function () {
if (server_timer != null) {
clearInterval(server_timer);
}
_root.DisableMainMenu();
com.gamebrew.Common.SoundPlay("click.wav");
if (_root.gb_redirect == true) {
_root.getURL(_root.GB_REDIRECT_URL, "_blank");
return(undefined);
}
delete this.onRelease;
_root.gb_name = _root.CleanName(_root.txt_name.text);
_root.txt_name.text = _root.gb_name;
_root.SaveCookie();
_root.mu_type = 0;
_root.OpenWindow("mc_win_connect");
};
mc_but_team.onRollOver = function () {
_root.ButtonRollOver(this);
};
mc_but_team.onRollOut = function () {
_root.ButtonRollOut(this);
};
mc_but_team.onRelease = function () {
if (server_timer != null) {
clearInterval(server_timer);
}
_root.DisableMainMenu();
com.gamebrew.Common.SoundPlay("click.wav");
if (_root.gb_redirect == true) {
_root.getURL(_root.GB_REDIRECT_URL, "_blank");
return(undefined);
}
delete this.onRelease;
_root.gb_name = _root.CleanName(_root.txt_name.text);
_root.txt_name.text = _root.gb_name;
_root.SaveCookie();
_root.mu_type = 1;
_root.OpenWindow("mc_win_connect");
};
mc_but_more.onRollOver = function () {
_root.ButtonRollOver(this, "");
};
mc_but_more.onRollOut = function () {
_root.ButtonRollOut(this);
};
mc_gb.onRollOut = function () {
_root.ButtonRollOut(this);
};
mc_but_credits.onRelease = function () {
com.gamebrew.Common.SoundPlay("click.wav");
_root.DisableMainMenu();
_root.OpenWindow("mc_win_credits");
delete this.onRelease;
};
mc_but_webmasters.onRelease = function () {
com.gamebrew.Common.SoundPlay("click.wav");
_root.DisableMainMenu();
_root.OpenWindow("mc_win_webmasters");
delete this.onRelease;
};
mc_but_help.onRelease = function () {
com.gamebrew.Common.SoundPlay("click.wav");
_root.DisableMainMenu();
_root.OpenWindow("mc_win_help");
delete this.onRelease;
};
EnableColors();
}
function DisableMainMenu() {
_root.ButtonDisable(mc_but_help);
_root.ButtonDisable(mc_but_credits);
_root.ButtonDisable(mc_but_webmasters);
_root.ButtonDisable(mc_gb);
_root.ButtonDisable(mc_but_more);
_root.ButtonDisable(mc_but_scores);
_root.ButtonDisable(mc_but_play);
_root.ButtonDisable(mc_but_team);
DisableColors();
Key.removeListener(txt_name_listener);
_root.txt_name.selectable = false;
}
function Goto1P() {
game_type = 0;
com.gamebrew.Common.MusicStop();
_root.StopServerStatus();
delete _root.mc_fader.onEnterFrame;
MovieRemoveAllExceptFooter();
gotoAndPlay (109);
}
function GotoMu() {
game_type = 1;
com.gamebrew.Common.MusicStop();
_root.StopServerStatus();
delete _root.mc_fader.onEnterFrame;
MovieRemoveAllExceptFooter();
gotoAndPlay (109);
}
stop();
com.gamebrew.Common.MusicSet("music.wav");
com.gamebrew.Common.MusicPlay();
delete _root.onMouseUp;
Key.removeListener(key_listener);
server_timer = null;
var server_status = new XMLSocket();
if (_root.gb_redirect == true) {
txt_server.text = "at gamebrew.com";
} else {
server_status.onConnect = function (success) {
if (success) {
_root.txt_server.text = "connected to server";
this.send(("&cmd=public.info.zone&zn=" + _root.GB_ZONE_NAME) + "");
} else {
_root.txt_server.text = "server unavailable";
clearInterval(server_timer);
server_timer = setInterval(_root, "UpdateServerStatus", 60000);
}
};
server_status.onData = function (str) {
if (str.length == 0) {
return(undefined);
}
var _local3 = new LoadVars();
_local3.decode(str);
_root.txt_server.text = ((_local3.user_count + " players ") + _local3.room_count) + " games";
this.close();
clearInterval(server_timer);
server_timer = setInterval(_root, "UpdateServerStatus", 30000);
};
UpdateServerStatus();
}
txt_version.text = "v" + _root.GB_GAME_VERSION;
txt_name.restrict = "A-za-z0-9_";
EnableMainMenu();
Frame 109
function ResetChat() {
if (_root.chat_interval != null) {
clearInterval(_root.chat_interval);
}
mc_chat.Enable();
}
function ClickChat(txt) {
mu.sendChat(com.gamebrew.Common.StringTrim(mc_chat.txt_input.text));
mc_chat.txt_input.text = "";
}
function AddChat(nm, team_id, txt) {
txt = ((((("<font color='" + _root.CHAT_COLORS[team_id]) + "'><b>") + nm) + "></b> ") + txt) + "</font>";
var _local2 = _root.txt_chat.htmlText;
var _local3 = _local2.split("</P>");
if (_local3.length > _root.CHAT_MAX_LINES) {
_local3 = _local3.splice(1);
_local2 = (_local3.join("</P>") + txt) + newline;
} else {
_local2 = _local2 + (txt + newline);
}
_root.txt_chat.htmlText = _local2;
_root.txt_chat.scroll = _root.txt_chat.maxscroll;
}
stop();
gotoAndStop ("play");
_root.CHAT_COLORS = ["#666666", "#FF0000", "#0000FF", "#444444"];
_root.CHAT_DEFAULT = "type chat here then press enter ...";
_root.CHAT_MAX_LINES = 9;
_root.txt_chat.html = true;
_root.txt_chat.text = (_root.txt_chat.htmlText = "");
_root.chat_interval = null;
if (game_type == 0) {
_root.mc_chat.Disable();
}
Frame 115
function ShowHiscoreBug() {
if (_root.kongregateServices != null) {
return(undefined);
}
var _local2 = _root.attachMovie("mc_hiscore", "mc_hiscore", _root.getNextHighestDepth());
_local2._x = 567;
_local2._y = 4;
_local2.game_id = _root.GB_GAME_ID;
_local2.mode_id = _root.game_type;
_local2.score_cgi = _root.GB_SCORE_CGI;
_local2.score_url = (_root.GB_SCORE_URL + "?i=1&m=") + game_type;
}
function CreateTankAI(i) {
var _local2 = new ArtilleryUser();
_local2.user_name = ((i == 0) ? (_root.gb_name) : ("Computer-" + (++ai_cpu_count)));
_local2.slot = i;
_local2.pos = ((com.gamebrew.Common.RandomBit() == 0) ? 1 : -1);
if ((i == 0) || (i == 2)) {
_local2.color = _root.color_id;
} else {
_local2.color = (_root.color_id + 1) % COLOR_NAME.length;
}
_local2.angle = com.gamebrew.Common.RandomInteger(20, 80);
_local2.power = com.gamebrew.Common.RandomInteger(11, 89);
_local2.score = 0;
_local2.kills = 0;
_local2.armor = 3;
_local2.combo = 0;
CreateTankUser(_local2, i == 0);
}
function GameReady() {
if (game_type == 0) {
var _local2 = 1;
while (_local2 <= 3) {
mc = _root["mc_tank_" + _local2];
if (mc == null) {
} else if (mc.is_disconnected == true) {
CreateTankAI(_local2);
_root.ai_change_wind = true;
}
_local2++;
}
if (_root.ai_change_wind == true) {
_root.ai_change_wind = false;
RandomizeWind();
_local2 = 1;
while (_local2 <= 3) {
mc = _root["mc_tank_" + _local2];
if (((mc == null) || (mc.is_dead)) || (mc.is_disconnected)) {
} else {
mc.ai_pos = ((com.gamebrew.Common.RandomInteger(0, 2) == 0) ? ((com.gamebrew.Common.RandomBit() ? 1 : -1)) : 0);
mc.ai_angle = com.gamebrew.Common.RandomInteger(30, 65);
mc.ai_power = com.gamebrew.Common.RandomInteger(11, 89);
}
_local2++;
}
}
}
com.gamebrew.Common.SoundPlay("shortbloop.wav");
if (_root.player.is_dead == false) {
_root.mc_controls.EnableAll();
}
var _local2 = 0;
while (_local2 <= 3) {
mc = _root["mc_tank_" + _local2];
if (mc == null) {
} else if ((mc.is_dead == false) && (mc.is_disconnected == true)) {
_root.RemoveTank(_local2);
}
_local2++;
}
_root.mc_menu.StartTimer();
_root.rounds++;
}
function AiRun(did_submit) {
_root.mc_menu.ClearTimer("battle in progress");
_root.mc_controls.DisableGrayAll();
var _local2 = 0;
while (_local2 <= 3) {
mc = _root["mc_tank_" + _local2];
if (mc == null) {
} else if (mc.is_dead || (mc.is_disconnected)) {
mc.command_on = false;
} else {
mc.command_on = true;
}
_local2++;
}
if (did_submit == true) {
var _local4 = ((mc_controls.val_pos == _root.player.user.pos) ? 0 : (mc_controls.val_pos));
var _local5 = mc_controls.val_angle;
var _local3 = mc_controls.val_power;
_root.player.ProcessCommand(_local4, _local5, _local3);
} else {
_root.player.command_on = false;
}
_local2 = 1;
while (_local2 <= 3) {
mc = _root["mc_tank_" + _local2];
if ((mc == null) || (mc.is_dead == true)) {
} else {
mc.ProcessCommand(((mc.ai_pos == mc.user.pos) ? 0 : (mc.ai_pos)), mc.ai_angle, mc.ai_power);
}
_local2++;
}
}
function DisableGame() {
Key.removeListener(key_listener);
com.gamebrew.Common.MusicStop();
_root.mc_hiscore.Stop();
_root.CloseCaption();
_root.CloseMarker();
_root.SetWind(0);
_root.mc_menu.Disable();
_root.mc_chat.Disable();
_root.mc_controls.DisableGrayAll();
var _local2 = 0;
while (_local2 <= 3) {
_root.DisableTank(_local2);
_local2++;
}
for (var _local3 in _root) {
if (com.gamebrew.Common.StringContains(_local3, "mc_ammo")) {
com.gamebrew.Common.MovieFilterGrayScale(_root[_local3]);
_root[_local3].stop();
delete _root[_local3].onEnterFrame;
}
}
}
function SetWind(w) {
if (w == 0) {
_root.wind_x = 0;
} else {
_root.wind_x = w / 3000;
}
var _local2 = int(_root.wind_x * 1000);
var _local5 = "";
var _local3 = ("wind at " + Math.abs(_local2)) + " ";
var _local4 = "";
if (_local2 > 0) {
_local3 = _local3 + "east";
if (_local2 >= 24) {
_local4 = ">>>";
} else if (_local2 >= 16) {
_local4 = ">>";
} else if (_local2 >= 8) {
_local4 = ">";
}
} else if (_local2 < 0) {
_local3 = _local3 + "west";
if (_local2 <= -24) {
_local5 = "<<<";
} else if (_local2 <= -16) {
_local5 = "<<";
} else if (_local2 <= -8) {
_local5 = "<";
}
} else {
_local3 = _local3 + "neutral";
}
_root.mc_wind.ChangeText(_local5, _local3, _local4);
}
function RandomizeWind() {
if (_root.wind_x >= 0) {
SetWind((-com.gamebrew.Common.RandomInteger(0, 96)) - 3);
} else {
SetWind(com.gamebrew.Common.RandomInteger(0, 96) + 3);
}
}
function AnimateClouds() {
if (_root.wind_x == 0) {
return(undefined);
}
this._x = this._x + (_root.wind_x * 20);
if ((_root.wind_x > 0) && ((this._x - (this._width / 2)) > Stage.width)) {
this._x = this._x - (Stage.width + this._width);
} else if ((_root.wind_x < 0) && ((this._x + (this._width / 2)) < 0)) {
this._x = this._x + (Stage.width + this._width);
}
}
function OpenCaption(txt) {
_root.CloseCaption();
var _local2 = _root.attachMovie("mc_caption", "mc_caption", com.gamebrew.Common.MovieGetNextDepthAt(_root, _root.GB_GAME_DEPTH));
_local2._x = 360;
_local2._y = 111;
_local2.arg_txt = txt;
return(_local2);
}
function CloseCaption() {
_root.mc_caption.removeMovieClip();
}
function OpenStatus(mcp, txt) {
_root.CloseStatus();
var _local2 = _root.attachMovie("mc_status", "mc_status", com.gamebrew.Common.MovieGetNextDepthAt(_root, _root.GB_GAME_DEPTH));
_local2._x = mcp._x;
_local2._y = mcp._y - 60;
_local2.arg_txt = txt;
return(_local2);
}
function CloseStatus() {
_root.mc_status.removeMovieClip();
}
function OpenMarker() {
_root.CloseMarker();
var _local2 = _root.attachMovie("mc_marker", "mc_marker", com.gamebrew.Common.MovieGetNextDepthAt(_root, _root.GB_GAME_DEPTH));
_local2._x = _root.player._x;
_local2._y = _root.player._y - 51;
return(_local2);
}
function CloseMarker() {
_root.mc_marker.removeMovieClip();
}
function OpenControls() {
_root.CloseControls();
if ((_root.PLAYER_DATA[_root.mu.user.slot].face == 1) || (_root.game_type == 0)) {
var _local2 = _root.attachMovie("mc_controls_right", "mc_controls", com.gamebrew.Common.MovieGetNextDepthAt(_root, _root.GB_GAME_DEPTH));
_local2._x = 50;
_local2._y = 504;
_local2 = _root.attachMovie("mc_menu", "mc_menu", com.gamebrew.Common.MovieGetNextDepthAt(_root, _root.GB_GAME_DEPTH));
_local2._x = 711;
_local2._y = 553;
} else {
var _local2 = _root.attachMovie("mc_controls_left", "mc_controls", com.gamebrew.Common.MovieGetNextDepthAt(_root, _root.GB_GAME_DEPTH));
_local2._x = 670;
_local2._y = 504;
_local2 = _root.attachMovie("mc_menu", "mc_menu", com.gamebrew.Common.MovieGetNextDepthAt(_root, _root.GB_GAME_DEPTH));
_local2.gotoAndStop("left");
_local2._x = 9;
_local2._y = 553;
}
_local2.DisableGrayAll();
return(_local2);
}
function CloseControls() {
_root.mc_controls.removeMovieClip();
_root.mc_menu.removeMovieClip();
}
function CreateTank(slot, nm, pos, col, is_plr) {
mc = _root["mc_tank_" + slot];
if (mc != undefined) {
mc.removeMovieClip();
}
var _local6 = _root.PLAYER_DATA[slot].face * -1;
var mc = _root.attachMovie("mc_tank", "mc_tank_" + slot, com.gamebrew.Common.MovieGetNextDepthAt(_root, _root.GB_GAME_DEPTH));
mc._x = _root.PLAYER_DATA[slot].x + ((_local6 == pos) ? 0 : (pos * _root.TANK_MOVE));
mc._y = _root.PLAYER_DATA[slot].y;
mc.face = _root.PLAYER_DATA[slot].face;
mc.team_id = _root.PLAYER_DATA[slot].team_id;
mc.color_id = col;
mc.is_dead = false;
mc.is_disconnected = false;
if (_root.game_type == 0) {
mc.ai_pos = 0;
mc.ai_angle = 0;
mc.ai_power = 0;
}
_root.players[slot] = mc;
if (col != 0) {
mc.body.filters = COLOR_FILTER[col];
mc.turret.filters = COLOR_FILTER[col];
}
com.gamebrew.Common.SoundPlay("zap.wav");
mc._xscale = 0;
mc._yscale = 300;
mc.transform.colorTransform = new flash.geom.ColorTransform(1, 1, 1, 1, 255, 255, 255, 0);
mc.onEnterFrame = function () {
this._xscale = this._xscale + (10 * this.face);
if ((this.face == 1) && (this._xscale >= 100)) {
this._xscale = 100;
} else if ((this.face == -1) && (this._xscale <= -100)) {
this._xscale = -100;
}
this._yscale = this._yscale - 30;
if (this._yscale < 100) {
this._yscale = 100;
}
var _local2 = this.transform.colorTransform.redOffset - 16;
if (_local2 < 0) {
_local2 = 0;
}
this.transform.colorTransform = new flash.geom.ColorTransform(1, 1, 1, 1, _local2, _local2, _local2, 0);
if (((this._xscale == (100 * this.face)) && (this._yscale == 100)) && (_local2 == 0)) {
this.transform.colorTransform = new flash.geom.ColorTransform(1, 1, 1, 1, 0, 0, 0, 0);
delete this.onEnterFrame;
}
};
if (is_plr == true) {
_root.player = mc;
_root.txt_pc.htmlText = ((("<FONT COLOR='" + _root.CHAT_COLORS[mc.team_id]) + "'><B>") + nm) + "</B></FONT>";
}
return(mc);
}
function CreateTankUser(user, is_plr) {
var _local2 = CreateTank(user.slot, user.user_name, user.pos, user.color, is_plr);
_local2.user = user;
_local2.ai_power = user.power;
_local2.ai_angle = user.angle;
_local2.ai_pos = user.pos;
return(_local2);
}
function RemoveTank(slot) {
mc = _root["mc_tank_" + slot];
if (mc == undefined) {
return(undefined);
}
if (mc.is_dead == true) {
return(undefined);
}
if (mc.ammo != null) {
mc.ammo.removeAmmo();
}
com.gamebrew.Common.SoundPlay("zap.wav");
mc._xscale = 100 * this.face;
mc._yscale = 100;
mc.transform.colorTransform = new flash.geom.ColorTransform(1, 1, 1, 1, 0, 0, 0, 0);
mc.onEnterFrame = function () {
this._xscale = this._xscale - (10 * this.face);
if ((this.face == 1) && (this._xscale <= 0)) {
this._xscale = 0;
} else if ((this.face == -1) && (this._xscale >= 0)) {
this._xscale = 0;
}
this._yscale = this._yscale + 50;
if (this._yscale > 300) {
this._yscale = 300;
}
var _local3 = this.transform.colorTransform.redOffset + 16;
if (_local3 > 255) {
_local3 = 255;
}
this.transform.colorTransform = new flash.geom.ColorTransform(1, 1, 1, 1, _local3, _local3, _local3, 0);
if (((this._xscale == 0) && (this._yscale == 300)) && (_local3 == 255)) {
this.transform.colorTransform = new flash.geom.ColorTransform(1, 1, 1, 1, 0, 0, 0, 0);
_root[this._name].removeMovieClip();
_root[("txt_p" + slot) + "k"].text = "disconnected";
delete this.onEnterFrame;
}
};
}
function DisableTank(slot) {
mc = _root["mc_tank_" + slot];
if (mc == null) {
return(undefined);
}
if (mc.is_dead == false) {
com.gamebrew.Common.MovieFilterGrayScale(mc);
}
}
function AllTanksDone() {
var _local2 = 0;
while (_local2 <= 3) {
var _local3 = _root["mc_tank_" + _local2];
if (_local3 == null) {
} else if (_local3.command_on == true) {
return(false);
}
_local2++;
}
return(true);
}
function GotoEnding(tt) {
if (game_type == 1) {
delete mu.onDisconnect;
mu.onDisconnect = null;
mu.disconnect();
}
DisableGame();
if (_root.kongregateServices == null) {
_root.OpenWindow("mc_win_end");
_root.mc_win.arg_title = tt;
} else {
_root.OpenWindow("mc_win_end_kong");
_root.mc_win.arg_title = tt;
}
}
function ReturnMenu() {
mu.disconnect();
com.gamebrew.Common.MovieRemoveAll(this);
gotoAndPlay (80);
}
stop();
_root.GRAVITY = 0.1;
_root.TANK_MOVE = 50;
_root.TURN_SECS = 10;
_root.MAX_WIND = 3;
_root.PLAYER_DATA = [{player_id:1, team_id:1, face:1, x:32, y:295}, {player_id:2, team_id:2, face:-1, x:688, y:295}, {player_id:3, team_id:1, face:1, x:165, y:360}, {player_id:4, team_id:2, face:-1, x:555, y:360}];
_root.player = null;
_root.players = new Array(4);
_root.turn_secs = _root.TURN_SECS;
_root.rounds = 0;
_root.ai_change_wind = false;
_root.ai_cpu_count = 0;
var key_up = 0;
var key_listener = new Object();
key_listener.onKeyUp = function () {
key_up = Key.getCode();
};
Key.addListener(key_listener);
SetWind(0);
mc_cloud.onEnterFrame = AnimateClouds;
mc_cloud_1.onEnterFrame = AnimateClouds;
_root.txt_pc.htmlText = "";
var i = 0;
while (i <= 3) {
_root["txt_p" + i].text = "";
_root[("txt_p" + i) + "k"].text = "";
_root[("mc_p" + i) + "a"]._visible = false;
i++;
}
if (game_type == 1) {
mc_menu.ClearTimer("starting game");
delete mu.onConnect;
delete mu.onLogin;
mu.onDisconnect = function (message) {
if (_root.player == null) {
_root.AddChat("System", 0, message);
_root.OpenStatus(_root.player, "disconnected!");
_root.mc_menu.ClearTimer("you are disconnected");
_root.GotoEnding("Disconnected");
} else if (_root.player.is_dead == false) {
_root.AddChat("System", 0, message);
_root.mc_menu.ClearTimer("you are disconnected");
_root.GotoEnding("Disconnected");
} else {
_root.AddChat("System", 0, "Game over disconnected");
_root.mc_menu.ClearTimer("you are disconnected");
_root.GotoEnding("Game Over");
}
};
mu.onInfo = function (cmd, ok, vars) {
_root.AddChat("System", 0, vars.msg);
};
mu.onGameCommand = function (cmd, vars) {
if (cmd == "game.move.ready") {
if (_root.player.is_dead == true) {
_root.mc_menu.ClearTimer("game over");
if (_root.game_type == 1) {
delete this.onGameCommand;
_root.mu.leaveRoom();
_root.GotoEnding("Game Over");
}
return(undefined);
}
_root.mc_menu.ClearTimer("battle in progress");
_root.mc_controls.DisableGrayAll();
var _local3 = 0;
while (_local3 <= 3) {
mc = _root["mc_tank_" + _local3];
if (mc == null) {
} else if (mc.is_dead || (mc.is_disconnected)) {
mc.command_on = false;
} else {
mc.command_on = true;
}
_local3++;
}
} else if (cmd == "game.move") {
mc = _root["mc_tank_" + vars.slot];
if (vars.power == null) {
mc.arg_pos = 0;
mc.arg_angle = -1;
mc.arg_power = -1;
mc.ProcessResult(0, 0);
} else {
mc.ProcessCommand(int(vars.pos), int(vars.angle), int(vars.power));
}
} else if (cmd == "game.ready") {
_root.GameReady();
} else if (cmd == "game.event") {
if (vars.wind != null) {
com.gamebrew.Common.SoundPlay("windy.wav");
_root.SetWind(vars.wind);
}
}
};
mu.onChat = function (msg, uid, user_name, user) {
if (user_name == null) {
_root.AddChat("System", 0, msg);
} else if (user == null) {
_root.AddChat(user_name, 3, msg);
} else if (this.user_id == uid) {
AddChat(user_name, _root.PLAYER_DATA[user.slot].team_id, msg);
_root.chat_interval = setInterval(_root.ResetChat, 2000);
} else {
AddChat(user_name, _root.PLAYER_DATA[user.slot].team_id, msg);
}
};
mu.onRoomUserJoin = function (room, users) {
_root.AddChat("System", 0, ("You are playing \"" + room.room_name) + "\"");
_root.OpenControls();
var _local2 = 0;
while (_local2 < users.length) {
var _local3 = users[_local2];
CreateTankUser(_local3, _local3.user_id == _root.mu.user_id);
_local2++;
}
_root.OpenCaption("Gun Battle!");
_root.OpenMarker();
_root.mc_menu.timer_start = true;
_root.mc_chat.Enable();
ShowHiscoreBug();
com.gamebrew.Common.MusicPlay();
};
mu.onEventRoomUserJoin = function (user, room) {
if (_root.player.is_dead == true) {
return(undefined);
}
_root.AddChat("System", 0, user.user_name + " has joined the game");
_root.CreateTankUser(user, false);
};
mu.onEventRoomUserLeave = function (user, room) {
mc = _root["mc_tank_" + user.slot];
if (mc.is_dead == true) {
_root.AddChat("System", 0, user.user_name + " has been destroyed");
} else {
_root.AddChat("System", 0, user.user_name + " has left the game");
mc.is_disconnected = true;
}
};
mu.onEventRoomUserDisconnect = function (user, room) {
mc = _root["mc_tank_" + user.slot];
if (mc.is_dead == true) {
_root.AddChat("System", 0, user.user_name + " has been destroyed");
} else {
_root.AddChat("System", 0, user.user_name + " has disconnected");
mc.is_disconnected = true;
}
};
_root.mu.setPaused(false);
} else {
AddChat("System", 0, "Single player mode");
OpenControls();
OpenCaption("Gun Battle!");
RandomizeWind();
mc_menu.timer_start = true;
ShowHiscoreBug();
var i = 0;
while (i <= 3) {
CreateTankAI(i);
i++;
}
OpenMarker();
com.gamebrew.Common.MusicPlay();
}
Symbol 566 MovieClip Frame 1
if (yy.savescore == 1) {
if (ipb_score == undefined) {
ipb_score = eval (_global.ipb_scoreVar);
}
xx = new LoadVars();
xx.arcadegid = _root.ibpro_gameid;
xx.gscore = ipb_score;
xx.gname = _global.ipb_get_gname();
xx.enscore = (ipb_score * yy.randchar) ^ yy.randchar2;
xx.send("index.php?autocom=arcade&do=savescore", "_self", "POST");
stop();
}
_global.ipbSend = function (ipb_score) {
_root._visible = false;
_root.enabled = false;
xx = new LoadVars();
yy = new LoadVars();
xx.sendAndLoad("index.php?autocom=arcade&do=verifyscore", yy, "POST");
};
Symbol 239 MovieClip Frame 1
stop();
onPress = function () {
if (com.gamebrew.Common.MuteGet() == false) {
com.gamebrew.Common.MuteSet(true);
com.gamebrew.Common.MovieFilterGrayScale(this);
com.gamebrew.Common.MovieFilterGrayScale(this._parent.mc_but_music);
gotoAndStop (2);
} else {
com.gamebrew.Common.MuteSet(false);
com.gamebrew.Common.SoundPlay("click.wav");
com.gamebrew.Common.MovieFilterClear(this);
com.gamebrew.Common.MovieFilterClear(this._parent.mc_but_music);
gotoAndStop (1);
}
onRollOver();
};
onRollOver = function () {
this.transform.colorTransform = new flash.geom.ColorTransform(1, 1, 1, 1, 255, 255, 0, 0);
this._parent.opt = "volume = " + (com.gamebrew.Common.MuteGet() ? "off" : "on");
};
onRollOut = function () {
this.transform.colorTransform = new flash.geom.ColorTransform(1, 1, 1, 1, 0, 0, 0, 0);
this._parent.opt = "";
};
Symbol 248 MovieClip Frame 1
function update() {
if (_root._quality == "BEST") {
} else if (_root._quality == "HIGH") {
gotoAndStop (2);
} else if (_root._quality == "MEDIUM") {
gotoAndStop (3);
} else if (_root._quality == "LOW") {
gotoAndStop (4);
}
}
stop();
update();
setInterval(this, "update", 3000);
onPress = function () {
com.gamebrew.Common.SoundPlay("click.wav");
if (_root._quality == "BEST") {
_root._quality = "HIGH";
gotoAndStop (2);
} else if (_root._quality == "HIGH") {
_root._quality = "MEDIUM";
gotoAndStop (3);
} else if (_root._quality == "MEDIUM") {
_root._quality = "LOW";
gotoAndStop (4);
} else if (_root._quality == "LOW") {
_root._quality = "BEST";
gotoAndStop (1);
}
onRollOver();
};
onRollOver = function () {
this.transform.colorTransform = new flash.geom.ColorTransform(1, 1, 1, 1, 255, 255, 0, 0);
this._parent.opt = "quality = " + _root._quality;
};
onRollOut = function () {
this.transform.colorTransform = new flash.geom.ColorTransform(1, 1, 1, 1, 0, 0, 0, 0);
this._parent.opt = "";
};
Symbol 253 MovieClip Frame 1
stop();
onPress = function () {
if (com.gamebrew.Common.MusicGetMute() == false) {
com.gamebrew.Common.MusicSetMute(true);
if (com.gamebrew.Common.MuteGet() == false) {
com.gamebrew.Common.MovieFilterGrayScale(this);
}
gotoAndStop (2);
} else {
com.gamebrew.Common.MusicSetMute(false);
if (com.gamebrew.Common.MuteGet() == false) {
com.gamebrew.Common.MovieFilterClear(this);
}
gotoAndStop (1);
}
com.gamebrew.Common.SoundPlay("click.wav");
onRollOver();
};
onRollOver = function () {
this.transform.colorTransform = new flash.geom.ColorTransform(1, 1, 1, 1, 255, 255, 0, 0);
this._parent.opt = "music = " + (com.gamebrew.Common.MusicGetMute() ? "off" : "on");
};
onRollOut = function () {
this.transform.colorTransform = new flash.geom.ColorTransform(1, 1, 1, 1, 0, 0, 0, 0);
this._parent.opt = "";
};
Symbol 256 MovieClip Frame 1
stop();
onPress = function () {
com.gamebrew.Common.SoundPlay("click.wav");
_root.getURL(this._parent.email_url, "_blank");
onRollOver();
};
onRollOver = function () {
this.transform.colorTransform = new flash.geom.ColorTransform(1, 1, 1, 1, 255, 255, 0, 0);
this._parent.opt = "email creator";
};
onRollOut = function () {
this.transform.colorTransform = new flash.geom.ColorTransform(1, 1, 1, 1, 0, 0, 0, 0);
this._parent.opt = "";
};
Symbol 257 MovieClip [mc_footer] Frame 1
stop();
opt = "";
mc_footer_label.onRelease = function () {
com.gamebrew.Common.SoundPlay("click.wav");
_root.getURL(_root.GB_URL, "_blank");
};
Symbol 274 MovieClip [mc_win_team] Frame 1
function EnableTeamButton() {
com.gamebrew.Common.MovieFilterClear(mc_but_team);
mc_but_team.onRollOver = function () {
_root.ButtonRollOver(this);
};
mc_but_team.onRollOut = function () {
_root.ButtonRollOut(this);
};
mc_but_team.onRelease = function () {
if ((_root.mc_win.txt_name.text.length == 0) || (_root.mc_win.txt_name.text.toLowerCase() == _root.mu.user_name.toLowerCase())) {
_root.mc_win.txt_err.text = "Invalid user";
com.gamebrew.Common.SoundPlay("error.wav");
return(undefined);
}
com.gamebrew.Common.SoundPlay("click.wav");
com.gamebrew.Common.MovieFilterGrayScale(this);
_root.ButtonDisable(this);
_root.mu.sendRequest("game.join.team", "&user_name=" + _root.mc_win.txt_name.text);
_root.mc_win.txt_err.text = "Finding user";
};
}
stop();
txt_help.text = com.gamebrew.Common.StringReplace(txt_help.text, "$$$", _root.mu.user_name);
txt_name.restrict = "^&=\\";
txt_name_listener = new Object();
txt_name_listener.field_path = _root.mc_win.txt_name;
txt_name_listener.onKeyDown = function () {
if (Key.getAscii() == 13) {
if (Selection.getFocus() == String(this.field_path)) {
_root.mc_win.mc_but_team.onRelease();
}
}
};
Key.addListener(txt_name_listener);
Selection.setFocus(_root.mc_win.txt_name);
mc_but_close.onRollOver = function () {
_root.ButtonRollOver(this);
};
mc_but_close.onRollOut = function () {
_root.ButtonRollOut(this);
};
mc_but_close.onRelease = function () {
com.gamebrew.Common.SoundPlay("click.wav");
_root.EnableMainMenu();
_root.CloseWindow();
};
EnableTeamButton();
_root.mu.onInfo = function (cmd, ok, vars) {
_root.mc_win.txt_err.text = vars.msg;
com.gamebrew.Common.SoundPlay("error.wav");
EnableTeamButton();
};
_root.mu.onDisconnect = function (msg, isban) {
mc_but_close.onRelease();
};
_root.mu.onGameCommand = function (cmd, vars) {
if (cmd == "game.join.team") {
_root.gb_team = _root.mc_win.txt_name.text;
_root.SaveCookie();
com.gamebrew.Common.SoundPlay("longbloop.wav");
_root.mc_win.txt_err.text = "Game starting";
_root.mu.setPaused(true);
_root.FadeOutIn(0, 0, _root.GotoMu);
}
};
_root.mu.setPaused(false);
Symbol 283 MovieClip [mc_hiscore] Frame 1
function Stop() {
stop();
delete mc_cycle.onEnterFrame;
}
mc_but.tabEnabled = false;
Symbol 283 MovieClip [mc_hiscore] Frame 2
function AttachFlag(cc) {
if (cc == flag_cc) {
return(undefined);
}
this.mc_flag.removeMovieClip();
var _local2 = this.createEmptyMovieClip("mc_flag", 0);
_local2._x = 121;
_local2._y = 5;
_local2.attachBitmap(flash.display.BitmapData.loadBitmap(cc + ".gif"), 0);
flag_cc = cc;
}
function Cycle() {
var _local2 = this.createEmptyMovieClip("mc_cycle", 1);
mc_cycle.onEnterFrame = function () {
var _local2 = this._parent;
if (_local2.wait > 0) {
_local2.wait--;
return(undefined);
}
var _local3 = "xx";
if ((_local2.score_cycle == 0) && (_local2.scoreload.nm_99999 != null)) {
_local2.txt_1.text = "All Time Hiscore";
_local2.txt_2.text = (_local2.scoreload.nm_99999 + " ") + _local2.scoreload.sc_99999;
_local3 = _local2.scoreload.cc_99999;
} else if ((_local2.score_cycle == 1) && (_local2.scoreload.nm_30 != null)) {
_local2.txt_1.text = "Monthly Hiscore";
_local2.txt_2.text = (_local2.scoreload.nm_30 + " ") + _local2.scoreload.sc_30;
_local3 = _local2.scoreload.cc_30;
} else if ((_local2.score_cycle == 2) && (_local2.scoreload.nm_7 != null)) {
_local2.txt_1.text = "Weekly Hiscore";
_local2.txt_2.text = (_local2.scoreload.nm_7 + " ") + _local2.scoreload.sc_7;
_local3 = _local2.scoreload.cc_7;
} else if ((_local2.score_cycle == 3) && (_local2.scoreload.nm_1 != null)) {
_local2.txt_1.text = "Today's Hiscore";
_local2.txt_2.text = (_local2.scoreload.nm_1 + " ") + _local2.scoreload.sc_1;
_local3 = _local2.scoreload.cc_1;
}
_local2.AttachFlag(_local3);
_local2.wait = 240;
_local2.score_cycle++;
if (_local2.score_cycle > 3) {
_local2.score_cycle = 0;
}
};
}
stop();
var score_cycle = 0;
var wait = 0;
var flag_cc;
var scoreload = new LoadVars();
scoreload.onLoad = function (success) {
if ((!success) || (this.success == 0)) {
trace("[thread]hiscore failed: " + this.message);
_root.mc_hiscore.txt_2.text = "Click here to view";
} else {
trace("[thread]hiscore: " + unescape(this));
if (this.nm_99999 == undefined) {
_root.mc_hiscore.txt_2.text = "Click here to view";
} else {
_root.mc_hiscore.Cycle();
}
}
delete this.onLoad;
};
var post = new LoadVars();
post.cmd = "hiscore.load.bug";
post.g = game_id;
post.m = mode_id;
post.sendAndLoad(score_cgi, scoreload, "POST");
AttachFlag("xx");
Symbol 285 MovieClip [mc_tooltip] Frame 1
txt.text = this.new_text;
txt.backgroundColor = 16777113 /* 0xFFFF99 */;
txt.borderColor = 3355443 /* 0x333333 */;
txt.autoSize = "left";
txt.selectable = false;
txt._visible = false;
this.frames = 0;
this.onEnterFrame = function () {
this.frames++;
if (this.frames == 30) {
txt._visible = true;
} else if (this.frames > (30 + (txt.text.length * 10))) {
delete this.onEnterFrame;
_root[this._name].removeMovieClip();
}
};
Symbol 289 MovieClip [mc_turret_fire] Frame 12
stop();
_root[_name].removeMovieClip();
Symbol 293 MovieClip [mc_ammo] Frame 1
function removeAmmo(did_hit) {
if (((_root.game_type == 1) && (did_hit == false)) && (this.owner.user.slot != 0)) {
var _local5 = _root.PLAYER_DATA[this.owner.user.slot].team_id;
if (((_local5 == 1) && (_x <= 360)) || ((_local5 == 2) && (_x >= 360))) {
this.owner.ai_angle = this.owner.ai_angle + com.gamebrew.Common.RandomInteger(3, 5);
if (this.owner.user.slot >= 2) {
if (this.owner.ai_angle > 65) {
this.owner.ai_angle = 65;
}
} else if (this.owner.ai_angle > 50) {
this.owner.ai_angle = 50;
}
this.owner.ai_power = this.owner.ai_power + com.gamebrew.Common.RandomInteger(7, 15);
if (this.owner.ai_power > 99) {
this.owner.ai_power = 99;
}
} else if (((_local5 == 1) && (_x > 720)) || ((_local5 == 2) && (_x < 0))) {
this.owner.ai_angle = this.owner.ai_angle - com.gamebrew.Common.RandomInteger(1, 3);
if (this.owner.ai_angle < 10) {
this.owner.ai_angle = 10;
}
this.owner.ai_power = this.owner.ai_power - com.gamebrew.Common.RandomInteger(3, 10);
if (this.owner.ai_power < 1) {
this.owner.ai_power = 1;
}
} else {
var _local6 = null;
var _local4 = 99999 /* 0x01869F */;
i = 0;
while (i <= 3) {
mc = _root["mc_tank_" + i];
if (mc == null) {
} else if (_root.PLAYER_DATA[mc.user.slot].team_id == _local5) {
} else {
var _local3 = com.gamebrew.Common.CalcDistance(_x, _y, mc._x, mc._y);
if (_local3 < _local4) {
_local4 = _local3;
_local6 = mc;
}
}
i++;
}
if (_local6 != null) {
if (_local6._x < _x) {
this.owner.ai_power = this.owner.ai_power - (com.gamebrew.Common.RandomInteger(1, 5) * ((_local5 == 1) ? 1 : -1));
} else {
this.owner.ai_power = this.owner.ai_power + (com.gamebrew.Common.RandomInteger(1, 5) * ((_local5 == 1) ? 1 : -1));
}
}
}
}
this.owner.ammo = null;
_root[_name].removeMovieClip();
delete onEnterFrame;
}
type = "ammo";
onEnterFrame = function () {
if (do_hit_dirt == true) {
d = com.gamebrew.Common.MovieGetNextDepthAt(_root, _root.GB_GAME_DEPTH);
mc2 = _root.attachMovie("mc_hit_dirt", "mc_hit_dirt_" + d, d);
mc2._rotation = _rotation;
mc2._x = _x;
mc2._y = _y;
owner.ResultNoKill("miss!");
this.removeAmmo(false);
return(undefined);
}
_x = (_x + speed.x);
_y = (_y + speed.y);
speed.x = speed.x + _root.wind_x;
speed.y = speed.y + _root.GRAVITY;
_rotation = com.gamebrew.Common.CalcAngleFromPoints(last_x, last_y, _x, _y);
last_x = _x;
last_y = _y;
var _local3 = false;
for (mc in _root) {
if (!(_root[mc] instanceof MovieClip)) {
// unexpected jump
}
if (_root[mc].type != "tank") {
// unexpected jump
}
if (_root[mc].is_dead == true) {
// unexpected jump
}
if (_root[mc].body.hitTest(_x, _y, true) == false) {
// unexpected jump
}
if ((_root[mc] == owner) || (_root[mc].team_id == owner.team_id)) {
owner.ResultBadKill(_root[mc]);
} else if (_root[mc].user.armor > 1) {
d = com.gamebrew.Common.MovieGetNextDepthAt(_root, _root.GB_GAME_DEPTH);
mc2 = _root.attachMovie("mc_hit_block", "mc_hit_block_" + d, d);
mc2._rotation = _rotation;
mc2._x = _x;
mc2._y = _y;
owner.ResultAddKill(_root[mc]);
} else {
owner.ResultAddKill(_root[mc]);
}
_local3 = true;
this.removeAmmo(true);
}
if (_local3 == true) {
return(undefined);
}
for (mc in _root) {
if (_root[mc].type != "ammo") {
continue;
}
if (((_root[mc] == owner) || (_root[mc].owner == owner)) || (_root[mc].owner.team_id == owner.team_id)) {
continue;
}
if (_root[mc].hitTest(_x, _y, true) == true) {
_root[mc].do_hit_dirt = true;
do_hit_dirt = true;
break;
}
}
if (do_hit_dirt == false) {
if (_root.mc_terrain.ground.hitTest(_x, _y, true) == true) {
do_hit_dirt = true;
} else if ((((_y > Stage.height) || (_y < -100)) || (_x > (Stage.width + 25))) || (_x < -25)) {
owner.ResultNoKill("foul!");
this.removeAmmo(false);
}
}
};
Symbol 293 MovieClip [mc_ammo] Frame 5
var d = com.gamebrew.Common.MovieGetNextDepthAt(_root, _root.GB_GAME_DEPTH);
var mc = _root.attachMovie("mc_smoke", "mc_smoke_" + d, d);
var pt = {x:0, y:0};
this.localToGlobal(pt);
mc._x = pt.x;
mc._y = pt.y;
mc._alpha = 70;
mc._rotation = this._rotation;
mc.onEnterFrame = function () {
var _local2 = this._alpha - 2;
if (_local2 <= 0) {
this._alpha = 0;
delete this.onEnterFrame;
this.removeMovieClip();
} else {
this._alpha = _local2;
this._xscale = this._xscale + 3;
this._yscale = this._yscale + 3;
}
};
gotoAndPlay (2);
Symbol 297 MovieClip [mc_hit_block] Frame 10
_root[this._name].removeMovieClip();
stop();
Symbol 303 MovieClip [mc_hit_dirt] Frame 5
_root[this._name].removeMovieClip();
stop();
Symbol 323 MovieClip [mc_controls_left] Frame 1
function RefreshInfo() {
val_angle = int(mc_but_power._rotation + 180);
val_power = int(((mc_but_power.mc_but_power_drag._x - mc_but_power.mc_but_power_drag.MIN_POWER_LOC) / (mc_but_power.mc_but_power_drag.MAX_POWER_LOC - mc_but_power.mc_but_power_drag.MIN_POWER_LOC)) * 100);
if (val_power < 1) {
val_power = 1;
} else if (val_power > 99) {
val_power = 99;
}
txt_angle.text = ((val_angle + "\u00B0\n") + val_power) + "+";
}
function SetToPlayer() {
mc_but_power._rotation = _root.player.user.angle - 180;
mc_but_power.mc_but_power_drag._x = mc_but_power.mc_but_power_drag.MIN_POWER_LOC + ((_root.player.user.power / 99) * (mc_but_power.mc_but_power_drag.MAX_POWER_LOC - mc_but_power.mc_but_power_drag.MIN_POWER_LOC));
RefreshInfo();
}
function StartFire(did_submit) {
if (was_submitted) {
return(undefined);
}
was_submitted = true;
DisableAll();
RefreshInfo();
com.gamebrew.Common.MovieFilterGrayScale(mc_but_power);
com.gamebrew.Common.MovieFilterGrayScale(mc_angle_up);
com.gamebrew.Common.MovieFilterGrayScale(mc_angle_down);
com.gamebrew.Common.MovieFilterGrayScale(mc_but_move);
if ((val_pos == -1) || (val_pos == 0)) {
com.gamebrew.Common.MovieFilterGrayScale(mc_but_move_right);
} else if ((val_pos == 1) || (val_pos == 0)) {
com.gamebrew.Common.MovieFilterGrayScale(mc_but_move_left);
}
_root.ClearTooltip(null);
if (did_submit == true) {
txt_angle_old.text = txt_angle.text;
com.gamebrew.Common.SoundPlay("longbloop.wav");
mc_but_fire.transform.colorTransform = new flash.geom.ColorTransform(1, 1, 0.25, 1, 0, 0, 0, 0);
if (_root.game_type == 1) {
_root.mu.sendRequest("game.move", (((("&pos=" + ((val_pos == _root.player.user.pos) ? 0 : (val_pos))) + "&angle=") + val_angle) + "&power=") + val_power);
} else {
_root.AiRun(true);
}
} else if (_root.game_type == 1) {
_root.mu.sendRequest("game.move");
} else {
_root.AiRun(false);
}
}
function DisableGrayAll() {
com.gamebrew.Common.MovieFilterGrayScale(this.mc_but_power);
com.gamebrew.Common.MovieFilterGrayScale(this.mc_angle_up);
com.gamebrew.Common.MovieFilterGrayScale(this.mc_angle_down);
com.gamebrew.Common.MovieFilterGrayScale(this.mc_but_move);
com.gamebrew.Common.MovieFilterGrayScale(this.mc_but_move_right);
com.gamebrew.Common.MovieFilterGrayScale(this.mc_but_move_left);
com.gamebrew.Common.MovieFilterGrayScale(this.mc_but_fire);
DisableAll();
}
function DisableAll() {
Key.removeListener(this);
this.was_submitted = true;
_root.ButtonDisable(this.mc_angle_up);
_root.ButtonDisable(this.mc_angle_down);
_root.ButtonDisable(this.mc_but_power.mc_but_power_up);
_root.ButtonDisable(this.mc_but_power.mc_but_power_down);
_root.ButtonDisable(this.mc_but_power.mc_but_power_drag);
_root.ButtonDisable(this.mc_but_move);
_root.ButtonDisable(this.mc_but_move_left);
_root.ButtonDisable(this.mc_but_move_right);
_root.ButtonDisable(this.mc_but_fire);
}
function EnableMoveButton() {
com.gamebrew.Common.MovieFilterClear(mc_but_move);
mc_but_move.onRollOver = function () {
if (this._parent.was_submitted == true) {
return(undefined);
}
_root.ButtonRollOver(this, "abort move");
};
mc_but_move.onRollOut = function () {
if (this._parent.was_submitted == true) {
return(undefined);
}
_root.ButtonRollOut(this);
};
mc_but_move.onRelease = function () {
if (this._parent.was_submitted == true) {
return(undefined);
}
com.gamebrew.Common.SoundPlay("click.wav");
EnableDirButtons();
_root.ClearTooltip();
};
}
function EnableDirButtons() {
val_pos = _root.player.user.pos;
com.gamebrew.Common.MovieFilterGrayScale(mc_but_move);
_root.ButtonDisable(mc_but_move);
if (val_pos != -1) {
com.gamebrew.Common.MovieFilterClear(mc_but_move_left);
mc_but_move_left.onRollOver = function () {
if ((this._parent.was_submitted == true) || (this._parent.val_pos == -1)) {
return(undefined);
}
_root.ButtonRollOver(this, "move left");
};
mc_but_move_left.onRollOut = function () {
if ((this._parent.was_submitted == true) || (this._parent.val_pos == -1)) {
return(undefined);
}
_root.ButtonRollOut(this);
};
mc_but_move_left.onRelease = function () {
if ((this._parent.was_submitted == true) || (this._parent.val_pos == -1)) {
return(undefined);
}
this.transform.colorTransform = new flash.geom.ColorTransform(1, 1, 0.25, 1, 0, 0, 0, 0);
this._parent.val_pos = -1;
this._parent.EnableMoveButton();
com.gamebrew.Common.SoundPlay("click.wav");
_root.ClearTooltip();
};
} else {
com.gamebrew.Common.MovieFilterGrayScale(mc_but_move_left);
}
if (val_pos != 1) {
com.gamebrew.Common.MovieFilterClear(mc_but_move_right);
mc_but_move_right.onRollOver = function () {
if ((this._parent.was_submitted == true) || (this._parent.val_pos == 1)) {
return(undefined);
}
_root.ButtonRollOver(this, "move right");
};
mc_but_move_right.onRollOut = function () {
if ((this._parent.was_submitted == true) || (this._parent.val_pos == 1)) {
return(undefined);
}
_root.ButtonRollOut(this);
};
mc_but_move_right.onRelease = function () {
if ((this._parent.was_submitted == true) || (this._parent.val_pos == 1)) {
return(undefined);
}
this.transform.colorTransform = new flash.geom.ColorTransform(1, 1, 0.25, 1, 0, 0, 0, 0);
this._parent.val_pos = 1;
this._parent.EnableMoveButton();
com.gamebrew.Common.SoundPlay("click.wav");
_root.ClearTooltip();
};
} else {
com.gamebrew.Common.MovieFilterGrayScale(mc_but_move_right);
}
}
function EnableAll() {
this.was_submitted = false;
this.onKeyDown = function () {
if (this._parent.was_submitted == true) {
return(undefined);
}
if (Key.isDown(39)) {
var _local2 = mc_but_power._rotation + 1;
if (_local2 > -90) {
mc_but_power._rotation = -90;
} else {
mc_but_power._rotation = _local2;
}
} else if (Key.isDown(37)) {
var _local2 = mc_but_power._rotation - 1;
if (_local2 < -180) {
mc_but_power._rotation = -180;
} else {
mc_but_power._rotation = _local2;
}
} else if (Key.isDown(38)) {
mc_but_power.mc_but_power_drag._x++;
if (mc_but_power.mc_but_power_drag._x > mc_but_power.mc_but_power_drag.MAX_POWER_LOC) {
mc_but_power.mc_but_power_drag._x = mc_but_power.mc_but_power_drag.MAX_POWER_LOC;
}
} else if (Key.isDown(40)) {
mc_but_power.mc_but_power_drag._x--;
if (mc_but_power.mc_but_power_drag._x < mc_but_power.mc_but_power_drag.MIN_POWER_LOC) {
mc_but_power.mc_but_power_drag._x = mc_but_power.mc_but_power_drag.MIN_POWER_LOC;
}
} else if (Key.isDown(17)) {
StartFire(true);
}
RefreshInfo();
};
Key.addListener(this);
com.gamebrew.Common.MovieFilterClear(mc_angle_up);
mc_angle_up.onRollOver = _root.ButtonOver;
mc_angle_up.onRollOut = _root.ButtonOut;
mc_angle_up.onPress = _root.ButtonPress;
mc_angle_up.onRelease = _root.ButtonRelease;
mc_angle_up.onReleaseOutside = _root.ButtonReleaseOutside;
mc_angle_up.onEnterFrame = function () {
if (this._parent.was_submitted == true) {
return(undefined);
}
_root.EnterFrameRoll(this, "raise angle");
if ((this.is_pressed == false) || (this.is_pressed == undefined)) {
return(undefined);
}
var _local3 = mc_but_power._rotation + 1;
if (_local3 > -90) {
mc_but_power._rotation = -90;
} else {
mc_but_power._rotation = _local3;
}
RefreshInfo();
};
com.gamebrew.Common.MovieFilterClear(mc_angle_down);
mc_angle_down.onRollOver = _root.ButtonOver;
mc_angle_down.onRollOut = _root.ButtonOut;
mc_angle_down.onPress = _root.ButtonPress;
mc_angle_down.onRelease = _root.ButtonRelease;
mc_angle_down.onReleaseOutside = _root.ButtonReleaseOutside;
mc_angle_down.onEnterFrame = function () {
if (this._parent.was_submitted == true) {
return(undefined);
}
_root.EnterFrameRoll(this, "lower angle");
if ((this.is_pressed == false) || (this.is_pressed == undefined)) {
return(undefined);
}
var _local3 = mc_but_power._rotation - 1;
if (_local3 < -180) {
mc_but_power._rotation = -180;
} else {
mc_but_power._rotation = _local3;
}
RefreshInfo();
};
com.gamebrew.Common.MovieFilterClear(mc_but_power);
mc_but_power.mc_but_power_up.onRollOver = _root.ButtonOver;
mc_but_power.mc_but_power_up.onRollOut = _root.ButtonOut;
mc_but_power.mc_but_power_up.onPress = _root.ButtonPress;
mc_but_power.mc_but_power_up.onRelease = _root.ButtonRelease;
mc_but_power.mc_but_power_up.onReleaseOutside = _root.ButtonReleaseOutside;
mc_but_power.mc_but_power_up.onEnterFrame = function () {
if (this._parent._parent.was_submitted == true) {
return(undefined);
}
_root.EnterFrameRoll(this, "increase power");
if ((this.is_pressed == false) || (this.is_pressed == undefined)) {
return(undefined);
}
this._parent.mc_but_power_drag._x++;
if (this._parent.mc_but_power_drag._x > this._parent.mc_but_power_drag.MAX_POWER_LOC) {
this._parent.mc_but_power_drag._x = this._parent.mc_but_power_drag.MAX_POWER_LOC;
}
RefreshInfo();
};
mc_but_power.mc_but_power_down.transform.colorTransform = new flash.geom.ColorTransform(1, 1, 1, 1, 0, 0, 0, 0);
mc_but_power.mc_but_power_down.onRollOver = _root.ButtonOver;
mc_but_power.mc_but_power_down.onRollOut = _root.ButtonOut;
mc_but_power.mc_but_power_down.onPress = _root.ButtonPress;
mc_but_power.mc_but_power_down.onRelease = _root.ButtonRelease;
mc_but_power.mc_but_power_down.onReleaseOutside = _root.ButtonReleaseOutside;
mc_but_power.mc_but_power_down.onEnterFrame = function () {
if (this._parent._parent.was_submitted == true) {
return(undefined);
}
_root.EnterFrameRoll(this, "decrease power");
if ((this.is_pressed == false) || (this.is_pressed == undefined)) {
return(undefined);
}
this._parent.mc_but_power_drag._x--;
if (this._parent.mc_but_power_drag._x < this._parent.mc_but_power_drag.MIN_POWER_LOC) {
this._parent.mc_but_power_drag._x = this._parent.mc_but_power_drag.MIN_POWER_LOC;
}
RefreshInfo();
};
mc_but_power.mc_but_power_drag.transform.colorTransform = new flash.geom.ColorTransform(1, 1, 1, 1, 0, 0, 0, 0);
mc_but_power.mc_but_power_drag.onRollOver = _root.ButtonOver;
mc_but_power.mc_but_power_drag.onRollOut = _root.ButtonOut;
mc_but_power.mc_but_power_drag.onPress = _root.ButtonPress;
mc_but_power.mc_but_power_drag.onRelease = _root.ButtonRelease;
mc_but_power.mc_but_power_drag.onReleaseOutside = _root.ButtonReleaseOutside;
mc_but_power.mc_but_power_drag.onEnterFrame = function () {
if (this._parent._parent.was_submitted == true) {
return(undefined);
}
_root.EnterFrameRoll(this, "drag to adjust");
if ((this.is_pressed == false) || (this.is_pressed == undefined)) {
return(undefined);
}
var _local3 = {x:0, y:0};
this._parent.localToGlobal(_local3);
if (_root._xmouse > _local3.x) {
this._parent._rotation = -90;
} else if (_root._ymouse > _local3.y) {
this._parent._rotation = -180;
} else {
this._parent._rotation = com.gamebrew.Common.CalcAngleFromPoints(_local3.x, _local3.y, _root._xmouse, _root._ymouse) - 90;
}
var _local4 = com.gamebrew.Common.CalcDistance(_local3.x, _local3.y, _root._xmouse, _root._ymouse);
if (_local4 < this.MIN_POWER_LOC) {
this._x = this.MIN_POWER_LOC;
} else if (_local4 > this.MAX_POWER_LOC) {
this._x = this.MAX_POWER_LOC;
} else {
this._x = _local4;
}
RefreshInfo();
};
EnableDirButtons();
com.gamebrew.Common.MovieFilterClear(mc_but_fire);
mc_but_fire.onRollOver = function () {
if (this._parent.was_submitted == true) {
return(undefined);
}
_root.ButtonRollOver(this, "fire and end turn");
};
mc_but_fire.onRollOut = function () {
if (this._parent.was_submitted == true) {
return(undefined);
}
_root.ButtonRollOut(this);
};
mc_but_fire.onRelease = function () {
this._parent.StartFire(true);
};
}
stop();
this.was_submitted = false;
this.val_pos = 0;
this.val_angle = 0;
this.val_power = 0;
txt_angle_old.text = "0\u00B0\n0+";
mc_but_power.mc_but_power_drag.MIN_POWER_LOC = 26;
mc_but_power.mc_but_power_drag.MAX_POWER_LOC = 97;
RefreshInfo();
DisableGrayAll();
Symbol 327 MovieClip [mc_controls_right] Frame 1
function RefreshInfo() {
val_angle = int(mc_but_power._rotation * -1);
val_power = int(((mc_but_power.mc_but_power_drag._x - mc_but_power.mc_but_power_drag.MIN_POWER_LOC) / (mc_but_power.mc_but_power_drag.MAX_POWER_LOC - mc_but_power.mc_but_power_drag.MIN_POWER_LOC)) * 100);
if (val_power < 1) {
val_power = 1;
} else if (val_power > 99) {
val_power = 99;
}
txt_angle.text = ((val_angle + "\u00B0\n") + val_power) + "+";
}
function SetToPlayer() {
mc_but_power._rotation = -_root.player.user.angle;
mc_but_power.mc_but_power_drag._x = mc_but_power.mc_but_power_drag.MIN_POWER_LOC + ((_root.player.user.power / 99) * (mc_but_power.mc_but_power_drag.MAX_POWER_LOC - mc_but_power.mc_but_power_drag.MIN_POWER_LOC));
RefreshInfo();
}
function StartFire(did_submit) {
if (was_submitted) {
return(undefined);
}
was_submitted = true;
DisableAll();
RefreshInfo();
com.gamebrew.Common.MovieFilterGrayScale(mc_but_power);
com.gamebrew.Common.MovieFilterGrayScale(mc_angle_up);
com.gamebrew.Common.MovieFilterGrayScale(mc_angle_down);
com.gamebrew.Common.MovieFilterGrayScale(mc_but_move);
if ((val_pos == -1) || (val_pos == 0)) {
com.gamebrew.Common.MovieFilterGrayScale(mc_but_move_right);
} else if ((val_pos == 1) || (val_pos == 0)) {
com.gamebrew.Common.MovieFilterGrayScale(mc_but_move_left);
}
_root.ClearTooltip(null);
if (did_submit == true) {
txt_angle_old.text = txt_angle.text;
com.gamebrew.Common.SoundPlay("longbloop.wav");
mc_but_fire.transform.colorTransform = new flash.geom.ColorTransform(1, 1, 0.25, 1, 0, 0, 0, 0);
if (_root.game_type == 1) {
_root.mu.sendRequest("game.move", (((("&pos=" + ((val_pos == _root.player.user.pos) ? 0 : (val_pos))) + "&angle=") + val_angle) + "&power=") + val_power);
} else {
_root.AiRun(true);
}
} else if (_root.game_type == 1) {
_root.mu.sendRequest("game.move");
} else {
_root.AiRun(false);
}
}
function DisableGrayAll() {
com.gamebrew.Common.MovieFilterGrayScale(this.mc_but_power);
com.gamebrew.Common.MovieFilterGrayScale(this.mc_angle_up);
com.gamebrew.Common.MovieFilterGrayScale(this.mc_angle_down);
com.gamebrew.Common.MovieFilterGrayScale(this.mc_but_move);
com.gamebrew.Common.MovieFilterGrayScale(this.mc_but_move_right);
com.gamebrew.Common.MovieFilterGrayScale(this.mc_but_move_left);
com.gamebrew.Common.MovieFilterGrayScale(this.mc_but_fire);
DisableAll();
}
function DisableAll() {
Key.removeListener(this);
this.was_submitted = true;
_root.ButtonDisable(this.mc_angle_up);
_root.ButtonDisable(this.mc_angle_down);
_root.ButtonDisable(this.mc_but_power.mc_but_power_up);
_root.ButtonDisable(this.mc_but_power.mc_but_power_down);
_root.ButtonDisable(this.mc_but_power.mc_but_power_drag);
_root.ButtonDisable(this.mc_but_move);
_root.ButtonDisable(this.mc_but_move_left);
_root.ButtonDisable(this.mc_but_move_right);
_root.ButtonDisable(this.mc_but_fire);
}
function EnableMoveButton() {
com.gamebrew.Common.MovieFilterClear(mc_but_move);
mc_but_move.onRollOver = function () {
if (this._parent.was_submitted == true) {
return(undefined);
}
_root.ButtonRollOver(this, "abort move");
};
mc_but_move.onRollOut = function () {
if (this._parent.was_submitted == true) {
return(undefined);
}
_root.ButtonRollOut(this);
};
mc_but_move.onRelease = function () {
if (this._parent.was_submitted == true) {
return(undefined);
}
com.gamebrew.Common.SoundPlay("click.wav");
EnableDirButtons();
_root.ClearTooltip();
};
}
function EnableDirButtons() {
val_pos = _root.player.user.pos;
com.gamebrew.Common.MovieFilterGrayScale(mc_but_move);
_root.ButtonDisable(mc_but_move);
if (val_pos != -1) {
com.gamebrew.Common.MovieFilterClear(mc_but_move_left);
mc_but_move_left.onRollOver = function () {
if ((this._parent.was_submitted == true) || (this._parent.val_pos == -1)) {
return(undefined);
}
_root.ButtonRollOver(this, "move left");
};
mc_but_move_left.onRollOut = function () {
if ((this._parent.was_submitted == true) || (this._parent.val_pos == -1)) {
return(undefined);
}
_root.ButtonRollOut(this);
};
mc_but_move_left.onRelease = function () {
if ((this._parent.was_submitted == true) || (this._parent.val_pos == -1)) {
return(undefined);
}
this.transform.colorTransform = new flash.geom.ColorTransform(1, 1, 0.25, 1, 0, 0, 0, 0);
this._parent.val_pos = -1;
this._parent.EnableMoveButton();
com.gamebrew.Common.SoundPlay("click.wav");
_root.ClearTooltip();
};
} else {
com.gamebrew.Common.MovieFilterGrayScale(mc_but_move_left);
}
if (val_pos != 1) {
com.gamebrew.Common.MovieFilterClear(mc_but_move_right);
mc_but_move_right.onRollOver = function () {
if ((this._parent.was_submitted == true) || (this._parent.val_pos == 1)) {
return(undefined);
}
_root.ButtonRollOver(this, "move right");
};
mc_but_move_right.onRollOut = function () {
if ((this._parent.was_submitted == true) || (this._parent.val_pos == 1)) {
return(undefined);
}
_root.ButtonRollOut(this);
};
mc_but_move_right.onRelease = function () {
if ((this._parent.was_submitted == true) || (this._parent.val_pos == 1)) {
return(undefined);
}
this.transform.colorTransform = new flash.geom.ColorTransform(1, 1, 0.25, 1, 0, 0, 0, 0);
this._parent.val_pos = 1;
this._parent.EnableMoveButton();
com.gamebrew.Common.SoundPlay("click.wav");
_root.ClearTooltip();
};
} else {
com.gamebrew.Common.MovieFilterGrayScale(mc_but_move_right);
}
}
function EnableAll() {
this.was_submitted = false;
this.onKeyDown = function () {
if (this._parent.was_submitted == true) {
return(undefined);
}
if (Key.isDown(37)) {
var _local2 = mc_but_power._rotation - 1;
if (_local2 < -90) {
mc_but_power._rotation = -90;
} else {
mc_but_power._rotation = _local2;
}
} else if (Key.isDown(39)) {
var _local2 = mc_but_power._rotation + 1;
if (_local2 > 0) {
mc_but_power._rotation = 0;
} else {
mc_but_power._rotation = _local2;
}
} else if (Key.isDown(38)) {
mc_but_power.mc_but_power_drag._x++;
if (mc_but_power.mc_but_power_drag._x > mc_but_power.mc_but_power_drag.MAX_POWER_LOC) {
mc_but_power.mc_but_power_drag._x = mc_but_power.mc_but_power_drag.MAX_POWER_LOC;
}
} else if (Key.isDown(40)) {
mc_but_power.mc_but_power_drag._x--;
if (mc_but_power.mc_but_power_drag._x < mc_but_power.mc_but_power_drag.MIN_POWER_LOC) {
mc_but_power.mc_but_power_drag._x = mc_but_power.mc_but_power_drag.MIN_POWER_LOC;
}
} else if (Key.isDown(17)) {
StartFire(true);
}
RefreshInfo();
};
Key.addListener(this);
com.gamebrew.Common.MovieFilterClear(mc_angle_up);
mc_angle_up.onRollOver = _root.ButtonOver;
mc_angle_up.onRollOut = _root.ButtonOut;
mc_angle_up.onPress = _root.ButtonPress;
mc_angle_up.onRelease = _root.ButtonRelease;
mc_angle_up.onReleaseOutside = _root.ButtonReleaseOutside;
mc_angle_up.onEnterFrame = function () {
if (this._parent.was_submitted == true) {
return(undefined);
}
_root.EnterFrameRoll(this, "raise angle");
if ((this.is_pressed == false) || (this.is_pressed == undefined)) {
return(undefined);
}
mc_but_power._rotation--;
if (mc_but_power._rotation < -90) {
mc_but_power._rotation = -90;
}
RefreshInfo();
};
com.gamebrew.Common.MovieFilterClear(mc_angle_down);
mc_angle_down.onRollOver = _root.ButtonOver;
mc_angle_down.onRollOut = _root.ButtonOut;
mc_angle_down.onPress = _root.ButtonPress;
mc_angle_down.onRelease = _root.ButtonRelease;
mc_angle_down.onReleaseOutside = _root.ButtonReleaseOutside;
mc_angle_down.onEnterFrame = function () {
if (this._parent.was_submitted == true) {
return(undefined);
}
_root.EnterFrameRoll(this, "lower angle");
if ((this.is_pressed == false) || (this.is_pressed == undefined)) {
return(undefined);
}
mc_but_power._rotation++;
if (mc_but_power._rotation > 0) {
mc_but_power._rotation = 0;
}
RefreshInfo();
};
com.gamebrew.Common.MovieFilterClear(mc_but_power);
mc_but_power.mc_but_power_up.onRollOver = _root.ButtonOver;
mc_but_power.mc_but_power_up.onRollOut = _root.ButtonOut;
mc_but_power.mc_but_power_up.onPress = _root.ButtonPress;
mc_but_power.mc_but_power_up.onRelease = _root.ButtonRelease;
mc_but_power.mc_but_power_up.onReleaseOutside = _root.ButtonReleaseOutside;
mc_but_power.mc_but_power_up.onEnterFrame = function () {
if (this._parent._parent.was_submitted == true) {
return(undefined);
}
_root.EnterFrameRoll(this, "increase power");
if ((this.is_pressed == false) || (this.is_pressed == undefined)) {
return(undefined);
}
this._parent.mc_but_power_drag._x++;
if (this._parent.mc_but_power_drag._x > this._parent.mc_but_power_drag.MAX_POWER_LOC) {
this._parent.mc_but_power_drag._x = this._parent.mc_but_power_drag.MAX_POWER_LOC;
}
RefreshInfo();
};
mc_but_power.mc_but_power_down.transform.colorTransform = new flash.geom.ColorTransform(1, 1, 1, 1, 0, 0, 0, 0);
mc_but_power.mc_but_power_down.onRollOver = _root.ButtonOver;
mc_but_power.mc_but_power_down.onRollOut = _root.ButtonOut;
mc_but_power.mc_but_power_down.onPress = _root.ButtonPress;
mc_but_power.mc_but_power_down.onRelease = _root.ButtonRelease;
mc_but_power.mc_but_power_down.onReleaseOutside = _root.ButtonReleaseOutside;
mc_but_power.mc_but_power_down.onEnterFrame = function () {
if (this._parent._parent.was_submitted == true) {
return(undefined);
}
_root.EnterFrameRoll(this, "decrease power");
if ((this.is_pressed == false) || (this.is_pressed == undefined)) {
return(undefined);
}
this._parent.mc_but_power_drag._x--;
if (this._parent.mc_but_power_drag._x < this._parent.mc_but_power_drag.MIN_POWER_LOC) {
this._parent.mc_but_power_drag._x = this._parent.mc_but_power_drag.MIN_POWER_LOC;
}
RefreshInfo();
};
mc_but_power.mc_but_power_drag.transform.colorTransform = new flash.geom.ColorTransform(1, 1, 1, 1, 0, 0, 0, 0);
mc_but_power.mc_but_power_drag.onRollOver = _root.ButtonOver;
mc_but_power.mc_but_power_drag.onRollOut = _root.ButtonOut;
mc_but_power.mc_but_power_drag.onPress = _root.ButtonPress;
mc_but_power.mc_but_power_drag.onRelease = _root.ButtonRelease;
mc_but_power.mc_but_power_drag.onReleaseOutside = _root.ButtonReleaseOutside;
mc_but_power.mc_but_power_drag.onEnterFrame = function () {
if (this._parent._parent.was_submitted == true) {
return(undefined);
}
_root.EnterFrameRoll(this, "drag to adjust");
if ((this.is_pressed == false) || (this.is_pressed == undefined)) {
return(undefined);
}
var _local3 = {x:0, y:0};
this._parent.localToGlobal(_local3);
if (_root._xmouse < _local3.x) {
this._parent._rotation = -90;
} else if (_root._ymouse > _local3.y) {
this._parent._rotation = 0;
} else {
this._parent._rotation = com.gamebrew.Common.CalcAngleFromPoints(_local3.x, _local3.y, _root._xmouse, _root._ymouse) - 90;
}
var _local4 = com.gamebrew.Common.CalcDistance(_local3.x, _local3.y, _root._xmouse, _root._ymouse);
if (_local4 < this.MIN_POWER_LOC) {
this._x = this.MIN_POWER_LOC;
} else if (_local4 > this.MAX_POWER_LOC) {
this._x = this.MAX_POWER_LOC;
} else {
this._x = _local4;
}
RefreshInfo();
};
EnableDirButtons();
com.gamebrew.Common.MovieFilterClear(mc_but_fire);
mc_but_fire.onRollOver = function () {
if (this._parent.was_submitted == true) {
return(undefined);
}
_root.ButtonRollOver(this, "fire and end turn");
};
mc_but_fire.onRollOut = function () {
if (this._parent.was_submitted == true) {
return(undefined);
}
_root.ButtonRollOut(this);
};
mc_but_fire.onRelease = function () {
this._parent.StartFire(true);
};
}
stop();
this.was_submitted = false;
this.val_pos = 0;
this.val_angle = 0;
this.val_power = 0;
txt_angle_old.text = "0\u00B0\n0+";
mc_but_power.mc_but_power_drag.MIN_POWER_LOC = 26;
mc_but_power.mc_but_power_drag.MAX_POWER_LOC = 97;
RefreshInfo();
DisableGrayAll();
Symbol 331 MovieClip [mc_marker] Frame 1
txt.text = this.new_text;
txt.backgroundColor = 16777113 /* 0xFFFF99 */;
txt.borderColor = 3355443 /* 0x333333 */;
txt.autoSize = "left";
txt.selectable = false;
txt._visible = false;
this.frames = 0;
this.onEnterFrame = function () {
this.frames++;
if (this.frames == 20) {
txt._visible = true;
} else if (this.frames > (20 + (txt.text.length * 4))) {
delete this.onEnterFrame;
_root[this._name].removeMovieClip();
}
};
Symbol 331 MovieClip [mc_marker] Frame 60
_root[_name].removeMovieClip();
Symbol 337 MovieClip [mc_menu] Frame 1
function Enable() {
com.gamebrew.Common.MovieFilterClear(mc_but_quit);
mc_but_quit.onRollOver = function () {
_root.ButtonRollOver(this, "had enough?");
};
mc_but_quit.onRollOut = function () {
_root.ButtonRollOut(this);
};
mc_but_quit.onRelease = function () {
Disable();
com.gamebrew.Common.SoundPlay("click.wav");
_root.mu.leaveRoom();
_root.GotoEnding("Game Over");
};
}
function Disable() {
com.gamebrew.Common.MovieFilterGrayScale(mc_but_quit);
_root.ButtonDisable(mc_but_quit);
ClearTimer(null);
}
function StartTimer() {
ClearTimer(null);
timer_secs = _root.TURN_SECS;
timer_id = setInterval(this, "UpdateTimer", 1000);
UpdateTimer();
}
function UpdateTimer() {
if (timer_secs < 0) {
return(undefined);
}
timer_secs--;
if (timer_secs == 0) {
timer_secs = -1;
if (_root.player.is_dead == true) {
ClearTimer("game over");
if (_root.game_type == 1) {
delete _root.mu.onGameCommand;
_root.mu.leaveRoom();
_root.GotoEnding("Game Over");
}
} else if (_root.mc_controls.was_submitted == false) {
ClearTimer("skipping turn");
_root.mc_controls.StartFire(false);
} else {
ClearTimer("waiting for turn");
}
} else if (_root.player.is_dead == true) {
txt_secs.text = ("leaving in " + timer_secs) + " seconds";
} else if (_root.mc_controls.was_submitted == true) {
txt_secs.text = ("waiting others in " + timer_secs) + " seconds";
} else {
txt_secs.text = ("next turn in " + timer_secs) + " seconds";
}
}
function ClearTimer(str) {
if (timer_id != null) {
clearInterval(timer_id);
}
timer_id = null;
if (str != null) {
txt_secs.text = str;
}
}
stop();
timer_id = null;
timer_secs = 0;
Enable();
if (timer_start == true) {
StartTimer();
}
Symbol 343 MovieClip [mc_caption] Frame 50
txt_caption.selectable = false;
_root[_name].removeMovieClip();
Symbol 347 MovieClip [mc_status] Frame 40
stop();
_root[_name].removeMovieClip();
Symbol 358 MovieClip [mc_win_end_kong] Frame 1
stop();
if (_root.player.user == null) {
txt_name.text = "Unknown";
txt_kills.text = 0;
} else {
txt_name.text = _root.kongregate_username;
if (_root.player.user.score > 0) {
txt_score.text = _root.player.user.score;
if (_root.player.user.score >= 3) {
if (_root.game_type == 0) {
_root.kongregateScores.setMode("Arcade");
} else {
_root.kongregateScores.setMode("Multiplayer");
}
_root.kongregateScores.submit(_root.player.user.score);
}
} else {
txt_score.text = 0;
}
}
if (arg_title == "Disconnected") {
gotoAndStop (2);
}
mc_but_scores.onRollOver = function () {
_root.ButtonRollOver(this, "");
};
mc_but_scores.onRollOut = function () {
_root.ButtonRollOut(this);
};
mc_but_scores.onRelease = function () {
com.gamebrew.Common.SoundPlay("click.wav");
if (_root.game_type == 0) {
_root.getURL(_root.KONG_SCORE_URL_1P, "_blank");
} else {
_root.getURL(_root.KONG_SCORE_URL_LIVE, "_blank");
}
};
mc_but_close.onRollOver = function () {
_root.ButtonRollOver(this, "");
};
mc_but_close.onRollOut = function () {
_root.ButtonRollOut(this);
};
mc_but_close.onRelease = function () {
com.gamebrew.Common.SoundPlay("click.wav");
_root.GotoMenu();
};
Symbol 376 MovieClip [mc_win_end] Frame 1
function SetRank(txtfld, amt) {
if (amt == 0) {
txtfld.text = "Unchanged";
} else if ((amt == -1) || (amt > 125)) {
txtfld.text = "Below 100";
} else {
var _local1 = com.gamebrew.Common.StringNumberRank(amt);
if (amt == 1) {
_local1 = _local1 + " Gold";
} else if (amt <= 3) {
_local1 = _local1 + " Silver";
} else if (amt <= 7) {
_local1 = _local1 + " Bronze";
} else {
_local1 = _local1 + " Place";
}
txtfld.text = _local1;
}
}
_root.micro = _root.player.user.score;
stop();
if (_root.player.user == null) {
txt_name.text = "Unknown";
txt_kills.text = 0;
} else {
txt_name.text = _root.player.user.user_name;
if (_root.player.user.score > 0) {
txt_kills.text = _root.player.user.score;
} else {
txt_kills.text = 0;
}
}
if (arg_title == "Disconnected") {
gotoAndStop (2);
}
if ((_root.player.user.score < 3) || (_root.player.user.score > ((_root.rounds + 1) * 9))) {
txt_msg.text = "Cannot Submit Score";
txt_rank_99999.text = "Unranked";
txt_rank_30.text = "Unranked";
txt_rank_7.text = "Unranked";
txt_rank_1.text = "Unranked";
com.gamebrew.Common.MovieFilterGrayScale(mc_but_submit);
} else {
txt_msg.text = "Submit Your Score";
txt_rank_99999.text = "Unknown";
txt_rank_30.text = "Unknown";
txt_rank_7.text = "Unknown";
txt_rank_1.text = "Unknown";
mc_but_submit.onRollOver = function () {
_root.ButtonRollOver(this, "");
};
mc_but_submit.onRollOut = function () {
_root.ButtonRollOut(this);
};
mc_but_submit.onRelease = function () {
com.gamebrew.Common.SoundPlay("click.wav");
com.gamebrew.Common.MovieFilterGrayScale(this);
_root.ButtonDisable(this);
txt_msg.text = "Sending Your Score";
txt_rank_99999.text = "Sending";
txt_rank_30.text = "Sending";
txt_rank_7.text = "Sending";
txt_rank_1.text = "Sending";
_global.ipbSend();
var _local7 = new LoadVars();
_local7.onLoad = function (success) {
if (success) {
if (this.success == 0) {
success = false;
} else if (this.rank_99999 == undefined) {
success = false;
} else {
txt_msg.text = "Score Was Submitted";
com.gamebrew.Common.SoundPlay("shortbloop.wav");
SetRank(txt_rank_99999, this.rank_99999);
SetRank(txt_rank_30, this.rank_30);
SetRank(txt_rank_7, this.rank_7);
SetRank(txt_rank_1, this.rank_1);
}
}
if (!success) {
com.gamebrew.Common.SoundPlay("error.wav");
txt_msg.text = this.message;
txt_rank_99999.text = "Failed";
txt_rank_30.text = "Failed";
txt_rank_7.text = "Failed";
txt_rank_1.text = "Failed";
trace(unescape(this));
}
};
var _local5 = _root.player.user.user_name;
if (com.gamebrew.Common.StringContains(_local5, "-")) {
_local5 = _local5.substr(0, _local5.lastIndexOf("-"));
}
var _local4 = "";
_local4 = _local4 + ("&g=" + _root.GB_GAME_ID);
_local4 = _local4 + ("&v=" + _root.GB_SCORE_VERSION);
_local4 = _local4 + ("&m=" + _root.game_type);
_local4 = _local4 + ("&nm=" + _local5);
_local4 = _local4 + ("&sc=" + _root.player.user.score);
_local4 = _local4 + ("&dat=" + com.gamebrew.Base64.encode((("&kills=" + _root.player.user.kills) + "&rounds=") + _root.rounds));
var _local6 = new LoadVars();
_local6.cmd = "hiscore.save";
_local6.cd = com.gamebrew.Base64.encode(_local4);
_local6.sendAndLoad(_root.GB_SCORE_CGI, _local7, "POST");
};
}
mc_but_close.onRollOver = function () {
_root.ButtonRollOver(this, "");
};
mc_but_close.onRollOut = function () {
_root.ButtonRollOut(this);
};
mc_but_close.onRelease = function () {
com.gamebrew.Common.SoundPlay("click.wav");
_root.GotoMenu();
};
Symbol 393 MovieClip [mc_win_help] Frame 1
stop();
mc_but_close.onRollOver = function () {
_root.ButtonRollOver(this);
};
mc_but_close.onRollOut = function () {
_root.ButtonRollOut(this);
};
mc_but_close.onRelease = function () {
com.gamebrew.Common.SoundPlay("click.wav");
_root.EnableMainMenu();
_root.CloseWindow();
};
mc_but_next.onRollOver = function () {
_root.ButtonRollOver(this);
};
mc_but_next.onRollOut = function () {
_root.ButtonRollOut(this);
};
mc_but_next.onRelease = function () {
gotoAndStop ("help2");
com.gamebrew.Common.SoundPlay("click.wav");
};
com.gamebrew.Common.MovieFilterGrayScale(mc_but_back);
com.gamebrew.Common.MovieFilterClear(mc_but_next);
_root.ButtonDisable(mc_but_back);
Symbol 393 MovieClip [mc_win_help] Frame 10
mc_but_back.onRollOver = function () {
_root.ButtonRollOver(this);
};
mc_but_back.onRollOut = function () {
_root.ButtonRollOut(this);
};
mc_but_back.onRelease = function () {
gotoAndStop ("help1");
com.gamebrew.Common.SoundPlay("click.wav");
};
com.gamebrew.Common.MovieFilterGrayScale(mc_but_next);
com.gamebrew.Common.MovieFilterClear(mc_but_back);
_root.ButtonDisable(mc_but_next);
Symbol 400 MovieClip [mc_win_connect] Frame 1
stop();
mc_but_close.onRollOver = function () {
_root.ButtonRollOver(this);
};
mc_but_close.onRollOut = function () {
_root.ButtonRollOut(this);
};
mc_but_close.onRelease = function () {
delete _root.mu.onGameCommand;
delete _root.mu.onDisconnect;
delete _root.mu.onInfo;
delete _root.mu.onLogin;
delete _root.mu.onLoginRedirect;
delete this.onRelease;
_root.mu.disconnect();
com.gamebrew.Common.MovieFilterGrayScale(this);
com.gamebrew.Common.SoundPlay("click.wav");
_root.EnableMainMenu();
_root.CloseWindow();
};
_root.mc_win.txt.text = "Connecting to server";
_root.mu.onConnect = function (success) {
if (!success) {
_root.mc_win.txt.text = _root.mc_win.txt.text + "\nServer unavailable try again later";
} else {
_root.mc_win.txt.text = _root.mc_win.txt.text + "\nConnection succeeded";
}
};
_root.mu.onDisconnect = function (message) {
_root.mc_win.txt.text = _root.mc_win.txt.text + (newline + message);
};
_root.mu.onInfo = function (cmd, ok, vars) {
_root.mc_win.txt.text = _root.mc_win.txt.text + (newline + vars.msg);
};
_root.mu.onLogin = function (uid, nm) {
_root.mu.sendRequest("game.init", "&color=" + _root.color_id);
if (_root.mu_type == 0) {
_root.mc_win.txt.text = _root.mc_win.txt.text + "\nWaiting for an open game";
_root.mu.sendRequest("game.join.auto", "");
} else if (_root.mu_type == 1) {
_root.mu.setPaused(true);
_root.mu.sendRequest("game.join.team", "");
_root.OpenWindow("mc_win_team");
}
};
_root.mu.onLoginRedirect = function (ip) {
_root.mc_win.txt.text = _root.mc_win.txt.text + "\nRedirecting to another server";
this.server_ip = ip;
_root.mu.login(_root.GB_ZONE_NAME, _root.GB_ZONE_VERSION, _root.gb_name);
};
_root.mu.onGameCommand = function (cmd, vars) {
if (cmd == "game.join.auto") {
_root.mu.setPaused(true);
_root.FadeOutIn(0, 0, _root.GotoMu);
}
};
_root.mu.login(_root.GB_ZONE_NAME, _root.GB_ZONE_VERSION, _root.gb_name);
Symbol 407 MovieClip [mc_win_webmasters] Frame 1
stop();
mc_but_close.onRollOver = function () {
_root.ButtonRollOver(this);
};
mc_but_close.onRollOut = function () {
_root.ButtonRollOut(this);
};
mc_but_close.onRelease = function () {
com.gamebrew.Common.SoundPlay("click.wav");
_root.EnableMainMenu();
_root.CloseWindow();
};
Symbol 417 MovieClip [mc_win_credits] Frame 1
stop();
mc_but_close.onRollOver = function () {
_root.ButtonRollOver(this);
};
mc_but_close.onRollOut = function () {
_root.ButtonRollOut(this);
};
mc_but_close.onRelease = function () {
com.gamebrew.Common.SoundPlay("click.wav");
_root.EnableMainMenu();
_root.CloseWindow();
};
Symbol 423 MovieClip [mc_team] Frame 1
stop();
Symbol 423 MovieClip [mc_team] Frame 2
stop();
Symbol 423 MovieClip [mc_team] Frame 3
stop();
Symbol 429 MovieClip [mc_body] Frame 1
stop();
Symbol 429 MovieClip [mc_body] Frame 5
gotoAndStop (1);
Symbol 437 MovieClip [mc_turret] Frame 1
stop();
Symbol 437 MovieClip [mc_turret] Frame 2
this._parent._y++;
pt = {x:0, y:0};
this.point.localToGlobal(pt);
tpt = {x:0, y:0};
this.localToGlobal(tpt);
d = com.gamebrew.Common.MovieGetNextDepthAt(_root, _root.GB_GAME_DEPTH);
mc = _root.attachMovie("mc_turret_fire", "mc_turret_fire" + d, d);
mc._rotation = this._rotation * (this._parent._xscale / 100);
mc._x = pt.x;
mc._y = pt.y;
d = com.gamebrew.Common.MovieGetNextDepthAt(_root, _root.GB_GAME_DEPTH);
mc = _root.attachMovie("mc_ammo", "mc_ammo_" + d, d);
mc._rotation = this._rotation * (this._parent._xscale / 100);
mc.owner = this._parent;
this._parent.ammo = mc;
mc._x = pt.x;
mc._y = pt.y;
mc.last_x = tpt.x;
mc.last_y = tpt.y;
mc.speed = com.gamebrew.Common.CalcAngle(mc._rotation);
mc.speed.x = mc.speed.x * this._parent.target_speed;
mc.speed.y = mc.speed.y * this._parent.target_speed;
mc.do_hit_dirt = false;
Symbol 437 MovieClip [mc_turret] Frame 7
this._parent._y--;
gotoAndStop (1);
Symbol 443 MovieClip Frame 1
stop();
Symbol 443 MovieClip Frame 5
gotoAndPlay ("move_left");
Symbol 443 MovieClip Frame 9
gotoAndPlay ("move_right");
Symbol 448 MovieClip Frame 1
stop();
Symbol 448 MovieClip Frame 5
gotoAndStop (1);
Symbol 473 MovieClip [mc_tank] Frame 1
function ProcessCommand(pos, angle, power) {
if (is_dead == true) {
return(undefined);
}
arg_pos = pos;
arg_angle = angle;
arg_power = power;
target_pos = arg_pos;
target_angle = 90 - arg_angle;
target_speed = 3 + (arg_power / 15);
target_x = _x + (pos * _root.TANK_MOVE);
ProcessMoving();
}
function ProcessMoving() {
if (current_pos == target_pos) {
ProcessFiring();
return(undefined);
}
if (_x != target_x) {
com.gamebrew.Common.SoundPlay("roll.wav");
if (_x > target_x) {
wheels.gotoAndPlay("move_left");
} else if (_x < target_x) {
wheels.gotoAndPlay("move_right");
}
}
onEnterFrame = function () {
var _local1 = false;
if (_x == target_x) {
_local1 = true;
} else if (_x > target_x) {
_x = (_x - 2);
if (_x <= target_x) {
_local1 = true;
}
} else if (_x < target_x) {
_x = (_x + 2);
if (_x >= target_x) {
_local1 = true;
}
}
if (_local1 == true) {
current_pos = target_pos;
_x = target_x;
wheels.gotoAndStop(1);
delete onEnterFrame;
ProcessFiring();
}
};
}
function ProcessFiring() {
if (turret._rotation != target_angle) {
com.gamebrew.Common.SoundPlay("turret.wav");
}
onEnterFrame = function () {
var _local1 = false;
if (turret._rotation == target_angle) {
_local1 = true;
} else if (turret._rotation > target_angle) {
turret._rotation = turret._rotation - 2;
if (turret._rotation <= target_angle) {
_local1 = true;
}
} else if (turret._rotation < target_angle) {
turret._rotation = turret._rotation + 2;
if (turret._rotation >= target_angle) {
_local1 = true;
}
}
if (_local1 == true) {
turret._rotation = target_angle;
body.gotoAndPlay("fire");
fire_ring.gotoAndPlay("fire");
turret.gotoAndPlay("fire");
delete onEnterFrame;
}
};
}
function AnimateDie() {
gotoAndPlay ("die");
}
function AnimateError() {
com.gamebrew.Common.SoundPlay("error.wav");
transform.colorTransform = new flash.geom.ColorTransform(1, 1, 1, 1, 255, 0, 0, 0);
onEnterFrame = function () {
var _local1 = transform.colorTransform.redOffset;
_local1 = _local1 - 8;
if (_local1 < 0) {
_local1 = 0;
delete onEnterFrame;
}
transform.colorTransform = new flash.geom.ColorTransform(1, 1, 1, 1, _local1, 0, 0, 0);
};
}
function AnimateBlock() {
transform.colorTransform = new flash.geom.ColorTransform(1, 1, 1, 1, 0, 255, 255, 0);
onEnterFrame = function () {
var _local1 = transform.colorTransform.blueOffset;
_local1 = _local1 - 32;
if (_local1 < 0) {
_local1 = 0;
delete onEnterFrame;
}
transform.colorTransform = new flash.geom.ColorTransform(1, 1, 1, 1, 0, _local1, _local1, 0);
};
}
function AnimateBonus() {
transform.colorTransform = new flash.geom.ColorTransform(1, 1, 1, 1, 255, 255, 255, 0);
onEnterFrame = function () {
var _local1 = transform.colorTransform.redOffset;
_local1 = _local1 - 24;
if (_local1 < 0) {
_local1 = 0;
delete onEnterFrame;
}
transform.colorTransform = new flash.geom.ColorTransform(1, 1, 1, 1, _local1, _local1, _local1, 0);
};
}
function UpdateStats(str) {
_root["txt_p" + user.slot].text = user.user_name;
if (str == null) {
if (user.armor == 0) {
_root[("txt_p" + user.slot) + "k"].text = "dead";
} else {
_root[("txt_p" + user.slot) + "k"].text = (((("kills " + user.kills) + " score ") + user.score) + "\narmor ") + user.armor;
}
} else {
_root[("txt_p" + user.slot) + "k"].text = str;
}
var _local2 = _root[("mc_p" + user.slot) + "a"];
_local2._visible = true;
_local2.gotoAndStop(user.armor + 1);
}
function ResultNoKill(str) {
if (this == _root.player) {
_root.OpenStatus(this, str);
}
var _local3 = 0;
while (_local3 < _root.players.length) {
if (_root.players[_local3].team_id != this.team_id) {
user.combo = 0;
break;
}
_local3++;
}
ProcessResult(0, 0);
}
function ResultBadKill(enemy) {
user.score--;
user.combo = 0;
enemy.AnimateError();
if (user.score < 0) {
user.score = 0;
}
if ((this == _root.player) || (this == enemy)) {
_root.OpenCaption("Friendly Fire!");
}
_root.OpenStatus(this, "score -1");
UpdateStats();
ProcessResult(0, -1);
}
function ResultAddKill(enemy) {
var _local4 = "";
_root.ai_change_wind = true;
user.combo++;
user.score = user.score + user.combo;
enemy.user.armor--;
if (enemy.user.armor > 0) {
enemy.UpdateStats();
if (this == _root.player) {
_local4 = _local4 + ("score +" + user.combo);
_root.OpenStatus(this, _local4);
_root.OpenCaption("Enemy Hit!");
} else if (enemy == _root.player) {
_root.OpenStatus(enemy, "damage!");
_root.OpenCaption("Armor Hit!");
}
enemy.AnimateBlock();
ProcessResult(0, user.combo, enemy);
UpdateStats();
return(undefined);
}
user.kills++;
if ((user.kills >= next_armor_bonus) && (user.armor < 3)) {
user.armor++;
next_armor_bonus = next_armor_bonus + 3;
if (this == _root.player) {
_local4 = _local4 + "armor +1\n";
com.gamebrew.Common.SoundPlay("bonus.wav");
AnimateBonus();
}
mc = _root[("mc_p" + user.slot) + "a"];
mc["a" + user.armor].gotoAndPlay("armor_bonus");
}
UpdateStats();
enemy.AnimateDie();
enemy.is_dead = true;
if (enemy.ammo == null) {
enemy.command_on = false;
}
enemy.UpdateStats("dead");
if (this == _root.player) {
_local4 = _local4 + ("score +" + user.combo);
_root.OpenCaption("Enemy Killed!");
_root.OpenStatus(this, _local4);
} else if (enemy == _root.player) {
_root.OpenCaption("Game Over!");
_root.OpenStatus(enemy, "dead");
_root.mc_controls.DisableGrayAll();
_root.mc_menu.ClearTimer("you have been destroyed");
}
UpdateStats();
ProcessResult(1, user.combo, enemy);
}
function ProcessResult(kill_add, score_add, enemy) {
if (arg_pos != 0) {
user.pos = arg_pos;
}
if (arg_angle != -1) {
user.angle = arg_angle;
}
if (arg_power != -1) {
user.power = arg_power;
}
command_on = false;
if (_root.AllTanksDone() == true) {
_root.mc_menu.ClearTimer("getting battle results");
if (_root.game_type == 1) {
_root.mu.sendRequest("game.result", (((("&kills=" + _root.player.user.kills) + "&score=") + _root.player.user.score) + "&armor=") + _root.player.user.armor);
} else {
_root.GameReady();
}
}
}
stop();
command_on = false;
next_armor_bonus = 3;
target_x = 0;
type = "tank";
if (user == null) {
turret._rotation = 45;
} else {
turret._rotation = 90 - user.angle;
}
team.gotoAndStop(team_id);
UpdateStats();
if (_root.player == this) {
_root.mc_controls.SetToPlayer();
_root.mc_controls.EnableAll();
}
Symbol 473 MovieClip [mc_tank] Frame 140
stop();
if (_root.game_type == 0) {
this.is_disconnected = true;
if (_root.player == this) {
_root.AddChat("System", 0, "You have been destroyed");
_root.mc_menu.ClearTimer("game over");
_root.GotoEnding("Game Over");
}
}
Symbol 557 MovieClip [__Packages.com.gamebrew.Common] Frame 0
class com.gamebrew.Common
{
function Common () {
}
static function ArrayClean(arr) {
if (arr.length == 0) {
return(arr);
}
var _local1 = 0;
while (_local1 < arr.length) {
if (arr[_local1] == null) {
arr.splice(_local1, 1);
_local1--;
}
_local1++;
}
return(arr);
}
static function ArrayClear(arr) {
arr.length = 0;
for (var _local2 in arr) {
delete arr[_local2];
}
}
static function ArrayPushUnique(arr, obj) {
var _local2 = arr.length;
var _local1 = 0;
while (_local1 < _local2) {
if (arr[_local1] == obj) {
return(undefined);
}
_local1++;
}
arr.push(obj);
}
static function ArrayContains(arr, obj) {
if (obj == null) {
return(false);
}
var _local2 = arr.length;
var _local1 = 0;
while (_local1 < _local2) {
if (arr[_local1] == obj) {
return(true);
}
_local1++;
}
return(false);
}
static function ArrayFind(arr, obj) {
if (obj == null) {
return(-1);
}
var _local2 = arr.length;
var _local1 = 0;
while (_local1 < _local2) {
if (arr[_local1] == obj) {
return(_local1);
}
_local1++;
}
return(-1);
}
static function ArrayClone(arr) {
var _local3 = new Array();
var _local1 = 0;
while (_local1 < arr.length) {
_local3.push(arr[_local1]);
_local1++;
}
return(_local3);
}
static function EnableTextField(txtfld, bool) {
if (bool == true) {
txtfld.type = "input";
txtfld.selectable = true;
} else {
txtfld.type = "dynamic";
txtfld.selectable = false;
}
}
static function SoundQueueAdd(lib) {
if ((sound_volume == 0) || (do_mute)) {
return(undefined);
}
var _local1 = 0;
while (_local1 < sound_queue.length) {
if (sound_queue[_local1] == lib) {
return(undefined);
}
_local1++;
}
sound_queue.push(lib);
}
static function SoundQueuePlay() {
if (((sound_volume == 0) || (sound_queue.length == 0)) || (do_mute)) {
return(undefined);
}
var _local1 = 0;
while (_local1 < sound_queue.length) {
SoundPlay(sound_queue[_local1]);
sound_queue[_local1] = null;
_local1++;
}
sound_queue = new Array();
}
static function SoundQueueClear() {
sound_queue = new Array();
}
static function SoundPlay(lib, func) {
if (((lib == null) || (sound_volume == 0)) || (do_mute)) {
return(undefined);
}
var _local1 = new Sound();
_local1.attachSound(lib);
_local1.setVolume(sound_volume);
if (func != null) {
_local1.onSoundComplete = func;
}
_local1.start();
return(_local1);
}
static function SoundGetVolume() {
return(sound_volume);
}
static function SoundSetVolume(vol) {
if ((sound_volume != 0) && (vol == 0)) {
sound_queue = new Array();
}
sound_volume = vol;
}
static function MusicSet(lib) {
music = lib;
}
static function MusicPlay() {
if (music_playing != null) {
MusicStop();
}
if ((((music_volume == 0) || (do_mute)) || (do_mute_music)) || (music == null)) {
return(undefined);
}
music_playing = new Sound();
music_playing.attachSound(music);
music_playing.setVolume(music_volume);
music_playing.start();
music_playing.onSoundComplete = function () {
this.start();
};
}
static function MusicStop() {
music_playing.onSoundComplete = null;
music_playing.stop();
delete music_playing;
music_playing = null;
}
static function MusicGetVolume() {
return(music_volume);
}
static function MusicSetVolume(vol) {
music_volume = vol;
if (music_playing != null) {
music_playing.setVolume(music_volume);
}
}
static function MusicGetMute() {
return(do_mute_music);
}
static function MusicSetMute(bool) {
do_mute_music = bool;
if (bool == true) {
MusicStop();
} else {
MusicPlay();
}
}
static function MuteSet(bool) {
if (bool == true) {
do_mute = true;
MusicStop();
SoundQueueClear();
_root.globalvolume = new Sound();
_root.globalvolume.setVolume(0);
} else {
do_mute = false;
_root.globalvolume = new Sound();
_root.globalvolume.setVolume(100);
MusicPlay();
}
}
static function MuteGet() {
return(do_mute);
}
static function SetCookie(nm, key, val) {
var _local1 = SharedObject.getLocal(nm);
_local1.data[key] = val;
_local1.flush();
}
static function GetCookie(nm, key, def) {
var _local2 = SharedObject.getLocal(nm);
var _local1 = _local2.data[key];
if ((_local1 == "") || (_local1 == undefined)) {
return(def);
}
return(_local1);
}
static function GetQueryString() {
var _local6 = _root._url;
var _local5 = new Object();
var _local4 = _local6.substring(_local6.lastIndexOf("?") + 1, _local6.length).split("&");
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2].split("=");
if (_local3[0].length == 0) {
} else {
_local5[_local3[0]] = _local3[1];
}
_local2++;
}
return(_local5);
}
static function GetHost() {
var _local3 = _root._url.split("/");
var _local2 = _local3[2];
if (_local2.indexOf("www.") == 0) {
_local2 = _local2.substr(4);
}
return(_local2);
}
static function ProtectUrl(domains) {
var _local5 = GetHost();
var _local4 = false;
var _local2 = 0;
while (_local2 < domains.length) {
var _local1 = domains[_local2];
if (_local1.indexOf("www.") == 0) {
_local1 = _local1.substr(4);
}
if (_local5 == _local1) {
_local4 = true;
break;
}
_local2++;
}
return(_local4);
}
static function GetUrlPath() {
var _local2 = _root._url;
_local2 = _local2.substr(0, _local2.lastIndexOf("/"));
return(_local2);
}
static function DrawRectangle(bd, c, x, y, w, h) {
var _local1 = x;
while (_local1 < (x + w)) {
bd.setPixel(_local1, y, c);
bd.setPixel(_local1, (y + h) - 1, c);
_local1++;
}
_local1 = y;
while (_local1 < (y + h)) {
bd.setPixel(x, _local1, c);
bd.setPixel((x + w) - 1, _local1, c);
_local1++;
}
}
static function FillRectangle(bd, c, x, y, w, h) {
bd.fillRect(new flash.geom.Rectangle(x, y, w, h), c);
}
static function DrawHLine(bd, c, x, y, w) {
var _local1 = x;
while (_local1 < (x + w)) {
bd.setPixel(_local1, y, c);
_local1++;
}
}
static function DrawVLine(bd, c, x, y, h) {
var _local1 = y;
while (_local1 < (y + h)) {
bd.setPixel(x, _local1, c);
_local1++;
}
}
static function DataFillRectangle(a, aw, ah, c, x, y, w, h) {
var _local2 = y;
while (_local2 < (y + h)) {
if ((_local2 < 0) || (_local2 >= ah)) {
} else {
var _local1 = x;
while (_local1 < (x + w)) {
if ((_local1 < 0) || (_local1 >= aw)) {
} else {
a[_local1 + (_local2 * aw)] = c;
}
_local1++;
}
}
_local2++;
}
}
static function DataCopyRectangle(ta, taw, tah, tx, ty, sa, saw, sah, sx, sy, sw, sh) {
var _local3 = 0;
while (_local3 < sh) {
var _local4 = _local3 + ty;
if ((_local4 >= tah) || (_local4 < 0)) {
} else {
var _local1 = 0;
while (_local1 < sw) {
var _local2 = _local1 + tx;
if ((_local2 >= taw) || (_local2 < 0)) {
} else {
ta[_local2 + (_local4 * taw)] = sa[(_local1 + sx) + ((_local3 + sy) * saw)];
}
_local1++;
}
}
_local3++;
}
}
static function GetFps() {
if (fps_signal == true) {
fps_time = getTimer();
} else {
fps_tempo = int(1000 / (getTimer() - fps_time));
}
fps_signal = !fps_signal;
return(fps_tempo);
}
static function NumberConfine(val, min, max) {
if (val < min) {
val = min;
} else if (val > max) {
val = max;
}
return(val);
}
static function NumberComma(n) {
var _local4 = n.toString();
var _local3 = _local4.split(".");
var _local1 = "";
var _local2 = _local3[0].length;
while (_local2--) {
if ((_local2 < (_local3[0].length - 1)) && ((((_local3[0].length - _local2) - 1) % 3) == 0)) {
_local1 = "," + _local1;
}
_local1 = _local3[0].substr(_local2, 1) + _local1;
}
if (_local3.length > 1) {
_local1 = _local1 + ("." + _local3[1]);
}
return(_local1);
}
static function NumberColor(r, g, b) {
if (r > 255) {
r = 255;
} else if (r < 0) {
r = 0;
}
if (g > 255) {
g = 255;
} else if (g < 0) {
g = 0;
}
if (b > 255) {
b = 255;
} else if (b < 0) {
b = 0;
}
return(((4278190080 | (r << 16)) | (g << 8)) | b);
}
static function NumberColorHex(r, g, b) {
return((("#" + r.toString(16)) + g.toString(16)) + b.toString(16));
}
static function RandomInteger(min, max) {
if ((min == max) || (max < min)) {
return(min);
}
return(int(Math.random() * ((max - min) + 1)) + min);
}
static function RandomNumber(min, max) {
if ((min == max) || (max < min)) {
return(min);
}
return((Math.random() * ((max - min) + 1)) + min);
}
static function RandomBit() {
return(int(Math.random() * 2));
}
static function StringUpperCaseFirst(str) {
return(str.substring(0, 1).toUpperCase() + str.substring(1, str.length));
}
static function StringReplace(str, pattern, replacement) {
return(str.split(pattern).join(replacement));
}
static function StringTrimLeft(s) {
var _local4 = 9;
var _local3 = 10;
var _local5 = 13;
var _local6 = 32;
var _local1 = 0;
while ((((s.charCodeAt(_local1) == _local6) || (s.charCodeAt(_local1) == _local5)) || (s.charCodeAt(_local1) == _local3)) || (s.charCodeAt(_local1) == _local4)) {
_local1++;
}
return(s.substring(_local1, s.length));
}
static function StringTrimRight(s) {
var _local4 = 9;
var _local3 = 10;
var _local5 = 13;
var _local6 = 32;
var _local1 = s.length - 1;
while ((((s.charCodeAt(_local1) == _local6) || (s.charCodeAt(_local1) == _local5)) || (s.charCodeAt(_local1) == _local3)) || (s.charCodeAt(_local1) == _local4)) {
_local1--;
}
return(s.substring(0, _local1 + 1));
}
static function StringTrim(s) {
return(StringTrimRight(StringTrimLeft(s)));
}
static function StringContains(str, strfind) {
return(str.indexOf(strfind) >= 0);
}
static function StringStartsWith(str, strfind) {
return(str.indexOf(strfind) == 0);
}
static function StringEndsWith(str, strfind) {
return(str.lastIndexOf(strfind) == (str.length - strfind.length));
}
static function StringNumberRank(amt) {
var _local1 = amt;
if ((amt >= 4) && (amt <= 20)) {
return(_local1 + "th");
}
var _local2 = _local1.charAt(_local1.length - 1);
if (_local2 == 1) {
_local1 = _local1 + "st";
} else if (_local2 == 2) {
_local1 = _local1 + "nd";
} else if (_local2 == 3) {
_local1 = _local1 + "rd";
} else {
_local1 = _local1 + "th";
}
return(_local1);
}
static function StringPadNumber(num, sz) {
var _local2 = "" + num;
var _local1 = 0;
while (_local1 < sz) {
_local2 = "0" + _local2;
_local1++;
}
return(_local2.substr(-sz, sz));
}
static function RectangleGetCenter(rect) {
return(new flash.geom.Point(rect.x + (rect.width / 2), rect.y + (rect.height / 2)));
}
static function CalcDistance(x1, y1, x2, y2) {
var _local1 = x2 - x1;
var _local2 = y2 - y1;
return(Math.sqrt((_local1 * _local1) + (_local2 * _local2)));
}
static function CalcToRadians(angle) {
return(angle * (Math.PI/180));
}
static function CalcToDegrees(rads) {
return(rads * 57.2957795130823);
}
static function CalcAngle(angle) {
var _local2 = CalcToRadians(angle - 90);
var _local1 = new Object();
_local1.x = Math.cos(_local2);
_local1.y = Math.sin(_local2);
return(_local1);
}
static function CalcAngleDistance(angle, tgt_angle) {
angle = angle % 360;
tgt_angle = tgt_angle % 360;
if (tgt_angle < 0) {
tgt_angle = tgt_angle + 360;
}
var _local1 = tgt_angle - angle;
if (_local1 > 180) {
_local1 = _local1 - 360;
} else if (_local1 < -180) {
_local1 = _local1 + 360;
}
return(_local1);
}
static function CalcAngleFromPoints(x1, y1, x2, y2) {
var _local3 = x2 - x1;
var _local2 = y2 - y1;
var _local1 = 0;
if (_local3 == 0) {
if (_local2 == 0) {
_local1 = 0;
} else if (_local2 > 0) {
_local1 = (Math.PI/2);
} else {
_local1 = 4.71238898038469;
}
} else if (_local2 == 0) {
if (_local3 > 0) {
_local1 = 0;
} else {
_local1 = Math.PI;
}
} else if (_local3 < 0) {
_local1 = Math.atan(_local2 / _local3) + Math.PI;
} else if (_local2 < 0) {
_local1 = Math.atan(_local2 / _local3) + (Math.PI*2);
} else {
_local1 = Math.atan(_local2 / _local3);
}
return(((_local1 * 57.2957795130823) + 90) % 360);
}
static function CalcAngleShoot(angle, sx, sy, dist) {
var _local1 = CalcAngle(angle);
_local1.x = sx + (_local1.x * dist);
_local1.y = sy + (_local1.y * dist);
return(_local1);
}
static function CalcTarget(sx, sy, tx, ty) {
var _local4 = new Object();
var _local1;
var _local3 = tx - sx;
var _local2 = ty - sy;
if (_local3 == 0) {
if (_local2 == 0) {
_local1 = 0;
} else if (_local2 > 0) {
_local1 = (Math.PI/2);
} else {
_local1 = 4.71238898038469;
}
} else if (_local2 == 0) {
if (_local3 > 0) {
_local1 = 0;
} else {
_local1 = Math.PI;
}
} else if (_local3 < 0) {
_local1 = Math.atan(_local2 / _local3) + Math.PI;
} else if (_local2 < 0) {
_local1 = Math.atan(_local2 / _local3) + (Math.PI*2);
} else {
_local1 = Math.atan(_local2 / _local3);
}
_local4.x = Math.cos(_local1);
_local4.y = Math.sin(_local1);
return(_local4);
}
static function CalcTargetShoot(sx, sy, tx, ty, dist) {
var _local1 = CalcTarget(sx, sy, tx, ty);
_local1.x = sx + (_local1.x * dist);
_local1.y = sy + (_local1.y * dist);
return(_local1);
}
static function MovieDrawCircle(mc, col, r, x, y) {
var _local6 = r * 0.414213562373095;
var _local5 = (r * Math.SQRT2) / 2;
mc.lineStyle(0, col);
mc.moveTo(x + r, y);
mc.curveTo(x + r, y + _local6, x + _local5, y + _local5);
mc.curveTo(x + _local6, y + r, x, y + r);
mc.curveTo(x - _local6, y + r, x - _local5, y + _local5);
mc.curveTo(x - r, y + _local6, x - r, y);
mc.curveTo(x - r, y - _local6, x - _local5, y - _local5);
mc.curveTo(x - _local6, y - r, x, y - r);
mc.curveTo(x + _local6, y - r, x + _local5, y - _local5);
mc.curveTo(x + r, y - _local6, x + r, y);
}
static function MovieFillCircle(mc, col, r, x, y) {
var _local6 = r * 0.414213562373095;
var _local5 = (r * Math.SQRT2) / 2;
mc.beginFill(col, 100);
mc.moveTo(x + r, y);
mc.curveTo(x + r, y + _local6, x + _local5, y + _local5);
mc.curveTo(x + _local6, y + r, x, y + r);
mc.curveTo(x - _local6, y + r, x - _local5, y + _local5);
mc.curveTo(x - r, y + _local6, x - r, y);
mc.curveTo(x - r, y - _local6, x - _local5, y - _local5);
mc.curveTo(x - _local6, y - r, x, y - r);
mc.curveTo(x + _local6, y - r, x + _local5, y - _local5);
mc.curveTo(x + r, y - _local6, x + r, y);
mc.endFill();
}
static function MovieDrawRectangle(mc, col, x1, y1, x2, y2) {
mc.lineStyle(0, col);
mc.moveTo(x1, y1);
mc.lineTo(x2, y1);
mc.lineTo(x2, y2);
mc.lineTo(x1, y2);
mc.lineTo(x1, y1);
}
static function MovieFillRectangle(mc, col, x1, y1, x2, y2, alpha) {
mc.beginFill(col, ((alpha == null) ? 100 : (alpha)));
mc.moveTo(x1, y1);
mc.lineTo(x2, y1);
mc.lineTo(x2, y2);
mc.lineTo(x1, y2);
mc.lineTo(x1, y1);
mc.endFill();
}
static function MovieGetNextDepthAt(mv, group) {
var _local1 = group;
var _local2 = _local1 + 99999;
while (_local1 < _local2) {
if (mv.getInstanceAtDepth(_local1) == undefined) {
return(_local1);
}
_local1++;
}
}
static function MovieGetNextDepthAtInterval(mv, group, intv) {
var _local1 = group;
if (intv > 0) {
var _local4 = _local1 + 99999;
while (_local1 < _local4) {
if (mv.getInstanceAtDepth(_local1) == undefined) {
return(_local1);
}
_local1 = _local1 + intv;
}
} else {
var _local4 = _local1 - 99999;
while (_local1 > _local4) {
if (mv.getInstanceAtDepth(_local1) == undefined) {
return(_local1);
}
_local1 = _local1 + intv;
}
}
}
static function MovieYSortDepthAt(mv, group) {
var _local1 = group;
var _local5 = group + 99999;
var _local3 = new Array();
while (_local1 < _local5) {
var _local2 = mv.getInstanceAtDepth(_local1);
if (_local2 == undefined) {
break;
}
_local3.push(_local2);
_local1++;
}
_local3.sort(_MovieYSortDepthAt);
_local1 = 0;
while (_local1 < _local3.length) {
_local3[_local1].swapDepths(group + _local1);
_local1++;
}
return(_local3);
}
static function _MovieYSortDepthAt(a, b) {
return(a._y < b._y);
}
static function MovieFilterGrayScale(mv) {
MovieFilterClear(mv);
var _local1 = [0.33, 0.33, 0.33, 0, 0, 0.33, 0.33, 0.33, 0, 0, 0.33, 0.33, 0.33, 0, 0, 0, 0, 0, 1, 0];
var _local2 = new flash.filters.ColorMatrixFilter(_local1);
mv.filters = [_local2];
}
static function MovieFilterClear(mv) {
mv.transform.colorTransform = new flash.geom.ColorTransform(1, 1, 1, 1, 0, 0, 0, 0);
mv.filters = null;
}
static function MovieRemoveAll(mv) {
for (var _local2 in mv) {
if (mv[_local2] instanceof MovieClip) {
removeMovieClip(mv[_local2]);
}
}
}
static function MovieRecursiveStop(mv) {
for (var _local2 in mv) {
if (mv[_local2] instanceof MovieClip) {
mv[_local2].stop();
MovieRecursiveStop(mv[_local2]);
}
}
}
static function MovieRecursivePlay(mv) {
for (var _local2 in mv) {
if (mv[_local2] instanceof MovieClip) {
mv[_local2].play();
MovieRecursivePlay(mv[_local2]);
}
}
}
static function MovieRemoveAllExcept(mv, nms) {
for (var _local5 in mv) {
if (mv[_local5] instanceof MovieClip) {
var _local3 = false;
var _local1 = 0;
while (_local1 < nms.length) {
if (nms[_local1] == mv[_local5]._name) {
_local3 = true;
break;
}
_local1++;
}
if (_local3 == false) {
removeMovieClip(mv[_local5]);
}
}
}
}
static function MovieRemoveStartsWith(mv, st) {
for (var _local2 in mv) {
if (mv[_local2] instanceof MovieClip) {
if (StringStartsWith(mv[_local2]._name, st)) {
removeMovieClip(mv[_local2]);
}
}
}
}
static function MovieGetRectangle(mv_relation, mv) {
var _local1 = mv.getRect();
var _local2 = {x:_local1.xMin, y:_local1.yMin};
mv_relation.localToGlobal(_local2);
var _local3 = new flash.geom.Rectangle(_local2.x, _local2.y, (_local1.xMax - _local1.xMin) + 1, (_local1.yMax - _local1.yMin) + 1);
return(_local3);
}
static var music = null;
static var music_playing = null;
static var sound_queue = new Array();
static var sound_volume = 100;
static var music_volume = 100;
static var do_mute = false;
static var do_mute_music = false;
static var fps_signal = false;
static var fps_time = 0;
static var fps_tempo = 0;
}
Symbol 558 MovieClip [__Packages.com.gamebrew.Base64] Frame 0
class com.gamebrew.Base64 extends Object
{
static var _CharsReverseLookup;
var _base64Str, _base64Count;
function Base64 (_base64Pad) {
super();
if (_base64Pad != undefined) {
this._base64Pad = _base64Pad;
}
}
static function encode(str) {
var _local1 = new com.gamebrew.Base64();
return(_local1.encodeBase64(str));
}
static function decode(str) {
var _local1 = new com.gamebrew.Base64();
return(_local1.decodeBase64(str));
}
static function InitReverseChars() {
_CharsReverseLookup = new Array();
var _local1 = 0;
while (_local1 < _Chars.length) {
_CharsReverseLookup[_Chars[_local1]] = _local1;
_local1++;
}
return(true);
}
function setBase64Str(str) {
_base64Str = str;
_base64Count = 0;
}
function readBase64() {
if (!_base64Str) {
return(_EndOfInput);
}
if (_base64Count >= _base64Str.length) {
return(_EndOfInput);
}
var _local2 = _base64Str.charCodeAt(_base64Count) & 255;
_base64Count++;
return(_local2);
}
function encodeBase64(str) {
setBase64Str(str);
var _local3 = "";
var _local2 = new Array(3);
var _local5 = 0;
var _local4 = false;
while ((!_local4) && (((_local2[0] = readBase64())) != _EndOfInput)) {
_local2[1] = readBase64();
_local2[2] = readBase64();
_local3 = _local3 + _Chars[_local2[0] >> 2];
if (_local2[1] != _EndOfInput) {
_local3 = _local3 + _Chars[((_local2[0] << 4) & 48) | (_local2[1] >> 4)];
if (_local2[2] != _EndOfInput) {
_local3 = _local3 + _Chars[((_local2[1] << 2) & 60) | (_local2[2] >> 6)];
_local3 = _local3 + _Chars[_local2[2] & 63];
} else {
_local3 = _local3 + _Chars[(_local2[1] << 2) & 60];
_local3 = _local3 + _base64Pad;
_local4 = true;
}
} else {
_local3 = _local3 + _Chars[(_local2[0] << 4) & 48];
_local3 = _local3 + _base64Pad;
_local3 = _local3 + _base64Pad;
_local4 = true;
}
_local5 = _local5 + 4;
}
return(_local3);
}
function readReverseBase64() {
if (!_base64Str) {
return(_EndOfInput);
}
while (true) {
if (_base64Count >= _base64Str.length) {
return(_EndOfInput);
}
var _local2 = _base64Str.charAt(_base64Count);
_base64Count++;
if (_CharsReverseLookup[_local2]) {
return(_CharsReverseLookup[_local2]);
}
if (_local2 == "A") {
return(0);
}
}
}
function ntos(n) {
var _local1 = n.toString(16);
if (_local1.length == 1) {
_local1 = "0" + _local1;
}
_local1 = "%" + _local1;
return(unescape(_local1));
}
function decodeBase64(str) {
setBase64Str(str);
var _local3 = "";
var _local2 = new Array(4);
var _local4 = false;
while (((!_local4) && (((_local2[0] = readReverseBase64())) != _EndOfInput)) && (((_local2[1] = readReverseBase64())) != _EndOfInput)) {
_local2[2] = readReverseBase64();
_local2[3] = readReverseBase64();
_local3 = _local3 + ntos(((_local2[0] << 2) & 255) | (_local2[1] >> 4));
if (_local2[2] != _EndOfInput) {
_local3 = _local3 + ntos(((_local2[1] << 4) & 255) | (_local2[2] >> 2));
if (_local2[3] != _EndOfInput) {
_local3 = _local3 + ntos(((_local2[2] << 6) & 255) | _local2[3]);
} else {
_local4 = true;
}
} else {
_local4 = true;
}
}
return(_local3);
}
function toHex(n) {
var _local4 = "";
var _local3 = true;
var _local1 = 32;
while (_local1 > 0) {
_local1 = _local1 - 4;
var _local2 = (n >> _local1) & 15;
if ((!_local3) || (_local2 != 0)) {
_local3 = false;
_local4 = _local4 + _Digits[_local2];
}
}
return(((_local4 == "") ? "0" : (_local4)));
}
function pad(str, len, pad) {
var _local2 = str;
var _local1 = str.length;
while (_local1 < len) {
_local2 = pad + _local2;
_local1++;
}
return(_local2);
}
function encodeHex(str) {
var _local4 = "";
var _local2 = 0;
while (_local2 < str.length) {
_local4 = _local4 + pad(toHex(str.charCodeAt(_local2) & 255), 2, "0");
_local2++;
}
return(_local4);
}
function decodeHex(str) {
var _local5 = "";
var _local3 = "";
var _local2 = 0;
while (_local2 < str.length) {
_local3 = _local3 + str.charAt(_local2);
if (_local3.length == 2) {
_local5 = _local5 + ntos(parseInt("0x" + _local3));
_local3 = "";
}
_local2++;
}
return(_local5);
}
var _base64Pad = new String("*");
static var _EndOfInput = -1;
static var _Chars = new Array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "-", "/");
static var _CharsReverseLookupInited = InitReverseChars();
static var _Digits = new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f");
}
Symbol 559 MovieClip [__Packages.com.mochiads.MochiAd] Frame 0
class com.mochiads.MochiAd
{
function MochiAd () {
}
static function getVersion() {
return("1.5");
}
static function showPreloaderAd(options) {
var _local27 = {clip:_root, ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:16747008, background:16777161, outline:13994812, ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}};
options = _parseOptions(options, _local27);
var clip = options.clip;
var _local23 = 11000;
var _local26 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local14 = _getRes(options);
var _local4 = _local14[0];
var _local13 = _local14[1];
mc._x = _local4 * 0.5;
mc._y = _local13 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk._x = _local4 * -0.5;
chk._y = _local13 * -0.5;
var _local7 = chk.createEmptyMovieClip("_mochiad_bar", 4);
_local7._x = 10;
_local7._y = _local13 - 20;
var _local22 = options.color;
delete options.color;
var _local19 = options.background;
delete options.background;
var _local24 = options.outline;
delete options.outline;
var _local5 = _local7.createEmptyMovieClip("_outline", 1);
_local5.beginFill(_local19);
_local5.moveTo(0, 0);
_local5.lineTo(_local4 - 20, 0);
_local5.lineTo(_local4 - 20, 10);
_local5.lineTo(0, 10);
_local5.lineTo(0, 0);
_local5.endFill();
var _local3 = _local7.createEmptyMovieClip("_inside", 2);
_local3.beginFill(_local22);
_local3.moveTo(0, 0);
_local3.lineTo(_local4 - 20, 0);
_local3.lineTo(_local4 - 20, 10);
_local3.lineTo(0, 10);
_local3.lineTo(0, 0);
_local3.endFill();
_local3._xscale = 0;
var _local6 = _local7.createEmptyMovieClip("_outline", 3);
_local6.lineStyle(0, _local24, 100);
_local6.moveTo(0, 0);
_local6.lineTo(_local4 - 20, 0);
_local6.lineTo(_local4 - 20, 10);
_local6.lineTo(0, 10);
_local6.lineTo(0, 0);
chk.ad_msec = _local23;
chk.ad_timeout = _local26;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
com.mochiads.MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = function (width, height) {
};
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec;
};
chk.onEnterFrame = function () {
var _local6 = this._parent._parent;
var _local12 = this._parent._mochiad_ctr;
var _local5 = getTimer() - this.started;
var _local3 = false;
var _local4 = _local6.getBytesTotal();
var _local8 = _local6.getBytesLoaded();
var _local10 = (100 * _local8) / _local4;
var _local11 = (100 * _local5) / chk.ad_msec;
var _local9 = this._mochiad_bar._inside;
var _local2 = Math.min(100, Math.min(_local10 || 0, _local11));
_local2 = Math.max(this.last_pcnt, _local2);
this.last_pcnt = _local2;
_local9._xscale = _local2;
if (!chk.showing) {
var _local7 = _local12.getBytesTotal();
if ((_local7 > 0) || (typeof(_local7) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local5 > chk.ad_timeout) {
_local3 = true;
}
}
if (_local5 > chk.ad_msec) {
_local3 = true;
}
if (((_local4 > 0) && (_local8 >= _local4)) && (_local3)) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
}
}
};
}
static function showTimedAd(options) {
var _local13 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}};
options = _parseOptions(options, _local13);
var clip = options.clip;
var _local10 = 11000;
var _local12 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local5 = _getRes(options);
var _local14 = _local5[0];
var _local11 = _local5[1];
mc._x = _local14 * 0.5;
mc._y = _local11 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_msec = _local10;
chk.ad_timeout = _local12;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
com.mochiads.MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec - 250;
};
chk.onEnterFrame = function () {
var _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
_local2 = true;
}
}
if (_local4 > chk.ad_msec) {
_local2 = true;
}
if (_local2) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
}
}
};
}
static function _allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function _loadCommunicator(options) {
var _local25 = {clip:_root, com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"};
options = _parseOptions(options, _local25);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local18 = options.clip;
var _local20 = "_mochiad_com_" + options.id;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local18[_local20]) {
return(_local18[_local20].lc);
}
var _local21 = options.com_server + options.id;
_allowDomains(_local21);
delete options.id;
delete options.com_server;
var _local24 = options.depth;
delete options.depth;
var _local17 = _local18.createEmptyMovieClip(_local20, _local24);
var _local11 = _local17.createEmptyMovieClip("_mochiad_com", 1);
for (var _local15 in options) {
_local11[_local15] = options[_local15];
}
var _local6 = new LocalConnection();
var _local16 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local6.mc = _local17;
_local6.name = _local16;
_local6.allowDomain = function (d) {
return(true);
};
_local6.allowInsecureDomain = _local6.allowDomain;
_local6.connect(_local16);
_local17.lc = _local6;
_local11.lc = _local16;
_local6._id = 0;
_local6._queue = [];
_local6.rpcResult = function (cb) {
cb = parseInt(cb);
var _local4 = this._callbacks[cb];
if (!_local4) {
return(undefined);
}
delete this._callbacks[cb];
var _local5 = [];
var _local3 = 2;
while (_local3 < _local4.length) {
_local5.push(_local4[_local3]);
_local3++;
}
_local3 = 1;
while (_local3 < arguments.length) {
_local5.push(arguments[_local3]);
_local3++;
}
var _local6 = _local4[1];
var _local7 = _local4[0];
if (_local7 && (typeof(_local6) == "string")) {
_local6 = _local7[_local6];
}
if (_local6) {
_local6.apply(_local7, _local5);
}
};
_local6._didConnect = function (endpoint) {
this._endpoint = endpoint;
var _local4 = this._queue;
delete this._queue;
var _local5 = this.doSend;
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2];
_local5.apply(this, _local3);
_local2++;
}
};
_local6.doSend = function (args, cbobj, cbfn) {
if (this._endpoint == null) {
var _local4 = [];
var _local3 = 0;
while (_local3 < arguments.length) {
_local4.push(arguments[_local3]);
_local3++;
}
this._queue.push(_local4);
return(undefined);
}
this._id = this._id + 1;
var _local5 = this._id;
if ((cbfn === undefined) || (cbfn === null)) {
cbfn = cbobj;
}
this._callbacks[_local5] = [cbobj, cbfn];
var _local7 = new LocalConnection();
var _local9 = _local7.send(this._endpoint, "rpc", _local5, args);
};
_local6._callbacks = {};
_local6._callbacks[0] = [_local6, "_didConnect"];
_local11.st = getTimer();
_local11.loadMovie(_local21 + ".swf", "POST");
return(_local6);
}
static function fetchHighScores(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["fetchHighScores", options];
_local1.doSend(["fetchHighScores", options], callbackObj, callbackMethod);
return(true);
}
static function sendHighScore(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["sendHighScore", options];
_local1.doSend(["sendHighScore", options], callbackObj, callbackMethod);
return(true);
}
static function load(options) {
var _local13 = {clip:_root, server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = _parseOptions(options, _local13);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local7 = options.clip;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local7._mochiad_loaded) {
return(null);
}
var _local12 = options.depth;
delete options.depth;
var _local6 = _local7.createEmptyMovieClip("_mochiad", _local12);
var _local11 = _getRes(options);
options.res = (_local11[0] + "x") + _local11[1];
options.server = options.server + options.id;
delete options.id;
_local7._mochiad_loaded = true;
var _local4 = _local6.createEmptyMovieClip("_mochiad_ctr", 1);
for (var _local8 in options) {
_local4[_local8] = options[_local8];
}
if (_local7._url.indexOf("http") != 0) {
options.no_page = true;
}
var _local10 = _local4.server;
delete _local4.server;
var _local14 = _allowDomains(_local10);
_local6.onEnterFrame = function () {
if (this._mochiad_ctr._url != this._url) {
this.onEnterFrame = function () {
if (!this._mochiad_ctr) {
delete this.onEnterFrame;
com.mochiads.MochiAd.unload(this._parent);
}
};
}
};
var _local5 = new LocalConnection();
var _local9 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local5.mc = _local6;
_local5.name = _local9;
_local5.hostname = _local14;
_local5.allowDomain = function (d) {
return(true);
};
_local5.allowInsecureDomain = _local5.allowDomain;
_local5.connect(_local9);
_local6.lc = _local5;
_local4.lc = _local9;
_local4.st = getTimer();
_local4.loadMovie(_local10 + ".swf", "POST");
return(_local6);
}
static function unload(clip) {
if (typeof(clip) == "undefined") {
clip = _root;
}
if (clip.clip && (clip.clip._mochiad)) {
clip = clip.clip;
}
if (!clip._mochiad) {
return(false);
}
clip._mochiad.removeMovieClip();
delete clip._mochiad_loaded;
delete clip._mochiad;
return(true);
}
static function _isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function _getRes(options) {
var _local3 = options.clip.getBounds();
var _local2 = 0;
var _local1 = 0;
if (typeof(options.res) != "undefined") {
var _local4 = options.res.split("x");
_local2 = parseFloat(_local4[0]);
_local1 = parseFloat(_local4[1]);
} else {
_local2 = _local3.xMax - _local3.xMin;
_local1 = _local3.yMax - _local3.yMin;
}
if ((_local2 == 0) || (_local1 == 0)) {
_local2 = Stage.width;
_local1 = Stage.height;
}
return([_local2, _local1]);
}
static function _parseOptions(options, defaults) {
var _local4 = {};
for (var _local8 in defaults) {
_local4[_local8] = defaults[_local8];
}
if (options) {
for (var _local8 in options) {
_local4[_local8] = options[_local8];
}
}
if (_root.mochiad_options) {
var _local5 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local5.length) {
var _local3 = _local5[_local2].split("=");
_local4[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
return(_local4);
}
}
Symbol 560 MovieClip [__Packages.com.gamebrew.MuServer] Frame 0
class com.gamebrew.MuServer
{
var server_ip, server_port, xml, paused, read_array, write_array, connected, user_password, user_name, zone_name, zone_version, user_id;
function MuServer (server_ip, server_port, debug) {
this.server_ip = server_ip;
this.server_port = server_port;
if (debug == undefined) {
this.debug = true;
} else {
this.debug = debug;
}
xml = new XMLSocket();
xml.onConnect = mx.utils.Delegate.create(this, xmlConnect);
xml.onClose = mx.utils.Delegate.create(this, xmlClose);
xml.onData = mx.utils.Delegate.create(this, xmlData);
paused = false;
read_array = new Array();
write_array = new Array();
connected = false;
}
static function loadPolicyFile(ip, port) {
System.security.loadPolicyFile((("xmlsocket://" + ip) + ":") + port);
}
function xmlConnect(success) {
if (!success) {
onConnect(false);
if (debug) {
trace("Could not connect");
}
return(undefined);
}
outcd = 0;
incd = 0;
seckey = 0;
connected = true;
onConnect(true);
if (debug) {
trace("Connected");
}
var _local3 = "";
if (user_password != "") {
_local3 = com.gamebrew.MD5.encode(user_password);
}
var _local2 = (((("&zn=" + zone_name) + "&nm=") + user_name) + "&pw=") + _local3;
if (zone_version != "") {
_local2 = _local2 + ("&zv=" + zone_version);
}
sendRequest("login", _local2);
}
function xmlClose() {
if (debug) {
trace("Server closed connection");
}
onDisconnect("Server closed connection");
connected = false;
}
function xmlData(str) {
if (str.length == 0) {
return(undefined);
}
var _local3 = com.gamebrew.Base64.decode(str);
var _local2 = new LoadVars();
_local2.decode(_local3);
if (outcd != _local2.outcd) {
if (debug) {
trace((("Bad outbound security key " + _local2.outcd) + "!=") + outcd);
}
onDisconnect((("Bad outbound security key " + _local2.outcd) + "!=") + outcd);
xml.close();
return(undefined);
}
outcd = outcd + seckey;
if (outcd > MAX_SECKEY) {
outcd = outcd - MAX_SECKEY;
}
if (debug) {
trace("[recd]" + _local3);
}
if (paused == false) {
receiveRequest(_local2);
} else {
read_array.push(_local2);
}
}
function receiveRequest(vars) {
var _local3 = vars.cmd;
if (_local3 == "login") {
user_name = vars.nm;
user_id = int(vars.uid);
seckey = int(vars.seckey);
outcd = outcd + seckey;
onLogin(user_id, user_name);
} else if (_local3 == "disconnect") {
connected = false;
onDisconnect(vars.msg, false);
xml.close();
} else if (_local3 == "disconnect.ban") {
connected = false;
onDisconnect(vars.msg, true);
xml.close();
} else if (_local3 == "login.redirect") {
onLoginRedirect(vars.overload_ip);
xml.close();
xml.connect(vars.overload_ip, server_port);
} else {
onRequest(_local3, vars);
}
if ((read_array.length > 0) && (paused == false)) {
receiveRequest(read_array.shift());
}
}
function login(zn, zv, nm, pw) {
if (zn == null) {
zn = "";
}
if (zv == null) {
zv = "";
}
if ((nm == null) || (nm == undefined)) {
nm = "";
} else {
nm = com.gamebrew.Common.StringReplace(nm, "&", "");
nm = com.gamebrew.Common.StringReplace(nm, "=", "");
}
if ((pw == null) || (pw == undefined)) {
pw = "";
} else {
pw = com.gamebrew.Common.StringReplace(pw, "&", "");
pw = com.gamebrew.Common.StringReplace(pw, "=", "");
}
zone_name = zn;
zone_version = zv;
user_name = nm;
user_password = pw;
xml.connect(server_ip, server_port);
}
function disconnect() {
if (connected) {
sendRequest("disconnect");
}
}
function setPaused(tf) {
if (tf == true) {
paused = true;
} else {
paused = false;
var _local2 = 0;
while (_local2 < write_array.length) {
xml.send(write_array.shift());
_local2++;
}
if (read_array.length > 0) {
receiveRequest(read_array.shift());
}
}
}
function sendRequest(cmd, xtra) {
if (!connected) {
return(undefined);
}
var _local3 = (("&cmd=" + cmd) + "&incd=") + incd;
incd = incd + seckey;
if (incd > MAX_SECKEY) {
incd = incd - MAX_SECKEY;
}
if ((xtra != null) && (xtra != "")) {
if (!com.gamebrew.Common.StringStartsWith(xtra, "&")) {
xtra = "&" + xtra;
}
_local3 = _local3 + xtra;
}
if (debug) {
trace("[sent]" + _local3);
}
var _local4 = com.gamebrew.Base64.encode(_local3);
if (paused == false) {
xml.send("");
xml.send(_local4);
} else {
write_array.push(_local4);
}
}
function onConnect(success) {
}
function onDisconnect(msg, is_banned) {
}
function onLogin(user_id, user_name) {
}
function onLoginRedirect(server_ip) {
}
function onRequest(cmd, vars) {
}
var MAX_SECKEY = 999;
var outcd = 0;
var incd = 0;
var seckey = 0;
var debug = true;
}
Symbol 561 MovieClip [__Packages.mx.utils.Delegate] Frame 0
class mx.utils.Delegate extends Object
{
var func;
function Delegate (f) {
super();
func = f;
}
static function create(obj, func) {
var _local2 = function () {
var _local2 = arguments.callee.target;
var _local3 = arguments.callee.func;
return(_local3.apply(_local2, arguments));
};
_local2.target = obj;
_local2.func = func;
return(_local2);
}
function createDelegate(obj) {
return(create(obj, func));
}
}
Symbol 562 MovieClip [__Packages.com.gamebrew.MD5] Frame 0
class com.gamebrew.MD5
{
function MD5 () {
}
static function encode(s) {
var _local1 = new com.gamebrew.MD5();
return(_local1.hex_md5(s));
}
function hex_md5(s) {
return(binl2hex(core_md5(str2binl(s), s.length * chrsz)));
}
function b64_md5(s) {
return(binl2b64(core_md5(str2binl(s), s.length * chrsz)));
}
function str_md5(s) {
return(binl2str(core_md5(str2binl(s), s.length * chrsz)));
}
function hex_hmac_md5(key, data) {
return(binl2hex(core_hmac_md5(key, data)));
}
function b64_hmac_md5(key, data) {
return(binl2b64(core_hmac_md5(key, data)));
}
function str_hmac_md5(key, data) {
return(binl2str(core_hmac_md5(key, data)));
}
function md5_cmn(q, a, b, x, s, t) {
return(safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b));
}
function md5_ff(a, b, c, d, x, s, t) {
return(md5_cmn((b & c) | ((~b) & d), a, b, x, s, t));
}
function md5_gg(a, b, c, d, x, s, t) {
return(md5_cmn((b & d) | (c & (~d)), a, b, x, s, t));
}
function md5_hh(a, b, c, d, x, s, t) {
return(md5_cmn((b ^ c) ^ d, a, b, x, s, t));
}
function md5_ii(a, b, c, d, x, s, t) {
return(md5_cmn(c ^ (b | (~d)), a, b, x, s, t));
}
function core_md5(x, len) {
x[len >> 5] = x[len >> 5] | (128 << (len % 32));
x[(((len + 64) >>> 9) << 4) + 14] = len;
var _local5 = 1732584193 /* 0x67452301 */;
var _local4 = -271733879;
var _local3 = -1732584194;
var _local2 = 271733878 /* 0x10325476 */;
var _local6 = 0;
while (_local6 < x.length) {
var _local11 = _local5;
var _local10 = _local4;
var _local9 = _local3;
var _local8 = _local2;
_local5 = md5_ff(_local5, _local4, _local3, _local2, x[_local6 + 0], 7, -680876936);
_local2 = md5_ff(_local2, _local5, _local4, _local3, x[_local6 + 1], 12, -389564586);
_local3 = md5_ff(_local3, _local2, _local5, _local4, x[_local6 + 2], 17, 606105819);
_local4 = md5_ff(_local4, _local3, _local2, _local5, x[_local6 + 3], 22, -1044525330);
_local5 = md5_ff(_local5, _local4, _local3, _local2, x[_local6 + 4], 7, -176418897);
_local2 = md5_ff(_local2, _local5, _local4, _local3, x[_local6 + 5], 12, 1200080426);
_local3 = md5_ff(_local3, _local2, _local5, _local4, x[_local6 + 6], 17, -1473231341);
_local4 = md5_ff(_local4, _local3, _local2, _local5, x[_local6 + 7], 22, -45705983);
_local5 = md5_ff(_local5, _local4, _local3, _local2, x[_local6 + 8], 7, 1770035416);
_local2 = md5_ff(_local2, _local5, _local4, _local3, x[_local6 + 9], 12, -1958414417);
_local3 = md5_ff(_local3, _local2, _local5, _local4, x[_local6 + 10], 17, -42063);
_local4 = md5_ff(_local4, _local3, _local2, _local5, x[_local6 + 11], 22, -1990404162);
_local5 = md5_ff(_local5, _local4, _local3, _local2, x[_local6 + 12], 7, 1804603682);
_local2 = md5_ff(_local2, _local5, _local4, _local3, x[_local6 + 13], 12, -40341101);
_local3 = md5_ff(_local3, _local2, _local5, _local4, x[_local6 + 14], 17, -1502002290);
_local4 = md5_ff(_local4, _local3, _local2, _local5, x[_local6 + 15], 22, 1236535329);
_local5 = md5_gg(_local5, _local4, _local3, _local2, x[_local6 + 1], 5, -165796510);
_local2 = md5_gg(_local2, _local5, _local4, _local3, x[_local6 + 6], 9, -1069501632);
_local3 = md5_gg(_local3, _local2, _local5, _local4, x[_local6 + 11], 14, 643717713);
_local4 = md5_gg(_local4, _local3, _local2, _local5, x[_local6 + 0], 20, -373897302);
_local5 = md5_gg(_local5, _local4, _local3, _local2, x[_local6 + 5], 5, -701558691);
_local2 = md5_gg(_local2, _local5, _local4, _local3, x[_local6 + 10], 9, 38016083);
_local3 = md5_gg(_local3, _local2, _local5, _local4, x[_local6 + 15], 14, -660478335);
_local4 = md5_gg(_local4, _local3, _local2, _local5, x[_local6 + 4], 20, -405537848);
_local5 = md5_gg(_local5, _local4, _local3, _local2, x[_local6 + 9], 5, 568446438);
_local2 = md5_gg(_local2, _local5, _local4, _local3, x[_local6 + 14], 9, -1019803690);
_local3 = md5_gg(_local3, _local2, _local5, _local4, x[_local6 + 3], 14, -187363961);
_local4 = md5_gg(_local4, _local3, _local2, _local5, x[_local6 + 8], 20, 1163531501);
_local5 = md5_gg(_local5, _local4, _local3, _local2, x[_local6 + 13], 5, -1444681467);
_local2 = md5_gg(_local2, _local5, _local4, _local3, x[_local6 + 2], 9, -51403784);
_local3 = md5_gg(_local3, _local2, _local5, _local4, x[_local6 + 7], 14, 1735328473);
_local4 = md5_gg(_local4, _local3, _local2, _local5, x[_local6 + 12], 20, -1926607734);
_local5 = md5_hh(_local5, _local4, _local3, _local2, x[_local6 + 5], 4, -378558);
_local2 = md5_hh(_local2, _local5, _local4, _local3, x[_local6 + 8], 11, -2022574463);
_local3 = md5_hh(_local3, _local2, _local5, _local4, x[_local6 + 11], 16, 1839030562);
_local4 = md5_hh(_local4, _local3, _local2, _local5, x[_local6 + 14], 23, -35309556);
_local5 = md5_hh(_local5, _local4, _local3, _local2, x[_local6 + 1], 4, -1530992060);
_local2 = md5_hh(_local2, _local5, _local4, _local3, x[_local6 + 4], 11, 1272893353);
_local3 = md5_hh(_local3, _local2, _local5, _local4, x[_local6 + 7], 16, -155497632);
_local4 = md5_hh(_local4, _local3, _local2, _local5, x[_local6 + 10], 23, -1094730640);
_local5 = md5_hh(_local5, _local4, _local3, _local2, x[_local6 + 13], 4, 681279174);
_local2 = md5_hh(_local2, _local5, _local4, _local3, x[_local6 + 0], 11, -358537222);
_local3 = md5_hh(_local3, _local2, _local5, _local4, x[_local6 + 3], 16, -722521979);
_local4 = md5_hh(_local4, _local3, _local2, _local5, x[_local6 + 6], 23, 76029189);
_local5 = md5_hh(_local5, _local4, _local3, _local2, x[_local6 + 9], 4, -640364487);
_local2 = md5_hh(_local2, _local5, _local4, _local3, x[_local6 + 12], 11, -421815835);
_local3 = md5_hh(_local3, _local2, _local5, _local4, x[_local6 + 15], 16, 530742520);
_local4 = md5_hh(_local4, _local3, _local2, _local5, x[_local6 + 2], 23, -995338651);
_local5 = md5_ii(_local5, _local4, _local3, _local2, x[_local6 + 0], 6, -198630844);
_local2 = md5_ii(_local2, _local5, _local4, _local3, x[_local6 + 7], 10, 1126891415);
_local3 = md5_ii(_local3, _local2, _local5, _local4, x[_local6 + 14], 15, -1416354905);
_local4 = md5_ii(_local4, _local3, _local2, _local5, x[_local6 + 5], 21, -57434055);
_local5 = md5_ii(_local5, _local4, _local3, _local2, x[_local6 + 12], 6, 1700485571);
_local2 = md5_ii(_local2, _local5, _local4, _local3, x[_local6 + 3], 10, -1894986606);
_local3 = md5_ii(_local3, _local2, _local5, _local4, x[_local6 + 10], 15, -1051523);
_local4 = md5_ii(_local4, _local3, _local2, _local5, x[_local6 + 1], 21, -2054922799);
_local5 = md5_ii(_local5, _local4, _local3, _local2, x[_local6 + 8], 6, 1873313359);
_local2 = md5_ii(_local2, _local5, _local4, _local3, x[_local6 + 15], 10, -30611744);
_local3 = md5_ii(_local3, _local2, _local5, _local4, x[_local6 + 6], 15, -1560198380);
_local4 = md5_ii(_local4, _local3, _local2, _local5, x[_local6 + 13], 21, 1309151649);
_local5 = md5_ii(_local5, _local4, _local3, _local2, x[_local6 + 4], 6, -145523070);
_local2 = md5_ii(_local2, _local5, _local4, _local3, x[_local6 + 11], 10, -1120210379);
_local3 = md5_ii(_local3, _local2, _local5, _local4, x[_local6 + 2], 15, 718787259);
_local4 = md5_ii(_local4, _local3, _local2, _local5, x[_local6 + 9], 21, -343485551);
_local5 = safe_add(_local5, _local11);
_local4 = safe_add(_local4, _local10);
_local3 = safe_add(_local3, _local9);
_local2 = safe_add(_local2, _local8);
_local6 = _local6 + 16;
}
return(Array(_local5, _local4, _local3, _local2));
}
function core_hmac_md5(key, data) {
var _local3 = new Array(str2binl(key));
if (_local3.length > 16) {
_local3 = core_md5(_local3, key.length * chrsz);
}
var _local4 = new Array(16);
var _local5 = new Array(16);
var _local2 = 0;
while (_local2 < 16) {
_local4[_local2] = _local3[_local2] ^ 909522486;
_local5[_local2] = _local3[_local2] ^ 1549556828;
_local2++;
}
var _local6 = new Array(core_md5(_local4.concat(str2binl(data)), 512 + (data.length * chrsz)));
return(core_md5(_local5.concat(_local6), 640));
}
function safe_add(x, y) {
var _local1 = new Number((x & 65535) + (y & 65535));
var _local2 = new Number(((x >> 16) + (y >> 16)) + (_local1 >> 16));
return((_local2 << 16) | (_local1 & 65535));
}
function bit_rol(num, cnt) {
return((num << cnt) | (num >>> (32 - cnt)));
}
function str2binl(str) {
var _local4 = new Array();
var _local5 = (1 << chrsz) - 1;
var _local2 = 0;
while (_local2 < (str.length * chrsz)) {
_local4[_local2 >> 5] = _local4[_local2 >> 5] | ((str.charCodeAt(_local2 / chrsz) & _local5) << (_local2 % 32));
_local2 = _local2 + chrsz;
}
return(_local4);
}
function binl2str(bin) {
var _local4 = new String("");
var _local5 = (1 << chrsz) - 1;
var _local2 = 0;
while (_local2 < (bin.length * 32)) {
_local4 = _local4 + String.fromCharCode((bin[_local2 >> 5] >>> (_local2 % 32)) & _local5);
_local2 = _local2 + chrsz;
}
return(_local4);
}
function binl2hex(binarray) {
var _local3 = "0123456789abcdef";
var _local4 = new String("");
var _local1 = 0;
while (_local1 < (binarray.length * 4)) {
_local4 = _local4 + (_local3.charAt((binarray[_local1 >> 2] >> (((_local1 % 4) * 8) + 4)) & 15) + _local3.charAt((binarray[_local1 >> 2] >> ((_local1 % 4) * 8)) & 15));
_local1++;
}
return(_local4);
}
function binl2b64(binarray) {
var _local7 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var _local5 = new String("");
var _local3 = 0;
while (_local3 < (binarray.length * 4)) {
var _local6 = ((((binarray[_local3 >> 2] >> (8 * (_local3 % 4))) & 255) << 16) | (((binarray[(_local3 + 1) >> 2] >> (8 * ((_local3 + 1) % 4))) & 255) << 8)) | ((binarray[(_local3 + 2) >> 2] >> (8 * ((_local3 + 2) % 4))) & 255);
var _local2 = 0;
while (_local2 < 4) {
if (((_local3 * 8) + (_local2 * 6)) > (binarray.length * 32)) {
_local5 = _local5 + b64pad;
} else {
_local5 = _local5 + _local7.charAt((_local6 >> (6 * (3 - _local2))) & 63);
}
_local2++;
}
_local3 = _local3 + 3;
}
return(_local5);
}
var b64pad = new String("");
var chrsz = new Number(8);
}
Symbol 563 MovieClip [__Packages.ArtilleryZone] Frame 0
class ArtilleryZone extends com.gamebrew.MuServer
{
var zone_name, users, room, user_id, user, sendRequest;
function ArtilleryZone (server_ip, server_port, debug) {
super(server_ip, server_port, debug);
zone_name = null;
}
function findUserByName(nm) {
var _local2 = 0;
while (_local2 < users.length) {
if (users[_local2].user_name == nm) {
return(users[_local2]);
}
_local2++;
}
return(null);
}
function findUserById(id) {
var _local2 = 0;
while (_local2 < users.length) {
if (users[_local2].user_id == id) {
return(users[_local2]);
}
_local2++;
}
return(null);
}
function indexUserByName(nm) {
var _local2 = 0;
while (_local2 < users.length) {
if (users[_local2].user_name == nm) {
return(_local2);
}
_local2++;
}
return(-1);
}
function indexUserById(id) {
var _local2 = 0;
while (_local2 < users.length) {
if (users[_local2].user_id == id) {
return(_local2);
}
_local2++;
}
return(-1);
}
function onRequest(cmd, vars) {
if (com.gamebrew.Common.StringStartsWith(cmd, "game.")) {
onGameCommand(cmd, vars);
}
if (cmd == "chat") {
onChat(unescape(com.gamebrew.Base64.decode(vars.msg)), int(vars.user_id), vars.user_name, findUserById(vars.user_id));
} else if (cmd == "chat.private") {
onChatPrivate(unescape(com.gamebrew.Base64.decode(vars.msg)), int(vars.user_id), vars.user_name, findUserById(vars.user_id));
} else if (cmd == "zone.user.create") {
onZoneUserCreate();
} else if (cmd == "event.zone.room.create") {
} else if (cmd == "event.zone.room.destroy") {
} else if (cmd == "room.user.join") {
room = new ArtilleryRoom(vars.room_id, vars.room_name, 0);
users = new Array();
room.user_count = int(vars.user_count);
var _local3 = 0;
while (_local3 < room.user_count) {
var _local5 = new ArtilleryUser();
_local5.user_id = int(vars[("user." + _local3) + ".user_id"]);
_local5.user_name = vars[("user." + _local3) + ".user_name"];
_local5.color = int(vars[("user." + _local3) + ".color"]);
_local5.slot = int(vars[("user." + _local3) + ".slot"]);
_local5.pos = int(vars[("user." + _local3) + ".pos"]);
_local5.angle = int(vars[("user." + _local3) + ".angle"]);
_local5.power = int(vars[("user." + _local3) + ".power"]);
_local5.kills = int(vars[("user." + _local3) + ".kills"]);
_local5.score = int(vars[("user." + _local3) + ".score"]);
_local5.armor = int(vars[("user." + _local3) + ".armor"]);
users.push(_local5);
if (_local5.user_id == user_id) {
user = _local5;
}
_local3++;
}
onRoomUserJoin(room, users);
} else if (cmd == "room.user.leave") {
users = new Array();
room.user_count--;
onRoomUserLeave(room);
} else if (cmd == "event.room.user.join") {
var _local5 = new ArtilleryUser();
_local5.user_id = int(vars.user_id);
_local5.user_name = vars.user_name;
_local5.color = int(vars.color);
_local5.slot = int(vars.slot);
_local5.pos = int(vars.pos);
_local5.angle = int(vars.angle);
_local5.power = int(vars.power);
_local5.kills = int(vars.kills);
_local5.score = int(vars.score);
_local5.armor = int(vars.armor);
users.push(_local5);
room.user_count++;
onEventRoomUserJoin(_local5);
} else if (cmd == "event.room.user.leave") {
var _local6 = indexUserById(vars.user_id);
var _local7 = users[_local6];
users.splice(_local6, 1);
room.user_count--;
onEventRoomUserLeave(_local7);
} else if (cmd == "event.room.user.disconnect") {
var _local6 = indexUserById(vars.user_id);
var _local7 = users[_local6];
users.splice(_local6, 1);
room.user_count--;
onEventRoomUserDisconnect(_local7);
} else if (cmd == "event.room.outside.update") {
} else if (cmd == "info") {
var _local9 = vars.icmd;
var _local8 = ((int(vars.ok) == 0) ? false : true);
delete vars.icmd;
delete vars.ok;
onInfo(_local9, _local8, vars);
}
}
function silenceUserId(uid) {
sendRequest("silence", "&user_id=" + uid);
}
function silenceUserName(nm) {
sendRequest("silence", "&user_name=" + nm);
}
function bootUserId(uid) {
sendRequest("boot", "&user_id=" + uid);
}
function bootUserName(nm) {
sendRequest("boot", "&user_name=" + nm);
}
function joinRoom(rid) {
sendRequest("room.user.join", "&room_id=" + rid);
}
function leaveRoom() {
sendRequest("room.user.leave");
}
function sendChat(msg) {
sendRequest("chat", "&msg=" + com.gamebrew.Base64.encode(escape(msg)));
}
function sendChatToUserName(msg, nm) {
sendRequest("chat.private", (("&user_name=" + nm) + "&msg=") + com.gamebrew.Base64.encode(escape(msg)));
}
function sendChatToUserId(msg, id) {
sendRequest("chat.private", (("&user_id=" + id) + "&msg=") + com.gamebrew.Base64.encode(escape(msg)));
}
function sendChatToUser(msg, u) {
sendRequest("chat.private", (("&user_id=" + u.user_id) + "&msg=") + com.gamebrew.Base64.encode(escape(msg)));
}
function onConnect(success) {
}
function onDisconnect(msg, is_banned) {
}
function onInfo(cmd, ok, vars) {
}
function onChat(msg, user_id, user_name, user) {
}
function onChatPrivate(msg, user_id, user_name, user) {
}
function onZoneUserCreate() {
}
function onEventZoneRoomCreate(room) {
}
function onEventZoneRoomDestroy(room) {
}
function onRoomUserJoin(room, users) {
}
function onRoomUserLeave(room) {
}
function onEventRoomUserJoin(user) {
}
function onEventRoomUserLeave(user) {
}
function onEventRoomUserDisconnect(user) {
}
function onEventRoomOutsideUpdate(room) {
}
function onGameCommand(cmd, vars) {
}
}
Symbol 564 MovieClip [__Packages.ArtilleryUser] Frame 0
class ArtilleryUser
{
var combo, score;
function ArtilleryUser () {
combo = 0;
score = 0;
}
}
Symbol 565 MovieClip [__Packages.ArtilleryRoom] Frame 0
class ArtilleryRoom
{
var room_id, room_name, user_count;
function ArtilleryRoom (room_id, room_name, user_count) {
this.room_id = room_id;
this.room_name = room_name;
this.user_count = user_count;
}
}
Symbol 499 MovieClip Frame 7
stop();
Symbol 526 MovieClip Frame 1
stop();
Symbol 542 MovieClip Frame 1
stop();
Symbol 542 MovieClip Frame 17
gotoAndStop (1);
Symbol 547 MovieClip Frame 1
function ChangeText(txt_left, txt_mid, txt_right) {
txt_wind_west.text = txt_left;
txt_wind.text = txt_mid;
txt_wind_east.text = txt_right;
txt_wind_west.textColor = 29423;
txt_wind.textColor = 29423;
txt_wind_east.textColor = 29423;
this.blinks = 0;
onEnterFrame = function () {
if (txt_wind_west.textColor == 29423) {
txt_wind_west.textColor = 255;
txt_wind.textColor = 255;
txt_wind_east.textColor = 255;
} else {
txt_wind_west.textColor = 29423;
txt_wind.textColor = 29423;
txt_wind_east.textColor = 29423;
}
this.blinks++;
if (this.blinks > 24) {
txt_wind_west.textColor = 29423;
txt_wind.textColor = 29423;
txt_wind_east.textColor = 29423;
delete this.onEnterFrame;
}
};
}