Frame 1
Instance of Symbol 64 MovieClip in Frame 1
onClipEvent (enterFrame) {
var tLoaded = this._parent.getBytesLoaded();
var tTotal = this._parent.getBytesTotal();
var tPercent = Math.round((tLoaded / tTotal) * 100);
if (tPercent > 99) {
tPercent = 99;
}
if (tPercent < 0) {
tPercent = 0;
}
this.loaded_txt = tPercent;
if (this._parent.controlSWF == undefined) {
if (tLoaded >= tTotal) {
this._parent.gotoAndPlay(6);
} else {
this._parent.stop();
}
}
}
Frame 2
stop();
loadMovieNum (controlSWF, 1000);
Frame 3
play();
Frame 4
stop();
myGameObject.displayBillboard();
Frame 5
play();
Frame 6
_quality = "LOW";
this.xmlPrefs = new XML();
this.xmlPrefs.ignoreWhite = true;
this.xmlPrefs.parseXML("<MOVES>\t<MOVE ID=\"guard\" DEPTH=\"0\" TYPE=\"guard\" TARGET=\"self\" NAME=\"guard\" CHARACTERS=\"i,ke,m,ka,n,s,sa,ko\" >\t\t<USERIMPACT LOC=\"0,0\" LIFE=\"0\" ENERGY=\"0\" PROTECTION=\"15\" />\t\t<ENEMYIMPACT LIFE=\"0\" AREA=\"0,0,0_0,1,0_0,0,0\" />\t</MOVE>\t\t<MOVE ID=\"energyUp\" DEPTH=\"0\" TYPE=\"energyUp\" TARGET=\"self\" NAME=\"energy up\" CHARACTERS=\"i,ke,m,ka,n,s,sa,ko\">\t\t<USERIMPACT LOC=\"0,0\" LIFE=\"0\" ENERGY=\"15\" PROTECTION=\"0\" />\t\t<ENEMYIMPACT LIFE=\"0\" AREA=\"0,0,0_0,1,0_0,0,0\" />\t</MOVE>\t\t<MOVE ID=\"moveLeft\" DEPTH=\"1\" TYPE=\"location\" TARGET=\"self\" NAME=\"move left\" CHARACTERS=\"i,ke,m,ka,n,s,sa,ko\">\t\t<USERIMPACT LOC=\"0,-1\" LIFE=\"0\" ENERGY=\"0\" PROTECTION=\"0\" />\t\t<ENEMYIMPACT LIFE=\"0\" AREA=\"0,0,0_0,1,0_0,0,0\" />\t</MOVE>\t<MOVE ID=\"moveRight\" DEPTH=\"1\" TYPE=\"location\" TARGET=\"self\" NAME=\"move right\" CHARACTERS=\"i,ke,m,ka,n,s,sa,ko\">\t\t<USERIMPACT LOC=\"0,1\" LIFE=\"0\" ENERGY=\"0\" PROTECTION=\"0\" />\t\t<ENEMYIMPACT LIFE=\"0\" AREA=\"0,0,0_0,1,0_0,0,0\" />\t</MOVE>\t<MOVE ID=\"moveUp\" DEPTH=\"1\" TYPE=\"location\" TARGET=\"self\" NAME=\"move up\" CHARACTERS=\"i,ke,m,ka,n,s,sa,ko\">\t\t<USERIMPACT LOC=\"-1,0\" LIFE=\"0\" ENERGY=\"0\" PROTECTION=\"0\" />\t\t<ENEMYIMPACT LIFE=\"0\" AREA=\"0,0,0_0,1,0_0,0,0\" />\t</MOVE>\t<MOVE ID=\"moveDown\" DEPTH=\"1\" TYPE=\"location\" TARGET=\"self\" NAME=\"move down\" CHARACTERS=\"i,ke,m,ka,n,s,sa,ko\">\t\t<USERIMPACT LOC=\"1,0\" LIFE=\"0\" ENERGY=\"0\" PROTECTION=\"0\" />\t\t<ENEMYIMPACT LIFE=\"0\" AREA=\"0,0,0_0,1,0_0,0,0\" />\t</MOVE>\t\t<MOVE ID=\"ironReaver\" DEPTH=\"1\" TYPE=\"action\" TARGET=\"enemy\" NAME=\"iron reaver\" CHARACTERS=\"i\">\t\t<USERIMPACT LOC=\"0,0\" LIFE=\"0\" ENERGY=\"-35\" PROTECTION=\"0\" />\t\t<ENEMYIMPACT LIFE=\"-25\" AREA=\"1,0,1_0,1,0_1,0,1\" />\t</MOVE>\t<MOVE ID=\"bladesOfBlood\" DEPTH=\"1\" TYPE=\"action\" TARGET=\"enemy\" NAME=\"blades of blood\" CHARACTERS=\"i\">\t\t<USERIMPACT LOC=\"0,0\" LIFE=\"0\" ENERGY=\"-25\" PROTECTION=\"0\" />\t\t<ENEMYIMPACT LIFE=\"-25\" AREA=\"0,1,0_1,1,1_0,1,0\" />\t</MOVE>\t<MOVE ID=\"windScar\" DEPTH=\"1\" TYPE=\"action\" TARGET=\"enemy\" NAME=\"wind scar\" CHARACTERS=\"i\">\t\t<USERIMPACT LOC=\"0,0\" LIFE=\"0\" ENERGY=\"-50\" PROTECTION=\"0\" />\t\t<ENEMYIMPACT LIFE=\"-50\" AREA=\"0,0,0_0,1,0_1,1,1\" />\t</MOVE>\t<MOVE ID=\"bladeStrike\" DEPTH=\"1\" TYPE=\"action\" TARGET=\"enemy\" NAME=\"blade strike\" CHARACTERS=\"i\">\t\t<USERIMPACT LOC=\"0,0\" LIFE=\"0\" ENERGY=\"-25\" PROTECTION=\"0\" />\t\t<ENEMYIMPACT LIFE=\"-30\" AREA=\"0,1,0_0,1,0_0,1,0\" />\t</MOVE>\t\t<MOVE ID=\"deflectCurse\" DEPTH=\"1\" TYPE=\"action\" TARGET=\"enemy\" NAME=\"deflect curse\" CHARACTERS=\"ke\">\t\t<USERIMPACT LOC=\"0,0\" LIFE=\"0\" ENERGY=\"-25\" PROTECTION=\"0\" />\t\t<ENEMYIMPACT LIFE=\"-25\" AREA=\"0,1,0_1,1,1_0,1,0\" />\t</MOVE>\t<MOVE ID=\"spiritPower\" DEPTH=\"1\" TYPE=\"action\" TARGET=\"enemy\" NAME=\"spirit power\" CHARACTERS=\"ke\">\t\t<USERIMPACT LOC=\"0,0\" LIFE=\"0\" ENERGY=\"-15\" PROTECTION=\"0\" />\t\t<ENEMYIMPACT LIFE=\"-25\" AREA=\"0,0,0_1,1,1_0,0,0\" />\t</MOVE>\t<MOVE ID=\"purifyArrow\" DEPTH=\"21\" TYPE=\"action\" TARGET=\"enemy\" NAME=\"purify arrow\" CHARACTERS=\"ke\">\t\t<USERIMPACT LOC=\"0,0\" LIFE=\"0\" ENERGY=\"-15\" PROTECTION=\"0\" />\t\t<ENEMYIMPACT LIFE=\"-15\" AREA=\"1,1,1_1,1,1_1,1,1\" />\t</MOVE>\t<MOVE ID=\"sacredArrow\" DEPTH=\"21\" TYPE=\"action\" TARGET=\"enemy\" NAME=\"sacred arrow\" CHARACTERS=\"ke\">\t\t<USERIMPACT LOC=\"0,0\" LIFE=\"0\" ENERGY=\"-50\" PROTECTION=\"0\" />\t\t<ENEMYIMPACT LIFE=\"-50\" AREA=\"1,0,1_0,1,0_0,0,0\" />\t</MOVE>\t<MOVE ID=\"ashenSalt\" DEPTH=\"1\" TYPE=\"action\" TARGET=\"enemy\" NAME=\"ashen salt\" CHARACTERS=\"m\">\t\t<USERIMPACT LOC=\"0,0\" LIFE=\"0\" ENERGY=\"-20\" PROTECTION=\"0\" />\t\t<ENEMYIMPACT LIFE=\"-25\" AREA=\"0,0,0_1,1,1_0,0,0\" />\t</MOVE>\t<MOVE ID=\"spiritWard\" DEPTH=\"1\" TYPE=\"action\" TARGET=\"enemy\" NAME=\"spirit ward\" CHARACTERS=\"m\">\t\t<USERIMPACT LOC=\"0,0\" LIFE=\"0\" ENERGY=\"-35\" PROTECTION=\"0\" />\t\t<ENEMYIMPACT LIFE=\"-25\" AREA=\"1,0,1_0,1,0_1,0,1\" />\t</MOVE>\t<MOVE ID=\"spiritHold\" DEPTH=\"1\" TYPE=\"action\" TARGET=\"enemy\" NAME=\"spirit hold\" CHARACTERS=\"m\">\t\t<USERIMPACT LOC=\"0,0\" LIFE=\"0\" ENERGY=\"-15\" PROTECTION=\"0\" />\t\t<ENEMYIMPACT LIFE=\"-15\" AREA=\"1,1,1_1,1,1_1,1,1\" />\t</MOVE>\t<MOVE ID=\"windTunnel\" DEPTH=\"1\" TYPE=\"action\" TARGET=\"enemy\" NAME=\"wind tunnel\" CHARACTERS=\"m\">\t\t<USERIMPACT LOC=\"0,0\" LIFE=\"0\" ENERGY=\"-50\" PROTECTION=\"0\" />\t\t<ENEMYIMPACT LIFE=\"-50\" AREA=\"1,1,1_0,1,0_0,0,0\" />\t</MOVE>\t\t<MOVE ID=\"danceOfBlades\" DEPTH=\"1\" TYPE=\"action\" TARGET=\"enemy\" NAME=\"dance of blades\" CHARACTERS=\"ka\">\t\t<USERIMPACT LOC=\"0,0\" LIFE=\"0\" ENERGY=\"-30\" PROTECTION=\"0\" />\t\t<ENEMYIMPACT LIFE=\"-25\" AREA=\"1,0,1_0,1,0_1,0,1\" />\t</MOVE>\t<MOVE ID=\"danceOfTheDead\" DEPTH=\"1\" TYPE=\"action\" TARGET=\"enemy\" NAME=\"dance of the dead\" CHARACTERS=\"ka\">\t\t<USERIMPACT LOC=\"0,0\" LIFE=\"0\" ENERGY=\"-15\" PROTECTION=\"0\" />\t\t<ENEMYIMPACT LIFE=\"-25\" AREA=\"0,0,0_1,1,1_0,0,0\" />\t</MOVE>\t<MOVE ID=\"summonKanna\" DEPTH=\"1\" TYPE=\"action\" TARGET=\"enemy\" NAME=\"summon kanna\" CHARACTERS=\"ka\">\t\t<USERIMPACT LOC=\"0,0\" LIFE=\"0\" ENERGY=\"-30\" PROTECTION=\"0\" />\t\t<ENEMYIMPACT LIFE=\"-25\" AREA=\"0,1,0_1,1,1_0,1,0\" />\t</MOVE>\t<MOVE ID=\"dragonDance\" DEPTH=\"1\" TYPE=\"action\" TARGET=\"enemy\" NAME=\"dragon dance\" CHARACTERS=\"ka\">\t\t<USERIMPACT LOC=\"0,0\" LIFE=\"0\" ENERGY=\"-50\" PROTECTION=\"0\" />\t\t<ENEMYIMPACT LIFE=\"-40\" AREA=\"1,0,1_1,1,1_1,0,1\" />\t</MOVE>\t<MOVE ID=\"poisonInsects\" DEPTH=\"11\" TYPE=\"action\" TARGET=\"enemy\" NAME=\"poison insects\" CHARACTERS=\"n\">\t\t<USERIMPACT LOC=\"0,0\" LIFE=\"0\" ENERGY=\"-20\" PROTECTION=\"0\" />\t\t<ENEMYIMPACT LIFE=\"-25\" AREA=\"1,0,1_0,1,0_1,0,1\" />\t</MOVE>\t<MOVE ID=\"miasma\" DEPTH=\"1\" TYPE=\"action\" TARGET=\"enemy\" NAME=\"miasma\" CHARACTERS=\"n\">\t\t<USERIMPACT LOC=\"0,0\" LIFE=\"0\" ENERGY=\"-50\" PROTECTION=\"0\" />\t\t<ENEMYIMPACT LIFE=\"-40\" AREA=\"0,1,0_1,1,1_0,1,0\" />\t</MOVE>\t<MOVE ID=\"rootsOfEvil\" DEPTH=\"-1\" TYPE=\"action\" TARGET=\"enemy\" NAME=\"roots of evil\" CHARACTERS=\"n\">\t\t<USERIMPACT LOC=\"0,0\" LIFE=\"0\" ENERGY=\"-15\" PROTECTION=\"0\" />\t\t<ENEMYIMPACT LIFE=\"-20\" AREA=\"0,0,0_1,1,1_1,1,1\" />\t</MOVE>\t<MOVE ID=\"demonStrike\" DEPTH=\"21\" TYPE=\"action\" TARGET=\"enemy\" NAME=\"Demon Strike\" CHARACTERS=\"n\">\t\t<USERIMPACT LOC=\"0,0\" LIFE=\"0\" ENERGY=\"-70\" PROTECTION=\"0\" />\t\t<ENEMYIMPACT LIFE=\"-60\" AREA=\"0,0,0_1,0,1_0,0,0\" />\t</MOVE>\t\t<MOVE ID=\"whipOfLight\" DEPTH=\"1\" TYPE=\"action\" TARGET=\"enemy\" NAME=\"whip of light\" CHARACTERS=\"s\">\t\t<USERIMPACT LOC=\"0,0\" LIFE=\"0\" ENERGY=\"-20\" PROTECTION=\"0\" />\t\t<ENEMYIMPACT LIFE=\"-30\" AREA=\"0,0,0_1,1,1_0,0,0\" />\t</MOVE>\t<MOVE ID=\"tokijin\" DEPTH=\"1\" TYPE=\"action\" TARGET=\"enemy\" NAME=\"tokijin\" CHARACTERS=\"s\">\t\t<USERIMPACT LOC=\"0,0\" LIFE=\"0\" ENERGY=\"-50\" PROTECTION=\"0\" />\t\t<ENEMYIMPACT LIFE=\"-60\" AREA=\"0,0,0_0,1,0_0,1,0\" />\t</MOVE>\t<MOVE ID=\"poisonClaws\" DEPTH=\"1\" TYPE=\"action\" TARGET=\"enemy\" NAME=\"poison claws\" CHARACTERS=\"s\">\t\t<USERIMPACT LOC=\"0,0\" LIFE=\"0\" ENERGY=\"-25\" PROTECTION=\"0\" />\t\t<ENEMYIMPACT LIFE=\"-25\" AREA=\"1,0,1_0,1,0_1,0,1\" />\t</MOVE>\t<MOVE ID=\"demonForm\" DEPTH=\"21\" TYPE=\"action\" TARGET=\"enemy\" NAME=\"demon form\" CHARACTERS=\"s\">\t\t<USERIMPACT LOC=\"0,0\" LIFE=\"0\" ENERGY=\"-50\" PROTECTION=\"0\" />\t\t<ENEMYIMPACT LIFE=\"-40\" AREA=\"1,1,1_0,1,0_1,1,1\" />\t</MOVE>\t\t<MOVE ID=\"poisonPowder\" DEPTH=\"1\" TYPE=\"action\" TARGET=\"enemy\" NAME=\"poison powder\" CHARACTERS=\"sa\">\t\t<USERIMPACT LOC=\"0,0\" LIFE=\"0\" ENERGY=\"-20\" PROTECTION=\"0\" />\t\t<ENEMYIMPACT LIFE=\"-30\" AREA=\"0,1,0_0,1,0_0,1,0\" />\t</MOVE>\t<MOVE ID=\"secretSword\" DEPTH=\"1\" TYPE=\"action\" TARGET=\"enemy\" NAME=\"secret sword\" CHARACTERS=\"sa\">\t\t<USERIMPACT LOC=\"0,0\" LIFE=\"0\" ENERGY=\"-25\" PROTECTION=\"0\" />\t\t<ENEMYIMPACT LIFE=\"-15\" AREA=\"1,0,1_1,0,1_1,0,1\" />\t</MOVE>\t<MOVE ID=\"hiraikotsu\" DEPTH=\"1\" TYPE=\"action\" TARGET=\"enemy\" NAME=\"hiraikotsu\" CHARACTERS=\"sa\">\t\t<USERIMPACT LOC=\"0,0\" LIFE=\"0\" ENERGY=\"-30\" PROTECTION=\"0\" />\t\t<ENEMYIMPACT LIFE=\"-25\" AREA=\"1,1,1_0,1,0_1,1,1\" />\t</MOVE>\t<MOVE ID=\"kirarasPounce\" DEPTH=\"1\" TYPE=\"action\" TARGET=\"enemy\" NAME=\"kiraras pounce\" CHARACTERS=\"sa\">\t\t<USERIMPACT LOC=\"0,0\" LIFE=\"0\" ENERGY=\"-45\" PROTECTION=\"0\" />\t\t<ENEMYIMPACT LIFE=\"-40\" AREA=\"0,0,0_1,1,1_0,0,0\" />\t</MOVE>\t\t\t<MOVE ID=\"shardKick\" DEPTH=\"1\" TYPE=\"action\" TARGET=\"enemy\" NAME=\"shard kick\" CHARACTERS=\"ko\">\t\t<USERIMPACT LOC=\"0,0\" LIFE=\"0\" ENERGY=\"-35\" PROTECTION=\"0\" />\t\t<ENEMYIMPACT LIFE=\"-20\" AREA=\"1,0,1_1,1,1_1,0,1\" />\t</MOVE>\t<MOVE ID=\"wolfBite\" DEPTH=\"1\" TYPE=\"action\" TARGET=\"enemy\" NAME=\"wolf bite\" CHARACTERS=\"ko\">\t\t<USERIMPACT LOC=\"0,0\" LIFE=\"0\" ENERGY=\"-15\" PROTECTION=\"0\" />\t\t<ENEMYIMPACT LIFE=\"-25\" AREA=\"0,1,0_1,1,1_0,0,0\" />\t</MOVE>\t<MOVE ID=\"fistOfRage\" DEPTH=\"1\" TYPE=\"action\" TARGET=\"enemy\" NAME=\"fist of rage\" CHARACTERS=\"ko\">\t\t<USERIMPACT LOC=\"0,0\" LIFE=\"0\" ENERGY=\"-45\" PROTECTION=\"0\" />\t\t<ENEMYIMPACT LIFE=\"-50\" AREA=\"0,0,0_0,1,0_1,1,1\" />\t</MOVE>\t<MOVE ID=\"cycloneDash\" DEPTH=\"1\" TYPE=\"action\" TARGET=\"enemy\" NAME=\"cyclone dash\" CHARACTERS=\"ko\">\t\t<USERIMPACT LOC=\"0,0\" LIFE=\"0\" ENERGY=\"-25\" PROTECTION=\"0\" />\t\t<ENEMYIMPACT LIFE=\"-35\" AREA=\"0,0,0_1,1,1_0,0,0\" />\t</MOVE>\t\t<MOVE ID=\"perfectGuard\" DEPTH=\"0\" TYPE=\"guard\" TARGET=\"self\" NAME=\"perfect guard\" CHARACTERS=\"i,ke,m,ka,n,s,sa,ko\" ADVANCED=\"1\">\t\t<USERIMPACT LOC=\"0,0\" LIFE=\"0\" ENERGY=\"-25\" PROTECTION=\"100\"/>\t\t<ENEMYIMPACT LIFE=\"0\" AREA=\"0,0,0_0,1,0_0,0,0\" />\t</MOVE>\t<MOVE ID=\"heal\" DEPTH=\"0\" TYPE=\"heal\" TARGET=\"self\" NAME=\"heal\" CHARACTERS=\"i,ke,m,ka,n,s,sa,ko\" ADVANCED=\"1\">\t\t<USERIMPACT LOC=\"0,0\" LIFE=\"40\" ENERGY=\"-60\" PROTECTION=\"0\"/>\t\t<ENEMYIMPACT LIFE=\"0\" AREA=\"0,0,0_0,1,0_0,0,0\" />\t</MOVE>\t<MOVE ID=\"kikyosRevenge\" DEPTH=\"21\" TYPE=\"action\" TARGET=\"enemy\" NAME=\"Kikyos Revenge\" CHARACTERS=\"i,ke,m,ka,n,s,sa,ko\" ADVANCED=\"1\">\t\t<USERIMPACT LOC=\"0,0\" LIFE=\"0\" ENERGY=\"-100\" PROTECTION=\"0\"/>\t\t<ENEMYIMPACT LIFE=\"-80\" AREA=\"0,0,0_0,1,0_0,0,0\" />\t</MOVE>\t<MOVE ID=\"summonKirara\" DEPTH=\"21\" TYPE=\"action\" TARGET=\"enemy\" NAME=\"Summon Kirara\" CHARACTERS=\"sa\" ADVANCED=\"1\">\t\t<USERIMPACT LOC=\"0,0\" LIFE=\"0\" ENERGY=\"-15\" PROTECTION=\"0\" />\t\t<ENEMYIMPACT LIFE=\"-15\" AREA=\"1,1,1_1,1,1_1,1,1\" />\t</MOVE>\t<MOVE ID=\"summonDemons\" DEPTH=\"21\" TYPE=\"action\" TARGET=\"enemy\" NAME=\"Summon Demons\" CHARACTERS=\"ka,n\" ADVANCED=\"1\">\t\t<USERIMPACT LOC=\"0,0\" LIFE=\"0\" ENERGY=\"-15\" PROTECTION=\"0\" />\t\t<ENEMYIMPACT LIFE=\"-15\" AREA=\"1,1,1_1,1,1_1,1,1\" />\t</MOVE>\t<MOVE ID=\"summonJaken\" DEPTH=\"21\" TYPE=\"action\" TARGET=\"enemy\" NAME=\"Summon Jaken\" CHARACTERS=\"s\" ADVANCED=\"1\">\t\t<USERIMPACT LOC=\"0,0\" LIFE=\"0\" ENERGY=\"-15\" PROTECTION=\"0\" />\t\t<ENEMYIMPACT LIFE=\"-25\" AREA=\"0,0,0_1,0,1_1,0,1\" />\t</MOVE>\t<MOVE ID=\"summonShippo\" DEPTH=\"21\" TYPE=\"action\" TARGET=\"enemy\" NAME=\"Summon Shippo\" CHARACTERS=\"i,m,ke\" ADVANCED=\"1\">\t\t<USERIMPACT LOC=\"0,0\" LIFE=\"0\" ENERGY=\"-15\" PROTECTION=\"0\" />\t\t<ENEMYIMPACT LIFE=\"-15\" AREA=\"1,1,1_1,1,1_1,1,1\" />\t</MOVE>\t<MOVE ID=\"summonWolves\" DEPTH=\"21\" TYPE=\"action\" TARGET=\"enemy\" NAME=\"summon wolves\" CHARACTERS=\"ko\" ADVANCED=\"1\">\t\t<USERIMPACT LOC=\"0,0\" LIFE=\"0\" ENERGY=\"-40\" PROTECTION=\"0\" />\t\t<ENEMYIMPACT LIFE=\"-25\" AREA=\"1,1,1_1,1,1_1,1,1\" />\t</MOVE>\t\t<MOVE ID=\"doubleRight\" DEPTH=\"1\" TYPE=\"location\" TARGET=\"self\" NAME=\"double right\" CHARACTERS=\"i,ke,m,ka,n,s,sa,ko\" ADVANCED=\"1\">\t\t<USERIMPACT LOC=\"0,2\" LIFE=\"0\" ENERGY=\"0\" PROTECTION=\"0\"/>\t\t<ENEMYIMPACT LIFE=\"0\" AREA=\"0,0,0_0,1,0_0,0,0\" />\t</MOVE>\t<MOVE ID=\"doubleLeft\" DEPTH=\"1\" TYPE=\"location\" TARGET=\"self\" NAME=\"double left\" CHARACTERS=\"i,ke,m,ka,n,s,sa,ko\" ADVANCED=\"1\">\t\t<USERIMPACT LOC=\"0,-2\" LIFE=\"0\" ENERGY=\"0\" PROTECTION=\"0\"/>\t\t<ENEMYIMPACT LIFE=\"0\" AREA=\"0,0,0_0,1,0_0,0,0\" />\t</MOVE></MOVES>");
this.isPrefsLoaded = true;
Frame 7
if (isPrefsLoaded) {
if (this.getBytesLoaded() >= this.getBytesTotal()) {
gotoAndPlay ("XMLloaded");
}
}
Frame 8
gotoAndPlay ("loadingXML");
Frame 12
if (Object.$POP == undefined) {
Object.$POP = {};
}
if (Object.$POP.Class == undefined) {
Object.$POP.Class = {};
}
if (Object.$POP.Prefs == undefined) {
Object.$POP.Prefs = {};
}
if (Object.Tools == undefined) {
Object.Tools = {};
}
Object.Tools.copyObject = function (iObject) {
var _local3 = iObject;
if (Object.Tools.isArray(_local3)) {
var tNewArray = new Array();
var ti = 0;
while (ti < _local3.length) {
var _local1 = _local3[ti];
var _local2 = typeof(_local1);
if (((_local2 == "object") || (_local2 == "function")) || (_local2 == "movieclip")) {
tNewArray.push(Object.Tools.copyObject(_local1));
} else {
tNewArray.push(_local1);
}
ti++;
}
var tCopiedObject = tNewArray;
} else {
var tNewObject = new Object();
for (var ti in _local3) {
var _local1 = _local3[ti];
var _local2 = typeof(_local1);
if (((_local2 == "object") || (_local2 == "function")) || (_local2 == "movieclip")) {
tNewObject[ti] = Object.Tools.copyObject(_local1);
} else {
tNewObject[ti] = _local1;
}
}
var tCopiedObject = tNewObject;
}
return(tCopiedObject);
};
d = (Object.Tools.debug = {});
d._timees = {};
d._outputTarget = "trace";
d._outputField = "";
d.ST = function (iID) {
var _local2 = this;
var _local1 = iID;
var _local3 = _local2._timees;
if (_local3[_local1] == undefined) {
_local3[_local1] = _local2._getTime();
_local2._output({out:("> " + _local1) + " > start"});
} else {
_local2._output({out:"ALERT! - Object.Tools.debug.ST - There is already a timee with this ID - " + _local1});
}
};
d.ET = function (iID) {
var _local2 = this;
var _local1 = iID;
var _local3 = _local2._timees;
var tStartTime = _local3[_local1];
if (tStartTime != undefined) {
var tDuration = (_local2._getTime() - tStartTime);
_local2._output({out:(("< " + _local1) + " < stop < ") + tDuration});
delete _local3[_local1];
} else {
_local2._output({out:"ALERT! - Object.Tools.debug.ET - No timee with this ID - " + _local1});
}
};
d.setOutputTarget = function (iArgs) {
var _local2 = this;
var _local1 = iArgs.target;
var _local3 = iArgs.field;
if (_local1 == "trace") {
_local2._outputTarget = "trace";
_local2._outputField = "";
} else {
_local2._outputTarget = _local1;
_local2._outputField = _local3;
}
};
d._getTime = function () {
return(new Date().getTime());
};
d._output = function (iArgs) {
var _local1 = iArgs.out;
var _local2 = this._outputTarget;
var _local3 = this._outputField;
if (_local2 == "trace") {
} else {
_local2[_local3] = _local2[_local3] + (newline + _local1);
}
};
delete d;
Object.Tools.isArray = function (iTestMe) {
var _local1 = iTestMe;
var _local2 = ((_local1.length != undefined) && (typeof(_local1.push) == "function")) && (typeof(_local1.unshift) == "function");
return(_local2);
};
Object.Tools.traceObject = function (iObject, iPass, iParent) {
var tObject = iObject;
var tPass = ((iPass == undefined) ? 0 : (iPass));
var tParent = iParent;
if (tPass < 1) {
}
var _local1 = "";
var tIC = 0;
while (tIC <= tPass) {
_local1 = _local1 + " ";
tIC++;
}
tPass++;
for (var ti in tObject) {
var _local2 = tObject[ti];
var _local3 = typeof(_local2);
if (((_local3 == "object") || (_local3 == "function")) || (_local3 == "movieclip")) {
var tIsArray = Object.Tools.isArray(_local2);
var tOpenBracket = (tIsArray ? "[" : "{");
var tClosedBracket = (tIsArray ? "]" : "}");
if (Object.Tools.isArray(tObject)) {
}
var tParentType = (tIsArray ? "array" : "object");
Object.Tools.traceObject(_local2, tPass, tParentType);
} else if (Object.Tools.isArray(tObject)) {
}
}
};
Object.Tools.debugObject = function (iObject, iPass, iParent) {
var tObject = iObject;
var tPass = iPass;
var tParent = iParent;
if (tPass < 1) {
Object.TITAN.TransitionMediator.writeDebug({message:"- - - trace object - - -", header:eval("TRUE")});
}
var _local1 = "";
var tIC = 0;
while (tIC <= tPass) {
_local1 = _local1 + " ";
tIC++;
}
tPass++;
for (var ti in tObject) {
var _local2 = tObject[ti];
var _local3 = typeof(_local2);
if (((_local3 == "object") || (_local3 == "function")) || (_local3 == "movieclip")) {
var tIsArray = Object.Tools.isArray(_local2);
var tOpenBracket = (tIsArray ? "[" : "{");
var tClosedBracket = (tIsArray ? "]" : "}");
if (Object.Tools.isArray(tObject)) {
Object.TITAN.TransitionMediator.writeDebug({message:_local1 + tOpenBracket, header:eval("FALSE")});
} else {
Object.TITAN.TransitionMediator.writeDebug({message:((_local1 + ti) + " : ") + tOpenBracket, header:eval("FALSE")});
}
var tParentType = (tIsArray ? "array" : "object");
Object.Tools.debugObject(_local2, tPass, tParentType);
Object.TITAN.TransitionMediator.writeDebug({message:_local1 + tClosedBracket, header:eval("FALSE")});
} else if (Object.Tools.isArray(tObject)) {
Object.TITAN.TransitionMediator.writeDebug({message:_local1 + _local2, header:eval("FALSE")});
} else {
Object.TITAN.TransitionMediator.writeDebug({message:((_local1 + ti) + " : ") + _local2, header:eval("FALSE")});
}
}
};
Object.Tools.XMLToObject = function (iXMLObject) {
var _local1 = Object.Tools.unfoldXML({}, iXMLObject.firstChild);
return(_local1);
};
Object.Tools.unfoldXML = function (iStructure, iNode) {
var _local2 = iNode;
var tTempObject = {};
while (_local2 != null) {
if (_local2.nodeType == 1) {
tTempObject = Object.Tools.unfoldXML({}, _local2.firstChild);
var _local3 = _local2.nodeName;
for (var ti in _local2.attributes) {
var _local1 = _local2.attributes[ti];
var tBooleanCheck = _local1.toLowerCase();
if (tBooleanCheck == "true") {
_local1 = eval("TRUE");
}
if (tBooleanCheck == "false") {
_local1 = eval("FALSE");
}
tTempObject[ti] = _local1;
}
var tChildNode = _local2.firstChild;
if ((tChildNode != null) && (tChildNode.nodeType == 3)) {
tTempObject._value = tChildNode.nodeValue;
}
if (iStructure[_local3] == null) {
iStructure[_local3] = tTempObject;
} else if (iStructure[_local3].length < 1) {
iStructure._type = "array";
var tOrigValue = iStructure[_local3];
iStructure[_local3] = new Array(tOrigValue);
iStructure[_local3].push(tTempObject);
} else {
iStructure[_local3].push(tTempObject);
}
}
_local2 = _local2.nextSibling;
}
return(iStructure);
};
Object.Tools.getRandomProperty = function (iArray) {
var _local1 = iArray;
var tHashKey = [];
for (var ti in _local1) {
tHashKey.push({index:ti, value:_local1[ti]});
}
var tValueAndIndex = tHashKey[Math.floor(Math.random() * tHashKey.length)];
return(tValueAndIndex);
};
Object.Tools.getPropsCount = function (iObject) {
var _local3 = iObject;
var _local1 = 0;
for (var _local2 in _local3) {
_local1++;
}
return(_local1);
};
Object.Tools.combineProps = function (iObjects) {
var _local3 = iObjects;
var _local2 = {};
for (var tiObject in _local3) {
var _local1 = _local3[tiObject];
for (var tiName in _local1) {
_local2[tiName] = _local1[tiName];
}
}
return(_local2);
};
var o = ((Object.Tools.AttacherXL = {}));
o._clipMastersList = ["zip", "nada"];
o.attach = function (iArgs) {
var _local2 = iArgs;
var _local1 = new this.Class._attachedClipMaster(_local2);
this._cleanupClipMastersList();
this._clipMastersList.push(_local1);
var _local3 = _local1.attached_mc;
return(_local3);
};
o._storeClipMaster = function (iArgs) {
var _local1 = iArgs.clipMaster;
this._clipMastersList.push(_local1);
};
o._cleanupClipMastersList = function () {
var _local2 = this._clipMastersList;
var _local3 = [];
for (var ti in _local2) {
var _local1 = _local2[ti];
if (_local1.expired == false) {
_local3.push(_local1);
}
}
this._clipMastersList = _local3;
};
o.Class = {};
o.Class._attachedClipMaster = function (iArgs) {
var tParent_mc = iArgs.parent_mc;
var tLibraryName = iArgs.libraryName;
var tNewName = iArgs.newName;
var tLayer = iArgs.layer;
var tInitObj = iArgs.initObj;
var tLifeSpan = iArgs.lifeSpan;
var _local3 = iArgs.frame;
var tStop = iArgs.stop;
var tSubClipFrames = iArgs.subClipFrames;
var tAttached_mc = tParent_mc.attachMovie(tLibraryName, tNewName, tLayer, tInitObj);
if (tStop) {
tAttached_mc.gotoAndStop(_local3);
} else {
tAttached_mc.gotoAndPlay(_local3);
}
for (var ti in tSubClipFrames) {
var _local1 = tSubClipFrames[ti];
var _local2 = _local1.name;
_local3 = _local1.frame;
var tStop = _local1.stop;
if (tStop) {
tAttached_mc[_local2].gotoAndStop(_local3);
} else {
tAttached_mc[_local2].gotoAndStop(_local3);
}
}
this.attached_mc = tAttached_mc;
this.expired = false;
this._timerId = 0;
if (tLifeSpan > 0) {
this._removeClip = function () {
var _local1 = this;
_local1.attached_mc.removeMovieClip();
_local1.expired = true;
clearInterval(_local1._timerId);
};
this._timerId = setInterval(this, "_removeClip", tLifeSpan);
}
};
delete o;
Object.Tools.Math = {};
Object.Tools.Math.constrain = function (iArgs) {
var _local2 = iArgs.min;
var _local3 = iArgs.max;
var _local1 = iArgs.num;
_local1 = ((_local1 > _local3) ? (_local3) : (_local1));
_local1 = ((_local1 < _local2) ? (_local2) : (_local1));
return(_local1);
};
Object.Tools.Math.isPointInRect = function (iArgs) {
var _local2 = iArgs.point;
var _local1 = iArgs.rect;
if ((((_local2.x >= _local1.xMin) && (_local2.x <= _local1.xMax)) && (_local2.y >= _local1.yMin)) && (_local2.y <= _local1.yMax)) {
return(true);
}
return(false);
};
Object.Tools.Math.matchPointInRange = function (iArgs) {
var _local2 = iArgs.rangeA;
var _local1 = iArgs.rangeB;
var tPointInA = iArgs.point;
var tRangeADelta = (_local2[1] - _local2[0]);
var _local3 = _local1[1] - _local1[0];
var tRangeBMin = _local1[0];
var tRangeAMin = _local2[0];
var tPointAInDelta = (tPointInA - tRangeAMin);
var tRangeARatio = (tPointAInDelta / tRangeADelta);
var tPointInB = Math.round((_local3 * tRangeARatio) + tRangeBMin);
return(tPointInB);
};
Object.Tools.Inuyasha = {};
Object.Tools.Inuyasha.generateMoveLabelName = function (iArgs) {
var tMoveId = iArgs.moveId;
var _local3 = iArgs.characterId;
var _local1 = tMoveId;
var _local2 = _local1.substr(0, 1).toUpperCase();
var tRestOfWord = _local1.substr(1);
_local1 = (_local3 + _local2) + tRestOfWord;
return(_local1);
};
var c = ((Object.$POP.Class.EventManager = function () {
this._sl = [];
this._lastID = 0;
}));
var p = c.prototype;
p.subscribe = function (iArgs) {
var _local2 = iArgs.listener;
var _local1 = this._lastID++;
this._sl.push([_local1, _local2]);
return(_local1);
};
p.remove = function (iArgs) {
var _local1 = this;
var _local2 = iArgs.id;
for (var _local3 in _local1._sl) {
if (_local1._sl[_local3][0] == _local2) {
_local1._sl.splice(_local3, 1);
}
}
};
p.broadcast = function (iArgs) {
var _local1 = this;
var _local3 = iArgs.event;
var _local2 = iArgs.args;
for (var ti in _local1._sl) {
_local1._sl[ti][1][_local3](_local2);
}
};
delete p;
delete c;
var c = ((Object.$POP.Class.MovesImpactComputer = function () {
}));
p = c.prototype;
p.computeMovesImpact = function (iArgs) {
var tPlayers = iArgs.players;
var tMap = iArgs.map;
var tPlayersMoves = iArgs.moves;
var tTurnSummary = {deadPlayers:[], winner:0, matchResult:"none", players:[{name:"", characterId:"", life:999, energy:999, loc:[], oldLoc:[], facing:0, gotHitType:"miss", move:{name:"", id:"", type:"", impactLocs:[]}}, {move:{}}]};
for (var tiPlayer in tPlayersMoves) {
var _local1 = tPlayers[tiPlayer];
var _local3 = tTurnSummary.players[tiPlayer];
var _local2 = tPlayersMoves[tiPlayer];
if ((_local1.energy + _local2.userImpact.energyDiff) >= 0) {
var tCurrentLoc = Object.Tools.copyObject(_local1.loc);
var tNewLoc = [_local1.loc[0] + _local2.userImpact.locDiff[0], _local1.loc[1] + _local2.userImpact.locDiff[1]];
if (tNewLoc[0] < 0) {
tNewLoc[0] = 0;
} else if (tNewLoc[0] > (tMap.length - 1)) {
tNewLoc[0] = tMap.length - 1;
}
if (tNewLoc[1] < 0) {
tNewLoc[1] = 0;
} else if (tNewLoc[1] > (tMap[0].length - 1)) {
tNewLoc[1] = tMap[0].length - 1;
}
_local3.oldLoc = Object.Tools.copyObject(tCurrentLoc);
_local1.loc = Object.Tools.copyObject(tNewLoc);
}
}
for (var tiPlayer in tPlayers) {
var _local1 = tPlayers[tiPlayer];
var _local2 = tPlayersMoves[tiPlayer];
var tThemIndex = ((tiPlayer == 0) ? 1 : 0);
var tThem = tPlayers[tThemIndex];
var tThemMove = tPlayersMoves[tThemIndex];
var tLifeModByThem = 0;
var tEnergyModByThem = 0;
var tGotHitType = "miss";
if (tThemMove.target == "enemy") {
if ((tThem.energy + tThemMove.userImpact.energyDiff) >= 0) {
if (this.isHit({map:tMap, attacker:tThem, receiver:_local1, effectRange:tThemMove.enemyImpact.effectArea})) {
tGotHitType = "hit";
tEnergyModByThem = tThemMove.enemyImpact.energyDiff;
if (tThemMove.enemyImpact.lifeDiff < 0) {
if ((_local1.energy + _local2.userImpact.energyDiff) >= 0) {
if (_local2.userImpact.protection > 0) {
tGotHitType = "guard";
}
if (Math.abs(tThemMove.enemyImpact.lifeDiff) < _local2.userImpact.protection) {
tLifeModByThem = 0;
} else {
tLifeModByThem = tThemMove.enemyImpact.lifeDiff + _local2.userImpact.protection;
}
}
} else {
tLifeModByThem = tThemMove.enemyImpact.lifediff;
}
}
}
}
if ((_local1.energy + _local2.userImpact.energyDiff) >= 0) {
var tLifeModByUs = _local2.userImpact.lifeDiff;
var tEnergyModByUs = _local2.userImpact.energyDiff;
} else {
var tLifeModByUs = 0;
var tEnergyModByUs = 0;
}
var tNewLife = ((_local1.life + tLifeModByThem) + tLifeModByUs);
var tNewEnergy = ((_local1.energy + tEnergyModByThem) + tEnergyModByUs);
var tLifeMax = _local1.lifeMax;
var tEnergyMax = _local1.energyMax;
if (tNewLife > tLifeMax) {
tNewLife = tLifeMax;
}
if (tNewLife < 0) {
tNewLife = 0;
}
if (tNewEnergy > tEnergyMax) {
tNewEnergy = tEnergyMax;
}
if (tNewEnergy < 0) {
tNewEnergy = 0;
}
var _local3 = tTurnSummary.players[tiPlayer];
_local3.name = _local1.name;
_local3.characterId = _local1.characterId;
_local3.life = tNewLife;
_local3.energy = tNewEnergy;
_local3.loc = _local1.loc;
_local3.gotHitType = tGotHitType;
_local3.move.name = _local2.name;
_local3.move.id = _local2.id;
_local3.move.type = _local2.type;
_local3.move.depthMod = _local2.depthMod;
_local3.move.impactLocs = this._findAttackLocs({attacker:_local1, effectRange:_local2.enemyImpact.effectArea, map:tMap});
}
for (var tIplayer in tPlayers) {
var tPlayer = tPlayers[tIplayer];
tPlayer.life = tTurnSummary.players[tIplayer].life;
tPlayer.energy = tTurnSummary.players[tIplayer].energy;
}
var tDeadPlayers = [];
for (var tIplayer in tPlayers) {
var tPlayer = tPlayers[tIplayer];
if (tPlayer.life <= 0) {
tDeadPlayers.push(tIplayer);
}
}
tTurnSummary.deadPlayers = tDeadPlayers;
if (tDeadPlayers.length == 1) {
tTurnSummary.matchResult = "win";
tTurnSummary.winner = ((tDeadPlayers[0] == 0) ? 1 : 0);
} else if (tDeadPlayers.length == 2) {
tTurnSummary.matchResult = "tie";
}
return(tTurnSummary);
};
p.isHit = function (iArgs) {
var tMap = iArgs.map;
var tAttacker = iArgs.attacker;
var tReceiver = iArgs.receiver;
var tEffectRange = iArgs.effectRange;
var _local2 = this._findAttackLocs({map:tMap, attacker:tAttacker, effectRange:tEffectRange});
var _local3 = tReceiver.loc;
for (var ti in _local2) {
var _local1 = _local2[ti];
if ((_local1[0] == _local3[0]) && (_local1[1] == _local3[1])) {
return(true);
}
}
return(false);
};
p._findAttackLocs = function (iArgs) {
var tAttacker = iArgs.attacker;
var tEffectRange = iArgs.effectRange;
var tMap = iArgs.map;
var tAttackerLoc = tAttacker.loc;
var tAttackLocs = [];
for (var tiRow in tEffectRange) {
var tRow = tEffectRange[tiRow];
for (var _local2 in tRow) {
if (tRow[_local2] == 1) {
var tYOffset = (tiRow - ((tEffectRange.length - 1) / 2));
var tXOffset = (_local2 - ((tRow.length - 1) / 2));
var _local1 = [tAttackerLoc[0] + tYOffset, tAttackerLoc[1] + tXOffset];
if (tMap[_local1[0]][_local1[1]] != undefined) {
tAttackLocs.push(_local1);
}
}
}
}
var tiRow = 0;
while (tiRow < tMap.length) {
var tRow = tMap[tiRow];
var _local3 = "";
var _local2 = 0;
while (_local2 < tRow.length) {
var tOnMap = false;
for (var tiLoc in tAttackLocs) {
var _local1 = tAttackLocs[tiLoc];
if ((_local1[0] == tiRow) && (_local1[1] == _local2)) {
tOnMap = true;
}
}
if (tOnMap) {
_local3 = _local3 + "X";
} else {
_local3 = _local3 + "0";
}
_local2++;
}
tiRow++;
}
return(tAttackLocs);
};
delete c;
delete p;
Object.$POP.translateLoadedPrefs = function (iArgs) {
var tXMLPrefs = iArgs.prefs;
var tMovesData = [];
var tMoveNodes = tXMLPrefs.firstChild.childNodes;
for (var tiMove in tMoveNodes) {
var tMoveNode = tMoveNodes[tiMove];
var _local2 = {userImpact:{}, enemyImpact:{}};
_local2.name = tMoveNode.attributes.NAME;
_local2.target = tMoveNode.attributes.TARGET;
_local2.compatibleCharacters = tMoveNode.attributes.CHARACTERS.split(",");
_local2.type = tMoveNode.attributes.TYPE;
_local2.id = tMoveNode.attributes.ID;
_local2.advanced = ((tMoveNode.attributes.ADVANCED == 1) ? true : false);
_local2.depthMod = Number(tMoveNode.attributes.DEPTH);
var tImpactNodes = tMoveNode.childNodes;
for (var tiImpact in tImpactNodes) {
var _local3 = tImpactNodes[tiImpact];
if (_local3.nodeName == "USERIMPACT") {
var tLocAsArray = _local3.attributes.LOC.split(",");
for (var tiLoc in tLocAsArray) {
tLocAsArray[tiLoc] = Number(tLocAsArray[tiLoc]);
}
_local2.userImpact.energyDiff = Number(_local3.attributes.ENERGY);
_local2.userImpact.locDiff = tLocAsArray;
_local2.userImpact.lifeDiff = Number(_local3.attributes.LIFE);
_local2.userImpact.protection = Number(_local3.attributes.PROTECTION);
} else {
var tEffectAreaAsArray = _local3.attributes.AREA.split("_");
for (var tiRow in tEffectAreaAsArray) {
var _local1 = tEffectAreaAsArray[tiRow];
_local1 = _local1.split(",");
for (var tiColumn in _local1) {
_local1[tiColumn] = Number(_local1[tiColumn]);
}
tEffectAreaAsArray[tiRow] = _local1;
}
_local2.enemyImpact.effectArea = tEffectAreaAsArray;
_local2.enemyImpact.lifeDiff = Number(_local3.attributes.LIFE);
}
}
tMovesData.push(_local2);
}
return(tMovesData);
};
var c = ((Object.$POP.Class.ComputerBrain = function () {
this.em = new Object.$POP.Class.EventManager();
}));
var p = c.prototype;
p.init = function (iArgs) {
var _local1 = this;
var _local2 = iArgs;
_local1._movesMax = _local2.movesMax;
_local1._map = _local2.map;
_local1._movesImpactComputer = _local2.movesImpactComputer;
_local1._dumper("version 0");
_local1._dx = [-1, 0, 1, -1, 0, 1, -1, 0, 1];
_local1._dy = [-1, -1, -1, 0, 0, 0, 1, 1, 1];
};
p.pickMoves = function (iArgs) {
var _local3 = this;
_local3._dumper_clear();
var tHumanPlayer = iArgs.human;
var tComputerPlayer = iArgs.computer;
var tMovesMax = _local3._movesMax;
var tMovesImpactComputer = _local3._movesImpactComputer;
var tMap = _local3._map;
var tHumanLoc = tHumanPlayer.loc;
var tHumanEnergy = tHumanPlayer.energy;
var tHumanHealth = tHumanPlayer.life;
var tHumanRoundMoves = tHumanPlayer.roundMoves;
var tHumanAvailableMoves = tHumanPlayer.moves;
var tComputerLoc = tComputerPlayer.loc;
var tComputerEnergy = tComputerPlayer.energy;
var tComputerHealth = tComputerPlayer.life;
var tComputerRoundMoves = tComputerPlayer.roundMoves;
var tComputerAvailableMoves = tComputerPlayer.moves;
var _local2 = new Object();
_local2.board_width = 4;
_local2.board_height = 3;
_local2.max_life = 100;
_local2.max_energy = 100;
_local2.human_loc_x = tHumanLoc[1];
_local2.human_loc_y = tHumanLoc[0];
_local2.human_life = tHumanHealth;
_local2.human_energy = tHumanEnergy;
_local2.computer_loc_x = tComputerLoc[1];
_local2.computer_loc_y = tComputerLoc[0];
_local2.computer_life = tComputerHealth;
_local2.computer_energy = tComputerEnergy;
_local2.computer_available = new Array();
for (var _local1 in tComputerAvailableMoves) {
_local2.computer_available.push(tComputerAvailableMoves[_local1]);
}
var tStrategyArgs = new Object();
tStrategyArgs.state = _local2;
tStrategyArgs.human_moves = tHumanRoundMoves;
tStrategyArgs.round_length = tMovesMax;
if (Object.$POP.Prefs.easyWin) {
var tOut = _local3._killComputerStrategy(tStrategyArgs);
} else if (Object.$POP.Prefs.difficulty == "normal") {
var tRandom = Math.random();
if (tRandom < 0.5) {
var tOut = _local3._karlStrategy(tStrategyArgs);
} else if (tRandom < 0.65) {
var tOut = _local3._avoidHumanStrategy(tStrategyArgs);
} else if (tRandom < 0.85) {
var tOut = _local3._killHumanStrategy(tStrategyArgs);
} else {
var tOut = _local3._kindaKillComputerStrategy(tStrategyArgs);
}
} else {
var tRandom = Math.random();
if (tRandom < 0.5) {
var tOut = _local3._karlStrategy(tStrategyArgs);
} else if (tRandom < 0.65) {
var tOut = _local3._avoidHumanStrategy(tStrategyArgs);
} else if (tRandom < 0.9) {
var tOut = _local3._killHumanStrategy(tStrategyArgs);
} else {
var tOut = _local3._kindaKillComputerStrategy(tStrategyArgs);
}
}
var _local1 = 0;
while (_local1 < tOut.length) {
_local3._dumper_line((("move " + _local1) + ": ") + tOut[_local1].name);
_local1++;
}
tStrategyArgs.computer_moves = tOut;
if (_local3._isTied(tStrategyArgs)) {
return(_local3._avoidHumanStrategy(tStrategyArgs));
}
return(tOut);
};
p._isTied = function (iArgs) {
var _local3 = this;
return(false);
};
p._computerLifeLow = function (iState) {
var _local1 = iState;
return(((_local1.human_life - _local1.computer_life) > 20) || (_local1.computer_life < 20));
};
p._karlStrategy = function (iArgs) {
var _local2 = this;
_local2._dumper_line("karlStrategy");
var _local1 = _local2._copyState(iArgs.state);
var tOut = new Array();
var _local3;
if (_local2._computerLifeLow(_local1)) {
var ti = 0;
while (ti < iArgs.round_length) {
_local2._dumper_line("move " + ti);
_local1.human_move = null;
_local1.human_move_next = null;
_local3 = _local2._getOutcomes(_local1);
_local1.computer_move = ((ti == 0) ? (_local2._getAvoidOrKillHumanMove(_local1, _local3)) : (((ti == 1) ? (_local2._getWideAttackMove(_local1, _local3)) : (_local2._getGuardMove(_local1, _local3)))));
tOut.push(_local1.computer_move);
_local1 = _local2._battle(_local1);
ti++;
}
} else {
var ti = 0;
while (ti < iArgs.round_length) {
_local2._dumper_line("move " + ti);
_local1.human_move = null;
_local1.human_move_next = null;
_local3 = _local2._getOutcomes(_local1);
_local1.computer_move = ((ti == 0) ? (_local2._getMaybeKillHumanMove(_local1, _local3)) : (((ti == 1) ? (_local2._getWideAttackMove(_local1, _local3)) : (_local2._getEnergyOrGuardMove(_local1, _local3)))));
tOut.push(_local1.computer_move);
_local1 = _local2._battle(_local1);
ti++;
}
}
return(tOut);
};
p._computerCanBackAway = function (iState) {
return(false);
};
p._noStrategy = function (iArgs) {
var _local2 = iArgs;
var tOut = new Array();
var _local3 = new Array();
var tDump = "";
for (var _local1 in _local2.state.computer_available) {
_local3.push(_local2.state.computer_available[_local1]);
}
this._shuffleArray(_local3);
var _local1 = 0;
while (_local1 < _local2.round_length) {
tOut.push(_local3.pop());
_local1++;
}
return(tOut);
};
p._killOrDieStrategy = function (iArgs) {
var _local1 = this;
_local1._dumper_line("killOrDieStrategy");
if (0.5 <= Math.random()) {
return(_local1._killComputerStrategy(iArgs));
}
return(_local1._killHumanStrategy(iArgs));
};
p._randomStrategy = function (iArgs) {
var _local3 = this;
_local3._dumper_line("randomStrategy");
var tOut = new Array();
var _local1 = _local3._copyState(iArgs.state);
var tOutcomes;
var _local2 = 0;
while (_local2 < iArgs.round_length) {
_local1.human_move = iArgs.human_moves[_local2];
_local1.human_move_next = iArgs.human_moves[_local2 + 1];
tOutcomes = _local3._getOutcomes(_local1);
_local1.computer_move = _local3._getAnyMove(_local1, tOutcomes);
tOut.push(_local1.computer_move);
_local1 = _local3._battle(_local1);
_local2++;
}
return(tOut);
};
p._meetHumanStrategy = function (iArgs) {
var _local3 = this;
_local3._dumper_line("meetHumanStrategy");
var tOut = new Array();
var _local1 = _local3._copyState(iArgs.state);
var tOutcomes;
var _local2 = 0;
while (_local2 < iArgs.round_length) {
_local3._dumper_line("move " + _local2);
_local1.human_move = iArgs.human_moves[_local2];
_local1.human_move_next = iArgs.human_moves[_local2 + 1];
tOutcomes = _local3._getOutcomes(_local1);
_local1.computer_move = _local3._getMeetHumanMove(_local1, tOutcomes);
tOut.push(_local1.computer_move);
_local1 = _local3._battle(_local1);
_local2++;
}
return(tOut);
};
p._avoidHumanStrategy = function (iArgs) {
var _local3 = this;
_local3._dumper_line("avoidHumanStrategy");
var tOut = new Array();
var _local1 = _local3._copyState(iArgs.state);
var tOutcomes;
var _local2 = 0;
while (_local2 < iArgs.round_length) {
_local3._dumper_line("move " + _local2);
_local1.human_move = iArgs.human_moves[_local2];
_local1.human_move_next = iArgs.human_moves[_local2 + 1];
tOutcomes = _local3._getOutcomes(_local1);
_local1.computer_move = _local3._getAvoidHumanMove(_local1, tOutcomes);
tOut.push(_local1.computer_move);
_local1 = _local3._battle(_local1);
_local2++;
}
return(tOut);
};
p._blindFollowStrategy = function (iArgs) {
var _local3 = this;
_local3._dumper_line("blindFollowStrategy");
var tOut = new Array();
var _local1 = _local3._copyState(iArgs.state);
var tOutcomes;
var _local2 = 0;
while (_local2 < iArgs.round_length) {
_local3._dumper_line("move " + _local2);
_local1.human_move = null;
_local1.human_move_next = null;
tOutcomes = _local3._getOutcomes(_local1);
_local1.computer_move = _local3._getMeetHumanMove(_local1, tOutcomes);
tOut.push(_local1.computer_move);
_local1 = _local3._battle(_local1);
_local2++;
}
return(tOut);
};
p._blindAttackStrategy = function (iArgs) {
var _local3 = this;
_local3._dumper_line("blindAttackStrategy");
var tOut = new Array();
var _local1 = _local3._copyState(iArgs.state);
var tOutcomes;
var _local2 = 0;
while (_local2 < iArgs.round_length) {
_local3._dumper_line("move " + _local2);
_local1.human_move = null;
_local1.human_move_next = null;
tOutcomes = _local3._getOutcomes(_local1);
_local1.computer_move = ((_local2 == 0) ? (_local3._getMeetHumanMove(_local1, tOutcomes)) : (_local3._getKillHumanMove(_local1, tOutcomes)));
tOut.push(_local1.computer_move);
_local1 = _local3._battle(_local1);
_local2++;
}
return(tOut);
};
p._killHumanStrategy = function (iArgs) {
var _local3 = this;
_local3._dumper_line("killHUmanStrategy");
var tOut = new Array();
var _local1 = _local3._copyState(iArgs.state);
var tOutcomes;
var _local2 = 0;
while (_local2 < iArgs.round_length) {
_local3._dumper_line("move " + _local2);
_local1.human_move = iArgs.human_moves[_local2];
_local1.human_move_next = iArgs.human_moves[_local2 + 1];
tOutcomes = _local3._getOutcomes(_local1);
_local1.computer_move = ((0 == _local2) ? (_local3._getMaybeKillHumanMove(_local1, tOutcomes)) : (_local3._getKillHumanMove(_local1, tOutcomes)));
tOut.push(_local1.computer_move);
_local3._dumper_line("chose move: " + _local1.computer_move.name);
_local1 = _local3._battle(_local1);
_local2++;
}
return(tOut);
};
p._killComputerStrategy = function (iArgs) {
var _local3 = this;
_local3._dumper_line("killComputerStrategy");
var tOut = new Array();
var _local1 = _local3._copyState(iArgs.state);
var tOutcomes;
var _local2 = 0;
while (_local2 < iArgs.round_length) {
_local3._dumper_line("move " + _local2);
_local1.human_move = iArgs.human_moves[_local2];
_local1.human_move_next = iArgs.human_moves[_local2 + 1];
tOutcomes = _local3._getOutcomes(_local1);
_local1.computer_move = _local3._getKillComputerMove(_local1, tOutcomes);
tOut.push(_local1.computer_move);
_local3._dumper_line("chose move: " + _local1.computer_move.name);
_local1 = _local3._battle(_local1);
_local2++;
}
return(tOut);
};
p._kindaKillComputerStrategy = function (iArgs) {
var _local3 = this;
_local3._dumper_line("kindaKillComputerStrategy");
var tOut = new Array();
var _local1 = _local3._copyState(iArgs.state);
var tOutcomes;
var _local2 = 0;
while (_local2 < iArgs.round_length) {
_local3._dumper_line("move " + _local2);
_local1.human_move = iArgs.human_moves[_local2];
_local1.human_move_next = iArgs.human_moves[_local2 + 1];
tOutcomes = _local3._getOutcomes(_local1);
if (((_local2 == 1) && (Math.random() > 0.75)) || (_local2 == 2)) {
_local1.computer_move = _local3._getWideAttackMove(_local1, tOutcomes);
tOut.push(_local1.computer_move);
_local3._dumper_line("chose move: " + _local1.computer_move.name);
_local1 = _local3._battle(_local1);
} else {
_local1.computer_move = _local3._getKillComputerMove(_local1, tOutcomes);
tOut.push(_local1.computer_move);
_local3._dumper_line("chose move: " + _local1.computer_move.name);
_local1 = _local3._battle(_local1);
}
_local2++;
}
return(tOut);
};
p._getAnyMove = function (iState, iOutcomes) {
this._dumper_line("getAnyMove");
return(iState.computer_available[Math.floor(Math.random() * (iState.computer_available.length + 1))]);
};
p._sortMeetHumanMove = function (a, b) {
var _local1 = b;
var _local2 = a;
if (_local2.distance >= _local1.distance) {
return(((_local2.distance > _local1.distance) ? 1 : (((_local2.energy > _local1.energy) ? -1 : (((_local2.energy < _local1.energy) ? 1 : (((_local2.magnitude < _local1.magnitude) ? -1 : (((_local2.magnitude > _local1.magnitude) ? 1 : 0))))))))));
}
return(-1);
};
p._sortAvoidHumanMove = function (a, b) {
var _local1 = b;
var _local2 = a;
if (_local2.distance <= _local1.distance) {
return(((_local2.distance < _local1.distance) ? 1 : (((_local2.energy > _local1.energy) ? -1 : (((_local2.energy < _local1.energy) ? 1 : (((_local2.magnitude < _local1.magnitude) ? -1 : (((_local2.magnitude > _local1.magnitude) ? 1 : 0))))))))));
}
return(-1);
};
p._getAvoidOrKillHumanMove = function (iState, iOutcomes) {
var _local3 = this;
_local3._dumper_line("getAvoidOrKillHumanMove");
var tDistance = _local3._getDistance(iState);
_local3._dumper_line("initial distance: " + tDistance);
var _local1 = new Array();
var _local2 = 0;
while (_local2 < iOutcomes.length) {
_local1.unshift(new Object());
_local1[0].move = iOutcomes[_local2].computer_move;
_local1[0].energy = iOutcomes[_local2].computer_energy;
_local1[0].distance = -_local3._getDistance(iOutcomes[_local2]);
_local1[0].magnitude = Math.abs(_local1[0].move.userImpact.locDiff[1]);
_local1[0].magnitude = _local1[0].magnitude + Math.abs(_local1[0].move.userImpact.locDiff[0]);
_local2++;
}
_local3._dumper_line("before:");
_local2 = 0;
while (_local2 < _local1.length) {
_local3._dumper_line((((_local2 + " meet: ") + _local1[_local2].distance) + " ") + _local1[_local2].move.name);
_local2++;
}
_local1.sort(_local3._sortMeetHumanMove);
_local3._dumper_line("after:");
_local2 = 0;
while (_local2 < _local1.length) {
_local3._dumper_line((((_local2 + " meet: ") + _local1[_local2].distance) + " ") + _local1[_local2].move.name);
_local2++;
}
if ((-_local1[0].distance) <= tDistance) {
return(_local3._getKillHumanMove(iState, iOutcomes));
}
return(_local1[0].move);
};
p._getMaybeMeetHumanMove = function (iState, iOutcomes) {
var _local3 = iOutcomes;
this._dumper_line("getMaybeMeetHumanMove");
var _local1 = new Array();
var _local2 = 0;
while (_local2 < _local3.length) {
_local1.unshift(new Object());
_local1[0].move = _local3[_local2].computer_move;
_local1[0].energy = _local3[_local2].computer_energy;
_local1[0].distance = this._getDistance(_local3[_local2]);
_local1[0].magnitude = Math.abs(_local1[0].move.userImpact.locDiff[1]);
_local1[0].magnitude = _local1[0].magnitude + Math.abs(_local1[0].move.userImpact.locDiff[0]);
if (_local1[0].magnitude < 1) {
_local1.shift();
}
_local2++;
}
this._dumper_line("before:");
_local2 = 0;
while (_local2 < _local1.length) {
this._dumper_line((_local2 + " meet: ") + _local1[_local2].move.name);
_local2++;
}
_local1.sort(this._sortMeetHumanMove);
this._dumper_line("after:");
_local2 = 0;
while (_local2 < _local1.length) {
this._dumper_line((_local2 + " meet: ") + _local1[_local2].move.name);
_local2++;
}
if (0.5 > Math.random()) {
return(_local1[0].move);
}
if (2 == _local1.length) {
return(_local1[1].move);
}
return(_local1[Math.floor((Math.random() * 2) + 1)].move);
};
p._getMeetHumanMove = function (iState, iOutcomes) {
var _local3 = iOutcomes;
this._dumper_line("getMeetHumanMove");
var _local1 = new Array();
var _local2 = 0;
while (_local2 < _local3.length) {
_local1.unshift(new Object());
_local1[0].move = _local3[_local2].computer_move;
_local1[0].energy = _local3[_local2].computer_energy;
_local1[0].distance = this._getDistance(_local3[_local2]);
_local1[0].magnitude = Math.abs(_local1[0].move.userImpact.locDiff[1]);
_local1[0].magnitude = _local1[0].magnitude + Math.abs(_local1[0].move.userImpact.locDiff[0]);
if (_local1[0].magnitude < 1) {
_local1.shift();
}
_local2++;
}
this._dumper_line("before:");
_local2 = 0;
while (_local2 < _local1.length) {
this._dumper_line((_local2 + " meet: ") + _local1[_local2].move.name);
_local2++;
}
_local1.sort(this._sortMeetHumanMove);
this._dumper_line("after:");
_local2 = 0;
while (_local2 < _local1.length) {
this._dumper_line((_local2 + " meet: ") + _local1[_local2].move.name);
_local2++;
}
return(_local1[0].move);
};
p._getAvoidHumanMove = function (iState, iOutcomes) {
var _local3 = iOutcomes;
this._dumper_line("getAvoidHumanMove");
var _local1 = new Array();
var _local2 = 0;
while (_local2 < _local3.length) {
if (_local3[_local2].human_dead || (_local3[_local2].computer_move.enemyImpact.lifeDiff)) {
} else {
_local1.unshift(new Object());
_local1[0].move = _local3[_local2].computer_move;
_local1[0].energy = _local3[_local2].computer_energy;
_local1[0].distance = this._getDistance(_local3[_local2]);
_local1[0].magnitude = Math.abs(_local1[0].move.userImpact.locDiff[1]);
_local1[0].magnitude = _local1[0].magnitude + Math.abs(_local1[0].move.userImpact.locDiff[0]);
if (_local1[0].magnitude < 1) {
_local1.shift();
}
}
_local2++;
}
this._dumper_line("before:");
_local2 = 0;
while (_local2 < _local1.length) {
this._dumper_line((_local2 + " avoid: ") + _local1[_local2].move.name);
_local2++;
}
_local1.sort(this._sortAvoidHumanMove);
this._dumper_line("after:");
_local2 = 0;
while (_local2 < _local1.length) {
this._dumper_line((_local2 + " avoid: ") + _local1[_local2].move.name);
_local2++;
}
return(_local1[0].move);
};
p._getWideAttackMove = function (iState, iOutcomes) {
var _local2 = this;
_local2._dumper_line("getWideAttackMove");
var tBestSquares = 0;
var tSquares = 0;
var tBestEffect = 0;
var tBestProtection = 0;
var tEffect = 0;
var tProtection = 0;
var tBestMove = iOutcomes[0].computer_move;
var _local3;
var _local1 = 0;
while (_local1 < iOutcomes.length) {
_local2._dumper_line("wide:" + iOutcomes[_local1].computer_move.name);
if (!iOutcomes[_local1].computer_moved) {
} else {
_local2._dumper_line("has enough energy");
_local3 = iOutcomes[_local1].computer_move;
tSquares = _local2._countSquares(iState, _local3);
if (tSquares < tBestSquares) {
} else {
_local2._dumper_line("most squares");
tEffect = -_local3.enemyImpact.lifeDiff;
if ((tSquares == tBestSquares) && (tEffect < tBestEffect)) {
} else {
_local2._dumper_line("and best effect");
tProtection = _local3.userImpact.protection;
if ((tEffect == tBestEffect) && (tProtection < tBestProtection)) {
} else {
_local2._dumper_line("and best protection");
tBestMove = _local3;
tBestSquares = tSquares;
tBestEffect = tEffect;
tBestProtection = tProtection;
}
}
}
}
_local1++;
}
if (tBestSquares <= 0) {
return(_local2._getEnergyOrGuardMove(iState, iOutcomes));
}
return(tBestMove);
};
p._getEnergyMove = function (iState, iOutcomes) {
this._dumper_line("getEnergyMove");
var tBestMove = iOutcomes[0].computer_move;
var tBestEffect = tBestMove.userImpact.energyDiff;
var _local2 = 0;
var _local3;
var _local1 = 0;
while (_local1 < iOutcomes.length) {
if (!iOutcomes[_local1].computer_moved) {
} else {
_local3 = iOutcomes[_local1].computer_move;
_local2 = _local3.userImpact.energyDiff;
if (_local2 < tBestEffect) {
} else {
tBestMove = _local3;
tBestEffect = _local2;
}
}
_local1++;
}
return(tBestMove);
};
p._humanInRange = function (iState, iOutcomes) {
var _local1 = iState;
if (Math.abs(_local1.computer_loc_x - _local1.human_loc_x) > 1) {
return(false);
}
if (Math.abs(_local1.computer_loc_y - _local1.human_loc_y) > 1) {
return(false);
}
return(true);
};
p._getGuardMove = function (iState, iOutcomes) {
this._dumper_line("getGuardMove");
if (!this._humanInRange(iState, iOutcomes)) {
return(this._getAvoidHumanMove(iState, iOutcomes));
}
var tBestMove = iOutcomes[0].computer_move;
var tBestEffect = tBestMove.userImpact.protection;
var tBestEnergy = tBestMove.userImpact.energyDiff;
var _local2 = 0;
var _local3;
var _local1 = 0;
while (_local1 < iOutcomes.length) {
if (!iOutcomes[_local1].computer_moved) {
} else {
_local3 = iOutcomes[_local1].computer_move;
_local2 = _local3.userImpact.protection;
if (_local2 < tBestEffect) {
} else {
tEnergy = _local3.userImpact.energyDiff;
if ((_local2 == tBestEffect) && (tEnergy < tBestEnergy)) {
} else {
tBestMove = _local3;
tBestEffect = _local2;
tBestEnergy = tEnergy;
}
}
}
_local1++;
}
return(tBestMove);
};
p._getEnergyOrGuardMove = function (iState, iOutcomes) {
var _local1 = this;
var _local2 = iState;
_local1._dumper_line("getEnergyOrGuardMove");
if (_local2.computer_energy >= 80) {
return(_local1._getGuardMove(_local2, iOutcomes));
}
return(_local1._getEnergyMove(_local2, iOutcomes));
};
p._countSquares = function (iState, iMove) {
var tOut = 0;
var _local2 = 0;
var _local1 = 0;
var tBoard = new Array();
_local2 = 0;
while (_local2 < 3) {
tBoard[_local2] = new Array();
_local1 = 0;
while (_local1 < 4) {
tBoard[_local2][_local1] = false;
_local1++;
}
_local2++;
}
_local2 = iState.human_loc_y - 1;
while (_local2 <= (iState.human_loc_y + 1)) {
this._dumper_line("\thy:\t" + _local2);
if ((_local2 < 0) || (_local2 >= 3)) {
} else {
_local1 = iState.human_loc_x - 1;
while (_local1 <= (iState.human_loc_x + 1)) {
this._dumper_line("\thx:\t" + _local1);
if ((_local2 < 0) || (_local2 >= 4)) {
} else {
tBoard[_local2][_local1] = true;
}
_local1++;
}
}
_local2++;
}
_local2 = -1;
while (_local2 <= 1) {
var cy = (iState.computer_loc_y + _local2);
this._dumper_line("\tcy:\t" + cy);
if ((cy < 0) || (cy >= 3)) {
} else {
_local1 = -1;
while (_local1 <= 1) {
var _local3 = iState.computer_loc_x + _local1;
this._dumper_line("\tcx:\t" + _local3);
if ((_local3 < 0) || (_local3 >= 4)) {
} else if (iMove.enemyImpact.effectArea[_local2 + 1][_local1 + 1] && (tBoard[cy][_local3])) {
this._dumper_line((("\tsquare: " + _local3) + " ") + cy);
tOut++;
}
_local1++;
}
}
_local2++;
}
this._dumper_line("squares: " + tOut);
return(tOut);
};
p._getMaybeKillHumanMove = function (iState, iOutcomes) {
var _local2 = iOutcomes;
this._dumper_line("getMaybeKillHumanMove");
var tBestDiff = (iState.human_life - _local2[0].human_life);
var tBestEnergy = _local2[0].computer_energy;
var tBestMove = _local2[0].computer_move;
var _local3;
var tEnergy;
var _local1 = 1;
while (_local1 < _local2.length) {
_local3 = iState.human_life - _local2[_local1].human_life;
this._dumper_line((((((_local2[_local1].computer_move.name + ": ") + iState.human_life) + " - ") + _local2[_local1].human_life) + " = ") + _local3);
if (_local3 > tBestDiff) {
this._dumper_line("best so far");
tBestDiff = _local3;
tBestMove = _local2[_local1].computer_move;
} else if (_local3 == tBestDiff) {
tEnergy = _local2[_local1].computer_energy;
if (tEnergy > tBestEnergy) {
tBestEnergy = tEnergy;
tBestDiff = _local3;
tBestMove = _local2[_local1].computer_move;
}
}
_local1++;
}
if (tBestDiff <= 0) {
return(this._getMaybeMeetHumanMove(iState, _local2));
}
return(tBestMove);
};
p._getKillHumanMove = function (iState, iOutcomes) {
var _local2 = iOutcomes;
this._dumper_line("getKillHumanMove");
var tBestDiff = (iState.human_life - _local2[0].human_life);
var tBestEnergy = _local2[0].computer_energy;
var tBestMove = _local2[0].computer_move;
var _local3;
var tEnergy;
var _local1 = 1;
while (_local1 < _local2.length) {
_local3 = iState.human_life - _local2[_local1].human_life;
this._dumper_line((((((_local2[_local1].computer_move.name + ": ") + iState.human_life) + " - ") + _local2[_local1].human_life) + " = ") + _local3);
if (_local3 > tBestDiff) {
this._dumper_line("best so far");
tBestDiff = _local3;
tBestMove = _local2[_local1].computer_move;
} else if (_local3 == tBestDiff) {
tEnergy = _local2[_local1].computer_energy;
if (tEnergy > tBestEnergy) {
tBestEnergy = tEnergy;
tBestDiff = _local3;
tBestMove = _local2[_local1].computer_move;
}
}
_local1++;
}
if (tBestDiff <= 0) {
return(this._getMeetHumanMove(iState, _local2));
}
return(tBestMove);
};
p._getKillComputerMove = function (iState, iOutcomes) {
var _local2 = iOutcomes;
this._dumper_line("getKillComputerMove");
var tBestDiff = (iState.computer_life - _local2[0].computer_life);
var tBestEnergy = _local2[0].computer_energy;
var tBestMove = _local2[0].computer_move;
var _local3;
var tEnergy;
var _local1 = 1;
while (_local1 < _local2.length) {
_local3 = iState.computer_life - _local2[_local1].computer_life;
this._dumper_line((((((_local2[_local1].computer_move.name + ": ") + iState.human_life) + " - ") + _local2[_local1].human_life) + " = ") + _local3);
if (_local3 > tBestDiff) {
this._dumper_line("best so far");
tBestDiff = _local3;
tBestMove = _local2[_local1].computer_move;
} else if (_local3 == tBestDiff) {
tEnergy = _local2[_local1].human_life;
if (tEnergy > tBestEnergy) {
tBestEnergy = tEnergy;
tBestDiff = _local3;
tBestMove = _local2[_local1].computer_move;
}
}
_local1++;
}
if (tBestDiff <= 0) {
return(this._getMeetHumanMove(iState, _local2));
}
return(tBestMove);
};
p._getDistance = function (iState) {
var _local3 = iState;
this._dumper_line("getDistance");
var _local2 = _local3.computer_loc_x - _local3.human_loc_x;
var _local1 = _local3.computer_loc_y - _local3.human_loc_y;
_local2 = _local2 * _local2;
_local1 = _local1 * _local1;
var d = Math.sqrt(_local2 + _local1);
return(d);
};
p._getOutcomes = function (iState) {
this._dumper_line("getOutcomes");
var tOut = new Array();
var _local1 = new Object();
var _local3 = this._copyState(iState);
var _local2 = 0;
while (_local2 < _local3.computer_available.length) {
_local3.computer_move = _local3.computer_available[_local2];
_local1 = this._battle(_local3);
if (((_local1.computer_moved && (!_local1.wall_walk)) && (!_local1.too_much_energy)) && ((0.5 > Math.random()) || (!_local1.double_move))) {
tOut.push(_local1);
}
_local2++;
}
return(tOut);
};
p._copyState = function (iState) {
var _local1 = iState;
var _local2 = new Object();
for (var _local3 in _local2) {
this._dumper_line("SHOULDN'T EXIST!!! " + _local3);
}
for (var _local3 in _local1) {
_local2[_local3] = _local1[_local3];
}
_local2.computer_available = new Array();
for (var _local3 in _local1.computer_available) {
_local2.computer_available[_local3] = _local1.computer_available[_local3];
}
return(_local2);
};
p._deleteOne = function (iArray, iItem) {
var _local2 = iArray;
var _local3 = iItem;
var _local1 = 0;
while (_local1 < _local2.length) {
if (_local2[_local1] == _local3) {
_local2.splice(_local1, 1);
return;
}
_local1++;
}
};
p._shuffleArray = function (iArgs) {
var _local2 = iArgs;
var temp;
var _local3;
var _local1 = _local2.length;
while (_local1-- , _local1 > 0) {
_local3 = Math.floor(Math.random() * (_local1 + 1));
if (_local1 == _local3) {
} else {
temp = _local2[_local1];
_local2[_local1] = _local2[_local3];
_local2[_local3] = temp;
}
}
};
p._battle = function (iArgs) {
var _local3 = iArgs;
var _local1 = this._copyState(_local3);
this._deleteOne(_local1.computer_available, _local1.computer_move);
_local1.wall_walk = false;
_local1.double_move = false;
if ((Math.abs(_local3.computer_move.userImpact.locDiff[0]) > 1) || (Math.abs(_local3.computer_move.userImpact.locDiff[1]) > 1)) {
this._dumper_line("doule move!");
_local1.double_move = true;
}
_local1.computer_loc_x = _local1.computer_loc_x + _local3.computer_move.userImpact.locDiff[1];
if (_local1.computer_loc_x < 0) {
_local1.computer_loc_x = 0;
_local1.wall_walk = true;
} else if (_local1.computer_loc_x >= _local3.board_width) {
_local1.computer_loc_x = _local3.board_width - 1;
_local1.wall_walk = true;
}
_local1.computer_loc_y = _local1.computer_loc_y + _local3.computer_move.userImpact.locDiff[0];
if (_local1.computer_loc_y < 0) {
_local1.computer_loc_y = 0;
_local1.wall_walk = true;
} else if (_local1.computer_loc_y >= _local3.board_height) {
_local1.computer_loc_y = _local3.board_height - 1;
_local1.wall_walk = true;
}
_local1.human_loc_x = _local1.human_loc_x + _local3.human_move.userImpact.locDiff[1];
if (_local1.human_loc_x < 0) {
_local1.human_loc_x = 0;
} else if (_local1.human_loc_x >= _local3.board_width) {
_local1.human_loc_x = _local3.board_width - 1;
}
_local1.human_loc_y = _local1.human_loc_y + _local3.human_move.userImpact.locDiff[0];
if (_local1.human_loc_y < 0) {
_local1.human_loc_y = 0;
} else if (_local1.human_loc_y >= _local3.board_height) {
_local1.human_loc_y = _local3.board_height - 1;
}
var tSelves = ["human", "computer"];
var tOthers = ["computer", "human"];
var tProtection = new Object();
var tMoved = new Object();
_local1.too_much_energy = false;
if ((_local3.computer_move.userImpact.energyDiff > 0) && (_local3.computer_energy >= 100)) {
_local1.too_much_energy = true;
}
var ti = 0;
while (ti < 2) {
var tSelf = tSelves[ti];
var tMove = _local3[tSelf + "_move"].userImpact;
_local1.dump = ((((tSelf + " ") + tMove.energyDiff) + " ") + _local1[tSelf + "_energy"]) + newline;
if (_local1[tSelf + "_energy"] < (-tMove.energyDiff)) {
tMoved[tSelf] = false;
} else {
tMoved[tSelf] = true;
_local1[tSelf + "_energy"] = _local1[tSelf + "_energy"] + tMove.energyDiff;
if (_local1[tSelf + "_energy"] > _local3.max_energy) {
_local1[tSelf + "_energy"] = _local3.max_energy;
}
_local1[tSelf + "_life"] = _local1[tSelf + "_life"] + tMove.lifeDiff;
if (_local1[tSelf + "_life"] <= 0) {
_local1[tSelf + "_dead"] = true;
_local1.dead = true;
}
tProtection[tSelf] = tMove.protection;
}
ti++;
}
if (_local1.computer_dead && (_local1.human_dead)) {
_local1.tie = true;
}
for (var ti in tMoved) {
_local1[ti + "_moved"] = tMoved[ti];
}
var ti = 0;
while (ti < 2) {
var tSelf = tSelves[ti];
if (!tMoved[tSelf]) {
} else {
var tOther = tOthers[ti];
var tMove = _local3[tSelf + "_move"].enemyImpact;
if (tMove.lifeDiff == 0) {
} else if ((tMove.lifeDiff + tProtection[tOther]) >= 0) {
} else {
var _local2 = 0;
while (_local2 < 9) {
if ((tMove.effectArea[Math.floor(_local2 / 3)][_local2 % 3] && ((_local1[tSelf + "_loc_x"] + this._dx[_local2]) == _local1[tOther + "_loc_x"])) && ((_local1[tSelf + "_loc_y"] + this._dy[_local2]) == _local1[tOther + "_loc_y"])) {
_local1[tOther + "_life"] = _local1[tOther + "_life"] + tProtection[tOther];
_local1[tOther + "_life"] = _local1[tOther + "_life"] + tMove.lifeDiff;
break;
}
_local2++;
}
}
}
ti++;
}
var ti = 0;
while (ti < 2) {
var tSelf = tSelves[ti];
if (_local1[tSelf + "_life"] > _local3.max_life) {
_local1[tSelf + "_life"] = _local3.max_life;
}
ti++;
}
var tDump = "";
for (var ti in _local3.computer_move) {
tDump = tDump + (((ti + ":\t") + _local3.computer_move[ti]) + newline);
}
for (var ti in _local3.computer_move.userImpact) {
tDump = tDump + (((ti + ":\t") + _local3.computer_move.userImpact[ti]) + newline);
}
for (var ti in _local3.computer_move.userImpact.effectArea) {
tDump = tDump + (((ti + ":\t") + _local3.computer_move.userImpact.effectArea[ti]) + newline);
}
for (var ti in _local1) {
tDump = tDump + (((ti + ":\t") + _local1[ti]) + newline);
}
this._dumper_line(tDump);
return(_local1);
};
p._dumper_clear = function () {
_root.dumper = "";
};
p._dumper_line = function (iStr) {
};
p._dumper = function (iArgs) {
_root.dumper = iArgs;
};
delete p;
delete c;
var c = ((Object.$POP.Class.RoundSequenceComputer = function () {
}));
var p = c.prototype;
p.init = function (iArgs) {
this._players = [];
this._ambientAudio = "battle";
};
p.makeRoundSequence = function (iArgs) {
var _local2 = this;
var tRoundSummary = iArgs.roundSummary;
var tPlayers = iArgs.players;
var tAmbientAudio = _local2._ambientAudio;
var tTurnsSummary = tRoundSummary.turns;
var tTurnsCount = tRoundSummary.turnsCount;
var tMatchResult = tRoundSummary.matchResult;
var tWinner = tRoundSummary.winner;
_local2._players = tPlayers;
var _local1 = (_local2._roundSequence = []);
var tFightStartAudio = _local2._makeSoundObject({id:"beginRound"});
_local1.push([tFightStartAudio]);
var tIturn = 0;
while (tIturn < tTurnsCount) {
var _local3 = tTurnsSummary[tIturn];
var tTurnNum = (tiTurn + 1);
var tIsLastTurn = (tTurnNum >= tTurnsCount);
_local2._addContinueButton({roundSequence:_local1, turnSummary:_local3, isLastTurn:tIsLastTurn, state:"inactive"});
_local2._addPlayersAmbient({roundSequence:_local1, turnSummary:_local3});
_local2._addShowCards({roundSequence:_local1, turnSummary:_local3, turnNum:tTurnNum});
_local2._addPlayersMoves({roundSequence:_local1, turnSummary:_local3});
_local2._addStatusDisplayUpdate({roundSequence:_local1, turnSummary:_local3});
if (tIsLastTurn) {
if (tMatchResult == "none") {
_local2._addContinueButton({roundSequence:_local1, turnSummary:_local3, isLastTurn:tIsLastTurn, state:"active"});
_local2._addStopAudio({roundSequence:_local1});
} else {
_local2._addMatchResultMisc({roundSequence:_local1, turnSummary:_local3, roundSummary:tRoundSummary});
_local2._addStopAudio({roundSequence:_local1});
}
}
tIturn++;
}
return(_local1);
};
p._addToRoundSequence = function (iArgs) {
this._roundSequence.push(iArgs.step);
};
p._addStopAudio = function (iArgs) {
var _local2 = iArgs.roundSequence;
var _local1 = this._ambientAudio;
var _local3 = this._makeSoundObject({id:_local1, stop:true});
_local2.push([_local3]);
};
p._addContinueButton = function (iArgs) {
var _local2 = iArgs;
var tRoundSequence = _local2.roundSequence;
var tTurnSummary = _local2.turnSummary;
var tIsLastTurn = _local2.isLastTurn;
var _local1 = _local2.state;
if (tIsLastTurn) {
var _local3 = [{moveType:"showContinueButton", continueType:"round", state:_local1}];
} else {
var _local3 = [{moveType:"showContinueButton", continueType:"turn", state:_local1}];
}
tRoundSequence.push(_local3);
};
p._addStatusDisplayUpdate = function (iArgs) {
var _local2 = iArgs.roundSequence;
var _local3 = iArgs.turnSummary;
var _local1 = [{moveType:"updatePlayerStatusBar", playersStatus:_local3}];
_local2.push(_local1);
};
p._addMatchResultMisc = function (iArgs) {
var tRoundSequence = iArgs.roundSequence;
var tRoundSummary = iArgs.roundSummary;
var _local2 = iArgs.turnSummary;
var tMatchResult = tRoundSummary.matchResult;
var tWinner = tRoundSummary.winner;
if ((tMatchResult == "win") && (tWinner == 0)) {
var tSoundTrack = this._makeSoundObject({id:"themeSong", loops:99999, playNice:true});
} else {
var tSoundTrack = this._makeSoundObject({id:"youDie", loops:99999});
}
tRoundSequence.push([tSoundTrack]);
if (tMatchResult == "win") {
var tLoserId = this._findEnemyId({playerId:tWinner});
var tWinnerMove = this._makeActionObject({playerId:tWinner, turnSummary:_local2, moveId:"victory", doneActionId:"stop", requireDone:false});
var _local1 = this._makeActionObject({playerId:tLoserId, turnSummary:_local2, moveId:"defeat", doneActionId:"stop", requireDone:false});
tRoundSequence.push([_local1, tWinnerMove]);
var tWinnerMessage = {moveType:"matchOverMessage", playerId:tWinner, characterId:this._findCharacterId({playerId:tWinner}), isTie:false};
tRoundSequence.push([tWinnerMessage]);
} else if (tMatchResult == "tie") {
for (var tPlayerId in _local2) {
var _local1 = this._makeActionObject({playerId:tPlayerId, turnSummary:_local2, moveId:"defeat", doneActionId:"stop", requireDone:false});
tRoundSequence.push([_local1]);
}
var tTieMessage = {moveType:"matchOverMessage", isPlayerWinner:false, isTie:true};
tRoundSequence.push([tTieMessage]);
}
};
p._addPlayersMoves = function (iArgs) {
var tRoundSequence = iArgs.roundSequence;
var _local2 = iArgs.turnSummary;
var tGuarders = [];
var tAttackers = [];
var tMovers = [];
var tEnergyUpers = [];
var tHealers = [];
for (var tIplayer in _local2) {
var _local3 = _local2[tIplayer];
var _local1 = _local3.move.type;
if (_local1 == "guard") {
tGuarders.push(tIplayer);
} else if (_local1 == "action") {
tAttackers.push(tIplayer);
} else if (_local1 == "location") {
tMovers.push(tIplayer);
} else if (_local1 == "energyUp") {
tEnergyUpers.push(tIplayer);
} else if (_local1 == "heal") {
tHealers.push(tIplayer);
}
}
if (tGurarders.length == 2) {
this._addGenericPlayersMoves({roundSequence:tRoundSequence, turnSummary:_local2});
} else if (tMovers.length == 2) {
this._addMoveAndMove({roundSequence:tRoundSequence, turnSummary:_local2});
} else if (tAttackers.length == 2) {
this._addGenericPlayersMoves({roundSequence:tRoundSequence, turnSummary:_local2});
} else if (tEnergyUpers.length == 2) {
this._addGenericPlayersMoves({roundSequence:tRoundSequence, turnSummary:_local2});
} else if (tHealers.length == 2) {
this._addGenericPlayersMoves({roundSequence:tRoundSequence, turnSummary:_local2});
} else if ((tMovers.length == 1) && (tAttackers.length == 1)) {
this._addMoveAndOther({roundSequence:tRoundSequence, turnSummary:_local2, moverId:tMovers[0]});
} else if ((tMovers.length == 1) && (tEnergyUpers.length == 1)) {
this._addMoveAndOther({roundSequence:tRoundSequence, turnSummary:_local2, moverId:tMovers[0]});
} else if ((tMovers.length == 1) && (tHealers.length == 1)) {
this._addMoveAndOther({roundSequence:tRoundSequence, turnSummary:_local2, moverId:tMovers[0]});
} else if ((tMovers.length == 1) && (tGuarders.length == 1)) {
this._addMoveAndOther({roundSequence:tRoundSequence, turnSummary:_local2, moverId:tMovers[0]});
} else if ((tGuarders.length == 1) && (tAttackers.length == 1)) {
this._addGuardAndOther({roundSequence:tRoundSequence, turnSummary:_local2, guarderId:tGuarders[0]});
} else if ((tGuarders.length == 1) && (tEnergyUpers.length == 1)) {
this._addGuardAndOther({roundSequence:tRoundSequence, turnSummary:_local2, guarderId:tGuarders[0]});
} else if ((tGuarders.length == 1) && (tHealers.length == 1)) {
this._addGuardAndOther({roundSequence:tRoundSequence, turnSummary:_local2, guarderId:tGuarders[0]});
} else if ((tHealers.length == 1) && (tEnergyUpers.length == 1)) {
this._addGenericPlayersMoves({roundSequence:tRoundSequence, turnSummary:_local2});
} else if ((tHealers.length == 1) && (tAttackers.length == 1)) {
this._addGenericPlayersMoves({roundSequence:tRoundSequence, turnSummary:_local2});
} else if ((tEnergyUpers.length == 1) && (tAttackers.length == 1)) {
this._addGenericPlayersMoves({roundSequence:tRoundSequence, turnSummary:_local2});
} else {
this._addGenericPlayersMoves({roundSequence:tRoundSequence, turnSummary:_local2});
}
};
p._addGuardAndOther = function (iArgs) {
var _local3 = iArgs.roundSequence;
var _local2 = iArgs.turnSummary;
var _local1 = iArgs.guarderId;
var tEnemyId = this._findEnemyId({playerId:_local1});
var tGuardUpMoveId = (_local2[_local1].move.id + "_up");
var tGuardDownMoveId = (_local2[_local1].move.id + "_down");
var tGuardStayMoveId = (_local2[_local1].move.id + "_stay");
var tShowGuarderEffectArea = this._makeShowEffectAreasObject({playerId:_local1, playerTurnSummary:_local2[_local1]});
_local3.push([tShowGuarderEffectArea]);
var tGuardUpMove = this._makeActionObject({playerId:_local1, moveId:tGuardUpMoveId, doneActionId:"stop", turnSummary:_local2, requireDone:true});
_local3.push([tGuardUpMove]);
var tGuardStayMove = this._makeActionObject({playerId:_local1, moveId:tGuardStayMoveId, doneActionId:"stop", turnSummary:_local2, requireDone:false});
_local3.push([tGuardStayMove]);
var tShowEnemyEffectArea = this._makeShowEffectAreasObject({playerId:tEnemyId, playerTurnSummary:_local2[tEnemyId]});
_local3.push([tShowEnemyEffectArea]);
var tEnemyMove = this._makeActionObject({playerId:tEnemyId, turnSummary:_local2});
_local3.push([tEnemyMove]);
var tGuardDownMove = this._makeActionObject({playerId:_local1, moveId:tGuardDownMoveId, doneActionId:"ambient", turnSummary:_local2, requireDone:true});
_local3.push([tGuardDownMove]);
};
p._addGenericPlayersMoves = function (iArgs) {
var tRoundSequence = iArgs.roundSequence;
var _local3 = iArgs.turnSummary;
var tIsLastTurn = false;
for (var tiPlayer in _local3) {
var _local1 = _local3[tiPlayer];
var _local2 = _local1.life;
if (_local2 <= 0) {
tIsLastTurn = true;
var tLoser = tiPlayer;
}
}
if (tIsLastTurn) {
var tPlayerIdThatGoesFirst = tLoser;
var tPlayerIdThatGoesSecond = this._findEnemyId({playerId:tLoser});
} else {
var tPlayerIdThatGoesFirst = 1;
var tPlayerIdThatGoesSecond = this._findEnemyId({playerId:tPlayerIdThatGoesFirst});
}
var tOrderedIds = [tPlayerIdThatGoesFirst, tPlayerIdThatGoesSecond];
this._addOrderedMoves({roundSequence:tRoundSequence, turnSummary:_local3, orderedIds:tOrderedIds});
};
p._addMoveAndOther = function (iArgs) {
var _local1 = iArgs.roundSequence;
var _local3 = iArgs.turnSummary;
var _local2 = iArgs.moverId;
this._addLocationMove({roundSequence:_local1, turnSummary:_local3, moverId:_local2});
var tEnemyId = this._findEnemyId({playerId:_local2});
this._addGenericMove({roundSequence:_local1, turnSummary:_local3, playerId:tEnemyId});
};
p._addMoveAndMove = function (iArgs) {
var tRoundSequence = iArgs.roundSequence;
var _local2 = iArgs.turnSummary;
for (var ti in _local2) {
var _local1 = ti;
this._addLocationMove({roundSequence:tRoundSequence, turnSummary:_local2, moverId:_local1});
}
};
p._addGenericMove = function (iArgs) {
var _local2 = iArgs.roundSequence;
var _local3 = iArgs.turnSummary;
var _local1 = iArgs.playerId;
var tPlayerTurnSummary = _local3[_local1];
var tPlayerMove = this._makeActionObject({playerId:_local1, turnSummary:_local3});
var tShowPlayerEffectAreas = this._makeShowEffectAreasObject({playerId:_local1, playerTurnSummary:tPlayerTurnSummary});
_local2.push([tShowPlayerEffectAreas]);
_local2.push([tPlayerMove]);
};
p._addLocationMove = function (iArgs) {
var _local3 = this;
var tRoundSequence = iArgs.roundSequence;
var tTurnSummary = iArgs.turnSummary;
var _local1 = iArgs.moverId;
var tEnemyId = _local3._findEnemyId({playerId:_local1});
var tMoverTurnSummary = tTurnSummary[_local1];
var tEnemyTurnSummary = tTurnSummary[tEnemyId];
var _local2 = tMoverTurnSummary.oldLoc;
var tMoverDestinationLoc = tMoverTurnSummary.loc;
var tEnemyOriginLoc = tEnemyTurnSummary.oldLoc;
if (_local1 == 0) {
var tOriginFacing = _local3._findFacing({locs:[_local2, tEnemyOriginLoc]});
var tMoverOriginFacing = tOriginFacing[0];
} else {
var tOriginFacing = _local3._findFacing({locs:[tEnemyOriginLoc, _local2]});
var tMoverOriginFacing = tOriginFacing[1];
}
var tMoveIdKey = [["", "", "doubleUp", "", ""], ["", "", "moveUp", "", ""], ["doubleLeft", "moveLeft", "moveNone", "moveRight", "doubleRight"], ["", "", "moveDown", "", ""], ["", "", "doubleDown", "", ""]];
var tMoveIdKeyCenter = [2, 2];
var tXVector = ((tMoverDestinationLoc[1] - _local2[1]) * tMoverOriginFacing);
var tYVector = (tMoverDestinationLoc[0] - _local2[0]);
var tMoveIdIndex = [tMoveIdKeyCenter[0] + tYVector, tMoveIdKeyCenter[1] + tXVector];
var tMoveId = tMoveIdKey[tMoveIdIndex[0]][tMoveIdIndex[1]];
var tEffectArea = _local3._makeShowEffectAreasObject({playerId:_local1, playerTurnSummary:tMoverTurnSummary});
tRoundSequence.push([tEffectArea]);
var tJumpMove = _local3._makeActionObject({playerId:_local1, turnSummary:tTurnSummary, moveId:tMoveId, doneActionId:"ambient", loc:_local2, requireDone:true, facing:tMoverOriginFacing});
tRoundSequence.push([tJumpMove]);
var tDoneJumpMove = _local3._makeActionObject({playerId:_local1, turnSummary:tTurnSummary, moveId:"ambient", doneActionId:"ambient", loc:tMoverDestinationLoc, requireDone:false});
tRoundSequence.push([tDoneJumpMove]);
};
p._addOrderedMoves = function (iArgs) {
var tRoundSequence = iArgs.roundSequence;
var tTurnSummary = iArgs.turnSummary;
var _local3 = iArgs.orderedIds;
var _local1 = 0;
while (_local1 < _local3.length) {
var _local2 = _local3[_local1];
this._addGenericMove({roundSequence:tRoundSequence, turnSummary:tTurnSummary, playerId:_local2});
_local1++;
}
};
p._makeShowEffectAreasObject = function (iArgs) {
var tPlayerId = iArgs.playerId;
var _local2 = iArgs.playerTurnSummary;
var _local3 = _local2.move.impactLocs;
var _local1 = _local2.move.type;
if (_local1 == "action") {
tEffectType = "attack";
} else if ((_local1 == "energyUp") || (_local1 == "heal")) {
tEffectType = "regenerate";
} else {
tEffectType = "misc";
}
var tEffectAreas = {effectLocs:_local3, effectType:tEffectType, playerId:tPlayerId, moveType:"showEffectAreas"};
return(tEffectAreas);
};
p._findEnemyImpact = function (iArgs) {
var tTurnSummary = iArgs.turnSummary;
var _local3 = iArgs.attackerId;
var tPlayers = this._players;
var _local1 = {};
var _local2 = this._findEnemyId({playerId:_local3});
var tAttackerTurnSummary = tTurnSummary[_local3];
var tEnemyTurnSummary = tTurnSummary[_local2];
var tEnemyGotHitType = tEnemyTurnSummary.gotHitType;
var tEnemyMoveId = tEnemyTurnSummary.move.id;
var tAttackerMoveId = tAttackerTurnSummary.move.id;
var tAttackerMoveData = this._getMoveData({playerId:_local3, moveId:tAttackerMoveId});
var tEnemyMoveData = this._getMoveData({playerId:_local2, moveId:tEnemyMoveId});
if (tEnemyGotHitType == "hit") {
_local1.hitType = "hit";
_local1.healthDiff = tAttackerMoveData.enemyImpact.lifeDiff;
_local1.playerId = _local2;
} else if (tEnemyGotHitType == "guard") {
_local1.hitType = "guard";
_local1.healthDiff = tAttackerMoveData.enemyImpact.lifeDiff;
_local1.guardPts = tEnemyMoveData.userImpact.protection;
_local1.playerId = _local2;
} else {
_local1.hitType = "miss";
_local1.healthDiff = 0;
}
return(_local1);
};
p._getMoveData = function (iArgs) {
var _local1 = iArgs.playerId;
var tMoveId = iArgs.moveId;
var _local2 = this._players;
var _local3 = _local2[_local1].moves[tMoveId];
return(_local3);
};
p._findCharacterId = function (iArgs) {
var _local1 = iArgs.playerId;
var _local3 = this._players;
var _local2 = _local3[_local1].characterId;
return(_local2);
};
p._findPlayerName = function (iArgs) {
var _local1 = iArgs.playerId;
var _local3 = this._players;
var _local2 = _local3[_local1].name;
return(_local2);
};
p._findFacing = function (iArgs) {
var _local2 = iArgs.locs;
var _local1 = [];
var _local3 = _local2[0][1];
var t1_x = _local2[1][1];
if (_local3 > t1_x) {
_local1 = [-1, 1];
} else {
_local1 = [1, -1];
}
return(_local1);
};
p._addShowCards = function (iArgs) {
var tRoundSequence = iArgs.roundSequence;
var tTurnSummary = iArgs.turnSummary;
var tTurnNum = iArgs.turnNum;
var tMoveType = "showCards";
var tCardsLabels = [];
var _local1 = 0;
while (_local1 < tTurnSummary.length) {
var _local2 = tTurnSummary[_local1];
var tMoveId = _local2.move.id;
var _local3 = _local2.characterId;
tCardsLabels[_local1] = this._generateMoveLabelName({moveId:tMoveId, characterId:_local3});
_local1++;
}
var tShowCardsSequence = [{moveType:tMoveType, cardsLabels:tCardsLabels, turnNum:tTurnNum}];
tRoundSequence.push(tShowCardsSequence);
};
p._addPlayersAmbient = function (iArgs) {
var tRoundSequence = iArgs.roundSequence;
var _local2 = iArgs.turnSummary;
var tPlayersAmbient = [];
var _local1 = 0;
while (_local1 < _local2.length) {
var _local3 = _local2[_local1];
var tOldLoc = Object.Tools.copyObject(_local3.oldLoc);
var tFacing = this._findFacing({locs:[_local2[0].oldLoc, _local2[1].oldLoc]});
var tAmbientMove = this._makeActionObject({playerId:_local1, moveId:"ambient", turnSummary:_local2, loc:tOldLoc, facing:tFacing[_local1], requireDone:false});
tPlayersAmbient[_local1] = tAmbientMove;
_local1++;
}
tRoundSequence.push(tPlayersAmbient);
};
p._makeActionObject = function (iArgs) {
var _local1 = iArgs;
var _local2 = _local1.playerId;
var tTurnSummary = _local1.turnSummary;
var tRequireDone = _local1.requireDone;
var tLayer = _local1.layer;
var tFacing = _local1.facing;
var tEnemyImpact = _local1.enemyImpact;
var tLoc = _local1.loc;
var _local3 = _local1.moveId;
var tDoneActionId = _local1.doneActionId;
var tDepthMod = _local1.depthMod;
var tPlayerTurnSummary = tTurnSummary[_local2];
var tMoveType = tPlayerTurnSummary.move.type;
if (tRequireDone == undefined) {
tRequireDone = ((tMoveType == "location") ? false : true);
}
if (tLayer == undefined) {
tLayer = ((tMoveType == "location") ? "bottom" : "top");
}
if (tFacing == undefined) {
var tAllPlayersFacing = this._findFacing({locs:[tTurnSummary[0].loc, tTurnSummary[1].loc]});
tFacing = tAllPlayersFacing[_local2];
}
if (tEnemyImpact == undefined) {
tEnemyImpact = this._findEnemyImpact({turnSummary:tTurnSummary, attackerId:_local2});
}
if (tLoc == undefined) {
tLoc = tPlayerTurnSummary.loc;
}
if (_local3 == undefined) {
_local3 = tPlayerTurnSummary.move.id;
}
if (tDoneActionId == undefined) {
tDoneActionId = "ambient";
}
if (tDepthMod == undefined) {
tDepthMod = this._getMoveData({playerId:_local2, moveId:_local3}).depthMod;
}
var tCharacterId = this._findCharacterId({playerId:_local2});
var tMoveData = this._getMoveData({playerId:_local2, moveId:_local3});
var tUserImpact = {protection:tMoveData.userImpact.protection, energyDiff:tMoveData.userImpact.energyDiff, lifeDiff:tMoveData.userImpact.lifeDiff};
var tActionObject = {moveType:"action", playerId:_local2, characterId:tCharacterId, actionId:_local3, doneActionId:tDoneActionId, userImpact:tUserImpact, enemyImpact:tEnemyImpact, hitLocs:tPlayerTurnSummary.move.impactLocs, facing:tFacing, loc:tLoc, layer:tLayer, depthMod:tDepthMod, requireDone:tRequireDone};
return(tActionObject);
};
p._makeSoundObject = function (iArgs) {
var _local1 = iArgs;
var tId = _local1.id;
var _local3 = ((_local1.loops == undefined) ? 1 : (_local1.loops));
var tPlayNice = ((_local1.playNice == undefined) ? false : (_local1.playNice));
var tVolume = _local1.volume;
var tStop = ((_local1.stop == undefined) ? false : (_local1.stop));
var _local2 = {moveType:"playSound", id:tId, loops:_local3, playNice:tPlayNice, volume:tVolume, stop:tStop};
return(_local2);
};
p._generateMoveLabelName = function (iArgs) {
return(Object.Tools.Inuyasha.generateMoveLabelName({moveId:iArgs.moveId, characterId:iArgs.characterId}));
};
p._findEnemyId = function (iArgs) {
var _local1 = iArgs.playerId;
var _local2 = ((_local1 == 0) ? 1 : 0);
return(_local2);
};
delete p;
delete c;
var c = ((Object.$POP.Class.MoveData = function (iArgs) {
var _local1 = this;
var _local2 = iArgs;
_local1.name = _local2.name;
_local1.target = _local2.target;
_local1.id = _local2.id;
_local1.type = _local2.type;
_local1.advanced = _local2.advanced;
_local1.compatibleCharacters = _local2.compatibleCharacters;
_local1.depthMod = _local2.depthMod;
var _local3 = Object.$POP.Class.MoveImpactData;
_local1.userImpact = new _local3[undefined](_local2.userImpact);
_local1.enemyImpact = new _local3[undefined](_local2.enemyImpact);
_local1.order = 0;
_local1.fresh = false;
}));
p = c.prototype;
delete c;
delete p;
var c = ((Object.$POP.Class.MoveImpactData = function (iArgs) {
var _local1 = iArgs;
var _local2 = this;
_local2.locDiff = [0, 0];
_local2.effectArea = [[0, 0, 0], [0, 1, 0], [0, 0, 0]];
_local2.lifeDiff = 0;
_local2.energyDiff = 0;
_local2.protection = 0;
if (_local1.locDiff != undefined) {
_local2.locDiff = _local1.locDiff;
}
if (_local1.effectArea != undefined) {
_local2.effectArea = _local1.effectArea;
}
if (_local1.lifeDiff != undefined) {
_local2.lifeDiff = _local1.lifeDiff;
}
if (_local1.energyDiff != undefined) {
_local2.energyDiff = _local1.energyDiff;
}
if (_local1.protection != undefined) {
_local2.protection = _local1.protection;
}
}));
p = c.prototype;
delete c;
delete p;
var c = ((Object.$POP.Class.PlayerData = function (iArgs) {
var _local1 = this;
var _local2 = iArgs;
_local1.roundMoves = _local2.roundMoves;
_local1.moves = _local2.moves;
_local1.loc = _local2.loc;
_local1.life = _local2.life;
_local1.lifeMax = _local2.lifeMax;
_local1.energy = _local2.energy;
_local1.energyMax = _local2.energyMax;
_local1.name = _local2.name;
_local1.characterId = _local2.characterId;
_local1.facing = _local2.facing;
_local1.gotNewAdvancedMove = false;
if (_local1.roundMoves == undefined) {
_local1.roundMoves = [0, 0, 0];
}
if (_local1.moves == undefined) {
_local1.moves = [];
}
if (_local1.loc == undefined) {
_local1.loc = [0, 0];
}
if (_local1.life == undefined) {
_local1.life = 100;
}
if (_local1.lifeMax == undefined) {
_local1.lifeMax = 100;
}
if (_local1.energy == undefined) {
_local1.energy = 100;
}
if (_local1.energyMax == undefined) {
_local1.energyMax = 100;
}
if (_local1.name == undefined) {
var _local3 = _local2.characterId;
if (_local3 == "i") {
_local1.name = "InuYasha";
} else if (_local3 == "ke") {
_local1.name = "Kagome";
} else if (_local3 == "m") {
_local1.name = "Miroku";
} else if (_local3 == "ka") {
_local1.name = "Kagura";
} else if (_local3 == "n") {
_local1.name = "Naraku";
} else if (_local3 == "s") {
_local1.name = "Sesshomaru";
} else if (_local3 == "ko") {
_local1.name = "Koga";
} else if (_local3 == "sa") {
_local1.name = "Sango";
}
}
}));
p = c.prototype;
delete c;
delete p;
var c = ((Object.$POP.Class.CharacterData = function (iArgs) {
var _local1 = this;
var _local2 = iArgs;
_local1.name = _local2.name;
_local1.level = _local2.level;
_local1.moves = _local2.moves;
_local1.advancedMoves = _local2.advancedMoves;
_local1.id = _local2.id;
_local1.maxHealth = _local2.maxHealth;
_local1.maxEnergy = _local2.maxEnergy;
if (_local1.locked == undefined) {
_local1.locked = false;
}
if (_local1.defeated == undefined) {
_local1.defeated = false;
}
if (_local1.maxHealth == undefined) {
_local1.maxHealth = 100;
}
if (_local1.maxEnergy == undefined) {
_local1.maxEnergy = 100;
}
}));
p = c.prototype;
delete c;
delete p;
var c = ((Object.$POP.Class.GameManager = function () {
this.em = new Object.$POP.Class.EventManager();
}));
var p = c.prototype;
p.init = function (iArgs) {
var _local1 = this;
var _local2 = iArgs;
_local1._pickMovesManager = _local2.pickMovesManager;
_local1._viewRoundManager = _local2.viewRoundManager;
_local1._viewMiniMapManager = _local2.viewMiniMapManager;
_local1._viewBattleLoading = _local2.viewBattleLoading;
_local1._movesImpactComputer = _local2.movesImpactComputer;
_local1._roundSequenceComputer = _local2.roundSequenceComputer;
_local1._turnsMax = _local2.turnsMax;
_local1._map = _local2.map;
_local1._battleLoadManager = _local2.battleLoadManager;
_local1._roundsCount = 0;
_local1._players = [{}, {}];
_local1._playersMoves = [[], []];
_local1._roundSummary = {};
_local1._turnSummary = {};
_local1._isRoundDone = false;
_local1._isMatchDone = false;
_local1._pickMovesManager.em.subscribe({listener:_local1});
_local1._battleDisplayManager.em.subscribe({listener:_local1});
Object.$POP.viewPickMoves.em.subscribe({listener:_local1});
};
p.newMatch = function (iArgs) {
var _local1 = this;
var _local2 = iArgs.players;
_local1._players = _local2;
_local1._roundsCount = 1;
_local1.em.broadcast({event:"newMatch", args:{players:_local2}});
_local1._requestMoves();
};
p.newMoves = function (iArgs) {
var _local1 = this;
var _local2 = iArgs.moves;
var tBattleLoadManager = _local1._battleLoadManager;
var tViewBattleLoading = _local1._viewBattleLoading;
var _local3 = _local1._pickMovesManager;
var tPercentLoaded = tBattleLoadManager.getPercentLoaded();
if (tPercentLoaded == 100) {
_local1._beginRound({moves:_local2});
} else {
_local1._playersMoves = _local2;
tViewBattleLoading.show();
_local3.hidePicker();
}
};
p.viewBattleLoadingDone = function () {
var _local1 = this;
var _local2 = _local1._playersMoves;
var _local3 = _local1._viewBattleLoading;
_local3.hide();
_local1._beginRound({moves:_local2});
};
p.viewRoundDone = function () {
var _local1 = this;
var _local2 = _local1._findMatchResult();
_local1._endOfRoundEnergyUp();
_local1._roundsCount++;
if (_local2.isDone) {
_local1._matchDone({matchResult:_local2});
} else {
_local1._requestMoves();
}
};
p._matchDone = function (iArgs) {
var _local1 = iArgs.matchResult;
var _local2 = this._viewRoundManager;
_local2.hide();
this.em.broadcast({event:"matchDone", args:{matchResult:_local1}});
};
p._endOfRoundEnergyUp = function () {
var _local3 = this._players;
for (var ti in _local3) {
var _local1 = _local3[ti];
var _local2 = _local1.energyMax;
_local1.energy = _local1.energy + 15;
_local1.energy = ((_local1.energy > _local2) ? (_local2) : (_local1.energy));
}
};
p._findMatchResult = function () {
var _local1 = this._roundSummary;
var tIsDone = ((_local1.matchResult == "none") ? false : true);
var tDoneType = _local1.matchResult;
var _local3 = _local1.winner;
var _local2 = _local1.roundNumber;
tMatchResult = {isDone:tIsDone, doneType:tDoneType, winner:_local3, roundsCount:_local2};
return(tMatchResult);
};
p._requestMoves = function () {
var _local1 = this;
var _local2 = _local1._players;
var _local3 = _local1._viewRoundManager;
var tViewMiniMapManager = _local1._viewMiniMapManager;
var tRoundNum = _local1._roundsCount;
_local3.hide();
tViewMiniMapManager.newData({newData:_local2});
_local1.em.broadcast({event:"pickMoves", args:{players:_local2, roundNum:tRoundNum}});
};
p._beginRound = function (iArgs) {
var _local1 = this;
var tPlayersMoves = iArgs.moves;
var _local3 = _local1._pickMovesManager;
var tPlayers = _local1._players;
var tViewRoundManager = _local1._viewRoundManager;
var _local2 = _local1._findRoundSummary({playersMoves:tPlayersMoves});
_local1._roundSummary = _local2;
_local1._updatePlayersWithRoundResults({roundSummary:_local2});
var tRoundSequence = _local1._makeRoundSequence({roundSummary:_local2});
var tBackground = tPlayers[1].characterId;
_local3.hidePicker();
tViewRoundManager.startRound({roundSequence:tRoundSequence, background:tBackground});
};
p._makeRoundSequence = function (iArgs) {
var _local2 = iArgs.roundSummary;
var _local3 = this._players;
var tRoundSequenceComptuer = this._roundSequenceComputer;
var _local1 = tRoundSequenceComptuer.makeRoundSequence({roundSummary:_local2, players:_local3});
return(_local1);
};
p._updatePlayersWithRoundResults = function (iArgs) {
var tRoundSummary = iArgs.roundSummary;
var _local3 = this._players;
var tTurns = tRoundSummary.turns;
var tNewPlayersData = tTurns[tTurns.length - 1];
for (var ti in _local3) {
var _local1 = _local3[ti];
var _local2 = tNewPlayersData[ti];
_local1.life = _local2.life;
_local1.energy = _local2.energy;
_local1.loc = Object.Tools.copyObject(_local2.loc);
}
};
p._findRoundSummary = function (iArgs) {
var tPlayersMoves = iArgs.playersMoves;
var tTurnsMax = this._turnsMax;
var tMovesImpactComputer = this._movesImpactComputer;
var tPlayers = Object.Tools.copyObject(this._players);
var tMap = this._map;
var tRoundsCount = this._roundsCount;
var _local3 = {turns:[], turnsCount:0, matchResult:"none", winner:null, roundNumber:tRoundsCount};
var _local1 = 0;
while (_local1 < tTurnsMax) {
var tTurnMoves = [tPlayersMoves[0][_local1], tPlayersMoves[1][_local1]];
var _local2 = tMovesImpactComputer.computeMovesImpact({players:tPlayers, map:tMap, moves:tTurnMoves});
_local3.turns[_local1] = _local2.players;
_local3.turnsCount = _local1 + 1;
var tMatchResult = _local2.matchResult;
var tWinner = _local2.winner;
_local3.matchResult = tMatchResult;
if (tMatchResult != "none") {
_local3.winner = _local2.winner;
break;
}
_local1++;
}
return(_local3);
};
p._doTurn = function () {
var _local3 = this;
var _local1 = _local3._players;
var tMap = _local3._map;
var tMovesImpactComputer = _local3._movesImpactComputer;
var tPlayersMoves = _local3._playersMoves;
var tTurnsCount = _local3._turnsCount;
var tTurnsMax = _local3._turnsMax;
var tTurnMoves = [];
for (var ti in _local1) {
tTurnMoves[ti] = tPlayersMoves[ti][tTurnsCount];
}
var tTurnSummary = tMovesImpactComputer.computeMovesImpact({players:_local1, map:tMap, moves:tTurnMoves});
var tRoundDone = (((tTurnsCount + 1) >= tTurnsMax) ? true : false);
var tMatchDone = false;
for (var ti in _local1) {
var _local2 = _local1[ti];
if (_local2.life <= 0) {
tMatchDone = true;
break;
}
}
_local3._turnsCount++;
_local3._isRoundDone = tRoundDone;
_local3._isMatchDone = tMatchDone;
_local3._turnSummary = tTurnSummary;
_local3.em.broadcast({event:"movesComputed", args:{turnSummary:tTurnSummary, roundDone:tRoundDone, matchDone:tMatchDone}});
};
p._turnDisplayDone = function () {
var _local1 = this;
var _local2 = _local1._isMatchDone;
var _local3 = _local1._isRoundDone;
if (_local2) {
} else if (_local3) {
_local1._roundDone();
} else {
_local1._doTurn();
}
};
delete c;
delete p;
var c = ((Object.$POP.Class.PickMovesManager = function () {
this.em = new Object.$POP.Class.EventManager();
}));
var p = c.prototype;
p.init = function (iArgs) {
var _local1 = this;
var _local2 = iArgs;
_local1._movesMax = _local2.movesMax;
_local1._pickMovesView = _local2.pickMovesView;
_local1._gameManager = _local2.gameManager;
_local1._computerBrain = _local2.computerBrain;
_local1._players = [];
_local1._humanPlayerIndex = 0;
_local1._computerPlayerIndex = 1;
_local1._mode = "idle";
_local1._gameManager.em.subscribe({listener:_local1});
};
p.pickMoves = function (iArgs) {
var _local1 = this;
var _local3 = iArgs.players;
var tPickMovesView = _local1._pickMovesView;
_local1._players = _local3;
var _local2 = _local1._getHumanPlayer();
tPickMovesView.showPicker({player:_local2});
};
p.donePickingMoves = function (iArgs) {
var _local1 = iArgs.moves;
var tHumanPlayer = this._getHumanPlayer();
tHumanPlayer.roundMoves = _local1;
var _local2 = this._pickComputerMoves();
var _local3 = [_local1, _local2];
this.em.broadcast({event:"newMoves", args:{moves:_local3}});
};
p.hidePicker = function () {
var _local1 = this._pickMovesView;
_local1.hidePicker();
};
p._pickComputerMoves = function (iArgs) {
var _local3 = this;
var _local2 = _local3._computerBrain;
var tHumanPlayer = _local3._getHumanPlayer();
var tComputerPlayer = _local3._getComputerPlayer();
var _local1 = _local2.pickMoves({human:tHumanPlayer, computer:tComputerPlayer});
return(_local1);
};
p._getHumanPlayer = function () {
var _local1 = this._humanPlayerIndex;
var _local3 = this._players;
var _local2 = _local3[_local1];
return(_local2);
};
p._getComputerPlayer = function () {
var _local1 = this._computerPlayerIndex;
var _local3 = this._players;
var _local2 = _local3[_local1];
return(_local2);
};
delete p;
delete c;
var c = ((Object.$POP.Class.MovieMediator = function () {
this.em = new Object.$POP.Class.EventManager();
}));
var p = c.prototype;
p.init = function (iArgs) {
var _local1 = this;
var _local2 = iArgs;
_local1._gameManager = _local2.gameManager;
_local1._pickCharacterManager = _local2.characterPickerManager;
_local1._viewVersus = _local2.viewVersus;
_local1._viewMatchResult = _local2.viewMatchResult;
_local1._viewWinGame = _local2.viewWinGame;
_local1._viewPlayerStatus = _local2.viewPlayerStatus;
_local1._movesDescriptions = _local2.movesDescriptions;
_local1._charactersDescriptions = _local2.charactersDescriptions;
_local1._playerConstructor = _local2.playerConstructor;
_local1._characterConstructor = _local2.characterConstructor;
_local1._moveConstructor = _local2.moveConstructor;
_local1._battleLoadManager = _local2.battleLoadManager;
_local1._userStatsManager = _local2.userStatsManager;
_local1._soundManager = _local2.soundManager;
_local1._startLocs = [[1, 0], [1, 3]];
_local1._startFacing = [1, -1];
_local1._characters = {};
_local1._allMoves = [];
_local1._players = [{}, {}];
_local1._nextGameWillBeNew = true;
_local1._gameManager.em.subscribe({listener:_local1});
};
p.start = function () {
var _local1 = this;
var tGameManager = _local1._gameManager;
_local1._allMoves = _local1._createMoves();
_local1._characters = _local1._createCharacters();
_local1._pickUserCharacter();
};
p.userPickedCharacter = function (iArgs) {
var _local1 = iArgs.character;
var tPickCharacterManager = this._pickCharacterManager;
var tCharacters = this._characters;
var tBattleLoadManager = this._battleLoadManager;
var _local2 = this._userStatsManager;
_local2.selectCharacter({id:_local1.id, potentialEnemies:this._characters, potentialAdvancedMoves:_local1.advancedMoves});
for (var _local3 in _local1.advancedMoves) {
}
var tEnemyId = _local2.getNextEnemyId({id:_local1.id});
if (tEnemyId == false) {
tEnemyId = _local2.getEasiestEnemyId({id:_local1.id});
}
var tEnemyCharacter = tCharacters[tEnemyId];
tBattleLoadManager.load({ids:[_local1.id, tEnemyCharacter.id]});
_local2.unlockEnemy({userId:_local1.id, enemyId:tEnemyCharacter.id});
tPickCharacterManager.hidePickCharacter();
this._showVersus({userId:_local1.id, enemyId:tEnemyId});
};
p.pickCharacterFromVersus = function () {
var _local1 = this._viewVersus;
_local1.hide();
this._pickUserCharacter();
};
p.userDoneWithVersus = function (iArgs) {
var _local1 = this;
var tEnemyId = iArgs.enemyId;
var tGameManager = _local1._gameManager;
var tViewVersus = _local1._viewVersus;
var _local2 = _local1._soundManager;
var _local3 = _local1._userStatsManager;
tViewVersus.hide();
_local2.stop({id:"themeSong"});
_local2.stop({id:"youDie"});
var tUserId = _local3.getStats().id;
_local1._startNewMatch({userId:tUserId, enemyId:tEnemyId});
};
p.userDoneWithMatchResult = function () {
var _local1 = this;
var tViewMatchResult = _local1._viewMatchResult;
var tViewVersus = _local1._viewVersus;
var _local2 = _local1._players;
var _local3 = _local1._userStatsManager;
tViewMatchResult.hide();
if (_local3.getStats().defeatedAll) {
_local1._pickUserCharacter();
} else {
_local1._showVersus({userId:_local2[0].characterId, enemyId:_local2[1].characterId});
}
};
p.matchDone = function (iArgs) {
var _local1 = this;
var tMatchResult = iArgs.matchResult;
var tPlayers = _local1._players;
var tCharacters = _local1._characters;
var tGameManager = _local1._gameManager;
var tBattleLoadManager = _local1._battleLoadManager;
var _local3 = _local1._userStatsManager;
var tUserPlayer = tPlayers[0];
var tEnemyPlayer = tPlayers[1];
var tDoneType = tMatchResult.doneType;
var tWinner = tMatchResult.winner;
var tRoundsCount = tMatchResult.roundsCount;
var _local2 = tUserPlayer.characterId;
var tEnemyId = tEnemyPlayer.characterId;
var tUserCharacter = tCharacters[_local2];
var tEnemyCharacter = tCharacters[tEnemyId];
var tHasAllAdvancedMoves = _local3.getStats({id:_local2}).defeatedAll;
_local3.addMatchResult({id:_local2, win:(((tDoneType == "win") && (tWinner == 0)) ? true : false), enemyId:tEnemyId, roundCount:10});
var tUserStats = _local3.getStats({id:_local2});
if (tDoneType == "win") {
if (tWinner == 0) {
_local1._refreshPlayersProps();
if (tHasAllAdvancedMoves) {
_local1._showVersus({userId:_local2, enemyId:tEnemyId});
} else {
_local3.giveUserAdvancedMove({id:_local2});
if (!tUserStats.defeatedAll) {
var tEnemyId = _local3.getNextEnemyId({id:_local2});
var tNewEnemyCharacter = _local1._characters[tEnemyId];
tBattleLoadManager.load({ids:[tUserCharacter.id, tEnemyId]});
var tEnemyAdvancedMoves = _local3.assignRandomAdvancedMovesToEnemy({userId:_local2, enemyId:tEnemyId, count:tUserStats.level});
_local3.unlockEnemy({userId:_local2, enemyId:tEnemyId});
_local1._players[1] = _local1._createPlayer({character:tNewEnemyCharacter, type:1, advancedMoves:tEnemyAdvancedMoves});
} else {
var tWinnerNumber = (tUserCharacter.level + 1);
getURL (("javascript:submitWinner('" + tWinnerNumber) + "')");
_local1._nextGameWillBeNew = true;
}
_local1._showMatchResult({result:"win", shardCount:tUserStats.level, allShards:tUserStats.defeatedAll});
}
} else {
_local1._refreshPlayersProps();
_local1._showMatchResult({result:"lose"});
}
} else if (tDoneType == "tie") {
_local1._refreshPlayersProps();
_local1._showMatchResult({result:"tie"});
}
};
p._createCharacters = function (iArgs) {
var tCharactersDescriptions = this._charactersDescriptions;
var tCharacterConstructor = this._characterConstructor;
var tCharacters = {};
for (var tId in tCharactersDescriptions) {
var _local1 = tCharactersDescriptions[tId];
var _local2 = this._findCharacterMoves({id:tId});
var _local3 = new tCharacterConstructor({name:_local1.name, level:_local1.level, moves:_local2.regular, advancedMoves:_local2.advanced, id:tId, locked:true, defeated:false});
tCharacters[tId] = _local3;
}
return(tCharacters);
};
p._createPlayers = function (iArgs) {
var _local3 = iArgs.characters;
var tUserStatsManager = this._userStatsManager;
var tPlayers = [];
for (var ti in _local3) {
var _local2 = _local3[ti];
var _local1 = ti;
if (_local1 == 0) {
var tAdvancedMoves = tUserStatsManager.getAdvancedMoves({userId:_local2.id}).user;
} else {
var tAdvancedMoves = tUserStatsManager.getAdvancedMoves({userId:_local3[0].id, enemyId:_local2.id}).enemy;
}
var tPlayer = this._createPlayer({character:_local2, type:_local1, advancedMoves:tAdvancedMoves});
var tPlayersIndex = _local1;
tPlayers[tPlayersIndex] = tPlayer;
}
return(tPlayers);
};
p._createPlayer = function (iArgs) {
var tCharacter = iArgs.character;
var tType = iArgs.type;
var _local3 = iArgs.advancedMoves;
var tPlayerConstructor = this._playerConstructor;
var tStartLocs = this._startLocs;
var _local2 = tCharacter.moves;
var tCharacterId = tCharacter.id;
var tLoc = tStartLocs[tType];
var _local1 = {};
for (var tiMove in _local2) {
_local1[tiMove] = _local2[tiMove];
}
for (var tiMove in _local3) {
_local1[tiMove] = _local3[tiMove];
}
if (Object.$POP.Prefs.easyWin) {
var tLife = ((tType == 1) ? 1 : 100);
}
var tPlayer = new tPlayerConstructor({characterId:tCharacterId, moves:_local1, loc:tLoc, life:tLife});
return(tPlayer);
};
p._createMoves = function () {
var _local2 = this._movesDescriptions;
var tMoveConstructor = this._moveConstructor;
var _local3 = {};
for (var ti in _local2) {
var _local1 = _local2[ti];
tMove = new tMoveConstructor(_local1);
_local3[_local1.id] = tMove;
}
return(_local3);
};
p._refreshPlayersProps = function () {
var _local2 = this._players;
var _local3 = this._startLocs;
for (var tiPlayer in _local2) {
var _local1 = _local2[tiPlayer];
_local1.energy = _local1.energyMax;
_local1.life = _local1.lifeMax;
_local1.loc = _local3[tiPlayer];
}
};
p._startNewMatch = function (iArgs) {
var _local1 = this;
var _local3 = iArgs.userId;
var tEnemyId = iArgs.enemyId;
var tGameManager = _local1._gameManager;
var tPlayers = _local1._players;
var tCharacters = _local1._characters;
var tBattleLoadManager = _local1._battleLoadManager;
var tUserStatsManager = _local1._userStatsManager;
var _local2 = tUserStatsManager.getStats({id:_local3});
var tUserCharacter = _local1._characters[_local3];
var tEnemyCharacter = _local1._characters[tEnemyId];
var tPlayers = _local1._createPlayers({characters:[tUserCharacter, tEnemyCharacter]});
_local1._players = tPlayers;
_local1._players[0].gotNewAdvancedMove = _local2.gotNewAdvancedMove;
_local2.gotNewAdvancedMove = false;
var tPolite = (!_local2.defeatedAll);
var tEnemyMovesCount = tUserStatsManager.getAdvancedMovesCount({id:_local3});
tUserStatsManager.assignRandomAdvancedMovesToEnemy({polite:tPolite, userId:_local3, enemyId:tEnemyId, count:tEnemyMovesCount});
var tMoves = _local1._findAvailableMoves();
tPlayers[0].moves = tMoves.user;
tPlayers[1].moves = tMoves.enemy;
tBattleLoadManager.load({ids:[_local3, tEnemyId]});
tGameManager.newMatch({players:tPlayers});
if (_local1._nextGameWillBeNew) {
if (!_local2.defeatedAll) {
myTracker.track();
_local1._nextGameWillBeNew = false;
}
}
};
p._findAvailableMoves = function () {
var tPlayers = this._players;
var tUserStatsManager = this._userStatsManager;
var _local1 = this._characters;
var _local2 = tPlayers[0].characterId;
var _local3 = tPlayers[1].characterId;
var tAdvancedMoves = tUserStatsManager.getAdvancedMoves({userId:_local2, enemyId:_local3});
var tUserAdvancedMoves = tAdvancedMoves.user;
var tUserNormalMoves = _local1[_local2].moves;
var tEnemyAdvancedMoves = tAdvancedMoves.enemy;
var tEnemyNormalMoves = _local1[_local3].moves;
var tUserMoves = Object.Tools.combineProps([tUserAdvancedMoves, tUserNormalMoves]);
var tEnemyMoves = Object.Tools.combineProps([tEnemyAdvancedMoves, tEnemyNormalMoves]);
var tMoves = {user:tUserMoves, enemy:tEnemyMoves};
return(tMoves);
};
p._showMatchResult = function (iArgs) {
var _local1 = iArgs;
var tResult = _local1.result;
var tShardCount = _local1.shardCount;
var _local3 = _local1.defeatedAll;
var _local2 = _local1.winnerName;
var tViewMatchResult = this._viewMatchResult;
tViewMatchResult.show({result:tResult, shardCount:tShardCount, defeatedAll:_local3, winnerName:_local2});
};
p._showWinGame = function () {
var _local1 = this._viewWinGame;
_local1.show();
};
p._showVersus = function (iArgs) {
var tUserId = iArgs.userId;
var tEnemyId = iArgs.enemyId;
var _local3 = this._viewVersus;
var _local2 = this._userStatsManager;
var _local1 = _local2.getStats();
var tEnemies = _local1.enemies;
var tChoosey = _local1.defeatedAll;
_local3.show({playerA:tUserId, playerB:tEnemyId, enemies:tEnemies, choosey:tChoosey});
};
p._pickUserCharacter = function () {
var _local3 = this;
var _local2 = _local3._pickCharacterManager;
var tCharacters = _local3._characters;
var _local1 = _local3._viewPlayerStatus;
_local1.hide();
_local2.showPickCharacter({characters:tCharacters});
};
p._findCharacterMoves = function (iArgs) {
var tCharacterId = iArgs.id;
var tAllMoves = this._allMoves;
var tRegularMoves = {};
var tAdvancedMoves = {};
for (var tImove in tAllMoves) {
var _local1 = tAllMoves[tImove];
var _local2 = _local1.compatibleCharacters;
for (var tiCharacter in _local2) {
var _local3 = _local2[tiCharacter];
if (tCharacterId == _local3) {
if (_local1.advanced) {
tAdvancedMoves[_local1.id] = _local1;
} else {
tRegularMoves[_local1.id] = _local1;
}
break;
}
}
}
return({advanced:tAdvancedMoves, regular:tRegularMoves});
};
delete p;
delete c;
var c = ((Object.$POP.Class.SoundManager = function () {
this.em = new Object.$POP.Class.EventManager();
}));
var p = c.prototype;
p._Class = {};
p.init = function (iArgs) {
var _local3 = iArgs.soundLinks;
var tPreMadeSounds = iArgs.preMadeSounds;
var tSounds = ((this._sounds = {}));
for (var ti in _local3) {
var _local2 = _local3[ti];
tSounds[ti] = new this._Class.Sound({link:_local2});
}
for (var ti in tPreMadeSounds) {
var _local1 = tPreMadeSounds[ti];
tSounds[ti] = new this._Class.Sound({link:_local1.link, obj:_local1.obj});
}
};
p.start = function (iArgs) {
var _local1 = iArgs;
var tId = _local1.id;
var tOffset = ((_local1.offset == undefined) ? 0 : (_local1.offset));
var _local3 = ((_local1.loops == undefined) ? 1 : (_local1.loops));
var tVolume = ((_local1.volume == undefined) ? 100 : (_local1.volume));
var _local2 = this._sounds[tId];
_local2.obj.start(tOffset, _local3);
_local2.obj.setVolume(tVolume);
_local2.isPlaying = true;
};
p.playNice = function (iArgs) {
var _local1 = iArgs;
var tId = _local1.id;
var _local3 = ((_local1.volume == undefined) ? 100 : (_local1.volume));
var _local2 = this._sounds[tId];
if (!_local2.isPlaying) {
this.start(_local1);
} else {
_local2.obj.setVolume(_local3);
}
};
p.stop = function (iArgs) {
var _local2 = iArgs.id;
var _local1 = this._sounds[_local2];
_local1.obj.stop(_local1.link);
_local1.isPlaying = false;
};
p._Class.Sound = function (iArgs) {
var _local1 = this;
_local1.link = iArgs.link;
_local1.obj = iArgs.obj;
_local1.isPlaying = iArgs.isPlaying;
if (_local1.obj == undefined) {
_local1.obj = new Sound();
_local1.obj.attachSound(_local1.link);
}
_local1.obj.manager = _local1;
_local1.obj.onSoundComplete = function () {
this.manager.isPlaying = false;
};
if (_local1.isPlaying == undefined) {
var _local2 = _local1.obj.duration;
var _local3 = _local1.obj.position;
if (_local2 > 0) {
if ((_local3 > 0) && (_local3 < _local2)) {
_local1.isPlaying = true;
} else {
_local1.isPlaying = false;
}
} else {
_local1.isPlaying = false;
}
}
};
delete p;
delete c;
var c = ((Object.$POP.Class.ManageBattleLoad = function () {
this.em = new Object.$POP.Class.EventManager();
}));
var p = c.prototype;
p.init = function (iArgs) {
var _local1 = this;
_local1._dir = iArgs.dir;
_local1._shells = iArgs.shells;
_local1._loadingShells = [{}, {}];
_local1._lastLoad = ["", ""];
};
p.load = function (iArgs) {
var tIds = iArgs.ids;
var tShells = this._shells;
var tDir = this._dir;
var tLastLoad = this._lastLoad;
var tLoadingShells = this._loadingShells;
for (var tiPlayerId in tShells) {
var tPlayerShells = tShells[tiPlayerId];
if (tLastLoad[tiPlayerId] != tIds[tiPlayerId]) {
tLastLoad[tiPlayerId] = tIds[tiPlayerId];
for (var tiShellType in tPlayerShells) {
var _local2 = tPlayerShells[tiShellType];
for (var tiLayer in _local2) {
if (tiShellType == "figure") {
var _local3 = (((tDir + tIds[tiPlayerId]) + "_") + tiShellType) + ".swf";
var _local1 = _local2[tiLayer];
_local1.notStarted = true;
_local1.loadMovie(_local3);
tLoadingShells[tiPlayerId][tiLayer] = _local1;
}
}
}
}
}
this._prepShellStep = setInterval(this, "_prepShells", 100);
};
p.getPercentLoaded = function () {
var tLoadingShells = this._loadingShells;
var tTotalBytes = 1;
var tBytesLoaded = 1;
var tPrefixes = ["ka", "m", "i", "ke", "s", "n"];
var _local3 = [];
for (var tiA in tLoadingShells) {
var _local2 = tLoadingShells[tiA];
for (var tiB in _local2) {
_local3.push(_local2[tiB]);
}
}
for (var ti in _local3) {
var _local1 = _local3[ti];
if (_local1.notStarted) {
tTotalBytes = tTotalBytes + 1;
tBytesLoaded = tBytesLoaded + 0;
} else {
tTotalBytes = tTotalBytes + _local1.getBytesTotal();
tBytesLoaded = tBytesLoaded + _local1.getBytesLoaded();
if (_local1.prepped) {
} else {
this._prepShell({_mc:_local1});
tTotalBytes = tTotalBytes + 10;
}
}
}
var tPercentLoaded = (100 / (tTotalBytes / tBytesLoaded));
return(tPercentLoaded);
};
p._prepShells = function (iArgs) {
var tLoadingShells = this._loadingShells;
var tTotalShellsCount = 0;
var tPreppedShellsCount = 0;
for (var tiA in tLoadingShells) {
var _local2 = tLoadingShells[tiA];
for (var tiB in _local2) {
var _local1 = _local2[tiB];
tTotalShellsCount++;
if (_local1.prepped) {
tPreppedShellsCount++;
} else {
this._prepShell({_mc:_local1});
}
}
}
if (tPreppedShellsCount >= tTotalShellsCount) {
clearInterval(this._prepShellStep);
}
};
p._prepShell = function (iArgs) {
var _local2 = iArgs._mc;
if (_local2.getBytesLoaded() >= _local2.getBytesTotal()) {
if (_local2.prepTime < 5) {
_local2.prepTime++;
for (var tiP in tPrefixes) {
var _local3 = tPrefixes[tiP] + "Moves";
var _local1 = {_x:-9000, _y:-9000};
_local2.attachMovie(tClipName, "x", 100, _local1);
}
} else {
_local2.x.removeMovieClip();
_local2.prepped = true;
}
}
};
delete p;
delete c;
var c = ((Object.$POP.Class.UserStatsManager = function () {
this.em = new Object.$POP.Class.EventManager();
}));
var p = c.prototype;
p.init = function (iArgs) {
var _local1 = this;
_local1._characters = {};
_local1._currentCharacter = {};
_local1._enemyLevelKey = {ke:["m", "ko", "ka", "s", "n"], m:["ko", "i", "s", "ka", "n"], sa:["ko", "ka", "i", "s", "n"], i:["sa", "ko", "ka", "s", "n"], ka:["ke", "sa", "ko", "i", "n"], ko:["m", "sa", "s", "i", "ka"], s:["ke", "m", "sa", "ka", "i"], n:["ke", "ko", "sa", "m", "i"]};
};
p.getStats = function (iArgs) {
var _local1 = iArgs.id;
if (_local1 == undefined) {
return(this._currentCharacter);
}
return(this._characters[_local1]);
};
p.getEnemies = function (iArgs) {
var _local1 = iArgs.id;
return(this._characters[_local1].enemies);
};
p.getNextEnemyId = function (iArgs) {
var tId = iArgs.id;
var tUserCharacter = this._characters[tId];
var tEnemyLevelKey = this._enemyLevelKey[tId];
var _local1 = tUserCharacter.level;
var _local2 = ((_local1 < tEnemyLevelKey.length) ? (_local1) : 0);
var _local3 = tEnemyLevelKey[_local2];
return(_local3);
};
p.getEasiestEnemyId = function (iArgs) {
var _local3 = iArgs.id;
var _local2 = this._enemyLevelKey;
var _local1 = _local2[_local3][0];
return(_local1);
};
p.selectCharacter = function (iArgs) {
var _local2 = this;
var _local1 = iArgs.id;
var tPotentialEnemies = iArgs.potentialEnemies;
var tPotentialAdvancedMoves = iArgs.potentialAdvancedMoves;
var _local3 = _local2._characters;
if (_local3[_local1] == undefined) {
_local3[_local1] = _local2._newStats({id:_local1, potentialEnemies:tPotentialEnemies, potentialAdvancedMoves:tPotentialAdvancedMoves});
}
_local2._currentCharacter = _local2._characters[_local1];
};
p.getAdvancedMoves = function (iArgs) {
var _local2 = iArgs.userId;
var tEnemyId = iArgs.enemyId;
var _local1 = this._characters[_local2];
var tEnemy = _local1.enemies[tEnemyId];
var tUserMoves = _local1.advancedMoves;
var _local3 = tEnemy.advancedMoves;
return({user:tUserMoves, enemy:_local3});
};
p.getAdvancedMovesCount = function (iArgs) {
var _local2 = iArgs.id;
var _local1 = this._characters[_local2];
var _local3 = Object.Tools.getPropsCount(_local1.advancedMoves);
return(_local3);
};
p.assignRandomAdvancedMovesToEnemy = function (iArgs) {
var tPolite = iArgs.polite;
var tUserId = iArgs.userId;
var tEnemyId = iArgs.enemyId;
var tCount = iArgs.count;
var tUser = this._characters[tUserId];
var _local2 = tUser.enemies[tEnemyId];
var tDiff = (tCount - Object.Tools.getPropsCount(_local2.advancedMoves));
if (tPolite && (tDiff >= 0)) {
var tDiff = (tCount - Object.Tools.getPropsCount(_local2.advancedMoves));
tCount = tDiff;
} else {
var _local1 = _local2.advancedMoves;
var tPotentials = _local2.potentialAdvancedMoves;
for (var ti in _local1) {
tMove = _local1[ti];
tPotentials[ti] = tMove;
delete _local1[ti];
}
}
while ((tCount--) > 0) {
this._addRandomAdvancedMove({target:_local2});
}
return(_local2.advancedMoves);
};
p.giveUserAdvancedMove = function (iArgs) {
var _local2 = iArgs.id;
var _local1 = this._characters[_local2];
this._addRandomAdvancedMove({target:_local1});
_local1.gotNewAdvancedMove = true;
};
p.unlockEnemy = function (iArgs) {
var _local1 = iArgs.userId;
var _local2 = iArgs.enemyId;
var _local3 = this._characters[_local1];
_local3.enemies[_local2].locked = false;
};
p.addMatchResult = function (iArgs) {
var _local3 = iArgs;
var tId = _local3.id;
var tWin = _local3.win;
var tEnemyId = _local3.enemyId;
var _local2 = _local3.roundCount;
var _local1 = this._characters[tId];
_local1.matchCount++;
if (tWin) {
_local1.winCount++;
_local1.level++;
_local1.enemies[tEnemyId].defeated = true;
} else {
_local1.lossCount++;
}
if (this._isAllDefeated({id:tId})) {
_local1.defeatedAll = true;
} else {
_local1.defeatedAll = false;
}
if (_local2 > _local1.mostRoundsCount) {
_local1.mostRoundsCount = _local2;
} else if (_local2 < _local1.leastRoundsCount) {
_local1.leastRoundsCount = _local2;
}
_local1.allRoundsCount = _local1.allRoundsCount + _local2;
_local1.averageRoundsCount = _local1.allRoundsCount / _local1.matchCount;
_local1.winPercent = (_local1.winCount / _local1.matchCount) * 100;
};
p._newStats = function (iArgs) {
var _local2 = iArgs.id;
var tPotentialEnemies = iArgs.potentialEnemies;
var _local3 = iArgs.potentialAdvancedMoves;
var _local1 = {};
_local1.id = _local2;
_local1.matchCount = 0;
_local1.winCount = 0;
_local1.lossCount = 0;
_local1.winPercent = 0;
_local1.mostRoundsCount = 0;
_local1.leastRoundsCount = 0;
_local1.averageRoundsCount = 0;
_local1.allRoundsCount = 0;
_local1.defeatedAll = false;
_local1.level = 0;
_local1.advancedMoves = {};
_local1.potentialAdvancedMoves = this._makePotentialAdvancedMoves({moves:_local3});
_local1.gotNewAdvancedMove = false;
_local1.enemies = this._makeEnemies({id:_local2, potentialEnemies:tPotentialEnemies});
return(_local1);
};
p._makePotentialAdvancedMoves = function (iArgs) {
var _local1 = iArgs.moves;
var _local2 = {};
for (var _local3 in _local1) {
_local2[_local3] = _local1[_local3];
}
return(_local2);
};
p._makeEnemies = function (iArgs) {
var tId = iArgs.id;
var _local3 = iArgs.potentialEnemies;
var tEnemyIds = this._enemyLevelKey[tId];
var tEnemies = {};
var _local2 = 0;
while (_local2 < tEnemyIds.length) {
var tEnemyId = tEnemyIds[_local2];
for (var ti in _local3) {
var _local1 = _local3[ti];
if (tEnemyId == _local1.id) {
tEnemies[ti] = {id:ti, locked:true, defeated:false, level:_local1.level, advancedMoves:{}, potentialAdvancedMoves:this._makePotentialAdvancedMoves({moves:_local1.advancedMoves})};
break;
}
}
_local2++;
}
return(tEnemies);
};
p._addRandomAdvancedMove = function (iArgs) {
var tTarget = iArgs.target;
var _local3 = tTarget.advancedMoves;
var _local1 = tTarget.potentialAdvancedMoves;
var tAdvancedMovesCount = 0;
for (var ti in _local3) {
tAdvancedMovesCount++;
}
if (tAdvancedMovesCount < 1) {
var _local2 = {};
for (var ti in _local1) {
if (_local1[ti].id != "doubleLeft") {
_local2[ti] = _local1[ti];
}
}
var tNewMove = Object.Tools.getRandomProperty(_local2).value;
} else {
var tNewMove = Object.Tools.getRandomProperty(_local1).value;
}
delete _local1[tNewMove.id];
_local3[tNewMove.id] = tNewMove;
};
p._isAllDefeated = function (iArgs) {
var tId = iArgs.id;
var tCharacter = this._characters[tId];
if (tCharacter.defeatedAll == true) {
return(true);
}
var _local1 = tCharacter.enemies;
var _local3 = 0;
var _local2 = 0;
for (var ti in _local1) {
_local3++;
if (_local1[ti].defeated) {
_local2++;
}
}
if (_local2 >= _local3) {
return(true);
}
return(false);
};
delete p;
delete c;
var c = ((Object.$POP.Class.ViewRound = function () {
this.em = new Object.$POP.Class.EventManager();
}));
var p = c.prototype;
p.init = function (iArgs) {
var _local1 = this;
var _local2 = iArgs;
_local1._display_mc = _local2.display_mc;
_local1._manager = _local2.manager;
_local1._mapToScreenKey = _local2.mapToScreenKey;
_local1._viewPlayers = _local2.viewPlayers;
_local1._cardsDisplay_mc = _local2.cardsDisplay_mc;
_local1._nextCardButton_mc = _local2.nextCardButton_mc;
_local1._roundDoneButton_mc = _local2.roundDoneButton_mc;
_local1._viewPlayersStatusManager = _local2.viewPlayersStatusManager;
_local1._soundManager = _local2.soundManager;
_local1._turnIndex = 0;
_local1._unfinishedMoves = [];
_local1._roundSequence = {};
_local1._matchOverMessageClips = [];
_local1._impactNumbersClips = [{energy_mc:0, health_mc:0}, {energy_mc:0, health_mc:0}];
_local1._impactNumbersDepths = [{regenerate:150, hit:160, guard:170}, {regenerate:155, hit:165, guard:175}];
_local1._backgroundSound = "";
_local1._HACK_blockClipEvents = false;
_local1._display_mc._visible = false;
};
p.hide = function (iArgs) {
var _local2 = this;
var tViewPlayers = _local2._viewPlayers;
var _local3 = _local2._impactNumbersClips;
var tSoundManager = _local2._soundManager;
var tDisplay_mc = _local2._display_mc;
_local2._display_mc._visible = false;
tViewPlayers.hide();
for (var ti in _local3) {
var _local1 = _local3[ti];
for (var tia in _local1) {
_local1[tia].removeMovieClip();
}
}
for (var ti in _local2._matchOverMessageClips) {
_local2._matchOverMessageClips[ti].removeMovieClip();
}
_local2._matchOverMessageClips = [];
tDisplay_mc.background_mc.gotoAndPlay(1);
};
p.startRound = function (iArgs) {
var _local1 = this;
var _local3 = iArgs.roundSequence;
var tBackground = iArgs.background;
var _local2 = _local1._display_mc;
var tSoundManager = _local1._soundManager;
_local1._turnIndex = 0;
_local1._unfinishedMoves = [];
_local1._HACK_blockClipEvents = false;
_local1._roundSequence = _local3;
_local2._visible = true;
_local2.background_mc.gotoAndStop(tBackground);
_local1._showTurn();
};
p.finishedMove = function (iArgs) {
var _local2 = iArgs.doneId;
var _local1 = this._unfinishedMoves;
for (var _local3 in _local1) {
if (_local1[_local3] == _local2) {
_local1.splice(_local3, 1);
break;
}
}
this._patrolTurnDone();
};
p._showTurn = function () {
var _local3 = this;
var tTurnIndex = _local3._turnIndex;
var tRoundSequence = _local3._roundSequence;
if (tTurnIndex >= tRoundSequence.length) {
_local3._roundDone();
} else {
var tCurrentTurn = tRoundSequence[tTurnIndex];
for (var tImove in tCurrentTurn) {
var _local1 = tCurrentTurn[tImove];
var _local2 = _local1.moveType;
if (_local2 == "action") {
_local3._doMove_Action({move:_local1});
} else if (_local2 == "location") {
_local3._doMove_Location({move:_local1});
} else if (_local2 == "flip") {
_local3._doMove_Flip({move:_local1});
} else if (_local2 == "showCards") {
_local3._doMove_ShowCards({move:_local1});
} else if (_local2 == "showEffectAreas") {
_local3._doMove_ShowEffectAreas({move:_local1});
} else if (_local2 == "updatePlayerStatusBar") {
_local3._doMove_UpdatePlayerStatusBar({move:_local1});
} else if (_local2 == "showContinueButton") {
_local3._doMove_ShowContinueButton({move:_local1});
} else if (_local2 == "matchOverMessage") {
_local3._doMove_matchOverMessage({move:_local1});
} else if (_local2 == "playSound") {
_local3._doMove_playSound({move:_local1});
}
}
_local3._patrolTurnDone();
}
};
p._doMove_playSound = function (iArgs) {
var _local1 = iArgs.move;
var _local3 = _local1.id;
var tLoops = _local1.loops;
var tPlayNice = _local1.playNice;
var tStop = _local1.stop;
var tVolume = _local1.volume;
var _local2 = this._soundManager;
if (tPlayNice) {
_local2.playNice({id:_local3, loops:tLoops, volume:tVolume});
} else if (tStop) {
_local2.stop({id:_local3});
} else {
_local2.start({id:_local3, loops:tLoops, volume:tVolume});
}
};
p._doMove_ShowContinueButton = function (iArgs) {
var _local1 = this;
var tContinueType = iArgs.move.continueType;
var _local3 = iArgs.move.state;
_local1._nextCardButton_mc.gotoAndStop("off");
_local1._roundDoneButton_mc.gotoAndStop("off");
if (tContinueType == "turn") {
var _local2 = _local1._nextCardButton_mc;
} else {
var _local2 = _local1._roundDoneButton_mc;
}
if (_local3 == "inactive") {
_local2.gotoAndStop("inactive");
} else if (_local3 == "active") {
_local2.gotoAndStop("active");
_local2.manager = _local1;
_local2.doneId = _local1._newUnfinishedMoveId();
_local2.onMoveEvent = function (iArgs) {
var _local1 = this;
_local1.manager.finishedMove({doneId:_local1.doneId});
_local1.gotoAndStop("off");
};
}
};
p._doMove_UpdatePlayerStatusBar = function (iArgs) {
var _local1 = iArgs.move.playersStatus;
var _local2 = this._viewPlayersStatusManager;
_local2.newPlayersStatus({playersStatus:_local1});
};
p._doMove_ShowEffectAreas = function (iArgs) {
var tEffectLocs = iArgs.move.effectLocs;
var tPlayerId = iArgs.move.playerId;
var tEffectType = iArgs.move.effectType;
var tHitGrid = this._display_mc[("hitGrid_" + tPlayerId) + "_mc"];
var tRowCount = 3;
var tColumnCount = 4;
var _local2 = 0;
while (_local2 < tRowCount) {
var _local1 = 0;
while (_local1 < tColumnCount) {
tHitGrid[("cell_" + _local2) + _local1].gotoAndStop("ambient");
_local1++;
}
_local2++;
}
for (var tIeffectLoc in tEffectLocs) {
var _local3 = tEffectLocs[tIeffectLoc];
tHitGrid[("cell_" + _local3[0]) + _local3[1]].gotoAndStop(tEffectType);
}
};
p._doMove_matchOverMessage = function (iArgs) {
var _local1 = this;
var tPlayerId = iArgs.move.playerId;
var tCharacterId = iArgs.move.characterId;
var tIsTie = iArgs.move.isTie;
var _local3 = _local1._display_mc;
var tLinkageName = "matchOverMessage";
var tSubClipName = "message_mc";
var tWinFlash_mc = _local3.winFlash_mc;
tWinFlash_mc.play();
if (tIsTie) {
var tSubFrame = "tie";
var tStageName = "matchOverMessageT_mc";
var tDepth = 5000;
var tInitObj = {_x:0, _y:0};
} else {
var tSubFrame = ("w" + tCharacterId);
var tStageName = "matchOverMessageW_mc";
var tDepth = 5000;
var tInitObj = {_x:0, _y:0};
}
var _local2 = Object.Tools.attacherXL.attach({parent_mc:_local3, libraryName:tLinkageName, newName:tStageName, layer:tDepth, initObj:tInitObj, frame:1, stop:false, subClipFrames:[{name:tSubClipName, frame:tSubFrame, stop:true}]});
_local2.manager = _local1;
_local2.doneId = _local1._newUnfinishedMoveId();
_local2.onMoveEvent = function (iArgs) {
this.manager.finishedMove({doneId:this.doneId});
};
_local1._matchOverMessageClips.push(_local2);
};
p._doMove_ShowCards = function (iArgs) {
var tCardsLabels = iArgs.move.cardsLabels;
var tTurnNum = iArgs.move.turnNum;
var _local2 = this._cardsDisplay_mc;
for (var ti in tCardsLabels) {
var tCard_mc = _local2[((("card_" + tTurnNum) + "_player_") + ti) + "_mc"];
var _local3 = _local2[("card_" + ti) + "_fx_mc"];
var _local1 = tCardsLabels[ti];
tCard_mc.gotoAndStop(_local1);
_local3.gotoAndStop(_local1);
}
_local2.manager = this;
_local2.doneId = this._newUnfinishedMoveId();
_local2.onMoveEvent = function (iArgs) {
this.manager.finishedMove({doneId:this.doneId});
};
_local2.gotoAndPlay("turn" + tTurnNum);
};
p._doMove_Action = function (iArgs) {
var _local3 = this;
var _local1 = iArgs.move;
var _local2 = _local3._viewPlayers;
var tDoneId = (_local1.requireDone ? (_local3._newUnfinishedMoveId()) : null);
_local2.action({move:_local1, doneId:tDoneId});
_local3._patrolRegenerateFloatingImpactNumbers({move:_local1});
};
p._patrolRegenerateFloatingImpactNumbers = function (iArgs) {
var _local1 = iArgs.move;
var _local2 = _local1.actionId;
if ((_local2 == "energyUp") || (_local2 == "heal")) {
var tPlayerId = _local1.playerId;
var tLoc = _local1.loc;
var _local3 = _local1.userImpact;
var tImpact = ((_local2 == "heal") ? (_local3.lifeDiff) : (_local3.energyDiff));
var tHitType = ((_local2 == "heal") ? "heal" : "regenerate");
this._showFloatingImpactNumbers({hitType:tHitType, impact:tImpact, playerId:tPlayerId, loc:tLoc});
}
};
p._simpleFigureAction = function (iArgs) {
var _local1 = this._viewPlayers;
_local1.simpleAction(iArgs);
};
p.moveEvent = function (iArgs) {
var _local1 = this;
var tEvent = iArgs.event;
var _local3 = iArgs.eventInfo;
var tDoneId = _local3.doneId;
var _local2 = _local1._getPlayerLatestMove({playerId:_local3.playerId});
var tPlayerId = _local2.playerId;
var tDoneActionId = _local2.doneActionId;
var tEnemyImpact = _local2.enemyImpact;
if (_local1._HACK_blockClipEvents) {
if (tDoneActionId == "stop") {
_local1._simpleFigureAction({playerId:tPlayerId, actionId:"stop"});
} else {
_local3._mc.removeMovieClip();
}
} else if (tEvent == "done") {
_local1._simpleFigureAction({playerId:tPlayerId, actionId:tDoneActionId});
_local1.finishedMove({doneId:tDoneId});
} else if (tEvent == "hit") {
_local1._showPlayerHit(tEnemyImpact);
}
};
p._showPlayerHit = function (iArgs) {
var _local3 = this;
var _local2 = iArgs.hitType;
var tHealthDiff = iArgs.healthDiff;
var tGuardPts = iArgs.guardPts;
var _local1 = iArgs.playerId;
var tLoc = _local3._getPlayerLatestMove({playerId:_local1}).loc;
var tPlayerStatusDisplay = _local3._viewPlayersStatusManager;
var tViewPlayers = _local3._viewPlayers;
if (_local2 == "hit") {
tViewPlayers.hit({playerId:_local1});
tPlayerStatusDisplay.showHit({playerId:_local1});
_local3._showFloatingImpactNumbers({hitType:_local2, impact:tHealthDiff, playerId:_local1, loc:tLoc});
} else if (_local2 == "guard") {
tPlayerStatusDisplay.showHit({playerId:_local1});
_local3._showFloatingImpactNumbers({hitType:"hit", impact:tHealthDiff, playerId:_local1, loc:tLoc});
_local3._showFloatingImpactNumbers({hitType:_local2, impact:tGuardPts, playerId:_local1, loc:tLoc});
} else if (_local2 == "miss") {
}
};
p._showFloatingImpactNumbers = function (iArgs) {
var _local3 = iArgs.hitType;
var tImpact = iArgs.impact;
var _local2 = iArgs.playerId;
var tLoc = iArgs.loc;
var tDisplay_mc = this._display_mc;
var tLifeSpan = 3000;
var tDepths = this._impactNumbersDepths;
var tHitTypeKey = {guard:{libraryName:"FID_guard", clipPrefix:"FID_guard_"}, hit:{libraryName:"FID_damage", clipPrefix:"FID_damage_"}, regenerate:{libraryName:"FID_regenerate", clipPrefix:"FID_regenerate_"}, heal:{libraryName:"FID_heal", clipPrefix:"FID_heal_"}};
var tImpactDisplayLoc = this._transformMapToScreen({mapLoc:tLoc, playerIndex:_local2});
var tLayer = tDepths[_local2][_local3];
var tLibraryName = tHitTypeKey[_local3].libraryName;
var tClipName = ((tHitTypeKey[_local3].clipPrefix + _local2) + "_mc");
var _local1 = Math.abs(tImpact);
var tNum1 = (Math.floor(_local1 / 10) + 1);
var tNum2 = ((_local1 - (Math.floor(_local1 / 10) * 10)) + 1);
var tNum3 = 11;
if (_local1 == 100) {
var tNum1 = 2;
var tNum2 = 1;
var tNum3 = 1;
}
Object.Tools.attacherXL.attach({parent_mc:tDisplay_mc, libraryName:tLibraryName, newName:tClipName, layer:tLayer, initObj:{_x:tImpactDisplayLoc.x, _y:tImpactDisplayLoc.y}, lifeSpan:tLifeSpan, frame:1, stop:false, subClipFrames:[{name:"num_1_mc", frame:tNum1, stop:true}, {name:"num_2_mc", frame:tNum2, stop:true}, {name:"num_3_mc", frame:tNum3, stop:true}]});
};
p._turnDone = function () {
this._turnIndex++;
this._showTurn();
};
p._roundDone = function () {
var _local1 = this._manager;
this._HACK_blockClipEvents = true;
_local1.viewRoundDone();
};
p._getPlayerLatestMove = function (iArgs) {
var tPlayerId = iArgs.playerId;
var tRoundSequence = this._roundSequence;
var tTurnIndex = this._turnIndex;
var tLatestMove = null;
var _local3 = 0;
while (_local3 <= tTurnIndex) {
var _local2 = tRoundSequence[_local3];
for (var tImove in _local2) {
var _local1 = _local2[tImove];
if (tPlayerId == _local1.playerId) {
tLatestMove = _local1;
}
}
_local3++;
}
return(tLatestMove);
};
p._getCurrentTurn = function () {
return(this._roundSequence[this._turnIndex]);
};
p._patrolTurnDone = function () {
var _local1 = this._unfinishedMoves;
if (_local1.length <= 0) {
this._turnDone();
}
};
p._newUnfinishedMoveId = function () {
var _local1 = this._unfinishedMoves;
var _local2 = 0;
for (var _local3 in _local1) {
if (_local1[_local3] > tHighestDoneId) {
_local2 = _local1[_local3];
}
}
var tNewUnfinishedMoveId = (_local2 + 1);
this._unfinishedMoves.push(tNewUnfinishedMoveId);
return(tNewUnfinishedMoveId);
};
p._transformMapToScreen = function (iArgs) {
var _local1 = iArgs.mapLoc;
var _local3 = iArgs.playerIndex;
var tMapToScreenKey = this._mapToScreenKey[_local3];
var _local2 = tMapToScreenKey[_local1[0]][_local1[1]];
return(_local2);
};
delete p;
delete c;
var c = ((Object.$POP.Class.ViewRoundPlayers = function () {
this.em = new Object.$POP.Class.EventManager();
}));
var p = c.prototype;
p.init = function (iArgs) {
var _local1 = this;
var _local2 = iArgs;
_local1._manager = _local2.manager;
_local1._mapToScreenKey = _local2.mapToScreenKey;
_local1._characterIdToLinkageIdKey = _local2.characterIdToLinkageIdKey;
_local1._parentClips = _local2.parentClips;
_local1._playersClips = [{figure_mc:0, fxTop_mc:0, fxBottom_mc:0}, {figure_mc:0, fxTop_mc:0, fxBottom_mc:0}];
_local1._playersDepths = [{fxBottom:10, bottom:10, top:10, fxTop:10}, {fxBottom:10, bottom:10, top:10, fxTop:10}];
_local1._currentMoves = [];
_local1._overlap = {top:1, bottom:0};
_local1._stacking = [0, 1];
_local1._yStackingKey = [10, 20, 30];
_local1._stackParents = [_local2.parentClips[0].figure, _local2.parentClips[1].figure];
_local1._displayClips = [{}, {}];
_local1._attachProps = [{linkageId:"", isPlaying:false}, {}];
};
p.hide = function (iArgs) {
var _local3 = this._playersClips;
for (var tIplayer in _local3) {
var _local1 = _local3[tIplayer];
for (var tIclip in _local1) {
var _local2 = _local1[tIclip];
_local2.removeMovieClip();
}
}
};
p.action = function (iArgs) {
var _local2 = this;
var _local3 = iArgs.move;
var tDoneId = iArgs.doneId;
var tPlayersClips = _local2._playersClips;
var tCharacterIdToLinkageIdKey = _local2._characterIdToLinkageIdKey;
var tPlayersDepths = _local2._playersDepths;
var tManager = _local2._manager;
var _local1 = _local3.playerId;
var tActionId = _local3.actionId;
var tCharacterId = _local3.characterId;
var tLoc = _local3.loc;
var tLayer = _local3.layer;
var tStackingMod = _local3.depthMod;
var tDoneActionId = _local3.doneActionId;
var tFacing = _local3.facing;
var tOldFigure_mc = tPlayersClips[_local1].figure_mc;
var tOldFxTop_mc = tPlayersClips[_local1].fxTop_mc;
var tOldFxBottom_mc = tPlayersClips[_local1].fxBottom_mc;
var tParentClips = _local2._parentClips[_local1];
var tFigureParent_mc = tParentClips.figure.top;
var tFXTopParent_mc = tParentClips.fx.top;
var tFXBottomParent_mc = tParentClips.fx.bottom;
var tScreenLoc = _local2._transformMapToScreen({mapLoc:tLoc, playerIndex:_local1});
var tFrame = ((tActionId == "stop") ? (tOldFigure_mc._currentFrame - 1) : (tActionId));
if ((tFacing == -1) && (tCharacterId == "m")) {
tFrame = tFrame + "_R";
}
var tPlay = ((tActionId == "stop") ? false : true);
var tInitProps = {_x:tScreenLoc.x, _y:tScreenLoc.y, _xscale:tFacing * 100, forceXscale:tFacing * 100, manager:tManager, returnObj:{doneId:tDoneId, playerId:_local1}, onMoveEvent:function (iArgs) {
var _local1 = this;
_local1.returnObj._mc = _local1;
_local1.manager.moveEvent({event:iArgs.event, eventInfo:_local1.returnObj});
}};
_local2._attachMovieWithOverlap({id:_local1, linkageId:tCharacterIdToLinkageIdKey[tCharacterId].figure, initObj:tInitProps, play:tPlay, frame:tFrame, y:tLoc[0], stackingMod:tStackingMod});
tOldFxTop_mc.removeMovieClip();
var tFxTopLibraryClip = tCharacterIdToLinkageIdKey[tCharacterId].fxTop;
var tFxTopClipName = (("fxTop_" + _local1) + "_mc");
var tFxTopDepth = tPlayersDepths[_local1].fxTop;
var tFxTopInitProps = {_x:0, _y:0};
var tNewFxTop_mc = tFXTopParent_mc.attachMovie(tFxTopLibraryClip, tFxTopClipName, tFxTopDepth, tFxTopInitProps);
tPlayersClips[_local1].fxTop_mc = tNewFxTop_mc;
tOldFxBottom_mc.removeMovieClip();
var tFxBottomLibraryClip = tCharacterIdToLinkageIdKey[tCharacterId].fxBottom;
var tFxBottomClipName = (("fxBottom_" + _local1) + "_mc");
var tFxBottomDepth = tPlayersDepths[_local1].fxBottom;
var tFxBottomInitProps = {_x:0, _y:0};
var tNewFxBottom_mc = tFXBottomParent_mc.attachMovie(tFxBottomLibraryClip, tFxBottomClipName, tFxBottomDepth, tFxBottomInitProps);
tPlayersClips[_local1].fxBottom_mc = tNewFxBottom_mc;
if (tActionId == "stop") {
} else {
tNewFxTop_mc.gotoAndPlay(tActionId);
tNewFxBottom_mc.gotoAndPlay(tActionId);
}
_local2._currentMoves[_local1] = _local3;
};
p.simpleAction = function (iArgs) {
var _local3 = iArgs;
var tPlayerId = _local3.playerId;
var tActionId = ((_local3.actionId == undefined) ? "ambient" : (_local3.actionId));
var tLayer = ((_local3.layer == undefined) ? "bottom" : (_local3.layer));
var tRequireDone = ((_local3.requireDone == undefined) ? false : (_local3.requireDone));
var tDoneActionId = ((_local3.doneActionId == undefined) ? "ambient" : (_local3.doneActionId));
var _local2 = this._getPlayerLatestMove({playerId:tPlayerId});
var _local1 = {};
for (var tIprop in _local2) {
_local1[tIprop] = _local2[tIprop];
}
_local1.playerId = tPlayerId;
_local1.actionId = tActionId;
_local1.layer = tLayer;
_local1.requireDone = tRequireDone;
_local1.doneActionId = tDoneActionId;
_local1.depthMod = 0;
this.action({move:_local1});
};
p.hit = function (iArgs) {
var _local1 = iArgs.playerId;
this.simpleAction({playerId:_local1, actionId:"hit"});
};
p._getPlayerLatestMove = function (iArgs) {
var _local1 = iArgs.playerId;
var _local2 = this._currentMoves;
return(_local2[_local1]);
};
p._transformMapToScreen = function (iArgs) {
var _local1 = iArgs.mapLoc;
var _local3 = iArgs.playerIndex;
var tMapToScreenKey = this._mapToScreenKey[_local3];
var _local2 = tMapToScreenKey[_local1[0]][_local1[1]];
return(_local2);
};
p._attachMovieWithOverlap = function (iArgs) {
var _local1 = this;
var _local2 = iArgs;
var tPlayerId = _local2.id;
var tLinkageId = _local2.linkageId;
var tInitObj = _local2.initObj;
var tPlay = _local2.play;
var tFrame = _local2.frame;
var tY = _local2.y;
var tStackingMod = _local2.stackingMod;
var tPlayersClips = _local1._playersClips;
var _local3 = _local1._overlap;
var tAttachProps = _local1._attachProps;
_local1._modStacking({y:tY, id:tPlayerId, mod:tStackingMod});
if (!_local1._doesStackingMatchOverlap()) {
_local1._switchOverlap();
_local3 = _local1._overlap;
_local1.switchDepths({top:{_mc:tPlayersClips[_local3.top].figure_mc, playerId:_local3.top}, bottom:{_mc:tPlayersClips[_local3.bottom].figure_mc, playerId:_local3.bottom}});
}
var tPlayerOverlap = _local1._getPlayerOverlap({id:tPlayerId});
_local1._attachMovie({playerId:tPlayerId, linkageId:tLinkageId, overlap:tPlayerOverlap, initObj:tInitObj, play:tPlay, frame:tFrame});
};
p._attachMovie = function (iArgs) {
var _local2 = iArgs;
var _local1 = _local2.playerId;
var tOverlap = _local2.overlap;
var tLinkageId = _local2.linkageId;
var tInitObj = _local2.initObj;
var tPlay = _local2.play;
var tFrame = _local2.frame;
var tStackParent_mc = this._stackParents[_local1][tOverlap];
var _local3 = this._playersClips;
_local3[_local1].figure_mc.removeMovieClip();
var tClipName = (("x" + _local1) + "_mc");
var tDepth = (1 + Number(_local1));
_local3[_local1].figure_mc = tStackParent_mc.attachMovie(tLinkageId, tClipName, tDepth, tInitObj);
if (tPlay) {
_local3[_local1].figure_mc.gotoAndPlay(tFrame);
} else {
_local3[_local1].figure_mc.gotoAndStop(tFrame);
}
this._attachProps[_local1].linkageId = tLinkageId;
this._attachProps[_local1].isPlaying = tPlay;
};
p._modStacking = function (iArgs) {
var _local2 = iArgs.y;
var tId = iArgs.id;
var _local3 = iArgs.mod;
var tStacking = this._stacking;
var _local1 = this._yStackingKey;
this._stacking[tId] = _local1[_local2] + _local3;
};
p._doesStackingMatchOverlap = function () {
var _local2 = this._stacking;
var _local1 = this._overlap;
var _local3 = _local2[_local1.top];
var tBottomLayer = _local2[_local1.bottom];
if (_local3 >= tBottomLayer) {
return(true);
}
return(false);
};
p._switchOverlap = function () {
var _local1 = this;
_local1._overlap = {top:_local1._overlap.bottom, bottom:_local1._overlap.top};
};
p._getPlayerOverlap = function (iArgs) {
var _local2 = iArgs.id;
var _local1 = this._overlap;
for (var _local3 in _local1) {
if (_local1[_local3] == _local2) {
return(_local3);
}
}
return(undefined);
};
p.switchDepths = function (iArgs) {
var tSwitchees = iArgs;
var tStackParents = this._stackParents;
var tAttachProps = this._attachProps;
var tClipsProps = {};
for (var ti in tSwitchees) {
var tSwitchee = tSwitchees[ti];
var _local1 = tSwitchee._mc;
var _local3 = tSwitchee.playerId;
var tLinkageId = tAttachProps[_local3].linkageId;
var tIsPlaying = tAttachProps[_local3].isPlaying;
tClipsProps[ti] = {frame:_local1._currentframe, linkageId:tLinkageId, isPlaying:tIsPlaying, playerId:_local3, initObj:{_x:_local1._x, _y:_local1._y, _xscale:_local1.forceXscale, manager:_local1.manager, returnObj:_local1.returnObj, onMoveEvent:_local1.onMoveEvent}};
}
for (var ti in tClipsProps) {
var tOverlap = ti;
var _local2 = tClipsProps[ti];
this._attachMovie({playerId:_local2.playerId, linkageId:_local2.linkageId, overlap:tOverlap, initObj:_local2.initObj, play:_local2.isPlaying, frame:_local2.frame});
}
};
delete p;
delete c;
var c = ((Object.$POP.Class.ViewPickMoves = function () {
this.em = new Object.$POP.Class.EventManager();
}));
var p = c.prototype;
p.init = function (iArgs) {
this._display_mc = iArgs.display_mc;
this._continueButton_mc = iArgs.continueButton_mc;
this._clearButton_mc = iArgs.clearButton_mc;
this._helpButton_mc = iArgs.helpButton_mc;
this._manager = iArgs.manager;
this._soundManager = iArgs.soundManager;
this._pickShard_mc = iArgs.display_mc.pickShard_mc;
this._player = {};
this._playerMoves = {};
this._moveSelectorClips = [];
this._selectedMovesClips = [];
this._selectedMoves = [0, 0, 0];
this._nextSelectedMoveIndex = 0;
this._moveTypeToRowKey = {guard:0, location:0, action:1, energyUp:1, advanced:2};
this._maxSelectedMoves = 3;
this._inputObjects = [];
this._doShowNewShard = false;
this._didShowHelpFirstTime = false;
this._setupWidgets();
var tDisplay_mc = this._display_mc;
var tMoveSelectorClips = this._moveSelectorClips;
var tMoveSelectorRowCount = 3;
var tMoveSelectorColumnCount = 5;
var _local2 = 0;
while (_local2 < tMoveSelectorRowCount) {
var tMoveSelectorRow = ((tMoveSelectorClips[_local2] = []));
var _local1 = 0;
while (_local1 < tMoveSelectorColumnCount) {
tMoveSelectorRow[_local1] = tDisplay_mc[(("card_" + _local2) + _local1) + "_mc"];
_local1++;
}
_local2++;
}
var tDisplay_mc = this._display_mc;
var tSelectedMovesClips = this._selectedMovesClips;
var _local3 = 0;
while (_local3 < 3) {
tSelectedMovesClips[_local3] = tDisplay_mc[("selectedMove_" + _local3) + "_mc"];
_local3++;
}
this._registerInputObjects();
this._display_mc._visible = false;
};
p.hidePicker = function (iArgs) {
var tDisplay_mc = this._display_mc;
var tSoundManager = this._soundManager;
tDisplay_mc._visible = false;
tSoundManager.stop({id:"pickMoves"});
var tMoveSelectorClips = this._moveSelectorClips;
for (var tiRow in tMoveSelectorClips) {
var _local1 = tMoveSelectorClips[tiRow];
for (var tiColumn in _local1) {
var _local2 = _local1[tiColumn];
this._showAsSelected({mc:_local2});
}
}
};
p.showPicker = function (iArgs) {
var _local1 = this;
var _local2 = iArgs.player;
var _local3 = _local1._display_mc;
var tSoundManager = _local1._soundManager;
_local1._doShowNewShard = _local2.gotNewAdvancedMove;
_local2.gotNewAdvancedMove = false;
_local3._visible = true;
_local3.background_mc.gotoAndStop(_local2.characterId);
_local1._resetSelectedMoves();
_local1._player = _local2;
_local1._playerMoves = _local1._findPlayerMoves({player:_local2});
_local1._refresh();
if (!_local1._didShowHelpFirstTime) {
_local1.help();
_local1._didShowHelpFirstTime = true;
}
};
p.selectMove = function (iArgs) {
var _local1 = this;
var tMoveId = iArgs.moveId;
var _local2 = _local1._selectedMoves;
var tMaxSelectedMoves = _local1._maxSelectedMoves;
var tSelectedMovesClips = _local1._selectedMovesClips;
var tPlayerMoves = _local1._playerMoves;
var tNextSelectedMoveIndex = _local1._nextSelectedMoveIndex;
var _local3 = _local1._soundManager;
if (tNextSelectedMoveIndex != "none") {
_local2[tNextSelectedMoveIndex] = tPlayerMoves[tMoveId];
var tNextSelectedMoveIndex = _local1._findNextSelectedMoveIndex({selectedMoves:_local2});
_local1.setNextSelectedMoveIndex({index:tNextSelectedMoveIndex});
_local1._refresh();
_local3.start({id:"placeCard"});
var tSuccess = true;
} else {
_local3.start({id:"cantPlaceCard"});
var tSuccess = false;
}
return(tSuccess);
};
p.unSelectMove = function (iArgs) {
var _local1 = this;
var t_mc = iArgs.mc;
var _local2 = iArgs.selectedMoveIndex;
var _local3 = _local1._soundManager;
var tSelectedMoves = _local1._selectedMoves;
tSelectedMoves[_local2] = 0;
_local1.setNextSelectedMoveIndex({index:_local2});
_local1._refresh();
_local3.start({id:"placeCard"});
};
p.tryContinue = function () {
var _local1 = this._selectedMoves;
var _local2 = this._manager;
_local2.donePickingMoves({moves:_local1});
};
p.clearSelectedMoves = function () {
var _local1 = this;
var _local2 = _local1._soundManager;
_local1._resetSelectedMoves();
_local1._refresh();
_local2.start({id:"placeCard"});
};
p.help = function () {
var _local2 = this;
var _local1 = _local2._display_mc.help_mc;
_local1.manager = _local2;
_local1.onClose = function () {
this.manager.closeHelp();
};
_local1.gotoAndPlay("open");
_local2._openDialogBox();
};
p.closeHelp = function () {
this._closeDialogBox();
};
p.userPickedShard = function () {
tSoundManager.stop({id:"help"});
this._closeDialogBox();
this._refresh();
};
p.selectNextSelectedMoveIndex = function (iArgs) {
var _local1 = iArgs.index;
this.setNextSelectedMoveIndex({index:_local1});
this._refresh();
};
p.setNextSelectedMoveIndex = function (iArgs) {
this._nextSelectedMoveIndex = iArgs.index;
};
p._openDialogBox = function (iArgs) {
var tSoundManager = this._soundManager;
this._blockInputReception();
};
p._closeDialogBox = function (iArgs) {
var tSoundManager = this._soundManager;
this._restoreInputReception();
};
p._showPickShard = function (iArgs) {
var _local2 = this;
var _local3 = iArgs.label;
var _local1 = _local2._pickShard_mc;
_local1.show_mc.gotoAndStop(_local3);
_local1.gotoAndPlay("intro");
_local1.manager = _local2;
tSoundManager.start({id:"help", loops:999999});
_local2._openDialogBox();
};
p._refresh = function () {
var _local1 = this;
_local1._showSelectedMoves();
_local1._refreshContinueButton();
_local1._showMoves();
};
p._refreshContinueButton = function () {
var _local3 = this;
var _local2 = _local3._continueButton_mc;
var _local1 = _local3._selectedMoves;
var tMaxSelectedMoves = _local3._maxSelectedMoves;
var tSoundManager = _local3._soundManager;
var tSelectedMovesCount = 0;
for (var ti in _local1) {
if (_local1[ti] != 0) {
tSelectedMovesCount++;
}
}
if (tSelectedMovesCount >= tMaxSelectedMoves) {
_local2.master = _local3;
_local2.soundManager = tSoundManager;
_local2.gotoAndStop("on");
_local2.onPress = function () {
this.master.tryContinue();
this.soundManager.start({id:"click"});
};
_local2.onRollOver = function () {
this.gotoAndStop("rollover");
this.soundManager.start({id:"rollOver"});
};
_local2.onRollOut = function () {
this.gotoAndStop("on");
};
} else {
_local2.gotoAndStop("off");
_local2.onPress = null;
_local2.onRollOver = null;
_local2.onRollOut = null;
}
};
p._showMoves = function () {
var _local2 = this;
var tPlayerMoves = _local2._playerMoves;
var tMoveSelectorClips = _local2._moveSelectorClips;
var tMoveTypeToRowKey = _local2._moveTypeToRowKey;
var tPlayer = _local2._player;
var tShowNewShard = _local2._doShowNewShard;
var tGroupedMoves = [[], [], []];
for (var tImove in tPlayerMoves) {
var _local3 = tPlayerMoves[tImove];
var tMoveType = (_local3.advanced ? "advanced" : (_local3.type));
var tMoveRow = tMoveTypeToRowKey[tMoveType];
tGroupedMoves[tMoveRow].push(_local3);
}
var tAdvancedMoves = tGroupedMoves[2];
var tReorderedMoves = [];
var tAdvancedCount = tAdvancedMoves.length;
for (var ti in tAdvancedMoves) {
tReorderedMoves[(tAdvancedCount - 1) - ti] = tAdvancedMoves[ti];
}
tGroupedMoves[2] = tReorderedMoves;
for (var tIrow in tGroupedMoves) {
var tMoveRow = tGroupedMoves[tIrow];
for (var tImove in tMoveRow) {
var _local3 = tMoveRow[tImove];
var tMoveId = _local3.id;
var tCharacterId = tPlayer.characterId;
var _local1 = tMoveSelectorClips[tIrow][tImove];
_local1.moveId = tMoveId;
_local1.manager = _local2;
var tMoveLabelName = _local2._generateMoveLabelName({moveId:tMoveId, characterId:tCharacterId});
_local1.gotoAndStop(tMoveLabelName);
_local1.tinter_mc.gotoAndStop(1);
_local1.onPress = function () {
var _local1 = this;
_local1.manager.selectMove({moveId:_local1.moveId});
};
if (!_local2._isEnoughEnergyForMove({move:_local3})) {
_local1.tinter_mc.gotoAndStop(2);
delete _local1.onPress;
}
if (_local2._isMoveSelected({move:_local3})) {
_local2._showAsSelected({mc:_local1});
}
if (tShowNewShard) {
if ((tIrow == 2) && (tImove == 0)) {
_local2._doShowNewShard = false;
_local2._showAsSelected({mc:_local1});
var tHACKshardMoveLabelName = tMoveLabelName;
}
}
}
}
if (tShowNewShard) {
_local2._showPickShard({label:tHACKshardMoveLabelName});
}
};
p._showSelectedMoves = function () {
var _local2 = this;
var tSelectedMoves = _local2._selectedMoves;
var tSelectedMovesClips = _local2._selectedMovesClips;
var tNextSelectedMoveIndex = _local2._nextSelectedMoveIndex;
var tPlayer = _local2._player;
for (var tImove in tSelectedMoves) {
var _local3 = tSelectedMoves[tImove];
var _local1 = tSelectedMovesClips[tImove];
if (tImove == tNextSelectedMoveIndex) {
_local1.gotoAndStop("next");
_local1.onPress = null;
} else if (_local3 != 0) {
var tMoveId = _local3.id;
var tCharacterId = tPlayer.characterId;
var tMoveLabelName = _local2._generateMoveLabelName({moveId:tMoveId, characterId:tCharacterId});
_local1.gotoAndStop(tMoveLabelName);
_local1.manager = _local2;
_local1.selectedMoveIndex = tImove;
_local1.moveId = tMoveId;
_local1.onPress = function () {
var _local1 = this;
_local1.manager.unSelectMove({moveId:_local1.moveId, mc:_local1, selectedMoveIndex:_local1.selectedMoveIndex});
};
} else {
_local1.gotoAndStop("empty");
_local1.manager = _local2;
_local1.selectedMoveIndex = tImove;
_local1.onPress = function () {
this.manager.selectNextSelectedMoveIndex({index:this.selectedMoveIndex});
};
}
}
};
p._findSelector = function (iArgs) {
var _local3 = iArgs.moveId;
var tMoveSelectorClips = this._moveSelectorClips;
for (var tIrow in tMoveSelectorClips) {
var _local2 = tMoveSelectorClips[tIrow];
for (var tIselector in _local2) {
var _local1 = _local2[tIselector];
if (_local1.moveId == _local3) {
return(_local1);
}
}
}
return(false);
};
p._showAsSelected = function (iArgs) {
var _local1 = iArgs.mc;
_local1.gotoAndStop("selected");
_local1.tinter_mc.gotoAndStop(1);
delete _local1.onPress;
};
p._isMoveSelected = function (iArgs) {
var tMove = iArgs.move;
var tSelectedMoves = this._selectedMoves;
var tIsMoveSelected = false;
for (var ti in tSelectedMoves) {
var _local2 = tSelectedMoves[ti];
var _local1 = _local2.id;
var _local3 = tMove.id;
if (_local3 == _local1) {
tIsMoveSelected = true;
break;
}
}
return(tIsMoveSelected);
};
p._findNextSelectedMoveIndex = function (iArgs) {
var _local2 = iArgs.selectedMoves;
var _local3 = "none";
var _local1 = 0;
while (_local1 < _local2.length) {
if (_local2[_local1] == 0) {
_local3 = _local1;
break;
}
_local1++;
}
return(_local3);
};
p._isEnoughEnergyForMove = function (iArgs) {
var tMove = iArgs.move;
var tPlayer = this._player;
var _local2 = this._selectedMoves;
var tNextSelectedMoveIndex = this._nextSelectedMoveIndex;
var tPlayerEnergy = tPlayer.energy;
var tMoveEnergy = tMove.userImpact.energyDiff;
var tAllMovesEnergy = tMoveEnergy;
for (var _local1 in _local2) {
tAllMovesEnergy = tAllMovesEnergy + _local2[_local1].userImpact.energyDiff;
}
var tSomeMovesEnergy = tMoveEnergy;
var _local1 = 0;
while (_local1 < _local2.length) {
var _local3 = _local2[_local1].userImpact.energyDiff;
if ((_local3 > 0) && (_local1 > tNextSelectedMoveIndex)) {
break;
}
tSomeMovesEnergy = tSomeMovesEnergy + _local3;
_local1++;
}
if (((tPlayerEnergy + tAllMovesEnergy) >= 0) && ((tPlayerEnergy + tSomeMovesEnergy) >= 0)) {
return(true);
}
return(false);
};
p._findPlayerMoves = function (iArgs) {
var _local1 = iArgs.player;
return(_local1.moves);
};
p._generateMoveLabelName = function (iArgs) {
return(Object.Tools.Inuyasha.generateMoveLabelName({moveId:iArgs.moveId, characterId:iArgs.characterId}));
};
p._resetSelectedMoves = function () {
this._selectedMoves = [0, 0, 0];
this._nextSelectedMoveIndex = 0;
};
p._registerInputObjects = function () {
var _local2 = this;
var tHelpButton_mc = _local2._helpButton_mc;
var tClearButton_mc = _local2._clearButton_mc;
var tContinueButton_mc = _local2._continueButton_mc;
var tMoveSelectorClips = _local2._moveSelectorClips;
var _local3 = _local2._selectedMovesClips;
_local2._inputObjects = [];
_local2._registerInputReceptor({obj:tHelpButton_mc});
_local2._registerInputReceptor({obj:tClearButton_mc});
_local2._registerInputReceptor({obj:tContinueButton_mc});
for (var tiRow in tMoveSelectorClips) {
var _local1 = tMoveSelectorClips[tiRow];
for (var tiClip in _local1) {
_local2._registerInputReceptor({obj:_local1[tiClip]});
}
}
for (var ti in _local3) {
_local2._registerInputReceptor({obj:_local3[ti]});
}
};
p._registerInputReceptor = function (iArgs) {
var _local1 = iArgs.obj;
this._inputObjects.push({obj:_local1});
};
p._blockInputReception = function () {
var _local3 = this._inputObjects;
for (var ti in _local3) {
var _local2 = _local3[ti];
var _local1 = _local2.obj;
_local2.press = _local1.onPress;
_local2.release = _local1.onRelease;
_local2.rollout = _local1.onRollout;
_local2.rollover = _local1.onRollover;
delete _local1.onPress;
delete _local1.onRelease;
delete _local1.onRollout;
delete _local1.onRollover;
}
};
p._restoreInputReception = function () {
var _local3 = this._inputObjects;
for (var ti in _local3) {
var _local1 = _local3[ti];
var _local2 = _local1.obj;
if ((_local1.press != undefined) && (_local1.press != null)) {
_local2.onPress = _local1.press;
}
if ((_local1.release != undefined) && (_local1.release != null)) {
_local2.onRelease = _local1.release;
}
if ((_local1.rollout != undefined) && (_local1.rollout != null)) {
_local2.onRollout = _local1.rollout;
}
if ((_local1.rollover != undefined) && (_local1.rollover != null)) {
_local2.onRollover = _local1.rollover;
}
}
};
p._setupWidgets = function (iArgs) {
var _local1 = this;
var _local2 = _local1._helpButton_mc;
var _local3 = _local1._clearButton_mc;
var tSoundManager = _local1._soundManager;
_local2.manager = _local1;
_local2.soundManager = tSoundManager;
_local2.onRelease = function () {
this.manager.help();
this.soundManager.start({id:"click"});
};
_local2.onRollOver = function () {
this.soundManager.start({id:"rollOver"});
};
_local3.manager = _local1;
_local3.soundManager = tSoundManager;
_local3.onRelease = function () {
this.manager.clearSelectedMoves();
this.soundManager.start({id:"click"});
};
_local3.onRollOver = function () {
this.soundManager.start({id:"rollOver"});
};
};
delete p;
delete c;
var c = ((Object.$POP.Class.ViewMiniMap = function () {
this.em = new Object.$POP.Class.EventManager();
}));
var p = c.prototype;
p.init = function (iArgs) {
var _local1 = this;
_local1._display_mc = iArgs.display_mc;
_local1._gameManager = iArgs.gameManager;
_local1._playersClips = [{}, {}];
_local1._mapToScreenKey = iArgs.mapToScreenKey;
for (var ti in _local1._playersClips) {
var _local2 = _local1._playersClips[ti];
var _local3 = _local1._display_mc;
_local2.character_mc = _local3[("player_" + ti) + "_mc"];
}
var tEventBroadcasters = iArgs.eventBroadcasters;
for (var ti in tEventBroadcasters) {
tEventBroadcasters[ti].em.subscribe({listener:_local1});
}
};
p.newMatch = function (iArgs) {
var _local1 = iArgs.players;
this._displayNew({players:_local1});
};
p.newData = function (iArgs) {
var _local1 = iArgs.newData;
this._displayNew({players:_local1});
};
p._displayNew = function (iArgs) {
var tPlayers = iArgs.players;
var tPlayersClips = this._playersClips;
for (var ti in tPlayersClips) {
var _local1 = tPlayersClips[ti];
var _local3 = tPlayers[ti];
var tCharacterId = _local3.characterId;
var _local2 = this._transformMapToScreen({mapLoc:_local3.loc, playerIndex:ti});
_local1.character_mc._x = _local2.x;
_local1.character_mc._y = _local2.y;
_local1.character_mc.gotoAndStop(tCharacterId);
}
};
p._transformMapToScreen = function (iArgs) {
var _local1 = iArgs.mapLoc;
var _local3 = iArgs.playerIndex;
var tMapToScreenKey = this._mapToScreenKey[_local3];
var _local2 = tMapToScreenKey[_local1[0]][_local1[1]];
return(_local2);
};
delete p;
delete c;
var c = ((Object.$POP.Class.ViewPlayersStatus = function () {
this.em = new Object.$POP.Class.EventManager();
}));
var p = c.prototype;
p.init = function (iArgs) {
var _local3 = this;
_local3._display_mc = iArgs.display_mc;
_local3._gameManager = iArgs.gameManager;
_local3._soundManager = iArgs.soundManager;
_local3._playersClips = [{}, {}];
for (var ti in _local3._playersClips) {
var _local1 = _local3._playersClips[ti];
var _local2 = _local3._display_mc;
_local1.status_mc = _local2[("status_" + ti) + "_mc"];
_local1.healthBar_mc = _local2[("healthBar_" + ti) + "_mc"];
_local1.energyBar_mc = _local2[("energyBar_" + ti) + "_mc"];
_local1.portrait_mc = _local2[("portrait_" + ti) + "_mc"];
_local1.name_mc = _local2[("name_" + ti) + "_mc"];
}
var tPlayersClips = _local3._playersClips;
_local3._addTweener({clips:[tPlayersClips[0].healthBar_mc, tPlayersClips[0].energyBar_mc, tPlayersClips[1].healthBar_mc, tPlayersClips[1].energyBar_mc]});
var tEventBroadcasters = iArgs.eventBroadcasters;
for (var ti in tEventBroadcasters) {
tEventBroadcasters[ti].em.subscribe({listener:_local3});
}
_local3._display_mc._visible = false;
};
p.pickMoves = function (iArgs) {
var _local1 = iArgs.players;
var tRoundNum = iArgs.roundNum;
var tDisplay_mc = this._display_mc;
tDisplay_mc._visible = true;
for (var ti in _local1) {
this._refreshPlayerDisplay({index:ti, name:_local1[ti].name, life:_local1[ti].life, energy:_local1[ti].energy, characterId:_local1[ti].characterId});
}
this._refreshRoundDisplay({roundNum:tRoundNum});
};
p.newPlayersStatus = function (iArgs) {
var _local1 = iArgs.playersStatus;
for (var ti in _local1) {
this._refreshPlayerDisplay({index:ti, name:_local1[ti].name, life:_local1[ti].life, energy:_local1[ti].energy, characterId:_local1[ti].characterId});
}
};
p.showHit = function (iArgs) {
var _local1 = iArgs.playerId;
var _local2 = this._display_mc;
_local2[("hitFlash_" + _local1) + "_mc"].gotoAndPlay("show");
};
p.hide = function () {
var _local1 = this._display_mc;
_local1._visible = false;
};
p._refreshPlayerDisplay = function (iArgs) {
var _local1 = iArgs;
var tIndex = _local1.index;
var tName = _local1.name;
var _local2 = _local1.life;
var _local3 = _local1.energy;
var tCharacterId = _local1.characterId;
var tSoundManager = this._soundManager;
var tPlayersClips = this._playersClips;
tClips = tPlayersClips[tIndex];
if (tClips.status_mc.life_txt > _local2) {
}
tClips.status_mc.life_txt = _local2;
tClips.status_mc.energy_txt = _local3;
tClips.portrait_mc.gotoAndStop(tCharacterId);
tClips.name_mc.gotoAndStop(tCharacterId);
tClips.energyBar_mc.startTween({destination:_local3 + 1});
tClips.healthBar_mc.startTween({destination:_local2 + 1});
};
p._refreshRoundDisplay = function (iArgs) {
var _local1 = iArgs.roundNum;
var _local2 = this._display_mc;
_local2.roundNum_10s_mc.gotoAndStop(Math.floor(_local1 / 10) + 1);
_local2.roundNum_1s_mc.gotoAndStop((_local1 - (Math.floor(_local1 / 10) * 10)) + 1);
};
p._addTweener = function (iArgs) {
var _local1 = this;
var tClips = iArgs.clips;
for (var ti in tClips) {
var _local3 = tClips[ti];
_local3._tweening = false;
_local3._destination = 101;
_local3.startTween = function (iArgs) {
this._destination = iArgs.destination;
this._tweening = true;
};
_local3.onEnterFrame = function () {
var _local2 = this;
if (_local2._tweening) {
var _local1 = _local2._currentFrame;
var _local3 = _local2._destination;
if (_local1 < _local3) {
_local2.gotoAndStop(_local1 + 1);
} else if (_local1 > _local3) {
_local2.gotoAndStop(_local1 - 1);
} else {
_local2._tweening = false;
}
}
};
}
};
delete p;
delete c;
var c = ((Object.$POP.Class.ViewPickCharacter = function () {
this.em = new Object.$POP.Class.EventManager();
}));
var p = c.prototype;
p.init = function (iArgs) {
var _local1 = this;
var _local2 = iArgs;
_local1._display_mc = _local2.display_mc;
_local1._manager = _local2.manager;
_local1._soundManager = _local2.soundManager;
_local1._characters = {};
_local1._characterButtons = {};
};
p.hidePickCharacter = function () {
var _local1 = this._display_mc;
_local1._visible = false;
};
p.showPickCharacter = function (iArgs) {
var _local1 = this;
var _local2 = iArgs.characters;
var _local3 = _local1._display_mc;
_local3._visible = true;
_local1._characters = _local2;
_local1._buildWidgetRefs({characters:_local2});
_local1._refreshWidgets();
};
p._refreshWidgets = function (iArgs) {
var _local2 = this;
var tCharacterButtons = _local2._characterButtons;
var tCharacters = _local2._characters;
var tSoundManager = _local2._soundManager;
for (var tId in tCharacterButtons) {
var _local1 = tCharacterButtons[tId];
var _local3 = tCharacters[tId];
_local1.name_mc.gotoAndStop(tId);
_local1.portrait_mc.gotoAndStop(tId);
_local1.state_mc.gotoAndStop("default");
_local1.main_mc.manager = _local2;
_local1.main_mc.character = _local3;
_local1.main_mc.soundManager = tSoundManager;
_local1.main_mc.onRollOver = function () {
this.rollover_mc.play();
this.soundManager.start({id:"characterSelect"});
};
_local1.main_mc.onPress = function () {
this.manager.pickCharacter({character:this.character});
};
}
};
p._buildWidgetRefs = function (iArgs) {
var tCharacters = iArgs.characters;
var tDisplay_mc = this._display_mc;
var tCharacterButtons = {};
for (var tIcharacter in tCharacters) {
var _local2 = tCharacters[tIcharacter];
var tId = _local2.id;
var _local3 = _local2.level;
var _local1 = tDisplay_mc[("pick_" + _local3) + "_mc"];
tCharacterButtons[tId] = {main_mc:_local1, name_mc:_local1.name_mc, portrait_mc:_local1.portrait_mc, rollover_mc:_local1.rollover_mc, state_mc:_local1.state_mc};
}
this._characterButtons = tCharacterButtons;
};
p.pickCharacter = function (iArgs) {
var _local2 = iArgs.character;
var _local1 = this._manager;
_local1.userPickedCharacter({character:_local2});
};
delete p;
delete c;
var c = ((Object.$POP.Class.ViewVersus = function () {
this.em = new Object.$POP.Class.EventManager();
}));
var p = c.prototype;
p.init = function (iArgs) {
var _local1 = this;
var _local2 = iArgs;
_local1._display_mc = _local2.display_mc;
_local1._manager = _local2.manager;
_local1._soundManager = _local2.soundManager;
_local1._playerA = "";
_local1._playerB = "";
_local1._enemies = [];
_local1._choosey = false;
_local1._display_mc._visible = false;
};
p.show = function (iArgs) {
var _local1 = this;
var tPlayerA = iArgs.playerA;
var tPlayerB = iArgs.playerB;
var tEnemies = iArgs.enemies;
var tChoosey = iArgs.choosey;
var tDisplay_mc = _local1._display_mc;
var tSoundManager = _local1._soundManager;
_local1._playerA = tPlayerA;
_local1._playerB = tPlayerB;
_local1._enemies = tEnemies;
_local1._choosey = ((tChoosey == true) ? true : false);
tDisplay_mc._visible = true;
_local1._redraw({playerA:tPlayerA, playerB:tPlayerB, enemies:tEnemies});
var _local3 = tDisplay_mc.panel_mc.button_fight_mc;
_local3.manager = _local1;
_local3.soundManager = tSoundManager;
_local3.onPress = function () {
this.soundManager.start({id:"click"});
this.manager.clickedFight();
};
_local3.gotoAndStop("on");
_local3.onRollOver = function () {
this.soundManager.start({id:"rollOver"});
this.gotoAndStop("rollover");
};
_local3.onRollOut = function () {
this.gotoAndStop("on");
};
var _local2 = tDisplay_mc.panel_mc.button_pickCharacter_mc;
_local2.manager = _local1;
_local2.soundManager = tSoundManager;
_local2.onPress = function () {
this.soundManager.start({id:"click"});
this.manager.clickedPickCharacter();
};
_local2.gotoAndStop("on");
_local2.onRollOver = function () {
this.soundManager.start({id:"rollOver"});
this.gotoAndStop("rollover");
};
_local2.onRollOut = function () {
this.gotoAndStop("on");
};
tDisplay_mc.gotoAndPlay("intro");
};
p.hide = function (iArgs) {
var _local1 = this._display_mc;
_local1._visible = false;
};
p.clickedFight = function () {
var _local1 = this._manager;
var _local2 = this._playerB;
_local1.userDoneWithVersus({enemyId:_local2});
};
p.clickedPickCharacter = function () {
var _local1 = this._manager;
_local1.pickCharacterFromVersus();
};
p._redraw = function (iArgs) {
var tPlayerA = iArgs.playerA;
var tEnemies = iArgs.enemies;
var tPlayerB = iArgs.playerB;
var tUserChoice = iArgs.userChoice;
var tDisplay_mc = this._display_mc;
var tChoosey = this._choosey;
if (!tUserChoice) {
tDisplay_mc.giantA_mc.gotoAndPlay(tPlayerA);
}
tDisplay_mc.giantB_mc.gotoAndPlay(tPlayerB);
tDisplay_mc.kanjiA_mc.gotoAndStop(tPlayerA);
tDisplay_mc.kanjiB_mc.gotoAndStop(tPlayerB);
tDisplay_mc.portraitA_mc.portrait_mc.gotoAndStop(tPlayerA);
var _local2 = [];
var tEnemyOrderKey = {ke:["m", "ko", "ka", "s", "n"], m:["ko", "i", "s", "ka", "n"], sa:["ko", "ka", "i", "s", "n"], i:["sa", "ko", "ka", "s", "n"], ka:["ke", "sa", "ko", "i", "n"], ko:["m", "sa", "s", "i", "ka"], s:["ke", "m", "sa", "ka", "i"], n:["ke", "ko", "sa", "m", "i"]};
var tEnemyOrder_arr = tEnemyOrderKey[tPlayerA];
for (var ti in tEnemyOrder_arr) {
var tEnemyId = tEnemyOrder_arr[ti];
var tEnemy = tEnemies[tEnemyId];
var tId = tEnemy.id;
var tLevel = tEnemy.level;
var _local1 = {};
_local1.id = tId;
_local1.locked = tEnemy.locked;
_local1.defeated = tEnemy.defeated;
_local1.playerB = ((tId == tPlayerB) ? true : false);
_local2[ti] = _local1;
}
var tNewPortraitsDisplay_array = [];
var ti = 0;
while (ti < _local2.length) {
if (_local2[ti] != undefined) {
tNewPortraitsDisplay_array.push(_local2[ti]);
}
ti++;
}
_local2 = tNewPortraitsDisplay_array;
for (var ti in _local2) {
var _local3 = _local2[ti];
var tPortrait_mc = tDisplay_mc[("portraitB_" + ti) + "_mc"];
this._redrawPortrait({portrait_mc:tPortrait_mc, id:_local3.id, locked:_local3.locked, defeated:_local3.defeated, clickable:tChoosey});
if (_local3.playerB) {
tDisplay_mc.portraitA_mc.gotoAndStop(Number(ti) + 1);
}
}
};
p._redrawPortrait = function (iArgs) {
var _local3 = this;
var tId = iArgs.id;
var _local2 = iArgs.portrait_mc;
var tLocked = iArgs.locked;
var tDefeated = iArgs.defeated;
var tClickable = iArgs.clickable;
var tSoundManager = _local3._soundManager;
_local2.name_mc.gotoAndStop(tId);
_local2.portrait_mc.gotoAndStop(tId);
var _local1 = _local2;
if (tClickable) {
_local2.state_mc.gotoAndStop("defeated");
_local1.manager = _local3;
_local1.soundManager = tSoundManager;
_local1.id = tId;
_local1.onPress = function () {
var _local1 = this;
_local1.soundManager.start({id:"click"});
_local1.manager.pickedCharacter({id:_local1.id});
};
_local1.onRollOver = function () {
this.soundManager.start({id:"characterSelect"});
this.rollover_mc.play();
};
_local1.gotoAndStop("on");
} else {
delete _local1.onPress;
delete _local1.onRollOver;
if (tDefeated) {
_local2.state_mc.gotoAndStop("defeated");
} else if (tLocked) {
_local2.state_mc.gotoAndStop("locked");
} else {
_local2.state_mc.gotoAndStop("default");
}
}
};
p.pickedCharacter = function (iArgs) {
var _local2 = this;
var _local1 = iArgs.id;
var _local3 = _local2._playerA;
var tEnemies = _local2._enemies;
_local2._playerB = _local1;
_local2._redraw({playerA:_local3, enemies:tEnemies, playerB:_local1, userChoice:true});
};
delete p;
delete c;
var c = ((Object.$POP.Class.ViewMatchResult = function () {
this.em = new Object.$POP.Class.EventManager();
}));
var p = c.prototype;
p.init = function (iArgs) {
var _local1 = this;
var _local2 = iArgs;
_local1._displayLink = _local2.displayLink;
_local1._displayParent_mc = _local2.displayParent_mc;
_local1._displayLevel = _local2.displayLevel;
_local1._manager = _local2.manager;
_local1._trackStats = _local2.trackStats;
_local1._soundManager = _local2.soundManager;
_local1._display_mc = {};
};
p.show = function (iArgs) {
var _local1 = this;
var tResult = iArgs.result;
var tShardCount = iArgs.shardCount;
var tAllShards = iArgs.allShards;
var tDisplayLink = _local1._displayLink;
var tDisplayParent_mc = _local1._displayParent_mc;
var tDisplayLevel = _local1._displayLevel;
var tTrackStats = _local1._trackStats;
var tSoundManager = _local1._soundManager;
var _local3 = tDisplayParent_mc.attachMovie(tDisplayLink, "viewWinShard_mc", tDisplayLevel, {_x:0, _y:0});
if (tResult == "win") {
if ((Number(tShardCount) > 4) && (tTrackStats)) {
var tFrame = "win5stats";
} else {
var tFrame = ("win" + String(tShardCount));
}
} else {
var tFrame = tResult;
}
_local3.gotoAndStop(tFrame);
var _local2 = _local3.button_continue_mc;
_local2.manager = _local1;
_local2.soundManager = tSoundManager;
_local2.onRollOver = function () {
this.soundManager.start({id:"rollOver"});
};
_local2.onPress = function () {
this.soundManager.start({id:"click"});
};
_local2.onRelease = function () {
this.manager.clickedContinue();
};
var tViewStatsButton_mc = _local3.button_viewStats_mc;
tViewStatsButton_mc.soundManager = tSoundManager;
tViewStatsButton_mc.onRollOver = function () {
this.soundManager.start({id:"rollOver"});
};
tViewStatsButton_mc.onPress = function () {
this.soundManager.start({id:"click"});
};
tViewStatsButton_mc.onRelease = function () {
getURL ("javascript:viewLeaderBoard()");
};
_local1._display_mc = _local3;
};
p.clickedContinue = function () {
var _local1 = this._manager;
_local1.userDoneWithMatchResult();
};
p.hide = function (iArgs) {
var _local1 = this._display_mc;
_local1.removeMovieClip();
};
delete p;
delete c;
var c = ((Object.$POP.Class.ViewWinGame = function () {
this.em = new Object.$POP.Class.EventManager();
}));
var p = c.prototype;
p.init = function (iArgs) {
var _local1 = this;
var _local2 = iArgs;
_local1._displayPrefs = _local2.displayPrefs;
_local1._manager = _local2.manager;
_local1._soundManager = _local2.soundManager;
_local1._ambientAudio = _local2.ambientAudio;
_local1._display_mc = {};
};
p.show = function (iArgs) {
var _local2 = this;
var _local1 = _local2._displayPrefs;
var tSoundManager = _local2._soundManager;
var _local3 = _local2._ambientAudio;
var tDisplay_mc = _local1.parent.attachMovie(_local1.link, _local1.stageName, _local1.level, tDisplalyPrefs.initObj);
_local2._display_mc = tDisplay_mc;
tSoundManager.playNice({id:_local3, loops:99999});
};
p.clickedContinue = function () {
};
p.hide = function (iArgs) {
var _local1 = this._display_mc;
var _local2 = this._soundManager;
_local1.removeMovieClip();
_local2.stop({id:tAmbientAudio});
};
delete p;
delete c;
var c = ((Object.$POP.Class.ViewBattleLoading = function () {
this.em = new Object.$POP.Class.EventManager();
}));
var p = c.prototype;
p.init = function (iArgs) {
var _local1 = this;
var _local2 = iArgs;
_local1._displayPrefs = _local2.displayPrefs;
_local1._manager = _local2.manager;
_local1._loadingManager = _local2.loadingManager;
_local1._display_mc = null;
};
p.step = function () {
var _local3 = this;
var tLoadingManager = _local3._loadingManager;
var _local2 = _local3._display_mc;
var tManager = _local3._manager;
var _local1 = tLoadingManager.getPercentLoaded();
if (_local1 >= 100) {
tManager.viewBattleLoadingDone();
} else {
_local2.loaded_txt = Math.floor(_local1);
}
};
p.show = function (iArgs) {
var _local3 = this;
var _local1 = _local3._displayPrefs;
var tParent_mc = _local1.parent_mc;
var tLinkName = _local1.linkName;
var tStageName = _local1.stageName;
var tDepth = _local1.depth;
var tInitObj = _local1.initObj;
var _local2 = tParent_mc.attachMovie(tLinkName, tStageName, tDepth, tInitObj);
_local2.manager = _local3;
_local2.onEnterFrame = function () {
this.manager.step();
};
_local3._display_mc = _local2;
};
p.hide = function () {
var _local1 = this._display_mc;
_local1.removeMovieClip();
};
delete p;
delete c;
stop();
_global.preMadeSounds = {};
_global.preMadeSounds.themeSong = {};
_global.preMadeSounds.themeSong.link = "snd_themeSong";
_global.preMadeSounds.themeSong.obj = new Sound();
_global.preMadeSounds.themeSong.obj.attachSound("snd_themeSong");
_global.preMadeSounds.themeSong.obj.start(0, 99999);
Frame 16
var g = Object.$POP;
var p = Object.$POP.Prefs;
var r = this;
p.movesMax = 3;
p.playersTotal = 2;
p.soundLinks = {click:"snd_click", rollOver:"snd_rollOver", cantPlaceCard:"snd_cantPlaceCard", cardDown:"snd_cardDown", cardFlipping:"snd_cardFlipping", cardPickup:"snd_cardPickup", battle:"snd_battle", beginRound:"snd_beginRound", guard:"snd_guard", characterSelect:"snd_characterSelect", characterSelected:"snd_characterSelected", perfectGuard:"snd_perfectGuard", hit:"snd_hit", placeCard:"snd_placeCard", lifeDown:"snd_lifeDown", pickMoves:"snd_pickMoves", themeSong:"snd_themeSong", youLose:"snd_youLose", youWin:"snd_youWin", help:"snd_helpAndPickShard", youDie:"snd_youDie", battleBackgroundke:"snd_water", battleBackgroundm:"snd_rain", battleBackgroundi:"snd_wind", battleBackgroundka:"snd_wind", battleBackgrounds:"snd_cave", battleBackgroundn:"snd_wind"};
p.map = [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]];
p.mapToScreenKey = [[[{x:30, y:146}, {x:136, y:146}, {x:244, y:146}, {x:352, y:146}], [{x:30, y:192}, {x:136, y:192}, {x:244, y:192}, {x:352, y:192}], [{x:30, y:237}, {x:136, y:237}, {x:244, y:237}, {x:352, y:237}]], [[{x:80, y:146}, {x:188, y:146}, {x:296, y:146}, {x:402, y:146}], [{x:80, y:192}, {x:188, y:192}, {x:296, y:192}, {x:402, y:192}], [{x:80, y:237}, {x:188, y:237}, {x:296, y:237}, {x:402, y:237}]]];
p.miniMapToScreenKey = [[[{x:1, y:1}, {x:33, y:1}, {x:65, y:1}, {x:97, y:1}], [{x:1, y:24}, {x:33, y:24}, {x:65, y:24}, {x:97, y:24}], [{x:1, y:45}, {x:33, y:45}, {x:65, y:45}, {x:97, y:45}]], [[{x:14, y:1}, {x:46, y:1}, {x:78, y:1}, {x:112, y:1}], [{x:14, y:24}, {x:46, y:24}, {x:78, y:24}, {x:112, y:24}], [{x:14, y:45}, {x:46, y:45}, {x:78, y:45}, {x:112, y:45}]]];
p.movesDescriptions = g.translateLoadedPrefs({prefs:r.xmlPrefs});
p.charactersDescriptions = {ke:{name:"Kagome", level:0, fightList:["m", "ko", "ka", "s", "n"]}, m:{name:"Miroku", level:1, fightList:["ko", "i", "s", "ka", "n"]}, sa:{name:"Sango", level:2, fightList:["ko", "ka", "i", "s", "n"]}, i:{name:"InuYasha", level:3, fightList:["sa", "ko", "ka", "s", "n"]}, ka:{name:"Kagura", level:4, fightList:["ke", "sa", "ko", "i", "n"]}, ko:{name:"Koga", level:5, fightList:["m", "sa", "s", "i", "ka"]}, s:{name:"Sesshomaru", level:6, fightList:["ke", "m", "sa", "ka", "i"]}, n:{name:"Naraku", level:7, fightList:["ke", "ka", "sa", "m", "i"]}};
p.characterIdToLinkageIdKey = {ke:{figure:"keMoves", fxTop:"keFxTop", fxBottom:"keFxBottom"}, m:{figure:"mMoves", fxTop:"mFxTop", fxBottom:"mFxBottom"}, i:{figure:"iMoves", fxTop:"iFxTop", fxBottom:"iFxBottom"}, ka:{figure:"kaMoves", fxTop:"kaFxTop", fxBottom:"kaFxBottom"}, s:{figure:"sMoves", fxTop:"sFxTop", fxBottom:"sFxBottom"}, n:{figure:"nMoves", fxTop:"nFxTop", fxBottom:"nFxBottom"}, sa:{figure:"saMoves", fxTop:"saFxTop", fxBottom:"saFxBottom"}, ko:{figure:"koMoves", fxTop:"koFxTop", fxBottom:"koFxBottom"}};
p.battleShells = [{figure:{top:r.round_mc.shell_figuresTop_mc.shell_player0_mc, bottom:r.round_mc.shell_figuresBottom_mc.shell_player0_mc}, fx:{top:r.round_mc.shell_FxTop_mc.shell_player0_mc, bottom:r.round_mc.shell_FxBottom_mc.shell_player0_mc}}, {figure:{top:r.round_mc.shell_figuresTop_mc.shell_player1_mc, bottom:r.round_mc.shell_figuresBottom_mc.shell_player1_mc}, fx:{top:r.round_mc.shell_FxTop_mc.shell_player1_mc, bottom:r.round_mc.shell_FxBottom_mc.shell_player1_mc}}];
p.battleLoadingDisplayPrefs = {parent_mc:r, linkName:"loadingBattle", stageName:"loadingBattle_mc", depth:5, initObj:{_x:0, _y:0}};
delete p;
delete g;
delete r;
var g = Object.$POP;
var p = Object.$POP.Prefs;
var r = this;
p.trackStats = ((_root.leaderBoard == "true") ? true : false);
p.easyWin = ((_root.easyWin == "true") ? true : false);
p.difficulty = _root.difficulty;
g.movieMediator = new g.Class.MovieMediator();
g.gameManager = new g.Class.GameManager();
g.movesImpactComputer = new g.Class.MovesImpactComputer();
g.pickMovesManager = new g.Class.PickMovesManager();
g.soundManager = new g.Class.SoundManager();
g.battleLoadManager = new g.Class.ManageBattleLoad();
g.userStatsManager = new g.Class.UserStatsManager();
g.viewRound = new g.Class.ViewRound();
g.viewRoundPlayers = new g.Class.ViewRoundPlayers();
g.viewPickMoves = new g.Class.ViewPickMoves();
g.viewMiniMap = new g.Class.ViewMiniMap();
g.viewPlayersStatus = new g.Class.ViewPlayersStatus();
g.viewPickCharacter = new g.Class.ViewPickCharacter();
g.viewVersus = new g.Class.ViewVersus();
g.viewMatchResult = new g.Class.ViewMatchResult();
g.viewWinGame = new g.Class.ViewWinGame();
g.viewBattleLoading = new g.Class.ViewBattleLoading();
g.computerBrain = new g.Class.ComputerBrain();
g.roundSequenceComputer = new g.Class.RoundSequenceComputer();
g.soundManager.init({soundLinks:p.soundLinks, preMadeSounds:_global.preMadeSounds});
g.movieMediator.init({gameManager:g.gameManager, characterPickerManager:g.viewPickCharacter, viewVersus:g.viewVersus, viewMatchResult:g.viewMatchResult, viewWinGame:g.viewWinGame, viewPlayerStatus:g.viewPlayersStatus, movesDescriptions:p.movesDescriptions, charactersDescriptions:p.charactersDescriptions, playerConstructor:g.Class.PlayerData, characterConstructor:g.Class.CharacterData, moveConstructor:g.Class.MoveData, battleLoadManager:g.battleLoadManager, userStatsManager:g.userStatsManager, soundManager:g.soundManager});
g.userStatsManager.init({});
g.battleLoadManager.init({dir:"characters/", shells:p.battleShells});
g.viewBattleLoading.init({displayPrefs:p.battleLoadingDisplayPrefs, manager:g.gameManager, loadingManager:g.battleLoadManager});
g.gameManager.init({pickMovesManager:g.pickMovesManager, battleLoadManager:g.battleLoadManager, viewRoundManager:g.viewRound, viewMiniMapManager:g.viewMiniMap, viewBattleLoading:g.viewBattleLoading, movesImpactComputer:g.movesImpactComputer, roundSequenceComputer:g.roundSequenceComputer, turnsMax:p.movesMax, map:p.map});
g.pickMovesManager.init({movesMax:p.movesMax, pickMovesView:g.viewPickMoves, gameManager:g.gameManager, computerBrain:g.computerBrain});
g.viewRound.init({display_mc:r.round_mc, cardsDisplay_mc:r.round_mc.moveCards_mc, nextCardButton_mc:r.round_mc.nextCardButton_mc, roundDoneButton_mc:r.round_mc.roundDoneButton_mc, manager:g.gameManager, mapToScreenKey:p.mapToScreenKey, viewPlayers:g.viewRoundPlayers, viewPlayersStatusManager:g.viewPlayersStatus, soundManager:g.soundManager});
g.viewRoundPlayers.init({manager:g.viewRound, mapToScreenKey:p.mapToScreenKey, characterIdToLinkageIdKey:p.characterIdToLinkageIdKey, parentClips:p.battleShells});
g.viewPickMoves.init({display_mc:r.movesPicker_mc, manager:g.pickMovesManager, continueButton_mc:r.movesPicker_mc.panel_mc.continueButton_mc, clearButton_mc:r.movesPicker_mc.panel_mc.clearButton_mc, helpButton_mc:r.movesPicker_mc.panel_mc.helpButton_mc, soundManager:g.soundManager});
g.viewVersus.init({display_mc:r.versus_mc, manager:g.movieMediator, soundManager:g.soundManager});
g.viewMiniMap.init({display_mc:r.movesPicker_mc.panel_mc.miniMap_mc, eventBroadcasters:[g.gameManager], mapToScreenKey:p.miniMapToScreenKey});
g.viewPlayersStatus.init({display_mc:r.playersStatus_mc, eventBroadcasters:[g.gameManager], soundManager:g.soundManager});
g.viewPickCharacter.init({display_mc:r.characterPicker_mc, manager:g.movieMediator, soundManager:g.soundManager});
g.viewMatchResult.init({displayLink:"matchResult", displayParent_mc:r, displayLevel:100, manager:g.movieMediator, soundManager:g.soundManager, winTheme:"themeSong", loseTheme:"youDie", trackStats:p.trackStats, soundManager:g.soundManager});
g.computerBrain.init({movesMax:p.movesMax, map:p.map, movesImpactComputer:g.movesImpactComputer});
g.viewWinGame.init({displayPrefs:{link:"winGame", parent:r, level:100, screenName:"winGame_mc", initObj:{_x:0, _y:0}}, manager:g.movieMediator, soundManager:g.soundManager, ambientAudio:"themeSong"});
g.roundSequenceComputer.init({});
g.movieMediator.start();
delete g;
delete r;
delete p;
Frame 17
stop();
Symbol 44 MovieClip Frame 1
stop();
Symbol 48 MovieClip [FID_regenerate] Frame 41
stop();
Symbol 89 MovieClip Frame 1
stop();
Symbol 103 MovieClip Frame 11
stop();
Symbol 106 MovieClip Frame 26
stop();
Symbol 112 MovieClip Frame 8
stop();
Symbol 113 MovieClip Frame 1
stop();
Symbol 118 MovieClip Frame 38
stop();
Symbol 121 MovieClip Frame 38
stop();
Symbol 124 MovieClip Frame 39
stop();
Symbol 147 MovieClip Frame 14
stop();
Symbol 156 MovieClip Frame 77
stop();
Symbol 159 MovieClip Frame 8
stop();
Symbol 160 MovieClip Frame 1
stop();
Symbol 164 MovieClip Frame 39
stop();
Symbol 167 MovieClip Frame 39
stop();
Symbol 168 MovieClip [matchResult] Frame 1
stop();
Symbol 168 MovieClip [matchResult] Frame 2
stop();
Symbol 168 MovieClip [matchResult] Frame 241
this.done();
Symbol 168 MovieClip [matchResult] Frame 242
stop();
Symbol 187 MovieClip Frame 40
gotoAndPlay (20);
Symbol 202 MovieClip Frame 41
gotoAndPlay (19);
Symbol 209 MovieClip Frame 40
gotoAndPlay (20);
Symbol 216 MovieClip Frame 42
gotoAndPlay (20);
Symbol 217 MovieClip Frame 40
gotoAndPlay (20);
Symbol 218 MovieClip Frame 40
gotoAndPlay (20);
Symbol 219 MovieClip Frame 40
gotoAndPlay (20);
Symbol 220 MovieClip Frame 40
gotoAndPlay (20);
Symbol 221 MovieClip Frame 40
gotoAndPlay (20);
Symbol 229 MovieClip Frame 44
gotoAndPlay (20);
Symbol 231 MovieClip [matchOverMessage] Frame 119
this.onMoveEvent({event:"done"});
Symbol 231 MovieClip [matchOverMessage] Frame 120
stop();
Symbol 232 MovieClip Frame 1
stop();
Symbol 237 MovieClip [FID_damage] Frame 41
stop();
Symbol 238 MovieClip Frame 1
stop();
Symbol 243 MovieClip [FID_guard] Frame 41
stop();
Symbol 247 MovieClip [FID_heal] Frame 41
stop();
Symbol 262 MovieClip [iFxBottom] Frame 2
stop();
Symbol 262 MovieClip [iFxBottom] Frame 56
stop();
Symbol 262 MovieClip [iFxBottom] Frame 108
stop();
Symbol 262 MovieClip [iFxBottom] Frame 147
stop();
Symbol 266 MovieClip [iFxTop] Frame 2
stop();
Symbol 266 MovieClip [iFxTop] Frame 77
stop();
Symbol 266 MovieClip [iFxTop] Frame 84
stop();
Symbol 266 MovieClip [iFxTop] Frame 104
stop();
Symbol 266 MovieClip [iFxTop] Frame 119
stop();
Symbol 266 MovieClip [iFxTop] Frame 210
stop();
Symbol 269 MovieClip [keFxBottom] Frame 5
stop();
Symbol 269 MovieClip [keFxBottom] Frame 36
stop();
Symbol 269 MovieClip [keFxBottom] Frame 229
stop();
Symbol 269 MovieClip [keFxBottom] Frame 269
stop();
Symbol 270 MovieClip [keFxTop] Frame 2
stop();
Symbol 270 MovieClip [keFxTop] Frame 95
stop();
Symbol 270 MovieClip [keFxTop] Frame 106
stop();
Symbol 270 MovieClip [keFxTop] Frame 126
stop();
Symbol 270 MovieClip [keFxTop] Frame 139
stop();
Symbol 270 MovieClip [keFxTop] Frame 229
stop();
Symbol 279 MovieClip [kaFxBottom] Frame 17
stop();
Symbol 279 MovieClip [kaFxBottom] Frame 48
stop();
Symbol 279 MovieClip [kaFxBottom] Frame 130
stop();
Symbol 279 MovieClip [kaFxBottom] Frame 191
stop();
Symbol 280 MovieClip [kaFxTop] Frame 2
stop();
Symbol 280 MovieClip [kaFxTop] Frame 39
stop();
Symbol 280 MovieClip [kaFxTop] Frame 79
stop();
Symbol 280 MovieClip [kaFxTop] Frame 99
stop();
Symbol 280 MovieClip [kaFxTop] Frame 114
stop();
Symbol 283 MovieClip [mFxBottom] Frame 2
stop();
Symbol 283 MovieClip [mFxBottom] Frame 51
stop();
Symbol 283 MovieClip [mFxBottom] Frame 99
stop();
Symbol 283 MovieClip [mFxBottom] Frame 159
stop();
Symbol 283 MovieClip [mFxBottom] Frame 198
stop();
Symbol 284 MovieClip [mFxTop] Frame 2
stop();
Symbol 284 MovieClip [mFxTop] Frame 51
stop();
Symbol 284 MovieClip [mFxTop] Frame 94
stop();
Symbol 284 MovieClip [mFxTop] Frame 101
stop();
Symbol 284 MovieClip [mFxTop] Frame 121
stop();
Symbol 284 MovieClip [mFxTop] Frame 135
stop();
Symbol 284 MovieClip [mFxTop] Frame 229
stop();
Symbol 287 MovieClip [nFxBottom] Frame 2
stop();
Symbol 287 MovieClip [nFxBottom] Frame 43
stop();
Symbol 287 MovieClip [nFxBottom] Frame 270
stop();
Symbol 287 MovieClip [nFxBottom] Frame 330
stop();
Symbol 288 MovieClip [nFxTop] Frame 3
stop();
Symbol 288 MovieClip [nFxTop] Frame 45
stop();
Symbol 288 MovieClip [nFxTop] Frame 112
stop();
Symbol 288 MovieClip [nFxTop] Frame 132
stop();
Symbol 288 MovieClip [nFxTop] Frame 149
stop();
Symbol 294 MovieClip [sFxBottom] Frame 2
stop();
Symbol 294 MovieClip [sFxBottom] Frame 54
stop();
Symbol 294 MovieClip [sFxBottom] Frame 115
stop();
Symbol 294 MovieClip [sFxBottom] Frame 169
stop();
Symbol 295 MovieClip [sFXTop] Frame 3
stop();
Symbol 295 MovieClip [sFXTop] Frame 55
stop();
Symbol 295 MovieClip [sFXTop] Frame 61
stop();
Symbol 295 MovieClip [sFXTop] Frame 81
stop();
Symbol 295 MovieClip [sFXTop] Frame 94
stop();
Symbol 295 MovieClip [sFXTop] Frame 139
stop();
Symbol 299 MovieClip [koFxBottom] Frame 2
stop();
Symbol 299 MovieClip [koFxBottom] Frame 54
stop();
Symbol 299 MovieClip [koFxBottom] Frame 270
stop();
Symbol 299 MovieClip [koFxBottom] Frame 310
stop();
Symbol 300 MovieClip [koFxTop] Frame 3
stop();
Symbol 300 MovieClip [koFxTop] Frame 75
stop();
Symbol 300 MovieClip [koFxTop] Frame 84
stop();
Symbol 300 MovieClip [koFxTop] Frame 103
stop();
Symbol 300 MovieClip [koFxTop] Frame 149
stop();
Symbol 303 MovieClip [saFxBottom] Frame 2
stop();
Symbol 303 MovieClip [saFxBottom] Frame 49
stop();
Symbol 303 MovieClip [saFxBottom] Frame 89
stop();
Symbol 303 MovieClip [saFxBottom] Frame 259
stop();
Symbol 304 MovieClip [saFxTop] Frame 3
stop();
Symbol 304 MovieClip [saFxTop] Frame 54
stop();
Symbol 304 MovieClip [saFxTop] Frame 70
stop();
Symbol 304 MovieClip [saFxTop] Frame 90
stop();
Symbol 304 MovieClip [saFxTop] Frame 131
stop();
Symbol 309 MovieClip Frame 1
stop();
Symbol 317 MovieClip Frame 25
stop();
Symbol 320 MovieClip Frame 7
stop();
Symbol 321 Button
on (release) {
this.gotoAndStop(2);
}
Symbol 323 MovieClip Frame 7
stop();
Symbol 343 MovieClip Frame 9
stop();
Symbol 345 Button
on (release) {
_root.difficulty = "hard";
this._parent._parent.play();
}
Symbol 350 MovieClip Frame 9
stop();
Symbol 351 Button
on (release) {
_root.difficulty = "normal";
this._parent._parent.play();
}
Symbol 376 MovieClip Frame 17
stop();
Symbol 377 MovieClip Frame 1
stop();
Symbol 415 MovieClip Frame 10
stop();
Symbol 416 MovieClip Frame 1
stop();
Symbol 421 MovieClip Frame 10
stop();
Symbol 422 MovieClip Frame 1
stop();
Symbol 429 MovieClip Frame 10
stop();
Symbol 430 MovieClip Frame 1
stop();
Symbol 448 MovieClip Frame 1
stop();
Symbol 464 MovieClip Frame 1
stop();
Symbol 741 MovieClip Frame 5
stop();
Symbol 762 MovieClip Frame 1
stop();
Symbol 762 MovieClip Frame 6
stop();
Symbol 762 MovieClip Frame 17
stop();
Symbol 770 MovieClip Frame 1
stop();
Symbol 770 MovieClip Frame 6
stop();
Symbol 770 MovieClip Frame 17
stop();
Symbol 775 MovieClip Frame 1
stop();
Symbol 775 MovieClip Frame 6
stop();
Symbol 777 Button
on (rollOver) {
nextbutton.gotoAndPlay("over");
}
on (rollOut) {
nextbutton.gotoAndStop("up");
}
on (release) {
gotoAndPlay ("helpPage2");
}
Symbol 778 Button
on (rollOver) {
closebutton.gotoAndStop("over");
}
on (rollOut) {
closebutton.gotoAndStop("up");
}
on (release) {
this.onClose();
gotoAndPlay ("close");
}
Symbol 826 MovieClip Frame 1
stop();
Symbol 828 Button
on (rollOver) {
backbutton.gotoAndPlay("over");
}
on (rollOut) {
backbutton.gotoAndStop("up");
}
on (release) {
gotoAndPlay ("helpPage1");
}
Symbol 829 Button
on (rollOver) {
nextbutton.gotoAndPlay("over");
}
on (rollOut) {
nextbutton.gotoAndStop("up");
}
on (release) {
gotoAndPlay ("helpPage3");
}
Symbol 835 MovieClip Frame 10
stop();
Symbol 838 Button
on (rollOver) {
backbutton.gotoAndPlay("over");
}
on (rollOut) {
backbutton.gotoAndStop("up");
}
on (release) {
gotoAndPlay ("helpPage2");
}
Symbol 839 Button
on (rollOver) {
nextbutton.gotoAndPlay("over");
}
on (rollOut) {
nextbutton.gotoAndStop("up");
}
on (release) {
gotoAndPlay ("helpPage4");
}
Symbol 856 Button
on (rollOver) {
backbutton.gotoAndPlay("over");
}
on (rollOut) {
backbutton.gotoAndStop("up");
}
on (release) {
gotoAndPlay ("helpPage3");
}
Symbol 857 Button
on (rollOver) {
nextbutton.gotoAndPlay("over");
}
on (rollOut) {
nextbutton.gotoAndStop("up");
}
on (release) {
nextbutton.gotoAndStop("disabled");
gotoAndPlay ("helpPage5");
}
Symbol 866 MovieClip Frame 20
stop();
Symbol 872 MovieClip Frame 1
stop();
Symbol 872 MovieClip Frame 12
stop();
Symbol 873 Button
on (rollOver) {
backbutton.gotoAndPlay("over");
}
on (rollOut) {
backbutton.gotoAndStop("up");
}
on (release) {
nextbutton.gotoAndStop("up");
gotoAndPlay ("helpPage4");
}
Symbol 874 Button
on (rollOver) {
fightbutton.gotoAndPlay("over");
}
on (rollOut) {
fightbutton.gotoAndStop("up");
}
on (release) {
this.onClose();
gotoAndPlay ("close");
}
Symbol 875 MovieClip Frame 1
stop();
Symbol 875 MovieClip Frame 7
backbutton.gotoAndPlay("disabled");
nextbutton.gotoAndStop("up");
Symbol 875 MovieClip Frame 25
stop();
Symbol 875 MovieClip Frame 26
backbutton.gotoAndStop("up");
Symbol 875 MovieClip Frame 45
stop();
Symbol 875 MovieClip Frame 65
stop();
Symbol 875 MovieClip Frame 66
nextbutton.gotoAndStop("up");
Symbol 875 MovieClip Frame 85
stop();
Symbol 875 MovieClip Frame 105
stop();
Symbol 875 MovieClip Frame 112
stop();
Symbol 895 Button
on (release) {
gotoAndPlay ("show5");
}
Symbol 896 Button
on (release) {
gotoAndPlay ("show4");
}
Symbol 897 Button
on (release) {
gotoAndPlay ("show3");
}
Symbol 898 Button
on (release) {
gotoAndPlay ("show2");
}
Symbol 899 Button
on (release) {
gotoAndPlay ("show1");
}
Symbol 905 MovieClip Frame 1
stop();
Symbol 905 MovieClip Frame 41
stop();
Symbol 905 MovieClip Frame 65
this.gotoAndPlay("outtro");
Symbol 905 MovieClip Frame 90
this.gotoAndPlay("outtro");
Symbol 905 MovieClip Frame 120
this.gotoAndPlay("outtro");
Symbol 905 MovieClip Frame 150
this.gotoAndPlay("outtro");
Symbol 905 MovieClip Frame 176
this.gotoAndPlay("outtro");
Symbol 905 MovieClip Frame 183
this.manager.userPickedShard();
Symbol 920 MovieClip Frame 12
gotoAndPlay (1);
Symbol 975 MovieClip Frame 976
gotoAndPlay (1);
Symbol 1004 MovieClip Frame 1497
gotoAndPlay (1);
Symbol 1031 MovieClip Frame 2
stop();
Symbol 1038 MovieClip Frame 18
stop();
Symbol 1042 MovieClip Frame 18
stop();
Symbol 1046 MovieClip Frame 18
stop();
Symbol 1047 MovieClip Frame 1
stop();
Symbol 1053 MovieClip Frame 2
stop();
Symbol 1053 MovieClip Frame 40
this.onMoveEvent({event:"done"});
Symbol 1053 MovieClip Frame 41
stop();
Symbol 1053 MovieClip Frame 79
this.onMoveEvent({event:"done"});
Symbol 1053 MovieClip Frame 80
stop();
Symbol 1053 MovieClip Frame 119
this.onMoveEvent({event:"done"});
Symbol 1053 MovieClip Frame 120
stop();
Symbol 1061 Button
on (release) {
this.onMoveEvent({event:"done"});
}
Symbol 1062 MovieClip Frame 4
stop();
Symbol 1062 MovieClip Frame 14
stop();
Symbol 1062 MovieClip Frame 18
stop();
Symbol 1063 MovieClip Frame 1
stop();
Symbol 1064 MovieClip Frame 1
stop();
Symbol 1096 MovieClip Frame 1
stop();
Symbol 1147 MovieClip Frame 1
stop();
Symbol 1155 MovieClip Frame 1
stop();
Symbol 1179 MovieClip Frame 1
stop();
Symbol 1182 MovieClip Frame 2
stop();
Symbol 1182 MovieClip Frame 11
stop();
Symbol 1225 MovieClip Frame 17
stop();
Symbol 1225 MovieClip Frame 34
stop();
Symbol 1225 MovieClip Frame 51
stop();
Symbol 1225 MovieClip Frame 68
stop();
Symbol 1225 MovieClip Frame 85
stop();
Symbol 1225 MovieClip Frame 102
stop();
Symbol 1225 MovieClip Frame 119
stop();
Symbol 1225 MovieClip Frame 136
stop();
Symbol 1228 MovieClip Frame 17
stop();
Symbol 1228 MovieClip Frame 34
stop();
Symbol 1228 MovieClip Frame 51
stop();
Symbol 1228 MovieClip Frame 68
stop();
Symbol 1228 MovieClip Frame 85
stop();
Symbol 1228 MovieClip Frame 102
stop();
Symbol 1228 MovieClip Frame 119
stop();
Symbol 1228 MovieClip Frame 136
stop();
Symbol 1237 MovieClip Frame 9
stop();
Symbol 1238 MovieClip Frame 1
stop();
Symbol 1243 MovieClip Frame 9
stop();
Symbol 1244 MovieClip Frame 1
stop();
Symbol 1251 MovieClip Frame 1
stop();
Symbol 1271 MovieClip Frame 1
stop();
Symbol 1271 MovieClip Frame 8
stop();