Frame 1
function muteGame() {
if (muted == false) {
mute = new Sound(_root);
mute.setVolume(0);
_root.game.userInterface.muteButton.gotoAndStop(2);
muted = true;
} else {
mute = new Sound(_root);
mute.setVolume(100);
_root.game.userInterface.muteButton.gotoAndStop(1);
muted = false;
}
}
stop();
_level0.ffgamesSend.setGame("retro");
if (this != _root) {
stop();
}
if (this != _root) {
this._lockroot = true;
}
var muted = false;
onEnterFrame = function () {
if (Key.isDown(32)) {
}
if ((game.vibrate == true) and (game.paused == false)) {
}
};
this._lockroot;
Instance of Symbol 25 MovieClip in Frame 1
onClipEvent (enterFrame) {
if (_root.getBytesLoaded() == _root.getBytesTotal()) {
_parent.gotoAndStop(2);
}
}
onClipEvent (enterFrame) {
if (_alpha > 0) {
_alpha = (100 - _root.game._alpha);
}
}
Instance of Symbol 28 MovieClip in Frame 2
onClipEvent (enterFrame) {
if ((_parent.game.getBytesLoaded() == _parent.game.getBytesTotal()) and (_alpha < 100)) {
if (_alpha < 100) {
_alpha = (_alpha + 10);
gotoAndStop (2);
}
}
}
Instance of Symbol 494 MovieClip "game" in Frame 2
onClipEvent (load) {
_alpha = 0;
}
onClipEvent (enterFrame) {
if ((getBytesLoaded() == getBytesTotal()) and (_alpha < 100)) {
if (_alpha < 100) {
_alpha = (_alpha + 10);
gotoAndStop (2);
}
}
}
Symbol 8 MovieClip [message textfield] Frame 1
#initclip 11
Object.registerClass("message textfield", MessageFormInput);
#endinitclip
stop();
Symbol 8 MovieClip [message textfield] Frame 18
stop();
Symbol 8 MovieClip [message textfield] Frame 38
stop();
Symbol 13 MovieClip [Generic FormInput] Frame 1
#initclip 10
Object.registerClass("Generic FormInput", FormInput);
#endinitclip
stop();
Symbol 13 MovieClip [Generic FormInput] Frame 18
stop();
Symbol 13 MovieClip [Generic FormInput] Frame 38
stop();
Instance of Symbol 21 MovieClip in Symbol 22 MovieClip Frame 1
onClipEvent (enterFrame) {
_width = ((_root.getBytesLoaded() / _root.getBytesTotal()) * 50);
}
Instance of Symbol 17 MovieClip in Symbol 25 MovieClip Frame 1
onClipEvent (load) {
targetX = 0;
}
onClipEvent (enterFrame) {
targetX = ((_root.getBytesLoaded() / _root.getBytesTotal()) * 600) - _parent._x;
_x = (_x + ((targetX - _x) / 5));
}
Symbol 495 MovieClip [__Packages.FormInput] Frame 0
class FormInput extends MovieClip
{
var variable_p, form_mc, _parent, restrict_p, tf, maxChars_p, tabIndex_p, text, value, gotoAndPlay;
function FormInput () {
super();
variable = variable_p;
isRequired = required_p;
initTF();
form_mc = _parent;
var _local3 = 0;
while (_local3 < 10) {
if (form_mc instanceof FormMC) {
break;
}
form_mc = form_mc._parent;
_local3++;
}
form_mc.regFormInput(this);
recallValue();
}
function initTF() {
tf.restrict = restrict_p;
tf.maxChars = maxChars_p;
tf.onSetFocus = mx.utils.Delegate.create(this, onSetFocus);
tf.onKillFocus = mx.utils.Delegate.create(this, onKillFocus);
tf.tabIndex = tabIndex_p;
}
function onSetFocus() {
setNormal();
}
function onKillFocus() {
setValue(text);
}
function recallValue() {
if (!remember_p) {
return(undefined);
}
trace(" # recallValue");
var _local2 = rememberInfo_t[variable];
trace(" tValue:" + _local2);
if (_local2 != undefined) {
setValue(_local2);
text = _local2;
}
}
function setValue(value_a) {
value = value_a;
if (remember_p) {
rememberInfo_t[variable] = value;
}
}
function setError() {
if (status == "error") {
return(undefined);
}
status = "error";
gotoAndPlay("error");
}
function setNormal() {
if (status == "normal") {
return(undefined);
}
status = "normal";
gotoAndPlay("normal");
}
function clear() {
setValue(null);
text = "";
}
function validate() {
if (isRequired && ((value == "") || (value == undefined))) {
setError();
return(false);
}
if ((value == "") || (value == undefined)) {
return(true);
}
if (isEmail_p && (!validateEmail())) {
setError();
return(false);
}
return(true);
}
function validateEmail() {
var _local3 = value.indexOf("@");
var _local2 = value.lastIndexOf(".");
if ((_local3 < 0) || (_local2 < 0)) {
return(false);
}
if (_local3 > _local2) {
return(false);
}
if (_local3 < 1) {
return(false);
}
if ((_local2 - _local3) < 1) {
return(false);
}
if ((value.length - _local2) <= 1) {
return(false);
}
return(true);
}
function focus() {
Selection.setFocus(tf);
}
function onUnload() {
form_mc.removeFormInput(this);
}
function toString() {
return("[FormInput]");
}
var variable = "";
var isRequired = false;
var status = "normal";
static var rememberInfo_t = new Object();
var required_p = false;
var isEmail_p = false;
var remember_p = false;
}
Symbol 496 MovieClip [__Packages.FormMC] Frame 0
class FormMC extends MovieClip
{
var input_t, gotoAndPlay, _parent, content_mc, errorCode;
function FormMC () {
super();
trace(" # FormMC");
input_t = new Object();
}
function show(sendMessage_a) {
sendMessage = sendMessage_a;
if (isShowing) {
return(undefined);
}
isShowing = true;
status = "normal";
gotoAndPlay("show");
}
function hide() {
if (!isShowing) {
return(undefined);
}
isShowing = false;
status = "normal";
_parent.extraPanel_mc.onFormHide();
gotoAndPlay("hide");
}
function regFormInput(mc_a) {
input_t[mc_a.variable] = mc_a;
}
function removeFormInput(mc_a) {
delete input_t[mc_a.variable];
}
function submit() {
trace(" # submit");
var _local3 = true;
for (var _local4 in input_t) {
var _local2 = input_t[_local4];
if (_local2 == undefined) {
continue;
}
if (!_local2.validate()) {
trace((" " + _local2.variable) + " is invalid");
_local3 = false;
}
}
if (_local3) {
send();
}
}
function send() {
trace(" # send");
content_mc.gotoAndPlay("sending");
getDataID();
}
function getDataID() {
trace(" # getDataID");
var _local2 = Params.dataAppUrl;
trace(" tDataUrl:" + _local2);
Params.data = new FanCardModel(_local2);
var _local3 = {onSave:function (a) {
trace(" data saved:" + a);
if (Params.data.isError) {
trace(" error");
this.obj.onError();
} else {
trace(" returned id:" + Params.data.id);
this.obj.onDataIDLoad();
}
}, obj:this};
Params.data.addEventListener("onSave", _local3);
status = "sending";
Params.data.message = sendMessage;
trace(" sending:" + sendMessage);
Params.data.save();
}
function onDataIDLoad() {
sendEmail();
}
function sendEmail() {
trace(" # sendEmail");
var _local10 = Params.emailAppUrl;
var _local12 = Params.emailAppMethod;
trace(" tUrl:" + _local10);
trace(" tMethod:" + _local12);
var _local4 = new LoadVars();
var _local8 = new LoadVars();
_local4.fromEmail = input_t.fromEmail.value;
_local4.subject = Params.emailSubject;
_local4.captchaCode = input_t.captchaCode.value;
var _local6 = Params.emailMessage;
var _local9 = Params.receiverUrl;
_local9 = Util.replace(_local9, "##DATA_ID##", Params.data.id);
_local6 = Util.replace(_local6, "##ADD_MESSAGE##", input_t.addMessage.value);
_local6 = Util.replace(_local6, "##LINK##", _local9);
_local4.messageText = _local6;
trace(" tMessageText:" + _local6);
var _local5 = input_t.toEmail1.value;
var _local2 = 2;
while (_local2 < 5) {
var _local3 = input_t["toEmail" + _local2].value;
if (_local3 == undefined) {
} else {
_local5 = _local5 + ("," + _local3);
}
_local2++;
}
_local4.toEmail = _local5;
trace(" sending:" + _local4);
content_mc.debug_mc.sentOut = _local4;
_local8.obj = this;
_local8.onLoad = function (success_a) {
trace(" # onLoad");
this.obj.content_mc.debug_mc.receivedOut = this.toString();
trace(" received:" + success_a);
trace(" this:" + this);
trace(" success:" + this.success);
trace(" test:" + this.success.indexOf("true"));
trace(" test:" + (this.success.indexOf("true") >= 0));
var _local3 = (this.success != undefined) && (this.success.indexOf("true") >= 0);
var _local2 = this.errorCode;
trace(" tScriptSuccess:" + _local3);
trace(" tErrorCode:" + _local2);
if (!success_a) {
_local2 = "connection_failure";
this.obj.onError(_local2, "Url must be bad");
} else if (!_local3) {
this.obj.onError(_local2, "script did not work");
} else {
this.obj.onSendLoad(_local2);
}
};
_local4.sendAndLoad(_local10, _local8, _local12);
}
function onSendLoad(success_a) {
status = "success";
content_mc.gotoAndPlay("success");
}
function onError(errorCode_a, info_a) {
trace(" # onError");
status = "error";
errorCode = errorCode_a;
if (errorCode.indexOf("captcha_incorrect") >= 0) {
content_mc.captcha_mc.loadImage();
content_mc.captchaCode_mc.clear();
content_mc.gotoAndPlay("form_error");
} else {
content_mc.out_text = (((content_mc.out_text.raw_data + "\r") + errorCode_a) + ":") + info_a;
content_mc.gotoAndPlay("error");
}
trace(" error_text:" + content_mc.error_text);
}
var isShowing = false;
var sendMessage = "";
var status = "normal";
var error_text = "";
}
Symbol 497 MovieClip [__Packages.Params] Frame 0
class Params extends Object
{
function Params () {
super();
}
}
Symbol 498 MovieClip [__Packages.FanCardModel] Frame 0
class FanCardModel
{
var _url, _currId, _currMsg, dispatchEvent;
function FanCardModel (u) {
mx.events.EventDispatcher.initialize(this);
_url = u;
}
function load() {
var _local2 = new LoadVars();
_local2.onData = mx.utils.Delegate.create(this, function (response) {
if (response == undefined) {
this._error = true;
this.onLoad(false);
} else {
this._error = false;
this.handleLoad(response);
}
});
_local2.id = _currId;
_local2.op = "load";
_local2.sendAndLoad(_url, _local2, "POST");
}
function handleLoad(msg) {
_currMsg = msg;
dispatchEvent({type:"onLoad", target:this});
}
function save() {
var _local2 = new LoadVars();
_local2.onData = mx.utils.Delegate.create(this, function (response) {
if (response == undefined) {
this._error = true;
this.onLoad(false);
this.handleSave(0);
} else {
this._error = false;
this.handleSave(response);
}
});
_local2.type = _type;
_local2.dataString = _currMsg;
_local2.op = "save";
_local2.sendAndLoad(_url, _local2, "POST");
}
function handleSave(id) {
_currId = id;
dispatchEvent({type:"onSave", target:this});
}
function get isError() {
return(_error);
}
function get id() {
return(_currId);
}
function set id(id) {
_currId = id;
//return(this.id);
}
function get message() {
return(_currMsg);
}
function set message(msg) {
_currMsg = msg;
//return(message);
}
var _type = 1;
var _error = true;
}
Symbol 499 MovieClip [__Packages.mx.events.EventDispatcher] Frame 0
class mx.events.EventDispatcher
{
function EventDispatcher () {
}
static function _removeEventListener(queue, event, handler) {
if (queue != undefined) {
var _local4 = queue.length;
var _local1;
_local1 = 0;
while (_local1 < _local4) {
var _local2 = queue[_local1];
if (_local2 == handler) {
queue.splice(_local1, 1);
return(undefined);
}
_local1++;
}
}
}
static function initialize(object) {
if (_fEventDispatcher == undefined) {
_fEventDispatcher = new mx.events.EventDispatcher();
}
object.addEventListener = _fEventDispatcher.addEventListener;
object.removeEventListener = _fEventDispatcher.removeEventListener;
object.dispatchEvent = _fEventDispatcher.dispatchEvent;
object.dispatchQueue = _fEventDispatcher.dispatchQueue;
}
function dispatchQueue(queueObj, eventObj) {
var _local7 = "__q_" + eventObj.type;
var _local4 = queueObj[_local7];
if (_local4 != undefined) {
var _local5;
for (_local5 in _local4) {
var _local1 = _local4[_local5];
var _local3 = typeof(_local1);
if ((_local3 == "object") || (_local3 == "movieclip")) {
if (_local1.handleEvent != undefined) {
_local1.handleEvent(eventObj);
}
if (_local1[eventObj.type] != undefined) {
if (exceptions[eventObj.type] == undefined) {
_local1[eventObj.type](eventObj);
}
}
} else {
_local1.apply(queueObj, [eventObj]);
}
}
}
}
function dispatchEvent(eventObj) {
if (eventObj.target == undefined) {
eventObj.target = this;
}
this[eventObj.type + "Handler"](eventObj);
dispatchQueue(this, eventObj);
}
function addEventListener(event, handler) {
var _local3 = "__q_" + event;
if (this[_local3] == undefined) {
this[_local3] = new Array();
}
_global.ASSetPropFlags(this, _local3, 1);
_removeEventListener(this[_local3], event, handler);
this[_local3].push(handler);
}
function removeEventListener(event, handler) {
var _local2 = "__q_" + event;
_removeEventListener(this[_local2], event, handler);
}
static var _fEventDispatcher = undefined;
static var exceptions = {move:1, draw:1, load:1};
}
Symbol 500 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 501 MovieClip [__Packages.Util] Frame 0
class Util extends Object
{
function Util () {
super();
}
static function replace(str_a, find_a, replace_a) {
var _local2 = str_a.split(find_a);
var _local1 = _local2.join(replace_a);
return(_local1);
}
static function trimWhite(str_a) {
while ((str_a.charCodeAt(0) < 33) && (str_a.charCodeAt(0) > 4)) {
str_a = str_a.substring(1, str_a.length);
}
while ((str_a.charCodeAt(str_a.length - 1) < 33) && (str_a.charCodeAt(str_a.length - 1) > 4)) {
str_a = str_a.substring(0, str_a.length - 1);
}
return(str_a);
}
}
Symbol 502 MovieClip [__Packages.MessageFormInput] Frame 0
class MessageFormInput extends FormInput
{
var value, text;
function MessageFormInput () {
super();
value = text;
}
function toString() {
return("[MessageFormInput]");
}
var variable_p = "addMessage";
var maxChars_p = 200;
var required_p = true;
var isEmail_p = false;
var tabIndex_p = 10;
}
Symbol 503 MovieClip [__Packages.MouseChecker] Frame 0
class MouseChecker extends MovieClip
{
static var instance, overList_t;
var btn, nextFrame, _parent, hitTest, onEnterFrame;
function MouseChecker () {
super();
instance = this;
overList_t = new Object();
btn.useHandCursor = false;
}
function onMouseOverBanner() {
mouseIsOver = true;
nextFrame();
_parent.onMouseOverUnit();
}
function onMouseOutBanner() {
mouseIsOver = false;
_parent.onMouseOutUnit();
}
function onHitRollOver() {
tempMouseIsOver = true;
onMouseOverBanner();
}
function onHitRollOut() {
tempMouseIsOver = false;
checkNextFrame();
}
function onMouseMove() {
if (hitTest(_root._xmouse, _root._ymouse)) {
_parent.onInt();
}
}
function onMouseDown() {
if (hitTest(_root._xmouse, _root._ymouse)) {
_parent.onInt();
}
}
function onKeyDown() {
_parent.onInt();
}
static function overItem(id_a) {
overList_t[id_a] = true;
instance.onMouseOverBanner();
}
static function outItem(id_a) {
delete overList_t[id_a];
instance.checkNextFrame();
}
function checkNextFrame() {
checkTimer = 0;
onEnterFrame = function () {
this.checkTimer++;
if (this.checkTimer > this.checkWait) {
delete this.onEnterFrame;
var _local2 = false;
for (var _local3 in MouseChecker.overList_t) {
_local2 = true;
break;
}
if ((!this.tempMouseIsOver) && (!_local2)) {
this.onMouseOutBanner();
}
}
};
}
var tempMouseIsOver = false;
var mouseIsOver = false;
var checkWait = 3;
var checkTimer = 0;
}
Symbol 36 MovieClip Frame 10
stop();
Symbol 51 MovieClip Frame 1
stop();
Symbol 51 MovieClip Frame 2
stop();
Symbol 52 MovieClip Frame 1
stop();
allowChange = 0;
onEnterFrame = function () {
if (_parent._currentframe == 1) {
allowChange = allowChange + 1;
} else {
allowChange = 0;
gotoAndStop (1);
}
if (allowChange > 5) {
if (((_root.game.gameMode == "fieldGoal") and (_root.game.tdMode == false)) and (_root.game.ball.target.team == 1)) {
if (_currentframe != 2) {
cover.gotoAndPlay(1);
}
gotoAndStop ("fieldGoal");
}
if ((_root.game.tdMode != false) and (_root.game.ball.target.team == _root.game.playersTeam)) {
if (_currentframe != 5) {
cover.gotoAndPlay(1);
}
gotoAndStop ("extraPoint");
}
if ((_root.game.gameMode == "punt") and (_root.game.ball.target.team == _root.game.playersTeam)) {
if (_currentframe != 4) {
cover.gotoAndPlay(1);
}
gotoAndStop ("punt");
}
if ((((_root.game.ball.target.team == _root.game.playersTeam) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.tdMode == false)) {
if (_currentframe != 7) {
cover.gotoAndPlay(1);
}
gotoAndStop ("offense");
}
if (((_root.game.ball.target.team == _root.game.compTeam) and (_root.game.gameMode == "scrum")) || (_root.game.ball.target.team == _root.game.compTeam)) {
if (_currentframe != 6) {
cover.gotoAndPlay(1);
}
gotoAndStop ("defense");
}
}
if (_root.game.gameMode == "kickOff") {
if (_parent._currentframe != 22) {
_parent.play();
}
}
if ((((_parent._currentframe == 22) and (_root.game.gameMode != "kickOff")) and (_root.game.showInstructions == true)) and (_root.game.gameMode != "plays")) {
_parent.play();
}
if (_root.game.gameMode == "plays") {
}
};
Instance of Symbol 36 MovieClip "cover" in Symbol 52 MovieClip Frame 1
onClipEvent (load) {
storedFrame = _parent._currentframe;
}
onClipEvent (enterFrame) {
if (_parent._currentframe != storedFrame) {
gotoAndPlay (1);
storedFrame = _parent._currentframe;
}
}
Instance of Symbol 51 MovieClip in Symbol 52 MovieClip Frame 7
onClipEvent (enterFrame) {
if (_root.game.playType == "passing") {
gotoAndStop (1);
} else {
gotoAndStop (2);
}
}
Symbol 60 Button
on (release, keyPress "<Enter>") {
onHitRelease();
}
on (rollOver) {
onHitRollOver();
MouseChecker.overItem("view");
}
on (rollOut) {
onHitRollOut();
MouseChecker.outItem("view");
}
Symbol 66 MovieClip Frame 1
function onHitRollOver() {
gotoAndPlay ("over");
}
function onHitRollOut() {
if (_parent.isInTF) {
gotoAndPlay ("pulse_out");
} else {
gotoAndPlay ("out");
}
}
function startPulse() {
gotoAndPlay ("pulse_start");
}
gotoAndStop ("idle");
Symbol 66 MovieClip Frame 27
stop();
Symbol 66 MovieClip Frame 43
gotoAndStop ("idle");
Instance of Symbol 66 MovieClip in Symbol 67 MovieClip Frame 1
onClipEvent (enterFrame) {
function onHitRelease() {
if ((_root.game.vibrate == false) and (_root.game.gameMode == "scrum")) {
_root.game.vibrate = true;
_root.game.gameMode = "plays";
}
if (((_root.game.vibrate == false) and (_root.game.gameMode == "punt")) || ((_root.game.vibrate == false) and (_root.game.gameMode == "fieldGoal"))) {
_root.game.vibrate = true;
}
if (_root.game.started == false) {
_root.game.started = true;
}
if ((((_root.game.gameMode == "punt") and (_root.game.ball.target.team == 1)) || ((_root.game.gameMode == "fieldGoal") and (_root.game.ball.target.team == 1))) || ((_root.game.gameMode == "puntSafety") and (_root.game.ball.target.team == 1))) {
_root.game.powerBar.kickBall();
_root.game.vibrate = true;
}
if ((_root.game.gameMode == "kickOff") and (_root.game.ball.target.team == 1)) {
_root.game.powerBar.kickBall();
_root.game.vibrate = true;
}
if ((((_root.game.gameMode == "punt") and (_root.game.ball.target.team == 2)) || ((_root.game.gameMode == "fieldGoal") and (_root.game.ball.target.team == 2))) || ((_root.game.gameMode == "puntSafety") and (_root.game.ball.target.team == 2))) {
_root.game.powerBar.kickBall2();
_root.game.vibrate = true;
}
if ((_root.game.gameMode == "kickOff") and (_root.game.ball.target.team == 2)) {
_root.game.powerBar.kickBall2();
_root.game.vibrate = true;
}
}
label.text = "VIBRATE";
}
Instance of Symbol 66 MovieClip in Symbol 67 MovieClip Frame 2
onClipEvent (enterFrame) {
function onHitRelease() {
if ((((_root.game.gameMode == "punt") and (_root.game.ball.target.team == 2)) || ((_root.game.gameMode == "fieldGoal") and (_root.game.ball.target.team == 2))) || ((_root.game.gameMode == "puntSafety") and (_root.game.ball.target.team == 2))) {
_root.game.powerBar.kickBall2();
_root.game.vibrate = true;
}
if ((_root.game.gameMode == "kickOff") and (_root.game.ball.target.team == 2)) {
_root.game.powerBar.kickBall2();
_root.game.vibrate = true;
}
if ((((_root.game.gameMode == "punt") and (_root.game.ball.target.team == 1)) || ((_root.game.gameMode == "fieldGoal") and (_root.game.ball.target.team == 1))) || ((_root.game.gameMode == "puntSafety") and (_root.game.ball.target.team == 1))) {
_root.game.powerBar.kickBall();
_root.game.vibrate = true;
}
if ((_root.game.gameMode == "kickOff") and (_root.game.ball.target.team == 1)) {
_root.game.powerBar.kickBall();
_root.game.vibrate = true;
}
}
label.text = "KICK";
}
Instance of Symbol 66 MovieClip in Symbol 67 MovieClip Frame 3
onClipEvent (enterFrame) {
function onHitRelease() {
if ((_root.game.quarter == 1) and (_root.game.secs == 45)) {
}
if (_root.game.makeKick == false) {
_root.game.makeKick = true;
}
_root.game.started = true;
if ((((_root.game.gameMode == "punt") and (_root.game.ball.target.team == 2)) || ((_root.game.gameMode == "fieldGoal") and (_root.game.ball.target.team == 2))) || ((_root.game.gameMode == "puntSafety") and (_root.game.ball.target.team == 2))) {
_root.game.powerBar.kickBall2();
_root.game.vibrate = true;
}
if ((_root.game.gameMode == "kickOff") and (_root.game.ball.target.team == 2)) {
_root.game.powerBar.kickBall2();
_root.game.vibrate = true;
}
if ((((_root.game.gameMode == "punt") and (_root.game.ball.target.team == 1)) || ((_root.game.gameMode == "fieldGoal") and (_root.game.ball.target.team == 1))) || ((_root.game.gameMode == "puntSafety") and (_root.game.ball.target.team == 1))) {
_root.game.powerBar.kickBall();
_root.game.vibrate = true;
}
if ((_root.game.gameMode == "kickOff") and (_root.game.ball.target.team == 1)) {
_root.game.powerBar.kickBall();
_root.game.vibrate = true;
}
}
label.text = "KICK OFF";
}
Instance of Symbol 66 MovieClip in Symbol 67 MovieClip Frame 4
onClipEvent (enterFrame) {
function onHitRelease() {
if ((((_root.game.gameMode == "punt") and (_root.game.ball.target.team == 2)) || ((_root.game.gameMode == "fieldGoal") and (_root.game.ball.target.team == 2))) || ((_root.game.gameMode == "puntSafety") and (_root.game.ball.target.team == 2))) {
_root.game.powerBar.kickBall2();
_root.game.vibrate = true;
}
if ((_root.game.gameMode == "kickOff") and (_root.game.ball.target.team == 2)) {
_root.game.powerBar.kickBall2();
_root.game.vibrate = true;
}
if ((((_root.game.gameMode == "punt") and (_root.game.ball.target.team == 1)) || ((_root.game.gameMode == "fieldGoal") and (_root.game.ball.target.team == 1))) || ((_root.game.gameMode == "puntSafety") and (_root.game.ball.target.team == 1))) {
_root.game.powerBar.kickBall();
_root.game.vibrate = true;
}
if ((_root.game.gameMode == "kickOff") and (_root.game.ball.target.team == 1)) {
_root.game.powerBar.kickBall();
_root.game.vibrate = true;
}
}
label.text = "PUNT";
}
Instance of Symbol 67 MovieClip in Symbol 68 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.game.gameMode == "kickOff") {
gotoAndStop (3);
} else {
if (((((_root.game.gameMode == "punt") and (_root.game.ball.target.team == _root.game.playersTeam)) || ((_root.game.gameMode == "fieldGoal") and (_root.game.ball.target.team == _root.game.playersTeam))) || ((_root.game.gameMode == "kickOff") and (_root.game.ball.target.team == _root.game.playersTeam))) || ((_root.game.gameMode == "puntSafety") and (_root.game.ball.target.team == _root.game.playersTeam))) {
if (_root.game.gameMode == "fieldGoal") {
gotoAndStop (2);
} else {
gotoAndStop (4);
}
} else {
gotoAndStop (1);
}
if ((((((_root.game.gameMode == "scrum") and (_root.game.paused == false)) || ((_currentframe == 2) and (_root.game.paused == false))) || (((_root.game.ball.target.team == _root.game.compTeam) and (_root.game.gameMode != "plays")) and (_root.game.paused == false))) || ((_root.game.gameMode == "fieldGoal") and (_root.game.paused == false))) || ((_root.game.gameMode == "kickOff") and (_root.game.paused == false))) {
if (_alpha < 100) {
_alpha = (_alpha + 10);
}
} else if (_alpha > 0) {
}
}
}
Symbol 70 MovieClip Frame 1
stop();
Symbol 73 MovieClip Frame 1
stop();
Instance of Symbol 70 MovieClip in Symbol 74 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop (2);
}
Symbol 74 MovieClip Frame 10
stop();
Symbol 76 Button
on (release) {
play();
_root.game.showInstructions = false;
}
Symbol 77 Button
on (release) {
if ((_root.game.gameMode == "kickOff") and (_root.game.ball.target.team == 1)) {
} else {
_parent.play();
_root.game.showInstructions = true;
}
}
Symbol 81 MovieClip Frame 1
stop();
sym.gotoAndStop(2);
Symbol 81 MovieClip Frame 22
stop();
sym.gotoAndStop(2);
Instance of Symbol 78 MovieClip in Symbol 81 MovieClip Frame 22
onClipEvent (enterFrame) {
if ((((_root.game.gameMode == "kickOff") and (_root.game.ball.target.team == 2)) and (_root.game.quarter == 1)) and (_root.game.secs == _root.game.defaultSecs)) {
_alpha = 0;
} else {
_alpha = 100;
}
}
Instance of Symbol 80 MovieClip in Symbol 81 MovieClip Frame 22
onClipEvent (enterFrame) {
if ((((_root.game.gameMode == "kickOff") and (_root.game.ball.target.team == 2)) and (_root.game.quarter == 1)) and (_root.game.secs == _root.game.defaultSecs)) {
_alpha = 0;
} else {
_alpha = 100;
}
}
Symbol 81 MovieClip Frame 44
gotoAndStop (1);
Symbol 84 MovieClip Frame 1
stop();
Symbol 90 MovieClip Frame 1
stop();
Symbol 94 MovieClip Frame 1
function onHitRollOver() {
gotoAndPlay ("over");
}
function onHitRollOut() {
if (_parent.isInTF) {
gotoAndPlay ("pulse_out");
} else {
gotoAndPlay ("out");
}
}
function startPulse() {
gotoAndPlay ("pulse_start");
}
gotoAndStop ("idle");
Symbol 94 MovieClip Frame 27
stop();
Symbol 94 MovieClip Frame 43
gotoAndStop ("idle");
Symbol 105 Button
on (release) {
stopAllSounds();
_root.game.newMatch(2);
gotoAndStop (1);
}
Symbol 108 Button
on (release) {
stopAllSounds();
_root.game.newMatch(1);
gotoAndStop (1);
}
Instance of Symbol 81 MovieClip in Symbol 109 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop (22);
}
Instance of Symbol 90 MovieClip "muteButton" in Symbol 109 MovieClip Frame 1
on (release) {
_root.muteGame();
}
on (rollOver) {
glow.gotoAndStop(2);
}
on (rollOut, dragOut) {
glow.gotoAndStop(1);
}
Instance of Symbol 94 MovieClip in Symbol 109 MovieClip Frame 2
onClipEvent (enterFrame) {
function onHitRelease() {
_parent.stopAllSounds();
_parent.gotoAndStop(3);
}
label.text = "START GAME";
}
Symbol 112 Button
on (release) {
_parent.passesNum = _parent.passesNum + 1;
_parent.ball.target = "";
_parent.ball.targetX = _parent._xmouse;
_parent.ball.targetY = _parent._ymouse - 6;
var dx = (_parent.ball.targetX - _parent.ball._x);
var dy = (_parent.ball.targetY - _parent.ball._y);
var dist = Math.sqrt((dx * dx) + (dy * dy));
_parent.ball.xspeed = dx / (dist / 10);
_parent.ball.yspeed = dy / (dist / 10);
_parent.ball.zspeed = -(dist / 20);
_parent.ball.zpos = 4;
}
Symbol 137 MovieClip Frame 1
stop();
Symbol 139 MovieClip Frame 1
stop();
Symbol 139 MovieClip Frame 59
stop();
Symbol 142 Button
on (press) {
var offsetX = (_parent._x - _root.game._xmouse);
var offsetY = (_parent._y - _root.game._ymouse);
dragging = true;
}
on (release, releaseOutside) {
dragging = false;
}
Symbol 143 MovieClip Frame 1
stop();
Symbol 161 MovieClip Frame 1
stop();
Symbol 179 MovieClip Frame 1
stop();
Symbol 197 MovieClip Frame 1
stop();
Symbol 198 MovieClip Frame 1
stop();
Instance of Symbol 143 MovieClip in Symbol 198 MovieClip Frame 1
onClipEvent (load) {
dragging = false;
}
onClipEvent (enterFrame) {
var amount = -5;
if (((_root.game.gameMode == "scrum") and (_parent.team == _root.game.playersTeam)) || (((_root.game.gameMode == "fieldGoal") and (_parent.team == _root.game.playersTeam)) and (_root.game.ball.target.team != _root.game.playersTeam))) {
gotoAndStop (2);
} else {
gotoAndStop (1);
}
if (dragging == true) {
if (_root.game.scrimmageHit.hitTest(_root._xmouse, _root._ymouse + 10, true) || (_root.game.walls.hitTest(_root._xmouse, _root._ymouse + 10, true))) {
dragging = false;
} else {
_parent._x = _root.game._xmouse + offsetX;
_parent._y = _root.game._ymouse + offsetY;
}
}
if ((_root.game.scrimmageHit.hitTest(_parent.xpos - 5, _parent.ypos, true) and (_currentframe == 2)) and (_parent.team == 2)) {
_parent._x = _parent._x + 2;
}
if ((_root.game.scrimmageHit.hitTest(_parent.xpos + 5, _parent.ypos, true) and (_currentframe == 2)) and (_parent.team == 1)) {
_parent._x = _parent._x - 2;
}
if ((_root.game.walls.hitTest(_parent.xpos + 10, _parent.ypos, true) and (_currentframe == 2)) and (_parent._x > 425)) {
_parent._x = _parent._x - 2;
}
if (_root.game.walls.hitTest(_parent.xpos, _parent.ypos - 5, true) and (_currentframe == 2)) {
_parent._y = _parent._y + 2;
}
if (_root.game.walls.hitTest(_parent.xpos, _parent.ypos + 5, true) and (_currentframe == 2)) {
_parent._y = _parent._y - 2;
}
}
Symbol 209 Button
on (press) {
knob._x = _xmouse;
}
Symbol 218 MovieClip Frame 10
stop();
Symbol 219 MovieClip Frame 1
stop();
Instance of Symbol 215 MovieClip in Symbol 219 MovieClip Frame 1
onClipEvent (enterFrame) {
if ((_root.game.vibrate == true) and (_root.game.paused == false)) {
play();
} else {
gotoAndStop (1);
}
}
Instance of Symbol 218 MovieClip in Symbol 219 MovieClip Frame 2
onClipEvent (load) {
if (_currentframe == 1) {
play();
}
}
Instance of Symbol 219 MovieClip "knob" in Symbol 220 MovieClip Frame 1
onClipEvent (enterFrame) {
var offset = 5;
_root.game.vibrationVal = (((_x - _parent.bar._x) / (_parent.bar._width / 2)) / 2) + 0.5;
if (drag == true) {
if ((_parent._xmouse < (_parent.bar._x + (_parent.bar._width - offset))) and (_parent._xmouse > (_parent.bar._x + offset))) {
_x = _parent._xmouse;
}
if (_parent._xmouse < (_parent.bar._x + offset)) {
_x = (_parent.bar._x + offset);
}
if (_parent._xmouse > (_parent.bar._x + (_parent.bar._width - offset))) {
_x = (_parent.bar._x + (_parent.bar._width - offset));
}
}
}
on (press) {
var drag = true;
}
on (release, releaseOutside) {
var drag = false;
}
on (rollOver, dragOver) {
gotoAndStop (2);
}
on (rollOut, dragOut) {
gotoAndStop (1);
}
Symbol 227 Button
on (release) {
if ((((_root.game.gameMode == "punt") and (_root.game.ball.target.team == 2)) || ((_root.game.gameMode == "fieldGoal") and (_root.game.ball.target.team == 2))) || ((_root.game.gameMode == "puntSafety") and (_root.game.ball.target.team == 2))) {
_root.game.powerBar.kickBall2();
_root.game.vibrate = true;
}
if ((_root.game.gameMode == "kickOff") and (_root.game.ball.target.team == 2)) {
_root.game.powerBar.kickBall2();
_root.game.vibrate = true;
}
if ((((_root.game.gameMode == "punt") and (_root.game.ball.target.team == 1)) || ((_root.game.gameMode == "fieldGoal") and (_root.game.ball.target.team == 1))) || ((_root.game.gameMode == "puntSafety") and (_root.game.ball.target.team == 1))) {
_root.game.powerBar.kickBall();
_root.game.vibrate = true;
}
if ((_root.game.gameMode == "kickOff") and (_root.game.ball.target.team == 1)) {
_root.game.powerBar.kickBall();
_root.game.vibrate = true;
}
}
Symbol 229 MovieClip Frame 1
stop();
Instance of Symbol 228 MovieClip in Symbol 229 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_parent._alpha == 100) {
gotoAndStop (2);
} else {
gotoAndStop (1);
}
}
Symbol 229 MovieClip Frame 30
stop();
Symbol 242 MovieClip Frame 1
onPress = function () {
gotoAndStop (3);
};
onRelease = function () {
gotoAndStop (2);
};
var rolledOff = true;
stop();
Symbol 245 MovieClip Frame 45
stop();
Symbol 257 MovieClip Frame 1
_root.game.changeMode = false;
_root.game.situation = false;
changeTimer = 0;
changeTimer2 = 0;
setFormation = "";
chosenFormation = "";
setupType = "";
this.onEnterFrame = function () {
if ((_currentframe != 1) and (_root.game.tdMode == true)) {
_root.game.downs = 0;
}
changeTimer = changeTimer + 1;
changeTimer2 = changeTimer2 + 1;
if (setupType == "quarterFix") {
if (changeTimer2 == 1) {
if ((_root.game.quarterChange == true) and (_root.game.compPlayType != "defense")) {
var _local2 = random(2);
if (_local2 == 1) {
_root.game.compPlayType = "passing";
_root.game.setupLine(compTeam, _root.game.formationShotgun, tackleX, 0);
} else {
_root.game.compPlayType = "running";
_root.game.setupLine(compTeam, _root.game.formationI, tackleX, 0);
}
}
}
if (changeTimer2 == 2) {
if (_root.game.compPlayType == "running") {
if (_root.game.playersTeam == 1) {
}
} else if (_root.game.playersTeam == 1) {
}
}
}
if (setupType == "regular") {
if (changeTimer == 1) {
_root.game.setupLine(_root.game.playersTeam, chosenFormation, _root.game.scrimmage, 0);
if ((_root.game.goForIt == true) || (_root.game.quarterChange == true)) {
var _local2 = 1 + random(5);
_root.game.compPlayType = "defense";
_root.game.setupLine(_root.game.compTeam, _root.game["formationDefence" + _local2], _root.game.scrimmage, 0);
}
}
if (changeTimer == 2) {
if (_root.game.playType == "running") {
if (_root.game.playersTeam == 1) {
}
} else if (_root.game.playersTeam == 1) {
}
}
} else if (setupType == "punt") {
if ((changeTimer == 5) || (changeTimer == 2)) {
_root.game.setupPunt(2, scrimmage);
}
}
if ((_root.game.gameMode == "kickOff") || (_root.game.paused == true)) {
lastPlay = "";
}
};
if ((_root.game.gameMode == "kickOff") || (_root.game.paused == true)) {
lastPlay = "";
}
stop();
_root.game.blitz = false;
Symbol 257 MovieClip Frame 2
_root.game.playType = "defense";
_root.game.setupLine(_root.game.playersTeam, _root.game.formation43, _root.game.scrimmage, 0);
setupType = "quarterFix";
changeTimer2 = 0;
lastPlay = "4-3 COVER";
_root.game.blitz = false;
Instance of Symbol 242 MovieClip in Symbol 257 MovieClip Frame 2
on (rollOver) {
gotoAndStop (2);
}
on (rollOut, dragOut) {
gotoAndStop (1);
}
on (release) {
_parent.nextFrame();
}
Instance of Symbol 242 MovieClip "changeF" in Symbol 257 MovieClip Frame 2
on (rollOver) {
gotoAndStop (2);
}
on (rollOut, dragOut) {
gotoAndStop (1);
}
on (release) {
_parent.gotoAndStop(5);
}
onClipEvent (enterFrame) {
function beingPressed() {
_parent.nextFrame();
}
}
Instance of Symbol 246 MovieClip in Symbol 257 MovieClip Frame 2
/* no clip actions */
Symbol 257 MovieClip Frame 3
_root.game.playType = "defense";
_root.game.setupLine(_root.game.playersTeam, _root.game.formation52, _root.game.scrimmage, 0);
setupType = "quarterFix";
changeTimer2 = 0;
lastPlay = "5-2 COVER";
_root.game.blitz = false;
Instance of Symbol 242 MovieClip "changeF" in Symbol 257 MovieClip Frame 3
on (rollOver) {
gotoAndStop (2);
}
on (rollOut, dragOut) {
gotoAndStop (1);
}
on (release) {
_parent.prevFrame();
}
onClipEvent (enterFrame) {
function beingPressed() {
_parent.nextFrame();
}
}
Symbol 257 MovieClip Frame 4
_root.game.playType = "defense";
_root.game.setupLine(_root.game.playersTeam, _root.game.formationDefence3, _root.game.scrimmage, 0);
setupType = "quarterFix";
changeTimer2 = 0;
lastPlay = "DIME";
_root.game.blitz = false;
Symbol 257 MovieClip Frame 5
_root.game.playType = "defense";
_root.game.setupLine(_root.game.playersTeam, _root.game.formationDefence4, _root.game.scrimmage, 0);
setupType = "quarterFix";
changeTimer2 = 0;
lastPlay = "4-3 BLITZ";
_root.game.blitz = true;
Instance of Symbol 242 MovieClip in Symbol 257 MovieClip Frame 5
on (rollOver) {
gotoAndStop (2);
}
on (rollOut, dragOut) {
gotoAndStop (1);
}
on (release) {
_parent.gotoAndStop(2);
}
Instance of Symbol 242 MovieClip "changeF" in Symbol 257 MovieClip Frame 5
on (rollOver) {
gotoAndStop (2);
}
on (rollOut, dragOut) {
gotoAndStop (1);
}
on (release) {
_parent.prevFrame();
}
onClipEvent (enterFrame) {
function beingPressed() {
_parent.gotoAndStop(2);
}
}
Symbol 257 MovieClip Frame 10
_root.game.playType = "passing";
if (((_root.game.gameMode == "punt") || (_root.game.gameMode == "fieldGoal")) || (_root.game.tdMode != false)) {
_root.game.changeMode = true;
_root.game.goForIt = true;
}
storedFrame = _currentframe;
lastPlay = "SHOTGUN-PASS";
setupType = "regular";
changeTimer = 0;
chosenFormation = _root.game.formationShotgun;
Instance of Symbol 242 MovieClip in Symbol 257 MovieClip Frame 10
on (rollOver) {
gotoAndStop (2);
}
on (rollOut, dragOut) {
gotoAndStop (1);
}
on (release) {
_parent.nextFrame();
}
Instance of Symbol 242 MovieClip "changeF" in Symbol 257 MovieClip Frame 10
on (rollOver) {
gotoAndStop (2);
}
on (rollOut, dragOut) {
gotoAndStop (1);
}
on (release) {
if ((_root.game.situation == false) and (_root.game.tdMode == false)) {
_parent.gotoAndStop(13);
} else if ((_root.game.situation == "fieldGoal") || ((_root.game.tdMode != false) and (_root.game.downs == 0))) {
_parent.gotoAndStop(20);
} else {
_parent.gotoAndStop(21);
}
}
onClipEvent (enterFrame) {
function beingPressed() {
_parent.nextFrame();
}
}
Symbol 257 MovieClip Frame 11
_root.game.playType = "passing";
if (((_root.game.gameMode == "punt") || (_root.game.gameMode == "fieldGoal")) || (_root.game.tdMode != false)) {
_root.game.changeMode = true;
_root.game.goForIt = true;
}
storedFrame = _currentframe;
lastPlay = "WING-PASS";
setupType = "regular";
changeTimer = 0;
chosenFormation = _root.game.formationPass2;
Instance of Symbol 242 MovieClip "changeF" in Symbol 257 MovieClip Frame 11
on (rollOver) {
gotoAndStop (2);
}
on (rollOut, dragOut) {
gotoAndStop (1);
}
on (release) {
_parent.prevFrame();
}
onClipEvent (enterFrame) {
function beingPressed() {
_parent.nextFrame();
}
}
Symbol 257 MovieClip Frame 12
_root.game.playType = "running";
if (((_root.game.gameMode == "punt") || (_root.game.gameMode == "fieldGoal")) || (_root.game.tdMode != false)) {
_root.game.changeMode = true;
_root.game.goForIt = true;
}
storedFrame = _currentframe;
lastPlay = "I FORM-RUN";
setupType = "regular";
changeTimer = 0;
chosenFormation = _root.game.formationI;
Symbol 257 MovieClip Frame 13
_root.game.playType = "running";
if (((_root.game.gameMode == "punt") || (_root.game.gameMode == "fieldGoal")) || (_root.game.tdMode != false)) {
_root.game.goForIt = true;
_root.game.changeMode = true;
}
storedFrame = _currentframe;
lastPlay = "PISTOL-RUN";
setupType = "regular";
changeTimer = 0;
chosenFormation = _root.game.formationRun2;
Instance of Symbol 242 MovieClip in Symbol 257 MovieClip Frame 13
on (rollOver) {
gotoAndStop (2);
}
on (rollOut, dragOut) {
gotoAndStop (1);
}
on (release) {
if ((_root.game.situation == false) and (_root.game.tdMode == false)) {
_parent.gotoAndStop(10);
} else if ((_root.game.situation == "fieldGoal") || ((_root.game.tdMode != false) and (_root.game.downs == 0))) {
_parent.gotoAndStop(20);
} else {
_parent.gotoAndStop(21);
}
}
Instance of Symbol 242 MovieClip "changeF" in Symbol 257 MovieClip Frame 13
on (rollOver) {
gotoAndStop (2);
}
on (rollOut, dragOut) {
gotoAndStop (1);
}
on (release) {
_parent.prevFrame();
}
onClipEvent (enterFrame) {
function beingPressed() {
if ((_root.game.situation == false) and (_root.game.tdMode == false)) {
_parent.gotoAndStop(10);
} else if ((_root.game.situation == "fieldGoal") || ((_root.game.tdMode != false) and (_root.game.downs == 0))) {
_parent.gotoAndStop(20);
} else {
_parent.gotoAndStop(21);
}
}
}
Symbol 257 MovieClip Frame 20
if (_root.game.gameMode != "fieldGoal") {
_root.game.playType = "kick";
_root.game.downCounted = true;
_root.game.changeMode = false;
_root.game.gameMode = "resetKick";
if (_root.game.tdMode == false) {
}
}
Instance of Symbol 242 MovieClip in Symbol 257 MovieClip Frame 20
on (rollOver) {
gotoAndStop (2);
}
on (rollOut, dragOut) {
gotoAndStop (1);
}
on (release) {
_parent.gotoAndStop(10);
}
Instance of Symbol 242 MovieClip "changeF" in Symbol 257 MovieClip Frame 20
on (rollOver) {
gotoAndStop (2);
}
on (rollOut, dragOut) {
gotoAndStop (1);
}
on (release) {
_parent.gotoAndStop(13);
}
onClipEvent (enterFrame) {
function beingPressed() {
_parent.gotoAndStop(10);
}
}
Symbol 257 MovieClip Frame 21
if (_root.game.gameMode != "punt") {
_root.game.playType = "kick";
_root.game.downCounted = true;
_root.game.changeMode = false;
_root.game.gameMode = "resetKick";
}
Symbol 288 MovieClip Frame 1
stop();
Symbol 333 MovieClip Frame 239
Symbol 370 MovieClip Frame 1
_parent.stop();
Symbol 370 MovieClip Frame 67
_root.game.goalScored(_root.game.ball.target.team);
_parent.gotoAndStop(1);
Symbol 388 MovieClip Frame 1
_parent.stop();
Symbol 388 MovieClip Frame 63
_parent.gotoAndStop(1);
Symbol 393 MovieClip Frame 39
stop();
Symbol 399 MovieClip Frame 1
_parent.stop();
Instance of Symbol 393 MovieClip in Symbol 399 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.game.lastTeam == 1) {
_xscale = -100;
} else {
_xscale = 100;
}
}
Symbol 399 MovieClip Frame 101
_parent.gotoAndStop(1);
Symbol 405 MovieClip Frame 1
_parent.stop();
Symbol 405 MovieClip Frame 91
_parent.gotoAndStop(1);
Symbol 411 MovieClip Frame 1
_parent.stop();
Symbol 411 MovieClip Frame 82
_parent.gotoAndStop(1);
Symbol 419 MovieClip Frame 1
_parent.stop();
Symbol 419 MovieClip Frame 24
stop();
_parent.play();
Symbol 429 MovieClip Frame 1
_parent.stop();
Symbol 429 MovieClip Frame 59
_root.game.goalScored(_root.game.ball.target.team);
_parent.gotoAndStop(1);
Symbol 441 MovieClip Frame 1
_parent.stop();
Symbol 441 MovieClip Frame 140
stop();
_parent.gotoAndStop(1);
Symbol 444 MovieClip Frame 1
_parent.stop();
Symbol 444 MovieClip Frame 85
_parent.gotoAndStop(1);
Symbol 445 MovieClip Frame 1
stop();
Instance of Symbol 333 MovieClip "tutorial" in Symbol 445 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.game.demoMode == false) {
gotoAndStop (17);
}
}
Symbol 445 MovieClip Frame 62
gotoAndStop (1);
Symbol 445 MovieClip Frame 116
_root.game.goalScored(_root.game.ball.target.team);
gotoAndStop (1);
Symbol 445 MovieClip Frame 156
gotoAndStop (1);
Symbol 445 MovieClip Frame 220
gotoAndStop (1);
Symbol 445 MovieClip Frame 259
gotoAndStop (1);
Symbol 445 MovieClip Frame 290
gotoAndStop (1);
Symbol 445 MovieClip Frame 320
gotoAndStop (1);
Symbol 445 MovieClip Frame 350
gotoAndStop (1);
Symbol 445 MovieClip Frame 395
gotoAndStop (1);
Symbol 445 MovieClip Frame 425
gotoAndStop (1);
Symbol 445 MovieClip Frame 455
gotoAndStop (1);
Symbol 445 MovieClip Frame 485
gotoAndStop (1);
Symbol 445 MovieClip Frame 515
gotoAndStop (1);
Symbol 445 MovieClip Frame 555
gotoAndStop (1);
Symbol 445 MovieClip Frame 618
gotoAndStop (1);
Symbol 445 MovieClip Frame 660
_root.game.goalScored(_root.game.ball.target.team);
gotoAndStop (1);
Symbol 445 MovieClip Frame 701
gotoAndStop (1);
Symbol 445 MovieClip Frame 761
gotoAndStop (1);
Symbol 445 MovieClip Frame 795
gotoAndStop (1);
Symbol 445 MovieClip Frame 825
gotoAndStop (1);
Symbol 453 Button
on (release) {
getURL ("http://www.cokezero.com", _blank);
}
Instance of Symbol 288 MovieClip "tutorial" in Symbol 454 MovieClip Frame 1
onClipEvent (enterFrame) {
if (((((oshown and dshown) and kshown) and pshown) and fshown) and eshown) {
gotoAndStop (1);
}
if (_root.game.demoMode == true) {
_visible = false;
} else if (_visible == false) {
_visible = true;
}
}
Instance of Symbol 446 MovieClip "bigscreen" in Symbol 454 MovieClip Frame 1
onClipEvent (load) {
ani.cacheAsBitmap = true;
lights.cacheAsBitmap = true;
ani.setMask(lights);
ani.cacheAsBitmap = true;
lights.cacheAsBitmap = true;
}
onClipEvent (enterFrame) {
if (_root.game.demoMode == true) {
} else {
_alpha = 100;
}
}
Instance of Symbol 451 MovieClip in Symbol 454 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.game.ball.target.team == _root.game.playersTeam) {
_root.game.lastTeam = _root.game.playersTeam;
}
if (_root.game.lastTeam == _root.game.playersTeam) {
gotoAndStop (2);
} else {
gotoAndStop (1);
}
}
Instance of Symbol 451 MovieClip in Symbol 454 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.game.ball.target.team == _root.game.compTeam) {
_root.game.lastTeam = _root.game.compTeam;
}
if (_root.game.lastTeam == _root.game.compTeam) {
gotoAndStop (2);
} else {
gotoAndStop (1);
}
}
Symbol 457 MovieClip Frame 1
stop();
Symbol 457 MovieClip Frame 3
gotoAndStop (2);
Symbol 457 MovieClip Frame 5
gotoAndStop (2);
Symbol 457 MovieClip Frame 7
gotoAndStop (2);
Symbol 458 MovieClip Frame 72
gotoAndPlay (1);
Symbol 490 MovieClip Frame 1
stop();
Instance of Symbol 94 MovieClip in Symbol 490 MovieClip Frame 1
onClipEvent (load) {
function onHitRelease() {
_root.game.screens.gotoAndStop(1);
}
label.text = "CONTINUE GAME";
}
Instance of Symbol 94 MovieClip in Symbol 490 MovieClip Frame 1
onClipEvent (load) {
function onHitRelease() {
getURL ("http://www.cokezero.com", _blank);
}
label.text = "COKEZERO.COM";
}
Instance of Symbol 487 MovieClip in Symbol 490 MovieClip Frame 1
onClipEvent (load) {
if (_root.game.chosenColour == 1) {
gotoAndStop (1);
} else {
gotoAndStop (2);
}
}
Instance of Symbol 487 MovieClip in Symbol 490 MovieClip Frame 1
onClipEvent (load) {
if (_root.game.chosenColour == 1) {
gotoAndStop (2);
} else {
gotoAndStop (1);
}
}
Instance of Symbol 94 MovieClip in Symbol 490 MovieClip Frame 3
onClipEvent (load) {
function onHitRelease() {
_root.game.gotoAndPlay(3);
}
label.text = "PLAY AGAIN";
}
Instance of Symbol 490 MovieClip in Symbol 491 MovieClip Frame 19
onClipEvent (load) {
hscoreD = _root.game.screens.hscoreD;
gscoreD = _root.game.screens.gscoreD;
gotoAndStop(_root.game.screens._currentframe - 1);
}
Symbol 491 MovieClip Frame 36
stop();
Instance of Symbol 490 MovieClip in Symbol 491 MovieClip Frame 36
onClipEvent (load) {
hscoreD = _root.game.screens.hscoreD;
gscoreD = _root.game.screens.gscoreD;
gotoAndStop(_root.game.screens._currentframe - 1);
}
Symbol 493 MovieClip Frame 1
stop();
if (_root.game.demoMode == false) {
stopAllSounds();
}
Symbol 493 MovieClip Frame 2
stop();
Symbol 493 MovieClip Frame 5
_level0.ffgamesSend.show();
gotoAndStop (1);
stop();
Symbol 494 MovieClip Frame 1
if (_alpha == 0) {
stop();
}
cleanUp = false;
Symbol 494 MovieClip Frame 2
function lineUp(person) {
if (((gameMode != "kickOff") || (tdMode != false)) || (quarterChanged == true)) {
var _local3 = (scrimmage - halfPitchX) / 4;
person._x = person._x - _local3;
}
var _local2 = ((person._y - 10) * (person._x - halfPitchX)) / 4000;
person._x = person._x + (_local2 * 7);
person._y = person._y + 7;
}
function goalScored(team) {
downs = 0;
if (tdMode != false) {
if (timeOut == false) {
tdMode = false;
startKickoff(team);
} else {
removeTackles();
tacked = false;
_root.game.tdMode = false;
_root.game.gameMode = "convFail";
}
} else {
tdMode = team;
if (team == 1) {
scrimmage = 500;
setupFieldGoal(team, scrimmage);
} else {
scrimmage = 125;
setupFieldGoal(team, scrimmage);
}
}
}
function startKickoff(team) {
downs = 0;
tdMode = false;
if (team == 2) {
setupKickoff(2, formation44, 0);
setupRecieve(1, formationRecieve, 230);
} else {
setupKickoff(1, formation44, 190);
setupRecieve(2, formationRecieve, -30);
}
}
function checkScrimmage() {
if (ball.target.team == 1) {
if ((((downline < scrimmage) and (downline < endZoneR)) and (downline > endZoneL)) || (downline == -200)) {
downline = scrimmage + tenYards;
downs = downs - 0.5;
downs = 1;
}
}
if (ball.target.team == 2) {
if ((((downline > scrimmage) and (downline < endZoneR)) and (downline > endZoneL)) || (downline == -200)) {
downline = scrimmage - tenYards;
downs = downs - 0.5;
downs = 1;
}
}
}
function handBall() {
if (parseInt(ball.target.team) == compTeam) {
if (_root.game.compPlayType == "passing") {
if (compTeam == 1) {
ball.target = player11;
} else {
ball.target = player22;
}
} else if (compTeam == 1) {
ball.target = player6;
} else {
ball.target = player17;
}
} else if (_root.game.playType == "passing") {
if (playersTeam == 1) {
ball.target = player11;
} else {
ball.target = player22;
}
} else if (playersTeam == 1) {
ball.target = player6;
} else {
ball.target = player17;
}
}
function setupLine(team, formation, lineX, downed) {
if (((((downs < 4) and (tdDown == 0)) || (gameMode == "punt")) || (gameMode == "fieldGoal")) || (goForIt == true)) {
var _local5 = true;
if (((changeMode == false) and (timeOut == false)) and (quarterChanged == false)) {
if (lastTeam == 1) {
if (lineX < endZoneL) {
if (downs < 1) {
lineX = twentyYardLineL;
scrimmage = twentyYardLineL;
var _local4 = true;
} else {
_root.game.addMessage("Safety");
if (lastTeam != _root.game.playersTeam) {
_root.game.setupSafetyKick(_root.game.compTeam);
_root.game.hscore = _root.game.hscore + 2;
} else {
_root.game.setupSafetyKick(_root.game.playersTeam);
_root.game.gscore = _root.game.gscore + 2;
}
_local5 = false;
removeTackles();
}
} else {
var _local4 = false;
}
if (lineX > endZoneR) {
lineX = endZoneR;
scrimmage = endZoneR;
}
} else {
if (lineX < endZoneL) {
lineX = endZoneL;
scrimmage = endZoneL;
}
if (lineX > endZoneR) {
if (downs < 1) {
lineX = twentyYardLineR;
scrimmage = twentyYardLineR;
} else {
_root.game.addMessage("Safety");
if (lastTeam != _root.game.playersTeam) {
_root.game.setupSafetyKick(_root.game.compTeam);
_root.game.hscore = _root.game.hscore + 2;
} else {
_root.game.setupSafetyKick(_root.game.playersTeam);
_root.game.gscore = _root.game.gscore + 2;
}
_local5 = false;
removeTackles();
}
var _local4 = true;
} else {
var _local4 = false;
}
}
if (timeOut == false) {
if (downs < 1) {
downs = 1;
} else {
downs = downs + downed;
}
if (ball.target.team == 1) {
if ((downline < scrimmage) || (downline == -200)) {
downline = scrimmage + tenYards;
if ((_local4 != true) and (timeOut == false)) {
downs = downs - 0.5;
downs = 1;
}
}
}
if (ball.target.team == 2) {
if ((downline > scrimmage) || (downline == -200)) {
downline = scrimmage - tenYards;
if ((_local4 != true) and (timeOut == false)) {
downs = downs - 0.5;
downs = 1;
}
}
}
}
} else {
if (downs == 0) {
downs = 1;
}
if (ball.target.team == 1) {
if ((downline < scrimmage) || (downline == -200)) {
downline = scrimmage + tenYards;
}
}
if (ball.target.team == 2) {
if ((downline > scrimmage) || (downline == -200)) {
downline = scrimmage - tenYards;
}
}
}
if (_local5 == true) {
passesNum = 0;
gameMode = "scrum";
vibrate = false;
handBall();
if (team == 1) {
i = 1;
while (i < 12) {
if (ball.target.team == 1) {
_root.game["player" + i]._x = (lineX - 10) - ((formation[i - 1][0] / 2) * 1.2);
} else {
_root.game["player" + i]._x = (lineX - 10) - ((formation[i - 1][0] / 2) * 1.2);
}
_root.game["player" + i]._y = -5 + (formation[i - 1][1] * 1.2);
lineUp(_root.game["player" + i]);
_root.game["player" + i].xspeed = 0;
_root.game["player" + i].yspeed = 0;
_root.game["player" + i].rot = _root.game["player" + i].origRot;
_root.game["player" + i].rotVel = 0;
_root.game["player" + i].rotInc = 0;
_root.game["player" + i].ani.gotoAndStop(10);
i = i + 1;
}
}
if (team == 2) {
i = 12;
while (i < 23) {
_root.game["player" + i]._y = -5 + ((formation[i - 12][1] + 3) * 1.2);
if (ball.target.team == 2) {
_root.game["player" + i]._x = (lineX + 10) + ((formation[i - 12][0] / 2) * 1.2);
} else {
_root.game["player" + i]._x = (lineX + 10) + ((formation[i - 12][0] / 2) * 1.2);
}
lineUp(_root.game["player" + i]);
_root.game["player" + i].xspeed = 0;
_root.game["player" + i].yspeed = 0;
_root.game["player" + i].rot = _root.game["player" + i].origRot;
_root.game["player" + i].rotVel = 0;
_root.game["player" + i].rotInc = 0;
_root.game["player" + i].ani.gotoAndStop(1);
i = i + 1;
}
}
}
}
}
function setupKickoff(team, formation, lineX) {
tdMode = false;
downs = 0;
passesNum = 0;
gameMode = "kickOff";
vibrate = false;
if (playersTeam == team) {
powerBar.playerControlled = true;
} else {
powerBar.playerControlled = false;
}
if (team == 1) {
powerBar.target = player11;
i = 1;
while (i < 12) {
_root.game["player" + i]._y = -5 + ((formationKickOff[i - 1][1] + 5) * 1.2);
_root.game["player" + i]._x = (lineX + 55) - (formationKickOff[i - 1][0] * 1.2);
lineUp(_root.game["player" + i]);
_root.game["player" + i].xspeed = 0;
_root.game["player" + i].yspeed = 0;
_root.game["player" + i].rot = _root.game["player" + i].origRot;
_root.game["player" + i].rotVel = 0;
_root.game["player" + i].rotInc = 0;
_root.game["player" + i].ani.gotoAndStop(10);
i = i + 1;
}
ball.target = player11;
}
if (team == 2) {
powerBar.target = player22;
i = 12;
while (i < 23) {
_root.game["player" + i]._y = -5 + (formationKickOff[i - 12][1] * 1.2);
_root.game["player" + i]._x = (lineX + 387) + (formationKickOff[i - 12][0] * 1.2);
lineUp(_root.game["player" + i]);
_root.game["player" + i].xspeed = 0;
_root.game["player" + i].yspeed = 0;
_root.game["player" + i].rot = _root.game["player" + i].origRot;
_root.game["player" + i].rotVel = 0;
_root.game["player" + i].rotInc = 0;
_root.game["player" + i].ani.gotoAndStop(1);
i = i + 1;
}
ball.target = player22;
}
}
function setupSafetyKick(team) {
passesNum = 0;
vibrate = false;
gameMode = "puntSafety";
if (playersTeam == team) {
powerBar.playerControlled = true;
} else {
powerBar.playerControlled = false;
}
if (team == 1) {
kickingTeam = 1;
powerBar.target = player11;
i = 1;
while (i < 12) {
_root.game["player" + i]._y = -5 + ((formationPuntNew[i - 1][1] + 5) * 1.2);
_root.game["player" + i]._x = (endZoneL - 10) - (formationPuntNew[i - 1][0] * 1.2);
lineUp(_root.game["player" + i]);
_root.game["player" + i].xspeed = 0;
_root.game["player" + i].yspeed = 0;
_root.game["player" + i].rot = _root.game["player" + i].origRot;
_root.game["player" + i].rotVel = 0;
_root.game["player" + i].rotInc = 0;
_root.game["player" + i].ani.gotoAndStop(10);
i = i + 1;
}
ball.target = player11;
scrimmage = endZoneL;
setupRecievePuntSafety(2, formationRecieve, 250);
}
if (team == 2) {
kickingTeam = 2;
powerBar.target = player22;
i = 12;
while (i < 23) {
_root.game["player" + i]._y = -5 + ((formationPuntNew[i - 12][1] + 3) * 1.2);
_root.game["player" + i]._x = (endZoneR + 10) + (formationPuntNew[i - 12][0] * 1.2);
lineUp(_root.game["player" + i]);
_root.game["player" + i].xspeed = 0;
_root.game["player" + i].yspeed = 0;
_root.game["player" + i].rot = _root.game["player" + i].origRot;
_root.game["player" + i].rotVel = 0;
_root.game["player" + i].rotInc = 0;
_root.game["player" + i].ani.gotoAndStop(1);
i = i + 1;
}
ball.target = player22;
scrimmage = endZoneR;
setupRecievePuntSafety(1, formationRecieve, 250);
}
}
function setupRecieve(team, formation, lineX) {
if (team == 1) {
i = 1;
while (i < 12) {
_root.game["player" + i]._y = -5 + ((formation[i - 1][1] + 3) * 1.2);
_root.game["player" + i]._x = (lineX - 50) - (formation[i - 1][0] * 1.2);
lineUp(_root.game["player" + i]);
_root.game["player" + i].xspeed = 0;
_root.game["player" + i].yspeed = 0;
_root.game["player" + i].rot = _root.game["player" + i].origRot;
_root.game["player" + i].rotVel = 0;
_root.game["player" + i].rotInc = 0;
_root.game["player" + i].ani.gotoAndStop(10);
i = i + 1;
}
}
if (team == 2) {
i = 12;
while (i < 23) {
_root.game["player" + i]._y = -5 + ((formation[i - 12][1] + 3) * 1.2);
_root.game["player" + i]._x = (lineX + 470) + (formation[i - 12][0] * 1.2);
lineUp(_root.game["player" + i]);
_root.game["player" + i].xspeed = 0;
_root.game["player" + i].yspeed = 0;
_root.game["player" + i].rot = _root.game["player" + i].origRot;
_root.game["player" + i].rotVel = 0;
_root.game["player" + i].rotInc = 0;
_root.game["player" + i].ani.gotoAndStop(1);
i = i + 1;
}
}
}
function setupRecieve2(team, formation, lineX) {
if (team == 1) {
i = 1;
while (i < 12) {
_root.game["player" + i]._y = -5 + ((formation[i - 1][1] + 3) * 1.2);
_root.game["player" + i]._x = (lineX - 10) - (formation[i - 1][0] * 1.2);
lineUp(_root.game["player" + i]);
_root.game["player" + i].xspeed = 0;
_root.game["player" + i].yspeed = 0;
_root.game["player" + i].rot = _root.game["player" + i].origRot;
_root.game["player" + i].rotVel = 0;
_root.game["player" + i].rotInc = 0;
_root.game["player" + i].ani.gotoAndStop(10);
i = i + 1;
}
}
if (team == 2) {
i = 12;
while (i < 23) {
_root.game["player" + i]._y = -5 + ((formation[i - 12][1] + 3) * 1.2);
_root.game["player" + i]._x = (lineX + 10) + (formation[i - 12][0] * 1.2);
lineUp(_root.game["player" + i]);
_root.game["player" + i].xspeed = 0;
_root.game["player" + i].yspeed = 0;
_root.game["player" + i].rot = _root.game["player" + i].origRot;
_root.game["player" + i].rotVel = 0;
_root.game["player" + i].rotInc = 0;
_root.game["player" + i].ani.gotoAndStop(1);
i = i + 1;
}
}
}
function setupFieldGoal(team, lineX) {
passesNum = 0;
gameMode = "fieldGoal";
vibrate = false;
if (playersTeam == team) {
powerBar.playerControlled = true;
} else {
powerBar.playerControlled = false;
}
if (team == 1) {
powerBar.target = player11;
i = 1;
while (i < 12) {
_root.game["player" + i]._y = -5 + ((formationFieldGoal[i - 1][1] + 5) * 1.2);
_root.game["player" + i]._x = (lineX - 10) - (formationFieldGoal[i - 1][0] * 1.2);
lineUp(_root.game["player" + i]);
_root.game["player" + i].xspeed = 0;
_root.game["player" + i].yspeed = 0;
_root.game["player" + i].rot = _root.game["player" + i].origRot;
_root.game["player" + i].rotVel = 0;
_root.game["player" + i].rotInc = 0;
_root.game["player" + i].ani.gotoAndStop(10);
i = i + 1;
}
ball.target = player11;
setupRecieve2(2, formationKickOff, lineX);
}
if (team == 2) {
powerBar.target = player22;
i = 12;
while (i < 23) {
_root.game["player" + i]._y = -5 + ((formationFieldGoal[i - 12][1] + 3) * 1.2);
_root.game["player" + i]._x = (lineX + 10) + (formationFieldGoal[i - 12][0] * 1.2);
lineUp(_root.game["player" + i]);
_root.game["player" + i].xspeed = 0;
_root.game["player" + i].yspeed = 0;
_root.game["player" + i].rot = _root.game["player" + i].origRot;
_root.game["player" + i].rotVel = 0;
_root.game["player" + i].rotInc = 0;
_root.game["player" + i].ani.gotoAndStop(1);
i = i + 1;
}
ball.target = player22;
setupRecieve2(1, formationKickOff, lineX);
}
}
function setupRecievePuntSafety(team, formation, lineX) {
if (team == 1) {
i = 1;
while (i < 12) {
if (i < 5) {
_root.game["player" + i]._y = -5 + (formationRecievePuntBack[i - 1][1] * 1.2);
_root.game["player" + i]._x = halfPitchX - (formationRecievePuntBack[i - 1][0] * 1.2);
} else {
_root.game["player" + i]._y = -5 + (formationRecievePuntFront[i - 5][1] * 1.2);
_root.game["player" + i]._x = scrimmage - 10;
}
lineUp(_root.game["player" + i]);
_root.game["player" + i].xspeed = 0;
_root.game["player" + i].yspeed = 0;
_root.game["player" + i].rot = _root.game["player" + i].origRot;
_root.game["player" + i].rotVel = 0;
_root.game["player" + i].rotInc = 0;
_root.game["player" + i].ani.gotoAndStop(10);
i = i + 1;
}
}
if (team == 2) {
i = 12;
while (i < 23) {
if (i < 16) {
_root.game["player" + i]._y = -5 + (formationRecievePuntBack[i - 12][1] * 1.2);
_root.game["player" + i]._x = halfPitchX + (formationRecievePuntBack[i - 12][0] * 1.2);
} else {
_root.game["player" + i]._y = -5 + (formationRecievePuntFront[i - 16][1] * 1.2);
_root.game["player" + i]._x = scrimmage + 10;
}
lineUp(_root.game["player" + i]);
_root.game["player" + i].xspeed = 0;
_root.game["player" + i].yspeed = 0;
_root.game["player" + i].rot = _root.game["player" + i].origRot;
_root.game["player" + i].rotVel = 0;
_root.game["player" + i].rotInc = 0;
_root.game["player" + i].ani.gotoAndStop(1);
i = i + 1;
}
}
}
function setupRecievePunt(team, formation, lineX) {
if (team == 1) {
i = 1;
while (i < 12) {
if (i < 5) {
_root.game["player" + i]._y = -5 + (formationRecievePuntBack[i - 1][1] * 1.2);
_root.game["player" + i]._x = (twentyYardLineL + 50) - (formationRecievePuntBack[i - 1][0] * 1.2);
} else {
_root.game["player" + i]._y = -5 + (formationRecievePuntFront[i - 5][1] * 1.2);
_root.game["player" + i]._x = scrimmage - 10;
}
lineUp(_root.game["player" + i]);
_root.game["player" + i].xspeed = 0;
_root.game["player" + i].yspeed = 0;
_root.game["player" + i].rot = _root.game["player" + i].origRot;
_root.game["player" + i].rotVel = 0;
_root.game["player" + i].rotInc = 0;
_root.game["player" + i].ani.gotoAndStop(10);
i = i + 1;
}
}
if (team == 2) {
i = 12;
while (i < 23) {
if (i < 16) {
_root.game["player" + i]._y = -5 + (formationRecievePuntBack[i - 12][1] * 1.2);
_root.game["player" + i]._x = (twentyYardLineR - 50) + (formationRecievePuntBack[i - 12][0] * 1.2);
} else {
_root.game["player" + i]._y = -5 + (formationRecievePuntFront[i - 16][1] * 1.2);
_root.game["player" + i]._x = scrimmage + 10;
}
lineUp(_root.game["player" + i]);
_root.game["player" + i].xspeed = 0;
_root.game["player" + i].yspeed = 0;
_root.game["player" + i].rot = _root.game["player" + i].origRot;
_root.game["player" + i].rotVel = 0;
_root.game["player" + i].rotInc = 0;
_root.game["player" + i].ani.gotoAndStop(1);
i = i + 1;
}
}
}
function setupPunt(team, lineX) {
passesNum = 0;
gameMode = "punt";
vibrate = false;
if (playersTeam == team) {
powerBar.playerControlled = true;
} else {
powerBar.playerControlled = false;
}
if (team == 1) {
kickingTeam = 1;
powerBar.target = player11;
i = 1;
while (i < 12) {
_root.game["player" + i]._y = -5 + ((formationPunt[i - 1][1] + 5) * 1.2);
_root.game["player" + i]._x = (lineX - 10) - (formationPunt[i - 1][0] * 1.2);
lineUp(_root.game["player" + i]);
_root.game["player" + i].xspeed = 0;
_root.game["player" + i].yspeed = 0;
_root.game["player" + i].rot = _root.game["player" + i].origRot;
_root.game["player" + i].rotVel = 0;
_root.game["player" + i].rotInc = 0;
_root.game["player" + i].ani.gotoAndStop(10);
i = i + 1;
}
ball.target = player11;
setupRecievePunt(2, formationRecieve, -50);
}
if (team == 2) {
kickingTeam = 2;
powerBar.target = player22;
i = 12;
while (i < 23) {
_root.game["player" + i]._y = -5 + ((formationPunt[i - 12][1] + 3) * 1.2);
_root.game["player" + i]._x = (lineX + 10) + (formationPunt[i - 12][0] * 1.2);
lineUp(_root.game["player" + i]);
_root.game["player" + i].xspeed = 0;
_root.game["player" + i].yspeed = 0;
_root.game["player" + i].rot = _root.game["player" + i].origRot;
_root.game["player" + i].rotVel = 0;
_root.game["player" + i].rotInc = 0;
_root.game["player" + i].ani.gotoAndStop(1);
i = i + 1;
}
ball.target = player22;
setupRecievePunt(1, formationRecieve, 250);
}
}
function turnOver() {
addMessage("turnOver");
var _local2 = scrimmage;
if (parseInt(lastTeam) == 1) {
ball.target = player22;
if (compTeam == 2) {
var _local3 = random(2);
if (_local3 == 1) {
_root.game.compPlayType = "passing";
_root.game.setupLine(compTeam, _root.game.formationShotgun, _local2, 0);
} else {
_root.game.compPlayType = "running";
_root.game.setupLine(compTeam, _root.game.formationI, _local2, 0);
}
_root.game.playType = "defense";
_root.game.setupLine(playersTeam, _root.game.formation43, _local2, 0);
} else {
var _local3 = 1 + random(5);
_root.game.compPlayType = "defense";
_root.game.setupLine(compTeam, _root.game["formationDefence" + _local3], _local2, 0);
_root.game.setupLine(playersTeam, _root.game.formationShotgun, _local2, 0);
}
} else {
ball.target = player11;
if (compTeam == 1) {
var _local3 = random(2);
if (_local3 == 1) {
_root.game.compPlayType = "passing";
_root.game.setupLine(compTeam, _root.game.formationShotgun, _local2, 0);
} else {
_root.game.compPlayType = "running";
_root.game.setupLine(compTeam, _root.game.formationI, _local2, 0);
}
_root.game.playType = "defense";
_root.game.setupLine(playersTeam, _root.game.formation43, _local2, 0);
} else {
var _local3 = 1 + random(5);
_root.game.compPlayType = "defense";
_root.game.setupLine(compTeam, _root.game["formationDefence" + _local3], _local2, 0);
_root.game.setupLine(playersTeam, _root.game.formationShotgun, _local2, 0);
}
}
handBall();
downs = 0;
}
function switchOver() {
_parent.addMessage("turnover");
var _local3 = scrimmage;
if (parseInt(lastTeam) == 1) {
ball.target = player22;
if (compTeam == 2) {
var _local4 = random(2);
if (_local4 == 1) {
_root.game.compPlayType = "passing";
_root.game.setupLine(compTeam, _root.game.formationShotgun, _local3, 0);
} else {
_root.game.compPlayType = "running";
_root.game.setupLine(compTeam, _root.game.formationI, _local3, 0);
}
_root.game.playType = "defense";
_root.game.setupLine(playersTeam, _root.game.formation43, _local3, 0);
} else {
var _local4 = 1 + random(5);
_root.game.compPlayType = "defense";
_root.game.setupLine(compTeam, _root.game["formationDefence" + _local4], _local3, 0);
_root.game.setupLine(playersTeam, _root.game.formationShotgun, _local3, 0);
}
} else {
ball.target = player11;
if (compTeam == 1) {
var _local4 = random(2);
if (_local4 == 1) {
_root.game.compPlayType = "passing";
_root.game.setupLine(compTeam, _root.game.formationShotgun, _local3, 0);
} else {
_root.game.compPlayType = "running";
_root.game.setupLine(compTeam, _root.game.formationI, _local3, 0);
}
_root.game.playType = "defense";
_root.game.setupLine(playersTeam, _root.game.formation43, _local3, 0);
} else {
var _local4 = 1 + random(5);
_root.game.compPlayType = "defense";
_root.game.setupLine(compTeam, _root.game["formationDefence" + _local4], _local3, 0);
_root.game.setupLine(playersTeam, _root.game.formationShotgun, _local3, 0);
}
}
handBall();
}
function tackleNew(downCount) {
if ((_root.game.gameMode == "plays") and (downs <= 3)) {
if (downCount != 1) {
}
_parent.addMessage("tackled");
var _local3 = scrimmage;
if (parseInt(lastTeam) != playersTeam) {
if (compTeam == 1) {
ball.target = player11;
} else {
ball.target = player22;
}
var _local5 = random(2);
if (parseInt(_local5) == 1) {
_root.game.compPlayType = "passing";
_root.game.setupLine(compTeam, _root.game.formationShotgun, _local3, downCount / 2);
} else {
_root.game.compPlayType = "running";
_root.game.setupLine(compTeam, _root.game.formationI, _local3, downCount / 2);
}
_root.game.setupLine(playersTeam, _root.game.formation43, _local3, downCount / 2);
} else {
if (playersTeam == 1) {
ball.target = player11;
} else {
ball.target = player22;
}
var _local5 = 1 + random(5);
_root.game.compPlayType = "defense";
_root.game.setupLine(1, _root.game["formationDefence" + _local5], _local3, downCount / 2);
_root.game.setupLine(2, _root.game.formationShotgun, _local3, downCount / 2);
}
} else if (changeMode == false) {
downs = downs + 1;
}
}
function looseBall() {
if (_root.game.tdMode != false) {
if (timeOut == false) {
startKickoff(_root.game.playersTeam);
removeTackles();
_root.game.tdMode = false;
} else if (_root.game.gameMode != "celebration") {
removeTackles();
tacked = false;
_root.game.tdMode = false;
_root.game.gameMode = "convFail";
trace(_root.game.gameMode);
}
} else if (parseInt(downs) < 4) {
if (timeOut == true) {
removeTackles();
if (quarter == 2) {
startKickoff(_root.game.playersTeam);
} else {
if ((downsAdded == false) and (storedDownsNew != downs)) {
trace("clubskfjlds");
downs = downs + 0.5;
downsAdded = true;
var storedDownsNew = downs;
}
tackleNew(0);
}
removeTackles();
} else {
tackleNew(1);
}
} else if (changeMode == false) {
downs = downs + 1;
}
}
function removeTackles() {
i = 1;
while (i < 23) {
_root.game["player" + i].tackled = false;
i = i + 1;
}
pauseTime = 0;
paused = false;
}
function newMatch(colour) {
_root.game.sound.gotoAndPlay("whistle");
demoMode = false;
removeTackles();
scoreboard.bigscreen.ani.gotoAndStop(1);
i = messageList.length;
while (i > 0) {
messageList.pop();
i = messageList.length;
}
hscore = 0;
gscore = 0;
downs = 0;
vibrate = false;
gameMode = "scrum";
passesNum = 0;
downs = 0;
shotTimer = 0;
counter = 0;
secs = defaultSecs;
mins = defaultMins;
quarter = 1;
scrimmage = 0;
started = false;
startTimer = 0;
chosenColour = colour;
playersTeam = 1;
compTeam = 2;
ball.downTimer = 0;
ball.downTimer2 = 0;
ball.downTimer3 = 0;
i = 12;
while (i < 23) {
_root.game["player" + i].gotoAndStop(colour);
i = i + 1;
}
if (colour == 1) {
i = 1;
while (i < 12) {
_root.game["player" + i].gotoAndStop(2);
i = i + 1;
}
} else {
i = 1;
while (i < 12) {
_root.game["player" + i].gotoAndStop(1);
i = i + 1;
}
}
setupKickoff(2, formation44, 0);
setupRecieve(1, formationRecieve, 250);
removeTackles();
}
function updateTeams() {
if (playersTeam == 1) {
playersTeam = 2;
compTeam = 1;
} else {
playersTeam = 1;
compTeam = 2;
}
if (chosenColour == 1) {
var _local2 = 2;
chosenColour = 2;
} else {
var _local2 = 1;
chosenColour = 1;
}
i = 12;
while (i < 23) {
_root.game["player" + i].gotoAndStop(_local2);
i = i + 1;
}
if (_local2 == 1) {
i = 1;
while (i < 12) {
_root.game["player" + i].gotoAndStop(2);
i = i + 1;
}
} else {
i = 1;
while (i < 12) {
_root.game["player" + i].gotoAndStop(1);
i = i + 1;
}
}
}
function switchSides() {
if (playersTeam == 1) {
playersTeam = 2;
compTeam = 1;
} else {
playersTeam = 1;
compTeam = 2;
}
if (chosenColour == 1) {
var _local2 = 2;
chosenColour = 2;
} else {
var _local2 = 1;
chosenColour = 1;
}
i = 12;
while (i < 23) {
_root.game["player" + i].gotoAndStop(_local2);
i = i + 1;
}
if (_local2 == 1) {
i = 1;
while (i < 12) {
_root.game["player" + i].gotoAndStop(2);
i = i + 1;
}
} else {
i = 1;
while (i < 12) {
_root.game["player" + i].gotoAndStop(1);
i = i + 1;
}
}
switchOver();
}
function addMessage(messageName) {
messageList.push(messageName);
}
function forceQuarter() {
if ((mins <= 0) and (secs <= 0)) {
downs = 0;
quarter = quarter + 1;
mins = defaultMins;
secs = defaultSecs;
updateTeams();
if (parseInt(lastTeam) == 1) {
setupKickoff(2, formation44, 0);
setupRecieve(1, formationRecieve, 250);
} else {
setupKickoff(1, formation44, 190);
setupRecieve(2, formationRecieve, -50);
}
removeTackles();
}
}
stop();
blitz = false;
downsAdded = false;
pitchBackWidth = 368;
pitchFrontWidth = 472;
gameWidth = 600;
pitchDepth = 150;
pitchBackY = 40;
pitchFrontY = pitchBackY + pitchDepth;
horizon = 1000;
vibrationVal = 1;
vibrate = false;
playerNum = 0;
gameMode = "scrum";
passesNum = 0;
downs = 0;
shotTimer = 0;
counter = 0;
defaultSecs = 45;
defaultMins = 0;
secs = defaultSecs;
mins = defaultMins;
quarter = 1;
scrimmage = 0;
started = true;
startTimer = 0;
downline = -200;
togo = 0;
ballon = 0;
demoMode = true;
hscore = 0;
gscore = 0;
myTeam = 1;
pauseTime = 0;
paused = false;
doneFunction = true;
var messageList = new Array();
messagesToShow = 0;
formationOffset = 20;
viewTime = 0;
sentMessage = false;
halfPitchX = 320;
scored = false;
playType = "passing";
compPlayType = "passing";
downCounted = false;
tdMode = false;
tdDown = 0;
changeMode = false;
goForIt = false;
situation = false;
makeKick = false;
showInstructions = true;
lastTeam = 0;
endZoneR = 530;
endZoneL = 84;
twentyYardLineL = 168;
twentyYardLineR = 428;
tenYards = 43;
playersTeam = 1;
compTeam = 2;
nextQuarterIn = 0;
timeOut = false;
lastGameMode = "";
chosenColour = 0;
demoScoreTimer = 0;
safed = false;
kickingTeam = 0;
storedDowns = 0;
touchBack = false;
mouseIsDown = false;
storedDownline = downline;
intercepted = false;
if (gameCompleted == undefined) {
gameCompleted = false;
}
var formation44 = new Array(new Array(35, 26), new Array(42, 73), new Array(45, 86), new Array(47, 99), new Array(50, 112), new Array(63, 86), new Array(52, 47), new Array(40, 60), new Array(55, 143), new Array(80, 86), new Array(100, 86));
var formationT = new Array(new Array(10, 59), new Array(12, 72), new Array(14, 86), new Array(17, 99), new Array(21, 113), new Array(33, 86), new Array(46, 75), new Array(8, 45), new Array(22, 126), new Array(52, 97), new Array(50, 86));
var formationKickOff = new Array(new Array(0, 81), new Array(0, 69), new Array(0, 58), new Array(0, 137), new Array(0, 114), new Array(0, 103), new Array(0, 126), new Array(0, 35), new Array(0, 149), new Array(0, 47), new Array(0, 92));
var formationFieldGoal = new Array(new Array(0, 81), new Array(0, 69), new Array(0, 58), new Array(0, 137), new Array(0, 114), new Array(0, 103), new Array(0, 126), new Array(0, 35), new Array(0, 149), new Array(0, 47), new Array(35, 92));
var formationRecieve = new Array(new Array(0, 77), new Array(0, 68), new Array(0, 89), new Array(0, 99), new Array(0, 110), new Array(20, 88), new Array(20, 119), new Array(0, 38), new Array(0, 144), new Array(19, 59), new Array(43, 88));
var formationPunt = new Array(new Array(0, 68), new Array(0, 51), new Array(19, 137), new Array(17, 44), new Array(0, 116), new Array(0, 100), new Array(0, 84), new Array(0, 35), new Array(0, 149), new Array(0, 132), new Array(40, 89));
var formationPuntNew = new Array(new Array(0, 81), new Array(0, 69), new Array(0, 58), new Array(0, 137), new Array(0, 114), new Array(0, 103), new Array(0, 126), new Array(0, 35), new Array(0, 149), new Array(0, 47), new Array(15, 92));
var formationRecievePuntBack = new Array(new Array(0, 88), new Array(0, 119), new Array(0, 59), new Array(30, 88));
var formationRecievePuntFront = new Array(new Array(0, 81), new Array(0, 69), new Array(0, 114), new Array(0, 103), new Array(0, 35), new Array(0, 149), new Array(0, 92));
var formationGoalKick = new Array(new Array(53, 51), new Array(13, 65), new Array(25, 82), new Array(17, 100), new Array(7, 118), new Array(43, 82), new Array(43, 64), new Array(0, 51), new Array(53, 102), new Array(71, 119), new Array(84, 82));
var formationShotgun = new Array(new Array(0, 59), new Array(0, 71), new Array(0, 83), new Array(0, 95), new Array(0, 108), new Array(33, 107), new Array(0, 120), new Array(0, 38), new Array(0, 144), new Array(17, 54), new Array(33, 94));
var formationI = new Array(new Array(0, 59), new Array(0, 71), new Array(0, 83), new Array(0, 95), new Array(0, 108), new Array(60, 93), new Array(0, 120), new Array(0, 38), new Array(0, 144), new Array(38, 104), new Array(28, 94));
var formation43 = new Array(new Array(0, 64), new Array(0, 32), new Array(0, 149), new Array(27, 111), new Array(0, 78), new Array(0, 91), new Array(27, 58), new Array(52, 70), new Array(52, 98), new Array(0, 105), new Array(27, 84));
var formation44New = new Array(new Array(12, 59), new Array(0, 70), new Array(0, 83), new Array(0, 97), new Array(0, 110), new Array(45, 93), new Array(14, 119), new Array(0, 38), new Array(0, 144), new Array(18, 80), new Array(19, 98));
var formation52 = new Array(new Array(0, 64), new Array(0, 32), new Array(0, 149), new Array(24, 97), new Array(0, 76), new Array(0, 87), new Array(24, 72), new Array(50, 61), new Array(50, 108), new Array(0, 98), new Array(0, 109));
var formationPass2 = new Array(new Array(0, 75), new Array(0, 63), new Array(18, 131), new Array(18, 47), new Array(0, 111), new Array(0, 99), new Array(0, 87), new Array(0, 35), new Array(0, 149), new Array(28, 94), new Array(48, 84));
var formationRun2 = new Array(new Array(0, 75), new Array(0, 63), new Array(0, 99), new Array(18, 131), new Array(0, 111), new Array(56, 86), new Array(0, 87), new Array(0, 35), new Array(0, 149), new Array(18, 49), new Array(28, 86));
var formationDefence1 = new Array(new Array(0, 64), new Array(0, 32), new Array(0, 149), new Array(24, 97), new Array(0, 76), new Array(0, 87), new Array(24, 72), new Array(50, 61), new Array(50, 108), new Array(0, 98), new Array(0, 109));
var formationDefence2 = new Array(new Array(0, 64), new Array(0, 32), new Array(0, 149), new Array(27, 111), new Array(0, 78), new Array(0, 91), new Array(27, 58), new Array(52, 70), new Array(52, 98), new Array(0, 105), new Array(27, 84));
var formationDefence3 = new Array(new Array(0, 64), new Array(12, 32), new Array(12, 149), new Array(12, 131), new Array(0, 78), new Array(0, 91), new Array(12, 47), new Array(51, 56), new Array(51, 113), new Array(0, 105), new Array(26, 84));
var formationDefence4 = new Array(new Array(0, 64), new Array(0, 32), new Array(0, 149), new Array(27, 111), new Array(0, 78), new Array(0, 91), new Array(27, 58), new Array(52, 70), new Array(52, 98), new Array(0, 105), new Array(27, 84));
var formationDefence5 = new Array(new Array(0, 64), new Array(12, 32), new Array(12, 149), new Array(12, 131), new Array(0, 78), new Array(0, 91), new Array(12, 47), new Array(51, 56), new Array(51, 113), new Array(0, 105), new Array(26, 84));
onMouseDown = function () {
mouseIsDown = true;
};
onMouseUp = function () {
mouseIsDown = false;
};
setupKickoff(2, formation44, 0);
setupRecieve(1, formationRecieve, 250);
this.onEnterFrame = function () {
if (demoMode == false) {
if (((pauseTime > 10) and (messageList.length > 0)) || ((scoreboard.bigscreen.ani._currentframe != 1) and (pauseTime > 10))) {
pauseTime = 15;
}
}
if (demoMode == true) {
if (gameMode == "celebration") {
demoScoreTimer = demoScoreTimer + 1;
}
if (demoScoreTimer > 40) {
goalScored(_root.game.ball.target.team);
demoScoreTimer = 0;
}
} else {
demoScoreTimer = 0;
}
if (((((downs < 4) and (gameMode != "scrum")) and (gameMode != "punt")) and (gameMode != "fieldGoal")) and (gameMode != "puntSafety")) {
goForIt = false;
}
if (gameMode == "plays") {
vibrate = true;
if (paused == false) {
downsAdded = false;
var _local6 = 0;
}
}
if ((compPlayType == "running") and (parseInt(ball.storedOwner.team) != compTeam)) {
compPlayType = "defense";
}
if ((playType == "running") and (parseInt(ball.storedOwner.team) != playersTeam)) {
playType = "defense";
}
if (pauseTime > 0) {
gameMode = "paused";
pauseTime = pauseTime - 1;
paused = true;
} else {
paused = false;
}
if (gameMode != "plays") {
lastGameMode = gameMode;
}
if (((((parseInt(downs) == 4) and (gameMode != "punt")) and (gameMode != "fieldGoal")) and (gameMode != "4thDown")) and (goForIt == false)) {
i = 1;
while (i < 23) {
_root.game["player" + i].tackled = false;
i = i + 1;
}
downCounted = true;
}
if (parseInt(downs) == 5) {
turnOver();
downs = 0;
}
if (((scoreboard.bigscreen.ani._currentframe == 1) and (messageList.length > 0)) and (demoMode == false)) {
viewTime = viewTime + 1;
}
if (viewTime > 1) {
scoreboard.bigscreen.ani.gotoAndPlay(messageList[0]);
if (messageList[0] == messageList[1]) {
i = 0;
while (i < messageList.length) {
messageList[i] = messageList[i + 1];
i = i + 1;
}
messageList.pop();
}
i = 0;
while (i < messageList.length) {
messageList[i] = messageList[i + 1];
i = i + 1;
}
messageList.pop();
viewTime = 0;
}
if (gameMode == "kickOff") {
if (sentMessage == false) {
addMessage("kickOff");
sentMessage = true;
}
} else {
sentMessage = false;
}
if ((demoMode == true) and (gameMode == "scrum")) {
vibrate = true;
gameMode = "plays";
}
var _local5 = (fieldR._x - fieldL._x) / 100;
if (gameMode == "scrum") {
if (ball.target.team == 1) {
ballon = (fieldR._x - fieldL._x) - (scrimmage - fieldL._x);
} else if (ball.target.team == 2) {
ballon = scrimmage - fieldL._x;
}
ballon = Math.round(ballon / _local5);
if ((ballon > 99) || (ballon < 0)) {
ballon = 0;
}
}
if (ballon > 50) {
ballon = 50 - (ballon - 50);
}
if (downline != -200) {
if (downline > endZoneR) {
downline = endZoneR;
} else if (downline < endZoneL) {
downline = endZoneL;
}
}
if ((scrimmage > downline) and (downline != -200)) {
togo = scrimmage - downline;
} else if (downline != -200) {
togo = downline - scrimmage;
}
togo = Math.round(togo / _local5);
if ((downs == 0) and (timeOut == false)) {
downline = -200;
}
if (startTimer < 0) {
startTimer = startTimer + 1;
}
if (gameMode == "shot") {
if (scored == false) {
if ((ball.ypos > goal1B._y) and (ball.ypos < goal1F._y)) {
if (ball._x < goal1F._x) {
if ((ball.zpos > 20) and (messageList[messageList.length] != "goal")) {
if (tdMode != false) {
if (playersTeam == 2) {
hscore = hscore + 1;
} else {
gscore = gscore + 1;
}
tdMode = false;
} else if (playersTeam == 2) {
hscore = hscore + 3;
} else {
gscore = gscore + 3;
}
addMessage("goal");
scored = true;
} else if (messageList[messageList.length] != "goalMissed") {
addMessage("goalMissed");
scored = true;
}
}
}
if (((ball.ypos > goal1B._y) and (ball.ypos < goal1F._y)) and (messageList[messageList.length] != "goal")) {
if (ball._x > goal2F._x) {
if ((ball.zpos > 20) and (messageList[messageList.length] != "goal")) {
if (tdMode != false) {
if (playersTeam == 1) {
hscore = hscore + 1;
} else {
gscore = gscore + 1;
}
tdMode = false;
} else if (playersTeam == 1) {
hscore = hscore + 3;
} else {
gscore = gscore + 3;
}
addMessage("goal");
scored = true;
} else if (messageList[messageList.length] != "goalMissed") {
addMessage("goalMissed");
scored = true;
}
}
}
}
} else {
scored = false;
}
if (((((downCounted == true) and (gameMode != "punt")) and (gameMode != "fieldGoal")) and (gameMode != "4thDown")) and (changeMode == false)) {
downCounted = false;
gameMode = "4thdown";
pauseTime = 0;
paused = false;
if (fieldGoalArea.hitTest(_root.game._x + ball.thrownX, _root.game._y + ball.storedOwner._y, true)) {
if (ball.storedOwner.team == 1) {
if (ball.thrownX > halfPitchX) {
var _local4 = "fieldGoal";
} else {
var _local4 = "punt";
}
} else if (ball.thrownX < halfPitchX) {
var _local4 = "fieldGoal";
} else {
var _local4 = "punt";
}
} else {
var _local4 = "punt";
}
if ((_local4 == "fieldGoal") and (changeMode == false)) {
situation = "fieldGoal";
gameMode = "fieldGoal";
setupFieldGoal(ball.storedOwner.team, scrimmage);
}
if ((_local4 == "punt") and (changeMode == false)) {
situation = "punt";
gameMode = "punt";
setupPunt(ball.storedOwner.team, scrimmage);
}
if (((_local4 != "punt") and (_local4 != "fieldGoal")) and (changeMode == false)) {
situation = "punt";
gameMode = "punt";
setupPunt(ball.storedOwner.team, scrimmage);
}
}
if (gameMode == "shot") {
shotTimer = shotTimer + 1;
if (shotTimer > 50) {
if ((mins <= 0) and (secs <= 0)) {
downs = 0;
quarter = quarter + 1;
mins = defaultMins;
secs = defaultSecs;
updateTeams();
if (parseInt(lastTeam) == 1) {
setupKickoff(2, formation44, 0);
setupRecieve(1, formationRecieve, 250);
} else {
setupKickoff(1, formation44, 190);
setupRecieve(2, formationRecieve, -50);
}
} else if (parseInt(ball.storedOwner.team) == 1) {
setupKickoff(2, formation44, 0);
setupRecieve(1, formationRecieve, 250);
} else {
setupKickoff(1, formation44, 190);
setupRecieve(2, formationRecieve, -50);
}
}
} else {
shotTimer = 0;
}
if ((mins <= 0) and (secs <= 0)) {
timeOut = true;
if ((((gameMode == "celebration") || (gameMode == "shot")) || (quarter == 2)) || (gameMode == "convFail")) {
var _local3 = true;
} else {
var _local3 = false;
}
if (safed == false) {
trace(gameMode);
if ((pauseTime < 2) and (tdMode == false)) {
removeTackles();
}
} else {
var _local3 = "safety";
}
nextQuarterIn = nextQuarterIn - 1;
if (((((((((gameMode != "plays") and (gameMode != "fieldGoal")) and (gameMode != "shot")) and (paused == false)) and (gameMode != "celebration")) and (tdMode == false)) and (gameMode != "puntSafety")) || (gameMode == "convFail")) || ((gameMode == "fieldGoal") and (downs > 3.9))) {
trace(_local3);
var _local7 = downs;
quarter = quarter + 1;
mins = defaultMins;
secs = defaultSecs;
addMessage("quaterchange");
if (_local3 == true) {
updateTeams();
if ((parseInt(lastTeam) == 2) || (quarter == 3)) {
setupKickoff(1, formation44, 190);
setupRecieve(2, formationRecieve, -50);
} else {
setupKickoff(2, formation44, 0);
setupRecieve(1, formationRecieve, 250);
}
removeTackles();
} else if (_local3 == false) {
quarterChanged = true;
if (scrimmage != -200) {
scrimmage = gameWidth - scrimmage;
}
if (downline != -200) {
downline = gameWidth - downline;
}
timeOut = false;
switchSides();
} else {
updateTeams();
if (parseInt(lastTeam) == 2) {
if (lastTeam != _root.game.playersTeam) {
_root.game.gscore = _root.game.gscore + 2;
} else {
_root.game.hscore = _root.game.hscore + 2;
}
setupSafetyKick(1);
} else {
if (lastTeam != _root.game.playersTeam) {
_root.game.gscore = _root.game.gscore + 2;
} else {
_root.game.hscore = _root.game.hscore + 2;
}
setupSafetyKick(2);
}
removeTackles();
}
} else {
mins = 0;
secs = 0;
}
} else {
timeOut = false;
if (gameMode == "plays") {
quarterChanged = false;
safed = false;
}
}
if ((gameMode == "plays") and (demoMode == false)) {
kickingTeam = 0;
situation = false;
tdDown = 0;
changeMode = false;
makeKick = false;
counter = counter + 1;
if (counter > 25) {
secs = secs - 1;
counter = 0;
}
if ((secs == 0) and (mins > 0)) {
mins = mins - 1;
secs = 59;
}
}
if (gameMode == "fieldGoal") {
paused = false;
}
if ((((storedDowns != downs) and (downs > 0.5)) and (changeMode == false)) and (tdMode == false)) {
var _local2 = Math.round(downs);
if (_local2 > downs) {
_local2 = _local2 - 1;
}
if (messageList[messageList.length] != ("down" + Math.round(_local2))) {
addMessage("down" + Math.round(_local2));
}
storedDowns = downs;
}
};
Instance of Symbol 33 MovieClip in Symbol 494 MovieClip Frame 2
onClipEvent (enterFrame) {
if ((_root.game.vibrate == true) and (_root.game.paused == false)) {
play();
} else {
gotoAndStop (1);
}
}
Instance of Symbol 109 MovieClip "userInterface" in Symbol 494 MovieClip Frame 2
onClipEvent (load) {
if ((_root.game.demoMode == true) and (_currentframe < 3)) {
gotoAndStop (2);
} else {
gotoAndStop (1);
}
}
onClipEvent (enterFrame) {
if (_root.game.gameCompleted == true) {
gotoAndStop (3);
_root.game.gameCompleted = false;
}
if (_root.game.cleanUp == true) {
this.removeMovieClip();
}
if (_root.game.screens._currentframe == 1) {
this.swapDepths(997);
}
}
Instance of Symbol 113 MovieClip "grass" in Symbol 494 MovieClip Frame 2
onClipEvent (enterFrame) {
if (((((((((_parent.ball.target.team == _root.game.playersTeam) and (_root.game.gameMode == "plays")) and (_root.game.vibrate == true)) and (_parent.passesNum == 0)) and (_root.game.demoMode == false)) and (_root.game.paused == false)) and (_root.game.downs > 0)) and (_root.game.playType == "passing")) || ((((((((_parent.ball.target.team == _root.game.playersTeam) and (_root.game.gameMode == "plays")) and (_root.game.vibrate == true)) and (_parent.passesNum == 0)) and (_root.game.demoMode == false)) and (_root.game.paused == false)) and (_root.game.playType == "passing")) and (_root.game.tdMode != false))) {
gotoAndStop (2);
} else {
gotoAndStop (1);
}
}
Instance of Symbol 116 MovieClip "downlinemc" in Symbol 494 MovieClip Frame 2
onClipEvent (enterFrame) {
_x = _parent.downline;
var adjside = (_root.game.halfPitchX - _x);
var oppside = (-1 * (-500 - _y));
var angle = Math.atan2(oppside, adjside);
angle = ((angle / Math.PI) * 180) + 90;
_rotation = (-1 * angle);
if ((_root.game.gameMode != "puntSafety") and (_root.game.gameMode != "kickOff")) {
if (((_parent.downs > 0) and (_root.game.downline < _root.game.endZoneR)) and (_root.game.downline > _root.game.endZoneL)) {
_alpha = 70;
} else {
_alpha = 0;
}
} else {
_alpha = 0;
}
}
Instance of Symbol 116 MovieClip "scrimmageHit" in Symbol 494 MovieClip Frame 2
onClipEvent (enterFrame) {
_x = _parent.scrimmage;
var adjside = (_root.game.halfPitchX - _x);
var oppside = (-1 * (-500 - _y));
var angle = Math.atan2(oppside, adjside);
angle = ((angle / Math.PI) * 180) + 90;
_rotation = (-1 * angle);
if ((_root.game.gameMode != "puntSafety") and (_root.game.gameMode != "kickOff")) {
if ((_parent.downs > 0) || (_root.game.tdMode != false)) {
_alpha = 70;
} else {
_alpha = 0;
}
} else {
_alpha = 0;
}
if (_root.game.playersTeam == 1) {
gotoAndStop (2);
} else {
gotoAndStop (1);
}
}
Instance of Symbol 198 MovieClip "player12" in Symbol 494 MovieClip Frame 2
onClipEvent (load) {
hitSound = new Sound(this);
hitSound.attachSound("hitSound");
xspeed = 0;
yspeed = 0;
speed = 0.1 * _root.game.vibrationVal;
currentY = _y - _root.game.pitchBackY;
posY = currentY / _root.game.pitchFrontY;
percent = _root.game.pitchDepth / _root.game.horizon;
depthScale = (1 - percent) + (posY * percent);
rotVel = 0;
rotInc = 0;
rotTimer = random(20);
_rotation = 0;
xpos = _x + _root.game._x;
ypos = _y + _root.game._y;
_root.game.playerNum = _root.game.playerNum + 1;
mass = 2;
rad = hitArea._width / 2.3;
team = 0;
if (parseInt(substring(_name, 7, 2)) < 12) {
team = 1;
rot = 180;
origRot = rot;
if ((_name == "player22") || (_name == "player11")) {
gotoAndStop (4);
} else {
gotoAndStop (2);
}
ani.gotoAndStop(10);
} else {
team = 2;
rot = 0;
origRot = rot;
if ((_name == "player22") || (_name == "player11")) {
gotoAndStop (3);
} else {
gotoAndStop (1);
}
ani.gotoAndStop(1);
}
if (team == 2) {
trace(((("new Array(" + Math.round(_x)) + ",") + Math.round(_y)) + "),");
}
rotStored = 0;
heldTime = 0;
heldTime2 = 0;
tackled = false;
forwardProgress = 0;
progressTimer = 0;
type = "";
fixedLineX = 0;
speedDone = false;
var xspeedEq = speed;
var yspeedEq = speed;
storedVar = "";
collisionTimer = 0;
intercepted = false;
}
onClipEvent (enterFrame) {
function checkOutOfBounds() {
if (_root.game.ball.target == this) {
boundsPause();
if ((ani._currentframe < 6) || (ani._currentframe > 14)) {
if (team == 1) {
}
} else if ((ani._currentframe > 6) and (ani._currentframe < 14)) {
if (team == 2) {
}
}
}
}
function checkScrimmage() {
if (team == 1) {
if (_root.game.scrimmage < _root.game.endZoneL) {
_root.game.scrimmage = _root.game.twentyYardLineL;
_root.game.touchBack = true;
} else {
_root.game.touchBack = false;
}
if (_root.game.scrimmage > _root.game.endZoneR) {
_root.game.scrimmage = _root.game.endZoneR;
}
} else {
if (_root.game.scrimmage < _root.game.endZoneL) {
_root.game.scrimmage = _root.game.endZoneL;
}
if (_root.game.scrimmage > _root.game.endZoneR) {
_root.game.scrimmage = _root.game.twentyYardLineR;
_root.game.touchBack = true;
} else {
_root.game.touchBack = false;
}
}
}
function tacklePause() {
type = "tackle";
if ((_root.game.timeOut == true) and (_root.game.tdMode == false)) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
_root.game.scrimmage = _x + fixedLineX;
checkScrimmage();
}
if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "tackle";
_root.game.safed = true;
} else if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "tackle";
_root.game.safed = true;
} else {
type = "tackle";
}
if ((_root.game.paused == false) and (_root.game.gameMode != "celebration")) {
_root.game.sound.gotoAndPlay("whistle");
}
if (((((_root.game.gameMode == "plays") and (_root.game.paused == false)) || ((_root.game.gameMode == "kickOff") and (_root.game.paused == false))) || ((_root.game.gameMode == "punt") and (_root.game.paused == false))) || (((_root.game.tdMode != false) and (_root.game.paused == false)) and (_root.game.gameMode == "plays"))) {
tackled = true;
type = "tackle";
if ((_root.game.passesNum == 0) and (_root.game.gameMode != "celebration")) {
if (_parent.ball.target.team == 1) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
if (((_x + fixedLineX) < _root.game.scrimmage) and (_root.game.downs > 0)) {
_parent.addMessage("sack");
} else {
_parent.addMessage("tackled");
}
}
if (_parent.ball.target.team == 2) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
if (((_x + fixedLineX) > _root.game.scrimmage) and (_root.game.downs > 0)) {
_parent.addMessage("sack");
} else {
_parent.addMessage("tackled");
}
}
} else if (_root.game.gameMode != "celebration") {
_parent.addMessage("tackled");
}
_root.game.pauseTime = 55;
}
}
function boundsPause() {
if (_root.game.timeOut == true) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
_root.game.scrimmage = _x + fixedLineX;
checkScrimmage();
}
if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "bounds";
_root.game.safed = true;
} else if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "bounds";
_root.game.safed = true;
} else {
type = "bounds";
}
type = "bounds";
_root.game.sound.gotoAndPlay("whistle");
tackled = true;
_parent.addMessage("outOfBounds");
_root.game.pauseTime = 55;
}
function turnedPause() {
if (_root.game.timeOut == true) {
_root.game.scrimmage = forwardProgress;
checkScrimmage();
}
type = "turn";
_root.game.sound.gotoAndPlay("whistle");
tackled = true;
_parent.addMessage("turnedAround");
_parent.addMessage("negativeProgress");
_root.game.pauseTime = 55;
}
function tackle() {
if ((_root.game.gameMode != "puntSafety") and (gameMode != "scrum")) {
if (_root.game.tdMode != false) {
if ((_root.game.timeOut == false) and (_root.game.gameMode != "celebration")) {
_root.game.startKickoff(_root.game.playersTeam);
_root.game.removeTackles();
tacked = false;
_root.game.tdMode = false;
} else if (_root.game.gameMode != "celebration") {
_root.game.removeTackles();
tacked = false;
_root.game.tdMode = false;
_root.game.gameMode = "convFail";
trace(_root.game.gameMode);
} else {
_root.game.removeTackles();
tacked = false;
}
} else if ((_root.game.downs <= 3.5) || (_root.game.goForIt == true)) {
if ((((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (type != "turn")) and (_root.game.downs > 0.5)) and (_root.game.ball.target == this)) and (_root.game.gameMode != "celebration")) {
_root.game.addMessage("Safety");
if (team != _root.game.playersTeam) {
_root.game.setupSafetyKick(_root.game.compTeam);
_root.game.hscore = _root.game.hscore + 2;
} else {
_root.game.setupSafetyKick(_root.game.playersTeam);
_root.game.gscore = _root.game.gscore + 2;
}
tackled = false;
} else if ((((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (type != "turn")) and (_root.game.downs > 0.5)) and (_root.game.ball.target == this)) and (_root.game.gameMode != "celebration")) {
_root.game.addMessage("Safety");
if (team != _root.game.playersTeam) {
_root.game.setupSafetyKick(_root.game.compTeam);
_root.game.hscore = _root.game.hscore + 2;
} else {
_root.game.setupSafetyKick(_root.game.playersTeam);
_root.game.gscore = _root.game.gscore + 2;
}
tackled = false;
} else {
_root.game.changeMode = false;
tackled = false;
if (type == "turn") {
var _local4 = forwardProgress;
} else {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
var _local4 = _x + fixedLineX;
}
_root.game.scrimmage = _local4;
if (_parent.ball.target.team != _root.game.playersTeam) {
var _local5 = random(2);
if (_local5 == 1) {
_root.game.compPlayType = "passing";
_root.game.setupLine(_root.game.compTeam, _root.game.formationShotgun, _local4, 0.5);
} else {
_root.game.compPlayType = "running";
_root.game.setupLine(_root.game.compTeam, _root.game.formationI, _local4, 0.5);
}
_root.game.setupLine(_root.game.playersTeam, _root.game.formation43, _local4, 0.5);
} else {
var _local5 = 1 + random(5);
_root.game.compPlayType = "defense";
_root.game.setupLine(_root.game.compTeam, _root.game["formationDefence" + _local5], _local4, 0.5);
_root.game.setupLine(_root.game.playersTeam, _root.game.formationShotgun, _local4, 0.5);
}
}
} else if ((_root.game.goForIt == true) and (_root.game.gameMode == "plays")) {
if (_root.game.changeMode == false) {
_root.game.downs = _root.game.downs + 1;
}
_root.game.pauseTime = 0;
_root.game.paused = false;
tackled = false;
} else if (_root.game.gameMode == "plays") {
_root.game.pauseTime = 0;
_root.game.paused = false;
if (_root.game.changeMode == false) {
_root.game.downs = _root.game.downs + 1;
}
tackled = false;
}
}
}
function checkWalls() {
if ((_y + 10) > _root.game.pitchFrontY) {
if (((yspeed > 1) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) {
checkOutOfBounds();
}
_y = (_y - 1);
yspeed = (-yspeed) * 0.5;
}
if ((_y - 5) < _root.game.pitchBackY) {
if (((yspeed < 1) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) {
checkOutOfBounds();
}
_y = (_y + 1);
yspeed = (-yspeed) * 0.5;
}
if (_root.game.walls.hitTest(xpos + (hitArea._width / 2), ypos, true) and (_x > 300)) {
_x = (_x - 2);
xspeed = (-xspeed) * 0.5;
}
if (_root.game.walls.hitTest(xpos - (hitArea._width / 2), ypos, true) and (_x < 300)) {
_x = (_x + 2);
xspeed = (-xspeed) * 0.5;
}
}
function checkCollision(b1, b2) {
var _local12 = b2._x - b1._x;
var _local11 = b2._y - b1._y;
var _local19 = Math.sqrt((_local12 * _local12) + (_local11 * _local11));
if (_local19 < (b1.rad + b2.rad)) {
if (((_parent.ball.target == this) and (b2.team != this.team)) || ((_parent.ball.target == b2) and (this.team != b2.team))) {
tacklePause();
}
if (_root.game.gameMode == "plays") {
var _local8 = 0;
if (xspeed < 0) {
_local8 = _local8 + (-xspeed);
} else {
_local8 = _local8 + xspeed;
}
if (yspeed < 0) {
_local8 = _local8 + (-yspeed);
} else {
_local8 = _local8 + yspeed;
}
if (_local8 > 1) {
hitSound.setVolume(_local8 * 15);
hitSound.start(0, 0);
hitSound.setVolume(_local8 * 15);
}
}
var _local18 = Math.atan2(_local11, _local12);
var _local7 = Math.cos(_local18);
var _local6 = Math.sin(_local18);
var _local9 = (_local7 * b1.xspeed) + (_local6 * b1.yspeed);
var _local15 = (_local7 * b1.yspeed) - (_local6 * b1.xspeed);
var _local10 = (_local7 * b2.xspeed) + (_local6 * b2.yspeed);
var _local14 = (_local7 * b2.yspeed) - (_local6 * b2.xspeed);
var _local21 = (_local9 * b1.mass) + (_local10 * b2.mass);
var _local20 = _local9 - _local10;
_local9 = (_local21 - (b2.mass * _local20)) / (b1.mass + b2.mass);
_local10 = _local20 + _local9;
b1.xspeed = ((_local7 * _local9) - (_local6 * _local15)) * 0.7;
b1.yspeed = ((_local7 * _local15) + (_local6 * _local9)) * 0.7;
b2.xspeed = ((_local7 * _local10) - (_local6 * _local14)) * 0.7;
b2.yspeed = ((_local7 * _local14) + (_local6 * _local10)) * 0.7;
var _local16 = ((b1.rad + b2.rad) - _local19) / 2;
var _local17 = _local7 * _local16;
var _local13 = _local6 * _local16;
b1._x = b1._x - (_local17 * 1.1);
b1._y = b1._y - (_local13 * 1.1);
b2._x = b2._x + (_local17 * 1.1);
b2._y = b2._y + (_local13 * 1.1);
}
}
if (_root.game.gameMode == "kickOff") {
var xspeedEq = speed;
var yspeedEq = speed;
}
if (_root.game.cleanUp == true) {
this.removeMovieClip();
}
if ((_root.game.gameMode == "scrum") || (_root.game.gameMode == "kickOff")) {
forwardProgress = 0;
progressTimer = 0;
}
if (team == _root.game.playersTeam) {
if (_root.game.playType == "running") {
if (_root.game.playersTeam == 1) {
if ((((_name == "player7") || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else if ((((_name == "player18") || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else {
mass = 2;
}
}
if (team == _root.game.compTeam) {
if (_root.game.compPlayType == "running") {
if (_root.game.compTeam == 1) {
if ((((_name == "player7") || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else if ((((_name == "player18") || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else {
mass = 2;
}
}
if ((((((_name == "player22") and (parseInt(_root.game.ball.storedOwner.team) == 2)) and (_root.game.gameMode != "plays")) and (_root.game.gameMode != "celebration")) and (_root.game.paused == false)) || (((((_name == "player11") and (parseInt(_root.game.ball.storedOwner.team) == 1)) and (_root.game.gameMode != "plays")) and (_root.game.gameMode != "celebration")) and (_root.game.paused == false))) {
if (_currentframe == 1) {
gotoAndStop (3);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(10);
}
} else if (_currentframe == 2) {
gotoAndStop (4);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(10);
}
}
} else if (((((_name == "player22") and (_root.game.gameMode != "plays")) and (_root.game.paused == false)) and (_root.game.gameMode != "celebration")) and (_root.game.gameMode != "shot")) {
gotoAndStop(_root.game.player21._currentframe);
} else if (((((_name == "player11") and (_root.game.gameMode != "plays")) and (_root.game.paused == false)) and (_root.game.gameMode != "celebration")) and (_root.game.gameMode != "shot")) {
gotoAndStop(_root.game.player10._currentframe);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(_root.game.player10.ani._currentframe);
}
}
if ((tackled == true) and (_root.game.paused == false)) {
tackle();
}
if (_root.game.paused == false) {
if (_parent.ball.target != this) {
arrow.gotoAndStop(1);
var arrowPlayed = false;
heldTime = 0;
} else {
if ((_parent.passesNum == 1) || (_root.game.downs == 0)) {
if (team == 1) {
if ((((xspeed < 0) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) and (_root.game.messageList.length == 0)) {
if ((_root.game.tdMode == false) || ((_root.game.tdMode != false) and (_parent.passesNum > 0))) {
progressTimer = progressTimer + 1;
if ((forwardProgress == 0) || (forwardProgress < (_x + fixedLineX))) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
forwardProgress = _x + fixedLineX;
}
if (progressTimer > 50) {
turnedPause();
progressTimer = 0;
}
} else {
progressTimer = 0;
}
}
} else if ((((xspeed > 0) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) and (_root.game.messageList.length == 0)) {
if ((_root.game.tdMode == false) || ((_root.game.tdMode != false) and (_parent.passesNum > 0))) {
progressTimer = progressTimer + 1;
if ((forwardProgress == 0) || (forwardProgress > (_x + fixedLineX))) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
forwardProgress = _x + fixedLineX;
}
if (progressTimer > 50) {
turnedPause();
progressTimer = 0;
}
} else {
progressTimer = 0;
}
}
}
if ((((team == 1) and (_root.game.gameMode == "plays")) and (team != _root.game.playersTeam)) || (((team == 1) and (_root.game.gameMode == "plays")) and (_root.game.demoMode == true))) {
heldTime = heldTime + 1;
var playerAmount = 12;
i = 1;
while (i < playerAmount) {
var target = _root.game["player" + i];
var randFactor = random(3);
if (((((((((target._x > (_x + 40)) and (_parent.passesNum == 0)) and (heldTime > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed > (1.5 * _root.game.vibrationVal))) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || ((((_parent.nzone.hitTest(target.xpos, target.ypos, true) and (target._x > _x)) and (_parent.passesNum == 0)) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing"))) || ((((((((target._x > (_x + 40)) and (_parent.passesNum == 0)) and (heldTime > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed > 1.5)) and (_root.game.downs > 0)) and (_root.game.playType == "passing")) and (_root.game.demoMode == true))) {
_parent.passesNum = _parent.passesNum + 1;
_parent.ball.target = "";
_parent.ball.targetX = _root.game["player" + i]._x + (_root.game["player" + i].xspeed * (8 + random(15)));
_parent.ball.targetY = (_root.game["player" + i]._y - 10) + (_root.game["player" + i].yspeed * (8 + random(15)));
var dx = (_parent.ball.targetX - _parent.ball._x);
var dy = (_parent.ball.targetY - _parent.ball._y);
var dist = Math.sqrt((dx * dx) + (dy * dy));
_parent.ball.xspeed = dx / (dist / 10);
_parent.ball.yspeed = dy / (dist / 10);
_parent.ball.zspeed = -(dist / 20);
_parent.ball.zpos = 4;
}
i = i + 1;
}
} else {
heldTime = 0;
}
if ((((team == 2) and (_root.game.gameMode == "plays")) and (team != _root.game.playersTeam)) || (((team == 2) and (_root.game.gameMode == "plays")) and (_root.game.demoMode == true))) {
heldTime2 = heldTime2 + 1;
var playerAmount = 23;
i = 12;
while (i < playerAmount) {
var target = _root.game["player" + i];
var randFactor = random(3);
if ((((((((target._x < (_x - 40)) and (_parent.passesNum == 0)) and (heldTime2 > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed < (-1.5 * _root.game.vibrationVal))) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || ((((_parent.nzone.hitTest(target.xpos, target.ypos, true) and (target._x < _x)) and (_parent.passesNum == 0)) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing"))) {
_parent.passesNum = _parent.passesNum + 1;
_parent.ball.target = "";
_parent.ball.targetX = _root.game["player" + i]._x + (_root.game["player" + i].xspeed * (8 + random(15)));
_parent.ball.targetY = (_root.game["player" + i]._y - 10) + (_root.game["player" + i].yspeed * (8 + random(15)));
var dx = (_parent.ball.targetX - _parent.ball._x);
var dy = (_parent.ball.targetY - _parent.ball._y);
var dist = Math.sqrt((dx * dx) + (dy * dy));
_parent.ball.xspeed = dx / (dist / 10);
_parent.ball.yspeed = dy / (dist / 10);
_parent.ball.zspeed = -(dist / 20);
_parent.ball.zpos = 4;
}
i = i + 1;
}
} else {
heldTime2 = 0;
}
if (arrowPlayed == false) {
arrow.play();
var arrowPlayed = true;
}
}
if ((_root.game.gameMode == "plays") and (_parent.ball.target == "")) {
if ((((((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player22")) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player11"))) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player4"))) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player16"))) {
} else {
var catchRad = (rad * 2.5);
var zcatch = 4;
}
if (_root.game.ball.target == "") {
if ((_root.game.ball._x < (_x + 50)) and (_root.game.ball._x > (_x - 50))) {
if ((((_root.game.lastGameMode == "kickOff") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player22")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "kickOff") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player11")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "punt") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player15")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "punt") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player4")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "puntSafety") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player15")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "puntSafety") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player4")) {
_root.game.ball.target = this;
}
}
if ((_root.game.ball._x < (_x + 20)) and (_root.game.ball._x > (_x - 20))) {
var dx = (_parent.ball._x - _x);
var dy = (_parent.ball._y - (_y - 10));
var dist = Math.sqrt((dx * dx) + (dy * dy));
if (((dist < catchRad) and (_parent.ball.zpos < zcatch)) and (_root.game.ball.bounce < 1)) {
if ((_parent.ball.storedOwner.team != team) and (_parent.ball.storedOwner.team > 0)) {
if (_root.game.tdMode != false) {
tacklePause();
} else {
_parent.scoreboard.bigscreen.ani.gotoAndPlay("intercept");
_root.game.downs = 0;
intercepted = true;
_root.game.intercepted = true;
}
}
_parent.ball.target = this;
arrow.play();
}
var dx = ((_parent.ball._x + _root.game.ball.xspeed) - _x);
var dy = ((_parent.ball._y + _root.game.ball.yspeed) - (_y - 10));
var dist = Math.sqrt((dx * dx) + (dy * dy));
if (((dist < catchRad) and (_parent.ball.zpos < zcatch)) and (_root.game.ball.bounce < 1)) {
if ((_parent.ball.storedOwner.team != team) and (_parent.ball.storedOwner.team > 0)) {
if (_root.game.tdMode != false) {
tacklePause();
} else {
_parent.scoreboard.bigscreen.ani.gotoAndPlay("intercept");
_root.game.downs = 0;
intercepted = true;
_root.game.intercepted = true;
}
}
_parent.ball.target = this;
arrow.play();
}
}
}
}
xpos = _x + _root.game._x;
ypos = _y + _root.game._y;
speed = 0.12 * _root.game.vibrationVal;
currentY = _y - _root.game.pitchBackY;
posY = currentY / _root.game.pitchFrontY;
percent = _root.game.pitchDepth / _root.game.horizon;
depthScale = (1 - percent) + (posY * percent);
if (intercepted == true) {
speedDone = false;
intercepted = false;
}
if ((_root.game.vibrate == true) and (_root.game.paused == false)) {
rotTimer = 1 + random(20 * _root.game.vibrationVal);
if (rotTimer == 1) {
rotInc = (-30 + random(60)) / 140;
}
rotVel = rotVel + rotInc;
if (((_root.game.gameMode == "plays") and (speedDone == false)) || (_root.game.mouseIsDown == true)) {
if (_root.game.lastGameMode != "kickOff") {
speedDone = true;
if (_root.game.ball.target != this) {
if (((_root.game.playType == "running") and (team == _root.game.playersTeam)) || ((_root.game.compPlayType == "running") and (team == _root.game.compTeam))) {
if ((((((((((_name == "player22") || (_name == "player18")) || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) || (_name == "player11")) || (_name == "player7")) || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
var xspeedEq = (speed * 1.5);
var yspeedEq = (speed * 1.5);
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else if (((_root.game.playType == "defense") and (team == _root.game.playersTeam)) || ((_root.game.compPlayType == "defense") and (team == _root.game.compTeam))) {
if ((_root.downs >= 1) and (_root.game.blitz == false)) {
if ((((_name == "player8") || (_name == "player9")) || (_name == "player19")) || (_name == "player20")) {
var xspeedEq = (-(speed / 3));
var yspeedEq = (-(speed / 3));
} else if ((((_name == "player10") || (_name == "player11")) || (_name == "player21")) || (_name == "player22")) {
var xspeedEq = (-(speed / 5));
var yspeedEq = (-(speed / 5));
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else if (((((_root.game.passesNum == 0) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || (((_root.game.passesNum == 0) and (_root.game.downs > 0)) and (_root.game.playType == "passing"))) || (((_root.game.passesNum == 0) and (_root.game.tdMode != false)) and (_root.game.playType == "passing"))) {
var xspeedEq = (-(speed / 6));
var yspeedEq = (-(speed / 6));
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
}
}
if ((_root.game.gameMode != "plays") || (_root.game.paused == true)) {
speedDone = false;
}
if (((_root.game.gameMode == "plays") || (_root.game.gameMode == "celebration")) || (_root.game.gameMode == "shot")) {
xspeed = xspeed + (Math.cos((rot - 180) * (Math.PI/180)) * xspeedEq);
yspeed = yspeed + (Math.sin((rot - 180) * (Math.PI/180)) * yspeedEq);
}
if (collisionTimer < 1) {
collisionTimer = collisionTimer + 1;
} else {
collisionTimer = 0;
}
if (((_root.game.vibrate == true) and (_root.game.paused == false)) || (_root.game.mouseIsDown == true)) {
if ((collisionTimer == 0) and (team == 1)) {
i = 0;
while (i < (_root.game.playerNum + 1)) {
var target = _root.game["player" + i];
if (_name != ("player" + i)) {
checkCollision(this, target);
}
i = i + 1;
}
checkWalls();
}
if ((collisionTimer == 1) and (team == 2)) {
i = 12;
while (i < (_root.game.playerNum + 1)) {
var target = _root.game["player" + i];
if (_name != ("player" + i)) {
checkCollision(this, target);
}
i = i + 1;
}
checkWalls();
}
}
if (_root.game.gameMode == "puntSafety") {
checkWalls();
}
xspeed = xspeed * 0.97;
yspeed = yspeed * 0.97;
rotVel = rotVel * 0.97;
this.swapDepths(_y + (_x / 5));
if ((_name == "player22") and (_root.game.playType == "running")) {
} else {
var aniFrames = ani._totalframes;
rotStored = rotStored + rotVel;
if (rotStored > (360 / aniFrames)) {
if (ani._currentframe < aniFrames) {
ani.nextFrame();
} else {
ani.gotoAndStop(1);
}
rotStored = rotStored - (360 / aniFrames);
}
if (rotStored < (-(360 / aniFrames))) {
if (ani._currentframe > 1) {
ani.prevFrame();
} else {
ani.gotoAndStop(aniFrames);
}
rotStored = rotStored + (360 / aniFrames);
}
rot = rot + rotVel;
_xscale = (depthScale * 110);
_yscale = _xscale;
}
if (((_root.game.gameMode == "plays") || (_root.game.gameMode == "celebration")) || (_root.game.gameMode == "shot")) {
_x = (_x + (xspeed * depthScale));
_y = (_y + (yspeed * depthScale));
}
}
}
Instance of Symbol 198 MovieClip "player17" in Symbol 494 MovieClip Frame 2
onClipEvent (load) {
hitSound = new Sound(this);
hitSound.attachSound("hitSound");
xspeed = 0;
yspeed = 0;
speed = 0.1 * _root.game.vibrationVal;
currentY = _y - _root.game.pitchBackY;
posY = currentY / _root.game.pitchFrontY;
percent = _root.game.pitchDepth / _root.game.horizon;
depthScale = (1 - percent) + (posY * percent);
rotVel = 0;
rotInc = 0;
rotTimer = random(20);
_rotation = 0;
xpos = _x + _root.game._x;
ypos = _y + _root.game._y;
_root.game.playerNum = _root.game.playerNum + 1;
mass = 2;
rad = hitArea._width / 2.3;
team = 0;
if (parseInt(substring(_name, 7, 2)) < 12) {
team = 1;
rot = 180;
origRot = rot;
if ((_name == "player22") || (_name == "player11")) {
gotoAndStop (4);
} else {
gotoAndStop (2);
}
ani.gotoAndStop(10);
} else {
team = 2;
rot = 0;
origRot = rot;
if ((_name == "player22") || (_name == "player11")) {
gotoAndStop (3);
} else {
gotoAndStop (1);
}
ani.gotoAndStop(1);
}
if (team == 2) {
trace(((("new Array(" + Math.round(_x)) + ",") + Math.round(_y)) + "),");
}
rotStored = 0;
heldTime = 0;
heldTime2 = 0;
tackled = false;
forwardProgress = 0;
progressTimer = 0;
type = "";
fixedLineX = 0;
speedDone = false;
var xspeedEq = speed;
var yspeedEq = speed;
storedVar = "";
collisionTimer = 0;
intercepted = false;
}
onClipEvent (enterFrame) {
function checkOutOfBounds() {
if (_root.game.ball.target == this) {
boundsPause();
if ((ani._currentframe < 6) || (ani._currentframe > 14)) {
if (team == 1) {
}
} else if ((ani._currentframe > 6) and (ani._currentframe < 14)) {
if (team == 2) {
}
}
}
}
function checkScrimmage() {
if (team == 1) {
if (_root.game.scrimmage < _root.game.endZoneL) {
_root.game.scrimmage = _root.game.twentyYardLineL;
_root.game.touchBack = true;
} else {
_root.game.touchBack = false;
}
if (_root.game.scrimmage > _root.game.endZoneR) {
_root.game.scrimmage = _root.game.endZoneR;
}
} else {
if (_root.game.scrimmage < _root.game.endZoneL) {
_root.game.scrimmage = _root.game.endZoneL;
}
if (_root.game.scrimmage > _root.game.endZoneR) {
_root.game.scrimmage = _root.game.twentyYardLineR;
_root.game.touchBack = true;
} else {
_root.game.touchBack = false;
}
}
}
function tacklePause() {
type = "tackle";
if ((_root.game.timeOut == true) and (_root.game.tdMode == false)) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
_root.game.scrimmage = _x + fixedLineX;
checkScrimmage();
}
if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "tackle";
_root.game.safed = true;
} else if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "tackle";
_root.game.safed = true;
} else {
type = "tackle";
}
if ((_root.game.paused == false) and (_root.game.gameMode != "celebration")) {
_root.game.sound.gotoAndPlay("whistle");
}
if (((((_root.game.gameMode == "plays") and (_root.game.paused == false)) || ((_root.game.gameMode == "kickOff") and (_root.game.paused == false))) || ((_root.game.gameMode == "punt") and (_root.game.paused == false))) || (((_root.game.tdMode != false) and (_root.game.paused == false)) and (_root.game.gameMode == "plays"))) {
tackled = true;
type = "tackle";
if ((_root.game.passesNum == 0) and (_root.game.gameMode != "celebration")) {
if (_parent.ball.target.team == 1) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
if (((_x + fixedLineX) < _root.game.scrimmage) and (_root.game.downs > 0)) {
_parent.addMessage("sack");
} else {
_parent.addMessage("tackled");
}
}
if (_parent.ball.target.team == 2) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
if (((_x + fixedLineX) > _root.game.scrimmage) and (_root.game.downs > 0)) {
_parent.addMessage("sack");
} else {
_parent.addMessage("tackled");
}
}
} else if (_root.game.gameMode != "celebration") {
_parent.addMessage("tackled");
}
_root.game.pauseTime = 55;
}
}
function boundsPause() {
if (_root.game.timeOut == true) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
_root.game.scrimmage = _x + fixedLineX;
checkScrimmage();
}
if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "bounds";
_root.game.safed = true;
} else if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "bounds";
_root.game.safed = true;
} else {
type = "bounds";
}
type = "bounds";
_root.game.sound.gotoAndPlay("whistle");
tackled = true;
_parent.addMessage("outOfBounds");
_root.game.pauseTime = 55;
}
function turnedPause() {
if (_root.game.timeOut == true) {
_root.game.scrimmage = forwardProgress;
checkScrimmage();
}
type = "turn";
_root.game.sound.gotoAndPlay("whistle");
tackled = true;
_parent.addMessage("turnedAround");
_parent.addMessage("negativeProgress");
_root.game.pauseTime = 55;
}
function tackle() {
if ((_root.game.gameMode != "puntSafety") and (gameMode != "scrum")) {
if (_root.game.tdMode != false) {
if ((_root.game.timeOut == false) and (_root.game.gameMode != "celebration")) {
_root.game.startKickoff(_root.game.playersTeam);
_root.game.removeTackles();
tacked = false;
_root.game.tdMode = false;
} else if (_root.game.gameMode != "celebration") {
_root.game.removeTackles();
tacked = false;
_root.game.tdMode = false;
_root.game.gameMode = "convFail";
trace(_root.game.gameMode);
} else {
_root.game.removeTackles();
tacked = false;
}
} else if ((_root.game.downs <= 3.5) || (_root.game.goForIt == true)) {
if ((((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (type != "turn")) and (_root.game.downs > 0.5)) and (_root.game.ball.target == this)) and (_root.game.gameMode != "celebration")) {
_root.game.addMessage("Safety");
if (team != _root.game.playersTeam) {
_root.game.setupSafetyKick(_root.game.compTeam);
_root.game.hscore = _root.game.hscore + 2;
} else {
_root.game.setupSafetyKick(_root.game.playersTeam);
_root.game.gscore = _root.game.gscore + 2;
}
tackled = false;
} else if ((((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (type != "turn")) and (_root.game.downs > 0.5)) and (_root.game.ball.target == this)) and (_root.game.gameMode != "celebration")) {
_root.game.addMessage("Safety");
if (team != _root.game.playersTeam) {
_root.game.setupSafetyKick(_root.game.compTeam);
_root.game.hscore = _root.game.hscore + 2;
} else {
_root.game.setupSafetyKick(_root.game.playersTeam);
_root.game.gscore = _root.game.gscore + 2;
}
tackled = false;
} else {
_root.game.changeMode = false;
tackled = false;
if (type == "turn") {
var _local4 = forwardProgress;
} else {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
var _local4 = _x + fixedLineX;
}
_root.game.scrimmage = _local4;
if (_parent.ball.target.team != _root.game.playersTeam) {
var _local5 = random(2);
if (_local5 == 1) {
_root.game.compPlayType = "passing";
_root.game.setupLine(_root.game.compTeam, _root.game.formationShotgun, _local4, 0.5);
} else {
_root.game.compPlayType = "running";
_root.game.setupLine(_root.game.compTeam, _root.game.formationI, _local4, 0.5);
}
_root.game.setupLine(_root.game.playersTeam, _root.game.formation43, _local4, 0.5);
} else {
var _local5 = 1 + random(5);
_root.game.compPlayType = "defense";
_root.game.setupLine(_root.game.compTeam, _root.game["formationDefence" + _local5], _local4, 0.5);
_root.game.setupLine(_root.game.playersTeam, _root.game.formationShotgun, _local4, 0.5);
}
}
} else if ((_root.game.goForIt == true) and (_root.game.gameMode == "plays")) {
if (_root.game.changeMode == false) {
_root.game.downs = _root.game.downs + 1;
}
_root.game.pauseTime = 0;
_root.game.paused = false;
tackled = false;
} else if (_root.game.gameMode == "plays") {
_root.game.pauseTime = 0;
_root.game.paused = false;
if (_root.game.changeMode == false) {
_root.game.downs = _root.game.downs + 1;
}
tackled = false;
}
}
}
function checkWalls() {
if ((_y + 10) > _root.game.pitchFrontY) {
if (((yspeed > 1) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) {
checkOutOfBounds();
}
_y = (_y - 1);
yspeed = (-yspeed) * 0.5;
}
if ((_y - 5) < _root.game.pitchBackY) {
if (((yspeed < 1) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) {
checkOutOfBounds();
}
_y = (_y + 1);
yspeed = (-yspeed) * 0.5;
}
if (_root.game.walls.hitTest(xpos + (hitArea._width / 2), ypos, true) and (_x > 300)) {
_x = (_x - 2);
xspeed = (-xspeed) * 0.5;
}
if (_root.game.walls.hitTest(xpos - (hitArea._width / 2), ypos, true) and (_x < 300)) {
_x = (_x + 2);
xspeed = (-xspeed) * 0.5;
}
}
function checkCollision(b1, b2) {
var _local12 = b2._x - b1._x;
var _local11 = b2._y - b1._y;
var _local19 = Math.sqrt((_local12 * _local12) + (_local11 * _local11));
if (_local19 < (b1.rad + b2.rad)) {
if (((_parent.ball.target == this) and (b2.team != this.team)) || ((_parent.ball.target == b2) and (this.team != b2.team))) {
tacklePause();
}
if (_root.game.gameMode == "plays") {
var _local8 = 0;
if (xspeed < 0) {
_local8 = _local8 + (-xspeed);
} else {
_local8 = _local8 + xspeed;
}
if (yspeed < 0) {
_local8 = _local8 + (-yspeed);
} else {
_local8 = _local8 + yspeed;
}
if (_local8 > 1) {
hitSound.setVolume(_local8 * 15);
hitSound.start(0, 0);
hitSound.setVolume(_local8 * 15);
}
}
var _local18 = Math.atan2(_local11, _local12);
var _local7 = Math.cos(_local18);
var _local6 = Math.sin(_local18);
var _local9 = (_local7 * b1.xspeed) + (_local6 * b1.yspeed);
var _local15 = (_local7 * b1.yspeed) - (_local6 * b1.xspeed);
var _local10 = (_local7 * b2.xspeed) + (_local6 * b2.yspeed);
var _local14 = (_local7 * b2.yspeed) - (_local6 * b2.xspeed);
var _local21 = (_local9 * b1.mass) + (_local10 * b2.mass);
var _local20 = _local9 - _local10;
_local9 = (_local21 - (b2.mass * _local20)) / (b1.mass + b2.mass);
_local10 = _local20 + _local9;
b1.xspeed = ((_local7 * _local9) - (_local6 * _local15)) * 0.7;
b1.yspeed = ((_local7 * _local15) + (_local6 * _local9)) * 0.7;
b2.xspeed = ((_local7 * _local10) - (_local6 * _local14)) * 0.7;
b2.yspeed = ((_local7 * _local14) + (_local6 * _local10)) * 0.7;
var _local16 = ((b1.rad + b2.rad) - _local19) / 2;
var _local17 = _local7 * _local16;
var _local13 = _local6 * _local16;
b1._x = b1._x - (_local17 * 1.1);
b1._y = b1._y - (_local13 * 1.1);
b2._x = b2._x + (_local17 * 1.1);
b2._y = b2._y + (_local13 * 1.1);
}
}
if (_root.game.gameMode == "kickOff") {
var xspeedEq = speed;
var yspeedEq = speed;
}
if (_root.game.cleanUp == true) {
this.removeMovieClip();
}
if ((_root.game.gameMode == "scrum") || (_root.game.gameMode == "kickOff")) {
forwardProgress = 0;
progressTimer = 0;
}
if (team == _root.game.playersTeam) {
if (_root.game.playType == "running") {
if (_root.game.playersTeam == 1) {
if ((((_name == "player7") || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else if ((((_name == "player18") || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else {
mass = 2;
}
}
if (team == _root.game.compTeam) {
if (_root.game.compPlayType == "running") {
if (_root.game.compTeam == 1) {
if ((((_name == "player7") || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else if ((((_name == "player18") || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else {
mass = 2;
}
}
if ((((((_name == "player22") and (parseInt(_root.game.ball.storedOwner.team) == 2)) and (_root.game.gameMode != "plays")) and (_root.game.gameMode != "celebration")) and (_root.game.paused == false)) || (((((_name == "player11") and (parseInt(_root.game.ball.storedOwner.team) == 1)) and (_root.game.gameMode != "plays")) and (_root.game.gameMode != "celebration")) and (_root.game.paused == false))) {
if (_currentframe == 1) {
gotoAndStop (3);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(10);
}
} else if (_currentframe == 2) {
gotoAndStop (4);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(10);
}
}
} else if (((((_name == "player22") and (_root.game.gameMode != "plays")) and (_root.game.paused == false)) and (_root.game.gameMode != "celebration")) and (_root.game.gameMode != "shot")) {
gotoAndStop(_root.game.player21._currentframe);
} else if (((((_name == "player11") and (_root.game.gameMode != "plays")) and (_root.game.paused == false)) and (_root.game.gameMode != "celebration")) and (_root.game.gameMode != "shot")) {
gotoAndStop(_root.game.player10._currentframe);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(_root.game.player10.ani._currentframe);
}
}
if ((tackled == true) and (_root.game.paused == false)) {
tackle();
}
if (_root.game.paused == false) {
if (_parent.ball.target != this) {
arrow.gotoAndStop(1);
var arrowPlayed = false;
heldTime = 0;
} else {
if ((_parent.passesNum == 1) || (_root.game.downs == 0)) {
if (team == 1) {
if ((((xspeed < 0) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) and (_root.game.messageList.length == 0)) {
if ((_root.game.tdMode == false) || ((_root.game.tdMode != false) and (_parent.passesNum > 0))) {
progressTimer = progressTimer + 1;
if ((forwardProgress == 0) || (forwardProgress < (_x + fixedLineX))) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
forwardProgress = _x + fixedLineX;
}
if (progressTimer > 50) {
turnedPause();
progressTimer = 0;
}
} else {
progressTimer = 0;
}
}
} else if ((((xspeed > 0) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) and (_root.game.messageList.length == 0)) {
if ((_root.game.tdMode == false) || ((_root.game.tdMode != false) and (_parent.passesNum > 0))) {
progressTimer = progressTimer + 1;
if ((forwardProgress == 0) || (forwardProgress > (_x + fixedLineX))) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
forwardProgress = _x + fixedLineX;
}
if (progressTimer > 50) {
turnedPause();
progressTimer = 0;
}
} else {
progressTimer = 0;
}
}
}
if ((((team == 1) and (_root.game.gameMode == "plays")) and (team != _root.game.playersTeam)) || (((team == 1) and (_root.game.gameMode == "plays")) and (_root.game.demoMode == true))) {
heldTime = heldTime + 1;
var playerAmount = 12;
i = 1;
while (i < playerAmount) {
var target = _root.game["player" + i];
var randFactor = random(3);
if (((((((((target._x > (_x + 40)) and (_parent.passesNum == 0)) and (heldTime > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed > (1.5 * _root.game.vibrationVal))) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || ((((_parent.nzone.hitTest(target.xpos, target.ypos, true) and (target._x > _x)) and (_parent.passesNum == 0)) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing"))) || ((((((((target._x > (_x + 40)) and (_parent.passesNum == 0)) and (heldTime > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed > 1.5)) and (_root.game.downs > 0)) and (_root.game.playType == "passing")) and (_root.game.demoMode == true))) {
_parent.passesNum = _parent.passesNum + 1;
_parent.ball.target = "";
_parent.ball.targetX = _root.game["player" + i]._x + (_root.game["player" + i].xspeed * (8 + random(15)));
_parent.ball.targetY = (_root.game["player" + i]._y - 10) + (_root.game["player" + i].yspeed * (8 + random(15)));
var dx = (_parent.ball.targetX - _parent.ball._x);
var dy = (_parent.ball.targetY - _parent.ball._y);
var dist = Math.sqrt((dx * dx) + (dy * dy));
_parent.ball.xspeed = dx / (dist / 10);
_parent.ball.yspeed = dy / (dist / 10);
_parent.ball.zspeed = -(dist / 20);
_parent.ball.zpos = 4;
}
i = i + 1;
}
} else {
heldTime = 0;
}
if ((((team == 2) and (_root.game.gameMode == "plays")) and (team != _root.game.playersTeam)) || (((team == 2) and (_root.game.gameMode == "plays")) and (_root.game.demoMode == true))) {
heldTime2 = heldTime2 + 1;
var playerAmount = 23;
i = 12;
while (i < playerAmount) {
var target = _root.game["player" + i];
var randFactor = random(3);
if ((((((((target._x < (_x - 40)) and (_parent.passesNum == 0)) and (heldTime2 > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed < (-1.5 * _root.game.vibrationVal))) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || ((((_parent.nzone.hitTest(target.xpos, target.ypos, true) and (target._x < _x)) and (_parent.passesNum == 0)) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing"))) {
_parent.passesNum = _parent.passesNum + 1;
_parent.ball.target = "";
_parent.ball.targetX = _root.game["player" + i]._x + (_root.game["player" + i].xspeed * (8 + random(15)));
_parent.ball.targetY = (_root.game["player" + i]._y - 10) + (_root.game["player" + i].yspeed * (8 + random(15)));
var dx = (_parent.ball.targetX - _parent.ball._x);
var dy = (_parent.ball.targetY - _parent.ball._y);
var dist = Math.sqrt((dx * dx) + (dy * dy));
_parent.ball.xspeed = dx / (dist / 10);
_parent.ball.yspeed = dy / (dist / 10);
_parent.ball.zspeed = -(dist / 20);
_parent.ball.zpos = 4;
}
i = i + 1;
}
} else {
heldTime2 = 0;
}
if (arrowPlayed == false) {
arrow.play();
var arrowPlayed = true;
}
}
if ((_root.game.gameMode == "plays") and (_parent.ball.target == "")) {
if ((((((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player22")) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player11"))) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player4"))) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player16"))) {
} else {
var catchRad = (rad * 2.5);
var zcatch = 4;
}
if (_root.game.ball.target == "") {
if ((_root.game.ball._x < (_x + 50)) and (_root.game.ball._x > (_x - 50))) {
if ((((_root.game.lastGameMode == "kickOff") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player22")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "kickOff") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player11")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "punt") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player15")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "punt") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player4")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "puntSafety") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player15")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "puntSafety") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player4")) {
_root.game.ball.target = this;
}
}
if ((_root.game.ball._x < (_x + 20)) and (_root.game.ball._x > (_x - 20))) {
var dx = (_parent.ball._x - _x);
var dy = (_parent.ball._y - (_y - 10));
var dist = Math.sqrt((dx * dx) + (dy * dy));
if (((dist < catchRad) and (_parent.ball.zpos < zcatch)) and (_root.game.ball.bounce < 1)) {
if ((_parent.ball.storedOwner.team != team) and (_parent.ball.storedOwner.team > 0)) {
if (_root.game.tdMode != false) {
tacklePause();
} else {
_parent.scoreboard.bigscreen.ani.gotoAndPlay("intercept");
_root.game.downs = 0;
intercepted = true;
_root.game.intercepted = true;
}
}
_parent.ball.target = this;
arrow.play();
}
var dx = ((_parent.ball._x + _root.game.ball.xspeed) - _x);
var dy = ((_parent.ball._y + _root.game.ball.yspeed) - (_y - 10));
var dist = Math.sqrt((dx * dx) + (dy * dy));
if (((dist < catchRad) and (_parent.ball.zpos < zcatch)) and (_root.game.ball.bounce < 1)) {
if ((_parent.ball.storedOwner.team != team) and (_parent.ball.storedOwner.team > 0)) {
if (_root.game.tdMode != false) {
tacklePause();
} else {
_parent.scoreboard.bigscreen.ani.gotoAndPlay("intercept");
_root.game.downs = 0;
intercepted = true;
_root.game.intercepted = true;
}
}
_parent.ball.target = this;
arrow.play();
}
}
}
}
xpos = _x + _root.game._x;
ypos = _y + _root.game._y;
speed = 0.12 * _root.game.vibrationVal;
currentY = _y - _root.game.pitchBackY;
posY = currentY / _root.game.pitchFrontY;
percent = _root.game.pitchDepth / _root.game.horizon;
depthScale = (1 - percent) + (posY * percent);
if (intercepted == true) {
speedDone = false;
intercepted = false;
}
if ((_root.game.vibrate == true) and (_root.game.paused == false)) {
rotTimer = 1 + random(20 * _root.game.vibrationVal);
if (rotTimer == 1) {
rotInc = (-30 + random(60)) / 140;
}
rotVel = rotVel + rotInc;
if (((_root.game.gameMode == "plays") and (speedDone == false)) || (_root.game.mouseIsDown == true)) {
if (_root.game.lastGameMode != "kickOff") {
speedDone = true;
if (_root.game.ball.target != this) {
if (((_root.game.playType == "running") and (team == _root.game.playersTeam)) || ((_root.game.compPlayType == "running") and (team == _root.game.compTeam))) {
if ((((((((((_name == "player22") || (_name == "player18")) || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) || (_name == "player11")) || (_name == "player7")) || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
var xspeedEq = (speed * 1.5);
var yspeedEq = (speed * 1.5);
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else if (((_root.game.playType == "defense") and (team == _root.game.playersTeam)) || ((_root.game.compPlayType == "defense") and (team == _root.game.compTeam))) {
if ((_root.downs >= 1) and (_root.game.blitz == false)) {
if ((((_name == "player8") || (_name == "player9")) || (_name == "player19")) || (_name == "player20")) {
var xspeedEq = (-(speed / 3));
var yspeedEq = (-(speed / 3));
} else if ((((_name == "player10") || (_name == "player11")) || (_name == "player21")) || (_name == "player22")) {
var xspeedEq = (-(speed / 5));
var yspeedEq = (-(speed / 5));
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else if (((((_root.game.passesNum == 0) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || (((_root.game.passesNum == 0) and (_root.game.downs > 0)) and (_root.game.playType == "passing"))) || (((_root.game.passesNum == 0) and (_root.game.tdMode != false)) and (_root.game.playType == "passing"))) {
var xspeedEq = (-(speed / 6));
var yspeedEq = (-(speed / 6));
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
}
}
if ((_root.game.gameMode != "plays") || (_root.game.paused == true)) {
speedDone = false;
}
if (((_root.game.gameMode == "plays") || (_root.game.gameMode == "celebration")) || (_root.game.gameMode == "shot")) {
xspeed = xspeed + (Math.cos((rot - 180) * (Math.PI/180)) * xspeedEq);
yspeed = yspeed + (Math.sin((rot - 180) * (Math.PI/180)) * yspeedEq);
}
if (collisionTimer < 1) {
collisionTimer = collisionTimer + 1;
} else {
collisionTimer = 0;
}
if (((_root.game.vibrate == true) and (_root.game.paused == false)) || (_root.game.mouseIsDown == true)) {
if ((collisionTimer == 0) and (team == 1)) {
i = 0;
while (i < (_root.game.playerNum + 1)) {
var target = _root.game["player" + i];
if (_name != ("player" + i)) {
checkCollision(this, target);
}
i = i + 1;
}
checkWalls();
}
if ((collisionTimer == 1) and (team == 2)) {
i = 12;
while (i < (_root.game.playerNum + 1)) {
var target = _root.game["player" + i];
if (_name != ("player" + i)) {
checkCollision(this, target);
}
i = i + 1;
}
checkWalls();
}
}
if (_root.game.gameMode == "puntSafety") {
checkWalls();
}
xspeed = xspeed * 0.97;
yspeed = yspeed * 0.97;
rotVel = rotVel * 0.97;
this.swapDepths(_y + (_x / 5));
if ((_name == "player22") and (_root.game.playType == "running")) {
} else {
var aniFrames = ani._totalframes;
rotStored = rotStored + rotVel;
if (rotStored > (360 / aniFrames)) {
if (ani._currentframe < aniFrames) {
ani.nextFrame();
} else {
ani.gotoAndStop(1);
}
rotStored = rotStored - (360 / aniFrames);
}
if (rotStored < (-(360 / aniFrames))) {
if (ani._currentframe > 1) {
ani.prevFrame();
} else {
ani.gotoAndStop(aniFrames);
}
rotStored = rotStored + (360 / aniFrames);
}
rot = rot + rotVel;
_xscale = (depthScale * 110);
_yscale = _xscale;
}
if (((_root.game.gameMode == "plays") || (_root.game.gameMode == "celebration")) || (_root.game.gameMode == "shot")) {
_x = (_x + (xspeed * depthScale));
_y = (_y + (yspeed * depthScale));
}
}
}
Instance of Symbol 198 MovieClip "player18" in Symbol 494 MovieClip Frame 2
onClipEvent (load) {
hitSound = new Sound(this);
hitSound.attachSound("hitSound");
xspeed = 0;
yspeed = 0;
speed = 0.1 * _root.game.vibrationVal;
currentY = _y - _root.game.pitchBackY;
posY = currentY / _root.game.pitchFrontY;
percent = _root.game.pitchDepth / _root.game.horizon;
depthScale = (1 - percent) + (posY * percent);
rotVel = 0;
rotInc = 0;
rotTimer = random(20);
_rotation = 0;
xpos = _x + _root.game._x;
ypos = _y + _root.game._y;
_root.game.playerNum = _root.game.playerNum + 1;
mass = 2;
rad = hitArea._width / 2.3;
team = 0;
if (parseInt(substring(_name, 7, 2)) < 12) {
team = 1;
rot = 180;
origRot = rot;
if ((_name == "player22") || (_name == "player11")) {
gotoAndStop (4);
} else {
gotoAndStop (2);
}
ani.gotoAndStop(10);
} else {
team = 2;
rot = 0;
origRot = rot;
if ((_name == "player22") || (_name == "player11")) {
gotoAndStop (3);
} else {
gotoAndStop (1);
}
ani.gotoAndStop(1);
}
if (team == 2) {
trace(((("new Array(" + Math.round(_x)) + ",") + Math.round(_y)) + "),");
}
rotStored = 0;
heldTime = 0;
heldTime2 = 0;
tackled = false;
forwardProgress = 0;
progressTimer = 0;
type = "";
fixedLineX = 0;
speedDone = false;
var xspeedEq = speed;
var yspeedEq = speed;
storedVar = "";
collisionTimer = 0;
intercepted = false;
}
onClipEvent (enterFrame) {
function checkOutOfBounds() {
if (_root.game.ball.target == this) {
boundsPause();
if ((ani._currentframe < 6) || (ani._currentframe > 14)) {
if (team == 1) {
}
} else if ((ani._currentframe > 6) and (ani._currentframe < 14)) {
if (team == 2) {
}
}
}
}
function checkScrimmage() {
if (team == 1) {
if (_root.game.scrimmage < _root.game.endZoneL) {
_root.game.scrimmage = _root.game.twentyYardLineL;
_root.game.touchBack = true;
} else {
_root.game.touchBack = false;
}
if (_root.game.scrimmage > _root.game.endZoneR) {
_root.game.scrimmage = _root.game.endZoneR;
}
} else {
if (_root.game.scrimmage < _root.game.endZoneL) {
_root.game.scrimmage = _root.game.endZoneL;
}
if (_root.game.scrimmage > _root.game.endZoneR) {
_root.game.scrimmage = _root.game.twentyYardLineR;
_root.game.touchBack = true;
} else {
_root.game.touchBack = false;
}
}
}
function tacklePause() {
type = "tackle";
if ((_root.game.timeOut == true) and (_root.game.tdMode == false)) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
_root.game.scrimmage = _x + fixedLineX;
checkScrimmage();
}
if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "tackle";
_root.game.safed = true;
} else if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "tackle";
_root.game.safed = true;
} else {
type = "tackle";
}
if ((_root.game.paused == false) and (_root.game.gameMode != "celebration")) {
_root.game.sound.gotoAndPlay("whistle");
}
if (((((_root.game.gameMode == "plays") and (_root.game.paused == false)) || ((_root.game.gameMode == "kickOff") and (_root.game.paused == false))) || ((_root.game.gameMode == "punt") and (_root.game.paused == false))) || (((_root.game.tdMode != false) and (_root.game.paused == false)) and (_root.game.gameMode == "plays"))) {
tackled = true;
type = "tackle";
if ((_root.game.passesNum == 0) and (_root.game.gameMode != "celebration")) {
if (_parent.ball.target.team == 1) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
if (((_x + fixedLineX) < _root.game.scrimmage) and (_root.game.downs > 0)) {
_parent.addMessage("sack");
} else {
_parent.addMessage("tackled");
}
}
if (_parent.ball.target.team == 2) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
if (((_x + fixedLineX) > _root.game.scrimmage) and (_root.game.downs > 0)) {
_parent.addMessage("sack");
} else {
_parent.addMessage("tackled");
}
}
} else if (_root.game.gameMode != "celebration") {
_parent.addMessage("tackled");
}
_root.game.pauseTime = 55;
}
}
function boundsPause() {
if (_root.game.timeOut == true) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
_root.game.scrimmage = _x + fixedLineX;
checkScrimmage();
}
if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "bounds";
_root.game.safed = true;
} else if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "bounds";
_root.game.safed = true;
} else {
type = "bounds";
}
type = "bounds";
_root.game.sound.gotoAndPlay("whistle");
tackled = true;
_parent.addMessage("outOfBounds");
_root.game.pauseTime = 55;
}
function turnedPause() {
if (_root.game.timeOut == true) {
_root.game.scrimmage = forwardProgress;
checkScrimmage();
}
type = "turn";
_root.game.sound.gotoAndPlay("whistle");
tackled = true;
_parent.addMessage("turnedAround");
_parent.addMessage("negativeProgress");
_root.game.pauseTime = 55;
}
function tackle() {
if ((_root.game.gameMode != "puntSafety") and (gameMode != "scrum")) {
if (_root.game.tdMode != false) {
if ((_root.game.timeOut == false) and (_root.game.gameMode != "celebration")) {
_root.game.startKickoff(_root.game.playersTeam);
_root.game.removeTackles();
tacked = false;
_root.game.tdMode = false;
} else if (_root.game.gameMode != "celebration") {
_root.game.removeTackles();
tacked = false;
_root.game.tdMode = false;
_root.game.gameMode = "convFail";
trace(_root.game.gameMode);
} else {
_root.game.removeTackles();
tacked = false;
}
} else if ((_root.game.downs <= 3.5) || (_root.game.goForIt == true)) {
if ((((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (type != "turn")) and (_root.game.downs > 0.5)) and (_root.game.ball.target == this)) and (_root.game.gameMode != "celebration")) {
_root.game.addMessage("Safety");
if (team != _root.game.playersTeam) {
_root.game.setupSafetyKick(_root.game.compTeam);
_root.game.hscore = _root.game.hscore + 2;
} else {
_root.game.setupSafetyKick(_root.game.playersTeam);
_root.game.gscore = _root.game.gscore + 2;
}
tackled = false;
} else if ((((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (type != "turn")) and (_root.game.downs > 0.5)) and (_root.game.ball.target == this)) and (_root.game.gameMode != "celebration")) {
_root.game.addMessage("Safety");
if (team != _root.game.playersTeam) {
_root.game.setupSafetyKick(_root.game.compTeam);
_root.game.hscore = _root.game.hscore + 2;
} else {
_root.game.setupSafetyKick(_root.game.playersTeam);
_root.game.gscore = _root.game.gscore + 2;
}
tackled = false;
} else {
_root.game.changeMode = false;
tackled = false;
if (type == "turn") {
var _local4 = forwardProgress;
} else {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
var _local4 = _x + fixedLineX;
}
_root.game.scrimmage = _local4;
if (_parent.ball.target.team != _root.game.playersTeam) {
var _local5 = random(2);
if (_local5 == 1) {
_root.game.compPlayType = "passing";
_root.game.setupLine(_root.game.compTeam, _root.game.formationShotgun, _local4, 0.5);
} else {
_root.game.compPlayType = "running";
_root.game.setupLine(_root.game.compTeam, _root.game.formationI, _local4, 0.5);
}
_root.game.setupLine(_root.game.playersTeam, _root.game.formation43, _local4, 0.5);
} else {
var _local5 = 1 + random(5);
_root.game.compPlayType = "defense";
_root.game.setupLine(_root.game.compTeam, _root.game["formationDefence" + _local5], _local4, 0.5);
_root.game.setupLine(_root.game.playersTeam, _root.game.formationShotgun, _local4, 0.5);
}
}
} else if ((_root.game.goForIt == true) and (_root.game.gameMode == "plays")) {
if (_root.game.changeMode == false) {
_root.game.downs = _root.game.downs + 1;
}
_root.game.pauseTime = 0;
_root.game.paused = false;
tackled = false;
} else if (_root.game.gameMode == "plays") {
_root.game.pauseTime = 0;
_root.game.paused = false;
if (_root.game.changeMode == false) {
_root.game.downs = _root.game.downs + 1;
}
tackled = false;
}
}
}
function checkWalls() {
if ((_y + 10) > _root.game.pitchFrontY) {
if (((yspeed > 1) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) {
checkOutOfBounds();
}
_y = (_y - 1);
yspeed = (-yspeed) * 0.5;
}
if ((_y - 5) < _root.game.pitchBackY) {
if (((yspeed < 1) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) {
checkOutOfBounds();
}
_y = (_y + 1);
yspeed = (-yspeed) * 0.5;
}
if (_root.game.walls.hitTest(xpos + (hitArea._width / 2), ypos, true) and (_x > 300)) {
_x = (_x - 2);
xspeed = (-xspeed) * 0.5;
}
if (_root.game.walls.hitTest(xpos - (hitArea._width / 2), ypos, true) and (_x < 300)) {
_x = (_x + 2);
xspeed = (-xspeed) * 0.5;
}
}
function checkCollision(b1, b2) {
var _local12 = b2._x - b1._x;
var _local11 = b2._y - b1._y;
var _local19 = Math.sqrt((_local12 * _local12) + (_local11 * _local11));
if (_local19 < (b1.rad + b2.rad)) {
if (((_parent.ball.target == this) and (b2.team != this.team)) || ((_parent.ball.target == b2) and (this.team != b2.team))) {
tacklePause();
}
if (_root.game.gameMode == "plays") {
var _local8 = 0;
if (xspeed < 0) {
_local8 = _local8 + (-xspeed);
} else {
_local8 = _local8 + xspeed;
}
if (yspeed < 0) {
_local8 = _local8 + (-yspeed);
} else {
_local8 = _local8 + yspeed;
}
if (_local8 > 1) {
hitSound.setVolume(_local8 * 15);
hitSound.start(0, 0);
hitSound.setVolume(_local8 * 15);
}
}
var _local18 = Math.atan2(_local11, _local12);
var _local7 = Math.cos(_local18);
var _local6 = Math.sin(_local18);
var _local9 = (_local7 * b1.xspeed) + (_local6 * b1.yspeed);
var _local15 = (_local7 * b1.yspeed) - (_local6 * b1.xspeed);
var _local10 = (_local7 * b2.xspeed) + (_local6 * b2.yspeed);
var _local14 = (_local7 * b2.yspeed) - (_local6 * b2.xspeed);
var _local21 = (_local9 * b1.mass) + (_local10 * b2.mass);
var _local20 = _local9 - _local10;
_local9 = (_local21 - (b2.mass * _local20)) / (b1.mass + b2.mass);
_local10 = _local20 + _local9;
b1.xspeed = ((_local7 * _local9) - (_local6 * _local15)) * 0.7;
b1.yspeed = ((_local7 * _local15) + (_local6 * _local9)) * 0.7;
b2.xspeed = ((_local7 * _local10) - (_local6 * _local14)) * 0.7;
b2.yspeed = ((_local7 * _local14) + (_local6 * _local10)) * 0.7;
var _local16 = ((b1.rad + b2.rad) - _local19) / 2;
var _local17 = _local7 * _local16;
var _local13 = _local6 * _local16;
b1._x = b1._x - (_local17 * 1.1);
b1._y = b1._y - (_local13 * 1.1);
b2._x = b2._x + (_local17 * 1.1);
b2._y = b2._y + (_local13 * 1.1);
}
}
if (_root.game.gameMode == "kickOff") {
var xspeedEq = speed;
var yspeedEq = speed;
}
if (_root.game.cleanUp == true) {
this.removeMovieClip();
}
if ((_root.game.gameMode == "scrum") || (_root.game.gameMode == "kickOff")) {
forwardProgress = 0;
progressTimer = 0;
}
if (team == _root.game.playersTeam) {
if (_root.game.playType == "running") {
if (_root.game.playersTeam == 1) {
if ((((_name == "player7") || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else if ((((_name == "player18") || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else {
mass = 2;
}
}
if (team == _root.game.compTeam) {
if (_root.game.compPlayType == "running") {
if (_root.game.compTeam == 1) {
if ((((_name == "player7") || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else if ((((_name == "player18") || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else {
mass = 2;
}
}
if ((((((_name == "player22") and (parseInt(_root.game.ball.storedOwner.team) == 2)) and (_root.game.gameMode != "plays")) and (_root.game.gameMode != "celebration")) and (_root.game.paused == false)) || (((((_name == "player11") and (parseInt(_root.game.ball.storedOwner.team) == 1)) and (_root.game.gameMode != "plays")) and (_root.game.gameMode != "celebration")) and (_root.game.paused == false))) {
if (_currentframe == 1) {
gotoAndStop (3);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(10);
}
} else if (_currentframe == 2) {
gotoAndStop (4);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(10);
}
}
} else if (((((_name == "player22") and (_root.game.gameMode != "plays")) and (_root.game.paused == false)) and (_root.game.gameMode != "celebration")) and (_root.game.gameMode != "shot")) {
gotoAndStop(_root.game.player21._currentframe);
} else if (((((_name == "player11") and (_root.game.gameMode != "plays")) and (_root.game.paused == false)) and (_root.game.gameMode != "celebration")) and (_root.game.gameMode != "shot")) {
gotoAndStop(_root.game.player10._currentframe);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(_root.game.player10.ani._currentframe);
}
}
if ((tackled == true) and (_root.game.paused == false)) {
tackle();
}
if (_root.game.paused == false) {
if (_parent.ball.target != this) {
arrow.gotoAndStop(1);
var arrowPlayed = false;
heldTime = 0;
} else {
if ((_parent.passesNum == 1) || (_root.game.downs == 0)) {
if (team == 1) {
if ((((xspeed < 0) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) and (_root.game.messageList.length == 0)) {
if ((_root.game.tdMode == false) || ((_root.game.tdMode != false) and (_parent.passesNum > 0))) {
progressTimer = progressTimer + 1;
if ((forwardProgress == 0) || (forwardProgress < (_x + fixedLineX))) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
forwardProgress = _x + fixedLineX;
}
if (progressTimer > 50) {
turnedPause();
progressTimer = 0;
}
} else {
progressTimer = 0;
}
}
} else if ((((xspeed > 0) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) and (_root.game.messageList.length == 0)) {
if ((_root.game.tdMode == false) || ((_root.game.tdMode != false) and (_parent.passesNum > 0))) {
progressTimer = progressTimer + 1;
if ((forwardProgress == 0) || (forwardProgress > (_x + fixedLineX))) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
forwardProgress = _x + fixedLineX;
}
if (progressTimer > 50) {
turnedPause();
progressTimer = 0;
}
} else {
progressTimer = 0;
}
}
}
if ((((team == 1) and (_root.game.gameMode == "plays")) and (team != _root.game.playersTeam)) || (((team == 1) and (_root.game.gameMode == "plays")) and (_root.game.demoMode == true))) {
heldTime = heldTime + 1;
var playerAmount = 12;
i = 1;
while (i < playerAmount) {
var target = _root.game["player" + i];
var randFactor = random(3);
if (((((((((target._x > (_x + 40)) and (_parent.passesNum == 0)) and (heldTime > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed > (1.5 * _root.game.vibrationVal))) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || ((((_parent.nzone.hitTest(target.xpos, target.ypos, true) and (target._x > _x)) and (_parent.passesNum == 0)) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing"))) || ((((((((target._x > (_x + 40)) and (_parent.passesNum == 0)) and (heldTime > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed > 1.5)) and (_root.game.downs > 0)) and (_root.game.playType == "passing")) and (_root.game.demoMode == true))) {
_parent.passesNum = _parent.passesNum + 1;
_parent.ball.target = "";
_parent.ball.targetX = _root.game["player" + i]._x + (_root.game["player" + i].xspeed * (8 + random(15)));
_parent.ball.targetY = (_root.game["player" + i]._y - 10) + (_root.game["player" + i].yspeed * (8 + random(15)));
var dx = (_parent.ball.targetX - _parent.ball._x);
var dy = (_parent.ball.targetY - _parent.ball._y);
var dist = Math.sqrt((dx * dx) + (dy * dy));
_parent.ball.xspeed = dx / (dist / 10);
_parent.ball.yspeed = dy / (dist / 10);
_parent.ball.zspeed = -(dist / 20);
_parent.ball.zpos = 4;
}
i = i + 1;
}
} else {
heldTime = 0;
}
if ((((team == 2) and (_root.game.gameMode == "plays")) and (team != _root.game.playersTeam)) || (((team == 2) and (_root.game.gameMode == "plays")) and (_root.game.demoMode == true))) {
heldTime2 = heldTime2 + 1;
var playerAmount = 23;
i = 12;
while (i < playerAmount) {
var target = _root.game["player" + i];
var randFactor = random(3);
if ((((((((target._x < (_x - 40)) and (_parent.passesNum == 0)) and (heldTime2 > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed < (-1.5 * _root.game.vibrationVal))) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || ((((_parent.nzone.hitTest(target.xpos, target.ypos, true) and (target._x < _x)) and (_parent.passesNum == 0)) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing"))) {
_parent.passesNum = _parent.passesNum + 1;
_parent.ball.target = "";
_parent.ball.targetX = _root.game["player" + i]._x + (_root.game["player" + i].xspeed * (8 + random(15)));
_parent.ball.targetY = (_root.game["player" + i]._y - 10) + (_root.game["player" + i].yspeed * (8 + random(15)));
var dx = (_parent.ball.targetX - _parent.ball._x);
var dy = (_parent.ball.targetY - _parent.ball._y);
var dist = Math.sqrt((dx * dx) + (dy * dy));
_parent.ball.xspeed = dx / (dist / 10);
_parent.ball.yspeed = dy / (dist / 10);
_parent.ball.zspeed = -(dist / 20);
_parent.ball.zpos = 4;
}
i = i + 1;
}
} else {
heldTime2 = 0;
}
if (arrowPlayed == false) {
arrow.play();
var arrowPlayed = true;
}
}
if ((_root.game.gameMode == "plays") and (_parent.ball.target == "")) {
if ((((((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player22")) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player11"))) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player4"))) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player16"))) {
} else {
var catchRad = (rad * 2.5);
var zcatch = 4;
}
if (_root.game.ball.target == "") {
if ((_root.game.ball._x < (_x + 50)) and (_root.game.ball._x > (_x - 50))) {
if ((((_root.game.lastGameMode == "kickOff") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player22")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "kickOff") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player11")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "punt") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player15")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "punt") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player4")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "puntSafety") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player15")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "puntSafety") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player4")) {
_root.game.ball.target = this;
}
}
if ((_root.game.ball._x < (_x + 20)) and (_root.game.ball._x > (_x - 20))) {
var dx = (_parent.ball._x - _x);
var dy = (_parent.ball._y - (_y - 10));
var dist = Math.sqrt((dx * dx) + (dy * dy));
if (((dist < catchRad) and (_parent.ball.zpos < zcatch)) and (_root.game.ball.bounce < 1)) {
if ((_parent.ball.storedOwner.team != team) and (_parent.ball.storedOwner.team > 0)) {
if (_root.game.tdMode != false) {
tacklePause();
} else {
_parent.scoreboard.bigscreen.ani.gotoAndPlay("intercept");
_root.game.downs = 0;
intercepted = true;
_root.game.intercepted = true;
}
}
_parent.ball.target = this;
arrow.play();
}
var dx = ((_parent.ball._x + _root.game.ball.xspeed) - _x);
var dy = ((_parent.ball._y + _root.game.ball.yspeed) - (_y - 10));
var dist = Math.sqrt((dx * dx) + (dy * dy));
if (((dist < catchRad) and (_parent.ball.zpos < zcatch)) and (_root.game.ball.bounce < 1)) {
if ((_parent.ball.storedOwner.team != team) and (_parent.ball.storedOwner.team > 0)) {
if (_root.game.tdMode != false) {
tacklePause();
} else {
_parent.scoreboard.bigscreen.ani.gotoAndPlay("intercept");
_root.game.downs = 0;
intercepted = true;
_root.game.intercepted = true;
}
}
_parent.ball.target = this;
arrow.play();
}
}
}
}
xpos = _x + _root.game._x;
ypos = _y + _root.game._y;
speed = 0.12 * _root.game.vibrationVal;
currentY = _y - _root.game.pitchBackY;
posY = currentY / _root.game.pitchFrontY;
percent = _root.game.pitchDepth / _root.game.horizon;
depthScale = (1 - percent) + (posY * percent);
if (intercepted == true) {
speedDone = false;
intercepted = false;
}
if ((_root.game.vibrate == true) and (_root.game.paused == false)) {
rotTimer = 1 + random(20 * _root.game.vibrationVal);
if (rotTimer == 1) {
rotInc = (-30 + random(60)) / 140;
}
rotVel = rotVel + rotInc;
if (((_root.game.gameMode == "plays") and (speedDone == false)) || (_root.game.mouseIsDown == true)) {
if (_root.game.lastGameMode != "kickOff") {
speedDone = true;
if (_root.game.ball.target != this) {
if (((_root.game.playType == "running") and (team == _root.game.playersTeam)) || ((_root.game.compPlayType == "running") and (team == _root.game.compTeam))) {
if ((((((((((_name == "player22") || (_name == "player18")) || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) || (_name == "player11")) || (_name == "player7")) || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
var xspeedEq = (speed * 1.5);
var yspeedEq = (speed * 1.5);
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else if (((_root.game.playType == "defense") and (team == _root.game.playersTeam)) || ((_root.game.compPlayType == "defense") and (team == _root.game.compTeam))) {
if ((_root.downs >= 1) and (_root.game.blitz == false)) {
if ((((_name == "player8") || (_name == "player9")) || (_name == "player19")) || (_name == "player20")) {
var xspeedEq = (-(speed / 3));
var yspeedEq = (-(speed / 3));
} else if ((((_name == "player10") || (_name == "player11")) || (_name == "player21")) || (_name == "player22")) {
var xspeedEq = (-(speed / 5));
var yspeedEq = (-(speed / 5));
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else if (((((_root.game.passesNum == 0) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || (((_root.game.passesNum == 0) and (_root.game.downs > 0)) and (_root.game.playType == "passing"))) || (((_root.game.passesNum == 0) and (_root.game.tdMode != false)) and (_root.game.playType == "passing"))) {
var xspeedEq = (-(speed / 6));
var yspeedEq = (-(speed / 6));
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
}
}
if ((_root.game.gameMode != "plays") || (_root.game.paused == true)) {
speedDone = false;
}
if (((_root.game.gameMode == "plays") || (_root.game.gameMode == "celebration")) || (_root.game.gameMode == "shot")) {
xspeed = xspeed + (Math.cos((rot - 180) * (Math.PI/180)) * xspeedEq);
yspeed = yspeed + (Math.sin((rot - 180) * (Math.PI/180)) * yspeedEq);
}
if (collisionTimer < 1) {
collisionTimer = collisionTimer + 1;
} else {
collisionTimer = 0;
}
if (((_root.game.vibrate == true) and (_root.game.paused == false)) || (_root.game.mouseIsDown == true)) {
if ((collisionTimer == 0) and (team == 1)) {
i = 0;
while (i < (_root.game.playerNum + 1)) {
var target = _root.game["player" + i];
if (_name != ("player" + i)) {
checkCollision(this, target);
}
i = i + 1;
}
checkWalls();
}
if ((collisionTimer == 1) and (team == 2)) {
i = 12;
while (i < (_root.game.playerNum + 1)) {
var target = _root.game["player" + i];
if (_name != ("player" + i)) {
checkCollision(this, target);
}
i = i + 1;
}
checkWalls();
}
}
if (_root.game.gameMode == "puntSafety") {
checkWalls();
}
xspeed = xspeed * 0.97;
yspeed = yspeed * 0.97;
rotVel = rotVel * 0.97;
this.swapDepths(_y + (_x / 5));
if ((_name == "player22") and (_root.game.playType == "running")) {
} else {
var aniFrames = ani._totalframes;
rotStored = rotStored + rotVel;
if (rotStored > (360 / aniFrames)) {
if (ani._currentframe < aniFrames) {
ani.nextFrame();
} else {
ani.gotoAndStop(1);
}
rotStored = rotStored - (360 / aniFrames);
}
if (rotStored < (-(360 / aniFrames))) {
if (ani._currentframe > 1) {
ani.prevFrame();
} else {
ani.gotoAndStop(aniFrames);
}
rotStored = rotStored + (360 / aniFrames);
}
rot = rot + rotVel;
_xscale = (depthScale * 110);
_yscale = _xscale;
}
if (((_root.game.gameMode == "plays") || (_root.game.gameMode == "celebration")) || (_root.game.gameMode == "shot")) {
_x = (_x + (xspeed * depthScale));
_y = (_y + (yspeed * depthScale));
}
}
}
Instance of Symbol 198 MovieClip "player3" in Symbol 494 MovieClip Frame 2
onClipEvent (load) {
hitSound = new Sound(this);
hitSound.attachSound("hitSound");
xspeed = 0;
yspeed = 0;
speed = 0.1 * _root.game.vibrationVal;
currentY = _y - _root.game.pitchBackY;
posY = currentY / _root.game.pitchFrontY;
percent = _root.game.pitchDepth / _root.game.horizon;
depthScale = (1 - percent) + (posY * percent);
rotVel = 0;
rotInc = 0;
rotTimer = random(20);
_rotation = 0;
xpos = _x + _root.game._x;
ypos = _y + _root.game._y;
_root.game.playerNum = _root.game.playerNum + 1;
mass = 2;
rad = hitArea._width / 2.3;
team = 0;
if (parseInt(substring(_name, 7, 2)) < 12) {
team = 1;
rot = 180;
origRot = rot;
if ((_name == "player22") || (_name == "player11")) {
gotoAndStop (4);
} else {
gotoAndStop (2);
}
ani.gotoAndStop(10);
} else {
team = 2;
rot = 0;
origRot = rot;
if ((_name == "player22") || (_name == "player11")) {
gotoAndStop (3);
} else {
gotoAndStop (1);
}
ani.gotoAndStop(1);
}
if (team == 2) {
trace(((("new Array(" + Math.round(_x)) + ",") + Math.round(_y)) + "),");
}
rotStored = 0;
heldTime = 0;
heldTime2 = 0;
tackled = false;
forwardProgress = 0;
progressTimer = 0;
type = "";
fixedLineX = 0;
speedDone = false;
var xspeedEq = speed;
var yspeedEq = speed;
storedVar = "";
collisionTimer = 0;
intercepted = false;
}
onClipEvent (enterFrame) {
function checkOutOfBounds() {
if (_root.game.ball.target == this) {
boundsPause();
if ((ani._currentframe < 6) || (ani._currentframe > 14)) {
if (team == 1) {
}
} else if ((ani._currentframe > 6) and (ani._currentframe < 14)) {
if (team == 2) {
}
}
}
}
function checkScrimmage() {
if (team == 1) {
if (_root.game.scrimmage < _root.game.endZoneL) {
_root.game.scrimmage = _root.game.twentyYardLineL;
_root.game.touchBack = true;
} else {
_root.game.touchBack = false;
}
if (_root.game.scrimmage > _root.game.endZoneR) {
_root.game.scrimmage = _root.game.endZoneR;
}
} else {
if (_root.game.scrimmage < _root.game.endZoneL) {
_root.game.scrimmage = _root.game.endZoneL;
}
if (_root.game.scrimmage > _root.game.endZoneR) {
_root.game.scrimmage = _root.game.twentyYardLineR;
_root.game.touchBack = true;
} else {
_root.game.touchBack = false;
}
}
}
function tacklePause() {
type = "tackle";
if ((_root.game.timeOut == true) and (_root.game.tdMode == false)) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
_root.game.scrimmage = _x + fixedLineX;
checkScrimmage();
}
if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "tackle";
_root.game.safed = true;
} else if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "tackle";
_root.game.safed = true;
} else {
type = "tackle";
}
if ((_root.game.paused == false) and (_root.game.gameMode != "celebration")) {
_root.game.sound.gotoAndPlay("whistle");
}
if (((((_root.game.gameMode == "plays") and (_root.game.paused == false)) || ((_root.game.gameMode == "kickOff") and (_root.game.paused == false))) || ((_root.game.gameMode == "punt") and (_root.game.paused == false))) || (((_root.game.tdMode != false) and (_root.game.paused == false)) and (_root.game.gameMode == "plays"))) {
tackled = true;
type = "tackle";
if ((_root.game.passesNum == 0) and (_root.game.gameMode != "celebration")) {
if (_parent.ball.target.team == 1) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
if (((_x + fixedLineX) < _root.game.scrimmage) and (_root.game.downs > 0)) {
_parent.addMessage("sack");
} else {
_parent.addMessage("tackled");
}
}
if (_parent.ball.target.team == 2) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
if (((_x + fixedLineX) > _root.game.scrimmage) and (_root.game.downs > 0)) {
_parent.addMessage("sack");
} else {
_parent.addMessage("tackled");
}
}
} else if (_root.game.gameMode != "celebration") {
_parent.addMessage("tackled");
}
_root.game.pauseTime = 55;
}
}
function boundsPause() {
if (_root.game.timeOut == true) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
_root.game.scrimmage = _x + fixedLineX;
checkScrimmage();
}
if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "bounds";
_root.game.safed = true;
} else if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "bounds";
_root.game.safed = true;
} else {
type = "bounds";
}
type = "bounds";
_root.game.sound.gotoAndPlay("whistle");
tackled = true;
_parent.addMessage("outOfBounds");
_root.game.pauseTime = 55;
}
function turnedPause() {
if (_root.game.timeOut == true) {
_root.game.scrimmage = forwardProgress;
checkScrimmage();
}
type = "turn";
_root.game.sound.gotoAndPlay("whistle");
tackled = true;
_parent.addMessage("turnedAround");
_parent.addMessage("negativeProgress");
_root.game.pauseTime = 55;
}
function tackle() {
if ((_root.game.gameMode != "puntSafety") and (gameMode != "scrum")) {
if (_root.game.tdMode != false) {
if ((_root.game.timeOut == false) and (_root.game.gameMode != "celebration")) {
_root.game.startKickoff(_root.game.playersTeam);
_root.game.removeTackles();
tacked = false;
_root.game.tdMode = false;
} else if (_root.game.gameMode != "celebration") {
_root.game.removeTackles();
tacked = false;
_root.game.tdMode = false;
_root.game.gameMode = "convFail";
trace(_root.game.gameMode);
} else {
_root.game.removeTackles();
tacked = false;
}
} else if ((_root.game.downs <= 3.5) || (_root.game.goForIt == true)) {
if ((((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (type != "turn")) and (_root.game.downs > 0.5)) and (_root.game.ball.target == this)) and (_root.game.gameMode != "celebration")) {
_root.game.addMessage("Safety");
if (team != _root.game.playersTeam) {
_root.game.setupSafetyKick(_root.game.compTeam);
_root.game.hscore = _root.game.hscore + 2;
} else {
_root.game.setupSafetyKick(_root.game.playersTeam);
_root.game.gscore = _root.game.gscore + 2;
}
tackled = false;
} else if ((((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (type != "turn")) and (_root.game.downs > 0.5)) and (_root.game.ball.target == this)) and (_root.game.gameMode != "celebration")) {
_root.game.addMessage("Safety");
if (team != _root.game.playersTeam) {
_root.game.setupSafetyKick(_root.game.compTeam);
_root.game.hscore = _root.game.hscore + 2;
} else {
_root.game.setupSafetyKick(_root.game.playersTeam);
_root.game.gscore = _root.game.gscore + 2;
}
tackled = false;
} else {
_root.game.changeMode = false;
tackled = false;
if (type == "turn") {
var _local4 = forwardProgress;
} else {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
var _local4 = _x + fixedLineX;
}
_root.game.scrimmage = _local4;
if (_parent.ball.target.team != _root.game.playersTeam) {
var _local5 = random(2);
if (_local5 == 1) {
_root.game.compPlayType = "passing";
_root.game.setupLine(_root.game.compTeam, _root.game.formationShotgun, _local4, 0.5);
} else {
_root.game.compPlayType = "running";
_root.game.setupLine(_root.game.compTeam, _root.game.formationI, _local4, 0.5);
}
_root.game.setupLine(_root.game.playersTeam, _root.game.formation43, _local4, 0.5);
} else {
var _local5 = 1 + random(5);
_root.game.compPlayType = "defense";
_root.game.setupLine(_root.game.compTeam, _root.game["formationDefence" + _local5], _local4, 0.5);
_root.game.setupLine(_root.game.playersTeam, _root.game.formationShotgun, _local4, 0.5);
}
}
} else if ((_root.game.goForIt == true) and (_root.game.gameMode == "plays")) {
if (_root.game.changeMode == false) {
_root.game.downs = _root.game.downs + 1;
}
_root.game.pauseTime = 0;
_root.game.paused = false;
tackled = false;
} else if (_root.game.gameMode == "plays") {
_root.game.pauseTime = 0;
_root.game.paused = false;
if (_root.game.changeMode == false) {
_root.game.downs = _root.game.downs + 1;
}
tackled = false;
}
}
}
function checkWalls() {
if ((_y + 10) > _root.game.pitchFrontY) {
if (((yspeed > 1) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) {
checkOutOfBounds();
}
_y = (_y - 1);
yspeed = (-yspeed) * 0.5;
}
if ((_y - 5) < _root.game.pitchBackY) {
if (((yspeed < 1) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) {
checkOutOfBounds();
}
_y = (_y + 1);
yspeed = (-yspeed) * 0.5;
}
if (_root.game.walls.hitTest(xpos + (hitArea._width / 2), ypos, true) and (_x > 300)) {
_x = (_x - 2);
xspeed = (-xspeed) * 0.5;
}
if (_root.game.walls.hitTest(xpos - (hitArea._width / 2), ypos, true) and (_x < 300)) {
_x = (_x + 2);
xspeed = (-xspeed) * 0.5;
}
}
function checkCollision(b1, b2) {
var _local12 = b2._x - b1._x;
var _local11 = b2._y - b1._y;
var _local19 = Math.sqrt((_local12 * _local12) + (_local11 * _local11));
if (_local19 < (b1.rad + b2.rad)) {
if (((_parent.ball.target == this) and (b2.team != this.team)) || ((_parent.ball.target == b2) and (this.team != b2.team))) {
tacklePause();
}
if (_root.game.gameMode == "plays") {
var _local8 = 0;
if (xspeed < 0) {
_local8 = _local8 + (-xspeed);
} else {
_local8 = _local8 + xspeed;
}
if (yspeed < 0) {
_local8 = _local8 + (-yspeed);
} else {
_local8 = _local8 + yspeed;
}
if (_local8 > 1) {
hitSound.setVolume(_local8 * 15);
hitSound.start(0, 0);
hitSound.setVolume(_local8 * 15);
}
}
var _local18 = Math.atan2(_local11, _local12);
var _local7 = Math.cos(_local18);
var _local6 = Math.sin(_local18);
var _local9 = (_local7 * b1.xspeed) + (_local6 * b1.yspeed);
var _local15 = (_local7 * b1.yspeed) - (_local6 * b1.xspeed);
var _local10 = (_local7 * b2.xspeed) + (_local6 * b2.yspeed);
var _local14 = (_local7 * b2.yspeed) - (_local6 * b2.xspeed);
var _local21 = (_local9 * b1.mass) + (_local10 * b2.mass);
var _local20 = _local9 - _local10;
_local9 = (_local21 - (b2.mass * _local20)) / (b1.mass + b2.mass);
_local10 = _local20 + _local9;
b1.xspeed = ((_local7 * _local9) - (_local6 * _local15)) * 0.7;
b1.yspeed = ((_local7 * _local15) + (_local6 * _local9)) * 0.7;
b2.xspeed = ((_local7 * _local10) - (_local6 * _local14)) * 0.7;
b2.yspeed = ((_local7 * _local14) + (_local6 * _local10)) * 0.7;
var _local16 = ((b1.rad + b2.rad) - _local19) / 2;
var _local17 = _local7 * _local16;
var _local13 = _local6 * _local16;
b1._x = b1._x - (_local17 * 1.1);
b1._y = b1._y - (_local13 * 1.1);
b2._x = b2._x + (_local17 * 1.1);
b2._y = b2._y + (_local13 * 1.1);
}
}
if (_root.game.gameMode == "kickOff") {
var xspeedEq = speed;
var yspeedEq = speed;
}
if (_root.game.cleanUp == true) {
this.removeMovieClip();
}
if ((_root.game.gameMode == "scrum") || (_root.game.gameMode == "kickOff")) {
forwardProgress = 0;
progressTimer = 0;
}
if (team == _root.game.playersTeam) {
if (_root.game.playType == "running") {
if (_root.game.playersTeam == 1) {
if ((((_name == "player7") || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else if ((((_name == "player18") || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else {
mass = 2;
}
}
if (team == _root.game.compTeam) {
if (_root.game.compPlayType == "running") {
if (_root.game.compTeam == 1) {
if ((((_name == "player7") || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else if ((((_name == "player18") || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else {
mass = 2;
}
}
if ((((((_name == "player22") and (parseInt(_root.game.ball.storedOwner.team) == 2)) and (_root.game.gameMode != "plays")) and (_root.game.gameMode != "celebration")) and (_root.game.paused == false)) || (((((_name == "player11") and (parseInt(_root.game.ball.storedOwner.team) == 1)) and (_root.game.gameMode != "plays")) and (_root.game.gameMode != "celebration")) and (_root.game.paused == false))) {
if (_currentframe == 1) {
gotoAndStop (3);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(10);
}
} else if (_currentframe == 2) {
gotoAndStop (4);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(10);
}
}
} else if (((((_name == "player22") and (_root.game.gameMode != "plays")) and (_root.game.paused == false)) and (_root.game.gameMode != "celebration")) and (_root.game.gameMode != "shot")) {
gotoAndStop(_root.game.player21._currentframe);
} else if (((((_name == "player11") and (_root.game.gameMode != "plays")) and (_root.game.paused == false)) and (_root.game.gameMode != "celebration")) and (_root.game.gameMode != "shot")) {
gotoAndStop(_root.game.player10._currentframe);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(_root.game.player10.ani._currentframe);
}
}
if ((tackled == true) and (_root.game.paused == false)) {
tackle();
}
if (_root.game.paused == false) {
if (_parent.ball.target != this) {
arrow.gotoAndStop(1);
var arrowPlayed = false;
heldTime = 0;
} else {
if ((_parent.passesNum == 1) || (_root.game.downs == 0)) {
if (team == 1) {
if ((((xspeed < 0) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) and (_root.game.messageList.length == 0)) {
if ((_root.game.tdMode == false) || ((_root.game.tdMode != false) and (_parent.passesNum > 0))) {
progressTimer = progressTimer + 1;
if ((forwardProgress == 0) || (forwardProgress < (_x + fixedLineX))) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
forwardProgress = _x + fixedLineX;
}
if (progressTimer > 50) {
turnedPause();
progressTimer = 0;
}
} else {
progressTimer = 0;
}
}
} else if ((((xspeed > 0) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) and (_root.game.messageList.length == 0)) {
if ((_root.game.tdMode == false) || ((_root.game.tdMode != false) and (_parent.passesNum > 0))) {
progressTimer = progressTimer + 1;
if ((forwardProgress == 0) || (forwardProgress > (_x + fixedLineX))) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
forwardProgress = _x + fixedLineX;
}
if (progressTimer > 50) {
turnedPause();
progressTimer = 0;
}
} else {
progressTimer = 0;
}
}
}
if ((((team == 1) and (_root.game.gameMode == "plays")) and (team != _root.game.playersTeam)) || (((team == 1) and (_root.game.gameMode == "plays")) and (_root.game.demoMode == true))) {
heldTime = heldTime + 1;
var playerAmount = 12;
i = 1;
while (i < playerAmount) {
var target = _root.game["player" + i];
var randFactor = random(3);
if (((((((((target._x > (_x + 40)) and (_parent.passesNum == 0)) and (heldTime > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed > (1.5 * _root.game.vibrationVal))) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || ((((_parent.nzone.hitTest(target.xpos, target.ypos, true) and (target._x > _x)) and (_parent.passesNum == 0)) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing"))) || ((((((((target._x > (_x + 40)) and (_parent.passesNum == 0)) and (heldTime > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed > 1.5)) and (_root.game.downs > 0)) and (_root.game.playType == "passing")) and (_root.game.demoMode == true))) {
_parent.passesNum = _parent.passesNum + 1;
_parent.ball.target = "";
_parent.ball.targetX = _root.game["player" + i]._x + (_root.game["player" + i].xspeed * (8 + random(15)));
_parent.ball.targetY = (_root.game["player" + i]._y - 10) + (_root.game["player" + i].yspeed * (8 + random(15)));
var dx = (_parent.ball.targetX - _parent.ball._x);
var dy = (_parent.ball.targetY - _parent.ball._y);
var dist = Math.sqrt((dx * dx) + (dy * dy));
_parent.ball.xspeed = dx / (dist / 10);
_parent.ball.yspeed = dy / (dist / 10);
_parent.ball.zspeed = -(dist / 20);
_parent.ball.zpos = 4;
}
i = i + 1;
}
} else {
heldTime = 0;
}
if ((((team == 2) and (_root.game.gameMode == "plays")) and (team != _root.game.playersTeam)) || (((team == 2) and (_root.game.gameMode == "plays")) and (_root.game.demoMode == true))) {
heldTime2 = heldTime2 + 1;
var playerAmount = 23;
i = 12;
while (i < playerAmount) {
var target = _root.game["player" + i];
var randFactor = random(3);
if ((((((((target._x < (_x - 40)) and (_parent.passesNum == 0)) and (heldTime2 > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed < (-1.5 * _root.game.vibrationVal))) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || ((((_parent.nzone.hitTest(target.xpos, target.ypos, true) and (target._x < _x)) and (_parent.passesNum == 0)) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing"))) {
_parent.passesNum = _parent.passesNum + 1;
_parent.ball.target = "";
_parent.ball.targetX = _root.game["player" + i]._x + (_root.game["player" + i].xspeed * (8 + random(15)));
_parent.ball.targetY = (_root.game["player" + i]._y - 10) + (_root.game["player" + i].yspeed * (8 + random(15)));
var dx = (_parent.ball.targetX - _parent.ball._x);
var dy = (_parent.ball.targetY - _parent.ball._y);
var dist = Math.sqrt((dx * dx) + (dy * dy));
_parent.ball.xspeed = dx / (dist / 10);
_parent.ball.yspeed = dy / (dist / 10);
_parent.ball.zspeed = -(dist / 20);
_parent.ball.zpos = 4;
}
i = i + 1;
}
} else {
heldTime2 = 0;
}
if (arrowPlayed == false) {
arrow.play();
var arrowPlayed = true;
}
}
if ((_root.game.gameMode == "plays") and (_parent.ball.target == "")) {
if ((((((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player22")) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player11"))) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player4"))) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player16"))) {
} else {
var catchRad = (rad * 2.5);
var zcatch = 4;
}
if (_root.game.ball.target == "") {
if ((_root.game.ball._x < (_x + 50)) and (_root.game.ball._x > (_x - 50))) {
if ((((_root.game.lastGameMode == "kickOff") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player22")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "kickOff") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player11")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "punt") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player15")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "punt") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player4")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "puntSafety") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player15")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "puntSafety") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player4")) {
_root.game.ball.target = this;
}
}
if ((_root.game.ball._x < (_x + 20)) and (_root.game.ball._x > (_x - 20))) {
var dx = (_parent.ball._x - _x);
var dy = (_parent.ball._y - (_y - 10));
var dist = Math.sqrt((dx * dx) + (dy * dy));
if (((dist < catchRad) and (_parent.ball.zpos < zcatch)) and (_root.game.ball.bounce < 1)) {
if ((_parent.ball.storedOwner.team != team) and (_parent.ball.storedOwner.team > 0)) {
if (_root.game.tdMode != false) {
tacklePause();
} else {
_parent.scoreboard.bigscreen.ani.gotoAndPlay("intercept");
_root.game.downs = 0;
intercepted = true;
_root.game.intercepted = true;
}
}
_parent.ball.target = this;
arrow.play();
}
var dx = ((_parent.ball._x + _root.game.ball.xspeed) - _x);
var dy = ((_parent.ball._y + _root.game.ball.yspeed) - (_y - 10));
var dist = Math.sqrt((dx * dx) + (dy * dy));
if (((dist < catchRad) and (_parent.ball.zpos < zcatch)) and (_root.game.ball.bounce < 1)) {
if ((_parent.ball.storedOwner.team != team) and (_parent.ball.storedOwner.team > 0)) {
if (_root.game.tdMode != false) {
tacklePause();
} else {
_parent.scoreboard.bigscreen.ani.gotoAndPlay("intercept");
_root.game.downs = 0;
intercepted = true;
_root.game.intercepted = true;
}
}
_parent.ball.target = this;
arrow.play();
}
}
}
}
xpos = _x + _root.game._x;
ypos = _y + _root.game._y;
speed = 0.12 * _root.game.vibrationVal;
currentY = _y - _root.game.pitchBackY;
posY = currentY / _root.game.pitchFrontY;
percent = _root.game.pitchDepth / _root.game.horizon;
depthScale = (1 - percent) + (posY * percent);
if (intercepted == true) {
speedDone = false;
intercepted = false;
}
if ((_root.game.vibrate == true) and (_root.game.paused == false)) {
rotTimer = 1 + random(20 * _root.game.vibrationVal);
if (rotTimer == 1) {
rotInc = (-30 + random(60)) / 140;
}
rotVel = rotVel + rotInc;
if (((_root.game.gameMode == "plays") and (speedDone == false)) || (_root.game.mouseIsDown == true)) {
if (_root.game.lastGameMode != "kickOff") {
speedDone = true;
if (_root.game.ball.target != this) {
if (((_root.game.playType == "running") and (team == _root.game.playersTeam)) || ((_root.game.compPlayType == "running") and (team == _root.game.compTeam))) {
if ((((((((((_name == "player22") || (_name == "player18")) || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) || (_name == "player11")) || (_name == "player7")) || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
var xspeedEq = (speed * 1.5);
var yspeedEq = (speed * 1.5);
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else if (((_root.game.playType == "defense") and (team == _root.game.playersTeam)) || ((_root.game.compPlayType == "defense") and (team == _root.game.compTeam))) {
if ((_root.downs >= 1) and (_root.game.blitz == false)) {
if ((((_name == "player8") || (_name == "player9")) || (_name == "player19")) || (_name == "player20")) {
var xspeedEq = (-(speed / 3));
var yspeedEq = (-(speed / 3));
} else if ((((_name == "player10") || (_name == "player11")) || (_name == "player21")) || (_name == "player22")) {
var xspeedEq = (-(speed / 5));
var yspeedEq = (-(speed / 5));
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else if (((((_root.game.passesNum == 0) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || (((_root.game.passesNum == 0) and (_root.game.downs > 0)) and (_root.game.playType == "passing"))) || (((_root.game.passesNum == 0) and (_root.game.tdMode != false)) and (_root.game.playType == "passing"))) {
var xspeedEq = (-(speed / 6));
var yspeedEq = (-(speed / 6));
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
}
}
if ((_root.game.gameMode != "plays") || (_root.game.paused == true)) {
speedDone = false;
}
if (((_root.game.gameMode == "plays") || (_root.game.gameMode == "celebration")) || (_root.game.gameMode == "shot")) {
xspeed = xspeed + (Math.cos((rot - 180) * (Math.PI/180)) * xspeedEq);
yspeed = yspeed + (Math.sin((rot - 180) * (Math.PI/180)) * yspeedEq);
}
if (collisionTimer < 1) {
collisionTimer = collisionTimer + 1;
} else {
collisionTimer = 0;
}
if (((_root.game.vibrate == true) and (_root.game.paused == false)) || (_root.game.mouseIsDown == true)) {
if ((collisionTimer == 0) and (team == 1)) {
i = 0;
while (i < (_root.game.playerNum + 1)) {
var target = _root.game["player" + i];
if (_name != ("player" + i)) {
checkCollision(this, target);
}
i = i + 1;
}
checkWalls();
}
if ((collisionTimer == 1) and (team == 2)) {
i = 12;
while (i < (_root.game.playerNum + 1)) {
var target = _root.game["player" + i];
if (_name != ("player" + i)) {
checkCollision(this, target);
}
i = i + 1;
}
checkWalls();
}
}
if (_root.game.gameMode == "puntSafety") {
checkWalls();
}
xspeed = xspeed * 0.97;
yspeed = yspeed * 0.97;
rotVel = rotVel * 0.97;
this.swapDepths(_y + (_x / 5));
if ((_name == "player22") and (_root.game.playType == "running")) {
} else {
var aniFrames = ani._totalframes;
rotStored = rotStored + rotVel;
if (rotStored > (360 / aniFrames)) {
if (ani._currentframe < aniFrames) {
ani.nextFrame();
} else {
ani.gotoAndStop(1);
}
rotStored = rotStored - (360 / aniFrames);
}
if (rotStored < (-(360 / aniFrames))) {
if (ani._currentframe > 1) {
ani.prevFrame();
} else {
ani.gotoAndStop(aniFrames);
}
rotStored = rotStored + (360 / aniFrames);
}
rot = rot + rotVel;
_xscale = (depthScale * 110);
_yscale = _xscale;
}
if (((_root.game.gameMode == "plays") || (_root.game.gameMode == "celebration")) || (_root.game.gameMode == "shot")) {
_x = (_x + (xspeed * depthScale));
_y = (_y + (yspeed * depthScale));
}
}
}
Instance of Symbol 198 MovieClip "player10" in Symbol 494 MovieClip Frame 2
onClipEvent (load) {
hitSound = new Sound(this);
hitSound.attachSound("hitSound");
xspeed = 0;
yspeed = 0;
speed = 0.1 * _root.game.vibrationVal;
currentY = _y - _root.game.pitchBackY;
posY = currentY / _root.game.pitchFrontY;
percent = _root.game.pitchDepth / _root.game.horizon;
depthScale = (1 - percent) + (posY * percent);
rotVel = 0;
rotInc = 0;
rotTimer = random(20);
_rotation = 0;
xpos = _x + _root.game._x;
ypos = _y + _root.game._y;
_root.game.playerNum = _root.game.playerNum + 1;
mass = 2;
rad = hitArea._width / 2.3;
team = 0;
if (parseInt(substring(_name, 7, 2)) < 12) {
team = 1;
rot = 180;
origRot = rot;
if ((_name == "player22") || (_name == "player11")) {
gotoAndStop (4);
} else {
gotoAndStop (2);
}
ani.gotoAndStop(10);
} else {
team = 2;
rot = 0;
origRot = rot;
if ((_name == "player22") || (_name == "player11")) {
gotoAndStop (3);
} else {
gotoAndStop (1);
}
ani.gotoAndStop(1);
}
if (team == 2) {
trace(((("new Array(" + Math.round(_x)) + ",") + Math.round(_y)) + "),");
}
rotStored = 0;
heldTime = 0;
heldTime2 = 0;
tackled = false;
forwardProgress = 0;
progressTimer = 0;
type = "";
fixedLineX = 0;
speedDone = false;
var xspeedEq = speed;
var yspeedEq = speed;
storedVar = "";
collisionTimer = 0;
intercepted = false;
}
onClipEvent (enterFrame) {
function checkOutOfBounds() {
if (_root.game.ball.target == this) {
boundsPause();
if ((ani._currentframe < 6) || (ani._currentframe > 14)) {
if (team == 1) {
}
} else if ((ani._currentframe > 6) and (ani._currentframe < 14)) {
if (team == 2) {
}
}
}
}
function checkScrimmage() {
if (team == 1) {
if (_root.game.scrimmage < _root.game.endZoneL) {
_root.game.scrimmage = _root.game.twentyYardLineL;
_root.game.touchBack = true;
} else {
_root.game.touchBack = false;
}
if (_root.game.scrimmage > _root.game.endZoneR) {
_root.game.scrimmage = _root.game.endZoneR;
}
} else {
if (_root.game.scrimmage < _root.game.endZoneL) {
_root.game.scrimmage = _root.game.endZoneL;
}
if (_root.game.scrimmage > _root.game.endZoneR) {
_root.game.scrimmage = _root.game.twentyYardLineR;
_root.game.touchBack = true;
} else {
_root.game.touchBack = false;
}
}
}
function tacklePause() {
type = "tackle";
if ((_root.game.timeOut == true) and (_root.game.tdMode == false)) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
_root.game.scrimmage = _x + fixedLineX;
checkScrimmage();
}
if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "tackle";
_root.game.safed = true;
} else if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "tackle";
_root.game.safed = true;
} else {
type = "tackle";
}
if ((_root.game.paused == false) and (_root.game.gameMode != "celebration")) {
_root.game.sound.gotoAndPlay("whistle");
}
if (((((_root.game.gameMode == "plays") and (_root.game.paused == false)) || ((_root.game.gameMode == "kickOff") and (_root.game.paused == false))) || ((_root.game.gameMode == "punt") and (_root.game.paused == false))) || (((_root.game.tdMode != false) and (_root.game.paused == false)) and (_root.game.gameMode == "plays"))) {
tackled = true;
type = "tackle";
if ((_root.game.passesNum == 0) and (_root.game.gameMode != "celebration")) {
if (_parent.ball.target.team == 1) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
if (((_x + fixedLineX) < _root.game.scrimmage) and (_root.game.downs > 0)) {
_parent.addMessage("sack");
} else {
_parent.addMessage("tackled");
}
}
if (_parent.ball.target.team == 2) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
if (((_x + fixedLineX) > _root.game.scrimmage) and (_root.game.downs > 0)) {
_parent.addMessage("sack");
} else {
_parent.addMessage("tackled");
}
}
} else if (_root.game.gameMode != "celebration") {
_parent.addMessage("tackled");
}
_root.game.pauseTime = 55;
}
}
function boundsPause() {
if (_root.game.timeOut == true) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
_root.game.scrimmage = _x + fixedLineX;
checkScrimmage();
}
if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "bounds";
_root.game.safed = true;
} else if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "bounds";
_root.game.safed = true;
} else {
type = "bounds";
}
type = "bounds";
_root.game.sound.gotoAndPlay("whistle");
tackled = true;
_parent.addMessage("outOfBounds");
_root.game.pauseTime = 55;
}
function turnedPause() {
if (_root.game.timeOut == true) {
_root.game.scrimmage = forwardProgress;
checkScrimmage();
}
type = "turn";
_root.game.sound.gotoAndPlay("whistle");
tackled = true;
_parent.addMessage("turnedAround");
_parent.addMessage("negativeProgress");
_root.game.pauseTime = 55;
}
function tackle() {
if ((_root.game.gameMode != "puntSafety") and (gameMode != "scrum")) {
if (_root.game.tdMode != false) {
if ((_root.game.timeOut == false) and (_root.game.gameMode != "celebration")) {
_root.game.startKickoff(_root.game.playersTeam);
_root.game.removeTackles();
tacked = false;
_root.game.tdMode = false;
} else if (_root.game.gameMode != "celebration") {
_root.game.removeTackles();
tacked = false;
_root.game.tdMode = false;
_root.game.gameMode = "convFail";
trace(_root.game.gameMode);
} else {
_root.game.removeTackles();
tacked = false;
}
} else if ((_root.game.downs <= 3.5) || (_root.game.goForIt == true)) {
if ((((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (type != "turn")) and (_root.game.downs > 0.5)) and (_root.game.ball.target == this)) and (_root.game.gameMode != "celebration")) {
_root.game.addMessage("Safety");
if (team != _root.game.playersTeam) {
_root.game.setupSafetyKick(_root.game.compTeam);
_root.game.hscore = _root.game.hscore + 2;
} else {
_root.game.setupSafetyKick(_root.game.playersTeam);
_root.game.gscore = _root.game.gscore + 2;
}
tackled = false;
} else if ((((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (type != "turn")) and (_root.game.downs > 0.5)) and (_root.game.ball.target == this)) and (_root.game.gameMode != "celebration")) {
_root.game.addMessage("Safety");
if (team != _root.game.playersTeam) {
_root.game.setupSafetyKick(_root.game.compTeam);
_root.game.hscore = _root.game.hscore + 2;
} else {
_root.game.setupSafetyKick(_root.game.playersTeam);
_root.game.gscore = _root.game.gscore + 2;
}
tackled = false;
} else {
_root.game.changeMode = false;
tackled = false;
if (type == "turn") {
var _local4 = forwardProgress;
} else {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
var _local4 = _x + fixedLineX;
}
_root.game.scrimmage = _local4;
if (_parent.ball.target.team != _root.game.playersTeam) {
var _local5 = random(2);
if (_local5 == 1) {
_root.game.compPlayType = "passing";
_root.game.setupLine(_root.game.compTeam, _root.game.formationShotgun, _local4, 0.5);
} else {
_root.game.compPlayType = "running";
_root.game.setupLine(_root.game.compTeam, _root.game.formationI, _local4, 0.5);
}
_root.game.setupLine(_root.game.playersTeam, _root.game.formation43, _local4, 0.5);
} else {
var _local5 = 1 + random(5);
_root.game.compPlayType = "defense";
_root.game.setupLine(_root.game.compTeam, _root.game["formationDefence" + _local5], _local4, 0.5);
_root.game.setupLine(_root.game.playersTeam, _root.game.formationShotgun, _local4, 0.5);
}
}
} else if ((_root.game.goForIt == true) and (_root.game.gameMode == "plays")) {
if (_root.game.changeMode == false) {
_root.game.downs = _root.game.downs + 1;
}
_root.game.pauseTime = 0;
_root.game.paused = false;
tackled = false;
} else if (_root.game.gameMode == "plays") {
_root.game.pauseTime = 0;
_root.game.paused = false;
if (_root.game.changeMode == false) {
_root.game.downs = _root.game.downs + 1;
}
tackled = false;
}
}
}
function checkWalls() {
if ((_y + 10) > _root.game.pitchFrontY) {
if (((yspeed > 1) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) {
checkOutOfBounds();
}
_y = (_y - 1);
yspeed = (-yspeed) * 0.5;
}
if ((_y - 5) < _root.game.pitchBackY) {
if (((yspeed < 1) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) {
checkOutOfBounds();
}
_y = (_y + 1);
yspeed = (-yspeed) * 0.5;
}
if (_root.game.walls.hitTest(xpos + (hitArea._width / 2), ypos, true) and (_x > 300)) {
_x = (_x - 2);
xspeed = (-xspeed) * 0.5;
}
if (_root.game.walls.hitTest(xpos - (hitArea._width / 2), ypos, true) and (_x < 300)) {
_x = (_x + 2);
xspeed = (-xspeed) * 0.5;
}
}
function checkCollision(b1, b2) {
var _local12 = b2._x - b1._x;
var _local11 = b2._y - b1._y;
var _local19 = Math.sqrt((_local12 * _local12) + (_local11 * _local11));
if (_local19 < (b1.rad + b2.rad)) {
if (((_parent.ball.target == this) and (b2.team != this.team)) || ((_parent.ball.target == b2) and (this.team != b2.team))) {
tacklePause();
}
if (_root.game.gameMode == "plays") {
var _local8 = 0;
if (xspeed < 0) {
_local8 = _local8 + (-xspeed);
} else {
_local8 = _local8 + xspeed;
}
if (yspeed < 0) {
_local8 = _local8 + (-yspeed);
} else {
_local8 = _local8 + yspeed;
}
if (_local8 > 1) {
hitSound.setVolume(_local8 * 15);
hitSound.start(0, 0);
hitSound.setVolume(_local8 * 15);
}
}
var _local18 = Math.atan2(_local11, _local12);
var _local7 = Math.cos(_local18);
var _local6 = Math.sin(_local18);
var _local9 = (_local7 * b1.xspeed) + (_local6 * b1.yspeed);
var _local15 = (_local7 * b1.yspeed) - (_local6 * b1.xspeed);
var _local10 = (_local7 * b2.xspeed) + (_local6 * b2.yspeed);
var _local14 = (_local7 * b2.yspeed) - (_local6 * b2.xspeed);
var _local21 = (_local9 * b1.mass) + (_local10 * b2.mass);
var _local20 = _local9 - _local10;
_local9 = (_local21 - (b2.mass * _local20)) / (b1.mass + b2.mass);
_local10 = _local20 + _local9;
b1.xspeed = ((_local7 * _local9) - (_local6 * _local15)) * 0.7;
b1.yspeed = ((_local7 * _local15) + (_local6 * _local9)) * 0.7;
b2.xspeed = ((_local7 * _local10) - (_local6 * _local14)) * 0.7;
b2.yspeed = ((_local7 * _local14) + (_local6 * _local10)) * 0.7;
var _local16 = ((b1.rad + b2.rad) - _local19) / 2;
var _local17 = _local7 * _local16;
var _local13 = _local6 * _local16;
b1._x = b1._x - (_local17 * 1.1);
b1._y = b1._y - (_local13 * 1.1);
b2._x = b2._x + (_local17 * 1.1);
b2._y = b2._y + (_local13 * 1.1);
}
}
if (_root.game.gameMode == "kickOff") {
var xspeedEq = speed;
var yspeedEq = speed;
}
if (_root.game.cleanUp == true) {
this.removeMovieClip();
}
if ((_root.game.gameMode == "scrum") || (_root.game.gameMode == "kickOff")) {
forwardProgress = 0;
progressTimer = 0;
}
if (team == _root.game.playersTeam) {
if (_root.game.playType == "running") {
if (_root.game.playersTeam == 1) {
if ((((_name == "player7") || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else if ((((_name == "player18") || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else {
mass = 2;
}
}
if (team == _root.game.compTeam) {
if (_root.game.compPlayType == "running") {
if (_root.game.compTeam == 1) {
if ((((_name == "player7") || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else if ((((_name == "player18") || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else {
mass = 2;
}
}
if ((((((_name == "player22") and (parseInt(_root.game.ball.storedOwner.team) == 2)) and (_root.game.gameMode != "plays")) and (_root.game.gameMode != "celebration")) and (_root.game.paused == false)) || (((((_name == "player11") and (parseInt(_root.game.ball.storedOwner.team) == 1)) and (_root.game.gameMode != "plays")) and (_root.game.gameMode != "celebration")) and (_root.game.paused == false))) {
if (_currentframe == 1) {
gotoAndStop (3);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(10);
}
} else if (_currentframe == 2) {
gotoAndStop (4);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(10);
}
}
} else if (((((_name == "player22") and (_root.game.gameMode != "plays")) and (_root.game.paused == false)) and (_root.game.gameMode != "celebration")) and (_root.game.gameMode != "shot")) {
gotoAndStop(_root.game.player21._currentframe);
} else if (((((_name == "player11") and (_root.game.gameMode != "plays")) and (_root.game.paused == false)) and (_root.game.gameMode != "celebration")) and (_root.game.gameMode != "shot")) {
gotoAndStop(_root.game.player10._currentframe);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(_root.game.player10.ani._currentframe);
}
}
if ((tackled == true) and (_root.game.paused == false)) {
tackle();
}
if (_root.game.paused == false) {
if (_parent.ball.target != this) {
arrow.gotoAndStop(1);
var arrowPlayed = false;
heldTime = 0;
} else {
if ((_parent.passesNum == 1) || (_root.game.downs == 0)) {
if (team == 1) {
if ((((xspeed < 0) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) and (_root.game.messageList.length == 0)) {
if ((_root.game.tdMode == false) || ((_root.game.tdMode != false) and (_parent.passesNum > 0))) {
progressTimer = progressTimer + 1;
if ((forwardProgress == 0) || (forwardProgress < (_x + fixedLineX))) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
forwardProgress = _x + fixedLineX;
}
if (progressTimer > 50) {
turnedPause();
progressTimer = 0;
}
} else {
progressTimer = 0;
}
}
} else if ((((xspeed > 0) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) and (_root.game.messageList.length == 0)) {
if ((_root.game.tdMode == false) || ((_root.game.tdMode != false) and (_parent.passesNum > 0))) {
progressTimer = progressTimer + 1;
if ((forwardProgress == 0) || (forwardProgress > (_x + fixedLineX))) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
forwardProgress = _x + fixedLineX;
}
if (progressTimer > 50) {
turnedPause();
progressTimer = 0;
}
} else {
progressTimer = 0;
}
}
}
if ((((team == 1) and (_root.game.gameMode == "plays")) and (team != _root.game.playersTeam)) || (((team == 1) and (_root.game.gameMode == "plays")) and (_root.game.demoMode == true))) {
heldTime = heldTime + 1;
var playerAmount = 12;
i = 1;
while (i < playerAmount) {
var target = _root.game["player" + i];
var randFactor = random(3);
if (((((((((target._x > (_x + 40)) and (_parent.passesNum == 0)) and (heldTime > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed > (1.5 * _root.game.vibrationVal))) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || ((((_parent.nzone.hitTest(target.xpos, target.ypos, true) and (target._x > _x)) and (_parent.passesNum == 0)) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing"))) || ((((((((target._x > (_x + 40)) and (_parent.passesNum == 0)) and (heldTime > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed > 1.5)) and (_root.game.downs > 0)) and (_root.game.playType == "passing")) and (_root.game.demoMode == true))) {
_parent.passesNum = _parent.passesNum + 1;
_parent.ball.target = "";
_parent.ball.targetX = _root.game["player" + i]._x + (_root.game["player" + i].xspeed * (8 + random(15)));
_parent.ball.targetY = (_root.game["player" + i]._y - 10) + (_root.game["player" + i].yspeed * (8 + random(15)));
var dx = (_parent.ball.targetX - _parent.ball._x);
var dy = (_parent.ball.targetY - _parent.ball._y);
var dist = Math.sqrt((dx * dx) + (dy * dy));
_parent.ball.xspeed = dx / (dist / 10);
_parent.ball.yspeed = dy / (dist / 10);
_parent.ball.zspeed = -(dist / 20);
_parent.ball.zpos = 4;
}
i = i + 1;
}
} else {
heldTime = 0;
}
if ((((team == 2) and (_root.game.gameMode == "plays")) and (team != _root.game.playersTeam)) || (((team == 2) and (_root.game.gameMode == "plays")) and (_root.game.demoMode == true))) {
heldTime2 = heldTime2 + 1;
var playerAmount = 23;
i = 12;
while (i < playerAmount) {
var target = _root.game["player" + i];
var randFactor = random(3);
if ((((((((target._x < (_x - 40)) and (_parent.passesNum == 0)) and (heldTime2 > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed < (-1.5 * _root.game.vibrationVal))) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || ((((_parent.nzone.hitTest(target.xpos, target.ypos, true) and (target._x < _x)) and (_parent.passesNum == 0)) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing"))) {
_parent.passesNum = _parent.passesNum + 1;
_parent.ball.target = "";
_parent.ball.targetX = _root.game["player" + i]._x + (_root.game["player" + i].xspeed * (8 + random(15)));
_parent.ball.targetY = (_root.game["player" + i]._y - 10) + (_root.game["player" + i].yspeed * (8 + random(15)));
var dx = (_parent.ball.targetX - _parent.ball._x);
var dy = (_parent.ball.targetY - _parent.ball._y);
var dist = Math.sqrt((dx * dx) + (dy * dy));
_parent.ball.xspeed = dx / (dist / 10);
_parent.ball.yspeed = dy / (dist / 10);
_parent.ball.zspeed = -(dist / 20);
_parent.ball.zpos = 4;
}
i = i + 1;
}
} else {
heldTime2 = 0;
}
if (arrowPlayed == false) {
arrow.play();
var arrowPlayed = true;
}
}
if ((_root.game.gameMode == "plays") and (_parent.ball.target == "")) {
if ((((((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player22")) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player11"))) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player4"))) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player16"))) {
} else {
var catchRad = (rad * 2.5);
var zcatch = 4;
}
if (_root.game.ball.target == "") {
if ((_root.game.ball._x < (_x + 50)) and (_root.game.ball._x > (_x - 50))) {
if ((((_root.game.lastGameMode == "kickOff") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player22")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "kickOff") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player11")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "punt") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player15")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "punt") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player4")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "puntSafety") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player15")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "puntSafety") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player4")) {
_root.game.ball.target = this;
}
}
if ((_root.game.ball._x < (_x + 20)) and (_root.game.ball._x > (_x - 20))) {
var dx = (_parent.ball._x - _x);
var dy = (_parent.ball._y - (_y - 10));
var dist = Math.sqrt((dx * dx) + (dy * dy));
if (((dist < catchRad) and (_parent.ball.zpos < zcatch)) and (_root.game.ball.bounce < 1)) {
if ((_parent.ball.storedOwner.team != team) and (_parent.ball.storedOwner.team > 0)) {
if (_root.game.tdMode != false) {
tacklePause();
} else {
_parent.scoreboard.bigscreen.ani.gotoAndPlay("intercept");
_root.game.downs = 0;
intercepted = true;
_root.game.intercepted = true;
}
}
_parent.ball.target = this;
arrow.play();
}
var dx = ((_parent.ball._x + _root.game.ball.xspeed) - _x);
var dy = ((_parent.ball._y + _root.game.ball.yspeed) - (_y - 10));
var dist = Math.sqrt((dx * dx) + (dy * dy));
if (((dist < catchRad) and (_parent.ball.zpos < zcatch)) and (_root.game.ball.bounce < 1)) {
if ((_parent.ball.storedOwner.team != team) and (_parent.ball.storedOwner.team > 0)) {
if (_root.game.tdMode != false) {
tacklePause();
} else {
_parent.scoreboard.bigscreen.ani.gotoAndPlay("intercept");
_root.game.downs = 0;
intercepted = true;
_root.game.intercepted = true;
}
}
_parent.ball.target = this;
arrow.play();
}
}
}
}
xpos = _x + _root.game._x;
ypos = _y + _root.game._y;
speed = 0.12 * _root.game.vibrationVal;
currentY = _y - _root.game.pitchBackY;
posY = currentY / _root.game.pitchFrontY;
percent = _root.game.pitchDepth / _root.game.horizon;
depthScale = (1 - percent) + (posY * percent);
if (intercepted == true) {
speedDone = false;
intercepted = false;
}
if ((_root.game.vibrate == true) and (_root.game.paused == false)) {
rotTimer = 1 + random(20 * _root.game.vibrationVal);
if (rotTimer == 1) {
rotInc = (-30 + random(60)) / 140;
}
rotVel = rotVel + rotInc;
if (((_root.game.gameMode == "plays") and (speedDone == false)) || (_root.game.mouseIsDown == true)) {
if (_root.game.lastGameMode != "kickOff") {
speedDone = true;
if (_root.game.ball.target != this) {
if (((_root.game.playType == "running") and (team == _root.game.playersTeam)) || ((_root.game.compPlayType == "running") and (team == _root.game.compTeam))) {
if ((((((((((_name == "player22") || (_name == "player18")) || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) || (_name == "player11")) || (_name == "player7")) || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
var xspeedEq = (speed * 1.5);
var yspeedEq = (speed * 1.5);
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else if (((_root.game.playType == "defense") and (team == _root.game.playersTeam)) || ((_root.game.compPlayType == "defense") and (team == _root.game.compTeam))) {
if ((_root.downs >= 1) and (_root.game.blitz == false)) {
if ((((_name == "player8") || (_name == "player9")) || (_name == "player19")) || (_name == "player20")) {
var xspeedEq = (-(speed / 3));
var yspeedEq = (-(speed / 3));
} else if ((((_name == "player10") || (_name == "player11")) || (_name == "player21")) || (_name == "player22")) {
var xspeedEq = (-(speed / 5));
var yspeedEq = (-(speed / 5));
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else if (((((_root.game.passesNum == 0) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || (((_root.game.passesNum == 0) and (_root.game.downs > 0)) and (_root.game.playType == "passing"))) || (((_root.game.passesNum == 0) and (_root.game.tdMode != false)) and (_root.game.playType == "passing"))) {
var xspeedEq = (-(speed / 6));
var yspeedEq = (-(speed / 6));
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
}
}
if ((_root.game.gameMode != "plays") || (_root.game.paused == true)) {
speedDone = false;
}
if (((_root.game.gameMode == "plays") || (_root.game.gameMode == "celebration")) || (_root.game.gameMode == "shot")) {
xspeed = xspeed + (Math.cos((rot - 180) * (Math.PI/180)) * xspeedEq);
yspeed = yspeed + (Math.sin((rot - 180) * (Math.PI/180)) * yspeedEq);
}
if (collisionTimer < 1) {
collisionTimer = collisionTimer + 1;
} else {
collisionTimer = 0;
}
if (((_root.game.vibrate == true) and (_root.game.paused == false)) || (_root.game.mouseIsDown == true)) {
if ((collisionTimer == 0) and (team == 1)) {
i = 0;
while (i < (_root.game.playerNum + 1)) {
var target = _root.game["player" + i];
if (_name != ("player" + i)) {
checkCollision(this, target);
}
i = i + 1;
}
checkWalls();
}
if ((collisionTimer == 1) and (team == 2)) {
i = 12;
while (i < (_root.game.playerNum + 1)) {
var target = _root.game["player" + i];
if (_name != ("player" + i)) {
checkCollision(this, target);
}
i = i + 1;
}
checkWalls();
}
}
if (_root.game.gameMode == "puntSafety") {
checkWalls();
}
xspeed = xspeed * 0.97;
yspeed = yspeed * 0.97;
rotVel = rotVel * 0.97;
this.swapDepths(_y + (_x / 5));
if ((_name == "player22") and (_root.game.playType == "running")) {
} else {
var aniFrames = ani._totalframes;
rotStored = rotStored + rotVel;
if (rotStored > (360 / aniFrames)) {
if (ani._currentframe < aniFrames) {
ani.nextFrame();
} else {
ani.gotoAndStop(1);
}
rotStored = rotStored - (360 / aniFrames);
}
if (rotStored < (-(360 / aniFrames))) {
if (ani._currentframe > 1) {
ani.prevFrame();
} else {
ani.gotoAndStop(aniFrames);
}
rotStored = rotStored + (360 / aniFrames);
}
rot = rot + rotVel;
_xscale = (depthScale * 110);
_yscale = _xscale;
}
if (((_root.game.gameMode == "plays") || (_root.game.gameMode == "celebration")) || (_root.game.gameMode == "shot")) {
_x = (_x + (xspeed * depthScale));
_y = (_y + (yspeed * depthScale));
}
}
}
Instance of Symbol 198 MovieClip "player4" in Symbol 494 MovieClip Frame 2
onClipEvent (load) {
hitSound = new Sound(this);
hitSound.attachSound("hitSound");
xspeed = 0;
yspeed = 0;
speed = 0.1 * _root.game.vibrationVal;
currentY = _y - _root.game.pitchBackY;
posY = currentY / _root.game.pitchFrontY;
percent = _root.game.pitchDepth / _root.game.horizon;
depthScale = (1 - percent) + (posY * percent);
rotVel = 0;
rotInc = 0;
rotTimer = random(20);
_rotation = 0;
xpos = _x + _root.game._x;
ypos = _y + _root.game._y;
_root.game.playerNum = _root.game.playerNum + 1;
mass = 2;
rad = hitArea._width / 2.3;
team = 0;
if (parseInt(substring(_name, 7, 2)) < 12) {
team = 1;
rot = 180;
origRot = rot;
if ((_name == "player22") || (_name == "player11")) {
gotoAndStop (4);
} else {
gotoAndStop (2);
}
ani.gotoAndStop(10);
} else {
team = 2;
rot = 0;
origRot = rot;
if ((_name == "player22") || (_name == "player11")) {
gotoAndStop (3);
} else {
gotoAndStop (1);
}
ani.gotoAndStop(1);
}
if (team == 2) {
trace(((("new Array(" + Math.round(_x)) + ",") + Math.round(_y)) + "),");
}
rotStored = 0;
heldTime = 0;
heldTime2 = 0;
tackled = false;
forwardProgress = 0;
progressTimer = 0;
type = "";
fixedLineX = 0;
speedDone = false;
var xspeedEq = speed;
var yspeedEq = speed;
storedVar = "";
collisionTimer = 0;
intercepted = false;
}
onClipEvent (enterFrame) {
function checkOutOfBounds() {
if (_root.game.ball.target == this) {
boundsPause();
if ((ani._currentframe < 6) || (ani._currentframe > 14)) {
if (team == 1) {
}
} else if ((ani._currentframe > 6) and (ani._currentframe < 14)) {
if (team == 2) {
}
}
}
}
function checkScrimmage() {
if (team == 1) {
if (_root.game.scrimmage < _root.game.endZoneL) {
_root.game.scrimmage = _root.game.twentyYardLineL;
_root.game.touchBack = true;
} else {
_root.game.touchBack = false;
}
if (_root.game.scrimmage > _root.game.endZoneR) {
_root.game.scrimmage = _root.game.endZoneR;
}
} else {
if (_root.game.scrimmage < _root.game.endZoneL) {
_root.game.scrimmage = _root.game.endZoneL;
}
if (_root.game.scrimmage > _root.game.endZoneR) {
_root.game.scrimmage = _root.game.twentyYardLineR;
_root.game.touchBack = true;
} else {
_root.game.touchBack = false;
}
}
}
function tacklePause() {
type = "tackle";
if ((_root.game.timeOut == true) and (_root.game.tdMode == false)) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
_root.game.scrimmage = _x + fixedLineX;
checkScrimmage();
}
if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "tackle";
_root.game.safed = true;
} else if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "tackle";
_root.game.safed = true;
} else {
type = "tackle";
}
if ((_root.game.paused == false) and (_root.game.gameMode != "celebration")) {
_root.game.sound.gotoAndPlay("whistle");
}
if (((((_root.game.gameMode == "plays") and (_root.game.paused == false)) || ((_root.game.gameMode == "kickOff") and (_root.game.paused == false))) || ((_root.game.gameMode == "punt") and (_root.game.paused == false))) || (((_root.game.tdMode != false) and (_root.game.paused == false)) and (_root.game.gameMode == "plays"))) {
tackled = true;
type = "tackle";
if ((_root.game.passesNum == 0) and (_root.game.gameMode != "celebration")) {
if (_parent.ball.target.team == 1) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
if (((_x + fixedLineX) < _root.game.scrimmage) and (_root.game.downs > 0)) {
_parent.addMessage("sack");
} else {
_parent.addMessage("tackled");
}
}
if (_parent.ball.target.team == 2) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
if (((_x + fixedLineX) > _root.game.scrimmage) and (_root.game.downs > 0)) {
_parent.addMessage("sack");
} else {
_parent.addMessage("tackled");
}
}
} else if (_root.game.gameMode != "celebration") {
_parent.addMessage("tackled");
}
_root.game.pauseTime = 55;
}
}
function boundsPause() {
if (_root.game.timeOut == true) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
_root.game.scrimmage = _x + fixedLineX;
checkScrimmage();
}
if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "bounds";
_root.game.safed = true;
} else if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "bounds";
_root.game.safed = true;
} else {
type = "bounds";
}
type = "bounds";
_root.game.sound.gotoAndPlay("whistle");
tackled = true;
_parent.addMessage("outOfBounds");
_root.game.pauseTime = 55;
}
function turnedPause() {
if (_root.game.timeOut == true) {
_root.game.scrimmage = forwardProgress;
checkScrimmage();
}
type = "turn";
_root.game.sound.gotoAndPlay("whistle");
tackled = true;
_parent.addMessage("turnedAround");
_parent.addMessage("negativeProgress");
_root.game.pauseTime = 55;
}
function tackle() {
if ((_root.game.gameMode != "puntSafety") and (gameMode != "scrum")) {
if (_root.game.tdMode != false) {
if ((_root.game.timeOut == false) and (_root.game.gameMode != "celebration")) {
_root.game.startKickoff(_root.game.playersTeam);
_root.game.removeTackles();
tacked = false;
_root.game.tdMode = false;
} else if (_root.game.gameMode != "celebration") {
_root.game.removeTackles();
tacked = false;
_root.game.tdMode = false;
_root.game.gameMode = "convFail";
trace(_root.game.gameMode);
} else {
_root.game.removeTackles();
tacked = false;
}
} else if ((_root.game.downs <= 3.5) || (_root.game.goForIt == true)) {
if ((((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (type != "turn")) and (_root.game.downs > 0.5)) and (_root.game.ball.target == this)) and (_root.game.gameMode != "celebration")) {
_root.game.addMessage("Safety");
if (team != _root.game.playersTeam) {
_root.game.setupSafetyKick(_root.game.compTeam);
_root.game.hscore = _root.game.hscore + 2;
} else {
_root.game.setupSafetyKick(_root.game.playersTeam);
_root.game.gscore = _root.game.gscore + 2;
}
tackled = false;
} else if ((((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (type != "turn")) and (_root.game.downs > 0.5)) and (_root.game.ball.target == this)) and (_root.game.gameMode != "celebration")) {
_root.game.addMessage("Safety");
if (team != _root.game.playersTeam) {
_root.game.setupSafetyKick(_root.game.compTeam);
_root.game.hscore = _root.game.hscore + 2;
} else {
_root.game.setupSafetyKick(_root.game.playersTeam);
_root.game.gscore = _root.game.gscore + 2;
}
tackled = false;
} else {
_root.game.changeMode = false;
tackled = false;
if (type == "turn") {
var _local4 = forwardProgress;
} else {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
var _local4 = _x + fixedLineX;
}
_root.game.scrimmage = _local4;
if (_parent.ball.target.team != _root.game.playersTeam) {
var _local5 = random(2);
if (_local5 == 1) {
_root.game.compPlayType = "passing";
_root.game.setupLine(_root.game.compTeam, _root.game.formationShotgun, _local4, 0.5);
} else {
_root.game.compPlayType = "running";
_root.game.setupLine(_root.game.compTeam, _root.game.formationI, _local4, 0.5);
}
_root.game.setupLine(_root.game.playersTeam, _root.game.formation43, _local4, 0.5);
} else {
var _local5 = 1 + random(5);
_root.game.compPlayType = "defense";
_root.game.setupLine(_root.game.compTeam, _root.game["formationDefence" + _local5], _local4, 0.5);
_root.game.setupLine(_root.game.playersTeam, _root.game.formationShotgun, _local4, 0.5);
}
}
} else if ((_root.game.goForIt == true) and (_root.game.gameMode == "plays")) {
if (_root.game.changeMode == false) {
_root.game.downs = _root.game.downs + 1;
}
_root.game.pauseTime = 0;
_root.game.paused = false;
tackled = false;
} else if (_root.game.gameMode == "plays") {
_root.game.pauseTime = 0;
_root.game.paused = false;
if (_root.game.changeMode == false) {
_root.game.downs = _root.game.downs + 1;
}
tackled = false;
}
}
}
function checkWalls() {
if ((_y + 10) > _root.game.pitchFrontY) {
if (((yspeed > 1) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) {
checkOutOfBounds();
}
_y = (_y - 1);
yspeed = (-yspeed) * 0.5;
}
if ((_y - 5) < _root.game.pitchBackY) {
if (((yspeed < 1) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) {
checkOutOfBounds();
}
_y = (_y + 1);
yspeed = (-yspeed) * 0.5;
}
if (_root.game.walls.hitTest(xpos + (hitArea._width / 2), ypos, true) and (_x > 300)) {
_x = (_x - 2);
xspeed = (-xspeed) * 0.5;
}
if (_root.game.walls.hitTest(xpos - (hitArea._width / 2), ypos, true) and (_x < 300)) {
_x = (_x + 2);
xspeed = (-xspeed) * 0.5;
}
}
function checkCollision(b1, b2) {
var _local12 = b2._x - b1._x;
var _local11 = b2._y - b1._y;
var _local19 = Math.sqrt((_local12 * _local12) + (_local11 * _local11));
if (_local19 < (b1.rad + b2.rad)) {
if (((_parent.ball.target == this) and (b2.team != this.team)) || ((_parent.ball.target == b2) and (this.team != b2.team))) {
tacklePause();
}
if (_root.game.gameMode == "plays") {
var _local8 = 0;
if (xspeed < 0) {
_local8 = _local8 + (-xspeed);
} else {
_local8 = _local8 + xspeed;
}
if (yspeed < 0) {
_local8 = _local8 + (-yspeed);
} else {
_local8 = _local8 + yspeed;
}
if (_local8 > 1) {
hitSound.setVolume(_local8 * 15);
hitSound.start(0, 0);
hitSound.setVolume(_local8 * 15);
}
}
var _local18 = Math.atan2(_local11, _local12);
var _local7 = Math.cos(_local18);
var _local6 = Math.sin(_local18);
var _local9 = (_local7 * b1.xspeed) + (_local6 * b1.yspeed);
var _local15 = (_local7 * b1.yspeed) - (_local6 * b1.xspeed);
var _local10 = (_local7 * b2.xspeed) + (_local6 * b2.yspeed);
var _local14 = (_local7 * b2.yspeed) - (_local6 * b2.xspeed);
var _local21 = (_local9 * b1.mass) + (_local10 * b2.mass);
var _local20 = _local9 - _local10;
_local9 = (_local21 - (b2.mass * _local20)) / (b1.mass + b2.mass);
_local10 = _local20 + _local9;
b1.xspeed = ((_local7 * _local9) - (_local6 * _local15)) * 0.7;
b1.yspeed = ((_local7 * _local15) + (_local6 * _local9)) * 0.7;
b2.xspeed = ((_local7 * _local10) - (_local6 * _local14)) * 0.7;
b2.yspeed = ((_local7 * _local14) + (_local6 * _local10)) * 0.7;
var _local16 = ((b1.rad + b2.rad) - _local19) / 2;
var _local17 = _local7 * _local16;
var _local13 = _local6 * _local16;
b1._x = b1._x - (_local17 * 1.1);
b1._y = b1._y - (_local13 * 1.1);
b2._x = b2._x + (_local17 * 1.1);
b2._y = b2._y + (_local13 * 1.1);
}
}
if (_root.game.gameMode == "kickOff") {
var xspeedEq = speed;
var yspeedEq = speed;
}
if (_root.game.cleanUp == true) {
this.removeMovieClip();
}
if ((_root.game.gameMode == "scrum") || (_root.game.gameMode == "kickOff")) {
forwardProgress = 0;
progressTimer = 0;
}
if (team == _root.game.playersTeam) {
if (_root.game.playType == "running") {
if (_root.game.playersTeam == 1) {
if ((((_name == "player7") || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else if ((((_name == "player18") || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else {
mass = 2;
}
}
if (team == _root.game.compTeam) {
if (_root.game.compPlayType == "running") {
if (_root.game.compTeam == 1) {
if ((((_name == "player7") || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else if ((((_name == "player18") || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else {
mass = 2;
}
}
if ((((((_name == "player22") and (parseInt(_root.game.ball.storedOwner.team) == 2)) and (_root.game.gameMode != "plays")) and (_root.game.gameMode != "celebration")) and (_root.game.paused == false)) || (((((_name == "player11") and (parseInt(_root.game.ball.storedOwner.team) == 1)) and (_root.game.gameMode != "plays")) and (_root.game.gameMode != "celebration")) and (_root.game.paused == false))) {
if (_currentframe == 1) {
gotoAndStop (3);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(10);
}
} else if (_currentframe == 2) {
gotoAndStop (4);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(10);
}
}
} else if (((((_name == "player22") and (_root.game.gameMode != "plays")) and (_root.game.paused == false)) and (_root.game.gameMode != "celebration")) and (_root.game.gameMode != "shot")) {
gotoAndStop(_root.game.player21._currentframe);
} else if (((((_name == "player11") and (_root.game.gameMode != "plays")) and (_root.game.paused == false)) and (_root.game.gameMode != "celebration")) and (_root.game.gameMode != "shot")) {
gotoAndStop(_root.game.player10._currentframe);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(_root.game.player10.ani._currentframe);
}
}
if ((tackled == true) and (_root.game.paused == false)) {
tackle();
}
if (_root.game.paused == false) {
if (_parent.ball.target != this) {
arrow.gotoAndStop(1);
var arrowPlayed = false;
heldTime = 0;
} else {
if ((_parent.passesNum == 1) || (_root.game.downs == 0)) {
if (team == 1) {
if ((((xspeed < 0) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) and (_root.game.messageList.length == 0)) {
if ((_root.game.tdMode == false) || ((_root.game.tdMode != false) and (_parent.passesNum > 0))) {
progressTimer = progressTimer + 1;
if ((forwardProgress == 0) || (forwardProgress < (_x + fixedLineX))) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
forwardProgress = _x + fixedLineX;
}
if (progressTimer > 50) {
turnedPause();
progressTimer = 0;
}
} else {
progressTimer = 0;
}
}
} else if ((((xspeed > 0) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) and (_root.game.messageList.length == 0)) {
if ((_root.game.tdMode == false) || ((_root.game.tdMode != false) and (_parent.passesNum > 0))) {
progressTimer = progressTimer + 1;
if ((forwardProgress == 0) || (forwardProgress > (_x + fixedLineX))) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
forwardProgress = _x + fixedLineX;
}
if (progressTimer > 50) {
turnedPause();
progressTimer = 0;
}
} else {
progressTimer = 0;
}
}
}
if ((((team == 1) and (_root.game.gameMode == "plays")) and (team != _root.game.playersTeam)) || (((team == 1) and (_root.game.gameMode == "plays")) and (_root.game.demoMode == true))) {
heldTime = heldTime + 1;
var playerAmount = 12;
i = 1;
while (i < playerAmount) {
var target = _root.game["player" + i];
var randFactor = random(3);
if (((((((((target._x > (_x + 40)) and (_parent.passesNum == 0)) and (heldTime > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed > (1.5 * _root.game.vibrationVal))) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || ((((_parent.nzone.hitTest(target.xpos, target.ypos, true) and (target._x > _x)) and (_parent.passesNum == 0)) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing"))) || ((((((((target._x > (_x + 40)) and (_parent.passesNum == 0)) and (heldTime > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed > 1.5)) and (_root.game.downs > 0)) and (_root.game.playType == "passing")) and (_root.game.demoMode == true))) {
_parent.passesNum = _parent.passesNum + 1;
_parent.ball.target = "";
_parent.ball.targetX = _root.game["player" + i]._x + (_root.game["player" + i].xspeed * (8 + random(15)));
_parent.ball.targetY = (_root.game["player" + i]._y - 10) + (_root.game["player" + i].yspeed * (8 + random(15)));
var dx = (_parent.ball.targetX - _parent.ball._x);
var dy = (_parent.ball.targetY - _parent.ball._y);
var dist = Math.sqrt((dx * dx) + (dy * dy));
_parent.ball.xspeed = dx / (dist / 10);
_parent.ball.yspeed = dy / (dist / 10);
_parent.ball.zspeed = -(dist / 20);
_parent.ball.zpos = 4;
}
i = i + 1;
}
} else {
heldTime = 0;
}
if ((((team == 2) and (_root.game.gameMode == "plays")) and (team != _root.game.playersTeam)) || (((team == 2) and (_root.game.gameMode == "plays")) and (_root.game.demoMode == true))) {
heldTime2 = heldTime2 + 1;
var playerAmount = 23;
i = 12;
while (i < playerAmount) {
var target = _root.game["player" + i];
var randFactor = random(3);
if ((((((((target._x < (_x - 40)) and (_parent.passesNum == 0)) and (heldTime2 > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed < (-1.5 * _root.game.vibrationVal))) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || ((((_parent.nzone.hitTest(target.xpos, target.ypos, true) and (target._x < _x)) and (_parent.passesNum == 0)) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing"))) {
_parent.passesNum = _parent.passesNum + 1;
_parent.ball.target = "";
_parent.ball.targetX = _root.game["player" + i]._x + (_root.game["player" + i].xspeed * (8 + random(15)));
_parent.ball.targetY = (_root.game["player" + i]._y - 10) + (_root.game["player" + i].yspeed * (8 + random(15)));
var dx = (_parent.ball.targetX - _parent.ball._x);
var dy = (_parent.ball.targetY - _parent.ball._y);
var dist = Math.sqrt((dx * dx) + (dy * dy));
_parent.ball.xspeed = dx / (dist / 10);
_parent.ball.yspeed = dy / (dist / 10);
_parent.ball.zspeed = -(dist / 20);
_parent.ball.zpos = 4;
}
i = i + 1;
}
} else {
heldTime2 = 0;
}
if (arrowPlayed == false) {
arrow.play();
var arrowPlayed = true;
}
}
if ((_root.game.gameMode == "plays") and (_parent.ball.target == "")) {
if ((((((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player22")) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player11"))) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player4"))) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player16"))) {
} else {
var catchRad = (rad * 2.5);
var zcatch = 4;
}
if (_root.game.ball.target == "") {
if ((_root.game.ball._x < (_x + 50)) and (_root.game.ball._x > (_x - 50))) {
if ((((_root.game.lastGameMode == "kickOff") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player22")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "kickOff") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player11")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "punt") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player15")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "punt") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player4")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "puntSafety") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player15")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "puntSafety") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player4")) {
_root.game.ball.target = this;
}
}
if ((_root.game.ball._x < (_x + 20)) and (_root.game.ball._x > (_x - 20))) {
var dx = (_parent.ball._x - _x);
var dy = (_parent.ball._y - (_y - 10));
var dist = Math.sqrt((dx * dx) + (dy * dy));
if (((dist < catchRad) and (_parent.ball.zpos < zcatch)) and (_root.game.ball.bounce < 1)) {
if ((_parent.ball.storedOwner.team != team) and (_parent.ball.storedOwner.team > 0)) {
if (_root.game.tdMode != false) {
tacklePause();
} else {
_parent.scoreboard.bigscreen.ani.gotoAndPlay("intercept");
_root.game.downs = 0;
intercepted = true;
_root.game.intercepted = true;
}
}
_parent.ball.target = this;
arrow.play();
}
var dx = ((_parent.ball._x + _root.game.ball.xspeed) - _x);
var dy = ((_parent.ball._y + _root.game.ball.yspeed) - (_y - 10));
var dist = Math.sqrt((dx * dx) + (dy * dy));
if (((dist < catchRad) and (_parent.ball.zpos < zcatch)) and (_root.game.ball.bounce < 1)) {
if ((_parent.ball.storedOwner.team != team) and (_parent.ball.storedOwner.team > 0)) {
if (_root.game.tdMode != false) {
tacklePause();
} else {
_parent.scoreboard.bigscreen.ani.gotoAndPlay("intercept");
_root.game.downs = 0;
intercepted = true;
_root.game.intercepted = true;
}
}
_parent.ball.target = this;
arrow.play();
}
}
}
}
xpos = _x + _root.game._x;
ypos = _y + _root.game._y;
speed = 0.12 * _root.game.vibrationVal;
currentY = _y - _root.game.pitchBackY;
posY = currentY / _root.game.pitchFrontY;
percent = _root.game.pitchDepth / _root.game.horizon;
depthScale = (1 - percent) + (posY * percent);
if (intercepted == true) {
speedDone = false;
intercepted = false;
}
if ((_root.game.vibrate == true) and (_root.game.paused == false)) {
rotTimer = 1 + random(20 * _root.game.vibrationVal);
if (rotTimer == 1) {
rotInc = (-30 + random(60)) / 140;
}
rotVel = rotVel + rotInc;
if (((_root.game.gameMode == "plays") and (speedDone == false)) || (_root.game.mouseIsDown == true)) {
if (_root.game.lastGameMode != "kickOff") {
speedDone = true;
if (_root.game.ball.target != this) {
if (((_root.game.playType == "running") and (team == _root.game.playersTeam)) || ((_root.game.compPlayType == "running") and (team == _root.game.compTeam))) {
if ((((((((((_name == "player22") || (_name == "player18")) || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) || (_name == "player11")) || (_name == "player7")) || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
var xspeedEq = (speed * 1.5);
var yspeedEq = (speed * 1.5);
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else if (((_root.game.playType == "defense") and (team == _root.game.playersTeam)) || ((_root.game.compPlayType == "defense") and (team == _root.game.compTeam))) {
if ((_root.downs >= 1) and (_root.game.blitz == false)) {
if ((((_name == "player8") || (_name == "player9")) || (_name == "player19")) || (_name == "player20")) {
var xspeedEq = (-(speed / 3));
var yspeedEq = (-(speed / 3));
} else if ((((_name == "player10") || (_name == "player11")) || (_name == "player21")) || (_name == "player22")) {
var xspeedEq = (-(speed / 5));
var yspeedEq = (-(speed / 5));
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else if (((((_root.game.passesNum == 0) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || (((_root.game.passesNum == 0) and (_root.game.downs > 0)) and (_root.game.playType == "passing"))) || (((_root.game.passesNum == 0) and (_root.game.tdMode != false)) and (_root.game.playType == "passing"))) {
var xspeedEq = (-(speed / 6));
var yspeedEq = (-(speed / 6));
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
}
}
if ((_root.game.gameMode != "plays") || (_root.game.paused == true)) {
speedDone = false;
}
if (((_root.game.gameMode == "plays") || (_root.game.gameMode == "celebration")) || (_root.game.gameMode == "shot")) {
xspeed = xspeed + (Math.cos((rot - 180) * (Math.PI/180)) * xspeedEq);
yspeed = yspeed + (Math.sin((rot - 180) * (Math.PI/180)) * yspeedEq);
}
if (collisionTimer < 1) {
collisionTimer = collisionTimer + 1;
} else {
collisionTimer = 0;
}
if (((_root.game.vibrate == true) and (_root.game.paused == false)) || (_root.game.mouseIsDown == true)) {
if ((collisionTimer == 0) and (team == 1)) {
i = 0;
while (i < (_root.game.playerNum + 1)) {
var target = _root.game["player" + i];
if (_name != ("player" + i)) {
checkCollision(this, target);
}
i = i + 1;
}
checkWalls();
}
if ((collisionTimer == 1) and (team == 2)) {
i = 12;
while (i < (_root.game.playerNum + 1)) {
var target = _root.game["player" + i];
if (_name != ("player" + i)) {
checkCollision(this, target);
}
i = i + 1;
}
checkWalls();
}
}
if (_root.game.gameMode == "puntSafety") {
checkWalls();
}
xspeed = xspeed * 0.97;
yspeed = yspeed * 0.97;
rotVel = rotVel * 0.97;
this.swapDepths(_y + (_x / 5));
if ((_name == "player22") and (_root.game.playType == "running")) {
} else {
var aniFrames = ani._totalframes;
rotStored = rotStored + rotVel;
if (rotStored > (360 / aniFrames)) {
if (ani._currentframe < aniFrames) {
ani.nextFrame();
} else {
ani.gotoAndStop(1);
}
rotStored = rotStored - (360 / aniFrames);
}
if (rotStored < (-(360 / aniFrames))) {
if (ani._currentframe > 1) {
ani.prevFrame();
} else {
ani.gotoAndStop(aniFrames);
}
rotStored = rotStored + (360 / aniFrames);
}
rot = rot + rotVel;
_xscale = (depthScale * 110);
_yscale = _xscale;
}
if (((_root.game.gameMode == "plays") || (_root.game.gameMode == "celebration")) || (_root.game.gameMode == "shot")) {
_x = (_x + (xspeed * depthScale));
_y = (_y + (yspeed * depthScale));
}
}
}
Instance of Symbol 198 MovieClip "player2" in Symbol 494 MovieClip Frame 2
onClipEvent (load) {
hitSound = new Sound(this);
hitSound.attachSound("hitSound");
xspeed = 0;
yspeed = 0;
speed = 0.1 * _root.game.vibrationVal;
currentY = _y - _root.game.pitchBackY;
posY = currentY / _root.game.pitchFrontY;
percent = _root.game.pitchDepth / _root.game.horizon;
depthScale = (1 - percent) + (posY * percent);
rotVel = 0;
rotInc = 0;
rotTimer = random(20);
_rotation = 0;
xpos = _x + _root.game._x;
ypos = _y + _root.game._y;
_root.game.playerNum = _root.game.playerNum + 1;
mass = 2;
rad = hitArea._width / 2.3;
team = 0;
if (parseInt(substring(_name, 7, 2)) < 12) {
team = 1;
rot = 180;
origRot = rot;
if ((_name == "player22") || (_name == "player11")) {
gotoAndStop (4);
} else {
gotoAndStop (2);
}
ani.gotoAndStop(10);
} else {
team = 2;
rot = 0;
origRot = rot;
if ((_name == "player22") || (_name == "player11")) {
gotoAndStop (3);
} else {
gotoAndStop (1);
}
ani.gotoAndStop(1);
}
if (team == 2) {
trace(((("new Array(" + Math.round(_x)) + ",") + Math.round(_y)) + "),");
}
rotStored = 0;
heldTime = 0;
heldTime2 = 0;
tackled = false;
forwardProgress = 0;
progressTimer = 0;
type = "";
fixedLineX = 0;
speedDone = false;
var xspeedEq = speed;
var yspeedEq = speed;
storedVar = "";
collisionTimer = 0;
intercepted = false;
}
onClipEvent (enterFrame) {
function checkOutOfBounds() {
if (_root.game.ball.target == this) {
boundsPause();
if ((ani._currentframe < 6) || (ani._currentframe > 14)) {
if (team == 1) {
}
} else if ((ani._currentframe > 6) and (ani._currentframe < 14)) {
if (team == 2) {
}
}
}
}
function checkScrimmage() {
if (team == 1) {
if (_root.game.scrimmage < _root.game.endZoneL) {
_root.game.scrimmage = _root.game.twentyYardLineL;
_root.game.touchBack = true;
} else {
_root.game.touchBack = false;
}
if (_root.game.scrimmage > _root.game.endZoneR) {
_root.game.scrimmage = _root.game.endZoneR;
}
} else {
if (_root.game.scrimmage < _root.game.endZoneL) {
_root.game.scrimmage = _root.game.endZoneL;
}
if (_root.game.scrimmage > _root.game.endZoneR) {
_root.game.scrimmage = _root.game.twentyYardLineR;
_root.game.touchBack = true;
} else {
_root.game.touchBack = false;
}
}
}
function tacklePause() {
type = "tackle";
if ((_root.game.timeOut == true) and (_root.game.tdMode == false)) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
_root.game.scrimmage = _x + fixedLineX;
checkScrimmage();
}
if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "tackle";
_root.game.safed = true;
} else if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "tackle";
_root.game.safed = true;
} else {
type = "tackle";
}
if ((_root.game.paused == false) and (_root.game.gameMode != "celebration")) {
_root.game.sound.gotoAndPlay("whistle");
}
if (((((_root.game.gameMode == "plays") and (_root.game.paused == false)) || ((_root.game.gameMode == "kickOff") and (_root.game.paused == false))) || ((_root.game.gameMode == "punt") and (_root.game.paused == false))) || (((_root.game.tdMode != false) and (_root.game.paused == false)) and (_root.game.gameMode == "plays"))) {
tackled = true;
type = "tackle";
if ((_root.game.passesNum == 0) and (_root.game.gameMode != "celebration")) {
if (_parent.ball.target.team == 1) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
if (((_x + fixedLineX) < _root.game.scrimmage) and (_root.game.downs > 0)) {
_parent.addMessage("sack");
} else {
_parent.addMessage("tackled");
}
}
if (_parent.ball.target.team == 2) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
if (((_x + fixedLineX) > _root.game.scrimmage) and (_root.game.downs > 0)) {
_parent.addMessage("sack");
} else {
_parent.addMessage("tackled");
}
}
} else if (_root.game.gameMode != "celebration") {
_parent.addMessage("tackled");
}
_root.game.pauseTime = 55;
}
}
function boundsPause() {
if (_root.game.timeOut == true) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
_root.game.scrimmage = _x + fixedLineX;
checkScrimmage();
}
if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "bounds";
_root.game.safed = true;
} else if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "bounds";
_root.game.safed = true;
} else {
type = "bounds";
}
type = "bounds";
_root.game.sound.gotoAndPlay("whistle");
tackled = true;
_parent.addMessage("outOfBounds");
_root.game.pauseTime = 55;
}
function turnedPause() {
if (_root.game.timeOut == true) {
_root.game.scrimmage = forwardProgress;
checkScrimmage();
}
type = "turn";
_root.game.sound.gotoAndPlay("whistle");
tackled = true;
_parent.addMessage("turnedAround");
_parent.addMessage("negativeProgress");
_root.game.pauseTime = 55;
}
function tackle() {
if ((_root.game.gameMode != "puntSafety") and (gameMode != "scrum")) {
if (_root.game.tdMode != false) {
if ((_root.game.timeOut == false) and (_root.game.gameMode != "celebration")) {
_root.game.startKickoff(_root.game.playersTeam);
_root.game.removeTackles();
tacked = false;
_root.game.tdMode = false;
} else if (_root.game.gameMode != "celebration") {
_root.game.removeTackles();
tacked = false;
_root.game.tdMode = false;
_root.game.gameMode = "convFail";
trace(_root.game.gameMode);
} else {
_root.game.removeTackles();
tacked = false;
}
} else if ((_root.game.downs <= 3.5) || (_root.game.goForIt == true)) {
if ((((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (type != "turn")) and (_root.game.downs > 0.5)) and (_root.game.ball.target == this)) and (_root.game.gameMode != "celebration")) {
_root.game.addMessage("Safety");
if (team != _root.game.playersTeam) {
_root.game.setupSafetyKick(_root.game.compTeam);
_root.game.hscore = _root.game.hscore + 2;
} else {
_root.game.setupSafetyKick(_root.game.playersTeam);
_root.game.gscore = _root.game.gscore + 2;
}
tackled = false;
} else if ((((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (type != "turn")) and (_root.game.downs > 0.5)) and (_root.game.ball.target == this)) and (_root.game.gameMode != "celebration")) {
_root.game.addMessage("Safety");
if (team != _root.game.playersTeam) {
_root.game.setupSafetyKick(_root.game.compTeam);
_root.game.hscore = _root.game.hscore + 2;
} else {
_root.game.setupSafetyKick(_root.game.playersTeam);
_root.game.gscore = _root.game.gscore + 2;
}
tackled = false;
} else {
_root.game.changeMode = false;
tackled = false;
if (type == "turn") {
var _local4 = forwardProgress;
} else {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
var _local4 = _x + fixedLineX;
}
_root.game.scrimmage = _local4;
if (_parent.ball.target.team != _root.game.playersTeam) {
var _local5 = random(2);
if (_local5 == 1) {
_root.game.compPlayType = "passing";
_root.game.setupLine(_root.game.compTeam, _root.game.formationShotgun, _local4, 0.5);
} else {
_root.game.compPlayType = "running";
_root.game.setupLine(_root.game.compTeam, _root.game.formationI, _local4, 0.5);
}
_root.game.setupLine(_root.game.playersTeam, _root.game.formation43, _local4, 0.5);
} else {
var _local5 = 1 + random(5);
_root.game.compPlayType = "defense";
_root.game.setupLine(_root.game.compTeam, _root.game["formationDefence" + _local5], _local4, 0.5);
_root.game.setupLine(_root.game.playersTeam, _root.game.formationShotgun, _local4, 0.5);
}
}
} else if ((_root.game.goForIt == true) and (_root.game.gameMode == "plays")) {
if (_root.game.changeMode == false) {
_root.game.downs = _root.game.downs + 1;
}
_root.game.pauseTime = 0;
_root.game.paused = false;
tackled = false;
} else if (_root.game.gameMode == "plays") {
_root.game.pauseTime = 0;
_root.game.paused = false;
if (_root.game.changeMode == false) {
_root.game.downs = _root.game.downs + 1;
}
tackled = false;
}
}
}
function checkWalls() {
if ((_y + 10) > _root.game.pitchFrontY) {
if (((yspeed > 1) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) {
checkOutOfBounds();
}
_y = (_y - 1);
yspeed = (-yspeed) * 0.5;
}
if ((_y - 5) < _root.game.pitchBackY) {
if (((yspeed < 1) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) {
checkOutOfBounds();
}
_y = (_y + 1);
yspeed = (-yspeed) * 0.5;
}
if (_root.game.walls.hitTest(xpos + (hitArea._width / 2), ypos, true) and (_x > 300)) {
_x = (_x - 2);
xspeed = (-xspeed) * 0.5;
}
if (_root.game.walls.hitTest(xpos - (hitArea._width / 2), ypos, true) and (_x < 300)) {
_x = (_x + 2);
xspeed = (-xspeed) * 0.5;
}
}
function checkCollision(b1, b2) {
var _local12 = b2._x - b1._x;
var _local11 = b2._y - b1._y;
var _local19 = Math.sqrt((_local12 * _local12) + (_local11 * _local11));
if (_local19 < (b1.rad + b2.rad)) {
if (((_parent.ball.target == this) and (b2.team != this.team)) || ((_parent.ball.target == b2) and (this.team != b2.team))) {
tacklePause();
}
if (_root.game.gameMode == "plays") {
var _local8 = 0;
if (xspeed < 0) {
_local8 = _local8 + (-xspeed);
} else {
_local8 = _local8 + xspeed;
}
if (yspeed < 0) {
_local8 = _local8 + (-yspeed);
} else {
_local8 = _local8 + yspeed;
}
if (_local8 > 1) {
hitSound.setVolume(_local8 * 15);
hitSound.start(0, 0);
hitSound.setVolume(_local8 * 15);
}
}
var _local18 = Math.atan2(_local11, _local12);
var _local7 = Math.cos(_local18);
var _local6 = Math.sin(_local18);
var _local9 = (_local7 * b1.xspeed) + (_local6 * b1.yspeed);
var _local15 = (_local7 * b1.yspeed) - (_local6 * b1.xspeed);
var _local10 = (_local7 * b2.xspeed) + (_local6 * b2.yspeed);
var _local14 = (_local7 * b2.yspeed) - (_local6 * b2.xspeed);
var _local21 = (_local9 * b1.mass) + (_local10 * b2.mass);
var _local20 = _local9 - _local10;
_local9 = (_local21 - (b2.mass * _local20)) / (b1.mass + b2.mass);
_local10 = _local20 + _local9;
b1.xspeed = ((_local7 * _local9) - (_local6 * _local15)) * 0.7;
b1.yspeed = ((_local7 * _local15) + (_local6 * _local9)) * 0.7;
b2.xspeed = ((_local7 * _local10) - (_local6 * _local14)) * 0.7;
b2.yspeed = ((_local7 * _local14) + (_local6 * _local10)) * 0.7;
var _local16 = ((b1.rad + b2.rad) - _local19) / 2;
var _local17 = _local7 * _local16;
var _local13 = _local6 * _local16;
b1._x = b1._x - (_local17 * 1.1);
b1._y = b1._y - (_local13 * 1.1);
b2._x = b2._x + (_local17 * 1.1);
b2._y = b2._y + (_local13 * 1.1);
}
}
if (_root.game.gameMode == "kickOff") {
var xspeedEq = speed;
var yspeedEq = speed;
}
if (_root.game.cleanUp == true) {
this.removeMovieClip();
}
if ((_root.game.gameMode == "scrum") || (_root.game.gameMode == "kickOff")) {
forwardProgress = 0;
progressTimer = 0;
}
if (team == _root.game.playersTeam) {
if (_root.game.playType == "running") {
if (_root.game.playersTeam == 1) {
if ((((_name == "player7") || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else if ((((_name == "player18") || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else {
mass = 2;
}
}
if (team == _root.game.compTeam) {
if (_root.game.compPlayType == "running") {
if (_root.game.compTeam == 1) {
if ((((_name == "player7") || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else if ((((_name == "player18") || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else {
mass = 2;
}
}
if ((((((_name == "player22") and (parseInt(_root.game.ball.storedOwner.team) == 2)) and (_root.game.gameMode != "plays")) and (_root.game.gameMode != "celebration")) and (_root.game.paused == false)) || (((((_name == "player11") and (parseInt(_root.game.ball.storedOwner.team) == 1)) and (_root.game.gameMode != "plays")) and (_root.game.gameMode != "celebration")) and (_root.game.paused == false))) {
if (_currentframe == 1) {
gotoAndStop (3);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(10);
}
} else if (_currentframe == 2) {
gotoAndStop (4);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(10);
}
}
} else if (((((_name == "player22") and (_root.game.gameMode != "plays")) and (_root.game.paused == false)) and (_root.game.gameMode != "celebration")) and (_root.game.gameMode != "shot")) {
gotoAndStop(_root.game.player21._currentframe);
} else if (((((_name == "player11") and (_root.game.gameMode != "plays")) and (_root.game.paused == false)) and (_root.game.gameMode != "celebration")) and (_root.game.gameMode != "shot")) {
gotoAndStop(_root.game.player10._currentframe);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(_root.game.player10.ani._currentframe);
}
}
if ((tackled == true) and (_root.game.paused == false)) {
tackle();
}
if (_root.game.paused == false) {
if (_parent.ball.target != this) {
arrow.gotoAndStop(1);
var arrowPlayed = false;
heldTime = 0;
} else {
if ((_parent.passesNum == 1) || (_root.game.downs == 0)) {
if (team == 1) {
if ((((xspeed < 0) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) and (_root.game.messageList.length == 0)) {
if ((_root.game.tdMode == false) || ((_root.game.tdMode != false) and (_parent.passesNum > 0))) {
progressTimer = progressTimer + 1;
if ((forwardProgress == 0) || (forwardProgress < (_x + fixedLineX))) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
forwardProgress = _x + fixedLineX;
}
if (progressTimer > 50) {
turnedPause();
progressTimer = 0;
}
} else {
progressTimer = 0;
}
}
} else if ((((xspeed > 0) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) and (_root.game.messageList.length == 0)) {
if ((_root.game.tdMode == false) || ((_root.game.tdMode != false) and (_parent.passesNum > 0))) {
progressTimer = progressTimer + 1;
if ((forwardProgress == 0) || (forwardProgress > (_x + fixedLineX))) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
forwardProgress = _x + fixedLineX;
}
if (progressTimer > 50) {
turnedPause();
progressTimer = 0;
}
} else {
progressTimer = 0;
}
}
}
if ((((team == 1) and (_root.game.gameMode == "plays")) and (team != _root.game.playersTeam)) || (((team == 1) and (_root.game.gameMode == "plays")) and (_root.game.demoMode == true))) {
heldTime = heldTime + 1;
var playerAmount = 12;
i = 1;
while (i < playerAmount) {
var target = _root.game["player" + i];
var randFactor = random(3);
if (((((((((target._x > (_x + 40)) and (_parent.passesNum == 0)) and (heldTime > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed > (1.5 * _root.game.vibrationVal))) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || ((((_parent.nzone.hitTest(target.xpos, target.ypos, true) and (target._x > _x)) and (_parent.passesNum == 0)) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing"))) || ((((((((target._x > (_x + 40)) and (_parent.passesNum == 0)) and (heldTime > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed > 1.5)) and (_root.game.downs > 0)) and (_root.game.playType == "passing")) and (_root.game.demoMode == true))) {
_parent.passesNum = _parent.passesNum + 1;
_parent.ball.target = "";
_parent.ball.targetX = _root.game["player" + i]._x + (_root.game["player" + i].xspeed * (8 + random(15)));
_parent.ball.targetY = (_root.game["player" + i]._y - 10) + (_root.game["player" + i].yspeed * (8 + random(15)));
var dx = (_parent.ball.targetX - _parent.ball._x);
var dy = (_parent.ball.targetY - _parent.ball._y);
var dist = Math.sqrt((dx * dx) + (dy * dy));
_parent.ball.xspeed = dx / (dist / 10);
_parent.ball.yspeed = dy / (dist / 10);
_parent.ball.zspeed = -(dist / 20);
_parent.ball.zpos = 4;
}
i = i + 1;
}
} else {
heldTime = 0;
}
if ((((team == 2) and (_root.game.gameMode == "plays")) and (team != _root.game.playersTeam)) || (((team == 2) and (_root.game.gameMode == "plays")) and (_root.game.demoMode == true))) {
heldTime2 = heldTime2 + 1;
var playerAmount = 23;
i = 12;
while (i < playerAmount) {
var target = _root.game["player" + i];
var randFactor = random(3);
if ((((((((target._x < (_x - 40)) and (_parent.passesNum == 0)) and (heldTime2 > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed < (-1.5 * _root.game.vibrationVal))) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || ((((_parent.nzone.hitTest(target.xpos, target.ypos, true) and (target._x < _x)) and (_parent.passesNum == 0)) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing"))) {
_parent.passesNum = _parent.passesNum + 1;
_parent.ball.target = "";
_parent.ball.targetX = _root.game["player" + i]._x + (_root.game["player" + i].xspeed * (8 + random(15)));
_parent.ball.targetY = (_root.game["player" + i]._y - 10) + (_root.game["player" + i].yspeed * (8 + random(15)));
var dx = (_parent.ball.targetX - _parent.ball._x);
var dy = (_parent.ball.targetY - _parent.ball._y);
var dist = Math.sqrt((dx * dx) + (dy * dy));
_parent.ball.xspeed = dx / (dist / 10);
_parent.ball.yspeed = dy / (dist / 10);
_parent.ball.zspeed = -(dist / 20);
_parent.ball.zpos = 4;
}
i = i + 1;
}
} else {
heldTime2 = 0;
}
if (arrowPlayed == false) {
arrow.play();
var arrowPlayed = true;
}
}
if ((_root.game.gameMode == "plays") and (_parent.ball.target == "")) {
if ((((((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player22")) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player11"))) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player4"))) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player16"))) {
} else {
var catchRad = (rad * 2.5);
var zcatch = 4;
}
if (_root.game.ball.target == "") {
if ((_root.game.ball._x < (_x + 50)) and (_root.game.ball._x > (_x - 50))) {
if ((((_root.game.lastGameMode == "kickOff") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player22")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "kickOff") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player11")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "punt") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player15")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "punt") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player4")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "puntSafety") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player15")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "puntSafety") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player4")) {
_root.game.ball.target = this;
}
}
if ((_root.game.ball._x < (_x + 20)) and (_root.game.ball._x > (_x - 20))) {
var dx = (_parent.ball._x - _x);
var dy = (_parent.ball._y - (_y - 10));
var dist = Math.sqrt((dx * dx) + (dy * dy));
if (((dist < catchRad) and (_parent.ball.zpos < zcatch)) and (_root.game.ball.bounce < 1)) {
if ((_parent.ball.storedOwner.team != team) and (_parent.ball.storedOwner.team > 0)) {
if (_root.game.tdMode != false) {
tacklePause();
} else {
_parent.scoreboard.bigscreen.ani.gotoAndPlay("intercept");
_root.game.downs = 0;
intercepted = true;
_root.game.intercepted = true;
}
}
_parent.ball.target = this;
arrow.play();
}
var dx = ((_parent.ball._x + _root.game.ball.xspeed) - _x);
var dy = ((_parent.ball._y + _root.game.ball.yspeed) - (_y - 10));
var dist = Math.sqrt((dx * dx) + (dy * dy));
if (((dist < catchRad) and (_parent.ball.zpos < zcatch)) and (_root.game.ball.bounce < 1)) {
if ((_parent.ball.storedOwner.team != team) and (_parent.ball.storedOwner.team > 0)) {
if (_root.game.tdMode != false) {
tacklePause();
} else {
_parent.scoreboard.bigscreen.ani.gotoAndPlay("intercept");
_root.game.downs = 0;
intercepted = true;
_root.game.intercepted = true;
}
}
_parent.ball.target = this;
arrow.play();
}
}
}
}
xpos = _x + _root.game._x;
ypos = _y + _root.game._y;
speed = 0.12 * _root.game.vibrationVal;
currentY = _y - _root.game.pitchBackY;
posY = currentY / _root.game.pitchFrontY;
percent = _root.game.pitchDepth / _root.game.horizon;
depthScale = (1 - percent) + (posY * percent);
if (intercepted == true) {
speedDone = false;
intercepted = false;
}
if ((_root.game.vibrate == true) and (_root.game.paused == false)) {
rotTimer = 1 + random(20 * _root.game.vibrationVal);
if (rotTimer == 1) {
rotInc = (-30 + random(60)) / 140;
}
rotVel = rotVel + rotInc;
if (((_root.game.gameMode == "plays") and (speedDone == false)) || (_root.game.mouseIsDown == true)) {
if (_root.game.lastGameMode != "kickOff") {
speedDone = true;
if (_root.game.ball.target != this) {
if (((_root.game.playType == "running") and (team == _root.game.playersTeam)) || ((_root.game.compPlayType == "running") and (team == _root.game.compTeam))) {
if ((((((((((_name == "player22") || (_name == "player18")) || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) || (_name == "player11")) || (_name == "player7")) || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
var xspeedEq = (speed * 1.5);
var yspeedEq = (speed * 1.5);
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else if (((_root.game.playType == "defense") and (team == _root.game.playersTeam)) || ((_root.game.compPlayType == "defense") and (team == _root.game.compTeam))) {
if ((_root.downs >= 1) and (_root.game.blitz == false)) {
if ((((_name == "player8") || (_name == "player9")) || (_name == "player19")) || (_name == "player20")) {
var xspeedEq = (-(speed / 3));
var yspeedEq = (-(speed / 3));
} else if ((((_name == "player10") || (_name == "player11")) || (_name == "player21")) || (_name == "player22")) {
var xspeedEq = (-(speed / 5));
var yspeedEq = (-(speed / 5));
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else if (((((_root.game.passesNum == 0) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || (((_root.game.passesNum == 0) and (_root.game.downs > 0)) and (_root.game.playType == "passing"))) || (((_root.game.passesNum == 0) and (_root.game.tdMode != false)) and (_root.game.playType == "passing"))) {
var xspeedEq = (-(speed / 6));
var yspeedEq = (-(speed / 6));
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
}
}
if ((_root.game.gameMode != "plays") || (_root.game.paused == true)) {
speedDone = false;
}
if (((_root.game.gameMode == "plays") || (_root.game.gameMode == "celebration")) || (_root.game.gameMode == "shot")) {
xspeed = xspeed + (Math.cos((rot - 180) * (Math.PI/180)) * xspeedEq);
yspeed = yspeed + (Math.sin((rot - 180) * (Math.PI/180)) * yspeedEq);
}
if (collisionTimer < 1) {
collisionTimer = collisionTimer + 1;
} else {
collisionTimer = 0;
}
if (((_root.game.vibrate == true) and (_root.game.paused == false)) || (_root.game.mouseIsDown == true)) {
if ((collisionTimer == 0) and (team == 1)) {
i = 0;
while (i < (_root.game.playerNum + 1)) {
var target = _root.game["player" + i];
if (_name != ("player" + i)) {
checkCollision(this, target);
}
i = i + 1;
}
checkWalls();
}
if ((collisionTimer == 1) and (team == 2)) {
i = 12;
while (i < (_root.game.playerNum + 1)) {
var target = _root.game["player" + i];
if (_name != ("player" + i)) {
checkCollision(this, target);
}
i = i + 1;
}
checkWalls();
}
}
if (_root.game.gameMode == "puntSafety") {
checkWalls();
}
xspeed = xspeed * 0.97;
yspeed = yspeed * 0.97;
rotVel = rotVel * 0.97;
this.swapDepths(_y + (_x / 5));
if ((_name == "player22") and (_root.game.playType == "running")) {
} else {
var aniFrames = ani._totalframes;
rotStored = rotStored + rotVel;
if (rotStored > (360 / aniFrames)) {
if (ani._currentframe < aniFrames) {
ani.nextFrame();
} else {
ani.gotoAndStop(1);
}
rotStored = rotStored - (360 / aniFrames);
}
if (rotStored < (-(360 / aniFrames))) {
if (ani._currentframe > 1) {
ani.prevFrame();
} else {
ani.gotoAndStop(aniFrames);
}
rotStored = rotStored + (360 / aniFrames);
}
rot = rot + rotVel;
_xscale = (depthScale * 110);
_yscale = _xscale;
}
if (((_root.game.gameMode == "plays") || (_root.game.gameMode == "celebration")) || (_root.game.gameMode == "shot")) {
_x = (_x + (xspeed * depthScale));
_y = (_y + (yspeed * depthScale));
}
}
}
Instance of Symbol 198 MovieClip "player11" in Symbol 494 MovieClip Frame 2
onClipEvent (load) {
hitSound = new Sound(this);
hitSound.attachSound("hitSound");
xspeed = 0;
yspeed = 0;
speed = 0.1 * _root.game.vibrationVal;
currentY = _y - _root.game.pitchBackY;
posY = currentY / _root.game.pitchFrontY;
percent = _root.game.pitchDepth / _root.game.horizon;
depthScale = (1 - percent) + (posY * percent);
rotVel = 0;
rotInc = 0;
rotTimer = random(20);
_rotation = 0;
xpos = _x + _root.game._x;
ypos = _y + _root.game._y;
_root.game.playerNum = _root.game.playerNum + 1;
mass = 2;
rad = hitArea._width / 2.3;
team = 0;
if (parseInt(substring(_name, 7, 2)) < 12) {
team = 1;
rot = 180;
origRot = rot;
if ((_name == "player22") || (_name == "player11")) {
gotoAndStop (4);
} else {
gotoAndStop (2);
}
ani.gotoAndStop(10);
} else {
team = 2;
rot = 0;
origRot = rot;
if ((_name == "player22") || (_name == "player11")) {
gotoAndStop (3);
} else {
gotoAndStop (1);
}
ani.gotoAndStop(1);
}
if (team == 2) {
trace(((("new Array(" + Math.round(_x)) + ",") + Math.round(_y)) + "),");
}
rotStored = 0;
heldTime = 0;
heldTime2 = 0;
tackled = false;
forwardProgress = 0;
progressTimer = 0;
type = "";
fixedLineX = 0;
speedDone = false;
var xspeedEq = speed;
var yspeedEq = speed;
storedVar = "";
collisionTimer = 0;
intercepted = false;
}
onClipEvent (enterFrame) {
function checkOutOfBounds() {
if (_root.game.ball.target == this) {
boundsPause();
if ((ani._currentframe < 6) || (ani._currentframe > 14)) {
if (team == 1) {
}
} else if ((ani._currentframe > 6) and (ani._currentframe < 14)) {
if (team == 2) {
}
}
}
}
function checkScrimmage() {
if (team == 1) {
if (_root.game.scrimmage < _root.game.endZoneL) {
_root.game.scrimmage = _root.game.twentyYardLineL;
_root.game.touchBack = true;
} else {
_root.game.touchBack = false;
}
if (_root.game.scrimmage > _root.game.endZoneR) {
_root.game.scrimmage = _root.game.endZoneR;
}
} else {
if (_root.game.scrimmage < _root.game.endZoneL) {
_root.game.scrimmage = _root.game.endZoneL;
}
if (_root.game.scrimmage > _root.game.endZoneR) {
_root.game.scrimmage = _root.game.twentyYardLineR;
_root.game.touchBack = true;
} else {
_root.game.touchBack = false;
}
}
}
function tacklePause() {
type = "tackle";
if ((_root.game.timeOut == true) and (_root.game.tdMode == false)) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
_root.game.scrimmage = _x + fixedLineX;
checkScrimmage();
}
if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "tackle";
_root.game.safed = true;
} else if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "tackle";
_root.game.safed = true;
} else {
type = "tackle";
}
if ((_root.game.paused == false) and (_root.game.gameMode != "celebration")) {
_root.game.sound.gotoAndPlay("whistle");
}
if (((((_root.game.gameMode == "plays") and (_root.game.paused == false)) || ((_root.game.gameMode == "kickOff") and (_root.game.paused == false))) || ((_root.game.gameMode == "punt") and (_root.game.paused == false))) || (((_root.game.tdMode != false) and (_root.game.paused == false)) and (_root.game.gameMode == "plays"))) {
tackled = true;
type = "tackle";
if ((_root.game.passesNum == 0) and (_root.game.gameMode != "celebration")) {
if (_parent.ball.target.team == 1) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
if (((_x + fixedLineX) < _root.game.scrimmage) and (_root.game.downs > 0)) {
_parent.addMessage("sack");
} else {
_parent.addMessage("tackled");
}
}
if (_parent.ball.target.team == 2) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
if (((_x + fixedLineX) > _root.game.scrimmage) and (_root.game.downs > 0)) {
_parent.addMessage("sack");
} else {
_parent.addMessage("tackled");
}
}
} else if (_root.game.gameMode != "celebration") {
_parent.addMessage("tackled");
}
_root.game.pauseTime = 55;
}
}
function boundsPause() {
if (_root.game.timeOut == true) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
_root.game.scrimmage = _x + fixedLineX;
checkScrimmage();
}
if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "bounds";
_root.game.safed = true;
} else if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "bounds";
_root.game.safed = true;
} else {
type = "bounds";
}
type = "bounds";
_root.game.sound.gotoAndPlay("whistle");
tackled = true;
_parent.addMessage("outOfBounds");
_root.game.pauseTime = 55;
}
function turnedPause() {
if (_root.game.timeOut == true) {
_root.game.scrimmage = forwardProgress;
checkScrimmage();
}
type = "turn";
_root.game.sound.gotoAndPlay("whistle");
tackled = true;
_parent.addMessage("turnedAround");
_parent.addMessage("negativeProgress");
_root.game.pauseTime = 55;
}
function tackle() {
if ((_root.game.gameMode != "puntSafety") and (gameMode != "scrum")) {
if (_root.game.tdMode != false) {
if ((_root.game.timeOut == false) and (_root.game.gameMode != "celebration")) {
_root.game.startKickoff(_root.game.playersTeam);
_root.game.removeTackles();
tacked = false;
_root.game.tdMode = false;
} else if (_root.game.gameMode != "celebration") {
_root.game.removeTackles();
tacked = false;
_root.game.tdMode = false;
_root.game.gameMode = "convFail";
trace(_root.game.gameMode);
} else {
_root.game.removeTackles();
tacked = false;
}
} else if ((_root.game.downs <= 3.5) || (_root.game.goForIt == true)) {
if ((((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (type != "turn")) and (_root.game.downs > 0.5)) and (_root.game.ball.target == this)) and (_root.game.gameMode != "celebration")) {
_root.game.addMessage("Safety");
if (team != _root.game.playersTeam) {
_root.game.setupSafetyKick(_root.game.compTeam);
_root.game.hscore = _root.game.hscore + 2;
} else {
_root.game.setupSafetyKick(_root.game.playersTeam);
_root.game.gscore = _root.game.gscore + 2;
}
tackled = false;
} else if ((((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (type != "turn")) and (_root.game.downs > 0.5)) and (_root.game.ball.target == this)) and (_root.game.gameMode != "celebration")) {
_root.game.addMessage("Safety");
if (team != _root.game.playersTeam) {
_root.game.setupSafetyKick(_root.game.compTeam);
_root.game.hscore = _root.game.hscore + 2;
} else {
_root.game.setupSafetyKick(_root.game.playersTeam);
_root.game.gscore = _root.game.gscore + 2;
}
tackled = false;
} else {
_root.game.changeMode = false;
tackled = false;
if (type == "turn") {
var _local4 = forwardProgress;
} else {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
var _local4 = _x + fixedLineX;
}
_root.game.scrimmage = _local4;
if (_parent.ball.target.team != _root.game.playersTeam) {
var _local5 = random(2);
if (_local5 == 1) {
_root.game.compPlayType = "passing";
_root.game.setupLine(_root.game.compTeam, _root.game.formationShotgun, _local4, 0.5);
} else {
_root.game.compPlayType = "running";
_root.game.setupLine(_root.game.compTeam, _root.game.formationI, _local4, 0.5);
}
_root.game.setupLine(_root.game.playersTeam, _root.game.formation43, _local4, 0.5);
} else {
var _local5 = 1 + random(5);
_root.game.compPlayType = "defense";
_root.game.setupLine(_root.game.compTeam, _root.game["formationDefence" + _local5], _local4, 0.5);
_root.game.setupLine(_root.game.playersTeam, _root.game.formationShotgun, _local4, 0.5);
}
}
} else if ((_root.game.goForIt == true) and (_root.game.gameMode == "plays")) {
if (_root.game.changeMode == false) {
_root.game.downs = _root.game.downs + 1;
}
_root.game.pauseTime = 0;
_root.game.paused = false;
tackled = false;
} else if (_root.game.gameMode == "plays") {
_root.game.pauseTime = 0;
_root.game.paused = false;
if (_root.game.changeMode == false) {
_root.game.downs = _root.game.downs + 1;
}
tackled = false;
}
}
}
function checkWalls() {
if ((_y + 10) > _root.game.pitchFrontY) {
if (((yspeed > 1) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) {
checkOutOfBounds();
}
_y = (_y - 1);
yspeed = (-yspeed) * 0.5;
}
if ((_y - 5) < _root.game.pitchBackY) {
if (((yspeed < 1) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) {
checkOutOfBounds();
}
_y = (_y + 1);
yspeed = (-yspeed) * 0.5;
}
if (_root.game.walls.hitTest(xpos + (hitArea._width / 2), ypos, true) and (_x > 300)) {
_x = (_x - 2);
xspeed = (-xspeed) * 0.5;
}
if (_root.game.walls.hitTest(xpos - (hitArea._width / 2), ypos, true) and (_x < 300)) {
_x = (_x + 2);
xspeed = (-xspeed) * 0.5;
}
}
function checkCollision(b1, b2) {
var _local12 = b2._x - b1._x;
var _local11 = b2._y - b1._y;
var _local19 = Math.sqrt((_local12 * _local12) + (_local11 * _local11));
if (_local19 < (b1.rad + b2.rad)) {
if (((_parent.ball.target == this) and (b2.team != this.team)) || ((_parent.ball.target == b2) and (this.team != b2.team))) {
tacklePause();
}
if (_root.game.gameMode == "plays") {
var _local8 = 0;
if (xspeed < 0) {
_local8 = _local8 + (-xspeed);
} else {
_local8 = _local8 + xspeed;
}
if (yspeed < 0) {
_local8 = _local8 + (-yspeed);
} else {
_local8 = _local8 + yspeed;
}
if (_local8 > 1) {
hitSound.setVolume(_local8 * 15);
hitSound.start(0, 0);
hitSound.setVolume(_local8 * 15);
}
}
var _local18 = Math.atan2(_local11, _local12);
var _local7 = Math.cos(_local18);
var _local6 = Math.sin(_local18);
var _local9 = (_local7 * b1.xspeed) + (_local6 * b1.yspeed);
var _local15 = (_local7 * b1.yspeed) - (_local6 * b1.xspeed);
var _local10 = (_local7 * b2.xspeed) + (_local6 * b2.yspeed);
var _local14 = (_local7 * b2.yspeed) - (_local6 * b2.xspeed);
var _local21 = (_local9 * b1.mass) + (_local10 * b2.mass);
var _local20 = _local9 - _local10;
_local9 = (_local21 - (b2.mass * _local20)) / (b1.mass + b2.mass);
_local10 = _local20 + _local9;
b1.xspeed = ((_local7 * _local9) - (_local6 * _local15)) * 0.7;
b1.yspeed = ((_local7 * _local15) + (_local6 * _local9)) * 0.7;
b2.xspeed = ((_local7 * _local10) - (_local6 * _local14)) * 0.7;
b2.yspeed = ((_local7 * _local14) + (_local6 * _local10)) * 0.7;
var _local16 = ((b1.rad + b2.rad) - _local19) / 2;
var _local17 = _local7 * _local16;
var _local13 = _local6 * _local16;
b1._x = b1._x - (_local17 * 1.1);
b1._y = b1._y - (_local13 * 1.1);
b2._x = b2._x + (_local17 * 1.1);
b2._y = b2._y + (_local13 * 1.1);
}
}
if (_root.game.gameMode == "kickOff") {
var xspeedEq = speed;
var yspeedEq = speed;
}
if (_root.game.cleanUp == true) {
this.removeMovieClip();
}
if ((_root.game.gameMode == "scrum") || (_root.game.gameMode == "kickOff")) {
forwardProgress = 0;
progressTimer = 0;
}
if (team == _root.game.playersTeam) {
if (_root.game.playType == "running") {
if (_root.game.playersTeam == 1) {
if ((((_name == "player7") || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else if ((((_name == "player18") || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else {
mass = 2;
}
}
if (team == _root.game.compTeam) {
if (_root.game.compPlayType == "running") {
if (_root.game.compTeam == 1) {
if ((((_name == "player7") || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else if ((((_name == "player18") || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else {
mass = 2;
}
}
if ((((((_name == "player22") and (parseInt(_root.game.ball.storedOwner.team) == 2)) and (_root.game.gameMode != "plays")) and (_root.game.gameMode != "celebration")) and (_root.game.paused == false)) || (((((_name == "player11") and (parseInt(_root.game.ball.storedOwner.team) == 1)) and (_root.game.gameMode != "plays")) and (_root.game.gameMode != "celebration")) and (_root.game.paused == false))) {
if (_currentframe == 1) {
gotoAndStop (3);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(10);
}
} else if (_currentframe == 2) {
gotoAndStop (4);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(10);
}
}
} else if (((((_name == "player22") and (_root.game.gameMode != "plays")) and (_root.game.paused == false)) and (_root.game.gameMode != "celebration")) and (_root.game.gameMode != "shot")) {
gotoAndStop(_root.game.player21._currentframe);
} else if (((((_name == "player11") and (_root.game.gameMode != "plays")) and (_root.game.paused == false)) and (_root.game.gameMode != "celebration")) and (_root.game.gameMode != "shot")) {
gotoAndStop(_root.game.player10._currentframe);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(_root.game.player10.ani._currentframe);
}
}
if ((tackled == true) and (_root.game.paused == false)) {
tackle();
}
if (_root.game.paused == false) {
if (_parent.ball.target != this) {
arrow.gotoAndStop(1);
var arrowPlayed = false;
heldTime = 0;
} else {
if ((_parent.passesNum == 1) || (_root.game.downs == 0)) {
if (team == 1) {
if ((((xspeed < 0) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) and (_root.game.messageList.length == 0)) {
if ((_root.game.tdMode == false) || ((_root.game.tdMode != false) and (_parent.passesNum > 0))) {
progressTimer = progressTimer + 1;
if ((forwardProgress == 0) || (forwardProgress < (_x + fixedLineX))) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
forwardProgress = _x + fixedLineX;
}
if (progressTimer > 50) {
turnedPause();
progressTimer = 0;
}
} else {
progressTimer = 0;
}
}
} else if ((((xspeed > 0) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) and (_root.game.messageList.length == 0)) {
if ((_root.game.tdMode == false) || ((_root.game.tdMode != false) and (_parent.passesNum > 0))) {
progressTimer = progressTimer + 1;
if ((forwardProgress == 0) || (forwardProgress > (_x + fixedLineX))) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
forwardProgress = _x + fixedLineX;
}
if (progressTimer > 50) {
turnedPause();
progressTimer = 0;
}
} else {
progressTimer = 0;
}
}
}
if ((((team == 1) and (_root.game.gameMode == "plays")) and (team != _root.game.playersTeam)) || (((team == 1) and (_root.game.gameMode == "plays")) and (_root.game.demoMode == true))) {
heldTime = heldTime + 1;
var playerAmount = 12;
i = 1;
while (i < playerAmount) {
var target = _root.game["player" + i];
var randFactor = random(3);
if (((((((((target._x > (_x + 40)) and (_parent.passesNum == 0)) and (heldTime > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed > (1.5 * _root.game.vibrationVal))) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || ((((_parent.nzone.hitTest(target.xpos, target.ypos, true) and (target._x > _x)) and (_parent.passesNum == 0)) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing"))) || ((((((((target._x > (_x + 40)) and (_parent.passesNum == 0)) and (heldTime > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed > 1.5)) and (_root.game.downs > 0)) and (_root.game.playType == "passing")) and (_root.game.demoMode == true))) {
_parent.passesNum = _parent.passesNum + 1;
_parent.ball.target = "";
_parent.ball.targetX = _root.game["player" + i]._x + (_root.game["player" + i].xspeed * (8 + random(15)));
_parent.ball.targetY = (_root.game["player" + i]._y - 10) + (_root.game["player" + i].yspeed * (8 + random(15)));
var dx = (_parent.ball.targetX - _parent.ball._x);
var dy = (_parent.ball.targetY - _parent.ball._y);
var dist = Math.sqrt((dx * dx) + (dy * dy));
_parent.ball.xspeed = dx / (dist / 10);
_parent.ball.yspeed = dy / (dist / 10);
_parent.ball.zspeed = -(dist / 20);
_parent.ball.zpos = 4;
}
i = i + 1;
}
} else {
heldTime = 0;
}
if ((((team == 2) and (_root.game.gameMode == "plays")) and (team != _root.game.playersTeam)) || (((team == 2) and (_root.game.gameMode == "plays")) and (_root.game.demoMode == true))) {
heldTime2 = heldTime2 + 1;
var playerAmount = 23;
i = 12;
while (i < playerAmount) {
var target = _root.game["player" + i];
var randFactor = random(3);
if ((((((((target._x < (_x - 40)) and (_parent.passesNum == 0)) and (heldTime2 > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed < (-1.5 * _root.game.vibrationVal))) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || ((((_parent.nzone.hitTest(target.xpos, target.ypos, true) and (target._x < _x)) and (_parent.passesNum == 0)) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing"))) {
_parent.passesNum = _parent.passesNum + 1;
_parent.ball.target = "";
_parent.ball.targetX = _root.game["player" + i]._x + (_root.game["player" + i].xspeed * (8 + random(15)));
_parent.ball.targetY = (_root.game["player" + i]._y - 10) + (_root.game["player" + i].yspeed * (8 + random(15)));
var dx = (_parent.ball.targetX - _parent.ball._x);
var dy = (_parent.ball.targetY - _parent.ball._y);
var dist = Math.sqrt((dx * dx) + (dy * dy));
_parent.ball.xspeed = dx / (dist / 10);
_parent.ball.yspeed = dy / (dist / 10);
_parent.ball.zspeed = -(dist / 20);
_parent.ball.zpos = 4;
}
i = i + 1;
}
} else {
heldTime2 = 0;
}
if (arrowPlayed == false) {
arrow.play();
var arrowPlayed = true;
}
}
if ((_root.game.gameMode == "plays") and (_parent.ball.target == "")) {
if ((((((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player22")) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player11"))) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player4"))) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player16"))) {
} else {
var catchRad = (rad * 2.5);
var zcatch = 4;
}
if (_root.game.ball.target == "") {
if ((_root.game.ball._x < (_x + 50)) and (_root.game.ball._x > (_x - 50))) {
if ((((_root.game.lastGameMode == "kickOff") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player22")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "kickOff") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player11")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "punt") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player15")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "punt") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player4")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "puntSafety") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player15")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "puntSafety") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player4")) {
_root.game.ball.target = this;
}
}
if ((_root.game.ball._x < (_x + 20)) and (_root.game.ball._x > (_x - 20))) {
var dx = (_parent.ball._x - _x);
var dy = (_parent.ball._y - (_y - 10));
var dist = Math.sqrt((dx * dx) + (dy * dy));
if (((dist < catchRad) and (_parent.ball.zpos < zcatch)) and (_root.game.ball.bounce < 1)) {
if ((_parent.ball.storedOwner.team != team) and (_parent.ball.storedOwner.team > 0)) {
if (_root.game.tdMode != false) {
tacklePause();
} else {
_parent.scoreboard.bigscreen.ani.gotoAndPlay("intercept");
_root.game.downs = 0;
intercepted = true;
_root.game.intercepted = true;
}
}
_parent.ball.target = this;
arrow.play();
}
var dx = ((_parent.ball._x + _root.game.ball.xspeed) - _x);
var dy = ((_parent.ball._y + _root.game.ball.yspeed) - (_y - 10));
var dist = Math.sqrt((dx * dx) + (dy * dy));
if (((dist < catchRad) and (_parent.ball.zpos < zcatch)) and (_root.game.ball.bounce < 1)) {
if ((_parent.ball.storedOwner.team != team) and (_parent.ball.storedOwner.team > 0)) {
if (_root.game.tdMode != false) {
tacklePause();
} else {
_parent.scoreboard.bigscreen.ani.gotoAndPlay("intercept");
_root.game.downs = 0;
intercepted = true;
_root.game.intercepted = true;
}
}
_parent.ball.target = this;
arrow.play();
}
}
}
}
xpos = _x + _root.game._x;
ypos = _y + _root.game._y;
speed = 0.12 * _root.game.vibrationVal;
currentY = _y - _root.game.pitchBackY;
posY = currentY / _root.game.pitchFrontY;
percent = _root.game.pitchDepth / _root.game.horizon;
depthScale = (1 - percent) + (posY * percent);
if (intercepted == true) {
speedDone = false;
intercepted = false;
}
if ((_root.game.vibrate == true) and (_root.game.paused == false)) {
rotTimer = 1 + random(20 * _root.game.vibrationVal);
if (rotTimer == 1) {
rotInc = (-30 + random(60)) / 140;
}
rotVel = rotVel + rotInc;
if (((_root.game.gameMode == "plays") and (speedDone == false)) || (_root.game.mouseIsDown == true)) {
if (_root.game.lastGameMode != "kickOff") {
speedDone = true;
if (_root.game.ball.target != this) {
if (((_root.game.playType == "running") and (team == _root.game.playersTeam)) || ((_root.game.compPlayType == "running") and (team == _root.game.compTeam))) {
if ((((((((((_name == "player22") || (_name == "player18")) || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) || (_name == "player11")) || (_name == "player7")) || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
var xspeedEq = (speed * 1.5);
var yspeedEq = (speed * 1.5);
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else if (((_root.game.playType == "defense") and (team == _root.game.playersTeam)) || ((_root.game.compPlayType == "defense") and (team == _root.game.compTeam))) {
if ((_root.downs >= 1) and (_root.game.blitz == false)) {
if ((((_name == "player8") || (_name == "player9")) || (_name == "player19")) || (_name == "player20")) {
var xspeedEq = (-(speed / 3));
var yspeedEq = (-(speed / 3));
} else if ((((_name == "player10") || (_name == "player11")) || (_name == "player21")) || (_name == "player22")) {
var xspeedEq = (-(speed / 5));
var yspeedEq = (-(speed / 5));
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else if (((((_root.game.passesNum == 0) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || (((_root.game.passesNum == 0) and (_root.game.downs > 0)) and (_root.game.playType == "passing"))) || (((_root.game.passesNum == 0) and (_root.game.tdMode != false)) and (_root.game.playType == "passing"))) {
var xspeedEq = (-(speed / 6));
var yspeedEq = (-(speed / 6));
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
}
}
if ((_root.game.gameMode != "plays") || (_root.game.paused == true)) {
speedDone = false;
}
if (((_root.game.gameMode == "plays") || (_root.game.gameMode == "celebration")) || (_root.game.gameMode == "shot")) {
xspeed = xspeed + (Math.cos((rot - 180) * (Math.PI/180)) * xspeedEq);
yspeed = yspeed + (Math.sin((rot - 180) * (Math.PI/180)) * yspeedEq);
}
if (collisionTimer < 1) {
collisionTimer = collisionTimer + 1;
} else {
collisionTimer = 0;
}
if (((_root.game.vibrate == true) and (_root.game.paused == false)) || (_root.game.mouseIsDown == true)) {
if ((collisionTimer == 0) and (team == 1)) {
i = 0;
while (i < (_root.game.playerNum + 1)) {
var target = _root.game["player" + i];
if (_name != ("player" + i)) {
checkCollision(this, target);
}
i = i + 1;
}
checkWalls();
}
if ((collisionTimer == 1) and (team == 2)) {
i = 12;
while (i < (_root.game.playerNum + 1)) {
var target = _root.game["player" + i];
if (_name != ("player" + i)) {
checkCollision(this, target);
}
i = i + 1;
}
checkWalls();
}
}
if (_root.game.gameMode == "puntSafety") {
checkWalls();
}
xspeed = xspeed * 0.97;
yspeed = yspeed * 0.97;
rotVel = rotVel * 0.97;
this.swapDepths(_y + (_x / 5));
if ((_name == "player22") and (_root.game.playType == "running")) {
} else {
var aniFrames = ani._totalframes;
rotStored = rotStored + rotVel;
if (rotStored > (360 / aniFrames)) {
if (ani._currentframe < aniFrames) {
ani.nextFrame();
} else {
ani.gotoAndStop(1);
}
rotStored = rotStored - (360 / aniFrames);
}
if (rotStored < (-(360 / aniFrames))) {
if (ani._currentframe > 1) {
ani.prevFrame();
} else {
ani.gotoAndStop(aniFrames);
}
rotStored = rotStored + (360 / aniFrames);
}
rot = rot + rotVel;
_xscale = (depthScale * 110);
_yscale = _xscale;
}
if (((_root.game.gameMode == "plays") || (_root.game.gameMode == "celebration")) || (_root.game.gameMode == "shot")) {
_x = (_x + (xspeed * depthScale));
_y = (_y + (yspeed * depthScale));
}
}
}
Instance of Symbol 198 MovieClip "player20" in Symbol 494 MovieClip Frame 2
onClipEvent (load) {
hitSound = new Sound(this);
hitSound.attachSound("hitSound");
xspeed = 0;
yspeed = 0;
speed = 0.1 * _root.game.vibrationVal;
currentY = _y - _root.game.pitchBackY;
posY = currentY / _root.game.pitchFrontY;
percent = _root.game.pitchDepth / _root.game.horizon;
depthScale = (1 - percent) + (posY * percent);
rotVel = 0;
rotInc = 0;
rotTimer = random(20);
_rotation = 0;
xpos = _x + _root.game._x;
ypos = _y + _root.game._y;
_root.game.playerNum = _root.game.playerNum + 1;
mass = 2;
rad = hitArea._width / 2.3;
team = 0;
if (parseInt(substring(_name, 7, 2)) < 12) {
team = 1;
rot = 180;
origRot = rot;
if ((_name == "player22") || (_name == "player11")) {
gotoAndStop (4);
} else {
gotoAndStop (2);
}
ani.gotoAndStop(10);
} else {
team = 2;
rot = 0;
origRot = rot;
if ((_name == "player22") || (_name == "player11")) {
gotoAndStop (3);
} else {
gotoAndStop (1);
}
ani.gotoAndStop(1);
}
if (team == 2) {
trace(((("new Array(" + Math.round(_x)) + ",") + Math.round(_y)) + "),");
}
rotStored = 0;
heldTime = 0;
heldTime2 = 0;
tackled = false;
forwardProgress = 0;
progressTimer = 0;
type = "";
fixedLineX = 0;
speedDone = false;
var xspeedEq = speed;
var yspeedEq = speed;
storedVar = "";
collisionTimer = 0;
intercepted = false;
}
onClipEvent (enterFrame) {
function checkOutOfBounds() {
if (_root.game.ball.target == this) {
boundsPause();
if ((ani._currentframe < 6) || (ani._currentframe > 14)) {
if (team == 1) {
}
} else if ((ani._currentframe > 6) and (ani._currentframe < 14)) {
if (team == 2) {
}
}
}
}
function checkScrimmage() {
if (team == 1) {
if (_root.game.scrimmage < _root.game.endZoneL) {
_root.game.scrimmage = _root.game.twentyYardLineL;
_root.game.touchBack = true;
} else {
_root.game.touchBack = false;
}
if (_root.game.scrimmage > _root.game.endZoneR) {
_root.game.scrimmage = _root.game.endZoneR;
}
} else {
if (_root.game.scrimmage < _root.game.endZoneL) {
_root.game.scrimmage = _root.game.endZoneL;
}
if (_root.game.scrimmage > _root.game.endZoneR) {
_root.game.scrimmage = _root.game.twentyYardLineR;
_root.game.touchBack = true;
} else {
_root.game.touchBack = false;
}
}
}
function tacklePause() {
type = "tackle";
if ((_root.game.timeOut == true) and (_root.game.tdMode == false)) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
_root.game.scrimmage = _x + fixedLineX;
checkScrimmage();
}
if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "tackle";
_root.game.safed = true;
} else if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "tackle";
_root.game.safed = true;
} else {
type = "tackle";
}
if ((_root.game.paused == false) and (_root.game.gameMode != "celebration")) {
_root.game.sound.gotoAndPlay("whistle");
}
if (((((_root.game.gameMode == "plays") and (_root.game.paused == false)) || ((_root.game.gameMode == "kickOff") and (_root.game.paused == false))) || ((_root.game.gameMode == "punt") and (_root.game.paused == false))) || (((_root.game.tdMode != false) and (_root.game.paused == false)) and (_root.game.gameMode == "plays"))) {
tackled = true;
type = "tackle";
if ((_root.game.passesNum == 0) and (_root.game.gameMode != "celebration")) {
if (_parent.ball.target.team == 1) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
if (((_x + fixedLineX) < _root.game.scrimmage) and (_root.game.downs > 0)) {
_parent.addMessage("sack");
} else {
_parent.addMessage("tackled");
}
}
if (_parent.ball.target.team == 2) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
if (((_x + fixedLineX) > _root.game.scrimmage) and (_root.game.downs > 0)) {
_parent.addMessage("sack");
} else {
_parent.addMessage("tackled");
}
}
} else if (_root.game.gameMode != "celebration") {
_parent.addMessage("tackled");
}
_root.game.pauseTime = 55;
}
}
function boundsPause() {
if (_root.game.timeOut == true) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
_root.game.scrimmage = _x + fixedLineX;
checkScrimmage();
}
if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "bounds";
_root.game.safed = true;
} else if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "bounds";
_root.game.safed = true;
} else {
type = "bounds";
}
type = "bounds";
_root.game.sound.gotoAndPlay("whistle");
tackled = true;
_parent.addMessage("outOfBounds");
_root.game.pauseTime = 55;
}
function turnedPause() {
if (_root.game.timeOut == true) {
_root.game.scrimmage = forwardProgress;
checkScrimmage();
}
type = "turn";
_root.game.sound.gotoAndPlay("whistle");
tackled = true;
_parent.addMessage("turnedAround");
_parent.addMessage("negativeProgress");
_root.game.pauseTime = 55;
}
function tackle() {
if ((_root.game.gameMode != "puntSafety") and (gameMode != "scrum")) {
if (_root.game.tdMode != false) {
if ((_root.game.timeOut == false) and (_root.game.gameMode != "celebration")) {
_root.game.startKickoff(_root.game.playersTeam);
_root.game.removeTackles();
tacked = false;
_root.game.tdMode = false;
} else if (_root.game.gameMode != "celebration") {
_root.game.removeTackles();
tacked = false;
_root.game.tdMode = false;
_root.game.gameMode = "convFail";
trace(_root.game.gameMode);
} else {
_root.game.removeTackles();
tacked = false;
}
} else if ((_root.game.downs <= 3.5) || (_root.game.goForIt == true)) {
if ((((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (type != "turn")) and (_root.game.downs > 0.5)) and (_root.game.ball.target == this)) and (_root.game.gameMode != "celebration")) {
_root.game.addMessage("Safety");
if (team != _root.game.playersTeam) {
_root.game.setupSafetyKick(_root.game.compTeam);
_root.game.hscore = _root.game.hscore + 2;
} else {
_root.game.setupSafetyKick(_root.game.playersTeam);
_root.game.gscore = _root.game.gscore + 2;
}
tackled = false;
} else if ((((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (type != "turn")) and (_root.game.downs > 0.5)) and (_root.game.ball.target == this)) and (_root.game.gameMode != "celebration")) {
_root.game.addMessage("Safety");
if (team != _root.game.playersTeam) {
_root.game.setupSafetyKick(_root.game.compTeam);
_root.game.hscore = _root.game.hscore + 2;
} else {
_root.game.setupSafetyKick(_root.game.playersTeam);
_root.game.gscore = _root.game.gscore + 2;
}
tackled = false;
} else {
_root.game.changeMode = false;
tackled = false;
if (type == "turn") {
var _local4 = forwardProgress;
} else {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
var _local4 = _x + fixedLineX;
}
_root.game.scrimmage = _local4;
if (_parent.ball.target.team != _root.game.playersTeam) {
var _local5 = random(2);
if (_local5 == 1) {
_root.game.compPlayType = "passing";
_root.game.setupLine(_root.game.compTeam, _root.game.formationShotgun, _local4, 0.5);
} else {
_root.game.compPlayType = "running";
_root.game.setupLine(_root.game.compTeam, _root.game.formationI, _local4, 0.5);
}
_root.game.setupLine(_root.game.playersTeam, _root.game.formation43, _local4, 0.5);
} else {
var _local5 = 1 + random(5);
_root.game.compPlayType = "defense";
_root.game.setupLine(_root.game.compTeam, _root.game["formationDefence" + _local5], _local4, 0.5);
_root.game.setupLine(_root.game.playersTeam, _root.game.formationShotgun, _local4, 0.5);
}
}
} else if ((_root.game.goForIt == true) and (_root.game.gameMode == "plays")) {
if (_root.game.changeMode == false) {
_root.game.downs = _root.game.downs + 1;
}
_root.game.pauseTime = 0;
_root.game.paused = false;
tackled = false;
} else if (_root.game.gameMode == "plays") {
_root.game.pauseTime = 0;
_root.game.paused = false;
if (_root.game.changeMode == false) {
_root.game.downs = _root.game.downs + 1;
}
tackled = false;
}
}
}
function checkWalls() {
if ((_y + 10) > _root.game.pitchFrontY) {
if (((yspeed > 1) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) {
checkOutOfBounds();
}
_y = (_y - 1);
yspeed = (-yspeed) * 0.5;
}
if ((_y - 5) < _root.game.pitchBackY) {
if (((yspeed < 1) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) {
checkOutOfBounds();
}
_y = (_y + 1);
yspeed = (-yspeed) * 0.5;
}
if (_root.game.walls.hitTest(xpos + (hitArea._width / 2), ypos, true) and (_x > 300)) {
_x = (_x - 2);
xspeed = (-xspeed) * 0.5;
}
if (_root.game.walls.hitTest(xpos - (hitArea._width / 2), ypos, true) and (_x < 300)) {
_x = (_x + 2);
xspeed = (-xspeed) * 0.5;
}
}
function checkCollision(b1, b2) {
var _local12 = b2._x - b1._x;
var _local11 = b2._y - b1._y;
var _local19 = Math.sqrt((_local12 * _local12) + (_local11 * _local11));
if (_local19 < (b1.rad + b2.rad)) {
if (((_parent.ball.target == this) and (b2.team != this.team)) || ((_parent.ball.target == b2) and (this.team != b2.team))) {
tacklePause();
}
if (_root.game.gameMode == "plays") {
var _local8 = 0;
if (xspeed < 0) {
_local8 = _local8 + (-xspeed);
} else {
_local8 = _local8 + xspeed;
}
if (yspeed < 0) {
_local8 = _local8 + (-yspeed);
} else {
_local8 = _local8 + yspeed;
}
if (_local8 > 1) {
hitSound.setVolume(_local8 * 15);
hitSound.start(0, 0);
hitSound.setVolume(_local8 * 15);
}
}
var _local18 = Math.atan2(_local11, _local12);
var _local7 = Math.cos(_local18);
var _local6 = Math.sin(_local18);
var _local9 = (_local7 * b1.xspeed) + (_local6 * b1.yspeed);
var _local15 = (_local7 * b1.yspeed) - (_local6 * b1.xspeed);
var _local10 = (_local7 * b2.xspeed) + (_local6 * b2.yspeed);
var _local14 = (_local7 * b2.yspeed) - (_local6 * b2.xspeed);
var _local21 = (_local9 * b1.mass) + (_local10 * b2.mass);
var _local20 = _local9 - _local10;
_local9 = (_local21 - (b2.mass * _local20)) / (b1.mass + b2.mass);
_local10 = _local20 + _local9;
b1.xspeed = ((_local7 * _local9) - (_local6 * _local15)) * 0.7;
b1.yspeed = ((_local7 * _local15) + (_local6 * _local9)) * 0.7;
b2.xspeed = ((_local7 * _local10) - (_local6 * _local14)) * 0.7;
b2.yspeed = ((_local7 * _local14) + (_local6 * _local10)) * 0.7;
var _local16 = ((b1.rad + b2.rad) - _local19) / 2;
var _local17 = _local7 * _local16;
var _local13 = _local6 * _local16;
b1._x = b1._x - (_local17 * 1.1);
b1._y = b1._y - (_local13 * 1.1);
b2._x = b2._x + (_local17 * 1.1);
b2._y = b2._y + (_local13 * 1.1);
}
}
if (_root.game.gameMode == "kickOff") {
var xspeedEq = speed;
var yspeedEq = speed;
}
if (_root.game.cleanUp == true) {
this.removeMovieClip();
}
if ((_root.game.gameMode == "scrum") || (_root.game.gameMode == "kickOff")) {
forwardProgress = 0;
progressTimer = 0;
}
if (team == _root.game.playersTeam) {
if (_root.game.playType == "running") {
if (_root.game.playersTeam == 1) {
if ((((_name == "player7") || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else if ((((_name == "player18") || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else {
mass = 2;
}
}
if (team == _root.game.compTeam) {
if (_root.game.compPlayType == "running") {
if (_root.game.compTeam == 1) {
if ((((_name == "player7") || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else if ((((_name == "player18") || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else {
mass = 2;
}
}
if ((((((_name == "player22") and (parseInt(_root.game.ball.storedOwner.team) == 2)) and (_root.game.gameMode != "plays")) and (_root.game.gameMode != "celebration")) and (_root.game.paused == false)) || (((((_name == "player11") and (parseInt(_root.game.ball.storedOwner.team) == 1)) and (_root.game.gameMode != "plays")) and (_root.game.gameMode != "celebration")) and (_root.game.paused == false))) {
if (_currentframe == 1) {
gotoAndStop (3);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(10);
}
} else if (_currentframe == 2) {
gotoAndStop (4);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(10);
}
}
} else if (((((_name == "player22") and (_root.game.gameMode != "plays")) and (_root.game.paused == false)) and (_root.game.gameMode != "celebration")) and (_root.game.gameMode != "shot")) {
gotoAndStop(_root.game.player21._currentframe);
} else if (((((_name == "player11") and (_root.game.gameMode != "plays")) and (_root.game.paused == false)) and (_root.game.gameMode != "celebration")) and (_root.game.gameMode != "shot")) {
gotoAndStop(_root.game.player10._currentframe);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(_root.game.player10.ani._currentframe);
}
}
if ((tackled == true) and (_root.game.paused == false)) {
tackle();
}
if (_root.game.paused == false) {
if (_parent.ball.target != this) {
arrow.gotoAndStop(1);
var arrowPlayed = false;
heldTime = 0;
} else {
if ((_parent.passesNum == 1) || (_root.game.downs == 0)) {
if (team == 1) {
if ((((xspeed < 0) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) and (_root.game.messageList.length == 0)) {
if ((_root.game.tdMode == false) || ((_root.game.tdMode != false) and (_parent.passesNum > 0))) {
progressTimer = progressTimer + 1;
if ((forwardProgress == 0) || (forwardProgress < (_x + fixedLineX))) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
forwardProgress = _x + fixedLineX;
}
if (progressTimer > 50) {
turnedPause();
progressTimer = 0;
}
} else {
progressTimer = 0;
}
}
} else if ((((xspeed > 0) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) and (_root.game.messageList.length == 0)) {
if ((_root.game.tdMode == false) || ((_root.game.tdMode != false) and (_parent.passesNum > 0))) {
progressTimer = progressTimer + 1;
if ((forwardProgress == 0) || (forwardProgress > (_x + fixedLineX))) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
forwardProgress = _x + fixedLineX;
}
if (progressTimer > 50) {
turnedPause();
progressTimer = 0;
}
} else {
progressTimer = 0;
}
}
}
if ((((team == 1) and (_root.game.gameMode == "plays")) and (team != _root.game.playersTeam)) || (((team == 1) and (_root.game.gameMode == "plays")) and (_root.game.demoMode == true))) {
heldTime = heldTime + 1;
var playerAmount = 12;
i = 1;
while (i < playerAmount) {
var target = _root.game["player" + i];
var randFactor = random(3);
if (((((((((target._x > (_x + 40)) and (_parent.passesNum == 0)) and (heldTime > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed > (1.5 * _root.game.vibrationVal))) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || ((((_parent.nzone.hitTest(target.xpos, target.ypos, true) and (target._x > _x)) and (_parent.passesNum == 0)) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing"))) || ((((((((target._x > (_x + 40)) and (_parent.passesNum == 0)) and (heldTime > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed > 1.5)) and (_root.game.downs > 0)) and (_root.game.playType == "passing")) and (_root.game.demoMode == true))) {
_parent.passesNum = _parent.passesNum + 1;
_parent.ball.target = "";
_parent.ball.targetX = _root.game["player" + i]._x + (_root.game["player" + i].xspeed * (8 + random(15)));
_parent.ball.targetY = (_root.game["player" + i]._y - 10) + (_root.game["player" + i].yspeed * (8 + random(15)));
var dx = (_parent.ball.targetX - _parent.ball._x);
var dy = (_parent.ball.targetY - _parent.ball._y);
var dist = Math.sqrt((dx * dx) + (dy * dy));
_parent.ball.xspeed = dx / (dist / 10);
_parent.ball.yspeed = dy / (dist / 10);
_parent.ball.zspeed = -(dist / 20);
_parent.ball.zpos = 4;
}
i = i + 1;
}
} else {
heldTime = 0;
}
if ((((team == 2) and (_root.game.gameMode == "plays")) and (team != _root.game.playersTeam)) || (((team == 2) and (_root.game.gameMode == "plays")) and (_root.game.demoMode == true))) {
heldTime2 = heldTime2 + 1;
var playerAmount = 23;
i = 12;
while (i < playerAmount) {
var target = _root.game["player" + i];
var randFactor = random(3);
if ((((((((target._x < (_x - 40)) and (_parent.passesNum == 0)) and (heldTime2 > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed < (-1.5 * _root.game.vibrationVal))) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || ((((_parent.nzone.hitTest(target.xpos, target.ypos, true) and (target._x < _x)) and (_parent.passesNum == 0)) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing"))) {
_parent.passesNum = _parent.passesNum + 1;
_parent.ball.target = "";
_parent.ball.targetX = _root.game["player" + i]._x + (_root.game["player" + i].xspeed * (8 + random(15)));
_parent.ball.targetY = (_root.game["player" + i]._y - 10) + (_root.game["player" + i].yspeed * (8 + random(15)));
var dx = (_parent.ball.targetX - _parent.ball._x);
var dy = (_parent.ball.targetY - _parent.ball._y);
var dist = Math.sqrt((dx * dx) + (dy * dy));
_parent.ball.xspeed = dx / (dist / 10);
_parent.ball.yspeed = dy / (dist / 10);
_parent.ball.zspeed = -(dist / 20);
_parent.ball.zpos = 4;
}
i = i + 1;
}
} else {
heldTime2 = 0;
}
if (arrowPlayed == false) {
arrow.play();
var arrowPlayed = true;
}
}
if ((_root.game.gameMode == "plays") and (_parent.ball.target == "")) {
if ((((((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player22")) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player11"))) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player4"))) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player16"))) {
} else {
var catchRad = (rad * 2.5);
var zcatch = 4;
}
if (_root.game.ball.target == "") {
if ((_root.game.ball._x < (_x + 50)) and (_root.game.ball._x > (_x - 50))) {
if ((((_root.game.lastGameMode == "kickOff") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player22")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "kickOff") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player11")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "punt") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player15")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "punt") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player4")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "puntSafety") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player15")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "puntSafety") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player4")) {
_root.game.ball.target = this;
}
}
if ((_root.game.ball._x < (_x + 20)) and (_root.game.ball._x > (_x - 20))) {
var dx = (_parent.ball._x - _x);
var dy = (_parent.ball._y - (_y - 10));
var dist = Math.sqrt((dx * dx) + (dy * dy));
if (((dist < catchRad) and (_parent.ball.zpos < zcatch)) and (_root.game.ball.bounce < 1)) {
if ((_parent.ball.storedOwner.team != team) and (_parent.ball.storedOwner.team > 0)) {
if (_root.game.tdMode != false) {
tacklePause();
} else {
_parent.scoreboard.bigscreen.ani.gotoAndPlay("intercept");
_root.game.downs = 0;
intercepted = true;
_root.game.intercepted = true;
}
}
_parent.ball.target = this;
arrow.play();
}
var dx = ((_parent.ball._x + _root.game.ball.xspeed) - _x);
var dy = ((_parent.ball._y + _root.game.ball.yspeed) - (_y - 10));
var dist = Math.sqrt((dx * dx) + (dy * dy));
if (((dist < catchRad) and (_parent.ball.zpos < zcatch)) and (_root.game.ball.bounce < 1)) {
if ((_parent.ball.storedOwner.team != team) and (_parent.ball.storedOwner.team > 0)) {
if (_root.game.tdMode != false) {
tacklePause();
} else {
_parent.scoreboard.bigscreen.ani.gotoAndPlay("intercept");
_root.game.downs = 0;
intercepted = true;
_root.game.intercepted = true;
}
}
_parent.ball.target = this;
arrow.play();
}
}
}
}
xpos = _x + _root.game._x;
ypos = _y + _root.game._y;
speed = 0.12 * _root.game.vibrationVal;
currentY = _y - _root.game.pitchBackY;
posY = currentY / _root.game.pitchFrontY;
percent = _root.game.pitchDepth / _root.game.horizon;
depthScale = (1 - percent) + (posY * percent);
if (intercepted == true) {
speedDone = false;
intercepted = false;
}
if ((_root.game.vibrate == true) and (_root.game.paused == false)) {
rotTimer = 1 + random(20 * _root.game.vibrationVal);
if (rotTimer == 1) {
rotInc = (-30 + random(60)) / 140;
}
rotVel = rotVel + rotInc;
if (((_root.game.gameMode == "plays") and (speedDone == false)) || (_root.game.mouseIsDown == true)) {
if (_root.game.lastGameMode != "kickOff") {
speedDone = true;
if (_root.game.ball.target != this) {
if (((_root.game.playType == "running") and (team == _root.game.playersTeam)) || ((_root.game.compPlayType == "running") and (team == _root.game.compTeam))) {
if ((((((((((_name == "player22") || (_name == "player18")) || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) || (_name == "player11")) || (_name == "player7")) || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
var xspeedEq = (speed * 1.5);
var yspeedEq = (speed * 1.5);
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else if (((_root.game.playType == "defense") and (team == _root.game.playersTeam)) || ((_root.game.compPlayType == "defense") and (team == _root.game.compTeam))) {
if ((_root.downs >= 1) and (_root.game.blitz == false)) {
if ((((_name == "player8") || (_name == "player9")) || (_name == "player19")) || (_name == "player20")) {
var xspeedEq = (-(speed / 3));
var yspeedEq = (-(speed / 3));
} else if ((((_name == "player10") || (_name == "player11")) || (_name == "player21")) || (_name == "player22")) {
var xspeedEq = (-(speed / 5));
var yspeedEq = (-(speed / 5));
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else if (((((_root.game.passesNum == 0) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || (((_root.game.passesNum == 0) and (_root.game.downs > 0)) and (_root.game.playType == "passing"))) || (((_root.game.passesNum == 0) and (_root.game.tdMode != false)) and (_root.game.playType == "passing"))) {
var xspeedEq = (-(speed / 6));
var yspeedEq = (-(speed / 6));
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
}
}
if ((_root.game.gameMode != "plays") || (_root.game.paused == true)) {
speedDone = false;
}
if (((_root.game.gameMode == "plays") || (_root.game.gameMode == "celebration")) || (_root.game.gameMode == "shot")) {
xspeed = xspeed + (Math.cos((rot - 180) * (Math.PI/180)) * xspeedEq);
yspeed = yspeed + (Math.sin((rot - 180) * (Math.PI/180)) * yspeedEq);
}
if (collisionTimer < 1) {
collisionTimer = collisionTimer + 1;
} else {
collisionTimer = 0;
}
if (((_root.game.vibrate == true) and (_root.game.paused == false)) || (_root.game.mouseIsDown == true)) {
if ((collisionTimer == 0) and (team == 1)) {
i = 0;
while (i < (_root.game.playerNum + 1)) {
var target = _root.game["player" + i];
if (_name != ("player" + i)) {
checkCollision(this, target);
}
i = i + 1;
}
checkWalls();
}
if ((collisionTimer == 1) and (team == 2)) {
i = 12;
while (i < (_root.game.playerNum + 1)) {
var target = _root.game["player" + i];
if (_name != ("player" + i)) {
checkCollision(this, target);
}
i = i + 1;
}
checkWalls();
}
}
if (_root.game.gameMode == "puntSafety") {
checkWalls();
}
xspeed = xspeed * 0.97;
yspeed = yspeed * 0.97;
rotVel = rotVel * 0.97;
this.swapDepths(_y + (_x / 5));
if ((_name == "player22") and (_root.game.playType == "running")) {
} else {
var aniFrames = ani._totalframes;
rotStored = rotStored + rotVel;
if (rotStored > (360 / aniFrames)) {
if (ani._currentframe < aniFrames) {
ani.nextFrame();
} else {
ani.gotoAndStop(1);
}
rotStored = rotStored - (360 / aniFrames);
}
if (rotStored < (-(360 / aniFrames))) {
if (ani._currentframe > 1) {
ani.prevFrame();
} else {
ani.gotoAndStop(aniFrames);
}
rotStored = rotStored + (360 / aniFrames);
}
rot = rot + rotVel;
_xscale = (depthScale * 110);
_yscale = _xscale;
}
if (((_root.game.gameMode == "plays") || (_root.game.gameMode == "celebration")) || (_root.game.gameMode == "shot")) {
_x = (_x + (xspeed * depthScale));
_y = (_y + (yspeed * depthScale));
}
}
}
Instance of Symbol 198 MovieClip "player13" in Symbol 494 MovieClip Frame 2
onClipEvent (load) {
hitSound = new Sound(this);
hitSound.attachSound("hitSound");
xspeed = 0;
yspeed = 0;
speed = 0.1 * _root.game.vibrationVal;
currentY = _y - _root.game.pitchBackY;
posY = currentY / _root.game.pitchFrontY;
percent = _root.game.pitchDepth / _root.game.horizon;
depthScale = (1 - percent) + (posY * percent);
rotVel = 0;
rotInc = 0;
rotTimer = random(20);
_rotation = 0;
xpos = _x + _root.game._x;
ypos = _y + _root.game._y;
_root.game.playerNum = _root.game.playerNum + 1;
mass = 2;
rad = hitArea._width / 2.3;
team = 0;
if (parseInt(substring(_name, 7, 2)) < 12) {
team = 1;
rot = 180;
origRot = rot;
if ((_name == "player22") || (_name == "player11")) {
gotoAndStop (4);
} else {
gotoAndStop (2);
}
ani.gotoAndStop(10);
} else {
team = 2;
rot = 0;
origRot = rot;
if ((_name == "player22") || (_name == "player11")) {
gotoAndStop (3);
} else {
gotoAndStop (1);
}
ani.gotoAndStop(1);
}
if (team == 2) {
trace(((("new Array(" + Math.round(_x)) + ",") + Math.round(_y)) + "),");
}
rotStored = 0;
heldTime = 0;
heldTime2 = 0;
tackled = false;
forwardProgress = 0;
progressTimer = 0;
type = "";
fixedLineX = 0;
speedDone = false;
var xspeedEq = speed;
var yspeedEq = speed;
storedVar = "";
collisionTimer = 0;
intercepted = false;
}
onClipEvent (enterFrame) {
function checkOutOfBounds() {
if (_root.game.ball.target == this) {
boundsPause();
if ((ani._currentframe < 6) || (ani._currentframe > 14)) {
if (team == 1) {
}
} else if ((ani._currentframe > 6) and (ani._currentframe < 14)) {
if (team == 2) {
}
}
}
}
function checkScrimmage() {
if (team == 1) {
if (_root.game.scrimmage < _root.game.endZoneL) {
_root.game.scrimmage = _root.game.twentyYardLineL;
_root.game.touchBack = true;
} else {
_root.game.touchBack = false;
}
if (_root.game.scrimmage > _root.game.endZoneR) {
_root.game.scrimmage = _root.game.endZoneR;
}
} else {
if (_root.game.scrimmage < _root.game.endZoneL) {
_root.game.scrimmage = _root.game.endZoneL;
}
if (_root.game.scrimmage > _root.game.endZoneR) {
_root.game.scrimmage = _root.game.twentyYardLineR;
_root.game.touchBack = true;
} else {
_root.game.touchBack = false;
}
}
}
function tacklePause() {
type = "tackle";
if ((_root.game.timeOut == true) and (_root.game.tdMode == false)) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
_root.game.scrimmage = _x + fixedLineX;
checkScrimmage();
}
if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "tackle";
_root.game.safed = true;
} else if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "tackle";
_root.game.safed = true;
} else {
type = "tackle";
}
if ((_root.game.paused == false) and (_root.game.gameMode != "celebration")) {
_root.game.sound.gotoAndPlay("whistle");
}
if (((((_root.game.gameMode == "plays") and (_root.game.paused == false)) || ((_root.game.gameMode == "kickOff") and (_root.game.paused == false))) || ((_root.game.gameMode == "punt") and (_root.game.paused == false))) || (((_root.game.tdMode != false) and (_root.game.paused == false)) and (_root.game.gameMode == "plays"))) {
tackled = true;
type = "tackle";
if ((_root.game.passesNum == 0) and (_root.game.gameMode != "celebration")) {
if (_parent.ball.target.team == 1) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
if (((_x + fixedLineX) < _root.game.scrimmage) and (_root.game.downs > 0)) {
_parent.addMessage("sack");
} else {
_parent.addMessage("tackled");
}
}
if (_parent.ball.target.team == 2) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
if (((_x + fixedLineX) > _root.game.scrimmage) and (_root.game.downs > 0)) {
_parent.addMessage("sack");
} else {
_parent.addMessage("tackled");
}
}
} else if (_root.game.gameMode != "celebration") {
_parent.addMessage("tackled");
}
_root.game.pauseTime = 55;
}
}
function boundsPause() {
if (_root.game.timeOut == true) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
_root.game.scrimmage = _x + fixedLineX;
checkScrimmage();
}
if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "bounds";
_root.game.safed = true;
} else if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "bounds";
_root.game.safed = true;
} else {
type = "bounds";
}
type = "bounds";
_root.game.sound.gotoAndPlay("whistle");
tackled = true;
_parent.addMessage("outOfBounds");
_root.game.pauseTime = 55;
}
function turnedPause() {
if (_root.game.timeOut == true) {
_root.game.scrimmage = forwardProgress;
checkScrimmage();
}
type = "turn";
_root.game.sound.gotoAndPlay("whistle");
tackled = true;
_parent.addMessage("turnedAround");
_parent.addMessage("negativeProgress");
_root.game.pauseTime = 55;
}
function tackle() {
if ((_root.game.gameMode != "puntSafety") and (gameMode != "scrum")) {
if (_root.game.tdMode != false) {
if ((_root.game.timeOut == false) and (_root.game.gameMode != "celebration")) {
_root.game.startKickoff(_root.game.playersTeam);
_root.game.removeTackles();
tacked = false;
_root.game.tdMode = false;
} else if (_root.game.gameMode != "celebration") {
_root.game.removeTackles();
tacked = false;
_root.game.tdMode = false;
_root.game.gameMode = "convFail";
trace(_root.game.gameMode);
} else {
_root.game.removeTackles();
tacked = false;
}
} else if ((_root.game.downs <= 3.5) || (_root.game.goForIt == true)) {
if ((((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (type != "turn")) and (_root.game.downs > 0.5)) and (_root.game.ball.target == this)) and (_root.game.gameMode != "celebration")) {
_root.game.addMessage("Safety");
if (team != _root.game.playersTeam) {
_root.game.setupSafetyKick(_root.game.compTeam);
_root.game.hscore = _root.game.hscore + 2;
} else {
_root.game.setupSafetyKick(_root.game.playersTeam);
_root.game.gscore = _root.game.gscore + 2;
}
tackled = false;
} else if ((((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (type != "turn")) and (_root.game.downs > 0.5)) and (_root.game.ball.target == this)) and (_root.game.gameMode != "celebration")) {
_root.game.addMessage("Safety");
if (team != _root.game.playersTeam) {
_root.game.setupSafetyKick(_root.game.compTeam);
_root.game.hscore = _root.game.hscore + 2;
} else {
_root.game.setupSafetyKick(_root.game.playersTeam);
_root.game.gscore = _root.game.gscore + 2;
}
tackled = false;
} else {
_root.game.changeMode = false;
tackled = false;
if (type == "turn") {
var _local4 = forwardProgress;
} else {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
var _local4 = _x + fixedLineX;
}
_root.game.scrimmage = _local4;
if (_parent.ball.target.team != _root.game.playersTeam) {
var _local5 = random(2);
if (_local5 == 1) {
_root.game.compPlayType = "passing";
_root.game.setupLine(_root.game.compTeam, _root.game.formationShotgun, _local4, 0.5);
} else {
_root.game.compPlayType = "running";
_root.game.setupLine(_root.game.compTeam, _root.game.formationI, _local4, 0.5);
}
_root.game.setupLine(_root.game.playersTeam, _root.game.formation43, _local4, 0.5);
} else {
var _local5 = 1 + random(5);
_root.game.compPlayType = "defense";
_root.game.setupLine(_root.game.compTeam, _root.game["formationDefence" + _local5], _local4, 0.5);
_root.game.setupLine(_root.game.playersTeam, _root.game.formationShotgun, _local4, 0.5);
}
}
} else if ((_root.game.goForIt == true) and (_root.game.gameMode == "plays")) {
if (_root.game.changeMode == false) {
_root.game.downs = _root.game.downs + 1;
}
_root.game.pauseTime = 0;
_root.game.paused = false;
tackled = false;
} else if (_root.game.gameMode == "plays") {
_root.game.pauseTime = 0;
_root.game.paused = false;
if (_root.game.changeMode == false) {
_root.game.downs = _root.game.downs + 1;
}
tackled = false;
}
}
}
function checkWalls() {
if ((_y + 10) > _root.game.pitchFrontY) {
if (((yspeed > 1) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) {
checkOutOfBounds();
}
_y = (_y - 1);
yspeed = (-yspeed) * 0.5;
}
if ((_y - 5) < _root.game.pitchBackY) {
if (((yspeed < 1) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) {
checkOutOfBounds();
}
_y = (_y + 1);
yspeed = (-yspeed) * 0.5;
}
if (_root.game.walls.hitTest(xpos + (hitArea._width / 2), ypos, true) and (_x > 300)) {
_x = (_x - 2);
xspeed = (-xspeed) * 0.5;
}
if (_root.game.walls.hitTest(xpos - (hitArea._width / 2), ypos, true) and (_x < 300)) {
_x = (_x + 2);
xspeed = (-xspeed) * 0.5;
}
}
function checkCollision(b1, b2) {
var _local12 = b2._x - b1._x;
var _local11 = b2._y - b1._y;
var _local19 = Math.sqrt((_local12 * _local12) + (_local11 * _local11));
if (_local19 < (b1.rad + b2.rad)) {
if (((_parent.ball.target == this) and (b2.team != this.team)) || ((_parent.ball.target == b2) and (this.team != b2.team))) {
tacklePause();
}
if (_root.game.gameMode == "plays") {
var _local8 = 0;
if (xspeed < 0) {
_local8 = _local8 + (-xspeed);
} else {
_local8 = _local8 + xspeed;
}
if (yspeed < 0) {
_local8 = _local8 + (-yspeed);
} else {
_local8 = _local8 + yspeed;
}
if (_local8 > 1) {
hitSound.setVolume(_local8 * 15);
hitSound.start(0, 0);
hitSound.setVolume(_local8 * 15);
}
}
var _local18 = Math.atan2(_local11, _local12);
var _local7 = Math.cos(_local18);
var _local6 = Math.sin(_local18);
var _local9 = (_local7 * b1.xspeed) + (_local6 * b1.yspeed);
var _local15 = (_local7 * b1.yspeed) - (_local6 * b1.xspeed);
var _local10 = (_local7 * b2.xspeed) + (_local6 * b2.yspeed);
var _local14 = (_local7 * b2.yspeed) - (_local6 * b2.xspeed);
var _local21 = (_local9 * b1.mass) + (_local10 * b2.mass);
var _local20 = _local9 - _local10;
_local9 = (_local21 - (b2.mass * _local20)) / (b1.mass + b2.mass);
_local10 = _local20 + _local9;
b1.xspeed = ((_local7 * _local9) - (_local6 * _local15)) * 0.7;
b1.yspeed = ((_local7 * _local15) + (_local6 * _local9)) * 0.7;
b2.xspeed = ((_local7 * _local10) - (_local6 * _local14)) * 0.7;
b2.yspeed = ((_local7 * _local14) + (_local6 * _local10)) * 0.7;
var _local16 = ((b1.rad + b2.rad) - _local19) / 2;
var _local17 = _local7 * _local16;
var _local13 = _local6 * _local16;
b1._x = b1._x - (_local17 * 1.1);
b1._y = b1._y - (_local13 * 1.1);
b2._x = b2._x + (_local17 * 1.1);
b2._y = b2._y + (_local13 * 1.1);
}
}
if (_root.game.gameMode == "kickOff") {
var xspeedEq = speed;
var yspeedEq = speed;
}
if (_root.game.cleanUp == true) {
this.removeMovieClip();
}
if ((_root.game.gameMode == "scrum") || (_root.game.gameMode == "kickOff")) {
forwardProgress = 0;
progressTimer = 0;
}
if (team == _root.game.playersTeam) {
if (_root.game.playType == "running") {
if (_root.game.playersTeam == 1) {
if ((((_name == "player7") || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else if ((((_name == "player18") || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else {
mass = 2;
}
}
if (team == _root.game.compTeam) {
if (_root.game.compPlayType == "running") {
if (_root.game.compTeam == 1) {
if ((((_name == "player7") || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else if ((((_name == "player18") || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else {
mass = 2;
}
}
if ((((((_name == "player22") and (parseInt(_root.game.ball.storedOwner.team) == 2)) and (_root.game.gameMode != "plays")) and (_root.game.gameMode != "celebration")) and (_root.game.paused == false)) || (((((_name == "player11") and (parseInt(_root.game.ball.storedOwner.team) == 1)) and (_root.game.gameMode != "plays")) and (_root.game.gameMode != "celebration")) and (_root.game.paused == false))) {
if (_currentframe == 1) {
gotoAndStop (3);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(10);
}
} else if (_currentframe == 2) {
gotoAndStop (4);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(10);
}
}
} else if (((((_name == "player22") and (_root.game.gameMode != "plays")) and (_root.game.paused == false)) and (_root.game.gameMode != "celebration")) and (_root.game.gameMode != "shot")) {
gotoAndStop(_root.game.player21._currentframe);
} else if (((((_name == "player11") and (_root.game.gameMode != "plays")) and (_root.game.paused == false)) and (_root.game.gameMode != "celebration")) and (_root.game.gameMode != "shot")) {
gotoAndStop(_root.game.player10._currentframe);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(_root.game.player10.ani._currentframe);
}
}
if ((tackled == true) and (_root.game.paused == false)) {
tackle();
}
if (_root.game.paused == false) {
if (_parent.ball.target != this) {
arrow.gotoAndStop(1);
var arrowPlayed = false;
heldTime = 0;
} else {
if ((_parent.passesNum == 1) || (_root.game.downs == 0)) {
if (team == 1) {
if ((((xspeed < 0) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) and (_root.game.messageList.length == 0)) {
if ((_root.game.tdMode == false) || ((_root.game.tdMode != false) and (_parent.passesNum > 0))) {
progressTimer = progressTimer + 1;
if ((forwardProgress == 0) || (forwardProgress < (_x + fixedLineX))) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
forwardProgress = _x + fixedLineX;
}
if (progressTimer > 50) {
turnedPause();
progressTimer = 0;
}
} else {
progressTimer = 0;
}
}
} else if ((((xspeed > 0) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) and (_root.game.messageList.length == 0)) {
if ((_root.game.tdMode == false) || ((_root.game.tdMode != false) and (_parent.passesNum > 0))) {
progressTimer = progressTimer + 1;
if ((forwardProgress == 0) || (forwardProgress > (_x + fixedLineX))) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
forwardProgress = _x + fixedLineX;
}
if (progressTimer > 50) {
turnedPause();
progressTimer = 0;
}
} else {
progressTimer = 0;
}
}
}
if ((((team == 1) and (_root.game.gameMode == "plays")) and (team != _root.game.playersTeam)) || (((team == 1) and (_root.game.gameMode == "plays")) and (_root.game.demoMode == true))) {
heldTime = heldTime + 1;
var playerAmount = 12;
i = 1;
while (i < playerAmount) {
var target = _root.game["player" + i];
var randFactor = random(3);
if (((((((((target._x > (_x + 40)) and (_parent.passesNum == 0)) and (heldTime > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed > (1.5 * _root.game.vibrationVal))) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || ((((_parent.nzone.hitTest(target.xpos, target.ypos, true) and (target._x > _x)) and (_parent.passesNum == 0)) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing"))) || ((((((((target._x > (_x + 40)) and (_parent.passesNum == 0)) and (heldTime > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed > 1.5)) and (_root.game.downs > 0)) and (_root.game.playType == "passing")) and (_root.game.demoMode == true))) {
_parent.passesNum = _parent.passesNum + 1;
_parent.ball.target = "";
_parent.ball.targetX = _root.game["player" + i]._x + (_root.game["player" + i].xspeed * (8 + random(15)));
_parent.ball.targetY = (_root.game["player" + i]._y - 10) + (_root.game["player" + i].yspeed * (8 + random(15)));
var dx = (_parent.ball.targetX - _parent.ball._x);
var dy = (_parent.ball.targetY - _parent.ball._y);
var dist = Math.sqrt((dx * dx) + (dy * dy));
_parent.ball.xspeed = dx / (dist / 10);
_parent.ball.yspeed = dy / (dist / 10);
_parent.ball.zspeed = -(dist / 20);
_parent.ball.zpos = 4;
}
i = i + 1;
}
} else {
heldTime = 0;
}
if ((((team == 2) and (_root.game.gameMode == "plays")) and (team != _root.game.playersTeam)) || (((team == 2) and (_root.game.gameMode == "plays")) and (_root.game.demoMode == true))) {
heldTime2 = heldTime2 + 1;
var playerAmount = 23;
i = 12;
while (i < playerAmount) {
var target = _root.game["player" + i];
var randFactor = random(3);
if ((((((((target._x < (_x - 40)) and (_parent.passesNum == 0)) and (heldTime2 > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed < (-1.5 * _root.game.vibrationVal))) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || ((((_parent.nzone.hitTest(target.xpos, target.ypos, true) and (target._x < _x)) and (_parent.passesNum == 0)) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing"))) {
_parent.passesNum = _parent.passesNum + 1;
_parent.ball.target = "";
_parent.ball.targetX = _root.game["player" + i]._x + (_root.game["player" + i].xspeed * (8 + random(15)));
_parent.ball.targetY = (_root.game["player" + i]._y - 10) + (_root.game["player" + i].yspeed * (8 + random(15)));
var dx = (_parent.ball.targetX - _parent.ball._x);
var dy = (_parent.ball.targetY - _parent.ball._y);
var dist = Math.sqrt((dx * dx) + (dy * dy));
_parent.ball.xspeed = dx / (dist / 10);
_parent.ball.yspeed = dy / (dist / 10);
_parent.ball.zspeed = -(dist / 20);
_parent.ball.zpos = 4;
}
i = i + 1;
}
} else {
heldTime2 = 0;
}
if (arrowPlayed == false) {
arrow.play();
var arrowPlayed = true;
}
}
if ((_root.game.gameMode == "plays") and (_parent.ball.target == "")) {
if ((((((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player22")) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player11"))) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player4"))) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player16"))) {
} else {
var catchRad = (rad * 2.5);
var zcatch = 4;
}
if (_root.game.ball.target == "") {
if ((_root.game.ball._x < (_x + 50)) and (_root.game.ball._x > (_x - 50))) {
if ((((_root.game.lastGameMode == "kickOff") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player22")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "kickOff") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player11")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "punt") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player15")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "punt") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player4")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "puntSafety") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player15")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "puntSafety") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player4")) {
_root.game.ball.target = this;
}
}
if ((_root.game.ball._x < (_x + 20)) and (_root.game.ball._x > (_x - 20))) {
var dx = (_parent.ball._x - _x);
var dy = (_parent.ball._y - (_y - 10));
var dist = Math.sqrt((dx * dx) + (dy * dy));
if (((dist < catchRad) and (_parent.ball.zpos < zcatch)) and (_root.game.ball.bounce < 1)) {
if ((_parent.ball.storedOwner.team != team) and (_parent.ball.storedOwner.team > 0)) {
if (_root.game.tdMode != false) {
tacklePause();
} else {
_parent.scoreboard.bigscreen.ani.gotoAndPlay("intercept");
_root.game.downs = 0;
intercepted = true;
_root.game.intercepted = true;
}
}
_parent.ball.target = this;
arrow.play();
}
var dx = ((_parent.ball._x + _root.game.ball.xspeed) - _x);
var dy = ((_parent.ball._y + _root.game.ball.yspeed) - (_y - 10));
var dist = Math.sqrt((dx * dx) + (dy * dy));
if (((dist < catchRad) and (_parent.ball.zpos < zcatch)) and (_root.game.ball.bounce < 1)) {
if ((_parent.ball.storedOwner.team != team) and (_parent.ball.storedOwner.team > 0)) {
if (_root.game.tdMode != false) {
tacklePause();
} else {
_parent.scoreboard.bigscreen.ani.gotoAndPlay("intercept");
_root.game.downs = 0;
intercepted = true;
_root.game.intercepted = true;
}
}
_parent.ball.target = this;
arrow.play();
}
}
}
}
xpos = _x + _root.game._x;
ypos = _y + _root.game._y;
speed = 0.12 * _root.game.vibrationVal;
currentY = _y - _root.game.pitchBackY;
posY = currentY / _root.game.pitchFrontY;
percent = _root.game.pitchDepth / _root.game.horizon;
depthScale = (1 - percent) + (posY * percent);
if (intercepted == true) {
speedDone = false;
intercepted = false;
}
if ((_root.game.vibrate == true) and (_root.game.paused == false)) {
rotTimer = 1 + random(20 * _root.game.vibrationVal);
if (rotTimer == 1) {
rotInc = (-30 + random(60)) / 140;
}
rotVel = rotVel + rotInc;
if (((_root.game.gameMode == "plays") and (speedDone == false)) || (_root.game.mouseIsDown == true)) {
if (_root.game.lastGameMode != "kickOff") {
speedDone = true;
if (_root.game.ball.target != this) {
if (((_root.game.playType == "running") and (team == _root.game.playersTeam)) || ((_root.game.compPlayType == "running") and (team == _root.game.compTeam))) {
if ((((((((((_name == "player22") || (_name == "player18")) || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) || (_name == "player11")) || (_name == "player7")) || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
var xspeedEq = (speed * 1.5);
var yspeedEq = (speed * 1.5);
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else if (((_root.game.playType == "defense") and (team == _root.game.playersTeam)) || ((_root.game.compPlayType == "defense") and (team == _root.game.compTeam))) {
if ((_root.downs >= 1) and (_root.game.blitz == false)) {
if ((((_name == "player8") || (_name == "player9")) || (_name == "player19")) || (_name == "player20")) {
var xspeedEq = (-(speed / 3));
var yspeedEq = (-(speed / 3));
} else if ((((_name == "player10") || (_name == "player11")) || (_name == "player21")) || (_name == "player22")) {
var xspeedEq = (-(speed / 5));
var yspeedEq = (-(speed / 5));
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else if (((((_root.game.passesNum == 0) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || (((_root.game.passesNum == 0) and (_root.game.downs > 0)) and (_root.game.playType == "passing"))) || (((_root.game.passesNum == 0) and (_root.game.tdMode != false)) and (_root.game.playType == "passing"))) {
var xspeedEq = (-(speed / 6));
var yspeedEq = (-(speed / 6));
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
}
}
if ((_root.game.gameMode != "plays") || (_root.game.paused == true)) {
speedDone = false;
}
if (((_root.game.gameMode == "plays") || (_root.game.gameMode == "celebration")) || (_root.game.gameMode == "shot")) {
xspeed = xspeed + (Math.cos((rot - 180) * (Math.PI/180)) * xspeedEq);
yspeed = yspeed + (Math.sin((rot - 180) * (Math.PI/180)) * yspeedEq);
}
if (collisionTimer < 1) {
collisionTimer = collisionTimer + 1;
} else {
collisionTimer = 0;
}
if (((_root.game.vibrate == true) and (_root.game.paused == false)) || (_root.game.mouseIsDown == true)) {
if ((collisionTimer == 0) and (team == 1)) {
i = 0;
while (i < (_root.game.playerNum + 1)) {
var target = _root.game["player" + i];
if (_name != ("player" + i)) {
checkCollision(this, target);
}
i = i + 1;
}
checkWalls();
}
if ((collisionTimer == 1) and (team == 2)) {
i = 12;
while (i < (_root.game.playerNum + 1)) {
var target = _root.game["player" + i];
if (_name != ("player" + i)) {
checkCollision(this, target);
}
i = i + 1;
}
checkWalls();
}
}
if (_root.game.gameMode == "puntSafety") {
checkWalls();
}
xspeed = xspeed * 0.97;
yspeed = yspeed * 0.97;
rotVel = rotVel * 0.97;
this.swapDepths(_y + (_x / 5));
if ((_name == "player22") and (_root.game.playType == "running")) {
} else {
var aniFrames = ani._totalframes;
rotStored = rotStored + rotVel;
if (rotStored > (360 / aniFrames)) {
if (ani._currentframe < aniFrames) {
ani.nextFrame();
} else {
ani.gotoAndStop(1);
}
rotStored = rotStored - (360 / aniFrames);
}
if (rotStored < (-(360 / aniFrames))) {
if (ani._currentframe > 1) {
ani.prevFrame();
} else {
ani.gotoAndStop(aniFrames);
}
rotStored = rotStored + (360 / aniFrames);
}
rot = rot + rotVel;
_xscale = (depthScale * 110);
_yscale = _xscale;
}
if (((_root.game.gameMode == "plays") || (_root.game.gameMode == "celebration")) || (_root.game.gameMode == "shot")) {
_x = (_x + (xspeed * depthScale));
_y = (_y + (yspeed * depthScale));
}
}
}
Instance of Symbol 198 MovieClip "player14" in Symbol 494 MovieClip Frame 2
onClipEvent (load) {
hitSound = new Sound(this);
hitSound.attachSound("hitSound");
xspeed = 0;
yspeed = 0;
speed = 0.1 * _root.game.vibrationVal;
currentY = _y - _root.game.pitchBackY;
posY = currentY / _root.game.pitchFrontY;
percent = _root.game.pitchDepth / _root.game.horizon;
depthScale = (1 - percent) + (posY * percent);
rotVel = 0;
rotInc = 0;
rotTimer = random(20);
_rotation = 0;
xpos = _x + _root.game._x;
ypos = _y + _root.game._y;
_root.game.playerNum = _root.game.playerNum + 1;
mass = 2;
rad = hitArea._width / 2.3;
team = 0;
if (parseInt(substring(_name, 7, 2)) < 12) {
team = 1;
rot = 180;
origRot = rot;
if ((_name == "player22") || (_name == "player11")) {
gotoAndStop (4);
} else {
gotoAndStop (2);
}
ani.gotoAndStop(10);
} else {
team = 2;
rot = 0;
origRot = rot;
if ((_name == "player22") || (_name == "player11")) {
gotoAndStop (3);
} else {
gotoAndStop (1);
}
ani.gotoAndStop(1);
}
if (team == 2) {
trace(((("new Array(" + Math.round(_x)) + ",") + Math.round(_y)) + "),");
}
rotStored = 0;
heldTime = 0;
heldTime2 = 0;
tackled = false;
forwardProgress = 0;
progressTimer = 0;
type = "";
fixedLineX = 0;
speedDone = false;
var xspeedEq = speed;
var yspeedEq = speed;
storedVar = "";
collisionTimer = 0;
intercepted = false;
}
onClipEvent (enterFrame) {
function checkOutOfBounds() {
if (_root.game.ball.target == this) {
boundsPause();
if ((ani._currentframe < 6) || (ani._currentframe > 14)) {
if (team == 1) {
}
} else if ((ani._currentframe > 6) and (ani._currentframe < 14)) {
if (team == 2) {
}
}
}
}
function checkScrimmage() {
if (team == 1) {
if (_root.game.scrimmage < _root.game.endZoneL) {
_root.game.scrimmage = _root.game.twentyYardLineL;
_root.game.touchBack = true;
} else {
_root.game.touchBack = false;
}
if (_root.game.scrimmage > _root.game.endZoneR) {
_root.game.scrimmage = _root.game.endZoneR;
}
} else {
if (_root.game.scrimmage < _root.game.endZoneL) {
_root.game.scrimmage = _root.game.endZoneL;
}
if (_root.game.scrimmage > _root.game.endZoneR) {
_root.game.scrimmage = _root.game.twentyYardLineR;
_root.game.touchBack = true;
} else {
_root.game.touchBack = false;
}
}
}
function tacklePause() {
type = "tackle";
if ((_root.game.timeOut == true) and (_root.game.tdMode == false)) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
_root.game.scrimmage = _x + fixedLineX;
checkScrimmage();
}
if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "tackle";
_root.game.safed = true;
} else if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "tackle";
_root.game.safed = true;
} else {
type = "tackle";
}
if ((_root.game.paused == false) and (_root.game.gameMode != "celebration")) {
_root.game.sound.gotoAndPlay("whistle");
}
if (((((_root.game.gameMode == "plays") and (_root.game.paused == false)) || ((_root.game.gameMode == "kickOff") and (_root.game.paused == false))) || ((_root.game.gameMode == "punt") and (_root.game.paused == false))) || (((_root.game.tdMode != false) and (_root.game.paused == false)) and (_root.game.gameMode == "plays"))) {
tackled = true;
type = "tackle";
if ((_root.game.passesNum == 0) and (_root.game.gameMode != "celebration")) {
if (_parent.ball.target.team == 1) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
if (((_x + fixedLineX) < _root.game.scrimmage) and (_root.game.downs > 0)) {
_parent.addMessage("sack");
} else {
_parent.addMessage("tackled");
}
}
if (_parent.ball.target.team == 2) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
if (((_x + fixedLineX) > _root.game.scrimmage) and (_root.game.downs > 0)) {
_parent.addMessage("sack");
} else {
_parent.addMessage("tackled");
}
}
} else if (_root.game.gameMode != "celebration") {
_parent.addMessage("tackled");
}
_root.game.pauseTime = 55;
}
}
function boundsPause() {
if (_root.game.timeOut == true) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
_root.game.scrimmage = _x + fixedLineX;
checkScrimmage();
}
if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "bounds";
_root.game.safed = true;
} else if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "bounds";
_root.game.safed = true;
} else {
type = "bounds";
}
type = "bounds";
_root.game.sound.gotoAndPlay("whistle");
tackled = true;
_parent.addMessage("outOfBounds");
_root.game.pauseTime = 55;
}
function turnedPause() {
if (_root.game.timeOut == true) {
_root.game.scrimmage = forwardProgress;
checkScrimmage();
}
type = "turn";
_root.game.sound.gotoAndPlay("whistle");
tackled = true;
_parent.addMessage("turnedAround");
_parent.addMessage("negativeProgress");
_root.game.pauseTime = 55;
}
function tackle() {
if ((_root.game.gameMode != "puntSafety") and (gameMode != "scrum")) {
if (_root.game.tdMode != false) {
if ((_root.game.timeOut == false) and (_root.game.gameMode != "celebration")) {
_root.game.startKickoff(_root.game.playersTeam);
_root.game.removeTackles();
tacked = false;
_root.game.tdMode = false;
} else if (_root.game.gameMode != "celebration") {
_root.game.removeTackles();
tacked = false;
_root.game.tdMode = false;
_root.game.gameMode = "convFail";
trace(_root.game.gameMode);
} else {
_root.game.removeTackles();
tacked = false;
}
} else if ((_root.game.downs <= 3.5) || (_root.game.goForIt == true)) {
if ((((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (type != "turn")) and (_root.game.downs > 0.5)) and (_root.game.ball.target == this)) and (_root.game.gameMode != "celebration")) {
_root.game.addMessage("Safety");
if (team != _root.game.playersTeam) {
_root.game.setupSafetyKick(_root.game.compTeam);
_root.game.hscore = _root.game.hscore + 2;
} else {
_root.game.setupSafetyKick(_root.game.playersTeam);
_root.game.gscore = _root.game.gscore + 2;
}
tackled = false;
} else if ((((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (type != "turn")) and (_root.game.downs > 0.5)) and (_root.game.ball.target == this)) and (_root.game.gameMode != "celebration")) {
_root.game.addMessage("Safety");
if (team != _root.game.playersTeam) {
_root.game.setupSafetyKick(_root.game.compTeam);
_root.game.hscore = _root.game.hscore + 2;
} else {
_root.game.setupSafetyKick(_root.game.playersTeam);
_root.game.gscore = _root.game.gscore + 2;
}
tackled = false;
} else {
_root.game.changeMode = false;
tackled = false;
if (type == "turn") {
var _local4 = forwardProgress;
} else {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
var _local4 = _x + fixedLineX;
}
_root.game.scrimmage = _local4;
if (_parent.ball.target.team != _root.game.playersTeam) {
var _local5 = random(2);
if (_local5 == 1) {
_root.game.compPlayType = "passing";
_root.game.setupLine(_root.game.compTeam, _root.game.formationShotgun, _local4, 0.5);
} else {
_root.game.compPlayType = "running";
_root.game.setupLine(_root.game.compTeam, _root.game.formationI, _local4, 0.5);
}
_root.game.setupLine(_root.game.playersTeam, _root.game.formation43, _local4, 0.5);
} else {
var _local5 = 1 + random(5);
_root.game.compPlayType = "defense";
_root.game.setupLine(_root.game.compTeam, _root.game["formationDefence" + _local5], _local4, 0.5);
_root.game.setupLine(_root.game.playersTeam, _root.game.formationShotgun, _local4, 0.5);
}
}
} else if ((_root.game.goForIt == true) and (_root.game.gameMode == "plays")) {
if (_root.game.changeMode == false) {
_root.game.downs = _root.game.downs + 1;
}
_root.game.pauseTime = 0;
_root.game.paused = false;
tackled = false;
} else if (_root.game.gameMode == "plays") {
_root.game.pauseTime = 0;
_root.game.paused = false;
if (_root.game.changeMode == false) {
_root.game.downs = _root.game.downs + 1;
}
tackled = false;
}
}
}
function checkWalls() {
if ((_y + 10) > _root.game.pitchFrontY) {
if (((yspeed > 1) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) {
checkOutOfBounds();
}
_y = (_y - 1);
yspeed = (-yspeed) * 0.5;
}
if ((_y - 5) < _root.game.pitchBackY) {
if (((yspeed < 1) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) {
checkOutOfBounds();
}
_y = (_y + 1);
yspeed = (-yspeed) * 0.5;
}
if (_root.game.walls.hitTest(xpos + (hitArea._width / 2), ypos, true) and (_x > 300)) {
_x = (_x - 2);
xspeed = (-xspeed) * 0.5;
}
if (_root.game.walls.hitTest(xpos - (hitArea._width / 2), ypos, true) and (_x < 300)) {
_x = (_x + 2);
xspeed = (-xspeed) * 0.5;
}
}
function checkCollision(b1, b2) {
var _local12 = b2._x - b1._x;
var _local11 = b2._y - b1._y;
var _local19 = Math.sqrt((_local12 * _local12) + (_local11 * _local11));
if (_local19 < (b1.rad + b2.rad)) {
if (((_parent.ball.target == this) and (b2.team != this.team)) || ((_parent.ball.target == b2) and (this.team != b2.team))) {
tacklePause();
}
if (_root.game.gameMode == "plays") {
var _local8 = 0;
if (xspeed < 0) {
_local8 = _local8 + (-xspeed);
} else {
_local8 = _local8 + xspeed;
}
if (yspeed < 0) {
_local8 = _local8 + (-yspeed);
} else {
_local8 = _local8 + yspeed;
}
if (_local8 > 1) {
hitSound.setVolume(_local8 * 15);
hitSound.start(0, 0);
hitSound.setVolume(_local8 * 15);
}
}
var _local18 = Math.atan2(_local11, _local12);
var _local7 = Math.cos(_local18);
var _local6 = Math.sin(_local18);
var _local9 = (_local7 * b1.xspeed) + (_local6 * b1.yspeed);
var _local15 = (_local7 * b1.yspeed) - (_local6 * b1.xspeed);
var _local10 = (_local7 * b2.xspeed) + (_local6 * b2.yspeed);
var _local14 = (_local7 * b2.yspeed) - (_local6 * b2.xspeed);
var _local21 = (_local9 * b1.mass) + (_local10 * b2.mass);
var _local20 = _local9 - _local10;
_local9 = (_local21 - (b2.mass * _local20)) / (b1.mass + b2.mass);
_local10 = _local20 + _local9;
b1.xspeed = ((_local7 * _local9) - (_local6 * _local15)) * 0.7;
b1.yspeed = ((_local7 * _local15) + (_local6 * _local9)) * 0.7;
b2.xspeed = ((_local7 * _local10) - (_local6 * _local14)) * 0.7;
b2.yspeed = ((_local7 * _local14) + (_local6 * _local10)) * 0.7;
var _local16 = ((b1.rad + b2.rad) - _local19) / 2;
var _local17 = _local7 * _local16;
var _local13 = _local6 * _local16;
b1._x = b1._x - (_local17 * 1.1);
b1._y = b1._y - (_local13 * 1.1);
b2._x = b2._x + (_local17 * 1.1);
b2._y = b2._y + (_local13 * 1.1);
}
}
if (_root.game.gameMode == "kickOff") {
var xspeedEq = speed;
var yspeedEq = speed;
}
if (_root.game.cleanUp == true) {
this.removeMovieClip();
}
if ((_root.game.gameMode == "scrum") || (_root.game.gameMode == "kickOff")) {
forwardProgress = 0;
progressTimer = 0;
}
if (team == _root.game.playersTeam) {
if (_root.game.playType == "running") {
if (_root.game.playersTeam == 1) {
if ((((_name == "player7") || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else if ((((_name == "player18") || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else {
mass = 2;
}
}
if (team == _root.game.compTeam) {
if (_root.game.compPlayType == "running") {
if (_root.game.compTeam == 1) {
if ((((_name == "player7") || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else if ((((_name == "player18") || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else {
mass = 2;
}
}
if ((((((_name == "player22") and (parseInt(_root.game.ball.storedOwner.team) == 2)) and (_root.game.gameMode != "plays")) and (_root.game.gameMode != "celebration")) and (_root.game.paused == false)) || (((((_name == "player11") and (parseInt(_root.game.ball.storedOwner.team) == 1)) and (_root.game.gameMode != "plays")) and (_root.game.gameMode != "celebration")) and (_root.game.paused == false))) {
if (_currentframe == 1) {
gotoAndStop (3);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(10);
}
} else if (_currentframe == 2) {
gotoAndStop (4);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(10);
}
}
} else if (((((_name == "player22") and (_root.game.gameMode != "plays")) and (_root.game.paused == false)) and (_root.game.gameMode != "celebration")) and (_root.game.gameMode != "shot")) {
gotoAndStop(_root.game.player21._currentframe);
} else if (((((_name == "player11") and (_root.game.gameMode != "plays")) and (_root.game.paused == false)) and (_root.game.gameMode != "celebration")) and (_root.game.gameMode != "shot")) {
gotoAndStop(_root.game.player10._currentframe);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(_root.game.player10.ani._currentframe);
}
}
if ((tackled == true) and (_root.game.paused == false)) {
tackle();
}
if (_root.game.paused == false) {
if (_parent.ball.target != this) {
arrow.gotoAndStop(1);
var arrowPlayed = false;
heldTime = 0;
} else {
if ((_parent.passesNum == 1) || (_root.game.downs == 0)) {
if (team == 1) {
if ((((xspeed < 0) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) and (_root.game.messageList.length == 0)) {
if ((_root.game.tdMode == false) || ((_root.game.tdMode != false) and (_parent.passesNum > 0))) {
progressTimer = progressTimer + 1;
if ((forwardProgress == 0) || (forwardProgress < (_x + fixedLineX))) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
forwardProgress = _x + fixedLineX;
}
if (progressTimer > 50) {
turnedPause();
progressTimer = 0;
}
} else {
progressTimer = 0;
}
}
} else if ((((xspeed > 0) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) and (_root.game.messageList.length == 0)) {
if ((_root.game.tdMode == false) || ((_root.game.tdMode != false) and (_parent.passesNum > 0))) {
progressTimer = progressTimer + 1;
if ((forwardProgress == 0) || (forwardProgress > (_x + fixedLineX))) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
forwardProgress = _x + fixedLineX;
}
if (progressTimer > 50) {
turnedPause();
progressTimer = 0;
}
} else {
progressTimer = 0;
}
}
}
if ((((team == 1) and (_root.game.gameMode == "plays")) and (team != _root.game.playersTeam)) || (((team == 1) and (_root.game.gameMode == "plays")) and (_root.game.demoMode == true))) {
heldTime = heldTime + 1;
var playerAmount = 12;
i = 1;
while (i < playerAmount) {
var target = _root.game["player" + i];
var randFactor = random(3);
if (((((((((target._x > (_x + 40)) and (_parent.passesNum == 0)) and (heldTime > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed > (1.5 * _root.game.vibrationVal))) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || ((((_parent.nzone.hitTest(target.xpos, target.ypos, true) and (target._x > _x)) and (_parent.passesNum == 0)) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing"))) || ((((((((target._x > (_x + 40)) and (_parent.passesNum == 0)) and (heldTime > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed > 1.5)) and (_root.game.downs > 0)) and (_root.game.playType == "passing")) and (_root.game.demoMode == true))) {
_parent.passesNum = _parent.passesNum + 1;
_parent.ball.target = "";
_parent.ball.targetX = _root.game["player" + i]._x + (_root.game["player" + i].xspeed * (8 + random(15)));
_parent.ball.targetY = (_root.game["player" + i]._y - 10) + (_root.game["player" + i].yspeed * (8 + random(15)));
var dx = (_parent.ball.targetX - _parent.ball._x);
var dy = (_parent.ball.targetY - _parent.ball._y);
var dist = Math.sqrt((dx * dx) + (dy * dy));
_parent.ball.xspeed = dx / (dist / 10);
_parent.ball.yspeed = dy / (dist / 10);
_parent.ball.zspeed = -(dist / 20);
_parent.ball.zpos = 4;
}
i = i + 1;
}
} else {
heldTime = 0;
}
if ((((team == 2) and (_root.game.gameMode == "plays")) and (team != _root.game.playersTeam)) || (((team == 2) and (_root.game.gameMode == "plays")) and (_root.game.demoMode == true))) {
heldTime2 = heldTime2 + 1;
var playerAmount = 23;
i = 12;
while (i < playerAmount) {
var target = _root.game["player" + i];
var randFactor = random(3);
if ((((((((target._x < (_x - 40)) and (_parent.passesNum == 0)) and (heldTime2 > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed < (-1.5 * _root.game.vibrationVal))) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || ((((_parent.nzone.hitTest(target.xpos, target.ypos, true) and (target._x < _x)) and (_parent.passesNum == 0)) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing"))) {
_parent.passesNum = _parent.passesNum + 1;
_parent.ball.target = "";
_parent.ball.targetX = _root.game["player" + i]._x + (_root.game["player" + i].xspeed * (8 + random(15)));
_parent.ball.targetY = (_root.game["player" + i]._y - 10) + (_root.game["player" + i].yspeed * (8 + random(15)));
var dx = (_parent.ball.targetX - _parent.ball._x);
var dy = (_parent.ball.targetY - _parent.ball._y);
var dist = Math.sqrt((dx * dx) + (dy * dy));
_parent.ball.xspeed = dx / (dist / 10);
_parent.ball.yspeed = dy / (dist / 10);
_parent.ball.zspeed = -(dist / 20);
_parent.ball.zpos = 4;
}
i = i + 1;
}
} else {
heldTime2 = 0;
}
if (arrowPlayed == false) {
arrow.play();
var arrowPlayed = true;
}
}
if ((_root.game.gameMode == "plays") and (_parent.ball.target == "")) {
if ((((((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player22")) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player11"))) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player4"))) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player16"))) {
} else {
var catchRad = (rad * 2.5);
var zcatch = 4;
}
if (_root.game.ball.target == "") {
if ((_root.game.ball._x < (_x + 50)) and (_root.game.ball._x > (_x - 50))) {
if ((((_root.game.lastGameMode == "kickOff") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player22")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "kickOff") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player11")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "punt") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player15")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "punt") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player4")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "puntSafety") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player15")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "puntSafety") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player4")) {
_root.game.ball.target = this;
}
}
if ((_root.game.ball._x < (_x + 20)) and (_root.game.ball._x > (_x - 20))) {
var dx = (_parent.ball._x - _x);
var dy = (_parent.ball._y - (_y - 10));
var dist = Math.sqrt((dx * dx) + (dy * dy));
if (((dist < catchRad) and (_parent.ball.zpos < zcatch)) and (_root.game.ball.bounce < 1)) {
if ((_parent.ball.storedOwner.team != team) and (_parent.ball.storedOwner.team > 0)) {
if (_root.game.tdMode != false) {
tacklePause();
} else {
_parent.scoreboard.bigscreen.ani.gotoAndPlay("intercept");
_root.game.downs = 0;
intercepted = true;
_root.game.intercepted = true;
}
}
_parent.ball.target = this;
arrow.play();
}
var dx = ((_parent.ball._x + _root.game.ball.xspeed) - _x);
var dy = ((_parent.ball._y + _root.game.ball.yspeed) - (_y - 10));
var dist = Math.sqrt((dx * dx) + (dy * dy));
if (((dist < catchRad) and (_parent.ball.zpos < zcatch)) and (_root.game.ball.bounce < 1)) {
if ((_parent.ball.storedOwner.team != team) and (_parent.ball.storedOwner.team > 0)) {
if (_root.game.tdMode != false) {
tacklePause();
} else {
_parent.scoreboard.bigscreen.ani.gotoAndPlay("intercept");
_root.game.downs = 0;
intercepted = true;
_root.game.intercepted = true;
}
}
_parent.ball.target = this;
arrow.play();
}
}
}
}
xpos = _x + _root.game._x;
ypos = _y + _root.game._y;
speed = 0.12 * _root.game.vibrationVal;
currentY = _y - _root.game.pitchBackY;
posY = currentY / _root.game.pitchFrontY;
percent = _root.game.pitchDepth / _root.game.horizon;
depthScale = (1 - percent) + (posY * percent);
if (intercepted == true) {
speedDone = false;
intercepted = false;
}
if ((_root.game.vibrate == true) and (_root.game.paused == false)) {
rotTimer = 1 + random(20 * _root.game.vibrationVal);
if (rotTimer == 1) {
rotInc = (-30 + random(60)) / 140;
}
rotVel = rotVel + rotInc;
if (((_root.game.gameMode == "plays") and (speedDone == false)) || (_root.game.mouseIsDown == true)) {
if (_root.game.lastGameMode != "kickOff") {
speedDone = true;
if (_root.game.ball.target != this) {
if (((_root.game.playType == "running") and (team == _root.game.playersTeam)) || ((_root.game.compPlayType == "running") and (team == _root.game.compTeam))) {
if ((((((((((_name == "player22") || (_name == "player18")) || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) || (_name == "player11")) || (_name == "player7")) || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
var xspeedEq = (speed * 1.5);
var yspeedEq = (speed * 1.5);
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else if (((_root.game.playType == "defense") and (team == _root.game.playersTeam)) || ((_root.game.compPlayType == "defense") and (team == _root.game.compTeam))) {
if ((_root.downs >= 1) and (_root.game.blitz == false)) {
if ((((_name == "player8") || (_name == "player9")) || (_name == "player19")) || (_name == "player20")) {
var xspeedEq = (-(speed / 3));
var yspeedEq = (-(speed / 3));
} else if ((((_name == "player10") || (_name == "player11")) || (_name == "player21")) || (_name == "player22")) {
var xspeedEq = (-(speed / 5));
var yspeedEq = (-(speed / 5));
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else if (((((_root.game.passesNum == 0) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || (((_root.game.passesNum == 0) and (_root.game.downs > 0)) and (_root.game.playType == "passing"))) || (((_root.game.passesNum == 0) and (_root.game.tdMode != false)) and (_root.game.playType == "passing"))) {
var xspeedEq = (-(speed / 6));
var yspeedEq = (-(speed / 6));
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
}
}
if ((_root.game.gameMode != "plays") || (_root.game.paused == true)) {
speedDone = false;
}
if (((_root.game.gameMode == "plays") || (_root.game.gameMode == "celebration")) || (_root.game.gameMode == "shot")) {
xspeed = xspeed + (Math.cos((rot - 180) * (Math.PI/180)) * xspeedEq);
yspeed = yspeed + (Math.sin((rot - 180) * (Math.PI/180)) * yspeedEq);
}
if (collisionTimer < 1) {
collisionTimer = collisionTimer + 1;
} else {
collisionTimer = 0;
}
if (((_root.game.vibrate == true) and (_root.game.paused == false)) || (_root.game.mouseIsDown == true)) {
if ((collisionTimer == 0) and (team == 1)) {
i = 0;
while (i < (_root.game.playerNum + 1)) {
var target = _root.game["player" + i];
if (_name != ("player" + i)) {
checkCollision(this, target);
}
i = i + 1;
}
checkWalls();
}
if ((collisionTimer == 1) and (team == 2)) {
i = 12;
while (i < (_root.game.playerNum + 1)) {
var target = _root.game["player" + i];
if (_name != ("player" + i)) {
checkCollision(this, target);
}
i = i + 1;
}
checkWalls();
}
}
if (_root.game.gameMode == "puntSafety") {
checkWalls();
}
xspeed = xspeed * 0.97;
yspeed = yspeed * 0.97;
rotVel = rotVel * 0.97;
this.swapDepths(_y + (_x / 5));
if ((_name == "player22") and (_root.game.playType == "running")) {
} else {
var aniFrames = ani._totalframes;
rotStored = rotStored + rotVel;
if (rotStored > (360 / aniFrames)) {
if (ani._currentframe < aniFrames) {
ani.nextFrame();
} else {
ani.gotoAndStop(1);
}
rotStored = rotStored - (360 / aniFrames);
}
if (rotStored < (-(360 / aniFrames))) {
if (ani._currentframe > 1) {
ani.prevFrame();
} else {
ani.gotoAndStop(aniFrames);
}
rotStored = rotStored + (360 / aniFrames);
}
rot = rot + rotVel;
_xscale = (depthScale * 110);
_yscale = _xscale;
}
if (((_root.game.gameMode == "plays") || (_root.game.gameMode == "celebration")) || (_root.game.gameMode == "shot")) {
_x = (_x + (xspeed * depthScale));
_y = (_y + (yspeed * depthScale));
}
}
}
Instance of Symbol 198 MovieClip "player19" in Symbol 494 MovieClip Frame 2
onClipEvent (load) {
hitSound = new Sound(this);
hitSound.attachSound("hitSound");
xspeed = 0;
yspeed = 0;
speed = 0.1 * _root.game.vibrationVal;
currentY = _y - _root.game.pitchBackY;
posY = currentY / _root.game.pitchFrontY;
percent = _root.game.pitchDepth / _root.game.horizon;
depthScale = (1 - percent) + (posY * percent);
rotVel = 0;
rotInc = 0;
rotTimer = random(20);
_rotation = 0;
xpos = _x + _root.game._x;
ypos = _y + _root.game._y;
_root.game.playerNum = _root.game.playerNum + 1;
mass = 2;
rad = hitArea._width / 2.3;
team = 0;
if (parseInt(substring(_name, 7, 2)) < 12) {
team = 1;
rot = 180;
origRot = rot;
if ((_name == "player22") || (_name == "player11")) {
gotoAndStop (4);
} else {
gotoAndStop (2);
}
ani.gotoAndStop(10);
} else {
team = 2;
rot = 0;
origRot = rot;
if ((_name == "player22") || (_name == "player11")) {
gotoAndStop (3);
} else {
gotoAndStop (1);
}
ani.gotoAndStop(1);
}
if (team == 2) {
trace(((("new Array(" + Math.round(_x)) + ",") + Math.round(_y)) + "),");
}
rotStored = 0;
heldTime = 0;
heldTime2 = 0;
tackled = false;
forwardProgress = 0;
progressTimer = 0;
type = "";
fixedLineX = 0;
speedDone = false;
var xspeedEq = speed;
var yspeedEq = speed;
storedVar = "";
collisionTimer = 0;
intercepted = false;
}
onClipEvent (enterFrame) {
function checkOutOfBounds() {
if (_root.game.ball.target == this) {
boundsPause();
if ((ani._currentframe < 6) || (ani._currentframe > 14)) {
if (team == 1) {
}
} else if ((ani._currentframe > 6) and (ani._currentframe < 14)) {
if (team == 2) {
}
}
}
}
function checkScrimmage() {
if (team == 1) {
if (_root.game.scrimmage < _root.game.endZoneL) {
_root.game.scrimmage = _root.game.twentyYardLineL;
_root.game.touchBack = true;
} else {
_root.game.touchBack = false;
}
if (_root.game.scrimmage > _root.game.endZoneR) {
_root.game.scrimmage = _root.game.endZoneR;
}
} else {
if (_root.game.scrimmage < _root.game.endZoneL) {
_root.game.scrimmage = _root.game.endZoneL;
}
if (_root.game.scrimmage > _root.game.endZoneR) {
_root.game.scrimmage = _root.game.twentyYardLineR;
_root.game.touchBack = true;
} else {
_root.game.touchBack = false;
}
}
}
function tacklePause() {
type = "tackle";
if ((_root.game.timeOut == true) and (_root.game.tdMode == false)) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
_root.game.scrimmage = _x + fixedLineX;
checkScrimmage();
}
if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "tackle";
_root.game.safed = true;
} else if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "tackle";
_root.game.safed = true;
} else {
type = "tackle";
}
if ((_root.game.paused == false) and (_root.game.gameMode != "celebration")) {
_root.game.sound.gotoAndPlay("whistle");
}
if (((((_root.game.gameMode == "plays") and (_root.game.paused == false)) || ((_root.game.gameMode == "kickOff") and (_root.game.paused == false))) || ((_root.game.gameMode == "punt") and (_root.game.paused == false))) || (((_root.game.tdMode != false) and (_root.game.paused == false)) and (_root.game.gameMode == "plays"))) {
tackled = true;
type = "tackle";
if ((_root.game.passesNum == 0) and (_root.game.gameMode != "celebration")) {
if (_parent.ball.target.team == 1) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
if (((_x + fixedLineX) < _root.game.scrimmage) and (_root.game.downs > 0)) {
_parent.addMessage("sack");
} else {
_parent.addMessage("tackled");
}
}
if (_parent.ball.target.team == 2) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
if (((_x + fixedLineX) > _root.game.scrimmage) and (_root.game.downs > 0)) {
_parent.addMessage("sack");
} else {
_parent.addMessage("tackled");
}
}
} else if (_root.game.gameMode != "celebration") {
_parent.addMessage("tackled");
}
_root.game.pauseTime = 55;
}
}
function boundsPause() {
if (_root.game.timeOut == true) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
_root.game.scrimmage = _x + fixedLineX;
checkScrimmage();
}
if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "bounds";
_root.game.safed = true;
} else if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "bounds";
_root.game.safed = true;
} else {
type = "bounds";
}
type = "bounds";
_root.game.sound.gotoAndPlay("whistle");
tackled = true;
_parent.addMessage("outOfBounds");
_root.game.pauseTime = 55;
}
function turnedPause() {
if (_root.game.timeOut == true) {
_root.game.scrimmage = forwardProgress;
checkScrimmage();
}
type = "turn";
_root.game.sound.gotoAndPlay("whistle");
tackled = true;
_parent.addMessage("turnedAround");
_parent.addMessage("negativeProgress");
_root.game.pauseTime = 55;
}
function tackle() {
if ((_root.game.gameMode != "puntSafety") and (gameMode != "scrum")) {
if (_root.game.tdMode != false) {
if ((_root.game.timeOut == false) and (_root.game.gameMode != "celebration")) {
_root.game.startKickoff(_root.game.playersTeam);
_root.game.removeTackles();
tacked = false;
_root.game.tdMode = false;
} else if (_root.game.gameMode != "celebration") {
_root.game.removeTackles();
tacked = false;
_root.game.tdMode = false;
_root.game.gameMode = "convFail";
trace(_root.game.gameMode);
} else {
_root.game.removeTackles();
tacked = false;
}
} else if ((_root.game.downs <= 3.5) || (_root.game.goForIt == true)) {
if ((((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (type != "turn")) and (_root.game.downs > 0.5)) and (_root.game.ball.target == this)) and (_root.game.gameMode != "celebration")) {
_root.game.addMessage("Safety");
if (team != _root.game.playersTeam) {
_root.game.setupSafetyKick(_root.game.compTeam);
_root.game.hscore = _root.game.hscore + 2;
} else {
_root.game.setupSafetyKick(_root.game.playersTeam);
_root.game.gscore = _root.game.gscore + 2;
}
tackled = false;
} else if ((((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (type != "turn")) and (_root.game.downs > 0.5)) and (_root.game.ball.target == this)) and (_root.game.gameMode != "celebration")) {
_root.game.addMessage("Safety");
if (team != _root.game.playersTeam) {
_root.game.setupSafetyKick(_root.game.compTeam);
_root.game.hscore = _root.game.hscore + 2;
} else {
_root.game.setupSafetyKick(_root.game.playersTeam);
_root.game.gscore = _root.game.gscore + 2;
}
tackled = false;
} else {
_root.game.changeMode = false;
tackled = false;
if (type == "turn") {
var _local4 = forwardProgress;
} else {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
var _local4 = _x + fixedLineX;
}
_root.game.scrimmage = _local4;
if (_parent.ball.target.team != _root.game.playersTeam) {
var _local5 = random(2);
if (_local5 == 1) {
_root.game.compPlayType = "passing";
_root.game.setupLine(_root.game.compTeam, _root.game.formationShotgun, _local4, 0.5);
} else {
_root.game.compPlayType = "running";
_root.game.setupLine(_root.game.compTeam, _root.game.formationI, _local4, 0.5);
}
_root.game.setupLine(_root.game.playersTeam, _root.game.formation43, _local4, 0.5);
} else {
var _local5 = 1 + random(5);
_root.game.compPlayType = "defense";
_root.game.setupLine(_root.game.compTeam, _root.game["formationDefence" + _local5], _local4, 0.5);
_root.game.setupLine(_root.game.playersTeam, _root.game.formationShotgun, _local4, 0.5);
}
}
} else if ((_root.game.goForIt == true) and (_root.game.gameMode == "plays")) {
if (_root.game.changeMode == false) {
_root.game.downs = _root.game.downs + 1;
}
_root.game.pauseTime = 0;
_root.game.paused = false;
tackled = false;
} else if (_root.game.gameMode == "plays") {
_root.game.pauseTime = 0;
_root.game.paused = false;
if (_root.game.changeMode == false) {
_root.game.downs = _root.game.downs + 1;
}
tackled = false;
}
}
}
function checkWalls() {
if ((_y + 10) > _root.game.pitchFrontY) {
if (((yspeed > 1) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) {
checkOutOfBounds();
}
_y = (_y - 1);
yspeed = (-yspeed) * 0.5;
}
if ((_y - 5) < _root.game.pitchBackY) {
if (((yspeed < 1) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) {
checkOutOfBounds();
}
_y = (_y + 1);
yspeed = (-yspeed) * 0.5;
}
if (_root.game.walls.hitTest(xpos + (hitArea._width / 2), ypos, true) and (_x > 300)) {
_x = (_x - 2);
xspeed = (-xspeed) * 0.5;
}
if (_root.game.walls.hitTest(xpos - (hitArea._width / 2), ypos, true) and (_x < 300)) {
_x = (_x + 2);
xspeed = (-xspeed) * 0.5;
}
}
function checkCollision(b1, b2) {
var _local12 = b2._x - b1._x;
var _local11 = b2._y - b1._y;
var _local19 = Math.sqrt((_local12 * _local12) + (_local11 * _local11));
if (_local19 < (b1.rad + b2.rad)) {
if (((_parent.ball.target == this) and (b2.team != this.team)) || ((_parent.ball.target == b2) and (this.team != b2.team))) {
tacklePause();
}
if (_root.game.gameMode == "plays") {
var _local8 = 0;
if (xspeed < 0) {
_local8 = _local8 + (-xspeed);
} else {
_local8 = _local8 + xspeed;
}
if (yspeed < 0) {
_local8 = _local8 + (-yspeed);
} else {
_local8 = _local8 + yspeed;
}
if (_local8 > 1) {
hitSound.setVolume(_local8 * 15);
hitSound.start(0, 0);
hitSound.setVolume(_local8 * 15);
}
}
var _local18 = Math.atan2(_local11, _local12);
var _local7 = Math.cos(_local18);
var _local6 = Math.sin(_local18);
var _local9 = (_local7 * b1.xspeed) + (_local6 * b1.yspeed);
var _local15 = (_local7 * b1.yspeed) - (_local6 * b1.xspeed);
var _local10 = (_local7 * b2.xspeed) + (_local6 * b2.yspeed);
var _local14 = (_local7 * b2.yspeed) - (_local6 * b2.xspeed);
var _local21 = (_local9 * b1.mass) + (_local10 * b2.mass);
var _local20 = _local9 - _local10;
_local9 = (_local21 - (b2.mass * _local20)) / (b1.mass + b2.mass);
_local10 = _local20 + _local9;
b1.xspeed = ((_local7 * _local9) - (_local6 * _local15)) * 0.7;
b1.yspeed = ((_local7 * _local15) + (_local6 * _local9)) * 0.7;
b2.xspeed = ((_local7 * _local10) - (_local6 * _local14)) * 0.7;
b2.yspeed = ((_local7 * _local14) + (_local6 * _local10)) * 0.7;
var _local16 = ((b1.rad + b2.rad) - _local19) / 2;
var _local17 = _local7 * _local16;
var _local13 = _local6 * _local16;
b1._x = b1._x - (_local17 * 1.1);
b1._y = b1._y - (_local13 * 1.1);
b2._x = b2._x + (_local17 * 1.1);
b2._y = b2._y + (_local13 * 1.1);
}
}
if (_root.game.gameMode == "kickOff") {
var xspeedEq = speed;
var yspeedEq = speed;
}
if (_root.game.cleanUp == true) {
this.removeMovieClip();
}
if ((_root.game.gameMode == "scrum") || (_root.game.gameMode == "kickOff")) {
forwardProgress = 0;
progressTimer = 0;
}
if (team == _root.game.playersTeam) {
if (_root.game.playType == "running") {
if (_root.game.playersTeam == 1) {
if ((((_name == "player7") || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else if ((((_name == "player18") || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else {
mass = 2;
}
}
if (team == _root.game.compTeam) {
if (_root.game.compPlayType == "running") {
if (_root.game.compTeam == 1) {
if ((((_name == "player7") || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else if ((((_name == "player18") || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else {
mass = 2;
}
}
if ((((((_name == "player22") and (parseInt(_root.game.ball.storedOwner.team) == 2)) and (_root.game.gameMode != "plays")) and (_root.game.gameMode != "celebration")) and (_root.game.paused == false)) || (((((_name == "player11") and (parseInt(_root.game.ball.storedOwner.team) == 1)) and (_root.game.gameMode != "plays")) and (_root.game.gameMode != "celebration")) and (_root.game.paused == false))) {
if (_currentframe == 1) {
gotoAndStop (3);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(10);
}
} else if (_currentframe == 2) {
gotoAndStop (4);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(10);
}
}
} else if (((((_name == "player22") and (_root.game.gameMode != "plays")) and (_root.game.paused == false)) and (_root.game.gameMode != "celebration")) and (_root.game.gameMode != "shot")) {
gotoAndStop(_root.game.player21._currentframe);
} else if (((((_name == "player11") and (_root.game.gameMode != "plays")) and (_root.game.paused == false)) and (_root.game.gameMode != "celebration")) and (_root.game.gameMode != "shot")) {
gotoAndStop(_root.game.player10._currentframe);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(_root.game.player10.ani._currentframe);
}
}
if ((tackled == true) and (_root.game.paused == false)) {
tackle();
}
if (_root.game.paused == false) {
if (_parent.ball.target != this) {
arrow.gotoAndStop(1);
var arrowPlayed = false;
heldTime = 0;
} else {
if ((_parent.passesNum == 1) || (_root.game.downs == 0)) {
if (team == 1) {
if ((((xspeed < 0) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) and (_root.game.messageList.length == 0)) {
if ((_root.game.tdMode == false) || ((_root.game.tdMode != false) and (_parent.passesNum > 0))) {
progressTimer = progressTimer + 1;
if ((forwardProgress == 0) || (forwardProgress < (_x + fixedLineX))) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
forwardProgress = _x + fixedLineX;
}
if (progressTimer > 50) {
turnedPause();
progressTimer = 0;
}
} else {
progressTimer = 0;
}
}
} else if ((((xspeed > 0) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) and (_root.game.messageList.length == 0)) {
if ((_root.game.tdMode == false) || ((_root.game.tdMode != false) and (_parent.passesNum > 0))) {
progressTimer = progressTimer + 1;
if ((forwardProgress == 0) || (forwardProgress > (_x + fixedLineX))) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
forwardProgress = _x + fixedLineX;
}
if (progressTimer > 50) {
turnedPause();
progressTimer = 0;
}
} else {
progressTimer = 0;
}
}
}
if ((((team == 1) and (_root.game.gameMode == "plays")) and (team != _root.game.playersTeam)) || (((team == 1) and (_root.game.gameMode == "plays")) and (_root.game.demoMode == true))) {
heldTime = heldTime + 1;
var playerAmount = 12;
i = 1;
while (i < playerAmount) {
var target = _root.game["player" + i];
var randFactor = random(3);
if (((((((((target._x > (_x + 40)) and (_parent.passesNum == 0)) and (heldTime > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed > (1.5 * _root.game.vibrationVal))) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || ((((_parent.nzone.hitTest(target.xpos, target.ypos, true) and (target._x > _x)) and (_parent.passesNum == 0)) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing"))) || ((((((((target._x > (_x + 40)) and (_parent.passesNum == 0)) and (heldTime > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed > 1.5)) and (_root.game.downs > 0)) and (_root.game.playType == "passing")) and (_root.game.demoMode == true))) {
_parent.passesNum = _parent.passesNum + 1;
_parent.ball.target = "";
_parent.ball.targetX = _root.game["player" + i]._x + (_root.game["player" + i].xspeed * (8 + random(15)));
_parent.ball.targetY = (_root.game["player" + i]._y - 10) + (_root.game["player" + i].yspeed * (8 + random(15)));
var dx = (_parent.ball.targetX - _parent.ball._x);
var dy = (_parent.ball.targetY - _parent.ball._y);
var dist = Math.sqrt((dx * dx) + (dy * dy));
_parent.ball.xspeed = dx / (dist / 10);
_parent.ball.yspeed = dy / (dist / 10);
_parent.ball.zspeed = -(dist / 20);
_parent.ball.zpos = 4;
}
i = i + 1;
}
} else {
heldTime = 0;
}
if ((((team == 2) and (_root.game.gameMode == "plays")) and (team != _root.game.playersTeam)) || (((team == 2) and (_root.game.gameMode == "plays")) and (_root.game.demoMode == true))) {
heldTime2 = heldTime2 + 1;
var playerAmount = 23;
i = 12;
while (i < playerAmount) {
var target = _root.game["player" + i];
var randFactor = random(3);
if ((((((((target._x < (_x - 40)) and (_parent.passesNum == 0)) and (heldTime2 > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed < (-1.5 * _root.game.vibrationVal))) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || ((((_parent.nzone.hitTest(target.xpos, target.ypos, true) and (target._x < _x)) and (_parent.passesNum == 0)) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing"))) {
_parent.passesNum = _parent.passesNum + 1;
_parent.ball.target = "";
_parent.ball.targetX = _root.game["player" + i]._x + (_root.game["player" + i].xspeed * (8 + random(15)));
_parent.ball.targetY = (_root.game["player" + i]._y - 10) + (_root.game["player" + i].yspeed * (8 + random(15)));
var dx = (_parent.ball.targetX - _parent.ball._x);
var dy = (_parent.ball.targetY - _parent.ball._y);
var dist = Math.sqrt((dx * dx) + (dy * dy));
_parent.ball.xspeed = dx / (dist / 10);
_parent.ball.yspeed = dy / (dist / 10);
_parent.ball.zspeed = -(dist / 20);
_parent.ball.zpos = 4;
}
i = i + 1;
}
} else {
heldTime2 = 0;
}
if (arrowPlayed == false) {
arrow.play();
var arrowPlayed = true;
}
}
if ((_root.game.gameMode == "plays") and (_parent.ball.target == "")) {
if ((((((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player22")) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player11"))) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player4"))) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player16"))) {
} else {
var catchRad = (rad * 2.5);
var zcatch = 4;
}
if (_root.game.ball.target == "") {
if ((_root.game.ball._x < (_x + 50)) and (_root.game.ball._x > (_x - 50))) {
if ((((_root.game.lastGameMode == "kickOff") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player22")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "kickOff") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player11")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "punt") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player15")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "punt") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player4")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "puntSafety") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player15")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "puntSafety") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player4")) {
_root.game.ball.target = this;
}
}
if ((_root.game.ball._x < (_x + 20)) and (_root.game.ball._x > (_x - 20))) {
var dx = (_parent.ball._x - _x);
var dy = (_parent.ball._y - (_y - 10));
var dist = Math.sqrt((dx * dx) + (dy * dy));
if (((dist < catchRad) and (_parent.ball.zpos < zcatch)) and (_root.game.ball.bounce < 1)) {
if ((_parent.ball.storedOwner.team != team) and (_parent.ball.storedOwner.team > 0)) {
if (_root.game.tdMode != false) {
tacklePause();
} else {
_parent.scoreboard.bigscreen.ani.gotoAndPlay("intercept");
_root.game.downs = 0;
intercepted = true;
_root.game.intercepted = true;
}
}
_parent.ball.target = this;
arrow.play();
}
var dx = ((_parent.ball._x + _root.game.ball.xspeed) - _x);
var dy = ((_parent.ball._y + _root.game.ball.yspeed) - (_y - 10));
var dist = Math.sqrt((dx * dx) + (dy * dy));
if (((dist < catchRad) and (_parent.ball.zpos < zcatch)) and (_root.game.ball.bounce < 1)) {
if ((_parent.ball.storedOwner.team != team) and (_parent.ball.storedOwner.team > 0)) {
if (_root.game.tdMode != false) {
tacklePause();
} else {
_parent.scoreboard.bigscreen.ani.gotoAndPlay("intercept");
_root.game.downs = 0;
intercepted = true;
_root.game.intercepted = true;
}
}
_parent.ball.target = this;
arrow.play();
}
}
}
}
xpos = _x + _root.game._x;
ypos = _y + _root.game._y;
speed = 0.12 * _root.game.vibrationVal;
currentY = _y - _root.game.pitchBackY;
posY = currentY / _root.game.pitchFrontY;
percent = _root.game.pitchDepth / _root.game.horizon;
depthScale = (1 - percent) + (posY * percent);
if (intercepted == true) {
speedDone = false;
intercepted = false;
}
if ((_root.game.vibrate == true) and (_root.game.paused == false)) {
rotTimer = 1 + random(20 * _root.game.vibrationVal);
if (rotTimer == 1) {
rotInc = (-30 + random(60)) / 140;
}
rotVel = rotVel + rotInc;
if (((_root.game.gameMode == "plays") and (speedDone == false)) || (_root.game.mouseIsDown == true)) {
if (_root.game.lastGameMode != "kickOff") {
speedDone = true;
if (_root.game.ball.target != this) {
if (((_root.game.playType == "running") and (team == _root.game.playersTeam)) || ((_root.game.compPlayType == "running") and (team == _root.game.compTeam))) {
if ((((((((((_name == "player22") || (_name == "player18")) || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) || (_name == "player11")) || (_name == "player7")) || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
var xspeedEq = (speed * 1.5);
var yspeedEq = (speed * 1.5);
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else if (((_root.game.playType == "defense") and (team == _root.game.playersTeam)) || ((_root.game.compPlayType == "defense") and (team == _root.game.compTeam))) {
if ((_root.downs >= 1) and (_root.game.blitz == false)) {
if ((((_name == "player8") || (_name == "player9")) || (_name == "player19")) || (_name == "player20")) {
var xspeedEq = (-(speed / 3));
var yspeedEq = (-(speed / 3));
} else if ((((_name == "player10") || (_name == "player11")) || (_name == "player21")) || (_name == "player22")) {
var xspeedEq = (-(speed / 5));
var yspeedEq = (-(speed / 5));
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else if (((((_root.game.passesNum == 0) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || (((_root.game.passesNum == 0) and (_root.game.downs > 0)) and (_root.game.playType == "passing"))) || (((_root.game.passesNum == 0) and (_root.game.tdMode != false)) and (_root.game.playType == "passing"))) {
var xspeedEq = (-(speed / 6));
var yspeedEq = (-(speed / 6));
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
}
}
if ((_root.game.gameMode != "plays") || (_root.game.paused == true)) {
speedDone = false;
}
if (((_root.game.gameMode == "plays") || (_root.game.gameMode == "celebration")) || (_root.game.gameMode == "shot")) {
xspeed = xspeed + (Math.cos((rot - 180) * (Math.PI/180)) * xspeedEq);
yspeed = yspeed + (Math.sin((rot - 180) * (Math.PI/180)) * yspeedEq);
}
if (collisionTimer < 1) {
collisionTimer = collisionTimer + 1;
} else {
collisionTimer = 0;
}
if (((_root.game.vibrate == true) and (_root.game.paused == false)) || (_root.game.mouseIsDown == true)) {
if ((collisionTimer == 0) and (team == 1)) {
i = 0;
while (i < (_root.game.playerNum + 1)) {
var target = _root.game["player" + i];
if (_name != ("player" + i)) {
checkCollision(this, target);
}
i = i + 1;
}
checkWalls();
}
if ((collisionTimer == 1) and (team == 2)) {
i = 12;
while (i < (_root.game.playerNum + 1)) {
var target = _root.game["player" + i];
if (_name != ("player" + i)) {
checkCollision(this, target);
}
i = i + 1;
}
checkWalls();
}
}
if (_root.game.gameMode == "puntSafety") {
checkWalls();
}
xspeed = xspeed * 0.97;
yspeed = yspeed * 0.97;
rotVel = rotVel * 0.97;
this.swapDepths(_y + (_x / 5));
if ((_name == "player22") and (_root.game.playType == "running")) {
} else {
var aniFrames = ani._totalframes;
rotStored = rotStored + rotVel;
if (rotStored > (360 / aniFrames)) {
if (ani._currentframe < aniFrames) {
ani.nextFrame();
} else {
ani.gotoAndStop(1);
}
rotStored = rotStored - (360 / aniFrames);
}
if (rotStored < (-(360 / aniFrames))) {
if (ani._currentframe > 1) {
ani.prevFrame();
} else {
ani.gotoAndStop(aniFrames);
}
rotStored = rotStored + (360 / aniFrames);
}
rot = rot + rotVel;
_xscale = (depthScale * 110);
_yscale = _xscale;
}
if (((_root.game.gameMode == "plays") || (_root.game.gameMode == "celebration")) || (_root.game.gameMode == "shot")) {
_x = (_x + (xspeed * depthScale));
_y = (_y + (yspeed * depthScale));
}
}
}
Instance of Symbol 198 MovieClip "player21" in Symbol 494 MovieClip Frame 2
onClipEvent (load) {
hitSound = new Sound(this);
hitSound.attachSound("hitSound");
xspeed = 0;
yspeed = 0;
speed = 0.1 * _root.game.vibrationVal;
currentY = _y - _root.game.pitchBackY;
posY = currentY / _root.game.pitchFrontY;
percent = _root.game.pitchDepth / _root.game.horizon;
depthScale = (1 - percent) + (posY * percent);
rotVel = 0;
rotInc = 0;
rotTimer = random(20);
_rotation = 0;
xpos = _x + _root.game._x;
ypos = _y + _root.game._y;
_root.game.playerNum = _root.game.playerNum + 1;
mass = 2;
rad = hitArea._width / 2.3;
team = 0;
if (parseInt(substring(_name, 7, 2)) < 12) {
team = 1;
rot = 180;
origRot = rot;
if ((_name == "player22") || (_name == "player11")) {
gotoAndStop (4);
} else {
gotoAndStop (2);
}
ani.gotoAndStop(10);
} else {
team = 2;
rot = 0;
origRot = rot;
if ((_name == "player22") || (_name == "player11")) {
gotoAndStop (3);
} else {
gotoAndStop (1);
}
ani.gotoAndStop(1);
}
if (team == 2) {
trace(((("new Array(" + Math.round(_x)) + ",") + Math.round(_y)) + "),");
}
rotStored = 0;
heldTime = 0;
heldTime2 = 0;
tackled = false;
forwardProgress = 0;
progressTimer = 0;
type = "";
fixedLineX = 0;
speedDone = false;
var xspeedEq = speed;
var yspeedEq = speed;
storedVar = "";
collisionTimer = 0;
intercepted = false;
}
onClipEvent (enterFrame) {
function checkOutOfBounds() {
if (_root.game.ball.target == this) {
boundsPause();
if ((ani._currentframe < 6) || (ani._currentframe > 14)) {
if (team == 1) {
}
} else if ((ani._currentframe > 6) and (ani._currentframe < 14)) {
if (team == 2) {
}
}
}
}
function checkScrimmage() {
if (team == 1) {
if (_root.game.scrimmage < _root.game.endZoneL) {
_root.game.scrimmage = _root.game.twentyYardLineL;
_root.game.touchBack = true;
} else {
_root.game.touchBack = false;
}
if (_root.game.scrimmage > _root.game.endZoneR) {
_root.game.scrimmage = _root.game.endZoneR;
}
} else {
if (_root.game.scrimmage < _root.game.endZoneL) {
_root.game.scrimmage = _root.game.endZoneL;
}
if (_root.game.scrimmage > _root.game.endZoneR) {
_root.game.scrimmage = _root.game.twentyYardLineR;
_root.game.touchBack = true;
} else {
_root.game.touchBack = false;
}
}
}
function tacklePause() {
type = "tackle";
if ((_root.game.timeOut == true) and (_root.game.tdMode == false)) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
_root.game.scrimmage = _x + fixedLineX;
checkScrimmage();
}
if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "tackle";
_root.game.safed = true;
} else if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "tackle";
_root.game.safed = true;
} else {
type = "tackle";
}
if ((_root.game.paused == false) and (_root.game.gameMode != "celebration")) {
_root.game.sound.gotoAndPlay("whistle");
}
if (((((_root.game.gameMode == "plays") and (_root.game.paused == false)) || ((_root.game.gameMode == "kickOff") and (_root.game.paused == false))) || ((_root.game.gameMode == "punt") and (_root.game.paused == false))) || (((_root.game.tdMode != false) and (_root.game.paused == false)) and (_root.game.gameMode == "plays"))) {
tackled = true;
type = "tackle";
if ((_root.game.passesNum == 0) and (_root.game.gameMode != "celebration")) {
if (_parent.ball.target.team == 1) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
if (((_x + fixedLineX) < _root.game.scrimmage) and (_root.game.downs > 0)) {
_parent.addMessage("sack");
} else {
_parent.addMessage("tackled");
}
}
if (_parent.ball.target.team == 2) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
if (((_x + fixedLineX) > _root.game.scrimmage) and (_root.game.downs > 0)) {
_parent.addMessage("sack");
} else {
_parent.addMessage("tackled");
}
}
} else if (_root.game.gameMode != "celebration") {
_parent.addMessage("tackled");
}
_root.game.pauseTime = 55;
}
}
function boundsPause() {
if (_root.game.timeOut == true) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
_root.game.scrimmage = _x + fixedLineX;
checkScrimmage();
}
if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "bounds";
_root.game.safed = true;
} else if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "bounds";
_root.game.safed = true;
} else {
type = "bounds";
}
type = "bounds";
_root.game.sound.gotoAndPlay("whistle");
tackled = true;
_parent.addMessage("outOfBounds");
_root.game.pauseTime = 55;
}
function turnedPause() {
if (_root.game.timeOut == true) {
_root.game.scrimmage = forwardProgress;
checkScrimmage();
}
type = "turn";
_root.game.sound.gotoAndPlay("whistle");
tackled = true;
_parent.addMessage("turnedAround");
_parent.addMessage("negativeProgress");
_root.game.pauseTime = 55;
}
function tackle() {
if ((_root.game.gameMode != "puntSafety") and (gameMode != "scrum")) {
if (_root.game.tdMode != false) {
if ((_root.game.timeOut == false) and (_root.game.gameMode != "celebration")) {
_root.game.startKickoff(_root.game.playersTeam);
_root.game.removeTackles();
tacked = false;
_root.game.tdMode = false;
} else if (_root.game.gameMode != "celebration") {
_root.game.removeTackles();
tacked = false;
_root.game.tdMode = false;
_root.game.gameMode = "convFail";
trace(_root.game.gameMode);
} else {
_root.game.removeTackles();
tacked = false;
}
} else if ((_root.game.downs <= 3.5) || (_root.game.goForIt == true)) {
if ((((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (type != "turn")) and (_root.game.downs > 0.5)) and (_root.game.ball.target == this)) and (_root.game.gameMode != "celebration")) {
_root.game.addMessage("Safety");
if (team != _root.game.playersTeam) {
_root.game.setupSafetyKick(_root.game.compTeam);
_root.game.hscore = _root.game.hscore + 2;
} else {
_root.game.setupSafetyKick(_root.game.playersTeam);
_root.game.gscore = _root.game.gscore + 2;
}
tackled = false;
} else if ((((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (type != "turn")) and (_root.game.downs > 0.5)) and (_root.game.ball.target == this)) and (_root.game.gameMode != "celebration")) {
_root.game.addMessage("Safety");
if (team != _root.game.playersTeam) {
_root.game.setupSafetyKick(_root.game.compTeam);
_root.game.hscore = _root.game.hscore + 2;
} else {
_root.game.setupSafetyKick(_root.game.playersTeam);
_root.game.gscore = _root.game.gscore + 2;
}
tackled = false;
} else {
_root.game.changeMode = false;
tackled = false;
if (type == "turn") {
var _local4 = forwardProgress;
} else {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
var _local4 = _x + fixedLineX;
}
_root.game.scrimmage = _local4;
if (_parent.ball.target.team != _root.game.playersTeam) {
var _local5 = random(2);
if (_local5 == 1) {
_root.game.compPlayType = "passing";
_root.game.setupLine(_root.game.compTeam, _root.game.formationShotgun, _local4, 0.5);
} else {
_root.game.compPlayType = "running";
_root.game.setupLine(_root.game.compTeam, _root.game.formationI, _local4, 0.5);
}
_root.game.setupLine(_root.game.playersTeam, _root.game.formation43, _local4, 0.5);
} else {
var _local5 = 1 + random(5);
_root.game.compPlayType = "defense";
_root.game.setupLine(_root.game.compTeam, _root.game["formationDefence" + _local5], _local4, 0.5);
_root.game.setupLine(_root.game.playersTeam, _root.game.formationShotgun, _local4, 0.5);
}
}
} else if ((_root.game.goForIt == true) and (_root.game.gameMode == "plays")) {
if (_root.game.changeMode == false) {
_root.game.downs = _root.game.downs + 1;
}
_root.game.pauseTime = 0;
_root.game.paused = false;
tackled = false;
} else if (_root.game.gameMode == "plays") {
_root.game.pauseTime = 0;
_root.game.paused = false;
if (_root.game.changeMode == false) {
_root.game.downs = _root.game.downs + 1;
}
tackled = false;
}
}
}
function checkWalls() {
if ((_y + 10) > _root.game.pitchFrontY) {
if (((yspeed > 1) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) {
checkOutOfBounds();
}
_y = (_y - 1);
yspeed = (-yspeed) * 0.5;
}
if ((_y - 5) < _root.game.pitchBackY) {
if (((yspeed < 1) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) {
checkOutOfBounds();
}
_y = (_y + 1);
yspeed = (-yspeed) * 0.5;
}
if (_root.game.walls.hitTest(xpos + (hitArea._width / 2), ypos, true) and (_x > 300)) {
_x = (_x - 2);
xspeed = (-xspeed) * 0.5;
}
if (_root.game.walls.hitTest(xpos - (hitArea._width / 2), ypos, true) and (_x < 300)) {
_x = (_x + 2);
xspeed = (-xspeed) * 0.5;
}
}
function checkCollision(b1, b2) {
var _local12 = b2._x - b1._x;
var _local11 = b2._y - b1._y;
var _local19 = Math.sqrt((_local12 * _local12) + (_local11 * _local11));
if (_local19 < (b1.rad + b2.rad)) {
if (((_parent.ball.target == this) and (b2.team != this.team)) || ((_parent.ball.target == b2) and (this.team != b2.team))) {
tacklePause();
}
if (_root.game.gameMode == "plays") {
var _local8 = 0;
if (xspeed < 0) {
_local8 = _local8 + (-xspeed);
} else {
_local8 = _local8 + xspeed;
}
if (yspeed < 0) {
_local8 = _local8 + (-yspeed);
} else {
_local8 = _local8 + yspeed;
}
if (_local8 > 1) {
hitSound.setVolume(_local8 * 15);
hitSound.start(0, 0);
hitSound.setVolume(_local8 * 15);
}
}
var _local18 = Math.atan2(_local11, _local12);
var _local7 = Math.cos(_local18);
var _local6 = Math.sin(_local18);
var _local9 = (_local7 * b1.xspeed) + (_local6 * b1.yspeed);
var _local15 = (_local7 * b1.yspeed) - (_local6 * b1.xspeed);
var _local10 = (_local7 * b2.xspeed) + (_local6 * b2.yspeed);
var _local14 = (_local7 * b2.yspeed) - (_local6 * b2.xspeed);
var _local21 = (_local9 * b1.mass) + (_local10 * b2.mass);
var _local20 = _local9 - _local10;
_local9 = (_local21 - (b2.mass * _local20)) / (b1.mass + b2.mass);
_local10 = _local20 + _local9;
b1.xspeed = ((_local7 * _local9) - (_local6 * _local15)) * 0.7;
b1.yspeed = ((_local7 * _local15) + (_local6 * _local9)) * 0.7;
b2.xspeed = ((_local7 * _local10) - (_local6 * _local14)) * 0.7;
b2.yspeed = ((_local7 * _local14) + (_local6 * _local10)) * 0.7;
var _local16 = ((b1.rad + b2.rad) - _local19) / 2;
var _local17 = _local7 * _local16;
var _local13 = _local6 * _local16;
b1._x = b1._x - (_local17 * 1.1);
b1._y = b1._y - (_local13 * 1.1);
b2._x = b2._x + (_local17 * 1.1);
b2._y = b2._y + (_local13 * 1.1);
}
}
if (_root.game.gameMode == "kickOff") {
var xspeedEq = speed;
var yspeedEq = speed;
}
if (_root.game.cleanUp == true) {
this.removeMovieClip();
}
if ((_root.game.gameMode == "scrum") || (_root.game.gameMode == "kickOff")) {
forwardProgress = 0;
progressTimer = 0;
}
if (team == _root.game.playersTeam) {
if (_root.game.playType == "running") {
if (_root.game.playersTeam == 1) {
if ((((_name == "player7") || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else if ((((_name == "player18") || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else {
mass = 2;
}
}
if (team == _root.game.compTeam) {
if (_root.game.compPlayType == "running") {
if (_root.game.compTeam == 1) {
if ((((_name == "player7") || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else if ((((_name == "player18") || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else {
mass = 2;
}
}
if ((((((_name == "player22") and (parseInt(_root.game.ball.storedOwner.team) == 2)) and (_root.game.gameMode != "plays")) and (_root.game.gameMode != "celebration")) and (_root.game.paused == false)) || (((((_name == "player11") and (parseInt(_root.game.ball.storedOwner.team) == 1)) and (_root.game.gameMode != "plays")) and (_root.game.gameMode != "celebration")) and (_root.game.paused == false))) {
if (_currentframe == 1) {
gotoAndStop (3);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(10);
}
} else if (_currentframe == 2) {
gotoAndStop (4);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(10);
}
}
} else if (((((_name == "player22") and (_root.game.gameMode != "plays")) and (_root.game.paused == false)) and (_root.game.gameMode != "celebration")) and (_root.game.gameMode != "shot")) {
gotoAndStop(_root.game.player21._currentframe);
} else if (((((_name == "player11") and (_root.game.gameMode != "plays")) and (_root.game.paused == false)) and (_root.game.gameMode != "celebration")) and (_root.game.gameMode != "shot")) {
gotoAndStop(_root.game.player10._currentframe);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(_root.game.player10.ani._currentframe);
}
}
if ((tackled == true) and (_root.game.paused == false)) {
tackle();
}
if (_root.game.paused == false) {
if (_parent.ball.target != this) {
arrow.gotoAndStop(1);
var arrowPlayed = false;
heldTime = 0;
} else {
if ((_parent.passesNum == 1) || (_root.game.downs == 0)) {
if (team == 1) {
if ((((xspeed < 0) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) and (_root.game.messageList.length == 0)) {
if ((_root.game.tdMode == false) || ((_root.game.tdMode != false) and (_parent.passesNum > 0))) {
progressTimer = progressTimer + 1;
if ((forwardProgress == 0) || (forwardProgress < (_x + fixedLineX))) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
forwardProgress = _x + fixedLineX;
}
if (progressTimer > 50) {
turnedPause();
progressTimer = 0;
}
} else {
progressTimer = 0;
}
}
} else if ((((xspeed > 0) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) and (_root.game.messageList.length == 0)) {
if ((_root.game.tdMode == false) || ((_root.game.tdMode != false) and (_parent.passesNum > 0))) {
progressTimer = progressTimer + 1;
if ((forwardProgress == 0) || (forwardProgress > (_x + fixedLineX))) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
forwardProgress = _x + fixedLineX;
}
if (progressTimer > 50) {
turnedPause();
progressTimer = 0;
}
} else {
progressTimer = 0;
}
}
}
if ((((team == 1) and (_root.game.gameMode == "plays")) and (team != _root.game.playersTeam)) || (((team == 1) and (_root.game.gameMode == "plays")) and (_root.game.demoMode == true))) {
heldTime = heldTime + 1;
var playerAmount = 12;
i = 1;
while (i < playerAmount) {
var target = _root.game["player" + i];
var randFactor = random(3);
if (((((((((target._x > (_x + 40)) and (_parent.passesNum == 0)) and (heldTime > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed > (1.5 * _root.game.vibrationVal))) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || ((((_parent.nzone.hitTest(target.xpos, target.ypos, true) and (target._x > _x)) and (_parent.passesNum == 0)) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing"))) || ((((((((target._x > (_x + 40)) and (_parent.passesNum == 0)) and (heldTime > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed > 1.5)) and (_root.game.downs > 0)) and (_root.game.playType == "passing")) and (_root.game.demoMode == true))) {
_parent.passesNum = _parent.passesNum + 1;
_parent.ball.target = "";
_parent.ball.targetX = _root.game["player" + i]._x + (_root.game["player" + i].xspeed * (8 + random(15)));
_parent.ball.targetY = (_root.game["player" + i]._y - 10) + (_root.game["player" + i].yspeed * (8 + random(15)));
var dx = (_parent.ball.targetX - _parent.ball._x);
var dy = (_parent.ball.targetY - _parent.ball._y);
var dist = Math.sqrt((dx * dx) + (dy * dy));
_parent.ball.xspeed = dx / (dist / 10);
_parent.ball.yspeed = dy / (dist / 10);
_parent.ball.zspeed = -(dist / 20);
_parent.ball.zpos = 4;
}
i = i + 1;
}
} else {
heldTime = 0;
}
if ((((team == 2) and (_root.game.gameMode == "plays")) and (team != _root.game.playersTeam)) || (((team == 2) and (_root.game.gameMode == "plays")) and (_root.game.demoMode == true))) {
heldTime2 = heldTime2 + 1;
var playerAmount = 23;
i = 12;
while (i < playerAmount) {
var target = _root.game["player" + i];
var randFactor = random(3);
if ((((((((target._x < (_x - 40)) and (_parent.passesNum == 0)) and (heldTime2 > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed < (-1.5 * _root.game.vibrationVal))) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || ((((_parent.nzone.hitTest(target.xpos, target.ypos, true) and (target._x < _x)) and (_parent.passesNum == 0)) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing"))) {
_parent.passesNum = _parent.passesNum + 1;
_parent.ball.target = "";
_parent.ball.targetX = _root.game["player" + i]._x + (_root.game["player" + i].xspeed * (8 + random(15)));
_parent.ball.targetY = (_root.game["player" + i]._y - 10) + (_root.game["player" + i].yspeed * (8 + random(15)));
var dx = (_parent.ball.targetX - _parent.ball._x);
var dy = (_parent.ball.targetY - _parent.ball._y);
var dist = Math.sqrt((dx * dx) + (dy * dy));
_parent.ball.xspeed = dx / (dist / 10);
_parent.ball.yspeed = dy / (dist / 10);
_parent.ball.zspeed = -(dist / 20);
_parent.ball.zpos = 4;
}
i = i + 1;
}
} else {
heldTime2 = 0;
}
if (arrowPlayed == false) {
arrow.play();
var arrowPlayed = true;
}
}
if ((_root.game.gameMode == "plays") and (_parent.ball.target == "")) {
if ((((((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player22")) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player11"))) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player4"))) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player16"))) {
} else {
var catchRad = (rad * 2.5);
var zcatch = 4;
}
if (_root.game.ball.target == "") {
if ((_root.game.ball._x < (_x + 50)) and (_root.game.ball._x > (_x - 50))) {
if ((((_root.game.lastGameMode == "kickOff") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player22")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "kickOff") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player11")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "punt") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player15")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "punt") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player4")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "puntSafety") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player15")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "puntSafety") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player4")) {
_root.game.ball.target = this;
}
}
if ((_root.game.ball._x < (_x + 20)) and (_root.game.ball._x > (_x - 20))) {
var dx = (_parent.ball._x - _x);
var dy = (_parent.ball._y - (_y - 10));
var dist = Math.sqrt((dx * dx) + (dy * dy));
if (((dist < catchRad) and (_parent.ball.zpos < zcatch)) and (_root.game.ball.bounce < 1)) {
if ((_parent.ball.storedOwner.team != team) and (_parent.ball.storedOwner.team > 0)) {
if (_root.game.tdMode != false) {
tacklePause();
} else {
_parent.scoreboard.bigscreen.ani.gotoAndPlay("intercept");
_root.game.downs = 0;
intercepted = true;
_root.game.intercepted = true;
}
}
_parent.ball.target = this;
arrow.play();
}
var dx = ((_parent.ball._x + _root.game.ball.xspeed) - _x);
var dy = ((_parent.ball._y + _root.game.ball.yspeed) - (_y - 10));
var dist = Math.sqrt((dx * dx) + (dy * dy));
if (((dist < catchRad) and (_parent.ball.zpos < zcatch)) and (_root.game.ball.bounce < 1)) {
if ((_parent.ball.storedOwner.team != team) and (_parent.ball.storedOwner.team > 0)) {
if (_root.game.tdMode != false) {
tacklePause();
} else {
_parent.scoreboard.bigscreen.ani.gotoAndPlay("intercept");
_root.game.downs = 0;
intercepted = true;
_root.game.intercepted = true;
}
}
_parent.ball.target = this;
arrow.play();
}
}
}
}
xpos = _x + _root.game._x;
ypos = _y + _root.game._y;
speed = 0.12 * _root.game.vibrationVal;
currentY = _y - _root.game.pitchBackY;
posY = currentY / _root.game.pitchFrontY;
percent = _root.game.pitchDepth / _root.game.horizon;
depthScale = (1 - percent) + (posY * percent);
if (intercepted == true) {
speedDone = false;
intercepted = false;
}
if ((_root.game.vibrate == true) and (_root.game.paused == false)) {
rotTimer = 1 + random(20 * _root.game.vibrationVal);
if (rotTimer == 1) {
rotInc = (-30 + random(60)) / 140;
}
rotVel = rotVel + rotInc;
if (((_root.game.gameMode == "plays") and (speedDone == false)) || (_root.game.mouseIsDown == true)) {
if (_root.game.lastGameMode != "kickOff") {
speedDone = true;
if (_root.game.ball.target != this) {
if (((_root.game.playType == "running") and (team == _root.game.playersTeam)) || ((_root.game.compPlayType == "running") and (team == _root.game.compTeam))) {
if ((((((((((_name == "player22") || (_name == "player18")) || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) || (_name == "player11")) || (_name == "player7")) || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
var xspeedEq = (speed * 1.5);
var yspeedEq = (speed * 1.5);
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else if (((_root.game.playType == "defense") and (team == _root.game.playersTeam)) || ((_root.game.compPlayType == "defense") and (team == _root.game.compTeam))) {
if ((_root.downs >= 1) and (_root.game.blitz == false)) {
if ((((_name == "player8") || (_name == "player9")) || (_name == "player19")) || (_name == "player20")) {
var xspeedEq = (-(speed / 3));
var yspeedEq = (-(speed / 3));
} else if ((((_name == "player10") || (_name == "player11")) || (_name == "player21")) || (_name == "player22")) {
var xspeedEq = (-(speed / 5));
var yspeedEq = (-(speed / 5));
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else if (((((_root.game.passesNum == 0) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || (((_root.game.passesNum == 0) and (_root.game.downs > 0)) and (_root.game.playType == "passing"))) || (((_root.game.passesNum == 0) and (_root.game.tdMode != false)) and (_root.game.playType == "passing"))) {
var xspeedEq = (-(speed / 6));
var yspeedEq = (-(speed / 6));
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
}
}
if ((_root.game.gameMode != "plays") || (_root.game.paused == true)) {
speedDone = false;
}
if (((_root.game.gameMode == "plays") || (_root.game.gameMode == "celebration")) || (_root.game.gameMode == "shot")) {
xspeed = xspeed + (Math.cos((rot - 180) * (Math.PI/180)) * xspeedEq);
yspeed = yspeed + (Math.sin((rot - 180) * (Math.PI/180)) * yspeedEq);
}
if (collisionTimer < 1) {
collisionTimer = collisionTimer + 1;
} else {
collisionTimer = 0;
}
if (((_root.game.vibrate == true) and (_root.game.paused == false)) || (_root.game.mouseIsDown == true)) {
if ((collisionTimer == 0) and (team == 1)) {
i = 0;
while (i < (_root.game.playerNum + 1)) {
var target = _root.game["player" + i];
if (_name != ("player" + i)) {
checkCollision(this, target);
}
i = i + 1;
}
checkWalls();
}
if ((collisionTimer == 1) and (team == 2)) {
i = 12;
while (i < (_root.game.playerNum + 1)) {
var target = _root.game["player" + i];
if (_name != ("player" + i)) {
checkCollision(this, target);
}
i = i + 1;
}
checkWalls();
}
}
if (_root.game.gameMode == "puntSafety") {
checkWalls();
}
xspeed = xspeed * 0.97;
yspeed = yspeed * 0.97;
rotVel = rotVel * 0.97;
this.swapDepths(_y + (_x / 5));
if ((_name == "player22") and (_root.game.playType == "running")) {
} else {
var aniFrames = ani._totalframes;
rotStored = rotStored + rotVel;
if (rotStored > (360 / aniFrames)) {
if (ani._currentframe < aniFrames) {
ani.nextFrame();
} else {
ani.gotoAndStop(1);
}
rotStored = rotStored - (360 / aniFrames);
}
if (rotStored < (-(360 / aniFrames))) {
if (ani._currentframe > 1) {
ani.prevFrame();
} else {
ani.gotoAndStop(aniFrames);
}
rotStored = rotStored + (360 / aniFrames);
}
rot = rot + rotVel;
_xscale = (depthScale * 110);
_yscale = _xscale;
}
if (((_root.game.gameMode == "plays") || (_root.game.gameMode == "celebration")) || (_root.game.gameMode == "shot")) {
_x = (_x + (xspeed * depthScale));
_y = (_y + (yspeed * depthScale));
}
}
}
Instance of Symbol 198 MovieClip "player5" in Symbol 494 MovieClip Frame 2
onClipEvent (load) {
hitSound = new Sound(this);
hitSound.attachSound("hitSound");
xspeed = 0;
yspeed = 0;
speed = 0.1 * _root.game.vibrationVal;
currentY = _y - _root.game.pitchBackY;
posY = currentY / _root.game.pitchFrontY;
percent = _root.game.pitchDepth / _root.game.horizon;
depthScale = (1 - percent) + (posY * percent);
rotVel = 0;
rotInc = 0;
rotTimer = random(20);
_rotation = 0;
xpos = _x + _root.game._x;
ypos = _y + _root.game._y;
_root.game.playerNum = _root.game.playerNum + 1;
mass = 2;
rad = hitArea._width / 2.3;
team = 0;
if (parseInt(substring(_name, 7, 2)) < 12) {
team = 1;
rot = 180;
origRot = rot;
if ((_name == "player22") || (_name == "player11")) {
gotoAndStop (4);
} else {
gotoAndStop (2);
}
ani.gotoAndStop(10);
} else {
team = 2;
rot = 0;
origRot = rot;
if ((_name == "player22") || (_name == "player11")) {
gotoAndStop (3);
} else {
gotoAndStop (1);
}
ani.gotoAndStop(1);
}
if (team == 2) {
trace(((("new Array(" + Math.round(_x)) + ",") + Math.round(_y)) + "),");
}
rotStored = 0;
heldTime = 0;
heldTime2 = 0;
tackled = false;
forwardProgress = 0;
progressTimer = 0;
type = "";
fixedLineX = 0;
speedDone = false;
var xspeedEq = speed;
var yspeedEq = speed;
storedVar = "";
collisionTimer = 0;
intercepted = false;
}
onClipEvent (enterFrame) {
function checkOutOfBounds() {
if (_root.game.ball.target == this) {
boundsPause();
if ((ani._currentframe < 6) || (ani._currentframe > 14)) {
if (team == 1) {
}
} else if ((ani._currentframe > 6) and (ani._currentframe < 14)) {
if (team == 2) {
}
}
}
}
function checkScrimmage() {
if (team == 1) {
if (_root.game.scrimmage < _root.game.endZoneL) {
_root.game.scrimmage = _root.game.twentyYardLineL;
_root.game.touchBack = true;
} else {
_root.game.touchBack = false;
}
if (_root.game.scrimmage > _root.game.endZoneR) {
_root.game.scrimmage = _root.game.endZoneR;
}
} else {
if (_root.game.scrimmage < _root.game.endZoneL) {
_root.game.scrimmage = _root.game.endZoneL;
}
if (_root.game.scrimmage > _root.game.endZoneR) {
_root.game.scrimmage = _root.game.twentyYardLineR;
_root.game.touchBack = true;
} else {
_root.game.touchBack = false;
}
}
}
function tacklePause() {
type = "tackle";
if ((_root.game.timeOut == true) and (_root.game.tdMode == false)) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
_root.game.scrimmage = _x + fixedLineX;
checkScrimmage();
}
if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "tackle";
_root.game.safed = true;
} else if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "tackle";
_root.game.safed = true;
} else {
type = "tackle";
}
if ((_root.game.paused == false) and (_root.game.gameMode != "celebration")) {
_root.game.sound.gotoAndPlay("whistle");
}
if (((((_root.game.gameMode == "plays") and (_root.game.paused == false)) || ((_root.game.gameMode == "kickOff") and (_root.game.paused == false))) || ((_root.game.gameMode == "punt") and (_root.game.paused == false))) || (((_root.game.tdMode != false) and (_root.game.paused == false)) and (_root.game.gameMode == "plays"))) {
tackled = true;
type = "tackle";
if ((_root.game.passesNum == 0) and (_root.game.gameMode != "celebration")) {
if (_parent.ball.target.team == 1) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
if (((_x + fixedLineX) < _root.game.scrimmage) and (_root.game.downs > 0)) {
_parent.addMessage("sack");
} else {
_parent.addMessage("tackled");
}
}
if (_parent.ball.target.team == 2) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
if (((_x + fixedLineX) > _root.game.scrimmage) and (_root.game.downs > 0)) {
_parent.addMessage("sack");
} else {
_parent.addMessage("tackled");
}
}
} else if (_root.game.gameMode != "celebration") {
_parent.addMessage("tackled");
}
_root.game.pauseTime = 55;
}
}
function boundsPause() {
if (_root.game.timeOut == true) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
_root.game.scrimmage = _x + fixedLineX;
checkScrimmage();
}
if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "bounds";
_root.game.safed = true;
} else if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "bounds";
_root.game.safed = true;
} else {
type = "bounds";
}
type = "bounds";
_root.game.sound.gotoAndPlay("whistle");
tackled = true;
_parent.addMessage("outOfBounds");
_root.game.pauseTime = 55;
}
function turnedPause() {
if (_root.game.timeOut == true) {
_root.game.scrimmage = forwardProgress;
checkScrimmage();
}
type = "turn";
_root.game.sound.gotoAndPlay("whistle");
tackled = true;
_parent.addMessage("turnedAround");
_parent.addMessage("negativeProgress");
_root.game.pauseTime = 55;
}
function tackle() {
if ((_root.game.gameMode != "puntSafety") and (gameMode != "scrum")) {
if (_root.game.tdMode != false) {
if ((_root.game.timeOut == false) and (_root.game.gameMode != "celebration")) {
_root.game.startKickoff(_root.game.playersTeam);
_root.game.removeTackles();
tacked = false;
_root.game.tdMode = false;
} else if (_root.game.gameMode != "celebration") {
_root.game.removeTackles();
tacked = false;
_root.game.tdMode = false;
_root.game.gameMode = "convFail";
trace(_root.game.gameMode);
} else {
_root.game.removeTackles();
tacked = false;
}
} else if ((_root.game.downs <= 3.5) || (_root.game.goForIt == true)) {
if ((((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (type != "turn")) and (_root.game.downs > 0.5)) and (_root.game.ball.target == this)) and (_root.game.gameMode != "celebration")) {
_root.game.addMessage("Safety");
if (team != _root.game.playersTeam) {
_root.game.setupSafetyKick(_root.game.compTeam);
_root.game.hscore = _root.game.hscore + 2;
} else {
_root.game.setupSafetyKick(_root.game.playersTeam);
_root.game.gscore = _root.game.gscore + 2;
}
tackled = false;
} else if ((((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (type != "turn")) and (_root.game.downs > 0.5)) and (_root.game.ball.target == this)) and (_root.game.gameMode != "celebration")) {
_root.game.addMessage("Safety");
if (team != _root.game.playersTeam) {
_root.game.setupSafetyKick(_root.game.compTeam);
_root.game.hscore = _root.game.hscore + 2;
} else {
_root.game.setupSafetyKick(_root.game.playersTeam);
_root.game.gscore = _root.game.gscore + 2;
}
tackled = false;
} else {
_root.game.changeMode = false;
tackled = false;
if (type == "turn") {
var _local4 = forwardProgress;
} else {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
var _local4 = _x + fixedLineX;
}
_root.game.scrimmage = _local4;
if (_parent.ball.target.team != _root.game.playersTeam) {
var _local5 = random(2);
if (_local5 == 1) {
_root.game.compPlayType = "passing";
_root.game.setupLine(_root.game.compTeam, _root.game.formationShotgun, _local4, 0.5);
} else {
_root.game.compPlayType = "running";
_root.game.setupLine(_root.game.compTeam, _root.game.formationI, _local4, 0.5);
}
_root.game.setupLine(_root.game.playersTeam, _root.game.formation43, _local4, 0.5);
} else {
var _local5 = 1 + random(5);
_root.game.compPlayType = "defense";
_root.game.setupLine(_root.game.compTeam, _root.game["formationDefence" + _local5], _local4, 0.5);
_root.game.setupLine(_root.game.playersTeam, _root.game.formationShotgun, _local4, 0.5);
}
}
} else if ((_root.game.goForIt == true) and (_root.game.gameMode == "plays")) {
if (_root.game.changeMode == false) {
_root.game.downs = _root.game.downs + 1;
}
_root.game.pauseTime = 0;
_root.game.paused = false;
tackled = false;
} else if (_root.game.gameMode == "plays") {
_root.game.pauseTime = 0;
_root.game.paused = false;
if (_root.game.changeMode == false) {
_root.game.downs = _root.game.downs + 1;
}
tackled = false;
}
}
}
function checkWalls() {
if ((_y + 10) > _root.game.pitchFrontY) {
if (((yspeed > 1) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) {
checkOutOfBounds();
}
_y = (_y - 1);
yspeed = (-yspeed) * 0.5;
}
if ((_y - 5) < _root.game.pitchBackY) {
if (((yspeed < 1) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) {
checkOutOfBounds();
}
_y = (_y + 1);
yspeed = (-yspeed) * 0.5;
}
if (_root.game.walls.hitTest(xpos + (hitArea._width / 2), ypos, true) and (_x > 300)) {
_x = (_x - 2);
xspeed = (-xspeed) * 0.5;
}
if (_root.game.walls.hitTest(xpos - (hitArea._width / 2), ypos, true) and (_x < 300)) {
_x = (_x + 2);
xspeed = (-xspeed) * 0.5;
}
}
function checkCollision(b1, b2) {
var _local12 = b2._x - b1._x;
var _local11 = b2._y - b1._y;
var _local19 = Math.sqrt((_local12 * _local12) + (_local11 * _local11));
if (_local19 < (b1.rad + b2.rad)) {
if (((_parent.ball.target == this) and (b2.team != this.team)) || ((_parent.ball.target == b2) and (this.team != b2.team))) {
tacklePause();
}
if (_root.game.gameMode == "plays") {
var _local8 = 0;
if (xspeed < 0) {
_local8 = _local8 + (-xspeed);
} else {
_local8 = _local8 + xspeed;
}
if (yspeed < 0) {
_local8 = _local8 + (-yspeed);
} else {
_local8 = _local8 + yspeed;
}
if (_local8 > 1) {
hitSound.setVolume(_local8 * 15);
hitSound.start(0, 0);
hitSound.setVolume(_local8 * 15);
}
}
var _local18 = Math.atan2(_local11, _local12);
var _local7 = Math.cos(_local18);
var _local6 = Math.sin(_local18);
var _local9 = (_local7 * b1.xspeed) + (_local6 * b1.yspeed);
var _local15 = (_local7 * b1.yspeed) - (_local6 * b1.xspeed);
var _local10 = (_local7 * b2.xspeed) + (_local6 * b2.yspeed);
var _local14 = (_local7 * b2.yspeed) - (_local6 * b2.xspeed);
var _local21 = (_local9 * b1.mass) + (_local10 * b2.mass);
var _local20 = _local9 - _local10;
_local9 = (_local21 - (b2.mass * _local20)) / (b1.mass + b2.mass);
_local10 = _local20 + _local9;
b1.xspeed = ((_local7 * _local9) - (_local6 * _local15)) * 0.7;
b1.yspeed = ((_local7 * _local15) + (_local6 * _local9)) * 0.7;
b2.xspeed = ((_local7 * _local10) - (_local6 * _local14)) * 0.7;
b2.yspeed = ((_local7 * _local14) + (_local6 * _local10)) * 0.7;
var _local16 = ((b1.rad + b2.rad) - _local19) / 2;
var _local17 = _local7 * _local16;
var _local13 = _local6 * _local16;
b1._x = b1._x - (_local17 * 1.1);
b1._y = b1._y - (_local13 * 1.1);
b2._x = b2._x + (_local17 * 1.1);
b2._y = b2._y + (_local13 * 1.1);
}
}
if (_root.game.gameMode == "kickOff") {
var xspeedEq = speed;
var yspeedEq = speed;
}
if (_root.game.cleanUp == true) {
this.removeMovieClip();
}
if ((_root.game.gameMode == "scrum") || (_root.game.gameMode == "kickOff")) {
forwardProgress = 0;
progressTimer = 0;
}
if (team == _root.game.playersTeam) {
if (_root.game.playType == "running") {
if (_root.game.playersTeam == 1) {
if ((((_name == "player7") || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else if ((((_name == "player18") || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else {
mass = 2;
}
}
if (team == _root.game.compTeam) {
if (_root.game.compPlayType == "running") {
if (_root.game.compTeam == 1) {
if ((((_name == "player7") || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else if ((((_name == "player18") || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else {
mass = 2;
}
}
if ((((((_name == "player22") and (parseInt(_root.game.ball.storedOwner.team) == 2)) and (_root.game.gameMode != "plays")) and (_root.game.gameMode != "celebration")) and (_root.game.paused == false)) || (((((_name == "player11") and (parseInt(_root.game.ball.storedOwner.team) == 1)) and (_root.game.gameMode != "plays")) and (_root.game.gameMode != "celebration")) and (_root.game.paused == false))) {
if (_currentframe == 1) {
gotoAndStop (3);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(10);
}
} else if (_currentframe == 2) {
gotoAndStop (4);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(10);
}
}
} else if (((((_name == "player22") and (_root.game.gameMode != "plays")) and (_root.game.paused == false)) and (_root.game.gameMode != "celebration")) and (_root.game.gameMode != "shot")) {
gotoAndStop(_root.game.player21._currentframe);
} else if (((((_name == "player11") and (_root.game.gameMode != "plays")) and (_root.game.paused == false)) and (_root.game.gameMode != "celebration")) and (_root.game.gameMode != "shot")) {
gotoAndStop(_root.game.player10._currentframe);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(_root.game.player10.ani._currentframe);
}
}
if ((tackled == true) and (_root.game.paused == false)) {
tackle();
}
if (_root.game.paused == false) {
if (_parent.ball.target != this) {
arrow.gotoAndStop(1);
var arrowPlayed = false;
heldTime = 0;
} else {
if ((_parent.passesNum == 1) || (_root.game.downs == 0)) {
if (team == 1) {
if ((((xspeed < 0) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) and (_root.game.messageList.length == 0)) {
if ((_root.game.tdMode == false) || ((_root.game.tdMode != false) and (_parent.passesNum > 0))) {
progressTimer = progressTimer + 1;
if ((forwardProgress == 0) || (forwardProgress < (_x + fixedLineX))) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
forwardProgress = _x + fixedLineX;
}
if (progressTimer > 50) {
turnedPause();
progressTimer = 0;
}
} else {
progressTimer = 0;
}
}
} else if ((((xspeed > 0) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) and (_root.game.messageList.length == 0)) {
if ((_root.game.tdMode == false) || ((_root.game.tdMode != false) and (_parent.passesNum > 0))) {
progressTimer = progressTimer + 1;
if ((forwardProgress == 0) || (forwardProgress > (_x + fixedLineX))) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
forwardProgress = _x + fixedLineX;
}
if (progressTimer > 50) {
turnedPause();
progressTimer = 0;
}
} else {
progressTimer = 0;
}
}
}
if ((((team == 1) and (_root.game.gameMode == "plays")) and (team != _root.game.playersTeam)) || (((team == 1) and (_root.game.gameMode == "plays")) and (_root.game.demoMode == true))) {
heldTime = heldTime + 1;
var playerAmount = 12;
i = 1;
while (i < playerAmount) {
var target = _root.game["player" + i];
var randFactor = random(3);
if (((((((((target._x > (_x + 40)) and (_parent.passesNum == 0)) and (heldTime > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed > (1.5 * _root.game.vibrationVal))) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || ((((_parent.nzone.hitTest(target.xpos, target.ypos, true) and (target._x > _x)) and (_parent.passesNum == 0)) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing"))) || ((((((((target._x > (_x + 40)) and (_parent.passesNum == 0)) and (heldTime > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed > 1.5)) and (_root.game.downs > 0)) and (_root.game.playType == "passing")) and (_root.game.demoMode == true))) {
_parent.passesNum = _parent.passesNum + 1;
_parent.ball.target = "";
_parent.ball.targetX = _root.game["player" + i]._x + (_root.game["player" + i].xspeed * (8 + random(15)));
_parent.ball.targetY = (_root.game["player" + i]._y - 10) + (_root.game["player" + i].yspeed * (8 + random(15)));
var dx = (_parent.ball.targetX - _parent.ball._x);
var dy = (_parent.ball.targetY - _parent.ball._y);
var dist = Math.sqrt((dx * dx) + (dy * dy));
_parent.ball.xspeed = dx / (dist / 10);
_parent.ball.yspeed = dy / (dist / 10);
_parent.ball.zspeed = -(dist / 20);
_parent.ball.zpos = 4;
}
i = i + 1;
}
} else {
heldTime = 0;
}
if ((((team == 2) and (_root.game.gameMode == "plays")) and (team != _root.game.playersTeam)) || (((team == 2) and (_root.game.gameMode == "plays")) and (_root.game.demoMode == true))) {
heldTime2 = heldTime2 + 1;
var playerAmount = 23;
i = 12;
while (i < playerAmount) {
var target = _root.game["player" + i];
var randFactor = random(3);
if ((((((((target._x < (_x - 40)) and (_parent.passesNum == 0)) and (heldTime2 > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed < (-1.5 * _root.game.vibrationVal))) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || ((((_parent.nzone.hitTest(target.xpos, target.ypos, true) and (target._x < _x)) and (_parent.passesNum == 0)) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing"))) {
_parent.passesNum = _parent.passesNum + 1;
_parent.ball.target = "";
_parent.ball.targetX = _root.game["player" + i]._x + (_root.game["player" + i].xspeed * (8 + random(15)));
_parent.ball.targetY = (_root.game["player" + i]._y - 10) + (_root.game["player" + i].yspeed * (8 + random(15)));
var dx = (_parent.ball.targetX - _parent.ball._x);
var dy = (_parent.ball.targetY - _parent.ball._y);
var dist = Math.sqrt((dx * dx) + (dy * dy));
_parent.ball.xspeed = dx / (dist / 10);
_parent.ball.yspeed = dy / (dist / 10);
_parent.ball.zspeed = -(dist / 20);
_parent.ball.zpos = 4;
}
i = i + 1;
}
} else {
heldTime2 = 0;
}
if (arrowPlayed == false) {
arrow.play();
var arrowPlayed = true;
}
}
if ((_root.game.gameMode == "plays") and (_parent.ball.target == "")) {
if ((((((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player22")) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player11"))) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player4"))) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player16"))) {
} else {
var catchRad = (rad * 2.5);
var zcatch = 4;
}
if (_root.game.ball.target == "") {
if ((_root.game.ball._x < (_x + 50)) and (_root.game.ball._x > (_x - 50))) {
if ((((_root.game.lastGameMode == "kickOff") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player22")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "kickOff") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player11")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "punt") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player15")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "punt") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player4")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "puntSafety") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player15")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "puntSafety") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player4")) {
_root.game.ball.target = this;
}
}
if ((_root.game.ball._x < (_x + 20)) and (_root.game.ball._x > (_x - 20))) {
var dx = (_parent.ball._x - _x);
var dy = (_parent.ball._y - (_y - 10));
var dist = Math.sqrt((dx * dx) + (dy * dy));
if (((dist < catchRad) and (_parent.ball.zpos < zcatch)) and (_root.game.ball.bounce < 1)) {
if ((_parent.ball.storedOwner.team != team) and (_parent.ball.storedOwner.team > 0)) {
if (_root.game.tdMode != false) {
tacklePause();
} else {
_parent.scoreboard.bigscreen.ani.gotoAndPlay("intercept");
_root.game.downs = 0;
intercepted = true;
_root.game.intercepted = true;
}
}
_parent.ball.target = this;
arrow.play();
}
var dx = ((_parent.ball._x + _root.game.ball.xspeed) - _x);
var dy = ((_parent.ball._y + _root.game.ball.yspeed) - (_y - 10));
var dist = Math.sqrt((dx * dx) + (dy * dy));
if (((dist < catchRad) and (_parent.ball.zpos < zcatch)) and (_root.game.ball.bounce < 1)) {
if ((_parent.ball.storedOwner.team != team) and (_parent.ball.storedOwner.team > 0)) {
if (_root.game.tdMode != false) {
tacklePause();
} else {
_parent.scoreboard.bigscreen.ani.gotoAndPlay("intercept");
_root.game.downs = 0;
intercepted = true;
_root.game.intercepted = true;
}
}
_parent.ball.target = this;
arrow.play();
}
}
}
}
xpos = _x + _root.game._x;
ypos = _y + _root.game._y;
speed = 0.12 * _root.game.vibrationVal;
currentY = _y - _root.game.pitchBackY;
posY = currentY / _root.game.pitchFrontY;
percent = _root.game.pitchDepth / _root.game.horizon;
depthScale = (1 - percent) + (posY * percent);
if (intercepted == true) {
speedDone = false;
intercepted = false;
}
if ((_root.game.vibrate == true) and (_root.game.paused == false)) {
rotTimer = 1 + random(20 * _root.game.vibrationVal);
if (rotTimer == 1) {
rotInc = (-30 + random(60)) / 140;
}
rotVel = rotVel + rotInc;
if (((_root.game.gameMode == "plays") and (speedDone == false)) || (_root.game.mouseIsDown == true)) {
if (_root.game.lastGameMode != "kickOff") {
speedDone = true;
if (_root.game.ball.target != this) {
if (((_root.game.playType == "running") and (team == _root.game.playersTeam)) || ((_root.game.compPlayType == "running") and (team == _root.game.compTeam))) {
if ((((((((((_name == "player22") || (_name == "player18")) || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) || (_name == "player11")) || (_name == "player7")) || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
var xspeedEq = (speed * 1.5);
var yspeedEq = (speed * 1.5);
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else if (((_root.game.playType == "defense") and (team == _root.game.playersTeam)) || ((_root.game.compPlayType == "defense") and (team == _root.game.compTeam))) {
if ((_root.downs >= 1) and (_root.game.blitz == false)) {
if ((((_name == "player8") || (_name == "player9")) || (_name == "player19")) || (_name == "player20")) {
var xspeedEq = (-(speed / 3));
var yspeedEq = (-(speed / 3));
} else if ((((_name == "player10") || (_name == "player11")) || (_name == "player21")) || (_name == "player22")) {
var xspeedEq = (-(speed / 5));
var yspeedEq = (-(speed / 5));
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else if (((((_root.game.passesNum == 0) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || (((_root.game.passesNum == 0) and (_root.game.downs > 0)) and (_root.game.playType == "passing"))) || (((_root.game.passesNum == 0) and (_root.game.tdMode != false)) and (_root.game.playType == "passing"))) {
var xspeedEq = (-(speed / 6));
var yspeedEq = (-(speed / 6));
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
}
}
if ((_root.game.gameMode != "plays") || (_root.game.paused == true)) {
speedDone = false;
}
if (((_root.game.gameMode == "plays") || (_root.game.gameMode == "celebration")) || (_root.game.gameMode == "shot")) {
xspeed = xspeed + (Math.cos((rot - 180) * (Math.PI/180)) * xspeedEq);
yspeed = yspeed + (Math.sin((rot - 180) * (Math.PI/180)) * yspeedEq);
}
if (collisionTimer < 1) {
collisionTimer = collisionTimer + 1;
} else {
collisionTimer = 0;
}
if (((_root.game.vibrate == true) and (_root.game.paused == false)) || (_root.game.mouseIsDown == true)) {
if ((collisionTimer == 0) and (team == 1)) {
i = 0;
while (i < (_root.game.playerNum + 1)) {
var target = _root.game["player" + i];
if (_name != ("player" + i)) {
checkCollision(this, target);
}
i = i + 1;
}
checkWalls();
}
if ((collisionTimer == 1) and (team == 2)) {
i = 12;
while (i < (_root.game.playerNum + 1)) {
var target = _root.game["player" + i];
if (_name != ("player" + i)) {
checkCollision(this, target);
}
i = i + 1;
}
checkWalls();
}
}
if (_root.game.gameMode == "puntSafety") {
checkWalls();
}
xspeed = xspeed * 0.97;
yspeed = yspeed * 0.97;
rotVel = rotVel * 0.97;
this.swapDepths(_y + (_x / 5));
if ((_name == "player22") and (_root.game.playType == "running")) {
} else {
var aniFrames = ani._totalframes;
rotStored = rotStored + rotVel;
if (rotStored > (360 / aniFrames)) {
if (ani._currentframe < aniFrames) {
ani.nextFrame();
} else {
ani.gotoAndStop(1);
}
rotStored = rotStored - (360 / aniFrames);
}
if (rotStored < (-(360 / aniFrames))) {
if (ani._currentframe > 1) {
ani.prevFrame();
} else {
ani.gotoAndStop(aniFrames);
}
rotStored = rotStored + (360 / aniFrames);
}
rot = rot + rotVel;
_xscale = (depthScale * 110);
_yscale = _xscale;
}
if (((_root.game.gameMode == "plays") || (_root.game.gameMode == "celebration")) || (_root.game.gameMode == "shot")) {
_x = (_x + (xspeed * depthScale));
_y = (_y + (yspeed * depthScale));
}
}
}
Instance of Symbol 198 MovieClip "player6" in Symbol 494 MovieClip Frame 2
onClipEvent (load) {
hitSound = new Sound(this);
hitSound.attachSound("hitSound");
xspeed = 0;
yspeed = 0;
speed = 0.1 * _root.game.vibrationVal;
currentY = _y - _root.game.pitchBackY;
posY = currentY / _root.game.pitchFrontY;
percent = _root.game.pitchDepth / _root.game.horizon;
depthScale = (1 - percent) + (posY * percent);
rotVel = 0;
rotInc = 0;
rotTimer = random(20);
_rotation = 0;
xpos = _x + _root.game._x;
ypos = _y + _root.game._y;
_root.game.playerNum = _root.game.playerNum + 1;
mass = 2;
rad = hitArea._width / 2.3;
team = 0;
if (parseInt(substring(_name, 7, 2)) < 12) {
team = 1;
rot = 180;
origRot = rot;
if ((_name == "player22") || (_name == "player11")) {
gotoAndStop (4);
} else {
gotoAndStop (2);
}
ani.gotoAndStop(10);
} else {
team = 2;
rot = 0;
origRot = rot;
if ((_name == "player22") || (_name == "player11")) {
gotoAndStop (3);
} else {
gotoAndStop (1);
}
ani.gotoAndStop(1);
}
if (team == 2) {
trace(((("new Array(" + Math.round(_x)) + ",") + Math.round(_y)) + "),");
}
rotStored = 0;
heldTime = 0;
heldTime2 = 0;
tackled = false;
forwardProgress = 0;
progressTimer = 0;
type = "";
fixedLineX = 0;
speedDone = false;
var xspeedEq = speed;
var yspeedEq = speed;
storedVar = "";
collisionTimer = 0;
intercepted = false;
}
onClipEvent (enterFrame) {
function checkOutOfBounds() {
if (_root.game.ball.target == this) {
boundsPause();
if ((ani._currentframe < 6) || (ani._currentframe > 14)) {
if (team == 1) {
}
} else if ((ani._currentframe > 6) and (ani._currentframe < 14)) {
if (team == 2) {
}
}
}
}
function checkScrimmage() {
if (team == 1) {
if (_root.game.scrimmage < _root.game.endZoneL) {
_root.game.scrimmage = _root.game.twentyYardLineL;
_root.game.touchBack = true;
} else {
_root.game.touchBack = false;
}
if (_root.game.scrimmage > _root.game.endZoneR) {
_root.game.scrimmage = _root.game.endZoneR;
}
} else {
if (_root.game.scrimmage < _root.game.endZoneL) {
_root.game.scrimmage = _root.game.endZoneL;
}
if (_root.game.scrimmage > _root.game.endZoneR) {
_root.game.scrimmage = _root.game.twentyYardLineR;
_root.game.touchBack = true;
} else {
_root.game.touchBack = false;
}
}
}
function tacklePause() {
type = "tackle";
if ((_root.game.timeOut == true) and (_root.game.tdMode == false)) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
_root.game.scrimmage = _x + fixedLineX;
checkScrimmage();
}
if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "tackle";
_root.game.safed = true;
} else if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "tackle";
_root.game.safed = true;
} else {
type = "tackle";
}
if ((_root.game.paused == false) and (_root.game.gameMode != "celebration")) {
_root.game.sound.gotoAndPlay("whistle");
}
if (((((_root.game.gameMode == "plays") and (_root.game.paused == false)) || ((_root.game.gameMode == "kickOff") and (_root.game.paused == false))) || ((_root.game.gameMode == "punt") and (_root.game.paused == false))) || (((_root.game.tdMode != false) and (_root.game.paused == false)) and (_root.game.gameMode == "plays"))) {
tackled = true;
type = "tackle";
if ((_root.game.passesNum == 0) and (_root.game.gameMode != "celebration")) {
if (_parent.ball.target.team == 1) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
if (((_x + fixedLineX) < _root.game.scrimmage) and (_root.game.downs > 0)) {
_parent.addMessage("sack");
} else {
_parent.addMessage("tackled");
}
}
if (_parent.ball.target.team == 2) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
if (((_x + fixedLineX) > _root.game.scrimmage) and (_root.game.downs > 0)) {
_parent.addMessage("sack");
} else {
_parent.addMessage("tackled");
}
}
} else if (_root.game.gameMode != "celebration") {
_parent.addMessage("tackled");
}
_root.game.pauseTime = 55;
}
}
function boundsPause() {
if (_root.game.timeOut == true) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
_root.game.scrimmage = _x + fixedLineX;
checkScrimmage();
}
if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "bounds";
_root.game.safed = true;
} else if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "bounds";
_root.game.safed = true;
} else {
type = "bounds";
}
type = "bounds";
_root.game.sound.gotoAndPlay("whistle");
tackled = true;
_parent.addMessage("outOfBounds");
_root.game.pauseTime = 55;
}
function turnedPause() {
if (_root.game.timeOut == true) {
_root.game.scrimmage = forwardProgress;
checkScrimmage();
}
type = "turn";
_root.game.sound.gotoAndPlay("whistle");
tackled = true;
_parent.addMessage("turnedAround");
_parent.addMessage("negativeProgress");
_root.game.pauseTime = 55;
}
function tackle() {
if ((_root.game.gameMode != "puntSafety") and (gameMode != "scrum")) {
if (_root.game.tdMode != false) {
if ((_root.game.timeOut == false) and (_root.game.gameMode != "celebration")) {
_root.game.startKickoff(_root.game.playersTeam);
_root.game.removeTackles();
tacked = false;
_root.game.tdMode = false;
} else if (_root.game.gameMode != "celebration") {
_root.game.removeTackles();
tacked = false;
_root.game.tdMode = false;
_root.game.gameMode = "convFail";
trace(_root.game.gameMode);
} else {
_root.game.removeTackles();
tacked = false;
}
} else if ((_root.game.downs <= 3.5) || (_root.game.goForIt == true)) {
if ((((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (type != "turn")) and (_root.game.downs > 0.5)) and (_root.game.ball.target == this)) and (_root.game.gameMode != "celebration")) {
_root.game.addMessage("Safety");
if (team != _root.game.playersTeam) {
_root.game.setupSafetyKick(_root.game.compTeam);
_root.game.hscore = _root.game.hscore + 2;
} else {
_root.game.setupSafetyKick(_root.game.playersTeam);
_root.game.gscore = _root.game.gscore + 2;
}
tackled = false;
} else if ((((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (type != "turn")) and (_root.game.downs > 0.5)) and (_root.game.ball.target == this)) and (_root.game.gameMode != "celebration")) {
_root.game.addMessage("Safety");
if (team != _root.game.playersTeam) {
_root.game.setupSafetyKick(_root.game.compTeam);
_root.game.hscore = _root.game.hscore + 2;
} else {
_root.game.setupSafetyKick(_root.game.playersTeam);
_root.game.gscore = _root.game.gscore + 2;
}
tackled = false;
} else {
_root.game.changeMode = false;
tackled = false;
if (type == "turn") {
var _local4 = forwardProgress;
} else {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
var _local4 = _x + fixedLineX;
}
_root.game.scrimmage = _local4;
if (_parent.ball.target.team != _root.game.playersTeam) {
var _local5 = random(2);
if (_local5 == 1) {
_root.game.compPlayType = "passing";
_root.game.setupLine(_root.game.compTeam, _root.game.formationShotgun, _local4, 0.5);
} else {
_root.game.compPlayType = "running";
_root.game.setupLine(_root.game.compTeam, _root.game.formationI, _local4, 0.5);
}
_root.game.setupLine(_root.game.playersTeam, _root.game.formation43, _local4, 0.5);
} else {
var _local5 = 1 + random(5);
_root.game.compPlayType = "defense";
_root.game.setupLine(_root.game.compTeam, _root.game["formationDefence" + _local5], _local4, 0.5);
_root.game.setupLine(_root.game.playersTeam, _root.game.formationShotgun, _local4, 0.5);
}
}
} else if ((_root.game.goForIt == true) and (_root.game.gameMode == "plays")) {
if (_root.game.changeMode == false) {
_root.game.downs = _root.game.downs + 1;
}
_root.game.pauseTime = 0;
_root.game.paused = false;
tackled = false;
} else if (_root.game.gameMode == "plays") {
_root.game.pauseTime = 0;
_root.game.paused = false;
if (_root.game.changeMode == false) {
_root.game.downs = _root.game.downs + 1;
}
tackled = false;
}
}
}
function checkWalls() {
if ((_y + 10) > _root.game.pitchFrontY) {
if (((yspeed > 1) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) {
checkOutOfBounds();
}
_y = (_y - 1);
yspeed = (-yspeed) * 0.5;
}
if ((_y - 5) < _root.game.pitchBackY) {
if (((yspeed < 1) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) {
checkOutOfBounds();
}
_y = (_y + 1);
yspeed = (-yspeed) * 0.5;
}
if (_root.game.walls.hitTest(xpos + (hitArea._width / 2), ypos, true) and (_x > 300)) {
_x = (_x - 2);
xspeed = (-xspeed) * 0.5;
}
if (_root.game.walls.hitTest(xpos - (hitArea._width / 2), ypos, true) and (_x < 300)) {
_x = (_x + 2);
xspeed = (-xspeed) * 0.5;
}
}
function checkCollision(b1, b2) {
var _local12 = b2._x - b1._x;
var _local11 = b2._y - b1._y;
var _local19 = Math.sqrt((_local12 * _local12) + (_local11 * _local11));
if (_local19 < (b1.rad + b2.rad)) {
if (((_parent.ball.target == this) and (b2.team != this.team)) || ((_parent.ball.target == b2) and (this.team != b2.team))) {
tacklePause();
}
if (_root.game.gameMode == "plays") {
var _local8 = 0;
if (xspeed < 0) {
_local8 = _local8 + (-xspeed);
} else {
_local8 = _local8 + xspeed;
}
if (yspeed < 0) {
_local8 = _local8 + (-yspeed);
} else {
_local8 = _local8 + yspeed;
}
if (_local8 > 1) {
hitSound.setVolume(_local8 * 15);
hitSound.start(0, 0);
hitSound.setVolume(_local8 * 15);
}
}
var _local18 = Math.atan2(_local11, _local12);
var _local7 = Math.cos(_local18);
var _local6 = Math.sin(_local18);
var _local9 = (_local7 * b1.xspeed) + (_local6 * b1.yspeed);
var _local15 = (_local7 * b1.yspeed) - (_local6 * b1.xspeed);
var _local10 = (_local7 * b2.xspeed) + (_local6 * b2.yspeed);
var _local14 = (_local7 * b2.yspeed) - (_local6 * b2.xspeed);
var _local21 = (_local9 * b1.mass) + (_local10 * b2.mass);
var _local20 = _local9 - _local10;
_local9 = (_local21 - (b2.mass * _local20)) / (b1.mass + b2.mass);
_local10 = _local20 + _local9;
b1.xspeed = ((_local7 * _local9) - (_local6 * _local15)) * 0.7;
b1.yspeed = ((_local7 * _local15) + (_local6 * _local9)) * 0.7;
b2.xspeed = ((_local7 * _local10) - (_local6 * _local14)) * 0.7;
b2.yspeed = ((_local7 * _local14) + (_local6 * _local10)) * 0.7;
var _local16 = ((b1.rad + b2.rad) - _local19) / 2;
var _local17 = _local7 * _local16;
var _local13 = _local6 * _local16;
b1._x = b1._x - (_local17 * 1.1);
b1._y = b1._y - (_local13 * 1.1);
b2._x = b2._x + (_local17 * 1.1);
b2._y = b2._y + (_local13 * 1.1);
}
}
if (_root.game.gameMode == "kickOff") {
var xspeedEq = speed;
var yspeedEq = speed;
}
if (_root.game.cleanUp == true) {
this.removeMovieClip();
}
if ((_root.game.gameMode == "scrum") || (_root.game.gameMode == "kickOff")) {
forwardProgress = 0;
progressTimer = 0;
}
if (team == _root.game.playersTeam) {
if (_root.game.playType == "running") {
if (_root.game.playersTeam == 1) {
if ((((_name == "player7") || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else if ((((_name == "player18") || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else {
mass = 2;
}
}
if (team == _root.game.compTeam) {
if (_root.game.compPlayType == "running") {
if (_root.game.compTeam == 1) {
if ((((_name == "player7") || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else if ((((_name == "player18") || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else {
mass = 2;
}
}
if ((((((_name == "player22") and (parseInt(_root.game.ball.storedOwner.team) == 2)) and (_root.game.gameMode != "plays")) and (_root.game.gameMode != "celebration")) and (_root.game.paused == false)) || (((((_name == "player11") and (parseInt(_root.game.ball.storedOwner.team) == 1)) and (_root.game.gameMode != "plays")) and (_root.game.gameMode != "celebration")) and (_root.game.paused == false))) {
if (_currentframe == 1) {
gotoAndStop (3);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(10);
}
} else if (_currentframe == 2) {
gotoAndStop (4);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(10);
}
}
} else if (((((_name == "player22") and (_root.game.gameMode != "plays")) and (_root.game.paused == false)) and (_root.game.gameMode != "celebration")) and (_root.game.gameMode != "shot")) {
gotoAndStop(_root.game.player21._currentframe);
} else if (((((_name == "player11") and (_root.game.gameMode != "plays")) and (_root.game.paused == false)) and (_root.game.gameMode != "celebration")) and (_root.game.gameMode != "shot")) {
gotoAndStop(_root.game.player10._currentframe);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(_root.game.player10.ani._currentframe);
}
}
if ((tackled == true) and (_root.game.paused == false)) {
tackle();
}
if (_root.game.paused == false) {
if (_parent.ball.target != this) {
arrow.gotoAndStop(1);
var arrowPlayed = false;
heldTime = 0;
} else {
if ((_parent.passesNum == 1) || (_root.game.downs == 0)) {
if (team == 1) {
if ((((xspeed < 0) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) and (_root.game.messageList.length == 0)) {
if ((_root.game.tdMode == false) || ((_root.game.tdMode != false) and (_parent.passesNum > 0))) {
progressTimer = progressTimer + 1;
if ((forwardProgress == 0) || (forwardProgress < (_x + fixedLineX))) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
forwardProgress = _x + fixedLineX;
}
if (progressTimer > 50) {
turnedPause();
progressTimer = 0;
}
} else {
progressTimer = 0;
}
}
} else if ((((xspeed > 0) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) and (_root.game.messageList.length == 0)) {
if ((_root.game.tdMode == false) || ((_root.game.tdMode != false) and (_parent.passesNum > 0))) {
progressTimer = progressTimer + 1;
if ((forwardProgress == 0) || (forwardProgress > (_x + fixedLineX))) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
forwardProgress = _x + fixedLineX;
}
if (progressTimer > 50) {
turnedPause();
progressTimer = 0;
}
} else {
progressTimer = 0;
}
}
}
if ((((team == 1) and (_root.game.gameMode == "plays")) and (team != _root.game.playersTeam)) || (((team == 1) and (_root.game.gameMode == "plays")) and (_root.game.demoMode == true))) {
heldTime = heldTime + 1;
var playerAmount = 12;
i = 1;
while (i < playerAmount) {
var target = _root.game["player" + i];
var randFactor = random(3);
if (((((((((target._x > (_x + 40)) and (_parent.passesNum == 0)) and (heldTime > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed > (1.5 * _root.game.vibrationVal))) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || ((((_parent.nzone.hitTest(target.xpos, target.ypos, true) and (target._x > _x)) and (_parent.passesNum == 0)) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing"))) || ((((((((target._x > (_x + 40)) and (_parent.passesNum == 0)) and (heldTime > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed > 1.5)) and (_root.game.downs > 0)) and (_root.game.playType == "passing")) and (_root.game.demoMode == true))) {
_parent.passesNum = _parent.passesNum + 1;
_parent.ball.target = "";
_parent.ball.targetX = _root.game["player" + i]._x + (_root.game["player" + i].xspeed * (8 + random(15)));
_parent.ball.targetY = (_root.game["player" + i]._y - 10) + (_root.game["player" + i].yspeed * (8 + random(15)));
var dx = (_parent.ball.targetX - _parent.ball._x);
var dy = (_parent.ball.targetY - _parent.ball._y);
var dist = Math.sqrt((dx * dx) + (dy * dy));
_parent.ball.xspeed = dx / (dist / 10);
_parent.ball.yspeed = dy / (dist / 10);
_parent.ball.zspeed = -(dist / 20);
_parent.ball.zpos = 4;
}
i = i + 1;
}
} else {
heldTime = 0;
}
if ((((team == 2) and (_root.game.gameMode == "plays")) and (team != _root.game.playersTeam)) || (((team == 2) and (_root.game.gameMode == "plays")) and (_root.game.demoMode == true))) {
heldTime2 = heldTime2 + 1;
var playerAmount = 23;
i = 12;
while (i < playerAmount) {
var target = _root.game["player" + i];
var randFactor = random(3);
if ((((((((target._x < (_x - 40)) and (_parent.passesNum == 0)) and (heldTime2 > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed < (-1.5 * _root.game.vibrationVal))) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || ((((_parent.nzone.hitTest(target.xpos, target.ypos, true) and (target._x < _x)) and (_parent.passesNum == 0)) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing"))) {
_parent.passesNum = _parent.passesNum + 1;
_parent.ball.target = "";
_parent.ball.targetX = _root.game["player" + i]._x + (_root.game["player" + i].xspeed * (8 + random(15)));
_parent.ball.targetY = (_root.game["player" + i]._y - 10) + (_root.game["player" + i].yspeed * (8 + random(15)));
var dx = (_parent.ball.targetX - _parent.ball._x);
var dy = (_parent.ball.targetY - _parent.ball._y);
var dist = Math.sqrt((dx * dx) + (dy * dy));
_parent.ball.xspeed = dx / (dist / 10);
_parent.ball.yspeed = dy / (dist / 10);
_parent.ball.zspeed = -(dist / 20);
_parent.ball.zpos = 4;
}
i = i + 1;
}
} else {
heldTime2 = 0;
}
if (arrowPlayed == false) {
arrow.play();
var arrowPlayed = true;
}
}
if ((_root.game.gameMode == "plays") and (_parent.ball.target == "")) {
if ((((((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player22")) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player11"))) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player4"))) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player16"))) {
} else {
var catchRad = (rad * 2.5);
var zcatch = 4;
}
if (_root.game.ball.target == "") {
if ((_root.game.ball._x < (_x + 50)) and (_root.game.ball._x > (_x - 50))) {
if ((((_root.game.lastGameMode == "kickOff") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player22")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "kickOff") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player11")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "punt") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player15")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "punt") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player4")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "puntSafety") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player15")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "puntSafety") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player4")) {
_root.game.ball.target = this;
}
}
if ((_root.game.ball._x < (_x + 20)) and (_root.game.ball._x > (_x - 20))) {
var dx = (_parent.ball._x - _x);
var dy = (_parent.ball._y - (_y - 10));
var dist = Math.sqrt((dx * dx) + (dy * dy));
if (((dist < catchRad) and (_parent.ball.zpos < zcatch)) and (_root.game.ball.bounce < 1)) {
if ((_parent.ball.storedOwner.team != team) and (_parent.ball.storedOwner.team > 0)) {
if (_root.game.tdMode != false) {
tacklePause();
} else {
_parent.scoreboard.bigscreen.ani.gotoAndPlay("intercept");
_root.game.downs = 0;
intercepted = true;
_root.game.intercepted = true;
}
}
_parent.ball.target = this;
arrow.play();
}
var dx = ((_parent.ball._x + _root.game.ball.xspeed) - _x);
var dy = ((_parent.ball._y + _root.game.ball.yspeed) - (_y - 10));
var dist = Math.sqrt((dx * dx) + (dy * dy));
if (((dist < catchRad) and (_parent.ball.zpos < zcatch)) and (_root.game.ball.bounce < 1)) {
if ((_parent.ball.storedOwner.team != team) and (_parent.ball.storedOwner.team > 0)) {
if (_root.game.tdMode != false) {
tacklePause();
} else {
_parent.scoreboard.bigscreen.ani.gotoAndPlay("intercept");
_root.game.downs = 0;
intercepted = true;
_root.game.intercepted = true;
}
}
_parent.ball.target = this;
arrow.play();
}
}
}
}
xpos = _x + _root.game._x;
ypos = _y + _root.game._y;
speed = 0.12 * _root.game.vibrationVal;
currentY = _y - _root.game.pitchBackY;
posY = currentY / _root.game.pitchFrontY;
percent = _root.game.pitchDepth / _root.game.horizon;
depthScale = (1 - percent) + (posY * percent);
if (intercepted == true) {
speedDone = false;
intercepted = false;
}
if ((_root.game.vibrate == true) and (_root.game.paused == false)) {
rotTimer = 1 + random(20 * _root.game.vibrationVal);
if (rotTimer == 1) {
rotInc = (-30 + random(60)) / 140;
}
rotVel = rotVel + rotInc;
if (((_root.game.gameMode == "plays") and (speedDone == false)) || (_root.game.mouseIsDown == true)) {
if (_root.game.lastGameMode != "kickOff") {
speedDone = true;
if (_root.game.ball.target != this) {
if (((_root.game.playType == "running") and (team == _root.game.playersTeam)) || ((_root.game.compPlayType == "running") and (team == _root.game.compTeam))) {
if ((((((((((_name == "player22") || (_name == "player18")) || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) || (_name == "player11")) || (_name == "player7")) || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
var xspeedEq = (speed * 1.5);
var yspeedEq = (speed * 1.5);
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else if (((_root.game.playType == "defense") and (team == _root.game.playersTeam)) || ((_root.game.compPlayType == "defense") and (team == _root.game.compTeam))) {
if ((_root.downs >= 1) and (_root.game.blitz == false)) {
if ((((_name == "player8") || (_name == "player9")) || (_name == "player19")) || (_name == "player20")) {
var xspeedEq = (-(speed / 3));
var yspeedEq = (-(speed / 3));
} else if ((((_name == "player10") || (_name == "player11")) || (_name == "player21")) || (_name == "player22")) {
var xspeedEq = (-(speed / 5));
var yspeedEq = (-(speed / 5));
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else if (((((_root.game.passesNum == 0) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || (((_root.game.passesNum == 0) and (_root.game.downs > 0)) and (_root.game.playType == "passing"))) || (((_root.game.passesNum == 0) and (_root.game.tdMode != false)) and (_root.game.playType == "passing"))) {
var xspeedEq = (-(speed / 6));
var yspeedEq = (-(speed / 6));
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
}
}
if ((_root.game.gameMode != "plays") || (_root.game.paused == true)) {
speedDone = false;
}
if (((_root.game.gameMode == "plays") || (_root.game.gameMode == "celebration")) || (_root.game.gameMode == "shot")) {
xspeed = xspeed + (Math.cos((rot - 180) * (Math.PI/180)) * xspeedEq);
yspeed = yspeed + (Math.sin((rot - 180) * (Math.PI/180)) * yspeedEq);
}
if (collisionTimer < 1) {
collisionTimer = collisionTimer + 1;
} else {
collisionTimer = 0;
}
if (((_root.game.vibrate == true) and (_root.game.paused == false)) || (_root.game.mouseIsDown == true)) {
if ((collisionTimer == 0) and (team == 1)) {
i = 0;
while (i < (_root.game.playerNum + 1)) {
var target = _root.game["player" + i];
if (_name != ("player" + i)) {
checkCollision(this, target);
}
i = i + 1;
}
checkWalls();
}
if ((collisionTimer == 1) and (team == 2)) {
i = 12;
while (i < (_root.game.playerNum + 1)) {
var target = _root.game["player" + i];
if (_name != ("player" + i)) {
checkCollision(this, target);
}
i = i + 1;
}
checkWalls();
}
}
if (_root.game.gameMode == "puntSafety") {
checkWalls();
}
xspeed = xspeed * 0.97;
yspeed = yspeed * 0.97;
rotVel = rotVel * 0.97;
this.swapDepths(_y + (_x / 5));
if ((_name == "player22") and (_root.game.playType == "running")) {
} else {
var aniFrames = ani._totalframes;
rotStored = rotStored + rotVel;
if (rotStored > (360 / aniFrames)) {
if (ani._currentframe < aniFrames) {
ani.nextFrame();
} else {
ani.gotoAndStop(1);
}
rotStored = rotStored - (360 / aniFrames);
}
if (rotStored < (-(360 / aniFrames))) {
if (ani._currentframe > 1) {
ani.prevFrame();
} else {
ani.gotoAndStop(aniFrames);
}
rotStored = rotStored + (360 / aniFrames);
}
rot = rot + rotVel;
_xscale = (depthScale * 110);
_yscale = _xscale;
}
if (((_root.game.gameMode == "plays") || (_root.game.gameMode == "celebration")) || (_root.game.gameMode == "shot")) {
_x = (_x + (xspeed * depthScale));
_y = (_y + (yspeed * depthScale));
}
}
}
Instance of Symbol 198 MovieClip "player8" in Symbol 494 MovieClip Frame 2
onClipEvent (load) {
hitSound = new Sound(this);
hitSound.attachSound("hitSound");
xspeed = 0;
yspeed = 0;
speed = 0.1 * _root.game.vibrationVal;
currentY = _y - _root.game.pitchBackY;
posY = currentY / _root.game.pitchFrontY;
percent = _root.game.pitchDepth / _root.game.horizon;
depthScale = (1 - percent) + (posY * percent);
rotVel = 0;
rotInc = 0;
rotTimer = random(20);
_rotation = 0;
xpos = _x + _root.game._x;
ypos = _y + _root.game._y;
_root.game.playerNum = _root.game.playerNum + 1;
mass = 2;
rad = hitArea._width / 2.3;
team = 0;
if (parseInt(substring(_name, 7, 2)) < 12) {
team = 1;
rot = 180;
origRot = rot;
if ((_name == "player22") || (_name == "player11")) {
gotoAndStop (4);
} else {
gotoAndStop (2);
}
ani.gotoAndStop(10);
} else {
team = 2;
rot = 0;
origRot = rot;
if ((_name == "player22") || (_name == "player11")) {
gotoAndStop (3);
} else {
gotoAndStop (1);
}
ani.gotoAndStop(1);
}
if (team == 2) {
trace(((("new Array(" + Math.round(_x)) + ",") + Math.round(_y)) + "),");
}
rotStored = 0;
heldTime = 0;
heldTime2 = 0;
tackled = false;
forwardProgress = 0;
progressTimer = 0;
type = "";
fixedLineX = 0;
speedDone = false;
var xspeedEq = speed;
var yspeedEq = speed;
storedVar = "";
collisionTimer = 0;
intercepted = false;
}
onClipEvent (enterFrame) {
function checkOutOfBounds() {
if (_root.game.ball.target == this) {
boundsPause();
if ((ani._currentframe < 6) || (ani._currentframe > 14)) {
if (team == 1) {
}
} else if ((ani._currentframe > 6) and (ani._currentframe < 14)) {
if (team == 2) {
}
}
}
}
function checkScrimmage() {
if (team == 1) {
if (_root.game.scrimmage < _root.game.endZoneL) {
_root.game.scrimmage = _root.game.twentyYardLineL;
_root.game.touchBack = true;
} else {
_root.game.touchBack = false;
}
if (_root.game.scrimmage > _root.game.endZoneR) {
_root.game.scrimmage = _root.game.endZoneR;
}
} else {
if (_root.game.scrimmage < _root.game.endZoneL) {
_root.game.scrimmage = _root.game.endZoneL;
}
if (_root.game.scrimmage > _root.game.endZoneR) {
_root.game.scrimmage = _root.game.twentyYardLineR;
_root.game.touchBack = true;
} else {
_root.game.touchBack = false;
}
}
}
function tacklePause() {
type = "tackle";
if ((_root.game.timeOut == true) and (_root.game.tdMode == false)) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
_root.game.scrimmage = _x + fixedLineX;
checkScrimmage();
}
if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "tackle";
_root.game.safed = true;
} else if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "tackle";
_root.game.safed = true;
} else {
type = "tackle";
}
if ((_root.game.paused == false) and (_root.game.gameMode != "celebration")) {
_root.game.sound.gotoAndPlay("whistle");
}
if (((((_root.game.gameMode == "plays") and (_root.game.paused == false)) || ((_root.game.gameMode == "kickOff") and (_root.game.paused == false))) || ((_root.game.gameMode == "punt") and (_root.game.paused == false))) || (((_root.game.tdMode != false) and (_root.game.paused == false)) and (_root.game.gameMode == "plays"))) {
tackled = true;
type = "tackle";
if ((_root.game.passesNum == 0) and (_root.game.gameMode != "celebration")) {
if (_parent.ball.target.team == 1) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
if (((_x + fixedLineX) < _root.game.scrimmage) and (_root.game.downs > 0)) {
_parent.addMessage("sack");
} else {
_parent.addMessage("tackled");
}
}
if (_parent.ball.target.team == 2) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
if (((_x + fixedLineX) > _root.game.scrimmage) and (_root.game.downs > 0)) {
_parent.addMessage("sack");
} else {
_parent.addMessage("tackled");
}
}
} else if (_root.game.gameMode != "celebration") {
_parent.addMessage("tackled");
}
_root.game.pauseTime = 55;
}
}
function boundsPause() {
if (_root.game.timeOut == true) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
_root.game.scrimmage = _x + fixedLineX;
checkScrimmage();
}
if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "bounds";
_root.game.safed = true;
} else if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "bounds";
_root.game.safed = true;
} else {
type = "bounds";
}
type = "bounds";
_root.game.sound.gotoAndPlay("whistle");
tackled = true;
_parent.addMessage("outOfBounds");
_root.game.pauseTime = 55;
}
function turnedPause() {
if (_root.game.timeOut == true) {
_root.game.scrimmage = forwardProgress;
checkScrimmage();
}
type = "turn";
_root.game.sound.gotoAndPlay("whistle");
tackled = true;
_parent.addMessage("turnedAround");
_parent.addMessage("negativeProgress");
_root.game.pauseTime = 55;
}
function tackle() {
if ((_root.game.gameMode != "puntSafety") and (gameMode != "scrum")) {
if (_root.game.tdMode != false) {
if ((_root.game.timeOut == false) and (_root.game.gameMode != "celebration")) {
_root.game.startKickoff(_root.game.playersTeam);
_root.game.removeTackles();
tacked = false;
_root.game.tdMode = false;
} else if (_root.game.gameMode != "celebration") {
_root.game.removeTackles();
tacked = false;
_root.game.tdMode = false;
_root.game.gameMode = "convFail";
trace(_root.game.gameMode);
} else {
_root.game.removeTackles();
tacked = false;
}
} else if ((_root.game.downs <= 3.5) || (_root.game.goForIt == true)) {
if ((((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (type != "turn")) and (_root.game.downs > 0.5)) and (_root.game.ball.target == this)) and (_root.game.gameMode != "celebration")) {
_root.game.addMessage("Safety");
if (team != _root.game.playersTeam) {
_root.game.setupSafetyKick(_root.game.compTeam);
_root.game.hscore = _root.game.hscore + 2;
} else {
_root.game.setupSafetyKick(_root.game.playersTeam);
_root.game.gscore = _root.game.gscore + 2;
}
tackled = false;
} else if ((((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (type != "turn")) and (_root.game.downs > 0.5)) and (_root.game.ball.target == this)) and (_root.game.gameMode != "celebration")) {
_root.game.addMessage("Safety");
if (team != _root.game.playersTeam) {
_root.game.setupSafetyKick(_root.game.compTeam);
_root.game.hscore = _root.game.hscore + 2;
} else {
_root.game.setupSafetyKick(_root.game.playersTeam);
_root.game.gscore = _root.game.gscore + 2;
}
tackled = false;
} else {
_root.game.changeMode = false;
tackled = false;
if (type == "turn") {
var _local4 = forwardProgress;
} else {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
var _local4 = _x + fixedLineX;
}
_root.game.scrimmage = _local4;
if (_parent.ball.target.team != _root.game.playersTeam) {
var _local5 = random(2);
if (_local5 == 1) {
_root.game.compPlayType = "passing";
_root.game.setupLine(_root.game.compTeam, _root.game.formationShotgun, _local4, 0.5);
} else {
_root.game.compPlayType = "running";
_root.game.setupLine(_root.game.compTeam, _root.game.formationI, _local4, 0.5);
}
_root.game.setupLine(_root.game.playersTeam, _root.game.formation43, _local4, 0.5);
} else {
var _local5 = 1 + random(5);
_root.game.compPlayType = "defense";
_root.game.setupLine(_root.game.compTeam, _root.game["formationDefence" + _local5], _local4, 0.5);
_root.game.setupLine(_root.game.playersTeam, _root.game.formationShotgun, _local4, 0.5);
}
}
} else if ((_root.game.goForIt == true) and (_root.game.gameMode == "plays")) {
if (_root.game.changeMode == false) {
_root.game.downs = _root.game.downs + 1;
}
_root.game.pauseTime = 0;
_root.game.paused = false;
tackled = false;
} else if (_root.game.gameMode == "plays") {
_root.game.pauseTime = 0;
_root.game.paused = false;
if (_root.game.changeMode == false) {
_root.game.downs = _root.game.downs + 1;
}
tackled = false;
}
}
}
function checkWalls() {
if ((_y + 10) > _root.game.pitchFrontY) {
if (((yspeed > 1) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) {
checkOutOfBounds();
}
_y = (_y - 1);
yspeed = (-yspeed) * 0.5;
}
if ((_y - 5) < _root.game.pitchBackY) {
if (((yspeed < 1) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) {
checkOutOfBounds();
}
_y = (_y + 1);
yspeed = (-yspeed) * 0.5;
}
if (_root.game.walls.hitTest(xpos + (hitArea._width / 2), ypos, true) and (_x > 300)) {
_x = (_x - 2);
xspeed = (-xspeed) * 0.5;
}
if (_root.game.walls.hitTest(xpos - (hitArea._width / 2), ypos, true) and (_x < 300)) {
_x = (_x + 2);
xspeed = (-xspeed) * 0.5;
}
}
function checkCollision(b1, b2) {
var _local12 = b2._x - b1._x;
var _local11 = b2._y - b1._y;
var _local19 = Math.sqrt((_local12 * _local12) + (_local11 * _local11));
if (_local19 < (b1.rad + b2.rad)) {
if (((_parent.ball.target == this) and (b2.team != this.team)) || ((_parent.ball.target == b2) and (this.team != b2.team))) {
tacklePause();
}
if (_root.game.gameMode == "plays") {
var _local8 = 0;
if (xspeed < 0) {
_local8 = _local8 + (-xspeed);
} else {
_local8 = _local8 + xspeed;
}
if (yspeed < 0) {
_local8 = _local8 + (-yspeed);
} else {
_local8 = _local8 + yspeed;
}
if (_local8 > 1) {
hitSound.setVolume(_local8 * 15);
hitSound.start(0, 0);
hitSound.setVolume(_local8 * 15);
}
}
var _local18 = Math.atan2(_local11, _local12);
var _local7 = Math.cos(_local18);
var _local6 = Math.sin(_local18);
var _local9 = (_local7 * b1.xspeed) + (_local6 * b1.yspeed);
var _local15 = (_local7 * b1.yspeed) - (_local6 * b1.xspeed);
var _local10 = (_local7 * b2.xspeed) + (_local6 * b2.yspeed);
var _local14 = (_local7 * b2.yspeed) - (_local6 * b2.xspeed);
var _local21 = (_local9 * b1.mass) + (_local10 * b2.mass);
var _local20 = _local9 - _local10;
_local9 = (_local21 - (b2.mass * _local20)) / (b1.mass + b2.mass);
_local10 = _local20 + _local9;
b1.xspeed = ((_local7 * _local9) - (_local6 * _local15)) * 0.7;
b1.yspeed = ((_local7 * _local15) + (_local6 * _local9)) * 0.7;
b2.xspeed = ((_local7 * _local10) - (_local6 * _local14)) * 0.7;
b2.yspeed = ((_local7 * _local14) + (_local6 * _local10)) * 0.7;
var _local16 = ((b1.rad + b2.rad) - _local19) / 2;
var _local17 = _local7 * _local16;
var _local13 = _local6 * _local16;
b1._x = b1._x - (_local17 * 1.1);
b1._y = b1._y - (_local13 * 1.1);
b2._x = b2._x + (_local17 * 1.1);
b2._y = b2._y + (_local13 * 1.1);
}
}
if (_root.game.gameMode == "kickOff") {
var xspeedEq = speed;
var yspeedEq = speed;
}
if (_root.game.cleanUp == true) {
this.removeMovieClip();
}
if ((_root.game.gameMode == "scrum") || (_root.game.gameMode == "kickOff")) {
forwardProgress = 0;
progressTimer = 0;
}
if (team == _root.game.playersTeam) {
if (_root.game.playType == "running") {
if (_root.game.playersTeam == 1) {
if ((((_name == "player7") || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else if ((((_name == "player18") || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else {
mass = 2;
}
}
if (team == _root.game.compTeam) {
if (_root.game.compPlayType == "running") {
if (_root.game.compTeam == 1) {
if ((((_name == "player7") || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else if ((((_name == "player18") || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else {
mass = 2;
}
}
if ((((((_name == "player22") and (parseInt(_root.game.ball.storedOwner.team) == 2)) and (_root.game.gameMode != "plays")) and (_root.game.gameMode != "celebration")) and (_root.game.paused == false)) || (((((_name == "player11") and (parseInt(_root.game.ball.storedOwner.team) == 1)) and (_root.game.gameMode != "plays")) and (_root.game.gameMode != "celebration")) and (_root.game.paused == false))) {
if (_currentframe == 1) {
gotoAndStop (3);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(10);
}
} else if (_currentframe == 2) {
gotoAndStop (4);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(10);
}
}
} else if (((((_name == "player22") and (_root.game.gameMode != "plays")) and (_root.game.paused == false)) and (_root.game.gameMode != "celebration")) and (_root.game.gameMode != "shot")) {
gotoAndStop(_root.game.player21._currentframe);
} else if (((((_name == "player11") and (_root.game.gameMode != "plays")) and (_root.game.paused == false)) and (_root.game.gameMode != "celebration")) and (_root.game.gameMode != "shot")) {
gotoAndStop(_root.game.player10._currentframe);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(_root.game.player10.ani._currentframe);
}
}
if ((tackled == true) and (_root.game.paused == false)) {
tackle();
}
if (_root.game.paused == false) {
if (_parent.ball.target != this) {
arrow.gotoAndStop(1);
var arrowPlayed = false;
heldTime = 0;
} else {
if ((_parent.passesNum == 1) || (_root.game.downs == 0)) {
if (team == 1) {
if ((((xspeed < 0) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) and (_root.game.messageList.length == 0)) {
if ((_root.game.tdMode == false) || ((_root.game.tdMode != false) and (_parent.passesNum > 0))) {
progressTimer = progressTimer + 1;
if ((forwardProgress == 0) || (forwardProgress < (_x + fixedLineX))) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
forwardProgress = _x + fixedLineX;
}
if (progressTimer > 50) {
turnedPause();
progressTimer = 0;
}
} else {
progressTimer = 0;
}
}
} else if ((((xspeed > 0) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) and (_root.game.messageList.length == 0)) {
if ((_root.game.tdMode == false) || ((_root.game.tdMode != false) and (_parent.passesNum > 0))) {
progressTimer = progressTimer + 1;
if ((forwardProgress == 0) || (forwardProgress > (_x + fixedLineX))) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
forwardProgress = _x + fixedLineX;
}
if (progressTimer > 50) {
turnedPause();
progressTimer = 0;
}
} else {
progressTimer = 0;
}
}
}
if ((((team == 1) and (_root.game.gameMode == "plays")) and (team != _root.game.playersTeam)) || (((team == 1) and (_root.game.gameMode == "plays")) and (_root.game.demoMode == true))) {
heldTime = heldTime + 1;
var playerAmount = 12;
i = 1;
while (i < playerAmount) {
var target = _root.game["player" + i];
var randFactor = random(3);
if (((((((((target._x > (_x + 40)) and (_parent.passesNum == 0)) and (heldTime > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed > (1.5 * _root.game.vibrationVal))) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || ((((_parent.nzone.hitTest(target.xpos, target.ypos, true) and (target._x > _x)) and (_parent.passesNum == 0)) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing"))) || ((((((((target._x > (_x + 40)) and (_parent.passesNum == 0)) and (heldTime > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed > 1.5)) and (_root.game.downs > 0)) and (_root.game.playType == "passing")) and (_root.game.demoMode == true))) {
_parent.passesNum = _parent.passesNum + 1;
_parent.ball.target = "";
_parent.ball.targetX = _root.game["player" + i]._x + (_root.game["player" + i].xspeed * (8 + random(15)));
_parent.ball.targetY = (_root.game["player" + i]._y - 10) + (_root.game["player" + i].yspeed * (8 + random(15)));
var dx = (_parent.ball.targetX - _parent.ball._x);
var dy = (_parent.ball.targetY - _parent.ball._y);
var dist = Math.sqrt((dx * dx) + (dy * dy));
_parent.ball.xspeed = dx / (dist / 10);
_parent.ball.yspeed = dy / (dist / 10);
_parent.ball.zspeed = -(dist / 20);
_parent.ball.zpos = 4;
}
i = i + 1;
}
} else {
heldTime = 0;
}
if ((((team == 2) and (_root.game.gameMode == "plays")) and (team != _root.game.playersTeam)) || (((team == 2) and (_root.game.gameMode == "plays")) and (_root.game.demoMode == true))) {
heldTime2 = heldTime2 + 1;
var playerAmount = 23;
i = 12;
while (i < playerAmount) {
var target = _root.game["player" + i];
var randFactor = random(3);
if ((((((((target._x < (_x - 40)) and (_parent.passesNum == 0)) and (heldTime2 > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed < (-1.5 * _root.game.vibrationVal))) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || ((((_parent.nzone.hitTest(target.xpos, target.ypos, true) and (target._x < _x)) and (_parent.passesNum == 0)) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing"))) {
_parent.passesNum = _parent.passesNum + 1;
_parent.ball.target = "";
_parent.ball.targetX = _root.game["player" + i]._x + (_root.game["player" + i].xspeed * (8 + random(15)));
_parent.ball.targetY = (_root.game["player" + i]._y - 10) + (_root.game["player" + i].yspeed * (8 + random(15)));
var dx = (_parent.ball.targetX - _parent.ball._x);
var dy = (_parent.ball.targetY - _parent.ball._y);
var dist = Math.sqrt((dx * dx) + (dy * dy));
_parent.ball.xspeed = dx / (dist / 10);
_parent.ball.yspeed = dy / (dist / 10);
_parent.ball.zspeed = -(dist / 20);
_parent.ball.zpos = 4;
}
i = i + 1;
}
} else {
heldTime2 = 0;
}
if (arrowPlayed == false) {
arrow.play();
var arrowPlayed = true;
}
}
if ((_root.game.gameMode == "plays") and (_parent.ball.target == "")) {
if ((((((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player22")) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player11"))) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player4"))) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player16"))) {
} else {
var catchRad = (rad * 2.5);
var zcatch = 4;
}
if (_root.game.ball.target == "") {
if ((_root.game.ball._x < (_x + 50)) and (_root.game.ball._x > (_x - 50))) {
if ((((_root.game.lastGameMode == "kickOff") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player22")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "kickOff") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player11")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "punt") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player15")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "punt") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player4")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "puntSafety") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player15")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "puntSafety") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player4")) {
_root.game.ball.target = this;
}
}
if ((_root.game.ball._x < (_x + 20)) and (_root.game.ball._x > (_x - 20))) {
var dx = (_parent.ball._x - _x);
var dy = (_parent.ball._y - (_y - 10));
var dist = Math.sqrt((dx * dx) + (dy * dy));
if (((dist < catchRad) and (_parent.ball.zpos < zcatch)) and (_root.game.ball.bounce < 1)) {
if ((_parent.ball.storedOwner.team != team) and (_parent.ball.storedOwner.team > 0)) {
if (_root.game.tdMode != false) {
tacklePause();
} else {
_parent.scoreboard.bigscreen.ani.gotoAndPlay("intercept");
_root.game.downs = 0;
intercepted = true;
_root.game.intercepted = true;
}
}
_parent.ball.target = this;
arrow.play();
}
var dx = ((_parent.ball._x + _root.game.ball.xspeed) - _x);
var dy = ((_parent.ball._y + _root.game.ball.yspeed) - (_y - 10));
var dist = Math.sqrt((dx * dx) + (dy * dy));
if (((dist < catchRad) and (_parent.ball.zpos < zcatch)) and (_root.game.ball.bounce < 1)) {
if ((_parent.ball.storedOwner.team != team) and (_parent.ball.storedOwner.team > 0)) {
if (_root.game.tdMode != false) {
tacklePause();
} else {
_parent.scoreboard.bigscreen.ani.gotoAndPlay("intercept");
_root.game.downs = 0;
intercepted = true;
_root.game.intercepted = true;
}
}
_parent.ball.target = this;
arrow.play();
}
}
}
}
xpos = _x + _root.game._x;
ypos = _y + _root.game._y;
speed = 0.12 * _root.game.vibrationVal;
currentY = _y - _root.game.pitchBackY;
posY = currentY / _root.game.pitchFrontY;
percent = _root.game.pitchDepth / _root.game.horizon;
depthScale = (1 - percent) + (posY * percent);
if (intercepted == true) {
speedDone = false;
intercepted = false;
}
if ((_root.game.vibrate == true) and (_root.game.paused == false)) {
rotTimer = 1 + random(20 * _root.game.vibrationVal);
if (rotTimer == 1) {
rotInc = (-30 + random(60)) / 140;
}
rotVel = rotVel + rotInc;
if (((_root.game.gameMode == "plays") and (speedDone == false)) || (_root.game.mouseIsDown == true)) {
if (_root.game.lastGameMode != "kickOff") {
speedDone = true;
if (_root.game.ball.target != this) {
if (((_root.game.playType == "running") and (team == _root.game.playersTeam)) || ((_root.game.compPlayType == "running") and (team == _root.game.compTeam))) {
if ((((((((((_name == "player22") || (_name == "player18")) || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) || (_name == "player11")) || (_name == "player7")) || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
var xspeedEq = (speed * 1.5);
var yspeedEq = (speed * 1.5);
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else if (((_root.game.playType == "defense") and (team == _root.game.playersTeam)) || ((_root.game.compPlayType == "defense") and (team == _root.game.compTeam))) {
if ((_root.downs >= 1) and (_root.game.blitz == false)) {
if ((((_name == "player8") || (_name == "player9")) || (_name == "player19")) || (_name == "player20")) {
var xspeedEq = (-(speed / 3));
var yspeedEq = (-(speed / 3));
} else if ((((_name == "player10") || (_name == "player11")) || (_name == "player21")) || (_name == "player22")) {
var xspeedEq = (-(speed / 5));
var yspeedEq = (-(speed / 5));
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else if (((((_root.game.passesNum == 0) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || (((_root.game.passesNum == 0) and (_root.game.downs > 0)) and (_root.game.playType == "passing"))) || (((_root.game.passesNum == 0) and (_root.game.tdMode != false)) and (_root.game.playType == "passing"))) {
var xspeedEq = (-(speed / 6));
var yspeedEq = (-(speed / 6));
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
}
}
if ((_root.game.gameMode != "plays") || (_root.game.paused == true)) {
speedDone = false;
}
if (((_root.game.gameMode == "plays") || (_root.game.gameMode == "celebration")) || (_root.game.gameMode == "shot")) {
xspeed = xspeed + (Math.cos((rot - 180) * (Math.PI/180)) * xspeedEq);
yspeed = yspeed + (Math.sin((rot - 180) * (Math.PI/180)) * yspeedEq);
}
if (collisionTimer < 1) {
collisionTimer = collisionTimer + 1;
} else {
collisionTimer = 0;
}
if (((_root.game.vibrate == true) and (_root.game.paused == false)) || (_root.game.mouseIsDown == true)) {
if ((collisionTimer == 0) and (team == 1)) {
i = 0;
while (i < (_root.game.playerNum + 1)) {
var target = _root.game["player" + i];
if (_name != ("player" + i)) {
checkCollision(this, target);
}
i = i + 1;
}
checkWalls();
}
if ((collisionTimer == 1) and (team == 2)) {
i = 12;
while (i < (_root.game.playerNum + 1)) {
var target = _root.game["player" + i];
if (_name != ("player" + i)) {
checkCollision(this, target);
}
i = i + 1;
}
checkWalls();
}
}
if (_root.game.gameMode == "puntSafety") {
checkWalls();
}
xspeed = xspeed * 0.97;
yspeed = yspeed * 0.97;
rotVel = rotVel * 0.97;
this.swapDepths(_y + (_x / 5));
if ((_name == "player22") and (_root.game.playType == "running")) {
} else {
var aniFrames = ani._totalframes;
rotStored = rotStored + rotVel;
if (rotStored > (360 / aniFrames)) {
if (ani._currentframe < aniFrames) {
ani.nextFrame();
} else {
ani.gotoAndStop(1);
}
rotStored = rotStored - (360 / aniFrames);
}
if (rotStored < (-(360 / aniFrames))) {
if (ani._currentframe > 1) {
ani.prevFrame();
} else {
ani.gotoAndStop(aniFrames);
}
rotStored = rotStored + (360 / aniFrames);
}
rot = rot + rotVel;
_xscale = (depthScale * 110);
_yscale = _xscale;
}
if (((_root.game.gameMode == "plays") || (_root.game.gameMode == "celebration")) || (_root.game.gameMode == "shot")) {
_x = (_x + (xspeed * depthScale));
_y = (_y + (yspeed * depthScale));
}
}
}
Instance of Symbol 198 MovieClip "player7" in Symbol 494 MovieClip Frame 2
onClipEvent (load) {
hitSound = new Sound(this);
hitSound.attachSound("hitSound");
xspeed = 0;
yspeed = 0;
speed = 0.1 * _root.game.vibrationVal;
currentY = _y - _root.game.pitchBackY;
posY = currentY / _root.game.pitchFrontY;
percent = _root.game.pitchDepth / _root.game.horizon;
depthScale = (1 - percent) + (posY * percent);
rotVel = 0;
rotInc = 0;
rotTimer = random(20);
_rotation = 0;
xpos = _x + _root.game._x;
ypos = _y + _root.game._y;
_root.game.playerNum = _root.game.playerNum + 1;
mass = 2;
rad = hitArea._width / 2.3;
team = 0;
if (parseInt(substring(_name, 7, 2)) < 12) {
team = 1;
rot = 180;
origRot = rot;
if ((_name == "player22") || (_name == "player11")) {
gotoAndStop (4);
} else {
gotoAndStop (2);
}
ani.gotoAndStop(10);
} else {
team = 2;
rot = 0;
origRot = rot;
if ((_name == "player22") || (_name == "player11")) {
gotoAndStop (3);
} else {
gotoAndStop (1);
}
ani.gotoAndStop(1);
}
if (team == 2) {
trace(((("new Array(" + Math.round(_x)) + ",") + Math.round(_y)) + "),");
}
rotStored = 0;
heldTime = 0;
heldTime2 = 0;
tackled = false;
forwardProgress = 0;
progressTimer = 0;
type = "";
fixedLineX = 0;
speedDone = false;
var xspeedEq = speed;
var yspeedEq = speed;
storedVar = "";
collisionTimer = 0;
intercepted = false;
}
onClipEvent (enterFrame) {
function checkOutOfBounds() {
if (_root.game.ball.target == this) {
boundsPause();
if ((ani._currentframe < 6) || (ani._currentframe > 14)) {
if (team == 1) {
}
} else if ((ani._currentframe > 6) and (ani._currentframe < 14)) {
if (team == 2) {
}
}
}
}
function checkScrimmage() {
if (team == 1) {
if (_root.game.scrimmage < _root.game.endZoneL) {
_root.game.scrimmage = _root.game.twentyYardLineL;
_root.game.touchBack = true;
} else {
_root.game.touchBack = false;
}
if (_root.game.scrimmage > _root.game.endZoneR) {
_root.game.scrimmage = _root.game.endZoneR;
}
} else {
if (_root.game.scrimmage < _root.game.endZoneL) {
_root.game.scrimmage = _root.game.endZoneL;
}
if (_root.game.scrimmage > _root.game.endZoneR) {
_root.game.scrimmage = _root.game.twentyYardLineR;
_root.game.touchBack = true;
} else {
_root.game.touchBack = false;
}
}
}
function tacklePause() {
type = "tackle";
if ((_root.game.timeOut == true) and (_root.game.tdMode == false)) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
_root.game.scrimmage = _x + fixedLineX;
checkScrimmage();
}
if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "tackle";
_root.game.safed = true;
} else if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "tackle";
_root.game.safed = true;
} else {
type = "tackle";
}
if ((_root.game.paused == false) and (_root.game.gameMode != "celebration")) {
_root.game.sound.gotoAndPlay("whistle");
}
if (((((_root.game.gameMode == "plays") and (_root.game.paused == false)) || ((_root.game.gameMode == "kickOff") and (_root.game.paused == false))) || ((_root.game.gameMode == "punt") and (_root.game.paused == false))) || (((_root.game.tdMode != false) and (_root.game.paused == false)) and (_root.game.gameMode == "plays"))) {
tackled = true;
type = "tackle";
if ((_root.game.passesNum == 0) and (_root.game.gameMode != "celebration")) {
if (_parent.ball.target.team == 1) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
if (((_x + fixedLineX) < _root.game.scrimmage) and (_root.game.downs > 0)) {
_parent.addMessage("sack");
} else {
_parent.addMessage("tackled");
}
}
if (_parent.ball.target.team == 2) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
if (((_x + fixedLineX) > _root.game.scrimmage) and (_root.game.downs > 0)) {
_parent.addMessage("sack");
} else {
_parent.addMessage("tackled");
}
}
} else if (_root.game.gameMode != "celebration") {
_parent.addMessage("tackled");
}
_root.game.pauseTime = 55;
}
}
function boundsPause() {
if (_root.game.timeOut == true) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
_root.game.scrimmage = _x + fixedLineX;
checkScrimmage();
}
if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "bounds";
_root.game.safed = true;
} else if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "bounds";
_root.game.safed = true;
} else {
type = "bounds";
}
type = "bounds";
_root.game.sound.gotoAndPlay("whistle");
tackled = true;
_parent.addMessage("outOfBounds");
_root.game.pauseTime = 55;
}
function turnedPause() {
if (_root.game.timeOut == true) {
_root.game.scrimmage = forwardProgress;
checkScrimmage();
}
type = "turn";
_root.game.sound.gotoAndPlay("whistle");
tackled = true;
_parent.addMessage("turnedAround");
_parent.addMessage("negativeProgress");
_root.game.pauseTime = 55;
}
function tackle() {
if ((_root.game.gameMode != "puntSafety") and (gameMode != "scrum")) {
if (_root.game.tdMode != false) {
if ((_root.game.timeOut == false) and (_root.game.gameMode != "celebration")) {
_root.game.startKickoff(_root.game.playersTeam);
_root.game.removeTackles();
tacked = false;
_root.game.tdMode = false;
} else if (_root.game.gameMode != "celebration") {
_root.game.removeTackles();
tacked = false;
_root.game.tdMode = false;
_root.game.gameMode = "convFail";
trace(_root.game.gameMode);
} else {
_root.game.removeTackles();
tacked = false;
}
} else if ((_root.game.downs <= 3.5) || (_root.game.goForIt == true)) {
if ((((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (type != "turn")) and (_root.game.downs > 0.5)) and (_root.game.ball.target == this)) and (_root.game.gameMode != "celebration")) {
_root.game.addMessage("Safety");
if (team != _root.game.playersTeam) {
_root.game.setupSafetyKick(_root.game.compTeam);
_root.game.hscore = _root.game.hscore + 2;
} else {
_root.game.setupSafetyKick(_root.game.playersTeam);
_root.game.gscore = _root.game.gscore + 2;
}
tackled = false;
} else if ((((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (type != "turn")) and (_root.game.downs > 0.5)) and (_root.game.ball.target == this)) and (_root.game.gameMode != "celebration")) {
_root.game.addMessage("Safety");
if (team != _root.game.playersTeam) {
_root.game.setupSafetyKick(_root.game.compTeam);
_root.game.hscore = _root.game.hscore + 2;
} else {
_root.game.setupSafetyKick(_root.game.playersTeam);
_root.game.gscore = _root.game.gscore + 2;
}
tackled = false;
} else {
_root.game.changeMode = false;
tackled = false;
if (type == "turn") {
var _local4 = forwardProgress;
} else {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
var _local4 = _x + fixedLineX;
}
_root.game.scrimmage = _local4;
if (_parent.ball.target.team != _root.game.playersTeam) {
var _local5 = random(2);
if (_local5 == 1) {
_root.game.compPlayType = "passing";
_root.game.setupLine(_root.game.compTeam, _root.game.formationShotgun, _local4, 0.5);
} else {
_root.game.compPlayType = "running";
_root.game.setupLine(_root.game.compTeam, _root.game.formationI, _local4, 0.5);
}
_root.game.setupLine(_root.game.playersTeam, _root.game.formation43, _local4, 0.5);
} else {
var _local5 = 1 + random(5);
_root.game.compPlayType = "defense";
_root.game.setupLine(_root.game.compTeam, _root.game["formationDefence" + _local5], _local4, 0.5);
_root.game.setupLine(_root.game.playersTeam, _root.game.formationShotgun, _local4, 0.5);
}
}
} else if ((_root.game.goForIt == true) and (_root.game.gameMode == "plays")) {
if (_root.game.changeMode == false) {
_root.game.downs = _root.game.downs + 1;
}
_root.game.pauseTime = 0;
_root.game.paused = false;
tackled = false;
} else if (_root.game.gameMode == "plays") {
_root.game.pauseTime = 0;
_root.game.paused = false;
if (_root.game.changeMode == false) {
_root.game.downs = _root.game.downs + 1;
}
tackled = false;
}
}
}
function checkWalls() {
if ((_y + 10) > _root.game.pitchFrontY) {
if (((yspeed > 1) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) {
checkOutOfBounds();
}
_y = (_y - 1);
yspeed = (-yspeed) * 0.5;
}
if ((_y - 5) < _root.game.pitchBackY) {
if (((yspeed < 1) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) {
checkOutOfBounds();
}
_y = (_y + 1);
yspeed = (-yspeed) * 0.5;
}
if (_root.game.walls.hitTest(xpos + (hitArea._width / 2), ypos, true) and (_x > 300)) {
_x = (_x - 2);
xspeed = (-xspeed) * 0.5;
}
if (_root.game.walls.hitTest(xpos - (hitArea._width / 2), ypos, true) and (_x < 300)) {
_x = (_x + 2);
xspeed = (-xspeed) * 0.5;
}
}
function checkCollision(b1, b2) {
var _local12 = b2._x - b1._x;
var _local11 = b2._y - b1._y;
var _local19 = Math.sqrt((_local12 * _local12) + (_local11 * _local11));
if (_local19 < (b1.rad + b2.rad)) {
if (((_parent.ball.target == this) and (b2.team != this.team)) || ((_parent.ball.target == b2) and (this.team != b2.team))) {
tacklePause();
}
if (_root.game.gameMode == "plays") {
var _local8 = 0;
if (xspeed < 0) {
_local8 = _local8 + (-xspeed);
} else {
_local8 = _local8 + xspeed;
}
if (yspeed < 0) {
_local8 = _local8 + (-yspeed);
} else {
_local8 = _local8 + yspeed;
}
if (_local8 > 1) {
hitSound.setVolume(_local8 * 15);
hitSound.start(0, 0);
hitSound.setVolume(_local8 * 15);
}
}
var _local18 = Math.atan2(_local11, _local12);
var _local7 = Math.cos(_local18);
var _local6 = Math.sin(_local18);
var _local9 = (_local7 * b1.xspeed) + (_local6 * b1.yspeed);
var _local15 = (_local7 * b1.yspeed) - (_local6 * b1.xspeed);
var _local10 = (_local7 * b2.xspeed) + (_local6 * b2.yspeed);
var _local14 = (_local7 * b2.yspeed) - (_local6 * b2.xspeed);
var _local21 = (_local9 * b1.mass) + (_local10 * b2.mass);
var _local20 = _local9 - _local10;
_local9 = (_local21 - (b2.mass * _local20)) / (b1.mass + b2.mass);
_local10 = _local20 + _local9;
b1.xspeed = ((_local7 * _local9) - (_local6 * _local15)) * 0.7;
b1.yspeed = ((_local7 * _local15) + (_local6 * _local9)) * 0.7;
b2.xspeed = ((_local7 * _local10) - (_local6 * _local14)) * 0.7;
b2.yspeed = ((_local7 * _local14) + (_local6 * _local10)) * 0.7;
var _local16 = ((b1.rad + b2.rad) - _local19) / 2;
var _local17 = _local7 * _local16;
var _local13 = _local6 * _local16;
b1._x = b1._x - (_local17 * 1.1);
b1._y = b1._y - (_local13 * 1.1);
b2._x = b2._x + (_local17 * 1.1);
b2._y = b2._y + (_local13 * 1.1);
}
}
if (_root.game.gameMode == "kickOff") {
var xspeedEq = speed;
var yspeedEq = speed;
}
if (_root.game.cleanUp == true) {
this.removeMovieClip();
}
if ((_root.game.gameMode == "scrum") || (_root.game.gameMode == "kickOff")) {
forwardProgress = 0;
progressTimer = 0;
}
if (team == _root.game.playersTeam) {
if (_root.game.playType == "running") {
if (_root.game.playersTeam == 1) {
if ((((_name == "player7") || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else if ((((_name == "player18") || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else {
mass = 2;
}
}
if (team == _root.game.compTeam) {
if (_root.game.compPlayType == "running") {
if (_root.game.compTeam == 1) {
if ((((_name == "player7") || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else if ((((_name == "player18") || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else {
mass = 2;
}
}
if ((((((_name == "player22") and (parseInt(_root.game.ball.storedOwner.team) == 2)) and (_root.game.gameMode != "plays")) and (_root.game.gameMode != "celebration")) and (_root.game.paused == false)) || (((((_name == "player11") and (parseInt(_root.game.ball.storedOwner.team) == 1)) and (_root.game.gameMode != "plays")) and (_root.game.gameMode != "celebration")) and (_root.game.paused == false))) {
if (_currentframe == 1) {
gotoAndStop (3);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(10);
}
} else if (_currentframe == 2) {
gotoAndStop (4);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(10);
}
}
} else if (((((_name == "player22") and (_root.game.gameMode != "plays")) and (_root.game.paused == false)) and (_root.game.gameMode != "celebration")) and (_root.game.gameMode != "shot")) {
gotoAndStop(_root.game.player21._currentframe);
} else if (((((_name == "player11") and (_root.game.gameMode != "plays")) and (_root.game.paused == false)) and (_root.game.gameMode != "celebration")) and (_root.game.gameMode != "shot")) {
gotoAndStop(_root.game.player10._currentframe);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(_root.game.player10.ani._currentframe);
}
}
if ((tackled == true) and (_root.game.paused == false)) {
tackle();
}
if (_root.game.paused == false) {
if (_parent.ball.target != this) {
arrow.gotoAndStop(1);
var arrowPlayed = false;
heldTime = 0;
} else {
if ((_parent.passesNum == 1) || (_root.game.downs == 0)) {
if (team == 1) {
if ((((xspeed < 0) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) and (_root.game.messageList.length == 0)) {
if ((_root.game.tdMode == false) || ((_root.game.tdMode != false) and (_parent.passesNum > 0))) {
progressTimer = progressTimer + 1;
if ((forwardProgress == 0) || (forwardProgress < (_x + fixedLineX))) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
forwardProgress = _x + fixedLineX;
}
if (progressTimer > 50) {
turnedPause();
progressTimer = 0;
}
} else {
progressTimer = 0;
}
}
} else if ((((xspeed > 0) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) and (_root.game.messageList.length == 0)) {
if ((_root.game.tdMode == false) || ((_root.game.tdMode != false) and (_parent.passesNum > 0))) {
progressTimer = progressTimer + 1;
if ((forwardProgress == 0) || (forwardProgress > (_x + fixedLineX))) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
forwardProgress = _x + fixedLineX;
}
if (progressTimer > 50) {
turnedPause();
progressTimer = 0;
}
} else {
progressTimer = 0;
}
}
}
if ((((team == 1) and (_root.game.gameMode == "plays")) and (team != _root.game.playersTeam)) || (((team == 1) and (_root.game.gameMode == "plays")) and (_root.game.demoMode == true))) {
heldTime = heldTime + 1;
var playerAmount = 12;
i = 1;
while (i < playerAmount) {
var target = _root.game["player" + i];
var randFactor = random(3);
if (((((((((target._x > (_x + 40)) and (_parent.passesNum == 0)) and (heldTime > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed > (1.5 * _root.game.vibrationVal))) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || ((((_parent.nzone.hitTest(target.xpos, target.ypos, true) and (target._x > _x)) and (_parent.passesNum == 0)) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing"))) || ((((((((target._x > (_x + 40)) and (_parent.passesNum == 0)) and (heldTime > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed > 1.5)) and (_root.game.downs > 0)) and (_root.game.playType == "passing")) and (_root.game.demoMode == true))) {
_parent.passesNum = _parent.passesNum + 1;
_parent.ball.target = "";
_parent.ball.targetX = _root.game["player" + i]._x + (_root.game["player" + i].xspeed * (8 + random(15)));
_parent.ball.targetY = (_root.game["player" + i]._y - 10) + (_root.game["player" + i].yspeed * (8 + random(15)));
var dx = (_parent.ball.targetX - _parent.ball._x);
var dy = (_parent.ball.targetY - _parent.ball._y);
var dist = Math.sqrt((dx * dx) + (dy * dy));
_parent.ball.xspeed = dx / (dist / 10);
_parent.ball.yspeed = dy / (dist / 10);
_parent.ball.zspeed = -(dist / 20);
_parent.ball.zpos = 4;
}
i = i + 1;
}
} else {
heldTime = 0;
}
if ((((team == 2) and (_root.game.gameMode == "plays")) and (team != _root.game.playersTeam)) || (((team == 2) and (_root.game.gameMode == "plays")) and (_root.game.demoMode == true))) {
heldTime2 = heldTime2 + 1;
var playerAmount = 23;
i = 12;
while (i < playerAmount) {
var target = _root.game["player" + i];
var randFactor = random(3);
if ((((((((target._x < (_x - 40)) and (_parent.passesNum == 0)) and (heldTime2 > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed < (-1.5 * _root.game.vibrationVal))) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || ((((_parent.nzone.hitTest(target.xpos, target.ypos, true) and (target._x < _x)) and (_parent.passesNum == 0)) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing"))) {
_parent.passesNum = _parent.passesNum + 1;
_parent.ball.target = "";
_parent.ball.targetX = _root.game["player" + i]._x + (_root.game["player" + i].xspeed * (8 + random(15)));
_parent.ball.targetY = (_root.game["player" + i]._y - 10) + (_root.game["player" + i].yspeed * (8 + random(15)));
var dx = (_parent.ball.targetX - _parent.ball._x);
var dy = (_parent.ball.targetY - _parent.ball._y);
var dist = Math.sqrt((dx * dx) + (dy * dy));
_parent.ball.xspeed = dx / (dist / 10);
_parent.ball.yspeed = dy / (dist / 10);
_parent.ball.zspeed = -(dist / 20);
_parent.ball.zpos = 4;
}
i = i + 1;
}
} else {
heldTime2 = 0;
}
if (arrowPlayed == false) {
arrow.play();
var arrowPlayed = true;
}
}
if ((_root.game.gameMode == "plays") and (_parent.ball.target == "")) {
if ((((((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player22")) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player11"))) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player4"))) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player16"))) {
} else {
var catchRad = (rad * 2.5);
var zcatch = 4;
}
if (_root.game.ball.target == "") {
if ((_root.game.ball._x < (_x + 50)) and (_root.game.ball._x > (_x - 50))) {
if ((((_root.game.lastGameMode == "kickOff") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player22")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "kickOff") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player11")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "punt") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player15")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "punt") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player4")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "puntSafety") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player15")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "puntSafety") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player4")) {
_root.game.ball.target = this;
}
}
if ((_root.game.ball._x < (_x + 20)) and (_root.game.ball._x > (_x - 20))) {
var dx = (_parent.ball._x - _x);
var dy = (_parent.ball._y - (_y - 10));
var dist = Math.sqrt((dx * dx) + (dy * dy));
if (((dist < catchRad) and (_parent.ball.zpos < zcatch)) and (_root.game.ball.bounce < 1)) {
if ((_parent.ball.storedOwner.team != team) and (_parent.ball.storedOwner.team > 0)) {
if (_root.game.tdMode != false) {
tacklePause();
} else {
_parent.scoreboard.bigscreen.ani.gotoAndPlay("intercept");
_root.game.downs = 0;
intercepted = true;
_root.game.intercepted = true;
}
}
_parent.ball.target = this;
arrow.play();
}
var dx = ((_parent.ball._x + _root.game.ball.xspeed) - _x);
var dy = ((_parent.ball._y + _root.game.ball.yspeed) - (_y - 10));
var dist = Math.sqrt((dx * dx) + (dy * dy));
if (((dist < catchRad) and (_parent.ball.zpos < zcatch)) and (_root.game.ball.bounce < 1)) {
if ((_parent.ball.storedOwner.team != team) and (_parent.ball.storedOwner.team > 0)) {
if (_root.game.tdMode != false) {
tacklePause();
} else {
_parent.scoreboard.bigscreen.ani.gotoAndPlay("intercept");
_root.game.downs = 0;
intercepted = true;
_root.game.intercepted = true;
}
}
_parent.ball.target = this;
arrow.play();
}
}
}
}
xpos = _x + _root.game._x;
ypos = _y + _root.game._y;
speed = 0.12 * _root.game.vibrationVal;
currentY = _y - _root.game.pitchBackY;
posY = currentY / _root.game.pitchFrontY;
percent = _root.game.pitchDepth / _root.game.horizon;
depthScale = (1 - percent) + (posY * percent);
if (intercepted == true) {
speedDone = false;
intercepted = false;
}
if ((_root.game.vibrate == true) and (_root.game.paused == false)) {
rotTimer = 1 + random(20 * _root.game.vibrationVal);
if (rotTimer == 1) {
rotInc = (-30 + random(60)) / 140;
}
rotVel = rotVel + rotInc;
if (((_root.game.gameMode == "plays") and (speedDone == false)) || (_root.game.mouseIsDown == true)) {
if (_root.game.lastGameMode != "kickOff") {
speedDone = true;
if (_root.game.ball.target != this) {
if (((_root.game.playType == "running") and (team == _root.game.playersTeam)) || ((_root.game.compPlayType == "running") and (team == _root.game.compTeam))) {
if ((((((((((_name == "player22") || (_name == "player18")) || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) || (_name == "player11")) || (_name == "player7")) || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
var xspeedEq = (speed * 1.5);
var yspeedEq = (speed * 1.5);
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else if (((_root.game.playType == "defense") and (team == _root.game.playersTeam)) || ((_root.game.compPlayType == "defense") and (team == _root.game.compTeam))) {
if ((_root.downs >= 1) and (_root.game.blitz == false)) {
if ((((_name == "player8") || (_name == "player9")) || (_name == "player19")) || (_name == "player20")) {
var xspeedEq = (-(speed / 3));
var yspeedEq = (-(speed / 3));
} else if ((((_name == "player10") || (_name == "player11")) || (_name == "player21")) || (_name == "player22")) {
var xspeedEq = (-(speed / 5));
var yspeedEq = (-(speed / 5));
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else if (((((_root.game.passesNum == 0) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || (((_root.game.passesNum == 0) and (_root.game.downs > 0)) and (_root.game.playType == "passing"))) || (((_root.game.passesNum == 0) and (_root.game.tdMode != false)) and (_root.game.playType == "passing"))) {
var xspeedEq = (-(speed / 6));
var yspeedEq = (-(speed / 6));
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
}
}
if ((_root.game.gameMode != "plays") || (_root.game.paused == true)) {
speedDone = false;
}
if (((_root.game.gameMode == "plays") || (_root.game.gameMode == "celebration")) || (_root.game.gameMode == "shot")) {
xspeed = xspeed + (Math.cos((rot - 180) * (Math.PI/180)) * xspeedEq);
yspeed = yspeed + (Math.sin((rot - 180) * (Math.PI/180)) * yspeedEq);
}
if (collisionTimer < 1) {
collisionTimer = collisionTimer + 1;
} else {
collisionTimer = 0;
}
if (((_root.game.vibrate == true) and (_root.game.paused == false)) || (_root.game.mouseIsDown == true)) {
if ((collisionTimer == 0) and (team == 1)) {
i = 0;
while (i < (_root.game.playerNum + 1)) {
var target = _root.game["player" + i];
if (_name != ("player" + i)) {
checkCollision(this, target);
}
i = i + 1;
}
checkWalls();
}
if ((collisionTimer == 1) and (team == 2)) {
i = 12;
while (i < (_root.game.playerNum + 1)) {
var target = _root.game["player" + i];
if (_name != ("player" + i)) {
checkCollision(this, target);
}
i = i + 1;
}
checkWalls();
}
}
if (_root.game.gameMode == "puntSafety") {
checkWalls();
}
xspeed = xspeed * 0.97;
yspeed = yspeed * 0.97;
rotVel = rotVel * 0.97;
this.swapDepths(_y + (_x / 5));
if ((_name == "player22") and (_root.game.playType == "running")) {
} else {
var aniFrames = ani._totalframes;
rotStored = rotStored + rotVel;
if (rotStored > (360 / aniFrames)) {
if (ani._currentframe < aniFrames) {
ani.nextFrame();
} else {
ani.gotoAndStop(1);
}
rotStored = rotStored - (360 / aniFrames);
}
if (rotStored < (-(360 / aniFrames))) {
if (ani._currentframe > 1) {
ani.prevFrame();
} else {
ani.gotoAndStop(aniFrames);
}
rotStored = rotStored + (360 / aniFrames);
}
rot = rot + rotVel;
_xscale = (depthScale * 110);
_yscale = _xscale;
}
if (((_root.game.gameMode == "plays") || (_root.game.gameMode == "celebration")) || (_root.game.gameMode == "shot")) {
_x = (_x + (xspeed * depthScale));
_y = (_y + (yspeed * depthScale));
}
}
}
Instance of Symbol 198 MovieClip "player9" in Symbol 494 MovieClip Frame 2
onClipEvent (load) {
hitSound = new Sound(this);
hitSound.attachSound("hitSound");
xspeed = 0;
yspeed = 0;
speed = 0.1 * _root.game.vibrationVal;
currentY = _y - _root.game.pitchBackY;
posY = currentY / _root.game.pitchFrontY;
percent = _root.game.pitchDepth / _root.game.horizon;
depthScale = (1 - percent) + (posY * percent);
rotVel = 0;
rotInc = 0;
rotTimer = random(20);
_rotation = 0;
xpos = _x + _root.game._x;
ypos = _y + _root.game._y;
_root.game.playerNum = _root.game.playerNum + 1;
mass = 2;
rad = hitArea._width / 2.3;
team = 0;
if (parseInt(substring(_name, 7, 2)) < 12) {
team = 1;
rot = 180;
origRot = rot;
if ((_name == "player22") || (_name == "player11")) {
gotoAndStop (4);
} else {
gotoAndStop (2);
}
ani.gotoAndStop(10);
} else {
team = 2;
rot = 0;
origRot = rot;
if ((_name == "player22") || (_name == "player11")) {
gotoAndStop (3);
} else {
gotoAndStop (1);
}
ani.gotoAndStop(1);
}
if (team == 2) {
trace(((("new Array(" + Math.round(_x)) + ",") + Math.round(_y)) + "),");
}
rotStored = 0;
heldTime = 0;
heldTime2 = 0;
tackled = false;
forwardProgress = 0;
progressTimer = 0;
type = "";
fixedLineX = 0;
speedDone = false;
var xspeedEq = speed;
var yspeedEq = speed;
storedVar = "";
collisionTimer = 0;
intercepted = false;
}
onClipEvent (enterFrame) {
function checkOutOfBounds() {
if (_root.game.ball.target == this) {
boundsPause();
if ((ani._currentframe < 6) || (ani._currentframe > 14)) {
if (team == 1) {
}
} else if ((ani._currentframe > 6) and (ani._currentframe < 14)) {
if (team == 2) {
}
}
}
}
function checkScrimmage() {
if (team == 1) {
if (_root.game.scrimmage < _root.game.endZoneL) {
_root.game.scrimmage = _root.game.twentyYardLineL;
_root.game.touchBack = true;
} else {
_root.game.touchBack = false;
}
if (_root.game.scrimmage > _root.game.endZoneR) {
_root.game.scrimmage = _root.game.endZoneR;
}
} else {
if (_root.game.scrimmage < _root.game.endZoneL) {
_root.game.scrimmage = _root.game.endZoneL;
}
if (_root.game.scrimmage > _root.game.endZoneR) {
_root.game.scrimmage = _root.game.twentyYardLineR;
_root.game.touchBack = true;
} else {
_root.game.touchBack = false;
}
}
}
function tacklePause() {
type = "tackle";
if ((_root.game.timeOut == true) and (_root.game.tdMode == false)) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
_root.game.scrimmage = _x + fixedLineX;
checkScrimmage();
}
if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "tackle";
_root.game.safed = true;
} else if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "tackle";
_root.game.safed = true;
} else {
type = "tackle";
}
if ((_root.game.paused == false) and (_root.game.gameMode != "celebration")) {
_root.game.sound.gotoAndPlay("whistle");
}
if (((((_root.game.gameMode == "plays") and (_root.game.paused == false)) || ((_root.game.gameMode == "kickOff") and (_root.game.paused == false))) || ((_root.game.gameMode == "punt") and (_root.game.paused == false))) || (((_root.game.tdMode != false) and (_root.game.paused == false)) and (_root.game.gameMode == "plays"))) {
tackled = true;
type = "tackle";
if ((_root.game.passesNum == 0) and (_root.game.gameMode != "celebration")) {
if (_parent.ball.target.team == 1) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
if (((_x + fixedLineX) < _root.game.scrimmage) and (_root.game.downs > 0)) {
_parent.addMessage("sack");
} else {
_parent.addMessage("tackled");
}
}
if (_parent.ball.target.team == 2) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
if (((_x + fixedLineX) > _root.game.scrimmage) and (_root.game.downs > 0)) {
_parent.addMessage("sack");
} else {
_parent.addMessage("tackled");
}
}
} else if (_root.game.gameMode != "celebration") {
_parent.addMessage("tackled");
}
_root.game.pauseTime = 55;
}
}
function boundsPause() {
if (_root.game.timeOut == true) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
_root.game.scrimmage = _x + fixedLineX;
checkScrimmage();
}
if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "bounds";
_root.game.safed = true;
} else if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "bounds";
_root.game.safed = true;
} else {
type = "bounds";
}
type = "bounds";
_root.game.sound.gotoAndPlay("whistle");
tackled = true;
_parent.addMessage("outOfBounds");
_root.game.pauseTime = 55;
}
function turnedPause() {
if (_root.game.timeOut == true) {
_root.game.scrimmage = forwardProgress;
checkScrimmage();
}
type = "turn";
_root.game.sound.gotoAndPlay("whistle");
tackled = true;
_parent.addMessage("turnedAround");
_parent.addMessage("negativeProgress");
_root.game.pauseTime = 55;
}
function tackle() {
if ((_root.game.gameMode != "puntSafety") and (gameMode != "scrum")) {
if (_root.game.tdMode != false) {
if ((_root.game.timeOut == false) and (_root.game.gameMode != "celebration")) {
_root.game.startKickoff(_root.game.playersTeam);
_root.game.removeTackles();
tacked = false;
_root.game.tdMode = false;
} else if (_root.game.gameMode != "celebration") {
_root.game.removeTackles();
tacked = false;
_root.game.tdMode = false;
_root.game.gameMode = "convFail";
trace(_root.game.gameMode);
} else {
_root.game.removeTackles();
tacked = false;
}
} else if ((_root.game.downs <= 3.5) || (_root.game.goForIt == true)) {
if ((((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (type != "turn")) and (_root.game.downs > 0.5)) and (_root.game.ball.target == this)) and (_root.game.gameMode != "celebration")) {
_root.game.addMessage("Safety");
if (team != _root.game.playersTeam) {
_root.game.setupSafetyKick(_root.game.compTeam);
_root.game.hscore = _root.game.hscore + 2;
} else {
_root.game.setupSafetyKick(_root.game.playersTeam);
_root.game.gscore = _root.game.gscore + 2;
}
tackled = false;
} else if ((((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (type != "turn")) and (_root.game.downs > 0.5)) and (_root.game.ball.target == this)) and (_root.game.gameMode != "celebration")) {
_root.game.addMessage("Safety");
if (team != _root.game.playersTeam) {
_root.game.setupSafetyKick(_root.game.compTeam);
_root.game.hscore = _root.game.hscore + 2;
} else {
_root.game.setupSafetyKick(_root.game.playersTeam);
_root.game.gscore = _root.game.gscore + 2;
}
tackled = false;
} else {
_root.game.changeMode = false;
tackled = false;
if (type == "turn") {
var _local4 = forwardProgress;
} else {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
var _local4 = _x + fixedLineX;
}
_root.game.scrimmage = _local4;
if (_parent.ball.target.team != _root.game.playersTeam) {
var _local5 = random(2);
if (_local5 == 1) {
_root.game.compPlayType = "passing";
_root.game.setupLine(_root.game.compTeam, _root.game.formationShotgun, _local4, 0.5);
} else {
_root.game.compPlayType = "running";
_root.game.setupLine(_root.game.compTeam, _root.game.formationI, _local4, 0.5);
}
_root.game.setupLine(_root.game.playersTeam, _root.game.formation43, _local4, 0.5);
} else {
var _local5 = 1 + random(5);
_root.game.compPlayType = "defense";
_root.game.setupLine(_root.game.compTeam, _root.game["formationDefence" + _local5], _local4, 0.5);
_root.game.setupLine(_root.game.playersTeam, _root.game.formationShotgun, _local4, 0.5);
}
}
} else if ((_root.game.goForIt == true) and (_root.game.gameMode == "plays")) {
if (_root.game.changeMode == false) {
_root.game.downs = _root.game.downs + 1;
}
_root.game.pauseTime = 0;
_root.game.paused = false;
tackled = false;
} else if (_root.game.gameMode == "plays") {
_root.game.pauseTime = 0;
_root.game.paused = false;
if (_root.game.changeMode == false) {
_root.game.downs = _root.game.downs + 1;
}
tackled = false;
}
}
}
function checkWalls() {
if ((_y + 10) > _root.game.pitchFrontY) {
if (((yspeed > 1) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) {
checkOutOfBounds();
}
_y = (_y - 1);
yspeed = (-yspeed) * 0.5;
}
if ((_y - 5) < _root.game.pitchBackY) {
if (((yspeed < 1) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) {
checkOutOfBounds();
}
_y = (_y + 1);
yspeed = (-yspeed) * 0.5;
}
if (_root.game.walls.hitTest(xpos + (hitArea._width / 2), ypos, true) and (_x > 300)) {
_x = (_x - 2);
xspeed = (-xspeed) * 0.5;
}
if (_root.game.walls.hitTest(xpos - (hitArea._width / 2), ypos, true) and (_x < 300)) {
_x = (_x + 2);
xspeed = (-xspeed) * 0.5;
}
}
function checkCollision(b1, b2) {
var _local12 = b2._x - b1._x;
var _local11 = b2._y - b1._y;
var _local19 = Math.sqrt((_local12 * _local12) + (_local11 * _local11));
if (_local19 < (b1.rad + b2.rad)) {
if (((_parent.ball.target == this) and (b2.team != this.team)) || ((_parent.ball.target == b2) and (this.team != b2.team))) {
tacklePause();
}
if (_root.game.gameMode == "plays") {
var _local8 = 0;
if (xspeed < 0) {
_local8 = _local8 + (-xspeed);
} else {
_local8 = _local8 + xspeed;
}
if (yspeed < 0) {
_local8 = _local8 + (-yspeed);
} else {
_local8 = _local8 + yspeed;
}
if (_local8 > 1) {
hitSound.setVolume(_local8 * 15);
hitSound.start(0, 0);
hitSound.setVolume(_local8 * 15);
}
}
var _local18 = Math.atan2(_local11, _local12);
var _local7 = Math.cos(_local18);
var _local6 = Math.sin(_local18);
var _local9 = (_local7 * b1.xspeed) + (_local6 * b1.yspeed);
var _local15 = (_local7 * b1.yspeed) - (_local6 * b1.xspeed);
var _local10 = (_local7 * b2.xspeed) + (_local6 * b2.yspeed);
var _local14 = (_local7 * b2.yspeed) - (_local6 * b2.xspeed);
var _local21 = (_local9 * b1.mass) + (_local10 * b2.mass);
var _local20 = _local9 - _local10;
_local9 = (_local21 - (b2.mass * _local20)) / (b1.mass + b2.mass);
_local10 = _local20 + _local9;
b1.xspeed = ((_local7 * _local9) - (_local6 * _local15)) * 0.7;
b1.yspeed = ((_local7 * _local15) + (_local6 * _local9)) * 0.7;
b2.xspeed = ((_local7 * _local10) - (_local6 * _local14)) * 0.7;
b2.yspeed = ((_local7 * _local14) + (_local6 * _local10)) * 0.7;
var _local16 = ((b1.rad + b2.rad) - _local19) / 2;
var _local17 = _local7 * _local16;
var _local13 = _local6 * _local16;
b1._x = b1._x - (_local17 * 1.1);
b1._y = b1._y - (_local13 * 1.1);
b2._x = b2._x + (_local17 * 1.1);
b2._y = b2._y + (_local13 * 1.1);
}
}
if (_root.game.gameMode == "kickOff") {
var xspeedEq = speed;
var yspeedEq = speed;
}
if (_root.game.cleanUp == true) {
this.removeMovieClip();
}
if ((_root.game.gameMode == "scrum") || (_root.game.gameMode == "kickOff")) {
forwardProgress = 0;
progressTimer = 0;
}
if (team == _root.game.playersTeam) {
if (_root.game.playType == "running") {
if (_root.game.playersTeam == 1) {
if ((((_name == "player7") || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else if ((((_name == "player18") || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else {
mass = 2;
}
}
if (team == _root.game.compTeam) {
if (_root.game.compPlayType == "running") {
if (_root.game.compTeam == 1) {
if ((((_name == "player7") || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else if ((((_name == "player18") || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else {
mass = 2;
}
}
if ((((((_name == "player22") and (parseInt(_root.game.ball.storedOwner.team) == 2)) and (_root.game.gameMode != "plays")) and (_root.game.gameMode != "celebration")) and (_root.game.paused == false)) || (((((_name == "player11") and (parseInt(_root.game.ball.storedOwner.team) == 1)) and (_root.game.gameMode != "plays")) and (_root.game.gameMode != "celebration")) and (_root.game.paused == false))) {
if (_currentframe == 1) {
gotoAndStop (3);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(10);
}
} else if (_currentframe == 2) {
gotoAndStop (4);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(10);
}
}
} else if (((((_name == "player22") and (_root.game.gameMode != "plays")) and (_root.game.paused == false)) and (_root.game.gameMode != "celebration")) and (_root.game.gameMode != "shot")) {
gotoAndStop(_root.game.player21._currentframe);
} else if (((((_name == "player11") and (_root.game.gameMode != "plays")) and (_root.game.paused == false)) and (_root.game.gameMode != "celebration")) and (_root.game.gameMode != "shot")) {
gotoAndStop(_root.game.player10._currentframe);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(_root.game.player10.ani._currentframe);
}
}
if ((tackled == true) and (_root.game.paused == false)) {
tackle();
}
if (_root.game.paused == false) {
if (_parent.ball.target != this) {
arrow.gotoAndStop(1);
var arrowPlayed = false;
heldTime = 0;
} else {
if ((_parent.passesNum == 1) || (_root.game.downs == 0)) {
if (team == 1) {
if ((((xspeed < 0) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) and (_root.game.messageList.length == 0)) {
if ((_root.game.tdMode == false) || ((_root.game.tdMode != false) and (_parent.passesNum > 0))) {
progressTimer = progressTimer + 1;
if ((forwardProgress == 0) || (forwardProgress < (_x + fixedLineX))) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
forwardProgress = _x + fixedLineX;
}
if (progressTimer > 50) {
turnedPause();
progressTimer = 0;
}
} else {
progressTimer = 0;
}
}
} else if ((((xspeed > 0) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) and (_root.game.messageList.length == 0)) {
if ((_root.game.tdMode == false) || ((_root.game.tdMode != false) and (_parent.passesNum > 0))) {
progressTimer = progressTimer + 1;
if ((forwardProgress == 0) || (forwardProgress > (_x + fixedLineX))) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
forwardProgress = _x + fixedLineX;
}
if (progressTimer > 50) {
turnedPause();
progressTimer = 0;
}
} else {
progressTimer = 0;
}
}
}
if ((((team == 1) and (_root.game.gameMode == "plays")) and (team != _root.game.playersTeam)) || (((team == 1) and (_root.game.gameMode == "plays")) and (_root.game.demoMode == true))) {
heldTime = heldTime + 1;
var playerAmount = 12;
i = 1;
while (i < playerAmount) {
var target = _root.game["player" + i];
var randFactor = random(3);
if (((((((((target._x > (_x + 40)) and (_parent.passesNum == 0)) and (heldTime > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed > (1.5 * _root.game.vibrationVal))) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || ((((_parent.nzone.hitTest(target.xpos, target.ypos, true) and (target._x > _x)) and (_parent.passesNum == 0)) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing"))) || ((((((((target._x > (_x + 40)) and (_parent.passesNum == 0)) and (heldTime > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed > 1.5)) and (_root.game.downs > 0)) and (_root.game.playType == "passing")) and (_root.game.demoMode == true))) {
_parent.passesNum = _parent.passesNum + 1;
_parent.ball.target = "";
_parent.ball.targetX = _root.game["player" + i]._x + (_root.game["player" + i].xspeed * (8 + random(15)));
_parent.ball.targetY = (_root.game["player" + i]._y - 10) + (_root.game["player" + i].yspeed * (8 + random(15)));
var dx = (_parent.ball.targetX - _parent.ball._x);
var dy = (_parent.ball.targetY - _parent.ball._y);
var dist = Math.sqrt((dx * dx) + (dy * dy));
_parent.ball.xspeed = dx / (dist / 10);
_parent.ball.yspeed = dy / (dist / 10);
_parent.ball.zspeed = -(dist / 20);
_parent.ball.zpos = 4;
}
i = i + 1;
}
} else {
heldTime = 0;
}
if ((((team == 2) and (_root.game.gameMode == "plays")) and (team != _root.game.playersTeam)) || (((team == 2) and (_root.game.gameMode == "plays")) and (_root.game.demoMode == true))) {
heldTime2 = heldTime2 + 1;
var playerAmount = 23;
i = 12;
while (i < playerAmount) {
var target = _root.game["player" + i];
var randFactor = random(3);
if ((((((((target._x < (_x - 40)) and (_parent.passesNum == 0)) and (heldTime2 > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed < (-1.5 * _root.game.vibrationVal))) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || ((((_parent.nzone.hitTest(target.xpos, target.ypos, true) and (target._x < _x)) and (_parent.passesNum == 0)) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing"))) {
_parent.passesNum = _parent.passesNum + 1;
_parent.ball.target = "";
_parent.ball.targetX = _root.game["player" + i]._x + (_root.game["player" + i].xspeed * (8 + random(15)));
_parent.ball.targetY = (_root.game["player" + i]._y - 10) + (_root.game["player" + i].yspeed * (8 + random(15)));
var dx = (_parent.ball.targetX - _parent.ball._x);
var dy = (_parent.ball.targetY - _parent.ball._y);
var dist = Math.sqrt((dx * dx) + (dy * dy));
_parent.ball.xspeed = dx / (dist / 10);
_parent.ball.yspeed = dy / (dist / 10);
_parent.ball.zspeed = -(dist / 20);
_parent.ball.zpos = 4;
}
i = i + 1;
}
} else {
heldTime2 = 0;
}
if (arrowPlayed == false) {
arrow.play();
var arrowPlayed = true;
}
}
if ((_root.game.gameMode == "plays") and (_parent.ball.target == "")) {
if ((((((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player22")) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player11"))) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player4"))) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player16"))) {
} else {
var catchRad = (rad * 2.5);
var zcatch = 4;
}
if (_root.game.ball.target == "") {
if ((_root.game.ball._x < (_x + 50)) and (_root.game.ball._x > (_x - 50))) {
if ((((_root.game.lastGameMode == "kickOff") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player22")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "kickOff") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player11")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "punt") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player15")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "punt") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player4")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "puntSafety") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player15")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "puntSafety") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player4")) {
_root.game.ball.target = this;
}
}
if ((_root.game.ball._x < (_x + 20)) and (_root.game.ball._x > (_x - 20))) {
var dx = (_parent.ball._x - _x);
var dy = (_parent.ball._y - (_y - 10));
var dist = Math.sqrt((dx * dx) + (dy * dy));
if (((dist < catchRad) and (_parent.ball.zpos < zcatch)) and (_root.game.ball.bounce < 1)) {
if ((_parent.ball.storedOwner.team != team) and (_parent.ball.storedOwner.team > 0)) {
if (_root.game.tdMode != false) {
tacklePause();
} else {
_parent.scoreboard.bigscreen.ani.gotoAndPlay("intercept");
_root.game.downs = 0;
intercepted = true;
_root.game.intercepted = true;
}
}
_parent.ball.target = this;
arrow.play();
}
var dx = ((_parent.ball._x + _root.game.ball.xspeed) - _x);
var dy = ((_parent.ball._y + _root.game.ball.yspeed) - (_y - 10));
var dist = Math.sqrt((dx * dx) + (dy * dy));
if (((dist < catchRad) and (_parent.ball.zpos < zcatch)) and (_root.game.ball.bounce < 1)) {
if ((_parent.ball.storedOwner.team != team) and (_parent.ball.storedOwner.team > 0)) {
if (_root.game.tdMode != false) {
tacklePause();
} else {
_parent.scoreboard.bigscreen.ani.gotoAndPlay("intercept");
_root.game.downs = 0;
intercepted = true;
_root.game.intercepted = true;
}
}
_parent.ball.target = this;
arrow.play();
}
}
}
}
xpos = _x + _root.game._x;
ypos = _y + _root.game._y;
speed = 0.12 * _root.game.vibrationVal;
currentY = _y - _root.game.pitchBackY;
posY = currentY / _root.game.pitchFrontY;
percent = _root.game.pitchDepth / _root.game.horizon;
depthScale = (1 - percent) + (posY * percent);
if (intercepted == true) {
speedDone = false;
intercepted = false;
}
if ((_root.game.vibrate == true) and (_root.game.paused == false)) {
rotTimer = 1 + random(20 * _root.game.vibrationVal);
if (rotTimer == 1) {
rotInc = (-30 + random(60)) / 140;
}
rotVel = rotVel + rotInc;
if (((_root.game.gameMode == "plays") and (speedDone == false)) || (_root.game.mouseIsDown == true)) {
if (_root.game.lastGameMode != "kickOff") {
speedDone = true;
if (_root.game.ball.target != this) {
if (((_root.game.playType == "running") and (team == _root.game.playersTeam)) || ((_root.game.compPlayType == "running") and (team == _root.game.compTeam))) {
if ((((((((((_name == "player22") || (_name == "player18")) || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) || (_name == "player11")) || (_name == "player7")) || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
var xspeedEq = (speed * 1.5);
var yspeedEq = (speed * 1.5);
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else if (((_root.game.playType == "defense") and (team == _root.game.playersTeam)) || ((_root.game.compPlayType == "defense") and (team == _root.game.compTeam))) {
if ((_root.downs >= 1) and (_root.game.blitz == false)) {
if ((((_name == "player8") || (_name == "player9")) || (_name == "player19")) || (_name == "player20")) {
var xspeedEq = (-(speed / 3));
var yspeedEq = (-(speed / 3));
} else if ((((_name == "player10") || (_name == "player11")) || (_name == "player21")) || (_name == "player22")) {
var xspeedEq = (-(speed / 5));
var yspeedEq = (-(speed / 5));
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else if (((((_root.game.passesNum == 0) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || (((_root.game.passesNum == 0) and (_root.game.downs > 0)) and (_root.game.playType == "passing"))) || (((_root.game.passesNum == 0) and (_root.game.tdMode != false)) and (_root.game.playType == "passing"))) {
var xspeedEq = (-(speed / 6));
var yspeedEq = (-(speed / 6));
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
}
}
if ((_root.game.gameMode != "plays") || (_root.game.paused == true)) {
speedDone = false;
}
if (((_root.game.gameMode == "plays") || (_root.game.gameMode == "celebration")) || (_root.game.gameMode == "shot")) {
xspeed = xspeed + (Math.cos((rot - 180) * (Math.PI/180)) * xspeedEq);
yspeed = yspeed + (Math.sin((rot - 180) * (Math.PI/180)) * yspeedEq);
}
if (collisionTimer < 1) {
collisionTimer = collisionTimer + 1;
} else {
collisionTimer = 0;
}
if (((_root.game.vibrate == true) and (_root.game.paused == false)) || (_root.game.mouseIsDown == true)) {
if ((collisionTimer == 0) and (team == 1)) {
i = 0;
while (i < (_root.game.playerNum + 1)) {
var target = _root.game["player" + i];
if (_name != ("player" + i)) {
checkCollision(this, target);
}
i = i + 1;
}
checkWalls();
}
if ((collisionTimer == 1) and (team == 2)) {
i = 12;
while (i < (_root.game.playerNum + 1)) {
var target = _root.game["player" + i];
if (_name != ("player" + i)) {
checkCollision(this, target);
}
i = i + 1;
}
checkWalls();
}
}
if (_root.game.gameMode == "puntSafety") {
checkWalls();
}
xspeed = xspeed * 0.97;
yspeed = yspeed * 0.97;
rotVel = rotVel * 0.97;
this.swapDepths(_y + (_x / 5));
if ((_name == "player22") and (_root.game.playType == "running")) {
} else {
var aniFrames = ani._totalframes;
rotStored = rotStored + rotVel;
if (rotStored > (360 / aniFrames)) {
if (ani._currentframe < aniFrames) {
ani.nextFrame();
} else {
ani.gotoAndStop(1);
}
rotStored = rotStored - (360 / aniFrames);
}
if (rotStored < (-(360 / aniFrames))) {
if (ani._currentframe > 1) {
ani.prevFrame();
} else {
ani.gotoAndStop(aniFrames);
}
rotStored = rotStored + (360 / aniFrames);
}
rot = rot + rotVel;
_xscale = (depthScale * 110);
_yscale = _xscale;
}
if (((_root.game.gameMode == "plays") || (_root.game.gameMode == "celebration")) || (_root.game.gameMode == "shot")) {
_x = (_x + (xspeed * depthScale));
_y = (_y + (yspeed * depthScale));
}
}
}
Instance of Symbol 198 MovieClip "player22" in Symbol 494 MovieClip Frame 2
onClipEvent (load) {
hitSound = new Sound(this);
hitSound.attachSound("hitSound");
xspeed = 0;
yspeed = 0;
speed = 0.1 * _root.game.vibrationVal;
currentY = _y - _root.game.pitchBackY;
posY = currentY / _root.game.pitchFrontY;
percent = _root.game.pitchDepth / _root.game.horizon;
depthScale = (1 - percent) + (posY * percent);
rotVel = 0;
rotInc = 0;
rotTimer = random(20);
_rotation = 0;
xpos = _x + _root.game._x;
ypos = _y + _root.game._y;
_root.game.playerNum = _root.game.playerNum + 1;
mass = 2;
rad = hitArea._width / 2.3;
team = 0;
if (parseInt(substring(_name, 7, 2)) < 12) {
team = 1;
rot = 180;
origRot = rot;
if ((_name == "player22") || (_name == "player11")) {
gotoAndStop (4);
} else {
gotoAndStop (2);
}
ani.gotoAndStop(10);
} else {
team = 2;
rot = 0;
origRot = rot;
if ((_name == "player22") || (_name == "player11")) {
gotoAndStop (3);
} else {
gotoAndStop (1);
}
ani.gotoAndStop(1);
}
if (team == 2) {
trace(((("new Array(" + Math.round(_x)) + ",") + Math.round(_y)) + "),");
}
rotStored = 0;
heldTime = 0;
heldTime2 = 0;
tackled = false;
forwardProgress = 0;
progressTimer = 0;
type = "";
fixedLineX = 0;
speedDone = false;
var xspeedEq = speed;
var yspeedEq = speed;
storedVar = "";
collisionTimer = 0;
intercepted = false;
}
onClipEvent (enterFrame) {
function checkOutOfBounds() {
if (_root.game.ball.target == this) {
boundsPause();
if ((ani._currentframe < 6) || (ani._currentframe > 14)) {
if (team == 1) {
}
} else if ((ani._currentframe > 6) and (ani._currentframe < 14)) {
if (team == 2) {
}
}
}
}
function checkScrimmage() {
if (team == 1) {
if (_root.game.scrimmage < _root.game.endZoneL) {
_root.game.scrimmage = _root.game.twentyYardLineL;
_root.game.touchBack = true;
} else {
_root.game.touchBack = false;
}
if (_root.game.scrimmage > _root.game.endZoneR) {
_root.game.scrimmage = _root.game.endZoneR;
}
} else {
if (_root.game.scrimmage < _root.game.endZoneL) {
_root.game.scrimmage = _root.game.endZoneL;
}
if (_root.game.scrimmage > _root.game.endZoneR) {
_root.game.scrimmage = _root.game.twentyYardLineR;
_root.game.touchBack = true;
} else {
_root.game.touchBack = false;
}
}
}
function tacklePause() {
type = "tackle";
if ((_root.game.timeOut == true) and (_root.game.tdMode == false)) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
_root.game.scrimmage = _x + fixedLineX;
checkScrimmage();
}
if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "tackle";
_root.game.safed = true;
} else if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "tackle";
_root.game.safed = true;
} else {
type = "tackle";
}
if ((_root.game.paused == false) and (_root.game.gameMode != "celebration")) {
_root.game.sound.gotoAndPlay("whistle");
}
if (((((_root.game.gameMode == "plays") and (_root.game.paused == false)) || ((_root.game.gameMode == "kickOff") and (_root.game.paused == false))) || ((_root.game.gameMode == "punt") and (_root.game.paused == false))) || (((_root.game.tdMode != false) and (_root.game.paused == false)) and (_root.game.gameMode == "plays"))) {
tackled = true;
type = "tackle";
if ((_root.game.passesNum == 0) and (_root.game.gameMode != "celebration")) {
if (_parent.ball.target.team == 1) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
if (((_x + fixedLineX) < _root.game.scrimmage) and (_root.game.downs > 0)) {
_parent.addMessage("sack");
} else {
_parent.addMessage("tackled");
}
}
if (_parent.ball.target.team == 2) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
if (((_x + fixedLineX) > _root.game.scrimmage) and (_root.game.downs > 0)) {
_parent.addMessage("sack");
} else {
_parent.addMessage("tackled");
}
}
} else if (_root.game.gameMode != "celebration") {
_parent.addMessage("tackled");
}
_root.game.pauseTime = 55;
}
}
function boundsPause() {
if (_root.game.timeOut == true) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
_root.game.scrimmage = _x + fixedLineX;
checkScrimmage();
}
if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "bounds";
_root.game.safed = true;
} else if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "bounds";
_root.game.safed = true;
} else {
type = "bounds";
}
type = "bounds";
_root.game.sound.gotoAndPlay("whistle");
tackled = true;
_parent.addMessage("outOfBounds");
_root.game.pauseTime = 55;
}
function turnedPause() {
if (_root.game.timeOut == true) {
_root.game.scrimmage = forwardProgress;
checkScrimmage();
}
type = "turn";
_root.game.sound.gotoAndPlay("whistle");
tackled = true;
_parent.addMessage("turnedAround");
_parent.addMessage("negativeProgress");
_root.game.pauseTime = 55;
}
function tackle() {
if ((_root.game.gameMode != "puntSafety") and (gameMode != "scrum")) {
if (_root.game.tdMode != false) {
if ((_root.game.timeOut == false) and (_root.game.gameMode != "celebration")) {
_root.game.startKickoff(_root.game.playersTeam);
_root.game.removeTackles();
tacked = false;
_root.game.tdMode = false;
} else if (_root.game.gameMode != "celebration") {
_root.game.removeTackles();
tacked = false;
_root.game.tdMode = false;
_root.game.gameMode = "convFail";
trace(_root.game.gameMode);
} else {
_root.game.removeTackles();
tacked = false;
}
} else if ((_root.game.downs <= 3.5) || (_root.game.goForIt == true)) {
if ((((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (type != "turn")) and (_root.game.downs > 0.5)) and (_root.game.ball.target == this)) and (_root.game.gameMode != "celebration")) {
_root.game.addMessage("Safety");
if (team != _root.game.playersTeam) {
_root.game.setupSafetyKick(_root.game.compTeam);
_root.game.hscore = _root.game.hscore + 2;
} else {
_root.game.setupSafetyKick(_root.game.playersTeam);
_root.game.gscore = _root.game.gscore + 2;
}
tackled = false;
} else if ((((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (type != "turn")) and (_root.game.downs > 0.5)) and (_root.game.ball.target == this)) and (_root.game.gameMode != "celebration")) {
_root.game.addMessage("Safety");
if (team != _root.game.playersTeam) {
_root.game.setupSafetyKick(_root.game.compTeam);
_root.game.hscore = _root.game.hscore + 2;
} else {
_root.game.setupSafetyKick(_root.game.playersTeam);
_root.game.gscore = _root.game.gscore + 2;
}
tackled = false;
} else {
_root.game.changeMode = false;
tackled = false;
if (type == "turn") {
var _local4 = forwardProgress;
} else {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
var _local4 = _x + fixedLineX;
}
_root.game.scrimmage = _local4;
if (_parent.ball.target.team != _root.game.playersTeam) {
var _local5 = random(2);
if (_local5 == 1) {
_root.game.compPlayType = "passing";
_root.game.setupLine(_root.game.compTeam, _root.game.formationShotgun, _local4, 0.5);
} else {
_root.game.compPlayType = "running";
_root.game.setupLine(_root.game.compTeam, _root.game.formationI, _local4, 0.5);
}
_root.game.setupLine(_root.game.playersTeam, _root.game.formation43, _local4, 0.5);
} else {
var _local5 = 1 + random(5);
_root.game.compPlayType = "defense";
_root.game.setupLine(_root.game.compTeam, _root.game["formationDefence" + _local5], _local4, 0.5);
_root.game.setupLine(_root.game.playersTeam, _root.game.formationShotgun, _local4, 0.5);
}
}
} else if ((_root.game.goForIt == true) and (_root.game.gameMode == "plays")) {
if (_root.game.changeMode == false) {
_root.game.downs = _root.game.downs + 1;
}
_root.game.pauseTime = 0;
_root.game.paused = false;
tackled = false;
} else if (_root.game.gameMode == "plays") {
_root.game.pauseTime = 0;
_root.game.paused = false;
if (_root.game.changeMode == false) {
_root.game.downs = _root.game.downs + 1;
}
tackled = false;
}
}
}
function checkWalls() {
if ((_y + 10) > _root.game.pitchFrontY) {
if (((yspeed > 1) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) {
checkOutOfBounds();
}
_y = (_y - 1);
yspeed = (-yspeed) * 0.5;
}
if ((_y - 5) < _root.game.pitchBackY) {
if (((yspeed < 1) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) {
checkOutOfBounds();
}
_y = (_y + 1);
yspeed = (-yspeed) * 0.5;
}
if (_root.game.walls.hitTest(xpos + (hitArea._width / 2), ypos, true) and (_x > 300)) {
_x = (_x - 2);
xspeed = (-xspeed) * 0.5;
}
if (_root.game.walls.hitTest(xpos - (hitArea._width / 2), ypos, true) and (_x < 300)) {
_x = (_x + 2);
xspeed = (-xspeed) * 0.5;
}
}
function checkCollision(b1, b2) {
var _local12 = b2._x - b1._x;
var _local11 = b2._y - b1._y;
var _local19 = Math.sqrt((_local12 * _local12) + (_local11 * _local11));
if (_local19 < (b1.rad + b2.rad)) {
if (((_parent.ball.target == this) and (b2.team != this.team)) || ((_parent.ball.target == b2) and (this.team != b2.team))) {
tacklePause();
}
if (_root.game.gameMode == "plays") {
var _local8 = 0;
if (xspeed < 0) {
_local8 = _local8 + (-xspeed);
} else {
_local8 = _local8 + xspeed;
}
if (yspeed < 0) {
_local8 = _local8 + (-yspeed);
} else {
_local8 = _local8 + yspeed;
}
if (_local8 > 1) {
hitSound.setVolume(_local8 * 15);
hitSound.start(0, 0);
hitSound.setVolume(_local8 * 15);
}
}
var _local18 = Math.atan2(_local11, _local12);
var _local7 = Math.cos(_local18);
var _local6 = Math.sin(_local18);
var _local9 = (_local7 * b1.xspeed) + (_local6 * b1.yspeed);
var _local15 = (_local7 * b1.yspeed) - (_local6 * b1.xspeed);
var _local10 = (_local7 * b2.xspeed) + (_local6 * b2.yspeed);
var _local14 = (_local7 * b2.yspeed) - (_local6 * b2.xspeed);
var _local21 = (_local9 * b1.mass) + (_local10 * b2.mass);
var _local20 = _local9 - _local10;
_local9 = (_local21 - (b2.mass * _local20)) / (b1.mass + b2.mass);
_local10 = _local20 + _local9;
b1.xspeed = ((_local7 * _local9) - (_local6 * _local15)) * 0.7;
b1.yspeed = ((_local7 * _local15) + (_local6 * _local9)) * 0.7;
b2.xspeed = ((_local7 * _local10) - (_local6 * _local14)) * 0.7;
b2.yspeed = ((_local7 * _local14) + (_local6 * _local10)) * 0.7;
var _local16 = ((b1.rad + b2.rad) - _local19) / 2;
var _local17 = _local7 * _local16;
var _local13 = _local6 * _local16;
b1._x = b1._x - (_local17 * 1.1);
b1._y = b1._y - (_local13 * 1.1);
b2._x = b2._x + (_local17 * 1.1);
b2._y = b2._y + (_local13 * 1.1);
}
}
if (_root.game.gameMode == "kickOff") {
var xspeedEq = speed;
var yspeedEq = speed;
}
if (_root.game.cleanUp == true) {
this.removeMovieClip();
}
if ((_root.game.gameMode == "scrum") || (_root.game.gameMode == "kickOff")) {
forwardProgress = 0;
progressTimer = 0;
}
if (team == _root.game.playersTeam) {
if (_root.game.playType == "running") {
if (_root.game.playersTeam == 1) {
if ((((_name == "player7") || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else if ((((_name == "player18") || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else {
mass = 2;
}
}
if (team == _root.game.compTeam) {
if (_root.game.compPlayType == "running") {
if (_root.game.compTeam == 1) {
if ((((_name == "player7") || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else if ((((_name == "player18") || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else {
mass = 2;
}
}
if ((((((_name == "player22") and (parseInt(_root.game.ball.storedOwner.team) == 2)) and (_root.game.gameMode != "plays")) and (_root.game.gameMode != "celebration")) and (_root.game.paused == false)) || (((((_name == "player11") and (parseInt(_root.game.ball.storedOwner.team) == 1)) and (_root.game.gameMode != "plays")) and (_root.game.gameMode != "celebration")) and (_root.game.paused == false))) {
if (_currentframe == 1) {
gotoAndStop (3);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(10);
}
} else if (_currentframe == 2) {
gotoAndStop (4);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(10);
}
}
} else if (((((_name == "player22") and (_root.game.gameMode != "plays")) and (_root.game.paused == false)) and (_root.game.gameMode != "celebration")) and (_root.game.gameMode != "shot")) {
gotoAndStop(_root.game.player21._currentframe);
} else if (((((_name == "player11") and (_root.game.gameMode != "plays")) and (_root.game.paused == false)) and (_root.game.gameMode != "celebration")) and (_root.game.gameMode != "shot")) {
gotoAndStop(_root.game.player10._currentframe);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(_root.game.player10.ani._currentframe);
}
}
if ((tackled == true) and (_root.game.paused == false)) {
tackle();
}
if (_root.game.paused == false) {
if (_parent.ball.target != this) {
arrow.gotoAndStop(1);
var arrowPlayed = false;
heldTime = 0;
} else {
if ((_parent.passesNum == 1) || (_root.game.downs == 0)) {
if (team == 1) {
if ((((xspeed < 0) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) and (_root.game.messageList.length == 0)) {
if ((_root.game.tdMode == false) || ((_root.game.tdMode != false) and (_parent.passesNum > 0))) {
progressTimer = progressTimer + 1;
if ((forwardProgress == 0) || (forwardProgress < (_x + fixedLineX))) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
forwardProgress = _x + fixedLineX;
}
if (progressTimer > 50) {
turnedPause();
progressTimer = 0;
}
} else {
progressTimer = 0;
}
}
} else if ((((xspeed > 0) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) and (_root.game.messageList.length == 0)) {
if ((_root.game.tdMode == false) || ((_root.game.tdMode != false) and (_parent.passesNum > 0))) {
progressTimer = progressTimer + 1;
if ((forwardProgress == 0) || (forwardProgress > (_x + fixedLineX))) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
forwardProgress = _x + fixedLineX;
}
if (progressTimer > 50) {
turnedPause();
progressTimer = 0;
}
} else {
progressTimer = 0;
}
}
}
if ((((team == 1) and (_root.game.gameMode == "plays")) and (team != _root.game.playersTeam)) || (((team == 1) and (_root.game.gameMode == "plays")) and (_root.game.demoMode == true))) {
heldTime = heldTime + 1;
var playerAmount = 12;
i = 1;
while (i < playerAmount) {
var target = _root.game["player" + i];
var randFactor = random(3);
if (((((((((target._x > (_x + 40)) and (_parent.passesNum == 0)) and (heldTime > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed > (1.5 * _root.game.vibrationVal))) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || ((((_parent.nzone.hitTest(target.xpos, target.ypos, true) and (target._x > _x)) and (_parent.passesNum == 0)) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing"))) || ((((((((target._x > (_x + 40)) and (_parent.passesNum == 0)) and (heldTime > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed > 1.5)) and (_root.game.downs > 0)) and (_root.game.playType == "passing")) and (_root.game.demoMode == true))) {
_parent.passesNum = _parent.passesNum + 1;
_parent.ball.target = "";
_parent.ball.targetX = _root.game["player" + i]._x + (_root.game["player" + i].xspeed * (8 + random(15)));
_parent.ball.targetY = (_root.game["player" + i]._y - 10) + (_root.game["player" + i].yspeed * (8 + random(15)));
var dx = (_parent.ball.targetX - _parent.ball._x);
var dy = (_parent.ball.targetY - _parent.ball._y);
var dist = Math.sqrt((dx * dx) + (dy * dy));
_parent.ball.xspeed = dx / (dist / 10);
_parent.ball.yspeed = dy / (dist / 10);
_parent.ball.zspeed = -(dist / 20);
_parent.ball.zpos = 4;
}
i = i + 1;
}
} else {
heldTime = 0;
}
if ((((team == 2) and (_root.game.gameMode == "plays")) and (team != _root.game.playersTeam)) || (((team == 2) and (_root.game.gameMode == "plays")) and (_root.game.demoMode == true))) {
heldTime2 = heldTime2 + 1;
var playerAmount = 23;
i = 12;
while (i < playerAmount) {
var target = _root.game["player" + i];
var randFactor = random(3);
if ((((((((target._x < (_x - 40)) and (_parent.passesNum == 0)) and (heldTime2 > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed < (-1.5 * _root.game.vibrationVal))) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || ((((_parent.nzone.hitTest(target.xpos, target.ypos, true) and (target._x < _x)) and (_parent.passesNum == 0)) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing"))) {
_parent.passesNum = _parent.passesNum + 1;
_parent.ball.target = "";
_parent.ball.targetX = _root.game["player" + i]._x + (_root.game["player" + i].xspeed * (8 + random(15)));
_parent.ball.targetY = (_root.game["player" + i]._y - 10) + (_root.game["player" + i].yspeed * (8 + random(15)));
var dx = (_parent.ball.targetX - _parent.ball._x);
var dy = (_parent.ball.targetY - _parent.ball._y);
var dist = Math.sqrt((dx * dx) + (dy * dy));
_parent.ball.xspeed = dx / (dist / 10);
_parent.ball.yspeed = dy / (dist / 10);
_parent.ball.zspeed = -(dist / 20);
_parent.ball.zpos = 4;
}
i = i + 1;
}
} else {
heldTime2 = 0;
}
if (arrowPlayed == false) {
arrow.play();
var arrowPlayed = true;
}
}
if ((_root.game.gameMode == "plays") and (_parent.ball.target == "")) {
if ((((((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player22")) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player11"))) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player4"))) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player16"))) {
} else {
var catchRad = (rad * 2.5);
var zcatch = 4;
}
if (_root.game.ball.target == "") {
if ((_root.game.ball._x < (_x + 50)) and (_root.game.ball._x > (_x - 50))) {
if ((((_root.game.lastGameMode == "kickOff") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player22")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "kickOff") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player11")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "punt") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player15")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "punt") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player4")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "puntSafety") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player15")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "puntSafety") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player4")) {
_root.game.ball.target = this;
}
}
if ((_root.game.ball._x < (_x + 20)) and (_root.game.ball._x > (_x - 20))) {
var dx = (_parent.ball._x - _x);
var dy = (_parent.ball._y - (_y - 10));
var dist = Math.sqrt((dx * dx) + (dy * dy));
if (((dist < catchRad) and (_parent.ball.zpos < zcatch)) and (_root.game.ball.bounce < 1)) {
if ((_parent.ball.storedOwner.team != team) and (_parent.ball.storedOwner.team > 0)) {
if (_root.game.tdMode != false) {
tacklePause();
} else {
_parent.scoreboard.bigscreen.ani.gotoAndPlay("intercept");
_root.game.downs = 0;
intercepted = true;
_root.game.intercepted = true;
}
}
_parent.ball.target = this;
arrow.play();
}
var dx = ((_parent.ball._x + _root.game.ball.xspeed) - _x);
var dy = ((_parent.ball._y + _root.game.ball.yspeed) - (_y - 10));
var dist = Math.sqrt((dx * dx) + (dy * dy));
if (((dist < catchRad) and (_parent.ball.zpos < zcatch)) and (_root.game.ball.bounce < 1)) {
if ((_parent.ball.storedOwner.team != team) and (_parent.ball.storedOwner.team > 0)) {
if (_root.game.tdMode != false) {
tacklePause();
} else {
_parent.scoreboard.bigscreen.ani.gotoAndPlay("intercept");
_root.game.downs = 0;
intercepted = true;
_root.game.intercepted = true;
}
}
_parent.ball.target = this;
arrow.play();
}
}
}
}
xpos = _x + _root.game._x;
ypos = _y + _root.game._y;
speed = 0.12 * _root.game.vibrationVal;
currentY = _y - _root.game.pitchBackY;
posY = currentY / _root.game.pitchFrontY;
percent = _root.game.pitchDepth / _root.game.horizon;
depthScale = (1 - percent) + (posY * percent);
if (intercepted == true) {
speedDone = false;
intercepted = false;
}
if ((_root.game.vibrate == true) and (_root.game.paused == false)) {
rotTimer = 1 + random(20 * _root.game.vibrationVal);
if (rotTimer == 1) {
rotInc = (-30 + random(60)) / 140;
}
rotVel = rotVel + rotInc;
if (((_root.game.gameMode == "plays") and (speedDone == false)) || (_root.game.mouseIsDown == true)) {
if (_root.game.lastGameMode != "kickOff") {
speedDone = true;
if (_root.game.ball.target != this) {
if (((_root.game.playType == "running") and (team == _root.game.playersTeam)) || ((_root.game.compPlayType == "running") and (team == _root.game.compTeam))) {
if ((((((((((_name == "player22") || (_name == "player18")) || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) || (_name == "player11")) || (_name == "player7")) || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
var xspeedEq = (speed * 1.5);
var yspeedEq = (speed * 1.5);
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else if (((_root.game.playType == "defense") and (team == _root.game.playersTeam)) || ((_root.game.compPlayType == "defense") and (team == _root.game.compTeam))) {
if ((_root.downs >= 1) and (_root.game.blitz == false)) {
if ((((_name == "player8") || (_name == "player9")) || (_name == "player19")) || (_name == "player20")) {
var xspeedEq = (-(speed / 3));
var yspeedEq = (-(speed / 3));
} else if ((((_name == "player10") || (_name == "player11")) || (_name == "player21")) || (_name == "player22")) {
var xspeedEq = (-(speed / 5));
var yspeedEq = (-(speed / 5));
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else if (((((_root.game.passesNum == 0) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || (((_root.game.passesNum == 0) and (_root.game.downs > 0)) and (_root.game.playType == "passing"))) || (((_root.game.passesNum == 0) and (_root.game.tdMode != false)) and (_root.game.playType == "passing"))) {
var xspeedEq = (-(speed / 6));
var yspeedEq = (-(speed / 6));
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
}
}
if ((_root.game.gameMode != "plays") || (_root.game.paused == true)) {
speedDone = false;
}
if (((_root.game.gameMode == "plays") || (_root.game.gameMode == "celebration")) || (_root.game.gameMode == "shot")) {
xspeed = xspeed + (Math.cos((rot - 180) * (Math.PI/180)) * xspeedEq);
yspeed = yspeed + (Math.sin((rot - 180) * (Math.PI/180)) * yspeedEq);
}
if (collisionTimer < 1) {
collisionTimer = collisionTimer + 1;
} else {
collisionTimer = 0;
}
if (((_root.game.vibrate == true) and (_root.game.paused == false)) || (_root.game.mouseIsDown == true)) {
if ((collisionTimer == 0) and (team == 1)) {
i = 0;
while (i < (_root.game.playerNum + 1)) {
var target = _root.game["player" + i];
if (_name != ("player" + i)) {
checkCollision(this, target);
}
i = i + 1;
}
checkWalls();
}
if ((collisionTimer == 1) and (team == 2)) {
i = 12;
while (i < (_root.game.playerNum + 1)) {
var target = _root.game["player" + i];
if (_name != ("player" + i)) {
checkCollision(this, target);
}
i = i + 1;
}
checkWalls();
}
}
if (_root.game.gameMode == "puntSafety") {
checkWalls();
}
xspeed = xspeed * 0.97;
yspeed = yspeed * 0.97;
rotVel = rotVel * 0.97;
this.swapDepths(_y + (_x / 5));
if ((_name == "player22") and (_root.game.playType == "running")) {
} else {
var aniFrames = ani._totalframes;
rotStored = rotStored + rotVel;
if (rotStored > (360 / aniFrames)) {
if (ani._currentframe < aniFrames) {
ani.nextFrame();
} else {
ani.gotoAndStop(1);
}
rotStored = rotStored - (360 / aniFrames);
}
if (rotStored < (-(360 / aniFrames))) {
if (ani._currentframe > 1) {
ani.prevFrame();
} else {
ani.gotoAndStop(aniFrames);
}
rotStored = rotStored + (360 / aniFrames);
}
rot = rot + rotVel;
_xscale = (depthScale * 110);
_yscale = _xscale;
}
if (((_root.game.gameMode == "plays") || (_root.game.gameMode == "celebration")) || (_root.game.gameMode == "shot")) {
_x = (_x + (xspeed * depthScale));
_y = (_y + (yspeed * depthScale));
}
}
}
onClipEvent (load) {
arrow.play();
}
Instance of Symbol 198 MovieClip "player1" in Symbol 494 MovieClip Frame 2
onClipEvent (load) {
hitSound = new Sound(this);
hitSound.attachSound("hitSound");
xspeed = 0;
yspeed = 0;
speed = 0.1 * _root.game.vibrationVal;
currentY = _y - _root.game.pitchBackY;
posY = currentY / _root.game.pitchFrontY;
percent = _root.game.pitchDepth / _root.game.horizon;
depthScale = (1 - percent) + (posY * percent);
rotVel = 0;
rotInc = 0;
rotTimer = random(20);
_rotation = 0;
xpos = _x + _root.game._x;
ypos = _y + _root.game._y;
_root.game.playerNum = _root.game.playerNum + 1;
mass = 2;
rad = hitArea._width / 2.3;
team = 0;
if (parseInt(substring(_name, 7, 2)) < 12) {
team = 1;
rot = 180;
origRot = rot;
if ((_name == "player22") || (_name == "player11")) {
gotoAndStop (4);
} else {
gotoAndStop (2);
}
ani.gotoAndStop(10);
} else {
team = 2;
rot = 0;
origRot = rot;
if ((_name == "player22") || (_name == "player11")) {
gotoAndStop (3);
} else {
gotoAndStop (1);
}
ani.gotoAndStop(1);
}
if (team == 2) {
trace(((("new Array(" + Math.round(_x)) + ",") + Math.round(_y)) + "),");
}
rotStored = 0;
heldTime = 0;
heldTime2 = 0;
tackled = false;
forwardProgress = 0;
progressTimer = 0;
type = "";
fixedLineX = 0;
speedDone = false;
var xspeedEq = speed;
var yspeedEq = speed;
storedVar = "";
collisionTimer = 0;
intercepted = false;
}
onClipEvent (enterFrame) {
function checkOutOfBounds() {
if (_root.game.ball.target == this) {
boundsPause();
if ((ani._currentframe < 6) || (ani._currentframe > 14)) {
if (team == 1) {
}
} else if ((ani._currentframe > 6) and (ani._currentframe < 14)) {
if (team == 2) {
}
}
}
}
function checkScrimmage() {
if (team == 1) {
if (_root.game.scrimmage < _root.game.endZoneL) {
_root.game.scrimmage = _root.game.twentyYardLineL;
_root.game.touchBack = true;
} else {
_root.game.touchBack = false;
}
if (_root.game.scrimmage > _root.game.endZoneR) {
_root.game.scrimmage = _root.game.endZoneR;
}
} else {
if (_root.game.scrimmage < _root.game.endZoneL) {
_root.game.scrimmage = _root.game.endZoneL;
}
if (_root.game.scrimmage > _root.game.endZoneR) {
_root.game.scrimmage = _root.game.twentyYardLineR;
_root.game.touchBack = true;
} else {
_root.game.touchBack = false;
}
}
}
function tacklePause() {
type = "tackle";
if ((_root.game.timeOut == true) and (_root.game.tdMode == false)) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
_root.game.scrimmage = _x + fixedLineX;
checkScrimmage();
}
if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "tackle";
_root.game.safed = true;
} else if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "tackle";
_root.game.safed = true;
} else {
type = "tackle";
}
if ((_root.game.paused == false) and (_root.game.gameMode != "celebration")) {
_root.game.sound.gotoAndPlay("whistle");
}
if (((((_root.game.gameMode == "plays") and (_root.game.paused == false)) || ((_root.game.gameMode == "kickOff") and (_root.game.paused == false))) || ((_root.game.gameMode == "punt") and (_root.game.paused == false))) || (((_root.game.tdMode != false) and (_root.game.paused == false)) and (_root.game.gameMode == "plays"))) {
tackled = true;
type = "tackle";
if ((_root.game.passesNum == 0) and (_root.game.gameMode != "celebration")) {
if (_parent.ball.target.team == 1) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
if (((_x + fixedLineX) < _root.game.scrimmage) and (_root.game.downs > 0)) {
_parent.addMessage("sack");
} else {
_parent.addMessage("tackled");
}
}
if (_parent.ball.target.team == 2) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
if (((_x + fixedLineX) > _root.game.scrimmage) and (_root.game.downs > 0)) {
_parent.addMessage("sack");
} else {
_parent.addMessage("tackled");
}
}
} else if (_root.game.gameMode != "celebration") {
_parent.addMessage("tackled");
}
_root.game.pauseTime = 55;
}
}
function boundsPause() {
if (_root.game.timeOut == true) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
_root.game.scrimmage = _x + fixedLineX;
checkScrimmage();
}
if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "bounds";
_root.game.safed = true;
} else if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "bounds";
_root.game.safed = true;
} else {
type = "bounds";
}
type = "bounds";
_root.game.sound.gotoAndPlay("whistle");
tackled = true;
_parent.addMessage("outOfBounds");
_root.game.pauseTime = 55;
}
function turnedPause() {
if (_root.game.timeOut == true) {
_root.game.scrimmage = forwardProgress;
checkScrimmage();
}
type = "turn";
_root.game.sound.gotoAndPlay("whistle");
tackled = true;
_parent.addMessage("turnedAround");
_parent.addMessage("negativeProgress");
_root.game.pauseTime = 55;
}
function tackle() {
if ((_root.game.gameMode != "puntSafety") and (gameMode != "scrum")) {
if (_root.game.tdMode != false) {
if ((_root.game.timeOut == false) and (_root.game.gameMode != "celebration")) {
_root.game.startKickoff(_root.game.playersTeam);
_root.game.removeTackles();
tacked = false;
_root.game.tdMode = false;
} else if (_root.game.gameMode != "celebration") {
_root.game.removeTackles();
tacked = false;
_root.game.tdMode = false;
_root.game.gameMode = "convFail";
trace(_root.game.gameMode);
} else {
_root.game.removeTackles();
tacked = false;
}
} else if ((_root.game.downs <= 3.5) || (_root.game.goForIt == true)) {
if ((((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (type != "turn")) and (_root.game.downs > 0.5)) and (_root.game.ball.target == this)) and (_root.game.gameMode != "celebration")) {
_root.game.addMessage("Safety");
if (team != _root.game.playersTeam) {
_root.game.setupSafetyKick(_root.game.compTeam);
_root.game.hscore = _root.game.hscore + 2;
} else {
_root.game.setupSafetyKick(_root.game.playersTeam);
_root.game.gscore = _root.game.gscore + 2;
}
tackled = false;
} else if ((((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (type != "turn")) and (_root.game.downs > 0.5)) and (_root.game.ball.target == this)) and (_root.game.gameMode != "celebration")) {
_root.game.addMessage("Safety");
if (team != _root.game.playersTeam) {
_root.game.setupSafetyKick(_root.game.compTeam);
_root.game.hscore = _root.game.hscore + 2;
} else {
_root.game.setupSafetyKick(_root.game.playersTeam);
_root.game.gscore = _root.game.gscore + 2;
}
tackled = false;
} else {
_root.game.changeMode = false;
tackled = false;
if (type == "turn") {
var _local4 = forwardProgress;
} else {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
var _local4 = _x + fixedLineX;
}
_root.game.scrimmage = _local4;
if (_parent.ball.target.team != _root.game.playersTeam) {
var _local5 = random(2);
if (_local5 == 1) {
_root.game.compPlayType = "passing";
_root.game.setupLine(_root.game.compTeam, _root.game.formationShotgun, _local4, 0.5);
} else {
_root.game.compPlayType = "running";
_root.game.setupLine(_root.game.compTeam, _root.game.formationI, _local4, 0.5);
}
_root.game.setupLine(_root.game.playersTeam, _root.game.formation43, _local4, 0.5);
} else {
var _local5 = 1 + random(5);
_root.game.compPlayType = "defense";
_root.game.setupLine(_root.game.compTeam, _root.game["formationDefence" + _local5], _local4, 0.5);
_root.game.setupLine(_root.game.playersTeam, _root.game.formationShotgun, _local4, 0.5);
}
}
} else if ((_root.game.goForIt == true) and (_root.game.gameMode == "plays")) {
if (_root.game.changeMode == false) {
_root.game.downs = _root.game.downs + 1;
}
_root.game.pauseTime = 0;
_root.game.paused = false;
tackled = false;
} else if (_root.game.gameMode == "plays") {
_root.game.pauseTime = 0;
_root.game.paused = false;
if (_root.game.changeMode == false) {
_root.game.downs = _root.game.downs + 1;
}
tackled = false;
}
}
}
function checkWalls() {
if ((_y + 10) > _root.game.pitchFrontY) {
if (((yspeed > 1) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) {
checkOutOfBounds();
}
_y = (_y - 1);
yspeed = (-yspeed) * 0.5;
}
if ((_y - 5) < _root.game.pitchBackY) {
if (((yspeed < 1) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) {
checkOutOfBounds();
}
_y = (_y + 1);
yspeed = (-yspeed) * 0.5;
}
if (_root.game.walls.hitTest(xpos + (hitArea._width / 2), ypos, true) and (_x > 300)) {
_x = (_x - 2);
xspeed = (-xspeed) * 0.5;
}
if (_root.game.walls.hitTest(xpos - (hitArea._width / 2), ypos, true) and (_x < 300)) {
_x = (_x + 2);
xspeed = (-xspeed) * 0.5;
}
}
function checkCollision(b1, b2) {
var _local12 = b2._x - b1._x;
var _local11 = b2._y - b1._y;
var _local19 = Math.sqrt((_local12 * _local12) + (_local11 * _local11));
if (_local19 < (b1.rad + b2.rad)) {
if (((_parent.ball.target == this) and (b2.team != this.team)) || ((_parent.ball.target == b2) and (this.team != b2.team))) {
tacklePause();
}
if (_root.game.gameMode == "plays") {
var _local8 = 0;
if (xspeed < 0) {
_local8 = _local8 + (-xspeed);
} else {
_local8 = _local8 + xspeed;
}
if (yspeed < 0) {
_local8 = _local8 + (-yspeed);
} else {
_local8 = _local8 + yspeed;
}
if (_local8 > 1) {
hitSound.setVolume(_local8 * 15);
hitSound.start(0, 0);
hitSound.setVolume(_local8 * 15);
}
}
var _local18 = Math.atan2(_local11, _local12);
var _local7 = Math.cos(_local18);
var _local6 = Math.sin(_local18);
var _local9 = (_local7 * b1.xspeed) + (_local6 * b1.yspeed);
var _local15 = (_local7 * b1.yspeed) - (_local6 * b1.xspeed);
var _local10 = (_local7 * b2.xspeed) + (_local6 * b2.yspeed);
var _local14 = (_local7 * b2.yspeed) - (_local6 * b2.xspeed);
var _local21 = (_local9 * b1.mass) + (_local10 * b2.mass);
var _local20 = _local9 - _local10;
_local9 = (_local21 - (b2.mass * _local20)) / (b1.mass + b2.mass);
_local10 = _local20 + _local9;
b1.xspeed = ((_local7 * _local9) - (_local6 * _local15)) * 0.7;
b1.yspeed = ((_local7 * _local15) + (_local6 * _local9)) * 0.7;
b2.xspeed = ((_local7 * _local10) - (_local6 * _local14)) * 0.7;
b2.yspeed = ((_local7 * _local14) + (_local6 * _local10)) * 0.7;
var _local16 = ((b1.rad + b2.rad) - _local19) / 2;
var _local17 = _local7 * _local16;
var _local13 = _local6 * _local16;
b1._x = b1._x - (_local17 * 1.1);
b1._y = b1._y - (_local13 * 1.1);
b2._x = b2._x + (_local17 * 1.1);
b2._y = b2._y + (_local13 * 1.1);
}
}
if (_root.game.gameMode == "kickOff") {
var xspeedEq = speed;
var yspeedEq = speed;
}
if (_root.game.cleanUp == true) {
this.removeMovieClip();
}
if ((_root.game.gameMode == "scrum") || (_root.game.gameMode == "kickOff")) {
forwardProgress = 0;
progressTimer = 0;
}
if (team == _root.game.playersTeam) {
if (_root.game.playType == "running") {
if (_root.game.playersTeam == 1) {
if ((((_name == "player7") || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else if ((((_name == "player18") || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else {
mass = 2;
}
}
if (team == _root.game.compTeam) {
if (_root.game.compPlayType == "running") {
if (_root.game.compTeam == 1) {
if ((((_name == "player7") || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else if ((((_name == "player18") || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else {
mass = 2;
}
}
if ((((((_name == "player22") and (parseInt(_root.game.ball.storedOwner.team) == 2)) and (_root.game.gameMode != "plays")) and (_root.game.gameMode != "celebration")) and (_root.game.paused == false)) || (((((_name == "player11") and (parseInt(_root.game.ball.storedOwner.team) == 1)) and (_root.game.gameMode != "plays")) and (_root.game.gameMode != "celebration")) and (_root.game.paused == false))) {
if (_currentframe == 1) {
gotoAndStop (3);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(10);
}
} else if (_currentframe == 2) {
gotoAndStop (4);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(10);
}
}
} else if (((((_name == "player22") and (_root.game.gameMode != "plays")) and (_root.game.paused == false)) and (_root.game.gameMode != "celebration")) and (_root.game.gameMode != "shot")) {
gotoAndStop(_root.game.player21._currentframe);
} else if (((((_name == "player11") and (_root.game.gameMode != "plays")) and (_root.game.paused == false)) and (_root.game.gameMode != "celebration")) and (_root.game.gameMode != "shot")) {
gotoAndStop(_root.game.player10._currentframe);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(_root.game.player10.ani._currentframe);
}
}
if ((tackled == true) and (_root.game.paused == false)) {
tackle();
}
if (_root.game.paused == false) {
if (_parent.ball.target != this) {
arrow.gotoAndStop(1);
var arrowPlayed = false;
heldTime = 0;
} else {
if ((_parent.passesNum == 1) || (_root.game.downs == 0)) {
if (team == 1) {
if ((((xspeed < 0) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) and (_root.game.messageList.length == 0)) {
if ((_root.game.tdMode == false) || ((_root.game.tdMode != false) and (_parent.passesNum > 0))) {
progressTimer = progressTimer + 1;
if ((forwardProgress == 0) || (forwardProgress < (_x + fixedLineX))) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
forwardProgress = _x + fixedLineX;
}
if (progressTimer > 50) {
turnedPause();
progressTimer = 0;
}
} else {
progressTimer = 0;
}
}
} else if ((((xspeed > 0) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) and (_root.game.messageList.length == 0)) {
if ((_root.game.tdMode == false) || ((_root.game.tdMode != false) and (_parent.passesNum > 0))) {
progressTimer = progressTimer + 1;
if ((forwardProgress == 0) || (forwardProgress > (_x + fixedLineX))) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
forwardProgress = _x + fixedLineX;
}
if (progressTimer > 50) {
turnedPause();
progressTimer = 0;
}
} else {
progressTimer = 0;
}
}
}
if ((((team == 1) and (_root.game.gameMode == "plays")) and (team != _root.game.playersTeam)) || (((team == 1) and (_root.game.gameMode == "plays")) and (_root.game.demoMode == true))) {
heldTime = heldTime + 1;
var playerAmount = 12;
i = 1;
while (i < playerAmount) {
var target = _root.game["player" + i];
var randFactor = random(3);
if (((((((((target._x > (_x + 40)) and (_parent.passesNum == 0)) and (heldTime > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed > (1.5 * _root.game.vibrationVal))) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || ((((_parent.nzone.hitTest(target.xpos, target.ypos, true) and (target._x > _x)) and (_parent.passesNum == 0)) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing"))) || ((((((((target._x > (_x + 40)) and (_parent.passesNum == 0)) and (heldTime > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed > 1.5)) and (_root.game.downs > 0)) and (_root.game.playType == "passing")) and (_root.game.demoMode == true))) {
_parent.passesNum = _parent.passesNum + 1;
_parent.ball.target = "";
_parent.ball.targetX = _root.game["player" + i]._x + (_root.game["player" + i].xspeed * (8 + random(15)));
_parent.ball.targetY = (_root.game["player" + i]._y - 10) + (_root.game["player" + i].yspeed * (8 + random(15)));
var dx = (_parent.ball.targetX - _parent.ball._x);
var dy = (_parent.ball.targetY - _parent.ball._y);
var dist = Math.sqrt((dx * dx) + (dy * dy));
_parent.ball.xspeed = dx / (dist / 10);
_parent.ball.yspeed = dy / (dist / 10);
_parent.ball.zspeed = -(dist / 20);
_parent.ball.zpos = 4;
}
i = i + 1;
}
} else {
heldTime = 0;
}
if ((((team == 2) and (_root.game.gameMode == "plays")) and (team != _root.game.playersTeam)) || (((team == 2) and (_root.game.gameMode == "plays")) and (_root.game.demoMode == true))) {
heldTime2 = heldTime2 + 1;
var playerAmount = 23;
i = 12;
while (i < playerAmount) {
var target = _root.game["player" + i];
var randFactor = random(3);
if ((((((((target._x < (_x - 40)) and (_parent.passesNum == 0)) and (heldTime2 > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed < (-1.5 * _root.game.vibrationVal))) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || ((((_parent.nzone.hitTest(target.xpos, target.ypos, true) and (target._x < _x)) and (_parent.passesNum == 0)) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing"))) {
_parent.passesNum = _parent.passesNum + 1;
_parent.ball.target = "";
_parent.ball.targetX = _root.game["player" + i]._x + (_root.game["player" + i].xspeed * (8 + random(15)));
_parent.ball.targetY = (_root.game["player" + i]._y - 10) + (_root.game["player" + i].yspeed * (8 + random(15)));
var dx = (_parent.ball.targetX - _parent.ball._x);
var dy = (_parent.ball.targetY - _parent.ball._y);
var dist = Math.sqrt((dx * dx) + (dy * dy));
_parent.ball.xspeed = dx / (dist / 10);
_parent.ball.yspeed = dy / (dist / 10);
_parent.ball.zspeed = -(dist / 20);
_parent.ball.zpos = 4;
}
i = i + 1;
}
} else {
heldTime2 = 0;
}
if (arrowPlayed == false) {
arrow.play();
var arrowPlayed = true;
}
}
if ((_root.game.gameMode == "plays") and (_parent.ball.target == "")) {
if ((((((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player22")) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player11"))) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player4"))) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player16"))) {
} else {
var catchRad = (rad * 2.5);
var zcatch = 4;
}
if (_root.game.ball.target == "") {
if ((_root.game.ball._x < (_x + 50)) and (_root.game.ball._x > (_x - 50))) {
if ((((_root.game.lastGameMode == "kickOff") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player22")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "kickOff") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player11")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "punt") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player15")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "punt") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player4")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "puntSafety") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player15")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "puntSafety") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player4")) {
_root.game.ball.target = this;
}
}
if ((_root.game.ball._x < (_x + 20)) and (_root.game.ball._x > (_x - 20))) {
var dx = (_parent.ball._x - _x);
var dy = (_parent.ball._y - (_y - 10));
var dist = Math.sqrt((dx * dx) + (dy * dy));
if (((dist < catchRad) and (_parent.ball.zpos < zcatch)) and (_root.game.ball.bounce < 1)) {
if ((_parent.ball.storedOwner.team != team) and (_parent.ball.storedOwner.team > 0)) {
if (_root.game.tdMode != false) {
tacklePause();
} else {
_parent.scoreboard.bigscreen.ani.gotoAndPlay("intercept");
_root.game.downs = 0;
intercepted = true;
_root.game.intercepted = true;
}
}
_parent.ball.target = this;
arrow.play();
}
var dx = ((_parent.ball._x + _root.game.ball.xspeed) - _x);
var dy = ((_parent.ball._y + _root.game.ball.yspeed) - (_y - 10));
var dist = Math.sqrt((dx * dx) + (dy * dy));
if (((dist < catchRad) and (_parent.ball.zpos < zcatch)) and (_root.game.ball.bounce < 1)) {
if ((_parent.ball.storedOwner.team != team) and (_parent.ball.storedOwner.team > 0)) {
if (_root.game.tdMode != false) {
tacklePause();
} else {
_parent.scoreboard.bigscreen.ani.gotoAndPlay("intercept");
_root.game.downs = 0;
intercepted = true;
_root.game.intercepted = true;
}
}
_parent.ball.target = this;
arrow.play();
}
}
}
}
xpos = _x + _root.game._x;
ypos = _y + _root.game._y;
speed = 0.12 * _root.game.vibrationVal;
currentY = _y - _root.game.pitchBackY;
posY = currentY / _root.game.pitchFrontY;
percent = _root.game.pitchDepth / _root.game.horizon;
depthScale = (1 - percent) + (posY * percent);
if (intercepted == true) {
speedDone = false;
intercepted = false;
}
if ((_root.game.vibrate == true) and (_root.game.paused == false)) {
rotTimer = 1 + random(20 * _root.game.vibrationVal);
if (rotTimer == 1) {
rotInc = (-30 + random(60)) / 140;
}
rotVel = rotVel + rotInc;
if (((_root.game.gameMode == "plays") and (speedDone == false)) || (_root.game.mouseIsDown == true)) {
if (_root.game.lastGameMode != "kickOff") {
speedDone = true;
if (_root.game.ball.target != this) {
if (((_root.game.playType == "running") and (team == _root.game.playersTeam)) || ((_root.game.compPlayType == "running") and (team == _root.game.compTeam))) {
if ((((((((((_name == "player22") || (_name == "player18")) || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) || (_name == "player11")) || (_name == "player7")) || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
var xspeedEq = (speed * 1.5);
var yspeedEq = (speed * 1.5);
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else if (((_root.game.playType == "defense") and (team == _root.game.playersTeam)) || ((_root.game.compPlayType == "defense") and (team == _root.game.compTeam))) {
if ((_root.downs >= 1) and (_root.game.blitz == false)) {
if ((((_name == "player8") || (_name == "player9")) || (_name == "player19")) || (_name == "player20")) {
var xspeedEq = (-(speed / 3));
var yspeedEq = (-(speed / 3));
} else if ((((_name == "player10") || (_name == "player11")) || (_name == "player21")) || (_name == "player22")) {
var xspeedEq = (-(speed / 5));
var yspeedEq = (-(speed / 5));
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else if (((((_root.game.passesNum == 0) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || (((_root.game.passesNum == 0) and (_root.game.downs > 0)) and (_root.game.playType == "passing"))) || (((_root.game.passesNum == 0) and (_root.game.tdMode != false)) and (_root.game.playType == "passing"))) {
var xspeedEq = (-(speed / 6));
var yspeedEq = (-(speed / 6));
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
}
}
if ((_root.game.gameMode != "plays") || (_root.game.paused == true)) {
speedDone = false;
}
if (((_root.game.gameMode == "plays") || (_root.game.gameMode == "celebration")) || (_root.game.gameMode == "shot")) {
xspeed = xspeed + (Math.cos((rot - 180) * (Math.PI/180)) * xspeedEq);
yspeed = yspeed + (Math.sin((rot - 180) * (Math.PI/180)) * yspeedEq);
}
if (collisionTimer < 1) {
collisionTimer = collisionTimer + 1;
} else {
collisionTimer = 0;
}
if (((_root.game.vibrate == true) and (_root.game.paused == false)) || (_root.game.mouseIsDown == true)) {
if ((collisionTimer == 0) and (team == 1)) {
i = 0;
while (i < (_root.game.playerNum + 1)) {
var target = _root.game["player" + i];
if (_name != ("player" + i)) {
checkCollision(this, target);
}
i = i + 1;
}
checkWalls();
}
if ((collisionTimer == 1) and (team == 2)) {
i = 12;
while (i < (_root.game.playerNum + 1)) {
var target = _root.game["player" + i];
if (_name != ("player" + i)) {
checkCollision(this, target);
}
i = i + 1;
}
checkWalls();
}
}
if (_root.game.gameMode == "puntSafety") {
checkWalls();
}
xspeed = xspeed * 0.97;
yspeed = yspeed * 0.97;
rotVel = rotVel * 0.97;
this.swapDepths(_y + (_x / 5));
if ((_name == "player22") and (_root.game.playType == "running")) {
} else {
var aniFrames = ani._totalframes;
rotStored = rotStored + rotVel;
if (rotStored > (360 / aniFrames)) {
if (ani._currentframe < aniFrames) {
ani.nextFrame();
} else {
ani.gotoAndStop(1);
}
rotStored = rotStored - (360 / aniFrames);
}
if (rotStored < (-(360 / aniFrames))) {
if (ani._currentframe > 1) {
ani.prevFrame();
} else {
ani.gotoAndStop(aniFrames);
}
rotStored = rotStored + (360 / aniFrames);
}
rot = rot + rotVel;
_xscale = (depthScale * 110);
_yscale = _xscale;
}
if (((_root.game.gameMode == "plays") || (_root.game.gameMode == "celebration")) || (_root.game.gameMode == "shot")) {
_x = (_x + (xspeed * depthScale));
_y = (_y + (yspeed * depthScale));
}
}
}
Instance of Symbol 198 MovieClip "player15" in Symbol 494 MovieClip Frame 2
onClipEvent (load) {
hitSound = new Sound(this);
hitSound.attachSound("hitSound");
xspeed = 0;
yspeed = 0;
speed = 0.1 * _root.game.vibrationVal;
currentY = _y - _root.game.pitchBackY;
posY = currentY / _root.game.pitchFrontY;
percent = _root.game.pitchDepth / _root.game.horizon;
depthScale = (1 - percent) + (posY * percent);
rotVel = 0;
rotInc = 0;
rotTimer = random(20);
_rotation = 0;
xpos = _x + _root.game._x;
ypos = _y + _root.game._y;
_root.game.playerNum = _root.game.playerNum + 1;
mass = 2;
rad = hitArea._width / 2.3;
team = 0;
if (parseInt(substring(_name, 7, 2)) < 12) {
team = 1;
rot = 180;
origRot = rot;
if ((_name == "player22") || (_name == "player11")) {
gotoAndStop (4);
} else {
gotoAndStop (2);
}
ani.gotoAndStop(10);
} else {
team = 2;
rot = 0;
origRot = rot;
if ((_name == "player22") || (_name == "player11")) {
gotoAndStop (3);
} else {
gotoAndStop (1);
}
ani.gotoAndStop(1);
}
if (team == 2) {
trace(((("new Array(" + Math.round(_x)) + ",") + Math.round(_y)) + "),");
}
rotStored = 0;
heldTime = 0;
heldTime2 = 0;
tackled = false;
forwardProgress = 0;
progressTimer = 0;
type = "";
fixedLineX = 0;
speedDone = false;
var xspeedEq = speed;
var yspeedEq = speed;
storedVar = "";
collisionTimer = 0;
intercepted = false;
}
onClipEvent (enterFrame) {
function checkOutOfBounds() {
if (_root.game.ball.target == this) {
boundsPause();
if ((ani._currentframe < 6) || (ani._currentframe > 14)) {
if (team == 1) {
}
} else if ((ani._currentframe > 6) and (ani._currentframe < 14)) {
if (team == 2) {
}
}
}
}
function checkScrimmage() {
if (team == 1) {
if (_root.game.scrimmage < _root.game.endZoneL) {
_root.game.scrimmage = _root.game.twentyYardLineL;
_root.game.touchBack = true;
} else {
_root.game.touchBack = false;
}
if (_root.game.scrimmage > _root.game.endZoneR) {
_root.game.scrimmage = _root.game.endZoneR;
}
} else {
if (_root.game.scrimmage < _root.game.endZoneL) {
_root.game.scrimmage = _root.game.endZoneL;
}
if (_root.game.scrimmage > _root.game.endZoneR) {
_root.game.scrimmage = _root.game.twentyYardLineR;
_root.game.touchBack = true;
} else {
_root.game.touchBack = false;
}
}
}
function tacklePause() {
type = "tackle";
if ((_root.game.timeOut == true) and (_root.game.tdMode == false)) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
_root.game.scrimmage = _x + fixedLineX;
checkScrimmage();
}
if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "tackle";
_root.game.safed = true;
} else if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "tackle";
_root.game.safed = true;
} else {
type = "tackle";
}
if ((_root.game.paused == false) and (_root.game.gameMode != "celebration")) {
_root.game.sound.gotoAndPlay("whistle");
}
if (((((_root.game.gameMode == "plays") and (_root.game.paused == false)) || ((_root.game.gameMode == "kickOff") and (_root.game.paused == false))) || ((_root.game.gameMode == "punt") and (_root.game.paused == false))) || (((_root.game.tdMode != false) and (_root.game.paused == false)) and (_root.game.gameMode == "plays"))) {
tackled = true;
type = "tackle";
if ((_root.game.passesNum == 0) and (_root.game.gameMode != "celebration")) {
if (_parent.ball.target.team == 1) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
if (((_x + fixedLineX) < _root.game.scrimmage) and (_root.game.downs > 0)) {
_parent.addMessage("sack");
} else {
_parent.addMessage("tackled");
}
}
if (_parent.ball.target.team == 2) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
if (((_x + fixedLineX) > _root.game.scrimmage) and (_root.game.downs > 0)) {
_parent.addMessage("sack");
} else {
_parent.addMessage("tackled");
}
}
} else if (_root.game.gameMode != "celebration") {
_parent.addMessage("tackled");
}
_root.game.pauseTime = 55;
}
}
function boundsPause() {
if (_root.game.timeOut == true) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
_root.game.scrimmage = _x + fixedLineX;
checkScrimmage();
}
if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "bounds";
_root.game.safed = true;
} else if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "bounds";
_root.game.safed = true;
} else {
type = "bounds";
}
type = "bounds";
_root.game.sound.gotoAndPlay("whistle");
tackled = true;
_parent.addMessage("outOfBounds");
_root.game.pauseTime = 55;
}
function turnedPause() {
if (_root.game.timeOut == true) {
_root.game.scrimmage = forwardProgress;
checkScrimmage();
}
type = "turn";
_root.game.sound.gotoAndPlay("whistle");
tackled = true;
_parent.addMessage("turnedAround");
_parent.addMessage("negativeProgress");
_root.game.pauseTime = 55;
}
function tackle() {
if ((_root.game.gameMode != "puntSafety") and (gameMode != "scrum")) {
if (_root.game.tdMode != false) {
if ((_root.game.timeOut == false) and (_root.game.gameMode != "celebration")) {
_root.game.startKickoff(_root.game.playersTeam);
_root.game.removeTackles();
tacked = false;
_root.game.tdMode = false;
} else if (_root.game.gameMode != "celebration") {
_root.game.removeTackles();
tacked = false;
_root.game.tdMode = false;
_root.game.gameMode = "convFail";
trace(_root.game.gameMode);
} else {
_root.game.removeTackles();
tacked = false;
}
} else if ((_root.game.downs <= 3.5) || (_root.game.goForIt == true)) {
if ((((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (type != "turn")) and (_root.game.downs > 0.5)) and (_root.game.ball.target == this)) and (_root.game.gameMode != "celebration")) {
_root.game.addMessage("Safety");
if (team != _root.game.playersTeam) {
_root.game.setupSafetyKick(_root.game.compTeam);
_root.game.hscore = _root.game.hscore + 2;
} else {
_root.game.setupSafetyKick(_root.game.playersTeam);
_root.game.gscore = _root.game.gscore + 2;
}
tackled = false;
} else if ((((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (type != "turn")) and (_root.game.downs > 0.5)) and (_root.game.ball.target == this)) and (_root.game.gameMode != "celebration")) {
_root.game.addMessage("Safety");
if (team != _root.game.playersTeam) {
_root.game.setupSafetyKick(_root.game.compTeam);
_root.game.hscore = _root.game.hscore + 2;
} else {
_root.game.setupSafetyKick(_root.game.playersTeam);
_root.game.gscore = _root.game.gscore + 2;
}
tackled = false;
} else {
_root.game.changeMode = false;
tackled = false;
if (type == "turn") {
var _local4 = forwardProgress;
} else {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
var _local4 = _x + fixedLineX;
}
_root.game.scrimmage = _local4;
if (_parent.ball.target.team != _root.game.playersTeam) {
var _local5 = random(2);
if (_local5 == 1) {
_root.game.compPlayType = "passing";
_root.game.setupLine(_root.game.compTeam, _root.game.formationShotgun, _local4, 0.5);
} else {
_root.game.compPlayType = "running";
_root.game.setupLine(_root.game.compTeam, _root.game.formationI, _local4, 0.5);
}
_root.game.setupLine(_root.game.playersTeam, _root.game.formation43, _local4, 0.5);
} else {
var _local5 = 1 + random(5);
_root.game.compPlayType = "defense";
_root.game.setupLine(_root.game.compTeam, _root.game["formationDefence" + _local5], _local4, 0.5);
_root.game.setupLine(_root.game.playersTeam, _root.game.formationShotgun, _local4, 0.5);
}
}
} else if ((_root.game.goForIt == true) and (_root.game.gameMode == "plays")) {
if (_root.game.changeMode == false) {
_root.game.downs = _root.game.downs + 1;
}
_root.game.pauseTime = 0;
_root.game.paused = false;
tackled = false;
} else if (_root.game.gameMode == "plays") {
_root.game.pauseTime = 0;
_root.game.paused = false;
if (_root.game.changeMode == false) {
_root.game.downs = _root.game.downs + 1;
}
tackled = false;
}
}
}
function checkWalls() {
if ((_y + 10) > _root.game.pitchFrontY) {
if (((yspeed > 1) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) {
checkOutOfBounds();
}
_y = (_y - 1);
yspeed = (-yspeed) * 0.5;
}
if ((_y - 5) < _root.game.pitchBackY) {
if (((yspeed < 1) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) {
checkOutOfBounds();
}
_y = (_y + 1);
yspeed = (-yspeed) * 0.5;
}
if (_root.game.walls.hitTest(xpos + (hitArea._width / 2), ypos, true) and (_x > 300)) {
_x = (_x - 2);
xspeed = (-xspeed) * 0.5;
}
if (_root.game.walls.hitTest(xpos - (hitArea._width / 2), ypos, true) and (_x < 300)) {
_x = (_x + 2);
xspeed = (-xspeed) * 0.5;
}
}
function checkCollision(b1, b2) {
var _local12 = b2._x - b1._x;
var _local11 = b2._y - b1._y;
var _local19 = Math.sqrt((_local12 * _local12) + (_local11 * _local11));
if (_local19 < (b1.rad + b2.rad)) {
if (((_parent.ball.target == this) and (b2.team != this.team)) || ((_parent.ball.target == b2) and (this.team != b2.team))) {
tacklePause();
}
if (_root.game.gameMode == "plays") {
var _local8 = 0;
if (xspeed < 0) {
_local8 = _local8 + (-xspeed);
} else {
_local8 = _local8 + xspeed;
}
if (yspeed < 0) {
_local8 = _local8 + (-yspeed);
} else {
_local8 = _local8 + yspeed;
}
if (_local8 > 1) {
hitSound.setVolume(_local8 * 15);
hitSound.start(0, 0);
hitSound.setVolume(_local8 * 15);
}
}
var _local18 = Math.atan2(_local11, _local12);
var _local7 = Math.cos(_local18);
var _local6 = Math.sin(_local18);
var _local9 = (_local7 * b1.xspeed) + (_local6 * b1.yspeed);
var _local15 = (_local7 * b1.yspeed) - (_local6 * b1.xspeed);
var _local10 = (_local7 * b2.xspeed) + (_local6 * b2.yspeed);
var _local14 = (_local7 * b2.yspeed) - (_local6 * b2.xspeed);
var _local21 = (_local9 * b1.mass) + (_local10 * b2.mass);
var _local20 = _local9 - _local10;
_local9 = (_local21 - (b2.mass * _local20)) / (b1.mass + b2.mass);
_local10 = _local20 + _local9;
b1.xspeed = ((_local7 * _local9) - (_local6 * _local15)) * 0.7;
b1.yspeed = ((_local7 * _local15) + (_local6 * _local9)) * 0.7;
b2.xspeed = ((_local7 * _local10) - (_local6 * _local14)) * 0.7;
b2.yspeed = ((_local7 * _local14) + (_local6 * _local10)) * 0.7;
var _local16 = ((b1.rad + b2.rad) - _local19) / 2;
var _local17 = _local7 * _local16;
var _local13 = _local6 * _local16;
b1._x = b1._x - (_local17 * 1.1);
b1._y = b1._y - (_local13 * 1.1);
b2._x = b2._x + (_local17 * 1.1);
b2._y = b2._y + (_local13 * 1.1);
}
}
if (_root.game.gameMode == "kickOff") {
var xspeedEq = speed;
var yspeedEq = speed;
}
if (_root.game.cleanUp == true) {
this.removeMovieClip();
}
if ((_root.game.gameMode == "scrum") || (_root.game.gameMode == "kickOff")) {
forwardProgress = 0;
progressTimer = 0;
}
if (team == _root.game.playersTeam) {
if (_root.game.playType == "running") {
if (_root.game.playersTeam == 1) {
if ((((_name == "player7") || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else if ((((_name == "player18") || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else {
mass = 2;
}
}
if (team == _root.game.compTeam) {
if (_root.game.compPlayType == "running") {
if (_root.game.compTeam == 1) {
if ((((_name == "player7") || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else if ((((_name == "player18") || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else {
mass = 2;
}
}
if ((((((_name == "player22") and (parseInt(_root.game.ball.storedOwner.team) == 2)) and (_root.game.gameMode != "plays")) and (_root.game.gameMode != "celebration")) and (_root.game.paused == false)) || (((((_name == "player11") and (parseInt(_root.game.ball.storedOwner.team) == 1)) and (_root.game.gameMode != "plays")) and (_root.game.gameMode != "celebration")) and (_root.game.paused == false))) {
if (_currentframe == 1) {
gotoAndStop (3);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(10);
}
} else if (_currentframe == 2) {
gotoAndStop (4);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(10);
}
}
} else if (((((_name == "player22") and (_root.game.gameMode != "plays")) and (_root.game.paused == false)) and (_root.game.gameMode != "celebration")) and (_root.game.gameMode != "shot")) {
gotoAndStop(_root.game.player21._currentframe);
} else if (((((_name == "player11") and (_root.game.gameMode != "plays")) and (_root.game.paused == false)) and (_root.game.gameMode != "celebration")) and (_root.game.gameMode != "shot")) {
gotoAndStop(_root.game.player10._currentframe);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(_root.game.player10.ani._currentframe);
}
}
if ((tackled == true) and (_root.game.paused == false)) {
tackle();
}
if (_root.game.paused == false) {
if (_parent.ball.target != this) {
arrow.gotoAndStop(1);
var arrowPlayed = false;
heldTime = 0;
} else {
if ((_parent.passesNum == 1) || (_root.game.downs == 0)) {
if (team == 1) {
if ((((xspeed < 0) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) and (_root.game.messageList.length == 0)) {
if ((_root.game.tdMode == false) || ((_root.game.tdMode != false) and (_parent.passesNum > 0))) {
progressTimer = progressTimer + 1;
if ((forwardProgress == 0) || (forwardProgress < (_x + fixedLineX))) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
forwardProgress = _x + fixedLineX;
}
if (progressTimer > 50) {
turnedPause();
progressTimer = 0;
}
} else {
progressTimer = 0;
}
}
} else if ((((xspeed > 0) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) and (_root.game.messageList.length == 0)) {
if ((_root.game.tdMode == false) || ((_root.game.tdMode != false) and (_parent.passesNum > 0))) {
progressTimer = progressTimer + 1;
if ((forwardProgress == 0) || (forwardProgress > (_x + fixedLineX))) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
forwardProgress = _x + fixedLineX;
}
if (progressTimer > 50) {
turnedPause();
progressTimer = 0;
}
} else {
progressTimer = 0;
}
}
}
if ((((team == 1) and (_root.game.gameMode == "plays")) and (team != _root.game.playersTeam)) || (((team == 1) and (_root.game.gameMode == "plays")) and (_root.game.demoMode == true))) {
heldTime = heldTime + 1;
var playerAmount = 12;
i = 1;
while (i < playerAmount) {
var target = _root.game["player" + i];
var randFactor = random(3);
if (((((((((target._x > (_x + 40)) and (_parent.passesNum == 0)) and (heldTime > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed > (1.5 * _root.game.vibrationVal))) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || ((((_parent.nzone.hitTest(target.xpos, target.ypos, true) and (target._x > _x)) and (_parent.passesNum == 0)) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing"))) || ((((((((target._x > (_x + 40)) and (_parent.passesNum == 0)) and (heldTime > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed > 1.5)) and (_root.game.downs > 0)) and (_root.game.playType == "passing")) and (_root.game.demoMode == true))) {
_parent.passesNum = _parent.passesNum + 1;
_parent.ball.target = "";
_parent.ball.targetX = _root.game["player" + i]._x + (_root.game["player" + i].xspeed * (8 + random(15)));
_parent.ball.targetY = (_root.game["player" + i]._y - 10) + (_root.game["player" + i].yspeed * (8 + random(15)));
var dx = (_parent.ball.targetX - _parent.ball._x);
var dy = (_parent.ball.targetY - _parent.ball._y);
var dist = Math.sqrt((dx * dx) + (dy * dy));
_parent.ball.xspeed = dx / (dist / 10);
_parent.ball.yspeed = dy / (dist / 10);
_parent.ball.zspeed = -(dist / 20);
_parent.ball.zpos = 4;
}
i = i + 1;
}
} else {
heldTime = 0;
}
if ((((team == 2) and (_root.game.gameMode == "plays")) and (team != _root.game.playersTeam)) || (((team == 2) and (_root.game.gameMode == "plays")) and (_root.game.demoMode == true))) {
heldTime2 = heldTime2 + 1;
var playerAmount = 23;
i = 12;
while (i < playerAmount) {
var target = _root.game["player" + i];
var randFactor = random(3);
if ((((((((target._x < (_x - 40)) and (_parent.passesNum == 0)) and (heldTime2 > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed < (-1.5 * _root.game.vibrationVal))) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || ((((_parent.nzone.hitTest(target.xpos, target.ypos, true) and (target._x < _x)) and (_parent.passesNum == 0)) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing"))) {
_parent.passesNum = _parent.passesNum + 1;
_parent.ball.target = "";
_parent.ball.targetX = _root.game["player" + i]._x + (_root.game["player" + i].xspeed * (8 + random(15)));
_parent.ball.targetY = (_root.game["player" + i]._y - 10) + (_root.game["player" + i].yspeed * (8 + random(15)));
var dx = (_parent.ball.targetX - _parent.ball._x);
var dy = (_parent.ball.targetY - _parent.ball._y);
var dist = Math.sqrt((dx * dx) + (dy * dy));
_parent.ball.xspeed = dx / (dist / 10);
_parent.ball.yspeed = dy / (dist / 10);
_parent.ball.zspeed = -(dist / 20);
_parent.ball.zpos = 4;
}
i = i + 1;
}
} else {
heldTime2 = 0;
}
if (arrowPlayed == false) {
arrow.play();
var arrowPlayed = true;
}
}
if ((_root.game.gameMode == "plays") and (_parent.ball.target == "")) {
if ((((((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player22")) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player11"))) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player4"))) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player16"))) {
} else {
var catchRad = (rad * 2.5);
var zcatch = 4;
}
if (_root.game.ball.target == "") {
if ((_root.game.ball._x < (_x + 50)) and (_root.game.ball._x > (_x - 50))) {
if ((((_root.game.lastGameMode == "kickOff") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player22")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "kickOff") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player11")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "punt") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player15")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "punt") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player4")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "puntSafety") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player15")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "puntSafety") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player4")) {
_root.game.ball.target = this;
}
}
if ((_root.game.ball._x < (_x + 20)) and (_root.game.ball._x > (_x - 20))) {
var dx = (_parent.ball._x - _x);
var dy = (_parent.ball._y - (_y - 10));
var dist = Math.sqrt((dx * dx) + (dy * dy));
if (((dist < catchRad) and (_parent.ball.zpos < zcatch)) and (_root.game.ball.bounce < 1)) {
if ((_parent.ball.storedOwner.team != team) and (_parent.ball.storedOwner.team > 0)) {
if (_root.game.tdMode != false) {
tacklePause();
} else {
_parent.scoreboard.bigscreen.ani.gotoAndPlay("intercept");
_root.game.downs = 0;
intercepted = true;
_root.game.intercepted = true;
}
}
_parent.ball.target = this;
arrow.play();
}
var dx = ((_parent.ball._x + _root.game.ball.xspeed) - _x);
var dy = ((_parent.ball._y + _root.game.ball.yspeed) - (_y - 10));
var dist = Math.sqrt((dx * dx) + (dy * dy));
if (((dist < catchRad) and (_parent.ball.zpos < zcatch)) and (_root.game.ball.bounce < 1)) {
if ((_parent.ball.storedOwner.team != team) and (_parent.ball.storedOwner.team > 0)) {
if (_root.game.tdMode != false) {
tacklePause();
} else {
_parent.scoreboard.bigscreen.ani.gotoAndPlay("intercept");
_root.game.downs = 0;
intercepted = true;
_root.game.intercepted = true;
}
}
_parent.ball.target = this;
arrow.play();
}
}
}
}
xpos = _x + _root.game._x;
ypos = _y + _root.game._y;
speed = 0.12 * _root.game.vibrationVal;
currentY = _y - _root.game.pitchBackY;
posY = currentY / _root.game.pitchFrontY;
percent = _root.game.pitchDepth / _root.game.horizon;
depthScale = (1 - percent) + (posY * percent);
if (intercepted == true) {
speedDone = false;
intercepted = false;
}
if ((_root.game.vibrate == true) and (_root.game.paused == false)) {
rotTimer = 1 + random(20 * _root.game.vibrationVal);
if (rotTimer == 1) {
rotInc = (-30 + random(60)) / 140;
}
rotVel = rotVel + rotInc;
if (((_root.game.gameMode == "plays") and (speedDone == false)) || (_root.game.mouseIsDown == true)) {
if (_root.game.lastGameMode != "kickOff") {
speedDone = true;
if (_root.game.ball.target != this) {
if (((_root.game.playType == "running") and (team == _root.game.playersTeam)) || ((_root.game.compPlayType == "running") and (team == _root.game.compTeam))) {
if ((((((((((_name == "player22") || (_name == "player18")) || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) || (_name == "player11")) || (_name == "player7")) || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
var xspeedEq = (speed * 1.5);
var yspeedEq = (speed * 1.5);
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else if (((_root.game.playType == "defense") and (team == _root.game.playersTeam)) || ((_root.game.compPlayType == "defense") and (team == _root.game.compTeam))) {
if ((_root.downs >= 1) and (_root.game.blitz == false)) {
if ((((_name == "player8") || (_name == "player9")) || (_name == "player19")) || (_name == "player20")) {
var xspeedEq = (-(speed / 3));
var yspeedEq = (-(speed / 3));
} else if ((((_name == "player10") || (_name == "player11")) || (_name == "player21")) || (_name == "player22")) {
var xspeedEq = (-(speed / 5));
var yspeedEq = (-(speed / 5));
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else if (((((_root.game.passesNum == 0) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || (((_root.game.passesNum == 0) and (_root.game.downs > 0)) and (_root.game.playType == "passing"))) || (((_root.game.passesNum == 0) and (_root.game.tdMode != false)) and (_root.game.playType == "passing"))) {
var xspeedEq = (-(speed / 6));
var yspeedEq = (-(speed / 6));
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
}
}
if ((_root.game.gameMode != "plays") || (_root.game.paused == true)) {
speedDone = false;
}
if (((_root.game.gameMode == "plays") || (_root.game.gameMode == "celebration")) || (_root.game.gameMode == "shot")) {
xspeed = xspeed + (Math.cos((rot - 180) * (Math.PI/180)) * xspeedEq);
yspeed = yspeed + (Math.sin((rot - 180) * (Math.PI/180)) * yspeedEq);
}
if (collisionTimer < 1) {
collisionTimer = collisionTimer + 1;
} else {
collisionTimer = 0;
}
if (((_root.game.vibrate == true) and (_root.game.paused == false)) || (_root.game.mouseIsDown == true)) {
if ((collisionTimer == 0) and (team == 1)) {
i = 0;
while (i < (_root.game.playerNum + 1)) {
var target = _root.game["player" + i];
if (_name != ("player" + i)) {
checkCollision(this, target);
}
i = i + 1;
}
checkWalls();
}
if ((collisionTimer == 1) and (team == 2)) {
i = 12;
while (i < (_root.game.playerNum + 1)) {
var target = _root.game["player" + i];
if (_name != ("player" + i)) {
checkCollision(this, target);
}
i = i + 1;
}
checkWalls();
}
}
if (_root.game.gameMode == "puntSafety") {
checkWalls();
}
xspeed = xspeed * 0.97;
yspeed = yspeed * 0.97;
rotVel = rotVel * 0.97;
this.swapDepths(_y + (_x / 5));
if ((_name == "player22") and (_root.game.playType == "running")) {
} else {
var aniFrames = ani._totalframes;
rotStored = rotStored + rotVel;
if (rotStored > (360 / aniFrames)) {
if (ani._currentframe < aniFrames) {
ani.nextFrame();
} else {
ani.gotoAndStop(1);
}
rotStored = rotStored - (360 / aniFrames);
}
if (rotStored < (-(360 / aniFrames))) {
if (ani._currentframe > 1) {
ani.prevFrame();
} else {
ani.gotoAndStop(aniFrames);
}
rotStored = rotStored + (360 / aniFrames);
}
rot = rot + rotVel;
_xscale = (depthScale * 110);
_yscale = _xscale;
}
if (((_root.game.gameMode == "plays") || (_root.game.gameMode == "celebration")) || (_root.game.gameMode == "shot")) {
_x = (_x + (xspeed * depthScale));
_y = (_y + (yspeed * depthScale));
}
}
}
Instance of Symbol 198 MovieClip "player16" in Symbol 494 MovieClip Frame 2
onClipEvent (load) {
hitSound = new Sound(this);
hitSound.attachSound("hitSound");
xspeed = 0;
yspeed = 0;
speed = 0.1 * _root.game.vibrationVal;
currentY = _y - _root.game.pitchBackY;
posY = currentY / _root.game.pitchFrontY;
percent = _root.game.pitchDepth / _root.game.horizon;
depthScale = (1 - percent) + (posY * percent);
rotVel = 0;
rotInc = 0;
rotTimer = random(20);
_rotation = 0;
xpos = _x + _root.game._x;
ypos = _y + _root.game._y;
_root.game.playerNum = _root.game.playerNum + 1;
mass = 2;
rad = hitArea._width / 2.3;
team = 0;
if (parseInt(substring(_name, 7, 2)) < 12) {
team = 1;
rot = 180;
origRot = rot;
if ((_name == "player22") || (_name == "player11")) {
gotoAndStop (4);
} else {
gotoAndStop (2);
}
ani.gotoAndStop(10);
} else {
team = 2;
rot = 0;
origRot = rot;
if ((_name == "player22") || (_name == "player11")) {
gotoAndStop (3);
} else {
gotoAndStop (1);
}
ani.gotoAndStop(1);
}
if (team == 2) {
trace(((("new Array(" + Math.round(_x)) + ",") + Math.round(_y)) + "),");
}
rotStored = 0;
heldTime = 0;
heldTime2 = 0;
tackled = false;
forwardProgress = 0;
progressTimer = 0;
type = "";
fixedLineX = 0;
speedDone = false;
var xspeedEq = speed;
var yspeedEq = speed;
storedVar = "";
collisionTimer = 0;
intercepted = false;
}
onClipEvent (enterFrame) {
function checkOutOfBounds() {
if (_root.game.ball.target == this) {
boundsPause();
if ((ani._currentframe < 6) || (ani._currentframe > 14)) {
if (team == 1) {
}
} else if ((ani._currentframe > 6) and (ani._currentframe < 14)) {
if (team == 2) {
}
}
}
}
function checkScrimmage() {
if (team == 1) {
if (_root.game.scrimmage < _root.game.endZoneL) {
_root.game.scrimmage = _root.game.twentyYardLineL;
_root.game.touchBack = true;
} else {
_root.game.touchBack = false;
}
if (_root.game.scrimmage > _root.game.endZoneR) {
_root.game.scrimmage = _root.game.endZoneR;
}
} else {
if (_root.game.scrimmage < _root.game.endZoneL) {
_root.game.scrimmage = _root.game.endZoneL;
}
if (_root.game.scrimmage > _root.game.endZoneR) {
_root.game.scrimmage = _root.game.twentyYardLineR;
_root.game.touchBack = true;
} else {
_root.game.touchBack = false;
}
}
}
function tacklePause() {
type = "tackle";
if ((_root.game.timeOut == true) and (_root.game.tdMode == false)) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
_root.game.scrimmage = _x + fixedLineX;
checkScrimmage();
}
if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "tackle";
_root.game.safed = true;
} else if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "tackle";
_root.game.safed = true;
} else {
type = "tackle";
}
if ((_root.game.paused == false) and (_root.game.gameMode != "celebration")) {
_root.game.sound.gotoAndPlay("whistle");
}
if (((((_root.game.gameMode == "plays") and (_root.game.paused == false)) || ((_root.game.gameMode == "kickOff") and (_root.game.paused == false))) || ((_root.game.gameMode == "punt") and (_root.game.paused == false))) || (((_root.game.tdMode != false) and (_root.game.paused == false)) and (_root.game.gameMode == "plays"))) {
tackled = true;
type = "tackle";
if ((_root.game.passesNum == 0) and (_root.game.gameMode != "celebration")) {
if (_parent.ball.target.team == 1) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
if (((_x + fixedLineX) < _root.game.scrimmage) and (_root.game.downs > 0)) {
_parent.addMessage("sack");
} else {
_parent.addMessage("tackled");
}
}
if (_parent.ball.target.team == 2) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
if (((_x + fixedLineX) > _root.game.scrimmage) and (_root.game.downs > 0)) {
_parent.addMessage("sack");
} else {
_parent.addMessage("tackled");
}
}
} else if (_root.game.gameMode != "celebration") {
_parent.addMessage("tackled");
}
_root.game.pauseTime = 55;
}
}
function boundsPause() {
if (_root.game.timeOut == true) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
_root.game.scrimmage = _x + fixedLineX;
checkScrimmage();
}
if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "bounds";
_root.game.safed = true;
} else if ((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (_root.game.downs > 0)) and (_root.game.ball.target == this)) {
type = "bounds";
_root.game.safed = true;
} else {
type = "bounds";
}
type = "bounds";
_root.game.sound.gotoAndPlay("whistle");
tackled = true;
_parent.addMessage("outOfBounds");
_root.game.pauseTime = 55;
}
function turnedPause() {
if (_root.game.timeOut == true) {
_root.game.scrimmage = forwardProgress;
checkScrimmage();
}
type = "turn";
_root.game.sound.gotoAndPlay("whistle");
tackled = true;
_parent.addMessage("turnedAround");
_parent.addMessage("negativeProgress");
_root.game.pauseTime = 55;
}
function tackle() {
if ((_root.game.gameMode != "puntSafety") and (gameMode != "scrum")) {
if (_root.game.tdMode != false) {
if ((_root.game.timeOut == false) and (_root.game.gameMode != "celebration")) {
_root.game.startKickoff(_root.game.playersTeam);
_root.game.removeTackles();
tacked = false;
_root.game.tdMode = false;
} else if (_root.game.gameMode != "celebration") {
_root.game.removeTackles();
tacked = false;
_root.game.tdMode = false;
_root.game.gameMode = "convFail";
trace(_root.game.gameMode);
} else {
_root.game.removeTackles();
tacked = false;
}
} else if ((_root.game.downs <= 3.5) || (_root.game.goForIt == true)) {
if ((((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 1)) and (_x < 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (type != "turn")) and (_root.game.downs > 0.5)) and (_root.game.ball.target == this)) and (_root.game.gameMode != "celebration")) {
_root.game.addMessage("Safety");
if (team != _root.game.playersTeam) {
_root.game.setupSafetyKick(_root.game.compTeam);
_root.game.hscore = _root.game.hscore + 2;
} else {
_root.game.setupSafetyKick(_root.game.playersTeam);
_root.game.gscore = _root.game.gscore + 2;
}
tackled = false;
} else if ((((((((_root.game.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (team == 2)) and (_x > 300)) and (_root.game.gameMode != "fieldGoal")) and (_root.game.gameMode != "punt")) and (type != "turn")) and (_root.game.downs > 0.5)) and (_root.game.ball.target == this)) and (_root.game.gameMode != "celebration")) {
_root.game.addMessage("Safety");
if (team != _root.game.playersTeam) {
_root.game.setupSafetyKick(_root.game.compTeam);
_root.game.hscore = _root.game.hscore + 2;
} else {
_root.game.setupSafetyKick(_root.game.playersTeam);
_root.game.gscore = _root.game.gscore + 2;
}
tackled = false;
} else {
_root.game.changeMode = false;
tackled = false;
if (type == "turn") {
var _local4 = forwardProgress;
} else {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
var _local4 = _x + fixedLineX;
}
_root.game.scrimmage = _local4;
if (_parent.ball.target.team != _root.game.playersTeam) {
var _local5 = random(2);
if (_local5 == 1) {
_root.game.compPlayType = "passing";
_root.game.setupLine(_root.game.compTeam, _root.game.formationShotgun, _local4, 0.5);
} else {
_root.game.compPlayType = "running";
_root.game.setupLine(_root.game.compTeam, _root.game.formationI, _local4, 0.5);
}
_root.game.setupLine(_root.game.playersTeam, _root.game.formation43, _local4, 0.5);
} else {
var _local5 = 1 + random(5);
_root.game.compPlayType = "defense";
_root.game.setupLine(_root.game.compTeam, _root.game["formationDefence" + _local5], _local4, 0.5);
_root.game.setupLine(_root.game.playersTeam, _root.game.formationShotgun, _local4, 0.5);
}
}
} else if ((_root.game.goForIt == true) and (_root.game.gameMode == "plays")) {
if (_root.game.changeMode == false) {
_root.game.downs = _root.game.downs + 1;
}
_root.game.pauseTime = 0;
_root.game.paused = false;
tackled = false;
} else if (_root.game.gameMode == "plays") {
_root.game.pauseTime = 0;
_root.game.paused = false;
if (_root.game.changeMode == false) {
_root.game.downs = _root.game.downs + 1;
}
tackled = false;
}
}
}
function checkWalls() {
if ((_y + 10) > _root.game.pitchFrontY) {
if (((yspeed > 1) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) {
checkOutOfBounds();
}
_y = (_y - 1);
yspeed = (-yspeed) * 0.5;
}
if ((_y - 5) < _root.game.pitchBackY) {
if (((yspeed < 1) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) {
checkOutOfBounds();
}
_y = (_y + 1);
yspeed = (-yspeed) * 0.5;
}
if (_root.game.walls.hitTest(xpos + (hitArea._width / 2), ypos, true) and (_x > 300)) {
_x = (_x - 2);
xspeed = (-xspeed) * 0.5;
}
if (_root.game.walls.hitTest(xpos - (hitArea._width / 2), ypos, true) and (_x < 300)) {
_x = (_x + 2);
xspeed = (-xspeed) * 0.5;
}
}
function checkCollision(b1, b2) {
var _local12 = b2._x - b1._x;
var _local11 = b2._y - b1._y;
var _local19 = Math.sqrt((_local12 * _local12) + (_local11 * _local11));
if (_local19 < (b1.rad + b2.rad)) {
if (((_parent.ball.target == this) and (b2.team != this.team)) || ((_parent.ball.target == b2) and (this.team != b2.team))) {
tacklePause();
}
if (_root.game.gameMode == "plays") {
var _local8 = 0;
if (xspeed < 0) {
_local8 = _local8 + (-xspeed);
} else {
_local8 = _local8 + xspeed;
}
if (yspeed < 0) {
_local8 = _local8 + (-yspeed);
} else {
_local8 = _local8 + yspeed;
}
if (_local8 > 1) {
hitSound.setVolume(_local8 * 15);
hitSound.start(0, 0);
hitSound.setVolume(_local8 * 15);
}
}
var _local18 = Math.atan2(_local11, _local12);
var _local7 = Math.cos(_local18);
var _local6 = Math.sin(_local18);
var _local9 = (_local7 * b1.xspeed) + (_local6 * b1.yspeed);
var _local15 = (_local7 * b1.yspeed) - (_local6 * b1.xspeed);
var _local10 = (_local7 * b2.xspeed) + (_local6 * b2.yspeed);
var _local14 = (_local7 * b2.yspeed) - (_local6 * b2.xspeed);
var _local21 = (_local9 * b1.mass) + (_local10 * b2.mass);
var _local20 = _local9 - _local10;
_local9 = (_local21 - (b2.mass * _local20)) / (b1.mass + b2.mass);
_local10 = _local20 + _local9;
b1.xspeed = ((_local7 * _local9) - (_local6 * _local15)) * 0.7;
b1.yspeed = ((_local7 * _local15) + (_local6 * _local9)) * 0.7;
b2.xspeed = ((_local7 * _local10) - (_local6 * _local14)) * 0.7;
b2.yspeed = ((_local7 * _local14) + (_local6 * _local10)) * 0.7;
var _local16 = ((b1.rad + b2.rad) - _local19) / 2;
var _local17 = _local7 * _local16;
var _local13 = _local6 * _local16;
b1._x = b1._x - (_local17 * 1.1);
b1._y = b1._y - (_local13 * 1.1);
b2._x = b2._x + (_local17 * 1.1);
b2._y = b2._y + (_local13 * 1.1);
}
}
if (_root.game.gameMode == "kickOff") {
var xspeedEq = speed;
var yspeedEq = speed;
}
if (_root.game.cleanUp == true) {
this.removeMovieClip();
}
if ((_root.game.gameMode == "scrum") || (_root.game.gameMode == "kickOff")) {
forwardProgress = 0;
progressTimer = 0;
}
if (team == _root.game.playersTeam) {
if (_root.game.playType == "running") {
if (_root.game.playersTeam == 1) {
if ((((_name == "player7") || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else if ((((_name == "player18") || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else {
mass = 2;
}
}
if (team == _root.game.compTeam) {
if (_root.game.compPlayType == "running") {
if (_root.game.compTeam == 1) {
if ((((_name == "player7") || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else if ((((_name == "player18") || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) {
mass = 50;
_root.game.passesNum = 1;
} else {
mass = 2;
}
} else {
mass = 2;
}
}
if ((((((_name == "player22") and (parseInt(_root.game.ball.storedOwner.team) == 2)) and (_root.game.gameMode != "plays")) and (_root.game.gameMode != "celebration")) and (_root.game.paused == false)) || (((((_name == "player11") and (parseInt(_root.game.ball.storedOwner.team) == 1)) and (_root.game.gameMode != "plays")) and (_root.game.gameMode != "celebration")) and (_root.game.paused == false))) {
if (_currentframe == 1) {
gotoAndStop (3);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(10);
}
} else if (_currentframe == 2) {
gotoAndStop (4);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(10);
}
}
} else if (((((_name == "player22") and (_root.game.gameMode != "plays")) and (_root.game.paused == false)) and (_root.game.gameMode != "celebration")) and (_root.game.gameMode != "shot")) {
gotoAndStop(_root.game.player21._currentframe);
} else if (((((_name == "player11") and (_root.game.gameMode != "plays")) and (_root.game.paused == false)) and (_root.game.gameMode != "celebration")) and (_root.game.gameMode != "shot")) {
gotoAndStop(_root.game.player10._currentframe);
if (((team == 1) and (xspeed == 0)) and (yspeed == 0)) {
ani.gotoAndStop(_root.game.player10.ani._currentframe);
}
}
if ((tackled == true) and (_root.game.paused == false)) {
tackle();
}
if (_root.game.paused == false) {
if (_parent.ball.target != this) {
arrow.gotoAndStop(1);
var arrowPlayed = false;
heldTime = 0;
} else {
if ((_parent.passesNum == 1) || (_root.game.downs == 0)) {
if (team == 1) {
if ((((xspeed < 0) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) and (_root.game.messageList.length == 0)) {
if ((_root.game.tdMode == false) || ((_root.game.tdMode != false) and (_parent.passesNum > 0))) {
progressTimer = progressTimer + 1;
if ((forwardProgress == 0) || (forwardProgress < (_x + fixedLineX))) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
forwardProgress = _x + fixedLineX;
}
if (progressTimer > 50) {
turnedPause();
progressTimer = 0;
}
} else {
progressTimer = 0;
}
}
} else if ((((xspeed > 0) and (_root.game.gameMode == "plays")) and (_root.game.paused == false)) and (_root.game.messageList.length == 0)) {
if ((_root.game.tdMode == false) || ((_root.game.tdMode != false) and (_parent.passesNum > 0))) {
progressTimer = progressTimer + 1;
if ((forwardProgress == 0) || (forwardProgress > (_x + fixedLineX))) {
fixedLineX = -(((_y - 194) * (_x - _root.game.halfPitchX)) / 450);
forwardProgress = _x + fixedLineX;
}
if (progressTimer > 50) {
turnedPause();
progressTimer = 0;
}
} else {
progressTimer = 0;
}
}
}
if ((((team == 1) and (_root.game.gameMode == "plays")) and (team != _root.game.playersTeam)) || (((team == 1) and (_root.game.gameMode == "plays")) and (_root.game.demoMode == true))) {
heldTime = heldTime + 1;
var playerAmount = 12;
i = 1;
while (i < playerAmount) {
var target = _root.game["player" + i];
var randFactor = random(3);
if (((((((((target._x > (_x + 40)) and (_parent.passesNum == 0)) and (heldTime > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed > (1.5 * _root.game.vibrationVal))) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || ((((_parent.nzone.hitTest(target.xpos, target.ypos, true) and (target._x > _x)) and (_parent.passesNum == 0)) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing"))) || ((((((((target._x > (_x + 40)) and (_parent.passesNum == 0)) and (heldTime > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed > 1.5)) and (_root.game.downs > 0)) and (_root.game.playType == "passing")) and (_root.game.demoMode == true))) {
_parent.passesNum = _parent.passesNum + 1;
_parent.ball.target = "";
_parent.ball.targetX = _root.game["player" + i]._x + (_root.game["player" + i].xspeed * (8 + random(15)));
_parent.ball.targetY = (_root.game["player" + i]._y - 10) + (_root.game["player" + i].yspeed * (8 + random(15)));
var dx = (_parent.ball.targetX - _parent.ball._x);
var dy = (_parent.ball.targetY - _parent.ball._y);
var dist = Math.sqrt((dx * dx) + (dy * dy));
_parent.ball.xspeed = dx / (dist / 10);
_parent.ball.yspeed = dy / (dist / 10);
_parent.ball.zspeed = -(dist / 20);
_parent.ball.zpos = 4;
}
i = i + 1;
}
} else {
heldTime = 0;
}
if ((((team == 2) and (_root.game.gameMode == "plays")) and (team != _root.game.playersTeam)) || (((team == 2) and (_root.game.gameMode == "plays")) and (_root.game.demoMode == true))) {
heldTime2 = heldTime2 + 1;
var playerAmount = 23;
i = 12;
while (i < playerAmount) {
var target = _root.game["player" + i];
var randFactor = random(3);
if ((((((((target._x < (_x - 40)) and (_parent.passesNum == 0)) and (heldTime2 > 35)) and (randFactor == 1)) and (_root.game["player" + i].xspeed < (-1.5 * _root.game.vibrationVal))) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || ((((_parent.nzone.hitTest(target.xpos, target.ypos, true) and (target._x < _x)) and (_parent.passesNum == 0)) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing"))) {
_parent.passesNum = _parent.passesNum + 1;
_parent.ball.target = "";
_parent.ball.targetX = _root.game["player" + i]._x + (_root.game["player" + i].xspeed * (8 + random(15)));
_parent.ball.targetY = (_root.game["player" + i]._y - 10) + (_root.game["player" + i].yspeed * (8 + random(15)));
var dx = (_parent.ball.targetX - _parent.ball._x);
var dy = (_parent.ball.targetY - _parent.ball._y);
var dist = Math.sqrt((dx * dx) + (dy * dy));
_parent.ball.xspeed = dx / (dist / 10);
_parent.ball.yspeed = dy / (dist / 10);
_parent.ball.zspeed = -(dist / 20);
_parent.ball.zpos = 4;
}
i = i + 1;
}
} else {
heldTime2 = 0;
}
if (arrowPlayed == false) {
arrow.play();
var arrowPlayed = true;
}
}
if ((_root.game.gameMode == "plays") and (_parent.ball.target == "")) {
if ((((((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player22")) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player11"))) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player4"))) || (((_root.game.downs == 0) and (_root.game.passesNum == 0)) and (_name == "player16"))) {
} else {
var catchRad = (rad * 2.5);
var zcatch = 4;
}
if (_root.game.ball.target == "") {
if ((_root.game.ball._x < (_x + 50)) and (_root.game.ball._x > (_x - 50))) {
if ((((_root.game.lastGameMode == "kickOff") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player22")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "kickOff") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player11")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "punt") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player15")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "punt") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player4")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "puntSafety") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 1)) and (_name == "player15")) {
_root.game.ball.target = this;
}
if ((((_root.game.lastGameMode == "puntSafety") and (_root.game.ball.zpos < 4)) and (_root.game.lastTeam == 2)) and (_name == "player4")) {
_root.game.ball.target = this;
}
}
if ((_root.game.ball._x < (_x + 20)) and (_root.game.ball._x > (_x - 20))) {
var dx = (_parent.ball._x - _x);
var dy = (_parent.ball._y - (_y - 10));
var dist = Math.sqrt((dx * dx) + (dy * dy));
if (((dist < catchRad) and (_parent.ball.zpos < zcatch)) and (_root.game.ball.bounce < 1)) {
if ((_parent.ball.storedOwner.team != team) and (_parent.ball.storedOwner.team > 0)) {
if (_root.game.tdMode != false) {
tacklePause();
} else {
_parent.scoreboard.bigscreen.ani.gotoAndPlay("intercept");
_root.game.downs = 0;
intercepted = true;
_root.game.intercepted = true;
}
}
_parent.ball.target = this;
arrow.play();
}
var dx = ((_parent.ball._x + _root.game.ball.xspeed) - _x);
var dy = ((_parent.ball._y + _root.game.ball.yspeed) - (_y - 10));
var dist = Math.sqrt((dx * dx) + (dy * dy));
if (((dist < catchRad) and (_parent.ball.zpos < zcatch)) and (_root.game.ball.bounce < 1)) {
if ((_parent.ball.storedOwner.team != team) and (_parent.ball.storedOwner.team > 0)) {
if (_root.game.tdMode != false) {
tacklePause();
} else {
_parent.scoreboard.bigscreen.ani.gotoAndPlay("intercept");
_root.game.downs = 0;
intercepted = true;
_root.game.intercepted = true;
}
}
_parent.ball.target = this;
arrow.play();
}
}
}
}
xpos = _x + _root.game._x;
ypos = _y + _root.game._y;
speed = 0.12 * _root.game.vibrationVal;
currentY = _y - _root.game.pitchBackY;
posY = currentY / _root.game.pitchFrontY;
percent = _root.game.pitchDepth / _root.game.horizon;
depthScale = (1 - percent) + (posY * percent);
if (intercepted == true) {
speedDone = false;
intercepted = false;
}
if ((_root.game.vibrate == true) and (_root.game.paused == false)) {
rotTimer = 1 + random(20 * _root.game.vibrationVal);
if (rotTimer == 1) {
rotInc = (-30 + random(60)) / 140;
}
rotVel = rotVel + rotInc;
if (((_root.game.gameMode == "plays") and (speedDone == false)) || (_root.game.mouseIsDown == true)) {
if (_root.game.lastGameMode != "kickOff") {
speedDone = true;
if (_root.game.ball.target != this) {
if (((_root.game.playType == "running") and (team == _root.game.playersTeam)) || ((_root.game.compPlayType == "running") and (team == _root.game.compTeam))) {
if ((((((((((_name == "player22") || (_name == "player18")) || (_name == "player16")) || (_name == "player15")) || (_name == "player14")) || (_name == "player11")) || (_name == "player7")) || (_name == "player5")) || (_name == "player4")) || (_name == "player3")) {
var xspeedEq = (speed * 1.5);
var yspeedEq = (speed * 1.5);
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else if (((_root.game.playType == "defense") and (team == _root.game.playersTeam)) || ((_root.game.compPlayType == "defense") and (team == _root.game.compTeam))) {
if ((_root.downs >= 1) and (_root.game.blitz == false)) {
if ((((_name == "player8") || (_name == "player9")) || (_name == "player19")) || (_name == "player20")) {
var xspeedEq = (-(speed / 3));
var yspeedEq = (-(speed / 3));
} else if ((((_name == "player10") || (_name == "player11")) || (_name == "player21")) || (_name == "player22")) {
var xspeedEq = (-(speed / 5));
var yspeedEq = (-(speed / 5));
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else if (((((_root.game.passesNum == 0) and (_root.game.downs > 0)) and (_root.game.compPlayType == "passing")) || (((_root.game.passesNum == 0) and (_root.game.downs > 0)) and (_root.game.playType == "passing"))) || (((_root.game.passesNum == 0) and (_root.game.tdMode != false)) and (_root.game.playType == "passing"))) {
var xspeedEq = (-(speed / 6));
var yspeedEq = (-(speed / 6));
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
} else {
var xspeedEq = speed;
var yspeedEq = speed;
}
}
}
if ((_root.game.gameMode != "plays") || (_root.game.paused == true)) {
speedDone = false;
}
if (((_root.game.gameMode == "plays") || (_root.game.gameMode == "celebration")) || (_root.game.gameMode == "shot")) {
xspeed = xspeed + (Math.cos((rot - 180) * (Math.PI/180)) * xspeedEq);
yspeed = yspeed + (Math.sin((rot - 180) * (Math.PI/180)) * yspeedEq);
}
if (collisionTimer < 1) {
collisionTimer = collisionTimer + 1;
} else {
collisionTimer = 0;
}
if (((_root.game.vibrate == true) and (_root.game.paused == false)) || (_root.game.mouseIsDown == true)) {
if ((collisionTimer == 0) and (team == 1)) {
i = 0;
while (i < (_root.game.playerNum + 1)) {
var target = _root.game["player" + i];
if (_name != ("player" + i)) {
checkCollision(this, target);
}
i = i + 1;
}
checkWalls();
}
if ((collisionTimer == 1) and (team == 2)) {
i = 12;
while (i < (_root.game.playerNum + 1)) {
var target = _root.game["player" + i];
if (_name != ("player" + i)) {
checkCollision(this, target);
}
i = i + 1;
}
checkWalls();
}
}
if (_root.game.gameMode == "puntSafety") {
checkWalls();
}
xspeed = xspeed * 0.97;
yspeed = yspeed * 0.97;
rotVel = rotVel * 0.97;
this.swapDepths(_y + (_x / 5));
if ((_name == "player22") and (_root.game.playType == "running")) {
} else {
var aniFrames = ani._totalframes;
rotStored = rotStored + rotVel;
if (rotStored > (360 / aniFrames)) {
if (ani._currentframe < aniFrames) {
ani.nextFrame();
} else {
ani.gotoAndStop(1);
}
rotStored = rotStored - (360 / aniFrames);
}
if (rotStored < (-(360 / aniFrames))) {
if (ani._currentframe > 1) {
ani.prevFrame();
} else {
ani.gotoAndStop(aniFrames);
}
rotStored = rotStored + (360 / aniFrames);
}
rot = rot + rotVel;
_xscale = (depthScale * 110);
_yscale = _xscale;
}
if (((_root.game.gameMode == "plays") || (_root.game.gameMode == "celebration")) || (_root.game.gameMode == "shot")) {
_x = (_x + (xspeed * depthScale));
_y = (_y + (yspeed * depthScale));
}
}
}
Instance of Symbol 229 MovieClip "powerBar" in Symbol 494 MovieClip Frame 2
onClipEvent (load) {
playerControlled = false;
var target;
timer = 0;
madeFalse = false;
}
onClipEvent (enterFrame) {
function kickBall() {
_root.game.makeKick = false;
_root.game.downs = 0;
timer = 0;
_root.game.vibrate = true;
if ((_root.game.gameMode == "punt") || (_root.game.gameMode == "puntSafety")) {
_parent.ball.targetX = puntX;
_parent.ball.targetY = puntY;
} else if (_root.game.gameMode == "fieldGoal") {
if (_root.game.ball.target.team != _root.game.playersTeam) {
var _local6 = random(490 - _x);
if (_local6 < 140) {
_parent.ball.targetX = hitX;
_parent.ball.targetY = hitY;
} else {
_parent.ball.targetX = missX;
_parent.ball.targetY = missY;
}
} else if (((_currentframe > 5) and (_currentframe < 11)) || ((_currentframe > 20) and (_currentframe < 27))) {
_parent.ball.targetX = hitX;
_parent.ball.targetY = hitY;
} else {
_parent.ball.targetX = missX;
_parent.ball.targetY = missY;
}
} else {
_parent.ball.targetX = kickOffX;
_parent.ball.targetY = kickOffY;
}
if (((_root.game.gameMode == "kickOff") || (_root.game.gameMode == "punt")) || (_root.game.gameMode == "puntSafety")) {
_root.game.gameMode = "plays";
_root.game.passesNum = 0;
} else if (_root.game.gameMode == "fieldGoal") {
_root.game.gameMode = "shot";
}
var _local4 = _parent.ball.targetX - _parent.ball._x;
var _local3 = _parent.ball.targetY - _parent.ball._y;
var _local5 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
_parent.ball.xspeed = _local4 / (_local5 / 10);
_parent.ball.yspeed = _local3 / (_local5 / 10);
_parent.ball.zspeed = -(_local5 / 20);
_parent.ball.zpos = 4;
_parent.ball.target = "";
_parent.ball.lastPlayer = _root.game.player12;
_parent.ball.storedOwner = _root.game.player12;
madeFalse = false;
}
function kickBall2() {
_root.game.downs = 0;
timer = 0;
_root.game.vibrate = true;
if ((_root.game.gameMode == "punt") || (_root.game.gameMode == "puntSafety")) {
_parent.ball.targetX = _root.game.player4._x + ((_x - _root.game.player4._x) / 6);
_parent.ball.targetY = _root.game.player4._y - 10;
} else if (_root.game.gameMode == "fieldGoal") {
var _local6 = random(_x);
if (_root.game.ball.target.team != _root.game.playersTeam) {
_local6 = random(490 - _x);
if (_local6 < 140) {
_parent.ball.targetX = (_x - 220) - (_currentframe * 2);
_parent.ball.targetY = _y;
} else {
_parent.ball.targetX = (_x - 70) - (_currentframe * 2);
_parent.ball.targetY = _y;
}
} else if (((_currentframe > 5) and (_currentframe < 11)) || ((_currentframe > 20) and (_currentframe < 27))) {
_parent.ball.targetX = (_x - 220) - (_currentframe * 2);
_parent.ball.targetY = _y;
} else {
_parent.ball.targetX = (_x - 70) - (_currentframe * 2);
_parent.ball.targetY = _y;
}
} else {
_parent.ball.targetX = _x - 240;
_parent.ball.targetY = _y - 10;
}
if (((_root.game.gameMode == "kickOff") || (_root.game.gameMode == "punt")) || (_root.game.gameMode == "puntSafety")) {
_root.game.gameMode = "plays";
_root.game.passesNum = 0;
} else if (_root.game.gameMode == "fieldGoal") {
_root.game.gameMode = "shot";
}
var _local4 = _parent.ball.targetX - _parent.ball._x;
var _local3 = _parent.ball.targetY - _parent.ball._y;
var _local5 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
_parent.ball.xspeed = _local4 / (_local5 / 10);
_parent.ball.yspeed = _local3 / (_local5 / 10);
_parent.ball.zspeed = -(_local5 / 20);
_parent.ball.zpos = 4;
_parent.ball.target = "";
_parent.ball.lastPlayer = _root.game.player11;
_parent.ball.storedOwner = _root.game.player11;
}
if (_root.game.cleanUp == true) {
this.removeMovieClip();
}
var puntX = (_root.game.player15._x - ((_root.game.player15._x - _x) / 6));
var puntY = (_root.game.player15._y - 10);
var hitX = ((_x + 220) + (_currentframe * 2));
var hitY = _y;
var missX = ((_x + 70) + (_currentframe * 2));
var missY = _y;
var kickOffX = ((_parent.ball.targetX = _x + 240));
var kickOffY = (_y - 10);
_x = target._x;
_y = target._y;
if (((_root.game.gameMode == "kickOff") || (_root.game.gameMode == "fieldGoal")) || (_root.game.gameMode == "punt")) {
play();
if (timer < 25) {
timer = timer + 1;
} else {
timer = 0;
}
var when = (timer + random(20));
var now = 30;
if (((when > now) and (_root.game.started == true)) || ((_root.game.demoMode == true) and (when > now))) {
if (_root.game.ball.target.team == 1) {
kickBall();
} else if (_root.game.demoMode == true) {
kickBall2();
}
}
}
if (((_root.game.gameMode == "kickOff") || (_root.game.gameMode == "fieldGoal")) || (_root.game.gameMode == "punt")) {
if ((_root.game.gameMode == "fieldGoal") and (_root.game.ball.target.team == _root.game.playersTeam)) {
_alpha = 100;
} else {
_alpha = 0;
}
this.swapDepths(666);
} else {
_root.game.started = false;
_alpha = 0;
}
if (target.team == 1) {
_yscale = 100;
} else {
_yscale = -100;
}
}
Instance of Symbol 257 MovieClip in Symbol 494 MovieClip Frame 2
onClipEvent (load) {
storedFrame = 10;
}
onClipEvent (enterFrame) {
if (_root.game.cleanUp == true) {
this.removeMovieClip();
}
if (_root.game.gameMode == "punt") {
if ((_parent.ball.target.team == _root.game.playersTeam) and (_currentframe == 1)) {
var formations = "offensive";
gotoAndStop (21);
}
} else if (_root.game.gameMode == "fieldGoal") {
if ((_parent.ball.target.team == _root.game.playersTeam) and (_currentframe == 1)) {
var formations = "offensive";
gotoAndStop (20);
}
} else if ((_root.game.gameMode == "scrum") and (downs != 4)) {
if ((_parent.ball.target.team == _root.game.playersTeam) and (_currentframe == 1)) {
var formations = "offensive";
gotoAndStop(storedFrame);
} else if ((_currentframe == 1) and (downs != 4)) {
var formations = "defensive";
gotoAndStop (2);
}
} else if ((((_root.game.gameMode == "plays") || ((_root.game.gameMode == "fieldGoal") and (_root.ball.target.team != _root.game.playersTeam))) || ((_root.game.gameMode == "punt") and (_root.ball.target.team != _root.game.playersTeam))) || (_root.game.gameMode == "kickOff")) {
gotoAndStop (1);
}
if ((_root.game.gameMode == "fieldGoal") and (_root.ball.target.team != _root.game.playersTeam)) {
}
if (_root.game.gameMode == "kickOff") {
lastPlay = "";
}
if (_root.game.gameMode == "punt") {
lastPlay = "";
}
}
Instance of Symbol 259 MovieClip "ball" in Symbol 494 MovieClip Frame 2
onClipEvent (load) {
var target;
_x = target._x;
_y = target._y;
targetX = _x;
targetY = _y;
xpos = _x;
ypos = _y;
zpos = 0;
zspeed = 0;
grav = 1;
downTimer = 0;
downTimer2 = 0;
downTimer3 = 0;
xspeed = 0;
yspeed = 0;
lastPlayer = 0;
storedOwner = target;
thrownX = 0;
bounce = 0;
hitGround = false;
}
onClipEvent (enterFrame) {
if (_root.game.cleanUp == true) {
this.removeMovieClip();
}
if (target != "") {
storedOwner = target;
thrownX = target._x;
_rotation = 0;
lastPlayer = target;
if (_parent.nzone.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (_root.game.gameMode == "plays")) {
if ((target.team == 1) and (_x > 300)) {
if (_root.game.tdMode != false) {
_parent.addMessage("2point");
_root.game.gameMode = "celebration";
if (_root.game.playersTeam == 1) {
_root.game.hscore = _root.game.hscore + 2;
} else {
_root.game.gscore = _root.game.gscore + 2;
}
} else {
_parent.addMessage("touchdown");
_root.game.gameMode = "celebration";
if (_root.game.playersTeam == 1) {
_root.game.hscore = _root.game.hscore + 6;
} else {
_root.game.gscore = _root.game.gscore + 6;
}
}
} else if ((target.team == 2) and (_x < 300)) {
if (_root.game.tdMode != false) {
_parent.addMessage("2point");
_root.game.gameMode = "celebration";
if (_root.game.playersTeam == 2) {
_root.game.hscore = _root.game.hscore + 2;
} else {
_root.game.gscore = _root.game.gscore + 2;
}
} else {
_parent.addMessage("touchdown");
_root.game.gameMode = "celebration";
if (_root.game.playersTeam == 2) {
_root.game.hscore = _root.game.hscore + 6;
} else {
_root.game.gscore = _root.game.gscore + 6;
}
}
}
}
this.swapDepths((_y + 7.5) + _x);
_x = (target._x + target.xspeed);
_y = (target._y - 10);
_parent.ballShadow._x = _x;
_parent.ballShadow._y = _y + 11;
xpos = _x;
ypos = _y;
bounce = 0;
hitGround = false;
} else {
_rotation = (_rotation + xspeed);
this.swapDepths(_y + 5);
if (_root.game.paused == false) {
xpos = xpos + xspeed;
ypos = ypos + yspeed;
zpos = zpos - zspeed;
if ((zpos - zspeed) > 0) {
zspeed = zspeed + grav;
} else if (zspeed > 0) {
zspeed = -(zspeed * 0.3);
zpos = 0;
}
}
if ((zspeed < 0) and (hitGround == true)) {
bounce = bounce + 1;
}
if ((((zpos < 1) and (_root.game.paused == false)) and (_root.game.gameMode != "shot")) and (_root.game.gameMode != "celebration")) {
xspeed = xspeed * 0.9;
yspeed = yspeed * 0.9;
downTimer = downTimer + 1;
if (downTimer == 10) {
trace("stage1");
_root.game.sound.gotoAndPlay("whistle");
_root.game.addMessage("looseball");
_root.game.pauseTime = 100;
xspeed = 0;
yspeed = 0;
}
hitGround = true;
trace(bounce);
}
if ((((zpos < 1) and (_root.game.timeOut == true)) and (_root.game.gameMode != "shot")) and (_root.game.gameMode != "celebration")) {
xspeed = xspeed * 0.9;
yspeed = yspeed * 0.9;
downTimer3 = downTimer3 + 1;
if (downTimer3 == 10) {
trace("stage1.2");
_root.game.sound.gotoAndPlay("whistle");
_root.game.addMessage("looseball");
_root.game.removeTackles();
_root.game.gameMode = "plays";
_root.game.looseBall();
xspeed = 0;
yspeed = 0;
downTimer3 = 0;
}
hitGround = true;
}
if (((downTimer == 10) and (_root.game.screens._currentframe < 2)) and (_root.game.gameMode != "shot")) {
downTimer2 = downTimer2 + 1;
if (downTimer2 == 60) {
_root.game.removeTackles();
_root.game.pauseTime = 0;
_root.game.paused = false;
_root.game.gameMode = "plays";
_root.game.looseBall();
trace("stage2");
trace(_root.game.gameMode);
}
}
_x = xpos;
_y = (ypos - zpos);
_parent.ballShadow._x = xpos;
_parent.ballShadow._y = ypos;
}
if (_root.game.timeOut == true) {
downTimer = 0;
downTimer2 = 0;
}
if (((_root.game.gameMode != "plays") and (_root.game.paused == false)) and (downTimer != 0)) {
downTimer = 0;
downTimer2 = 0;
trace("stage3");
}
}
Instance of Symbol 263 MovieClip "ballShadow" in Symbol 494 MovieClip Frame 2
onClipEvent (enterFrame) {
if (_root.game.cleanUp == true) {
this.removeMovieClip();
}
if (_root.game.gameMode == "shot") {
_alpha = 0;
} else {
_alpha = 100;
}
}
Instance of Symbol 262 MovieClip in Symbol 494 MovieClip Frame 2
onClipEvent (enterFrame) {
if (_root.game.cleanUp == true) {
this.removeMovieClip();
}
if (_parent.grass.hitTest(_x + _root.game._x, _y + _root.game._y, true) and (_root.game.grass._currentframe == 2)) {
_alpha = 100;
_x = _parent._xmouse;
_y = _parent._ymouse;
Mouse.hide();
} else {
_alpha = 0;
_x = _parent._xmouse;
_y = _parent._ymouse;
Mouse.show();
}
}
Instance of Symbol 265 MovieClip in Symbol 494 MovieClip Frame 2
onClipEvent (enterFrame) {
if (_root.game.ball.target == "") {
if (_alpha == 0) {
_x = _root.game.ball.targetX;
_y = _root.game.ball.targetY;
}
} else {
_alpha = 0;
}
}
Instance of Symbol 454 MovieClip "scoreboard" in Symbol 494 MovieClip Frame 2
onClipEvent (load) {
waited = 0;
storedDowns = 0;
}
onClipEvent (enterFrame) {
if (_root.game.cleanUp == true) {
this.removeMovieClip();
}
if (_root.game.ball.ypos < 20) {
this.swapDepths(_root.getNextHighestDepth());
} else {
this.swapDepths(5);
}
if (_parent.mins > 9) {
minsTens = substring(_parent.mins, 1, 1);
minsOnes = substring(_parent.mins, 2, 1);
} else if (_parent.mins >= 0) {
minsTens = 0;
minsOnes = _parent.mins;
}
if (_parent.secs > 9) {
secsTens = substring(_parent.secs, 1, 1);
secsOnes = substring(_parent.secs, 2, 1);
} else if (_parent.secs >= 0) {
secsTens = 0;
secsOnes = _parent.secs;
}
_root.game.intercepted = false;
storedDowns = _root.game.downs;
guestScoreOnes = _root.game.gscore;
homeScoreOnes = _root.game.hscore;
if (_root.gameMode != "punt") {
downs = _parent.downs;
} else {
downs = 4;
}
if (_root.game.gameMode != "kickOff") {
if (_parent.ballon > 9) {
ballonTens = substring(_parent.ballon, 1, 1);
ballonOnes = substring(_parent.ballon, 2, 1);
} else if (_parent.ballon > 0.9) {
ballonTens = 0;
ballonOnes = _parent.ballon;
} else if (((_parent.ballon != 0) || (_root.game.gameMode == "scrum")) || (_root.game.gameMode == "punt")) {
ballonTens = 0;
ballonOnes = 1;
}
if (_parent.togo > 9) {
togoTens = substring(_parent.togo, 1, 1);
togoOnes = substring(_parent.togo, 2, 1);
} else if (_parent.togo > 0.9) {
togoTens = 0;
togoOnes = _parent.togo;
} else if (((_parent.togo != 0) || (_root.game.gameMode == "scrum")) || (_root.game.gameMode == "punt")) {
togoOnes = 1;
togoTens = 0;
}
} else {
ballonTens = "-";
ballonOnes = "-";
togoTens = "-";
togoOnes = "-";
}
if (_root.game.gscore > 9) {
guestScoreTens = substring(_root.game.gscore, 1, 1);
guestScoreOnes = substring(_root.game.gscore, 2, 1);
} else {
guestScoreTens = 0;
guestScoreOnes = _root.game.gscore;
}
if (_root.game.hscore > 9) {
homeScoreTens = substring(_root.game.hscore, 1, 1);
homeScoreOnes = substring(_root.game.hscore, 2, 1);
} else {
homeScoreTens = 0;
homeScoreOnes = _root.game.hscore;
}
if (_parent.quarter < 5) {
qtr = _parent.quarter;
} else {
qtr = 4;
}
if (bigscreen.ani._currentframe != 1) {
tutorial._alpha = 0;
waited = 0;
} else {
waited = waited + 1;
if (waited > 5) {
tutorial._alpha = 100;
}
}
}
Instance of Symbol 457 MovieClip "sound" in Symbol 494 MovieClip Frame 2
onClipEvent (load) {
}
onClipEvent (enterFrame) {
if ((_root.game.demoMode == false) and (songPlaying == false)) {
}
if ((_parent.vibrate != true) and (_root.game.demoMode == false)) {
if (songVol < 150) {
}
} else if (songVol > 0) {
}
}
Instance of Symbol 458 MovieClip "vibrationSound" in Symbol 494 MovieClip Frame 2
onClipEvent (load) {
vibrationTimer = 0;
}
onClipEvent (enterFrame) {
if ((_parent.vibrate == true) and (_parent.paused == false)) {
vibrationTimer = vibrationTimer + 1;
if ((vibratePlaying == false) and (vibrationTimer > 2)) {
vibrate = new Sound(this);
vibrate.attachSound("vibrationSound");
vibrate.start(0, 99);
vibrate.setVolume(25);
var vibratePlaying = true;
}
} else {
var vibratePlaying = false;
vibrationTimer = 0;
vibrate.stop();
kirupaSound = new Sound(this);
}
}
Instance of Symbol 493 MovieClip "screens" in Symbol 494 MovieClip Frame 2
onClipEvent (load) {
storedQuarter = 1;
gscoreD = 0;
hscoreD = 0;
lastFrame = 1;
}
onClipEvent (enterFrame) {
if (_currentframe == 5) {
_root.game.paused = true;
}
if ((_currentframe < 5) and (_currentframe > 1)) {
lastFrame = _currentframe;
}
if (_root.game.cleanUp == true) {
this.removeMovieClip();
}
if (((_root.game.demoMode == true) and (_currentframe != 5)) and (_currentframe != 1)) {
gotoAndStop (1);
}
if ((storedQuarter != _root.game.quarter) || (_currentframe == 5)) {
this.swapDepths(_root.game.getNextHighestDepth());
if (_currentframe == 1) {
if (_root.game.quarter == 3) {
gotoAndStop (3);
} else if (_root.game.quarter < 5) {
gotoAndStop (2);
} else if (_currentframe < 4) {
gotoAndStop (4);
}
storedQuarter = _root.game.quarter;
}
}
if ((_alpha < 100) and (_currentframe != 1)) {
_alpha = (_alpha + 10);
}
if (_currentframe == 1) {
_alpha = 0;
}
gscoreD = parseInt(_root.game.gscore);
hscoreD = parseInt(_root.game.hscore);
}
Symbol 494 MovieClip Frame 3
cleanUp = true;
Symbol 494 MovieClip Frame 4
hscore = 0;
gscore = 0;
downs = 0;
vibrate = false;
gameMode = "scrum";
passesNum = 0;
downs = 0;
shotTimer = 0;
counter = 0;
secs = 0;
mins = defaultMins;
quarter = 1;
scrimmage = 0;
started = false;
startTimer = 0;
chosenColour = colour;
playersTeam = 1;
compTeam = 2;
gameCompleted = true;