Section 1
//NewgroundsAPIAsset_API_Conencted_4 (APIConnector_fla.NewgroundsAPIAsset_API_Conencted_4)
package APIConnector_fla {
import flash.display.*;
import com.newgrounds.components.*;
public dynamic class NewgroundsAPIAsset_API_Conencted_4 extends MovieClip {
public function NewgroundsAPIAsset_API_Conencted_4(){
addFrameScript(36, this.frame37);
}
function frame37(){
APIConnector(parent).clear();
}
}
}//package APIConnector_fla
Section 2
//NewgroundsAPIAsset_ConnectingAPI_2 (APIConnector_fla.NewgroundsAPIAsset_ConnectingAPI_2)
package APIConnector_fla {
import flash.display.*;
public dynamic class NewgroundsAPIAsset_ConnectingAPI_2 extends MovieClip {
public function NewgroundsAPIAsset_ConnectingAPI_2(){
addFrameScript(9, this.frame10);
}
function frame10(){
stop();
}
}
}//package APIConnector_fla
Section 3
//NewgroundsAPIAsset_Connection_Error_7 (APIConnector_fla.NewgroundsAPIAsset_Connection_Error_7)
package APIConnector_fla {
import flash.display.*;
import com.newgrounds.components.*;
public dynamic class NewgroundsAPIAsset_Connection_Error_7 extends MovieClip {
public function NewgroundsAPIAsset_Connection_Error_7(){
addFrameScript(9, this.frame10, 20, this.frame21);
}
function frame10(){
stop();
}
function frame21(){
APIConnector(parent).clear();
}
}
}//package APIConnector_fla
Section 4
//NewgroundsAPIAsset_Load_Indicator_3 (APIConnector_fla.NewgroundsAPIAsset_Load_Indicator_3)
package APIConnector_fla {
import flash.events.*;
import flash.display.*;
public dynamic class NewgroundsAPIAsset_Load_Indicator_3 extends MovieClip {
public function NewgroundsAPIAsset_Load_Indicator_3(){
addFrameScript(0, this.frame1);
}
public function onEnterFrame(_arg1:Event):void{
if (((visible) && (stage))){
rotation = (rotation + 30);
} else {
removeEventListener(Event.ENTER_FRAME, this.onEnterFrame);
};
}
function frame1(){
addEventListener(Event.ENTER_FRAME, this.onEnterFrame);
}
}
}//package APIConnector_fla
Section 5
//NewgroundsAPIAsset_Login_Warning_5 (APIConnector_fla.NewgroundsAPIAsset_Login_Warning_5)
package APIConnector_fla {
import flash.display.*;
import com.newgrounds.components.*;
public dynamic class NewgroundsAPIAsset_Login_Warning_5 extends MovieClip {
public function NewgroundsAPIAsset_Login_Warning_5(){
addFrameScript(9, this.frame10, 20, this.frame21);
}
function frame10(){
stop();
}
function frame21(){
APIConnector(parent).clear();
}
}
}//package APIConnector_fla
Section 6
//MD5 (com.adobe.crypto.MD5)
package com.adobe.crypto {
import flash.utils.*;
import com.adobe.utils.*;
public class MD5 {
public static var digest:ByteArray;
public static function hash(_arg1:String):String{
var _local2:ByteArray = new ByteArray();
_local2.writeUTFBytes(_arg1);
return (hashBinary(_local2));
}
public static function hashBytes(_arg1:ByteArray):String{
return (hashBinary(_arg1));
}
public static function hashBinary(_arg1:ByteArray):String{
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local2 = 1732584193;
var _local3 = -271733879;
var _local4 = -1732584194;
var _local5 = 271733878;
var _local10:Array = createBlocks(_arg1);
var _local11:int = _local10.length;
var _local12:int;
while (_local12 < _local11) {
_local6 = _local2;
_local7 = _local3;
_local8 = _local4;
_local9 = _local5;
_local2 = ff(_local2, _local3, _local4, _local5, _local10[int((_local12 + 0))], 7, -680876936);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[int((_local12 + 1))], 12, -389564586);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[int((_local12 + 2))], 17, 606105819);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[int((_local12 + 3))], 22, -1044525330);
_local2 = ff(_local2, _local3, _local4, _local5, _local10[int((_local12 + 4))], 7, -176418897);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[int((_local12 + 5))], 12, 1200080426);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[int((_local12 + 6))], 17, -1473231341);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[int((_local12 + 7))], 22, -45705983);
_local2 = ff(_local2, _local3, _local4, _local5, _local10[int((_local12 + 8))], 7, 1770035416);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[int((_local12 + 9))], 12, -1958414417);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[int((_local12 + 10))], 17, -42063);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[int((_local12 + 11))], 22, -1990404162);
_local2 = ff(_local2, _local3, _local4, _local5, _local10[int((_local12 + 12))], 7, 1804603682);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[int((_local12 + 13))], 12, -40341101);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[int((_local12 + 14))], 17, -1502002290);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[int((_local12 + 15))], 22, 1236535329);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[int((_local12 + 1))], 5, -165796510);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[int((_local12 + 6))], 9, -1069501632);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[int((_local12 + 11))], 14, 643717713);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[int((_local12 + 0))], 20, -373897302);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[int((_local12 + 5))], 5, -701558691);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[int((_local12 + 10))], 9, 38016083);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[int((_local12 + 15))], 14, -660478335);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[int((_local12 + 4))], 20, -405537848);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[int((_local12 + 9))], 5, 568446438);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[int((_local12 + 14))], 9, -1019803690);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[int((_local12 + 3))], 14, -187363961);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[int((_local12 + 8))], 20, 1163531501);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[int((_local12 + 13))], 5, -1444681467);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[int((_local12 + 2))], 9, -51403784);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[int((_local12 + 7))], 14, 1735328473);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[int((_local12 + 12))], 20, -1926607734);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[int((_local12 + 5))], 4, -378558);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[int((_local12 + 8))], 11, -2022574463);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[int((_local12 + 11))], 16, 1839030562);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[int((_local12 + 14))], 23, -35309556);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[int((_local12 + 1))], 4, -1530992060);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[int((_local12 + 4))], 11, 1272893353);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[int((_local12 + 7))], 16, -155497632);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[int((_local12 + 10))], 23, -1094730640);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[int((_local12 + 13))], 4, 681279174);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[int((_local12 + 0))], 11, -358537222);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[int((_local12 + 3))], 16, -722521979);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[int((_local12 + 6))], 23, 76029189);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[int((_local12 + 9))], 4, -640364487);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[int((_local12 + 12))], 11, -421815835);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[int((_local12 + 15))], 16, 530742520);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[int((_local12 + 2))], 23, -995338651);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[int((_local12 + 0))], 6, -198630844);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[int((_local12 + 7))], 10, 1126891415);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[int((_local12 + 14))], 15, -1416354905);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[int((_local12 + 5))], 21, -57434055);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[int((_local12 + 12))], 6, 1700485571);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[int((_local12 + 3))], 10, -1894986606);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[int((_local12 + 10))], 15, -1051523);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[int((_local12 + 1))], 21, -2054922799);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[int((_local12 + 8))], 6, 1873313359);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[int((_local12 + 15))], 10, -30611744);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[int((_local12 + 6))], 15, -1560198380);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[int((_local12 + 13))], 21, 1309151649);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[int((_local12 + 4))], 6, -145523070);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[int((_local12 + 11))], 10, -1120210379);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[int((_local12 + 2))], 15, 718787259);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[int((_local12 + 9))], 21, -343485551);
_local2 = (_local2 + _local6);
_local3 = (_local3 + _local7);
_local4 = (_local4 + _local8);
_local5 = (_local5 + _local9);
_local12 = (_local12 + 16);
};
digest = new ByteArray();
digest.writeInt(_local2);
digest.writeInt(_local3);
digest.writeInt(_local4);
digest.writeInt(_local5);
digest.position = 0;
return ((((IntUtil.toHex(_local2) + IntUtil.toHex(_local3)) + IntUtil.toHex(_local4)) + IntUtil.toHex(_local5)));
}
private static function f(_arg1:int, _arg2:int, _arg3:int):int{
return (((_arg1 & _arg2) | (~(_arg1) & _arg3)));
}
private static function g(_arg1:int, _arg2:int, _arg3:int):int{
return (((_arg1 & _arg3) | (_arg2 & ~(_arg3))));
}
private static function h(_arg1:int, _arg2:int, _arg3:int):int{
return (((_arg1 ^ _arg2) ^ _arg3));
}
private static function i(_arg1:int, _arg2:int, _arg3:int):int{
return ((_arg2 ^ (_arg1 | ~(_arg3))));
}
private static function transform(_arg1:Function, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int, _arg8:int):int{
var _local9:int = (((_arg2 + int(_arg1(_arg3, _arg4, _arg5))) + _arg6) + _arg8);
return ((IntUtil.rol(_local9, _arg7) + _arg3));
}
private static function ff(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (transform(f, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
private static function gg(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (transform(g, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
private static function hh(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (transform(h, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
private static function ii(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (transform(i, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
private static function createBlocks(_arg1:ByteArray):Array{
var _local2:Array = new Array();
var _local3:int = (_arg1.length * 8);
var _local4 = 0xFF;
var _local5:int;
while (_local5 < _local3) {
_local2[int((_local5 >> 5))] = (_local2[int((_local5 >> 5))] | ((_arg1[(_local5 / 8)] & _local4) << (_local5 % 32)));
_local5 = (_local5 + 8);
};
_local2[int((_local3 >> 5))] = (_local2[int((_local3 >> 5))] | (128 << (_local3 % 32)));
_local2[int(((((_local3 + 64) >>> 9) << 4) + 14))] = _local3;
return (_local2);
}
}
}//package com.adobe.crypto
Section 7
//PNGEncoder (com.adobe.images.PNGEncoder)
package com.adobe.images {
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
public class PNGEncoder {
private static var crcTable:Array;
private static var crcTableComputed:Boolean = false;
public static function encode(_arg1:BitmapData):ByteArray{
var _local6:uint;
var _local7:int;
var _local2:ByteArray = new ByteArray();
_local2.writeUnsignedInt(2303741511);
_local2.writeUnsignedInt(218765834);
var _local3:ByteArray = new ByteArray();
_local3.writeInt(_arg1.width);
_local3.writeInt(_arg1.height);
_local3.writeUnsignedInt(134610944);
_local3.writeByte(0);
writeChunk(_local2, 1229472850, _local3);
var _local4:ByteArray = new ByteArray();
var _local5:int;
while (_local5 < _arg1.height) {
_local4.writeByte(0);
if (!_arg1.transparent){
_local7 = 0;
while (_local7 < _arg1.width) {
_local6 = _arg1.getPixel(_local7, _local5);
_local4.writeUnsignedInt(uint((((_local6 & 0xFFFFFF) << 8) | 0xFF)));
_local7++;
};
} else {
_local7 = 0;
while (_local7 < _arg1.width) {
_local6 = _arg1.getPixel32(_local7, _local5);
_local4.writeUnsignedInt(uint((((_local6 & 0xFFFFFF) << 8) | (_local6 >>> 24))));
_local7++;
};
};
_local5++;
};
_local4.compress();
writeChunk(_local2, 1229209940, _local4);
writeChunk(_local2, 1229278788, null);
return (_local2);
}
private static function writeChunk(_arg1:ByteArray, _arg2:uint, _arg3:ByteArray):void{
var _local8:uint;
var _local9:uint;
var _local10:uint;
if (!crcTableComputed){
crcTableComputed = true;
crcTable = [];
_local9 = 0;
while (_local9 < 0x0100) {
_local8 = _local9;
_local10 = 0;
while (_local10 < 8) {
if ((_local8 & 1)){
_local8 = uint((uint(3988292384) ^ uint((_local8 >>> 1))));
} else {
_local8 = uint((_local8 >>> 1));
};
_local10++;
};
crcTable[_local9] = _local8;
_local9++;
};
};
var _local4:uint;
if (_arg3 != null){
_local4 = _arg3.length;
};
_arg1.writeUnsignedInt(_local4);
var _local5:uint = _arg1.position;
_arg1.writeUnsignedInt(_arg2);
if (_arg3 != null){
_arg1.writeBytes(_arg3);
};
var _local6:uint = _arg1.position;
_arg1.position = _local5;
_local8 = 4294967295;
var _local7:int;
while (_local7 < (_local6 - _local5)) {
_local8 = uint((crcTable[((_local8 ^ _arg1.readUnsignedByte()) & uint(0xFF))] ^ uint((_local8 >>> 8))));
_local7++;
};
_local8 = uint((_local8 ^ uint(4294967295)));
_arg1.position = _local6;
_arg1.writeUnsignedInt(_local8);
}
}
}//package com.adobe.images
Section 8
//JSON (com.adobe.serialization.json.JSON)
package com.adobe.serialization.json {
public class JSON {
public static function encode(_arg1:Object):String{
var _local2:JSONEncoder = new JSONEncoder(_arg1);
return (_local2.getString());
}
public static function decode(_arg1:String){
var _local2:JSONDecoder = new JSONDecoder(_arg1);
return (_local2.getValue());
}
}
}//package com.adobe.serialization.json
Section 9
//JSONDecoder (com.adobe.serialization.json.JSONDecoder)
package com.adobe.serialization.json {
public class JSONDecoder {
private var value;
private var tokenizer:JSONTokenizer;
private var token:JSONToken;
public function JSONDecoder(_arg1:String){
this.tokenizer = new JSONTokenizer(_arg1);
this.nextToken();
this.value = this.parseValue();
}
public function getValue(){
return (this.value);
}
private function nextToken():JSONToken{
return ((this.token = this.tokenizer.getNextToken()));
}
private function parseArray():Array{
var _local1:Array = new Array();
this.nextToken();
if (this.token.type == JSONTokenType.RIGHT_BRACKET){
return (_local1);
};
while (true) {
_local1.push(this.parseValue());
this.nextToken();
if (this.token.type == JSONTokenType.RIGHT_BRACKET){
return (_local1);
};
if (this.token.type == JSONTokenType.COMMA){
this.nextToken();
} else {
this.tokenizer.parseError(("Expecting ] or , but found " + this.token.value));
};
};
return (null);
}
private function parseObject():Object{
var _local2:String;
var _local1:Object = new Object();
this.nextToken();
if (this.token.type == JSONTokenType.RIGHT_BRACE){
return (_local1);
};
while (true) {
if (this.token.type == JSONTokenType.STRING){
_local2 = String(this.token.value);
this.nextToken();
if (this.token.type == JSONTokenType.COLON){
this.nextToken();
_local1[_local2] = this.parseValue();
this.nextToken();
if (this.token.type == JSONTokenType.RIGHT_BRACE){
return (_local1);
};
if (this.token.type == JSONTokenType.COMMA){
this.nextToken();
} else {
this.tokenizer.parseError(("Expecting } or , but found " + this.token.value));
};
} else {
this.tokenizer.parseError(("Expecting : but found " + this.token.value));
};
} else {
this.tokenizer.parseError(("Expecting string but found " + this.token.value));
};
};
return (null);
}
private function parseValue():Object{
if (this.token == null){
this.tokenizer.parseError("Unexpected end of input");
};
switch (this.token.type){
case JSONTokenType.LEFT_BRACE:
return (this.parseObject());
case JSONTokenType.LEFT_BRACKET:
return (this.parseArray());
case JSONTokenType.STRING:
case JSONTokenType.NUMBER:
case JSONTokenType.TRUE:
case JSONTokenType.FALSE:
case JSONTokenType.NULL:
return (this.token.value);
default:
this.tokenizer.parseError(("Unexpected " + this.token.value));
};
return (null);
}
}
}//package com.adobe.serialization.json
Section 10
//JSONEncoder (com.adobe.serialization.json.JSONEncoder)
package com.adobe.serialization.json {
import flash.utils.*;
public class JSONEncoder {
private var jsonString:String;
public function JSONEncoder(_arg1){
this.jsonString = this.convertToString(_arg1);
}
public function getString():String{
return (this.jsonString);
}
private function convertToString(_arg1):String{
if ((_arg1 is String)){
return (this.escapeString((_arg1 as String)));
};
if ((_arg1 is Number)){
return ((isFinite((_arg1 as Number))) ? _arg1.toString() : "null");
} else {
if ((_arg1 is Boolean)){
return ((_arg1) ? "true" : "false");
} else {
if ((_arg1 is Array)){
return (this.arrayToString((_arg1 as Array)));
};
if ((((_arg1 is Object)) && (!((_arg1 == null))))){
return (this.objectToString(_arg1));
};
};
};
return ("null");
}
private function escapeString(_arg1:String):String{
var _local3:String;
var _local6:String;
var _local7:String;
var _local2 = "";
var _local4:Number = _arg1.length;
var _local5:int;
while (_local5 < _local4) {
_local3 = _arg1.charAt(_local5);
switch (_local3){
case "\"":
_local2 = (_local2 + "\\\"");
break;
case "\\":
_local2 = (_local2 + "\\\\");
break;
case "\b":
_local2 = (_local2 + "\\b");
break;
case "\f":
_local2 = (_local2 + "\\f");
break;
case "\n":
_local2 = (_local2 + "\\n");
break;
case "\r":
_local2 = (_local2 + "\\r");
break;
case "\t":
_local2 = (_local2 + "\\t");
break;
default:
if (_local3 < " "){
_local6 = _local3.charCodeAt(0).toString(16);
_local7 = ((_local6.length == 2)) ? "00" : "000";
_local2 = (_local2 + (("\\u" + _local7) + _local6));
} else {
_local2 = (_local2 + _local3);
};
};
_local5++;
};
return ((("\"" + _local2) + "\""));
}
private function arrayToString(_arg1:Array):String{
var _local2 = "";
var _local3:int;
while (_local3 < _arg1.length) {
if (_local2.length > 0){
_local2 = (_local2 + ",");
};
_local2 = (_local2 + this.convertToString(_arg1[_local3]));
_local3++;
};
return ((("[" + _local2) + "]"));
}
private function objectToString(_arg1:Object):String{
var value:Object;
var key:String;
var v:XML;
var o = _arg1;
var s = "";
var classInfo:XML = describeType(o);
if (classInfo.@name.toString() == "Object"){
for (key in o) {
value = o[key];
if ((value is Function)){
} else {
if (s.length > 0){
s = (s + ",");
};
s = (s + ((this.escapeString(key) + ":") + this.convertToString(value)));
};
};
} else {
for each (v in classInfo..*.(((name() == "variable")) || ((name() == "accessor")))) {
if (s.length > 0){
s = (s + ",");
};
s = (s + ((this.escapeString(v.@name.toString()) + ":") + this.convertToString(o[v.@name])));
};
};
return ((("{" + s) + "}"));
}
}
}//package com.adobe.serialization.json
Section 11
//JSONParseError (com.adobe.serialization.json.JSONParseError)
package com.adobe.serialization.json {
public class JSONParseError extends Error {
private var _location:int;
private var _text:String;
public function JSONParseError(_arg1:String="", _arg2:int=0, _arg3:String=""){
super(_arg1);
name = "JSONParseError";
this._location = _arg2;
this._text = _arg3;
}
public function get location():int{
return (this._location);
}
public function get text():String{
return (this._text);
}
}
}//package com.adobe.serialization.json
Section 12
//JSONToken (com.adobe.serialization.json.JSONToken)
package com.adobe.serialization.json {
public class JSONToken {
private var _type:int;
private var _value:Object;
public function JSONToken(_arg1:int=-1, _arg2:Object=null){
this._type = _arg1;
this._value = _arg2;
}
public function get type():int{
return (this._type);
}
public function set type(_arg1:int):void{
this._type = _arg1;
}
public function get value():Object{
return (this._value);
}
public function set value(_arg1:Object):void{
this._value = _arg1;
}
}
}//package com.adobe.serialization.json
Section 13
//JSONTokenizer (com.adobe.serialization.json.JSONTokenizer)
package com.adobe.serialization.json {
public class JSONTokenizer {
private var obj:Object;
private var jsonString:String;
private var loc:int;
private var ch:String;
public function JSONTokenizer(_arg1:String){
this.jsonString = _arg1;
this.loc = 0;
this.nextChar();
}
public function getNextToken():JSONToken{
var _local2:String;
var _local3:String;
var _local4:String;
var _local1:JSONToken = new JSONToken();
this.skipIgnored();
switch (this.ch){
case "{":
_local1.type = JSONTokenType.LEFT_BRACE;
_local1.value = "{";
this.nextChar();
break;
case "}":
_local1.type = JSONTokenType.RIGHT_BRACE;
_local1.value = "}";
this.nextChar();
break;
case "[":
_local1.type = JSONTokenType.LEFT_BRACKET;
_local1.value = "[";
this.nextChar();
break;
case "]":
_local1.type = JSONTokenType.RIGHT_BRACKET;
_local1.value = "]";
this.nextChar();
break;
case ",":
_local1.type = JSONTokenType.COMMA;
_local1.value = ",";
this.nextChar();
break;
case ":":
_local1.type = JSONTokenType.COLON;
_local1.value = ":";
this.nextChar();
break;
case "t":
_local2 = ((("t" + this.nextChar()) + this.nextChar()) + this.nextChar());
if (_local2 == "true"){
_local1.type = JSONTokenType.TRUE;
_local1.value = true;
this.nextChar();
} else {
this.parseError(("Expecting 'true' but found " + _local2));
};
break;
case "f":
_local3 = (((("f" + this.nextChar()) + this.nextChar()) + this.nextChar()) + this.nextChar());
if (_local3 == "false"){
_local1.type = JSONTokenType.FALSE;
_local1.value = false;
this.nextChar();
} else {
this.parseError(("Expecting 'false' but found " + _local3));
};
break;
case "n":
_local4 = ((("n" + this.nextChar()) + this.nextChar()) + this.nextChar());
if (_local4 == "null"){
_local1.type = JSONTokenType.NULL;
_local1.value = null;
this.nextChar();
} else {
this.parseError(("Expecting 'null' but found " + _local4));
};
break;
case "\"":
_local1 = this.readString();
break;
default:
if (((this.isDigit(this.ch)) || ((this.ch == "-")))){
_local1 = this.readNumber();
} else {
if (this.ch == ""){
return (null);
};
this.parseError((("Unexpected " + this.ch) + " encountered"));
};
};
return (_local1);
}
private function readString():JSONToken{
var _local3:String;
var _local4:int;
var _local1:JSONToken = new JSONToken();
_local1.type = JSONTokenType.STRING;
var _local2 = "";
this.nextChar();
while (((!((this.ch == "\""))) && (!((this.ch == ""))))) {
if (this.ch == "\\"){
this.nextChar();
switch (this.ch){
case "\"":
_local2 = (_local2 + "\"");
break;
case "/":
_local2 = (_local2 + "/");
break;
case "\\":
_local2 = (_local2 + "\\");
break;
case "b":
_local2 = (_local2 + "\b");
break;
case "f":
_local2 = (_local2 + "\f");
break;
case "n":
_local2 = (_local2 + "\n");
break;
case "r":
_local2 = (_local2 + "\r");
break;
case "t":
_local2 = (_local2 + "\t");
break;
case "u":
_local3 = "";
_local4 = 0;
while (_local4 < 4) {
if (!this.isHexDigit(this.nextChar())){
this.parseError((" Excepted a hex digit, but found: " + this.ch));
};
_local3 = (_local3 + this.ch);
_local4++;
};
_local2 = (_local2 + String.fromCharCode(parseInt(_local3, 16)));
break;
default:
_local2 = (_local2 + ("\\" + this.ch));
};
} else {
_local2 = (_local2 + this.ch);
};
this.nextChar();
};
if (this.ch == ""){
this.parseError("Unterminated string literal");
};
this.nextChar();
_local1.value = _local2;
return (_local1);
}
private function readNumber():JSONToken{
var _local1:JSONToken = new JSONToken();
_local1.type = JSONTokenType.NUMBER;
var _local2 = "";
if (this.ch == "-"){
_local2 = (_local2 + "-");
this.nextChar();
};
if (!this.isDigit(this.ch)){
this.parseError("Expecting a digit");
};
if (this.ch == "0"){
_local2 = (_local2 + this.ch);
this.nextChar();
if (this.isDigit(this.ch)){
this.parseError("A digit cannot immediately follow 0");
};
} else {
while (this.isDigit(this.ch)) {
_local2 = (_local2 + this.ch);
this.nextChar();
};
};
if (this.ch == "."){
_local2 = (_local2 + ".");
this.nextChar();
if (!this.isDigit(this.ch)){
this.parseError("Expecting a digit");
};
while (this.isDigit(this.ch)) {
_local2 = (_local2 + this.ch);
this.nextChar();
};
};
if ((((this.ch == "e")) || ((this.ch == "E")))){
_local2 = (_local2 + "e");
this.nextChar();
if ((((this.ch == "+")) || ((this.ch == "-")))){
_local2 = (_local2 + this.ch);
this.nextChar();
};
if (!this.isDigit(this.ch)){
this.parseError("Scientific notation number needs exponent value");
};
while (this.isDigit(this.ch)) {
_local2 = (_local2 + this.ch);
this.nextChar();
};
};
var _local3:Number = Number(_local2);
if (((isFinite(_local3)) && (!(isNaN(_local3))))){
_local1.value = _local3;
return (_local1);
};
this.parseError((("Number " + _local3) + " is not valid!"));
return (null);
}
private function nextChar():String{
return ((this.ch = this.jsonString.charAt(this.loc++)));
}
private function skipIgnored():void{
var _local1:int;
do {
_local1 = this.loc;
this.skipWhite();
this.skipComments();
} while (_local1 != this.loc);
}
private function skipComments():void{
if (this.ch == "/"){
this.nextChar();
switch (this.ch){
case "/":
do {
this.nextChar();
} while (((!((this.ch == "\n"))) && (!((this.ch == "")))));
this.nextChar();
break;
case "*":
this.nextChar();
while (true) {
if (this.ch == "*"){
this.nextChar();
if (this.ch == "/"){
this.nextChar();
break;
};
} else {
this.nextChar();
};
if (this.ch == ""){
this.parseError("Multi-line comment not closed");
};
};
break;
default:
this.parseError((("Unexpected " + this.ch) + " encountered (expecting '/' or '*' )"));
};
};
}
private function skipWhite():void{
while (this.isWhiteSpace(this.ch)) {
this.nextChar();
};
}
private function isWhiteSpace(_arg1:String):Boolean{
return ((((((((_arg1 == " ")) || ((_arg1 == "\t")))) || ((_arg1 == "\n")))) || ((_arg1 == "\r"))));
}
private function isDigit(_arg1:String):Boolean{
return ((((_arg1 >= "0")) && ((_arg1 <= "9"))));
}
private function isHexDigit(_arg1:String):Boolean{
var _local2:String = _arg1.toUpperCase();
return (((this.isDigit(_arg1)) || ((((_local2 >= "A")) && ((_local2 <= "F"))))));
}
public function parseError(_arg1:String):void{
throw (new JSONParseError(_arg1, this.loc, this.jsonString));
}
}
}//package com.adobe.serialization.json
Section 14
//JSONTokenType (com.adobe.serialization.json.JSONTokenType)
package com.adobe.serialization.json {
public class JSONTokenType {
public static const UNKNOWN:int = -1;
public static const COMMA:int = 0;
public static const LEFT_BRACE:int = 1;
public static const RIGHT_BRACE:int = 2;
public static const LEFT_BRACKET:int = 3;
public static const RIGHT_BRACKET:int = 4;
public static const COLON:int = 6;
public static const TRUE:int = 7;
public static const FALSE:int = 8;
public static const NULL:int = 9;
public static const STRING:int = 10;
public static const NUMBER:int = 11;
}
}//package com.adobe.serialization.json
Section 15
//IntUtil (com.adobe.utils.IntUtil)
package com.adobe.utils {
public class IntUtil {
private static var hexChars:String = "0123456789abcdef";
public static function rol(_arg1:int, _arg2:int):int{
return (((_arg1 << _arg2) | (_arg1 >>> (32 - _arg2))));
}
public static function ror(_arg1:int, _arg2:int):uint{
var _local3:int = (32 - _arg2);
return (((_arg1 << _local3) | (_arg1 >>> (32 - _local3))));
}
public static function toHex(_arg1:int, _arg2:Boolean=false):String{
var _local4:int;
var _local5:int;
var _local3 = "";
if (_arg2){
_local4 = 0;
while (_local4 < 4) {
_local3 = (_local3 + (hexChars.charAt(((_arg1 >> (((3 - _local4) * 8) + 4)) & 15)) + hexChars.charAt(((_arg1 >> ((3 - _local4) * 8)) & 15))));
_local4++;
};
} else {
_local5 = 0;
while (_local5 < 4) {
_local3 = (_local3 + (hexChars.charAt(((_arg1 >> ((_local5 * 8) + 4)) & 15)) + hexChars.charAt(((_arg1 >> (_local5 * 8)) & 15))));
_local5++;
};
};
return (_local3);
}
}
}//package com.adobe.utils
Section 16
//APIConnector (com.newgrounds.components.APIConnector)
package com.newgrounds.components {
import flash.events.*;
import flash.display.*;
import com.newgrounds.*;
import flash.utils.*;
public class APIConnector extends MovieClip {
public var errorDialog:MovieClip;
public var background:MovieClip;
public var viewLatestButton:SimpleButton;
public var closeButton:SimpleButton;
public var viewAuthorizedButton:SimpleButton;
private var _initialized:Boolean;
private var _movieId:String;
private var _encryptionKey:String;
private var _movieVersion:String;
private var _showConnectingPopup:Boolean;// = true
private var _useErrorPopup:Boolean;// = true
private var _medalPopup:MedalPopup;
private var _popDelay:Timer;
public function APIConnector(){
this._popDelay = new Timer(3000, 1);
super();
addFrameScript(0, this.frame1, 6, this.frame7, 7, this.frame8);
if (((!((parent == null))) && ((getQualifiedClassName(parent) == "fl.livepreview::LivePreviewParent")))){
return;
};
this.useErrorPopup = true;
this.useMedalPopup = true;
this._popDelay.addEventListener(TimerEvent.TIMER, this.errorTimerHandler);
addEventListener(Event.ENTER_FRAME, this.enterFrameHandler);
if (stage){
addEventListener(Event.RENDER, this.renderHandler);
stage.invalidate();
} else {
this.clear();
};
}
public function get movieId():String{
return (this._movieId);
}
public function set movieId(_arg1:String):void{
this._movieId = _arg1;
}
public function get encryptionKey():String{
return (this._encryptionKey);
}
public function set encryptionKey(_arg1:String):void{
this._encryptionKey = _arg1;
}
public function get movieVersion():String{
return (this._movieVersion);
}
public function set movieVersion(_arg1:String):void{
this._movieVersion = _arg1;
}
public function get debugMode():Boolean{
return (API.debugMode);
}
public function set debugMode(_arg1:Boolean):void{
API.debugMode = true;
}
public function get useMedalPopup():Boolean{
return (!((this._medalPopup == null)));
}
public function set useMedalPopup(_arg1:Boolean):void{
if (((_arg1) && (!(this._medalPopup)))){
this._medalPopup = new MedalPopup();
addChild(this._medalPopup);
} else {
if (((!(_arg1)) && (this._medalPopup))){
removeChild(this._medalPopup);
this._medalPopup = null;
};
};
}
public function get useErrorPopup():Boolean{
return (this._useErrorPopup);
}
public function set useErrorPopup(_arg1:Boolean):void{
this._useErrorPopup = _arg1;
API.addEventListener(APIEvent.API_CONNECTED, this.movieConnectedHandler);
if (this._useErrorPopup){
API.addEventListener(APIEvent.NEW_VERSION_AVAILABLE, this.newVersionAvailableHandler);
API.addEventListener(APIEvent.HOST_BLOCKED, this.hostBlockedHandler);
} else {
API.removeEventListener(APIEvent.NEW_VERSION_AVAILABLE, this.newVersionAvailableHandler);
API.removeEventListener(APIEvent.HOST_BLOCKED, this.hostBlockedHandler);
};
}
public function get showConnectingPopup():Boolean{
return (this._showConnectingPopup);
}
public function set showConnectingPopup(_arg1:Boolean):void{
this._showConnectingPopup = _arg1;
if (((!(_arg1)) && ((((currentLabel == "connecting")) || ((currentLabel == "connected")))))){
this.clear();
};
}
public function clear():void{
gotoAndStop("idle");
}
public function connect():void{
API.setVersion(this._movieVersion);
API.connect(root.loaderInfo, this._movieId, this._encryptionKey);
visible = true;
if (this.showConnectingPopup){
gotoAndStop("connecting");
};
}
private function renderHandler(_arg1:Event):void{
removeEventListener(Event.RENDER, this.renderHandler);
this.clear();
this.connect();
}
private function movieConnectedHandler(_arg1:APIEvent):void{
if (_arg1.success){
if (((((((API.isPublishedHost()) && (API.IsCompatible()))) && (!(API.hasUserSession())))) && (!(API.debugMode)))){
gotoAndStop("no_login");
this._popDelay.start();
visible = true;
} else {
if (this.showConnectingPopup){
gotoAndStop("connected");
};
};
} else {
gotoAndStop("no_connect");
this._popDelay.start();
visible = true;
};
}
private function newVersionAvailableHandler(_arg1:APIEvent):void{
gotoAndStop("new_version");
visible = true;
this.centerOnStage();
}
private function hostBlockedHandler(_arg1:APIEvent):void{
gotoAndStop("bad_host");
visible = true;
this.centerOnStage();
}
private function closeButtonClickHandler(_arg1:Event):void{
this.clear();
}
private function officialVersionClickHandler(_arg1:Event):void{
API.loadOfficialVersion();
}
private function enterFrameHandler(_arg1:Event):void{
this.forceAlwaysOnTop();
}
private function initButtons():void{
if (this.viewLatestButton){
this.viewLatestButton.addEventListener(MouseEvent.CLICK, this.officialVersionClickHandler);
};
if (this.viewAuthorizedButton){
this.viewAuthorizedButton.addEventListener(MouseEvent.CLICK, this.officialVersionClickHandler);
};
if (this.closeButton){
this.closeButton.addEventListener(MouseEvent.CLICK, this.closeButtonClickHandler);
};
}
private function forceAlwaysOnTop():void{
var myIndex:uint;
var topIndex:uint;
if (((parent) && (visible))){
try {
myIndex = parent.getChildIndex(this);
topIndex = (parent.numChildren - 1);
if (myIndex != topIndex){
parent.setChildIndex(this, topIndex);
};
} catch(e:Error) {
};
};
}
private function centerOnStage():void{
if (stage){
x = (stage.stageWidth / 2);
y = (stage.stageHeight / 2);
};
}
private function errorTimerHandler(_arg1:TimerEvent):void{
if (this.errorDialog){
this.errorDialog.gotoAndPlay("closeme");
} else {
this.clear();
};
}
function frame1(){
stop();
}
function frame7(){
this.initButtons();
}
function frame8(){
this.initButtons();
}
}
}//package com.newgrounds.components
Section 17
//FlashAd (com.newgrounds.components.FlashAd)
package com.newgrounds.components {
import flash.events.*;
import flash.display.*;
import com.newgrounds.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
public class FlashAd extends Sprite {
public var background:MovieClip;
private var _showBackground:Boolean;
private var _adURLLoader:URLLoader;
private var _adRect:Sprite;
private var _mask:Shape;
private var _ad:Loader;
private static const DEBUG_AD_URL:String = "http://www.ngads.com/adtest.php";
private static const REMOVED_FROM_STAGE:String = "removedFromStage";
private static var _adResetTime:uint = 0;
private static var _adURL:URLRequest;
public function FlashAd(_arg1:Boolean=true){
if (((!((parent == null))) && ((getQualifiedClassName(parent) == "fl.livepreview::LivePreviewParent")))){
return;
};
this._adRect = new Sprite();
this._adRect.graphics.beginFill(0);
this._adRect.graphics.moveTo(0, 0);
this._adRect.graphics.lineTo(300, 0);
this._adRect.graphics.lineTo(300, 250);
this._adRect.graphics.lineTo(0, 250);
this._adRect.graphics.lineTo(0, 0);
this._adRect.graphics.endFill();
this._mask = new Shape();
this._mask.graphics.beginFill(0);
this._mask.graphics.moveTo(0, 0);
this._mask.graphics.lineTo(300, 0);
this._mask.graphics.lineTo(300, 250);
this._mask.graphics.lineTo(0, 250);
this._mask.graphics.lineTo(0, 0);
this._mask.graphics.endFill();
addChild(this._adRect);
this._adRect.addChild(this._mask);
this._adRect.visible = false;
x = Math.round(x);
y = Math.round(y);
scaleX = 1;
scaleY = 1;
if (this.background){
if (this.background.ngLinkButton){
this.background.ngLinkButton.addEventListener(MouseEvent.CLICK, this.linkClickHandler);
};
if (this.background.loadingClip){
this.background.loadingClip.visible = false;
};
};
if (API.isFlashVersion(9, 0, 28)){
addEventListener(REMOVED_FROM_STAGE, this.onRemovedFromStage);
};
if (API.adsApproved){
this.loadAdFeed(API.adFeedURL);
} else {
API.addEventListener(APIEvent.ADS_APPROVED, this.onAdsApproved, false, 0, true);
};
this.showBackground = _arg1;
}
public function get showBackground():Boolean{
return (this._showBackground);
}
public function set showBackground(_arg1:Boolean):void{
this._showBackground = _arg1;
if (this.background){
this.background.visible = _arg1;
this._adRect.mask = (_arg1) ? this.background.adMask : null;
};
}
public function removeAd():void{
removeEventListener(REMOVED_FROM_STAGE, this.onRemovedFromStage);
if (((this.background) && (this.background.loadingClip))){
this.background.loadingClip.visible = false;
};
if (this._adURLLoader){
try {
this._adURLLoader.close();
} catch(e:Error) {
};
};
if (this._adRect){
this._adRect.visible = false;
};
if (this._ad){
trace("[NewgroundsAPI] :: Ad removed");
try {
this._ad.close();
} catch(e:Error) {
};
try {
Object(this._ad).unloadAndStop(true);
} catch(e:Error) {
_ad.unload();
};
if (this._ad.parent){
this._ad.parent.removeChild(this._ad);
};
};
this._ad = null;
}
private function onAdsApproved(_arg1:APIEvent):void{
API.removeEventListener(APIEvent.ADS_APPROVED, this.onAdsApproved, false);
if (_arg1.success){
this.loadAdFeed(API.adFeedURL);
} else {
trace("[NewgroundsAPI] :: No ad feed URL supplied to Newgrounds API ad!");
};
}
private function loadAdFeed(_arg1:String):void{
var adFeedURL = _arg1;
this._adURLLoader = new URLLoader();
this._adURLLoader.addEventListener(Event.COMPLETE, this.onAdFeedLoaded);
this._adURLLoader.addEventListener(IOErrorEvent.IO_ERROR, this.onAdError);
this._adURLLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, this.onAdError);
if (!adFeedURL){
trace("[Newgrounds API] :: Invalid feed URL!");
return;
};
if (this.hasAdElapsed){
if (adFeedURL.indexOf("?") > -1){
_adURL = new URLRequest(((adFeedURL + "&random=") + Math.random()));
} else {
_adURL = new URLRequest(((adFeedURL + "?random=") + Math.random()));
};
};
try {
this._adURLLoader.load(_adURL);
} catch(e:Error) {
onAdError(null);
};
if (((this.background) && (this.background.loadingClip))){
this.background.loadingClip.visible = true;
};
}
private function loadAd(_arg1:String):void{
if (this._ad){
this.removeAd();
};
this._ad = new Loader();
this._ad.contentLoaderInfo.addEventListener(Event.COMPLETE, this.onAdLoaded);
this._ad.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, this.onAdError);
this._ad.load(new URLRequest(_arg1), new LoaderContext(false, new ApplicationDomain(null)));
if (((this.background) && (this.background.loadingClip))){
this.background.loadingClip.visible = true;
};
}
private function onAdFeedLoaded(_arg1:Event):void{
var _local2:URLLoader = URLLoader(_arg1.target);
if (((_local2.data) && (!((_local2.data == ""))))){
this.loadAd((_local2.data as String));
} else {
dispatchEvent(new APIEvent(APIEvent.AD_ATTACHED, false, new APIError("FLASH_ADS_NOT_APPROVED", "Unable to render ad")));
if (((this.background) && (this.background.loadingClip))){
this.background.loadingClip.visible = false;
};
};
}
private function onAdFeedError(_arg1:Event):void{
trace("[NewgroundsAPI] :: Unable to load ad feed!");
if (((this.background) && (this.background.loadingClip))){
this.background.loadingClip.visible = false;
};
}
private function onAdError(_arg1:Event):void{
dispatchEvent(new APIEvent(APIEvent.AD_ATTACHED, false, new APIError("FLASH_ADS_NOT_APPROVED", "Unable to render ad")));
this.removeAd();
}
private function onAdLoaded(_arg1:Event):void{
this._adRect.addChild(this._ad);
this._ad.mask = this._mask;
this._adRect.visible = true;
if (this.background){
if (this._showBackground){
this._adRect.mask = this.background.adMask;
};
if (this.background.loadingClip){
this.background.loadingClip.visible = false;
};
};
trace("[NewgroundsAPI] :: Ad loaded!");
dispatchEvent(new APIEvent(APIEvent.AD_ATTACHED, true));
}
private function onRemovedFromStage(_arg1:Event):void{
this.removeAd();
}
private function get hasAdElapsed():Boolean{
if (getTimer() >= _adResetTime){
_adResetTime = (getTimer() + ((1000 * 60) * 5));
return (true);
};
return (false);
}
private function linkClickHandler(_arg1:MouseEvent):void{
API.loadNewgrounds();
}
}
}//package com.newgrounds.components
Section 18
//MedalPopup (com.newgrounds.components.MedalPopup)
package com.newgrounds.components {
import flash.events.*;
import flash.display.*;
import com.newgrounds.*;
import flash.utils.*;
import flash.text.*;
public class MedalPopup extends MovieClip {
public var medalNameText:TextField;
public var medalValueText:TextField;
public var medalContainer:Sprite;
private var _initialized:Boolean;
private var _medal:Medal;
private var _medalIcon:Bitmap;
private var _medalQueue:Array;
private var _popDelay:Timer;
public function MedalPopup(){
this._medalQueue = [];
this._popDelay = new Timer(3000, 1);
super();
addFrameScript(0, this.frame1, 9, this.frame10, 18, this.frame19);
if (((!((parent == null))) && ((getQualifiedClassName(parent) == "fl.livepreview::LivePreviewParent")))){
return;
};
visible = false;
addEventListener(Event.ENTER_FRAME, this.enterFrameHandler);
stop();
API.addEventListener(APIEvent.MEDAL_UNLOCKED, this.onMedalUnlocked, false, 0, true);
this._popDelay.addEventListener(TimerEvent.TIMER, this.timerHandler);
}
public function get popupTime():Number{
return ((this._popDelay.delay / 1000));
}
public function set popupTime(_arg1:Number):void{
if (isNaN(_arg1)){
_arg1 = 3;
};
this._popDelay.delay = (_arg1 * 1000);
}
private function enterFrameHandler(_arg1:Event):void{
var myIndex:uint;
var topIndex:uint;
var event = _arg1;
if (((this._medalQueue.length) && (!(visible)))){
this._medal = this._medalQueue.pop();
this._popDelay.start();
gotoAndPlay("medal_show");
visible = true;
};
if (((visible) && (parent))){
try {
myIndex = parent.getChildIndex(this);
topIndex = (parent.numChildren - 1);
if (myIndex != topIndex){
parent.setChildIndex(this, topIndex);
};
} catch(error:Error) {
};
};
}
private function onMedalUnlocked(_arg1:APIEvent):void{
if (((((_arg1.success) && (_arg1.data))) && ((_arg1.data is Medal)))){
this._medalQueue.push(Medal(_arg1.data));
};
}
private function showMedalInfo():void{
if (!this._medal){
return;
};
if (this.medalContainer){
this._medalIcon = this._medal.createIconBitmap();
this.medalContainer.addChild(this._medalIcon);
};
if (this.medalNameText){
this.medalNameText.text = this._medal.name;
};
if (this.medalValueText){
this.medalValueText.text = (this._medal.value.toString() + "pts");
};
this._popDelay.start();
stop();
}
private function timerHandler(_arg1:TimerEvent):void{
if (((this._medalIcon) && (this._medalIcon.parent))){
this._medalIcon.parent.removeChild(this._medalIcon);
this._medalIcon = null;
};
gotoAndPlay("medal_hide");
this._popDelay.stop();
}
function frame1(){
stop();
}
function frame10(){
this.showMedalInfo();
stop();
}
function frame19(){
stop();
visible = false;
}
}
}//package com.newgrounds.components
Section 19
//API (com.newgrounds.API)
package com.newgrounds {
import flash.events.*;
import flash.display.*;
import com.newgrounds.components.*;
import flash.utils.*;
import com.adobe.serialization.json.*;
import flash.net.*;
import com.adobe.images.*;
import com.adobe.crypto.*;
import flash.system.*;
public class API {
public static const VERSION:String = "2.8";
private static const GATEWAY_URL:String = "http://www.ngads.com/gateway_v2.php";
private static const AD_TERMS_URL:String = "http://www.newgrounds.com/wiki/flashads/terms/";
private static const COMMANDS_WIKI_URL:String = "http://www.newgrounds.com/wiki/flashapi/commands/";
private static var do_echo:Boolean = false;
private static var _debug:Boolean = true;
private static var _connected:Boolean = false;
private static var _isMetadataLoaded:Boolean = false;
private static var _preloadComplete:Boolean = false;
private static var _adsApproved:Boolean = false;
private static var _saveGroupId:uint;
private static var _saveFileId:uint;
private static var _trackerId:uint;
private static var _movieId:String;
private static var _encryptionKey:String;
private static var _url:String;
private static var _host:String;
private static var connected:Boolean;
private static var version:String;
private static var ad_url:String;
private static var publisher_id:uint;
private static var session_id:String;
private static var user_email:String;
private static var user_name:String;
private static var user_id:uint;
private static var userpage_format:String;
private static var _medals:Array;
private static var timeoutTimer:Timer = new Timer(8000, 1);
private static var _userpageFormat:String;
private static var _scoreboards:Array = new Array();
private static var _bridge:Bridge;
private static var _saveFile:SaveFile;
private static var _imageFilePath:String;
private static var _saveFilePath:String;
private static var _saveGroups:Array = [];
private static var root:DisplayObject;
private static var _eventDispatcher:EventDispatcher = new EventDispatcher();
private static var score_page_counts:Object = new Object();
private static var compression_radix:String = "/g8236klvBQ#&|;Zb*7CEA59%s`Oue1wziFp$rDVY@TKxUPWytSaGHJ>dmoMR^<0~4qNLhc(I+fjn)X";
private static var compressor:BaseN = new BaseN(compression_radix);
public static var errors:Dictionary = APIError.init_codes();
private static var sharedObjects:Dictionary = new Dictionary();
private static var _preloadAssets:Array = [];
public static var periods:Object = getPeriodAliases();
private static var period_aliases:Object = {t:{name:"Today", alias:"TODAY"}, p:{name:"Yesterday", alias:"YESTERDAY"}, w:{name:"This Week", alias:"THIS_WEEK"}, m:{name:"This Month", alias:"THIS_MONTH"}, y:{name:"This Year", alias:"THIS_YEAR"}, a:{name:"All-Time", alias:"ALL_TIME"}};
private static var secureCommand:String;
public static function get adFeedURL():String{
return (ad_url);
}
public static function get preloadComplete():Boolean{
return (_preloadComplete);
}
private static function assertConnected():Boolean{
if (!_connected){
return (false);
};
return (true);
}
public static function setVersion(_arg1:String):void{
if (((_arg1) && (!((_arg1 == ""))))){
version = _arg1;
};
}
public static function setUserEmail(_arg1:String):void{
user_email = _arg1;
}
public static function get debugMode():Boolean{
return (_debug);
}
public static function set debugMode(_arg1:Boolean):void{
_debug = _arg1;
}
public static function getTrackerID():uint{
return (_trackerId);
}
public static function getUserID():uint{
return (user_id);
}
public static function getUserName():String{
return (user_name);
}
public static function isConnected():Boolean{
return (_connected);
}
public static function getOfficialURL():String{
var _local1:String = ((((((GATEWAY_URL + "?tracker_id=") + _movieId) + "&command_id=") + getCommandID("loadOfficalVersion")) + "&seed=") + Math.random());
if (debugMode){
_local1 = (_local1 + "&debug=1");
};
return (_local1);
}
public static function get adsApproved():Boolean{
return (_adsApproved);
}
public static function hasUserSession():Boolean{
return (((((!((session_id == null))) && (!((session_id == ""))))) && (!((publisher_id == 0)))));
}
public static function isNewgrounds():Boolean{
return ((((publisher_id == 1)) || ((getHost().toLowerCase().indexOf("ungrounded.net") > -1))));
}
public static function IsCompatible():Boolean{
return (!((publisher_id == 0)));
}
public static function hasUserEmail():Boolean{
return (((!((user_email == null))) && (!((user_email == "")))));
}
public static function connectionTimeOut(_arg1:Event=null):void{
dispatchEvent(new APIEvent(APIEvent.API_CONNECTED, false, new APIError("CONNECTION_FAILED", "Connection to NewgroundsAPI gateway timed out.")));
}
public static function connect(_arg1:LoaderInfo, _arg2:String, _arg3:String=null):void{
var loaderInfo = _arg1;
var m_id = _arg2;
var encrypt_key = _arg3;
if (!loaderInfo){
fatalError("Null loaderInfo paremeter passed in to connectMovie!", "");
return;
};
try {
if (loaderInfo.loader){
loaderInfo = loaderInfo.loader.loaderInfo;
};
} catch(error:Error) {
};
_url = loaderInfo.url;
_host = _url;
if ((((_host.indexOf("http://") > -1)) || ((_host.indexOf("https://") > -1)))){
_host = _host.split("/")[2].toLowerCase();
} else {
_host = "localhost";
};
var flashVars:Object = loaderInfo.parameters;
if (isPublishedHost()){
debugMode = false;
};
if (((!(debugMode)) && (flashVars))){
if (flashVars.NewgroundsAPI_UserName){
user_name = flashVars.NewgroundsAPI_UserName;
};
if (flashVars.NewgroundsAPI_UserID){
user_id = flashVars.NewgroundsAPI_UserID;
};
if (flashVars.NewgroundsAPI_PublisherID){
publisher_id = flashVars.NewgroundsAPI_PublisherID;
} else {
publisher_id = 1;
};
if (flashVars.NewgroundsAPI_UserpageFormat){
_userpageFormat = flashVars.NewgroundsAPI_UserpageFormat;
};
if (flashVars.NewgroundsAPI_SessionID){
session_id = flashVars.NewgroundsAPI_SessionID;
};
if (flashVars.NewgroundsAPI_SaveGroupID){
_saveGroupId = flashVars.NewgroundsAPI_SaveGroupID;
};
if (flashVars.NewgroundsAPI_SaveFileID){
_saveFileId = flashVars.NewgroundsAPI_SaveFileID;
};
if (flashVars.NewgroundsAPI_SandboxID){
_bridge = new Bridge(flashVars.NewgroundsAPI_SandboxID);
};
} else {
publisher_id = 1;
session_id = "D3bu64p1U53R";
user_id = 10;
user_name = "API-Debugger";
};
if (connected){
return;
};
timeoutTimer.start();
if (!m_id){
fatalError("NewgroundsAPI.connectMovie() - missing required movieId parameter", "connectMovie");
};
_movieId = String(m_id);
_trackerId = uint(_movieId.substring(0, _movieId.indexOf(":")));
_encryptionKey = encrypt_key;
connected = true;
sendCommand("connectMovie", {host:getHost(), movie_version:version});
}
private static function getHost():String{
return (_host);
}
public static function isPublishedHost():Boolean{
return (((!((getHost() == "localhost"))) && ((getHost().indexOf("file://") == -1))));
}
public static function loadUserPage(_arg1:uint=0, _arg2:String=null):Boolean{
var _local3:String;
if ((((_arg1 == 0)) && ((_arg2 == null)))){
if (hasUserSession()){
_arg1 = user_id;
_arg2 = user_name;
} else {
return (false);
};
};
if (publisher_id == 1){
_local3 = (("http://" + _arg2.toLowerCase()) + ".newgrounds.com");
navigateToURL(new URLRequest(_local3), "_blank");
return (true);
};
if (userpage_format){
_local3 = userpage_format;
_local3 = _local3.split(":user_id:").join(_arg1.toString());
_local3 = _local3.split(":user_name:").join(escape(_arg2));
navigateToURL(new URLRequest(_local3), "_blank");
return (true);
};
return (false);
}
public static function loadNewgrounds():void{
sendCommand("loadNewgrounds", {host:getHost()}, true);
}
public static function loadOfficialVersion():void{
navigateToURL(new URLRequest(getOfficialURL()));
}
public static function loadMySite():void{
sendCommand("loadMySite", {host:getHost()}, true);
}
public static function loadCustomLink(_arg1:String):void{
sendCommand("loadCustomLink", {host:getHost(), link:_arg1}, true);
}
public static function logCustomEvent(_arg1:String):void{
sendCommand("logCustomEvent", {host:getHost(), event:_arg1});
}
public static function getScoreBoardByName(_arg1:String):ScoreBoard{
var _local2:ScoreBoard;
for each (_local2 in _scoreboards) {
if (_local2.name == _arg1){
return (_local2);
};
};
return (null);
}
public static function getScoreBoardById(_arg1:uint):ScoreBoard{
var _local2:ScoreBoard;
for each (_local2 in _scoreboards) {
if (_local2.id == _arg1){
return (_local2);
};
};
return (null);
}
public static function postScore(_arg1:String, _arg2:uint, _arg3:String=""):void{
if (((!(_arg1)) || ((_arg1 == "")))){
sendError({command_id:getCommandID("postScore")}, new APIError("MISSING_PARAM", "missing required parameter(s)"));
return;
};
if (_arg3 == null){
_arg3 = "";
};
sendSecureCommand("postScore", {user_name:user_name, board:_arg1, value:_arg2, publisher_id:publisher_id, tag:_arg3});
}
public static function loadScores(_arg1:ScoreBoard, _arg2:String=null):void{
var _local3 = "loadScores";
if (!_arg1.id){
sendError({command_id:getCommandID(_local3)}, new APIError("MISSING_PARAM", "missing required ScoreBoard instance"));
return;
};
var _local4:Object = {};
_local4.publisher_id = publisher_id;
_local4.period = _arg1.period;
_local4.board = _arg1.id;
_local4.num_results = _arg1.num_results;
_local4.page = _arg1.page;
if (((!(_arg2)) || ((_arg2 == "")))){
_local4.tag = _arg1.tag;
} else {
_local4.tag = _arg2;
};
sendCommand(_local3, _local4);
}
public static function loadScoresInRange(_arg1:String, _arg2:String="All-Time", _arg3:uint=1, _arg4:uint=10):void{
if (((!(_arg1)) || ((_arg1 == "")))){
sendError({command_id:getCommandID("postScore")}, new APIError("MISSING_PARAM", "missing required parameter(s)"));
return;
};
var _local5:ScoreBoard = getScoreBoardByName(_arg1);
if (_local5){
_local5.loadScoresInRange(_arg2, _arg3, _arg4);
} else {
sendWarning((("loadScoresInRange: Scoreboard " + _arg1) + " could not be found."));
};
}
private static function populateMedals(_arg1:Array):void{
var _local2:uint;
var _local3:Object;
if (_medals === null){
_medals = new Array();
_local2 = 0;
while (_local2 < _arg1.length) {
_local3 = _arg1[_local2];
_medals.push(Medal.createFromObject(_local3));
_local2++;
};
};
sendMessage("Medals loaded!");
}
private static function populateSaveGroups(_arg1:Array):void{
var _local3:SaveGroup;
_saveGroups = [];
var _local2:uint;
while (_local2 < _arg1.length) {
_local3 = SaveGroup.createFromObject(_arg1[_local2]);
_saveGroups.push(_local3);
_local2++;
};
}
private static function populateScoreBoards(_arg1:Array):void{
_scoreboards = [];
var _local2:uint;
while (_local2 < _arg1.length) {
_scoreboards.push(new ScoreBoard(_arg1[_local2].id, _arg1[_local2].name, ""));
_local2++;
};
}
public static function get medals():Array{
return ((_medals) ? _medals.concat() : []);
}
public static function getMedalById(_arg1:uint):Medal{
var _local2:Medal;
for each (_local2 in _medals) {
if (_local2.id == _arg1){
return (_local2);
};
};
return (null);
}
public static function getMedalByName(_arg1:String):Medal{
var _local2:Medal;
for each (_local2 in _medals) {
if (_local2.name == _arg1){
return (_local2);
};
};
return (null);
}
public static function unlockMedal(_arg1:String):void{
var _local3:Object;
var _local4:Object;
if (((!(_arg1)) || ((_arg1 == "")))){
sendError({command_id:getCommandID("unlockMedal")}, new APIError("MISSING_PARAM", "missing required medal name"));
return;
};
var _local2:Medal = getMedalByName(_arg1);
if (!_local2){
sendMessage(("No medal with name: " + _arg1));
return;
};
if (((hasUserSession()) || (debugMode))){
sendMessage((("Attempting to unlock '" + _local2.name) + "'"));
if (_local2.unlocked){
sendWarning((("Medal '" + _local2.name) + "' is already unlocked!"));
return;
};
_local3 = new Object();
_local3.medal_id = _local2.id;
sendSecureCommand("unlockMedal", _local3);
} else {
sendMessage(("Locally unlocking " + _local2.name));
if (_local2.unlocked){
sendWarning((("Medal '" + _local2.name) + "' is already unlocked!"));
return;
};
_local2.unlocked = true;
_local4 = loadLocal("medals_unlocked");
if (!_local4){
_local4 = new Object();
};
_local4[_local2.id.toString()] = true;
saveLocal("medals_unlocked", _local4);
callListener(APIEvent.MEDAL_UNLOCKED, true, _local2);
};
}
public static function loadMedals():void{
if (_medals){
dispatchEvent(new APIEvent(APIEvent.MEDALS_LOADED, true, medals));
return;
};
var _local1:Object = new Object();
if (hasUserSession()){
_local1.publisher_id = publisher_id;
_local1.user_id = user_id;
};
sendCommand("getMedals", _local1);
}
public static function saveLocal(_arg1:String, _arg2:Object, _arg3:uint=0):void{
var sharedObj:SharedObject;
var save_id = _arg1;
var save_data = _arg2;
var size_allocation = _arg3;
try {
if (!sharedObjects[save_id]){
sharedObjects[save_id] = SharedObject.getLocal(((("ng_ap_secure_" + _trackerId) + "_") + save_id));
};
sharedObj = sharedObjects[save_id];
sharedObj.data[save_id] = encodeData(save_data);
sharedObj.flush();
} catch(e:Error) {
sendWarning(("saveLocal ERROR: " + e));
};
}
public static function loadLocal(_arg1:String):Object{
var sharedObj:SharedObject;
var save_id = _arg1;
try {
if (!sharedObjects[save_id]){
sharedObjects[save_id] = SharedObject.getLocal(((("ng_ap_secure_" + _trackerId) + "_") + save_id));
};
sharedObj = sharedObjects[save_id];
if (((((sharedObj) && (sharedObj.data))) && (sharedObj.data[save_id]))){
return (decodeData(sharedObj.data[save_id]));
} else {
return (null);
};
} catch(e:Error) {
sendWarning(("loadLocal ERROR: " + e));
};
return (null);
}
public static function encodeData(_arg1:Object):String{
return (compressHex(RC4.encrypt(JSON.encode(_arg1), _encryptionKey)));
}
public static function decodeData(_arg1:String){
return (JSON.decode(RC4.decrypt(uncompressHex(_arg1), _encryptionKey)));
}
private static function compressHex(_arg1:String):String{
var _local2:uint = (_arg1.length % 6);
var _local3 = "";
var _local4:uint;
while (_local4 < _arg1.length) {
_local3 = (_local3 + compressor.encode(uint(("0x" + _arg1.substr(_local4, 6))), 4));
_local4 = (_local4 + 6);
};
return ((_local2.toString() + _local3));
}
private static function uncompressHex(_arg1:String):String{
var _local4:uint;
var _local6:String;
var _local7:uint;
var _local8:String;
var _local2:uint = uint(_arg1.charAt(0));
var _local3 = "";
var _local5:uint = 1;
while (_local5 < _arg1.length) {
_local6 = _arg1.substr(_local5, 4);
_local7 = uint(compressor.decode(_local6));
_local8 = _local7.toString(16);
if ((_local5 + 4) < _arg1.length){
_local4 = 6;
} else {
_local4 = _local2;
};
while (_local8.length < _local4) {
_local8 = ("0" + _local8);
};
_local3 = (_local3 + _local8);
_local5 = (_local5 + 4);
};
return (_local3);
}
public static function getSaveGroupById(_arg1:uint):SaveGroup{
if (((!(_saveGroups)) || ((_saveGroups.length < 1)))){
sendWarning("No save groups found");
return (null);
};
var _local2:uint;
while (_local2 < _saveGroups.length) {
if (_saveGroups[_local2].id == _arg1){
return (_saveGroups[_local2]);
};
_local2++;
};
return (null);
}
public static function getSaveGroupByName(_arg1:String):SaveGroup{
if (((!(_saveGroups)) || ((_saveGroups.length < 1)))){
sendWarning("No save groups found");
return (null);
};
var _local2:uint;
while (_local2 < _saveGroups.length) {
if (_saveGroups[_local2].name == _arg1){
return (_saveGroups[_local2]);
};
_local2++;
};
return (null);
}
public static function createSaveQuery(_arg1:String):SaveGroupQuery{
var _local2:SaveGroup = getSaveGroupByName(_arg1);
if (_local2){
return (_local2.createQuery());
};
return (null);
}
public static function executeSaveQuery(_arg1:SaveGroupQuery):void{
sendCommand("lookupSaveFiles", {publisher_id:publisher_id, group_id:_arg1.groupId, query:JSON.encode(_arg1.toObject())}, false, null, _arg1);
}
public static function checkFilePrivledges(_arg1:SaveFile):void{
sendCommand("checkFilePrivs", {group:_arg1.groupId, filename:_arg1.name, user_id:(user_id) ? user_id : 0, publisher_id:publisher_id});
}
public static function newSaveFile(_arg1:String):SaveFile{
var _local2:SaveGroup = getSaveGroupByName(_arg1);
if (_local2){
return (new SaveFile(_local2));
};
sendError({command_id:"newSaveFile"}, new APIError("INVALID_SAVE_GROUP", (("'" + _local2) + "' is not a valid save group.")));
return (null);
}
public static function saveFile(_arg1:SaveFile, _arg2:Boolean=false, _arg3:Boolean=false):void{
var _local4:Object = _arg1.toObject();
_local4.user_name = user_name;
if (_arg1.id){
_local4.save_id = _arg1.id;
};
_local4.overwrite = (_arg3) ? 1 : 0;
if (_arg2){
_local4.draft = 1;
};
var _local5:ByteArray = new ByteArray();
if ((_arg1.contents is ByteArray)){
_local5.writeByte(0);
_local5.writeBytes(_arg1.contents);
} else {
_local5.writeByte(1);
_local5.writeObject(_arg1.contents);
};
_local5.compress();
var _local6:Object = new Object();
_local6.file = _local5;
if (_arg1.thumbnail){
_local6.thumbnail = PNGEncoder.encode(_arg1.thumbnail);
};
sendSecureCommand("saveFile", _local4, null, _local6, _arg1);
}
public static function rateSaveFile(_arg1:SaveFile, _arg2:SaveRating, _arg3:Number):void{
sendSecureCommand("rateSaveFile", {group:_arg1.groupId, save_id:_arg1.id, rating_id:_arg2.id, vote:_arg3, user_id:user_id}, null, null, _arg1);
}
public static function loadSaveFile(_arg1:Number, _arg2:Boolean=true){
var _local3:Object = {publisher_id:publisher_id, save_id:_arg1, get_contents:_arg2};
trace(JSON.encode(_local3));
sendCommand("loadSaveFile", _local3);
}
private static function doEvent(_arg1:Object):void{
var _local2:String;
var _local3:Object;
var _local4:String;
var _local5:Boolean;
var _local6:ScoreBoard;
var _local7:Array;
var _local8:*;
var _local9:String;
var _local10:Medal;
var _local11:SaveGroup;
var _local12:Object;
var _local13:Object;
var _local14:Object;
var _local15:SaveFile;
var _local16:uint;
var _local17:Object;
var _local18:uint;
switch (getCommandName(_arg1.command_id)){
case "connectMovie":
timeoutTimer.stop();
if (_arg1.success){
sendMessage("You have successfully connected to the Newgrounds API Gateway");
sendMessage((("Movie identified as \"" + _arg1.movie_name) + "\""));
callListener(APIEvent.API_CONNECTED, _arg1.success, {title:_arg1.movie_name});
} else {
callListener(APIEvent.API_CONNECTED, _arg1.success, {});
return;
};
_local5 = false;
if (_arg1.ad_status === -1){
_local2 = "This movie was not approved to run Flash Ads.";
sendWarning(_local2);
sendWarning((("visit " + AD_TERMS_URL) + " to view our approval guidelines"));
if (!_arg1.ad_url){
callListener(APIEvent.ADS_APPROVED, false, new APIError("FLASH_ADS_NOT_APPROVED", _local2));
} else {
_local5 = true;
};
} else {
if (_arg1.ad_status === 0){
_local2 = "Flash Ads are currently awaiting approval.";
sendNotice(_local2);
if (!_arg1.ad_url){
callListener(APIEvent.ADS_APPROVED, false, new APIError("FLASH_ADS_NOT_APPROVED", _local2));
} else {
_local5 = true;
};
};
};
if (_arg1.ad_url){
ad_url = unescape(_arg1.ad_url);
if (!_local5){
sendMessage("This movie has been approved to run Flash Ads!");
};
_adsApproved = true;
callListener(APIEvent.ADS_APPROVED, true);
};
if (_arg1.deny_host){
_local2 = (getHost() + " does not have permission to run this movie!");
sendWarning(_local2);
sendWarning(("\tUpdate your API configuration to unblock " + getHost()));
callListener(APIEvent.HOST_BLOCKED, true, {real_url:unescape(_arg1.movie_url), url:getOfficialURL()});
};
if (_arg1.movie_version){
sendWarning("According to your API Configuration, this version is out of date.");
if (version){
sendWarning(("\tThe this movie is version " + version));
};
sendWarning(("\tThe most current version is " + _arg1.movie_version));
callListener(APIEvent.NEW_VERSION_AVAILABLE, true, {version:_arg1.movie_version, real_url:unescape(_arg1.movie_url), url:getOfficialURL()});
};
if (_arg1.request_portal_url){
sendCommand("setPortalID", {portal_url:_url});
};
sendCommand("preloadSettings", {publisher_id:publisher_id, user_id:user_id});
break;
case "preloadSettings":
if (_arg1.medals){
populateMedals(_arg1.medals);
if (((!(hasUserSession())) && (!(debugMode)))){
echo("Checking for SharedObject Medals...");
_local8 = loadLocal("medals_unlocked");
if (_local8){
for (_local9 in _local8) {
if (_local8[_local9]){
_local10 = getMedalById(uint(_local9));
echo(("Now unlocking " + _local10.name));
_local10.unlocked = true;
};
};
};
};
};
if (_arg1.save_groups){
populateSaveGroups(_arg1.save_groups);
};
if (_arg1.save_file_path){
_saveFilePath = (_arg1.save_file_path + "/");
};
if (_arg1.image_file_path){
_imageFilePath = (_arg1.image_file_path + "/");
};
if (_arg1.score_boards){
populateScoreBoards(_arg1.score_boards);
};
sendMessage("Metadata loaded!");
callListener(APIEvent.METADATA_LOADED, _arg1.success);
if (((_saveFileId) && (_saveGroupId))){
_local11 = getSaveGroupById(_saveGroupId);
if (_local11){
callListener(APIEvent.FILE_REQUESTED, true, {save_id:_saveFileId, group:_local11});
};
};
_preloadComplete = true;
break;
case "logCustomEvent":
if (_arg1.success){
sendMessage((("Event '" + _arg1.event) + "' was logged."));
};
callListener(APIEvent.EVENT_LOGGED, _arg1.success, {event:_arg1.event});
break;
case "postScore":
if (_arg1.success){
_local4 = "User";
if (user_email){
_local4 = user_email;
} else {
if (user_name){
_local4 = user_name;
};
};
_local6 = getScoreBoardById(_arg1.board);
if (_local6){
sendMessage((((((_local4 + " posted ") + _arg1.value) + " to '") + _local6.name) + "'"));
};
if (_arg1.best_scores){
_local12 = {today:_arg1.best_scores.D, yesterday:_arg1.best_scores.P, week:_arg1.best_scores.W, year:_arg1.best_scores.Y, all_time:_arg1.best_scores.A};
} else {
_local12 = {};
};
if (_arg1.best_ranks){
_local13 = {today:_arg1.best_ranks.D, yesterday:_arg1.best_ranks.P, week:_arg1.best_ranks.W, year:_arg1.best_ranks.Y, all_time:_arg1.best_ranks.A};
} else {
_local13 = {};
};
if (_arg1.num_scores){
_local14 = {today:_arg1.num_scores.D, yesterday:_arg1.num_scores.P, week:_arg1.num_scores.W, year:_arg1.num_scores.Y, all_time:_arg1.num_scores.A};
} else {
_local14 = {};
};
_local3 = {score:_arg1.score, value:_arg1.value, username:_local4, best_scores:_local12, best_ranks:_local13, num_scores:_local14};
};
callListener(APIEvent.SCORE_POSTED, _arg1.success, _local3);
break;
case "loadScores":
_local3 = new Object();
_local6 = getScoreBoardById(_arg1.board);
if (_local6){
_local6.setScores(_arg1.scores, _arg1.period, _arg1.page, _arg1.num_results, _arg1.num_scores);
};
callListener(APIEvent.SCORES_LOADED, _arg1.success, _local6);
break;
case "unlockMedal":
if (_medals){
_local10 = getMedalByName(_arg1.medal_name);
if (_local10.unlocked){
return;
};
_local10.unlocked = true;
callListener(APIEvent.MEDAL_UNLOCKED, _arg1.success, _local10);
};
break;
case "getMedals":
if (_arg1.success){
populateMedals(_arg1.medals);
};
callListener(APIEvent.MEDALS_LOADED, _arg1.success, _local3);
break;
case "loadSaveFile":
if (_arg1.success){
trace(JSON.encode(_arg1));
_local11 = getSaveGroupById(_arg1.group_id);
_local15 = new SaveFile(_local11);
_local15.id = _arg1.file.save_id;
_local15.name = _arg1.file.filename;
_local15.fileUrl = (_saveFilePath + _arg1.file.file);
_local15.thumbnailUrl = (_imageFilePath + _arg1.file.thumb);
_local15.authorName = _arg1.file.user_name;
_local15.authorId = _arg1.file.user_id;
_local15.setStatus(_arg1.file.status);
_local15.description = _arg1.file.description;
if (((_arg1.file.keys) && (_arg1.file.keys.length))){
_local16 = 0;
while (_local16 < _arg1.file.keys.length) {
_local15.setKey(_arg1.file.keys[_local16].id, _arg1.file.keys[_local16].value);
_local16++;
};
};
if (((_arg1.file.ratings) && (_arg1.file.ratings.length))){
_local16 = 0;
while (_local16 < _arg1.file.ratings.length) {
_local15.setRating(_arg1.file.ratings[_local16].id, _arg1.file.ratings[_local16].votes, _arg1.file.ratings[_local16].score);
_local16++;
};
};
if (_arg1.get_contents){
_local15.loadContents();
};
};
callListener(APIEvent.FILE_INITIALIZED, _arg1.success, _local15);
break;
case "lookupSaveFiles":
_local7 = [];
if (((_arg1.success) && (_arg1.files))){
_local16 = 0;
while (_local16 < _arg1.files.length) {
_local17 = _arg1.files[_local16];
_local15 = new SaveFile(getSaveGroupById(_arg1.group_id));
_local15.name = _local17.filename;
_local15.id = _local17.save_id;
_local15.description = _local17.description;
_local15.thumbnailUrl = (_imageFilePath + _local17.thumb);
_local15.fileUrl = (_saveFilePath + _local17.file);
_local15.authorName = _local17.user_name;
_local15.authorId = _local17.user_id;
_local15.setStatus(_local17.status);
if (((_local17.keys) && (_local17.keys.length))){
_local18 = 0;
while (_local18 < _local17.keys.length) {
_local15.setKey(_local17.keys[_local18].id, _local17.keys[_local18].value);
_local18++;
};
};
if (((_local17.ratings) && (_local17.ratings.length))){
_local18 = 0;
while (_local18 < _local17.ratings.length) {
_local15.setRating(_local17.ratings[_local18].id, _local17.ratings[_local18].votes, _local17.ratings[_local18].score);
_local18++;
};
};
_local7.push(_local15);
_local16++;
};
};
_arg1.owner.dispatchEvent(new APIEvent(APIEvent.QUERY_COMPLETE, _arg1.success, _local7));
break;
case "rateSaveFile":
_local15 = _arg1.owner;
_arg1.success = ((_arg1.success) && (!(_arg1.already_voted)));
if (_arg1.success){
_local15.setRating(_arg1.rating_id, _arg1.votes, _arg1.score);
};
_arg1.file = _local15;
_local15.dispatchEvent(new APIEvent(APIEvent.VOTE_COMPLETE, _arg1.success, _arg1));
break;
case "saveFile":
_local3 = {};
if (_arg1.success){
_local3 = {save_id:_arg1.save_id, filename:_arg1.filename, file_url:_arg1.file_url, thumbnail:_arg1.thumbnail, icon:_arg1.icon};
SaveFile(_arg1.owner).fileSaved(_local3);
};
_arg1.owner.dispatchEvent(new APIEvent(APIEvent.FILE_SAVED, _arg1.success, _local3));
break;
case "checkFilePrivs":
_local3 = {filename:_arg1.filename, folder:_arg1.folder, can_read:_arg1.can_read, can_write:_arg1.can_write};
callListener(APIEvent.FILE_PRIVS_LOADED, _arg1.success, _local3);
break;
};
}
public static function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:uint=0, _arg5:Boolean=false):void{
_eventDispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public static function hasEventListener(_arg1:String):Boolean{
return (_eventDispatcher.hasEventListener(_arg1));
}
public static function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
_eventDispatcher.removeEventListener(_arg1, _arg2, _arg3);
}
private static function dispatchEvent(_arg1:Event):void{
_eventDispatcher.dispatchEvent(_arg1);
echo(("Fired Event: " + _arg1.type));
}
static function callListener(_arg1:String, _arg2:Boolean=true, _arg3=undefined):void{
dispatchEvent(new APIEvent(_arg1, _arg2, _arg3));
if (_bridge){
_bridge.sendEvent(_arg1, {success:_arg2, data:_arg3});
};
}
private static function getCommandName(_arg1:String):String{
return (_arg1);
}
private static function getCommandID(_arg1:String):String{
return (_arg1);
}
private static function getPeriodAliases():Object{
var _local2:String;
var _local1:Object = new Object();
for (_local2 in period_aliases) {
_local1[period_aliases[_local2].alias] = _local2;
};
return (_local1);
}
public static function getPeriodName(_arg1:String):String{
var _local2:String;
for (_local2 in period_aliases) {
if (_local2 == _arg1){
return (period_aliases[_local2].name);
};
};
return (null);
}
public static function getPeriodAlias(_arg1:String):String{
var _local2:String;
for (_local2 in period_aliases) {
if (_local2 == _arg1){
return (period_aliases[_local2].alias);
};
};
return (null);
}
private static function sendError(_arg1:Object, _arg2:APIError):void{
var _local3:String = ((((("[NewgroundsAPI ERROR] :: " + getCommandName(_arg1.command_id)) + "() - ") + _arg2.name) + ":\n\t\t\t\t") + _arg2.message);
trace(_local3);
if (_bridge){
_bridge.sendEvent("trace", {data:_local3});
};
}
private static function sendWarning(_arg1:String, _arg2:String=null):void{
if (_arg2){
_arg1 = (_arg1 + ((("\n[NewgroundsAPI WARNING] :: \tSee " + COMMANDS_WIKI_URL) + _arg2.toLowerCase()) + " for additional information."));
};
trace(_arg1);
if (_bridge){
_bridge.sendEvent("trace", {data:_arg1});
};
}
private static function sendNotice(_arg1:String, _arg2:String=null):void{
var _local3:String;
if (_arg2){
_arg1 = (_arg1 + ((("\n[NewgroundsAPI NOTICE] :: \tSee " + COMMANDS_WIKI_URL) + _arg2.toLowerCase()) + " for additional information."));
};
trace(_arg1);
if (_bridge){
_bridge.sendEvent("trace", {data:_arg1});
};
}
private static function fatalError(_arg1:String, _arg2:String):void{
if (_arg2){
_arg1 = (_arg1 + ((("\n\tSee " + COMMANDS_WIKI_URL) + _arg2.toLowerCase()) + " for additional information."));
};
throw (new Error(("***ERROR*** class=API\n\n" + _arg1)));
}
public static function sendSecureCommand(_arg1:String, _arg2:Object, _arg3:Object=null, _arg4:Object=null, _arg5=null):void{
if (((((!(debugMode)) && (!(hasUserSession())))) && (!(hasUserEmail())))){
sendError({command_id:getCommandID(_arg1)}, new APIError("IDENTIFICATION_REQUIRED", (("You must be logged in or provide an e-mail address ( using NewgroundsAPI.setUserEmail(\"name@domain.com\"); ) to use " + _arg1) + "().")));
return;
};
if (!_arg1){
fatalError("Missing command", "sendSecureCommand");
};
if (!_arg2){
fatalError("Missing secure_params", "sendSecureCommand");
};
if (!_arg3){
_arg3 = new Object();
};
var _local6 = "";
var _local7:uint;
while (_local7 < 16) {
_local6 = (_local6 + compression_radix.charAt(Math.floor((Math.random() * compression_radix.length))));
_local7++;
};
if (((debugMode) && (!(session_id)))){
_arg2.session_id = "";
} else {
_arg2.session_id = session_id;
};
_arg2.as_version = 3;
_arg2.user_email = user_email;
_arg2.publisher_id = publisher_id;
_arg2.seed = _local6;
_arg2.command_id = getCommandID(_arg1);
var _local8:String = MD5.hash(_local6);
var _local9:String = RC4.encrypt(JSON.encode(_arg2), _encryptionKey);
var _local10:String = (_local8 + _local9);
_arg3.secure = compressHex(_local10);
secureCommand = _arg1;
sendCommand("securePacket", _arg3, false, _arg4, _arg5);
}
public static function stopPendingCommands():void{
SmartURLLoader.closeAll();
}
private static function onCommandComplete(_arg1:Event):void{
var response:Object;
var error:APIError;
var e = _arg1;
var loader:SmartURLLoader = SmartURLLoader(e.target);
echo((("INPUT: \n" + loader.response) + "\n"));
var i:uint;
while (i < _preloadAssets.length) {
if (_preloadAssets[i] == loader){
_preloadAssets.splice(i, 1);
break;
};
i = (i + 1);
};
try {
response = JSON.decode(loader.response);
} catch(error:Error) {
response = {success:false};
};
if (!response){
response = {command_id:loader._command, success:false};
};
response.owner = loader.owner;
if (((!(response)) || (!(response.success)))){
trace(("Error: " + response));
error = new APIError(response.error_code, response.error_msg);
sendError(response, error);
if (response.command_id){
doEvent(response);
};
} else {
doEvent(response);
};
}
private static function onCommandError(_arg1:Event):void{
var _local2:Object = {success:false};
var _local3:SmartURLLoader = SmartURLLoader(_arg1.target);
_local2.owner = _local3.owner;
var _local4:uint;
while (_local4 < _preloadAssets.length) {
if (_preloadAssets[_local4] == _local3){
_preloadAssets.splice(_local4, 1);
break;
};
_local4++;
};
if (_local3._command){
_local2.command_id = _local3._command;
doEvent(_local2);
};
}
private static function sendCommand(_arg1:String, _arg2:Object, _arg3:Boolean=false, _arg4:Object=null, _arg5=null):void{
var _local7:String;
var _local8:String;
var _local9:String;
if (((!(connected)) && (!((_arg1 == "connectMovie"))))){
_local7 = (("NewgroundsAPI." + _arg1) + "() - NewgroundsAPI.connectMovie() must be called before this command can be called\n");
fatalError(_local7, "connectMovie");
};
var _local6:SmartURLLoader = new SmartURLLoader();
_local6.addVariable("command_id", getCommandID(_arg1));
_local6.addVariable("tracker_id", _movieId);
if (debugMode){
_local6.addVariable("debug", 1);
};
if (_arg2){
for (_local8 in _arg2) {
_local6.addVariable(_local8, _arg2[_local8]);
};
};
if (_arg4){
for (_local9 in _arg4) {
_local6.addFile(_local9, _arg4[_local9], _local9);
};
};
if (_arg3){
_local6.method = URLRequestMethod.GET;
} else {
_local6.method = URLRequestMethod.POST;
};
_local6.preventCache = true;
if (_arg3){
_local6.openBrowser = true;
_local6.method = URLRequestMethod.GET;
} else {
_local6.addEventListener(Event.COMPLETE, onCommandComplete);
_local6.addEventListener(IOErrorEvent.IO_ERROR, onCommandError);
_local6.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onCommandError);
_local6.method = URLRequestMethod.POST;
};
if (_arg2.secure){
_local6._command = secureCommand;
} else {
_local6._command = getCommandID(_arg1);
};
_local6.owner = _arg5;
_local6.load(GATEWAY_URL);
}
public static function isFlashVersion(_arg1:uint, _arg2:uint=0, _arg3:uint=0, _arg4:uint=0):Boolean{
var _local6:Array = Capabilities.version.split(" ")[1].split(",");
var _local7:Array = arguments;
var _local8:uint;
while (_local8 < _local7.length) {
_local6[_local8] = uint(_local6[_local8]);
_local8++;
};
_local8 = 0;
while (_local8 < _local7.length) {
if (_local6[_local8] > _local7[_local8]){
return (true);
};
if (_local6[_local8] < _local7[_local8]){
return (false);
};
_local8++;
};
return (true);
}
public static function createAd():FlashAd{
sendMessage("You may see a security sandbox violation. This is normal!");
return (new FlashAd());
}
public static function sendMessage(_arg1:String, _arg2:Boolean=false):void{
var _local3:String = ("[NewgroundsAPI] :: " + _arg1);
trace(_local3);
if (_bridge){
_bridge.sendEvent("trace", {data:_local3});
};
}
private static function echo(_arg1:String):void{
if (do_echo){
trace(_arg1);
};
}
}
}//package com.newgrounds
Section 20
//APIError (com.newgrounds.APIError)
package com.newgrounds {
import flash.utils.*;
public class APIError {
public var code:Number;// = 0
public var message:String;
public var name:String;
public var alias:String;
public static const aliases:Array = new Array("UNKNOWN_ERROR", "INVALID_API_ID", "MISSING_PARAM", "INVALID_STAT_ID", "INVALID_COMMAND_ID", "FLASH_ADS_NOT_APPROVED", "PERMISSION_DENIED", "IDENTIFICATION_REQUIRED", "INVALID_EMAIL_ADDRESS", "BANNED_USER", "SESSION_EXPIRED", "INVALID_SCORE", "INVALID_MEDAL", "INVALID_FOLDER", "FILE_NOT_FOUND", "SITE_ID_REQUIRED", "UPLOAD_IN_PROGRESS", "USER_CANCELLED", "CONFIRM_REQUEST", "CONNECTION_FAILED");
private static const always_caps:Array = new Array("API", "URL", "ID");
public static const error_codes:Object = init_codes();
public static const error_names:Object = init_names();
public function APIError(_arg1, _arg2:String){
if ((_arg1 is String)){
_arg1 = error_codes[_arg1];
} else {
if (!(_arg1 is uint)){
_arg1 = 0;
};
};
this.code = _arg1;
this.message = _arg2;
this.name = error_names[_arg1];
this.alias = aliases[_arg1];
}
public function isError():Boolean{
return (true);
}
public static function init_codes():Dictionary{
var _local1:Dictionary = new Dictionary();
var _local2:uint;
while (_local2 < aliases.length) {
_local1[aliases[_local2]] = _local2;
_local2++;
};
return (_local1);
}
private static function init_names():Array{
var _local3:Array;
var _local4:uint;
var _local5:String;
var _local1:Array = new Array();
var _local2:uint;
while (_local2 < aliases.length) {
_local3 = aliases[_local2].toLowerCase().split("_");
_local4 = 0;
while (_local4 < _local3.length) {
_local3[_local4] = (_local3[_local4].substr(0, 1).toUpperCase() + _local3[_local4].substr(1, _local3[_local4].length));
for each (_local5 in always_caps) {
if (_local3[_local4].toUpperCase() == _local5){
_local3[_local4] = _local3[_local4].toUpperCase();
};
};
_local4++;
};
_local1[_local2] = _local3.join(" ");
_local2++;
};
return (_local1);
}
}
}//package com.newgrounds
Section 21
//APIEvent (com.newgrounds.APIEvent)
package com.newgrounds {
import flash.events.*;
public class APIEvent extends Event {
private var _data;
private var _success:Boolean;
private var _target;
private var _error:APIError;
public static const API_CONNECTED:String = "movieConnected";
public static const ADS_APPROVED:String = "adsApproved";
public static const AD_ATTACHED:String = "adAttached";
public static const HOST_BLOCKED:String = "hostBlocked";
public static const NEW_VERSION_AVAILABLE:String = "newVersionAvailable";
public static const EVENT_LOGGED:String = "eventLogged";
public static const SCORE_POSTED:String = "scorePosted";
public static const SCORES_LOADED:String = "scoresLoaded";
public static const MEDAL_UNLOCKED:String = "medalUnlocked";
public static const MEDALS_LOADED:String = "medalsLoaded";
public static const METADATA_LOADED:String = "metadataLoaded";
public static const FILE_PRIVS_LOADED:String = "filePrivsLoaded";
public static const FILE_SAVED:String = "fileSaved";
public static const FILE_LOADED:String = "fileLoaded";
public static const FILE_INITIALIZED:String = "fileInitialized";
public static const FILE_REQUESTED:String = "fileRequested";
public static const QUERY_COMPLETE:String = "queryComplete";
public static const VOTE_COMPLETE:String = "voteComplete";
public function APIEvent(_arg1:String, _arg2:Boolean=true, _arg3=undefined){
super(_arg1);
this._data = _arg3;
this._success = _arg2;
}
public function get success():Boolean{
return (this._success);
}
public function get data(){
return (this._data);
}
}
}//package com.newgrounds
Section 22
//BaseN (com.newgrounds.BaseN)
package com.newgrounds {
import flash.utils.*;
public class BaseN {
private var _hashIndex:String;
private var _hashVal:Dictionary;
private var _base:Number;
public function BaseN(_arg1:String=null){
if (_arg1){
this._hashIndex = _arg1;
} else {
this._hashIndex = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`~@#$%^&*()+|;/";
};
this._base = this._hashIndex.length;
this._hashVal = new Dictionary();
var _local2:uint;
while (_local2 < this._base) {
this._hashVal[this._hashIndex.charAt(_local2)] = _local2;
_local2++;
};
}
public function encode(_arg1:Number, _arg2:uint=1):String{
var _local3:String = _arg1.toString();
var _local4 = "";
if (_local3.charAt(0) == "-"){
_local4 = "-";
_local3 = _local3.substring(1);
};
var _local5:Array = _local3.split(".", 2);
_local4 = (_local4 + this.baseNEncoder(_local5[0], _arg2));
if (_local5.length > 1){
_local4 = (_local4 + ("." + this.baseNEncoder(_local5[1])));
};
return (_local4);
}
public function decode(_arg1:String):Number{
var _local2 = "";
if (_arg1.charAt(0) == "-"){
_local2 = "-";
_arg1 = _arg1.substring(1);
};
var _local3:Array = _arg1.split(".", 2);
_local2 = (_local2 + this.baseNDecoder(_local3[0]));
if (_local3.length > 1){
_local2 = (_local2 + ".");
_local2 = (_local2 + this.baseNDecoder(_local3[1]));
};
return (Number(_local2));
}
private function baseNEncoder(_arg1:uint, _arg2:uint=1):String{
var _local3 = "";
var _local4:uint = _arg1;
while (_local4 != 0) {
_local3 = (this._hashIndex.charAt((_local4 % this._base)) + _local3);
_local4 = (_local4 / this._base);
};
if (_arg2){
while (_local3.length < _arg2) {
_local3 = (this._hashIndex.charAt(0) + _local3);
};
};
return (_local3);
}
private function baseNDecoder(_arg1:String):uint{
var _local2:uint;
var _local3:uint;
while (_local3 < _arg1.length) {
_local2 = (_local2 * this._base);
_local2 = (_local2 + this._hashVal[_arg1.charAt(_local3)]);
_local3++;
};
return (_local2);
}
}
}//package com.newgrounds
Section 23
//Bridge (com.newgrounds.Bridge)
package com.newgrounds {
import flash.events.*;
import flash.net.*;
public class Bridge {
private var _inConnection:LocalConnection;
private var _outConnection:LocalConnection;
private var _widgetId:String;
public function Bridge(_arg1:String){
this._widgetId = _arg1;
this._inConnection = new LocalConnection();
this._outConnection = new LocalConnection();
this._inConnection.client = this;
this._inConnection.connect(("rec_" + this._widgetId));
this._outConnection.addEventListener(StatusEvent.STATUS, this.onStatus);
}
public function sendCommand(_arg1:String, _arg2:Object):void{
if (this._outConnection){
this._outConnection.send(this._widgetId, "sendCommand", _arg1, this.scrubParameters(_arg2));
};
}
public function sendEvent(_arg1:String, _arg2:Object):void{
if (this._outConnection){
this._outConnection.send(this._widgetId, "sendEvent", _arg1, this.scrubParameters(_arg2));
};
}
public function receiveEvent(_arg1:String, _arg2:Object):void{
API.callListener(_arg1, _arg2.success, _arg2.data);
}
public function scrubParameters(_arg1:Object):Object{
var _local3:String;
var _local2:Object = new Object();
for (_local3 in _arg1) {
if ((((((((((_arg1[_local3] is String)) || ((_arg1[_local3] is Number)))) || ((_arg1[_local3] is uint)))) || ((_arg1[_local3] is int)))) || ((_arg1[_local3] is Boolean)))){
_local2[_local3] = _arg1[_local3];
};
};
return (_local2);
}
private function onStatus(_arg1:Event):void{
}
}
}//package com.newgrounds
Section 24
//Medal (com.newgrounds.Medal)
package com.newgrounds {
import flash.events.*;
import flash.display.*;
import flash.net.*;
import flash.system.*;
public class Medal {
private var _id:uint;
private var _name:String;
private var _value:uint;
private var _difficultyId:uint;
private var _unlocked:Boolean;// = false
private var _iconUrl:URLRequest;
private var _iconLoader:Loader;
private var _icon:BitmapData;
private static const DEFAULT_ICON:BitmapData = new BitmapData(50, 50, false, 0);
private static const DIFFICULT_NAMES:Array = [null, "Easy", "Moderate", "Challenging", "Difficult", "Brutal"];
public function Medal(_arg1:uint, _arg2:String, _arg3:uint, _arg4:uint, _arg5:Boolean, _arg6:String){
var id = _arg1;
var name = _arg2;
var value = _arg3;
var difficulty = _arg4;
var unlocked = _arg5;
var iconUrl = _arg6;
this._icon = DEFAULT_ICON;
super();
this._id = id;
this._name = name;
this._value = value;
this._difficultyId = difficulty;
this._unlocked = unlocked;
if (iconUrl){
this._iconUrl = new URLRequest(iconUrl);
this._iconLoader = new Loader();
this._iconLoader.contentLoaderInfo.addEventListener(Event.INIT, this.onIconLoaderInit);
this._iconLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, this.onIconLoaderError);
this._iconLoader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, this.onIconLoaderError);
this._iconLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, this.onIconLoaderComplete);
try {
this._iconLoader.load(this._iconUrl, new LoaderContext(true));
} catch(e:Error) {
onIconLoaderError(null);
};
};
}
public function get difficulty():String{
return (DIFFICULT_NAMES[this._difficultyId]);
}
public function get difficultyId():uint{
return (this._difficultyId);
}
public function get icon():BitmapData{
return (this._icon);
}
public function get id():uint{
return (this._id);
}
public function get name():String{
return (this._name);
}
public function get unlocked():Boolean{
return (this._unlocked);
}
public function set unlocked(_arg1:Boolean):void{
this._unlocked = _arg1;
}
public function get value():uint{
return (this._value);
}
public function get bytesLoaded():uint{
return ((this._iconLoader) ? this._iconLoader.contentLoaderInfo.bytesLoaded : 0);
}
public function get bytesTotal():uint{
return ((this._iconLoader) ? this._iconLoader.contentLoaderInfo.bytesTotal : 0);
}
private function onIconLoaderInit(_arg1:Event):void{
}
private function onIconLoaderError(_arg1:IOErrorEvent):void{
trace((((("[NewgroundsAPI WARNING] :: Failed to load medal icon for " + this.name) + " (") + this._iconUrl.url.split("/").pop()) + ")"));
this._iconLoader.unload();
this._iconLoader = null;
}
private function onIconLoaderComplete(_arg1:Event):void{
var _local2:Bitmap = (this._iconLoader.content as Bitmap);
this._icon = _local2.bitmapData;
this._iconLoader.unload();
this._iconLoader = null;
}
public function unlock():void{
if (!this._unlocked){
API.unlockMedal(this._name);
};
}
public function createIconBitmap():Bitmap{
return (new Bitmap(this.icon));
}
public function toString():String{
return (this._name);
}
public static function createFromObject(_arg1:Object):Medal{
return (new Medal(_arg1.medal_id, _arg1.medal_name, _arg1.medal_value, _arg1.medal_difficulty, _arg1.medal_unlocked, _arg1.medal_icon));
}
}
}//package com.newgrounds
Section 25
//RC4 (com.newgrounds.RC4)
package com.newgrounds {
public class RC4 {
private static var sbox:Array = new Array(0xFF);
private static var mykey:Array = new Array(0xFF);
public static function encrypt(_arg1:String, _arg2:String):String{
var _local3:Array = strToChars(_arg1);
var _local4:Array = strToChars(_arg2);
var _local5:Array = calculate(_local3, _local4);
return (charsToHex(_local5));
}
public static function encryptbin(_arg1:String, _arg2:String):Array{
var _local3:Array = strToChars(_arg1);
var _local4:Array = strToChars(_arg2);
var _local5:Array = calculate(_local3, _local4);
return (_local5);
}
public static function decrypt(_arg1:String, _arg2:String):String{
var _local3:Array = hexToChars(_arg1);
var _local4:Array = strToChars(_arg2);
var _local5:Array = calculate(_local3, _local4);
return (charsToStr(_local5));
}
private static function initialize(_arg1:Array):void{
var _local3:uint;
var _local2:uint;
var _local4:uint = _arg1.length;
var _local5:uint;
while (_local5 <= 0xFF) {
mykey[_local5] = _arg1[(_local5 % _local4)];
sbox[_local5] = _local5;
_local5++;
};
_local5 = 0;
while (_local5 <= 0xFF) {
_local2 = (((_local2 + sbox[_local5]) + mykey[_local5]) % 0x0100);
_local3 = sbox[_local5];
sbox[_local5] = sbox[_local2];
sbox[_local2] = _local3;
_local5++;
};
}
private static function calculate(_arg1:Array, _arg2:Array):Array{
var _local6:uint;
var _local7:uint;
var _local8:uint;
var _local10:uint;
initialize(_arg2);
var _local3:uint;
var _local4:uint;
var _local5:Array = new Array();
var _local9:uint;
while (_local9 < _arg1.length) {
_local3 = ((_local3 + 1) % 0x0100);
_local4 = ((_local4 + sbox[_local3]) % 0x0100);
_local7 = sbox[_local3];
sbox[_local3] = sbox[_local4];
sbox[_local4] = _local7;
_local10 = ((sbox[_local3] + sbox[_local4]) % 0x0100);
_local6 = sbox[_local10];
_local8 = (_arg1[_local9] ^ _local6);
_local5.push(_local8);
_local9++;
};
return (_local5);
}
private static function charsToHex(_arg1:Array):String{
var _local2:String = new String("");
var _local3:Array = new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f");
var _local4:uint;
while (_local4 < _arg1.length) {
_local2 = (_local2 + (_local3[(_arg1[_local4] >> 4)] + _local3[(_arg1[_local4] & 15)]));
_local4++;
};
return (_local2);
}
private static function hexToChars(_arg1:String):Array{
var _local2:Array = new Array();
var _local3:uint = ((_arg1.substr(0, 2))=="0x") ? 2 : 0;
while (_local3 < _arg1.length) {
_local2.push(parseInt(_arg1.substr(_local3, 2), 16));
_local3 = (_local3 + 2);
};
return (_local2);
}
private static function charsToStr(_arg1:Array):String{
var _local2:String = new String("");
var _local3:uint;
while (_local3 < _arg1.length) {
_local2 = (_local2 + String.fromCharCode(_arg1[_local3]));
_local3++;
};
return (_local2);
}
private static function strToChars(_arg1:String):Array{
var _local2:Array = new Array();
var _local3:uint;
while (_local3 < _arg1.length) {
_local2.push(_arg1.charCodeAt(_local3));
_local3++;
};
return (_local2);
}
}
}//package com.newgrounds
Section 26
//SaveFile (com.newgrounds.SaveFile)
package com.newgrounds {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
public class SaveFile extends EventDispatcher {
private var _filename:String;
private var _id:uint;
private var _description:String;
private var _contents;
private var _loader:SmartURLLoader;
private var _group:SaveGroup;
private var _keys:Dictionary;
private var _ratings:Dictionary;
private var _fileUrl:String;
private var _thumbnail:BitmapData;
private var _thumbnailUrl:String;
private var _authorId:uint;
private var _authorName:String;
private var _contentSize:uint;
private var _status:uint;
public static const STATUS_PRIVATE = 1;
public static const STATUS_SHARED = 2;
public static const STATUS_UNAPPROVED = 3;
public static const STATUS_APPROVED = 4;
public function SaveFile(_arg1:SaveGroup){
this._keys = new Dictionary();
this._ratings = new Dictionary();
this._group = _arg1;
this._description = "";
}
public function get name():String{
return (this._filename);
}
public function set name(_arg1:String):void{
this._filename = _arg1;
}
public function get id():uint{
return (this._id);
}
public function set id(_arg1:uint):void{
this._id = _arg1;
}
public function get description():String{
return (this._description);
}
public function set description(_arg1:String):void{
this._description = _arg1;
}
public function get contents(){
return (this._contents);
}
public function set contents(_arg1):void{
this._contents = _arg1;
this._contentSize = 0;
}
public function get thumbnailUrl():String{
return (this._thumbnailUrl);
}
public function set thumbnailUrl(_arg1:String):void{
this._thumbnailUrl = _arg1;
}
public function get fileUrl():String{
return (this._fileUrl);
}
public function set fileUrl(_arg1:String):void{
this._fileUrl = _arg1;
}
public function get thumbnail():BitmapData{
return (this._thumbnail);
}
public function set thumbnail(_arg1:BitmapData):void{
if (this._thumbnail){
this._thumbnail.dispose();
};
this._thumbnail = _arg1.clone();
}
public function loadThumbnail():Loader{
var _local1:Loader = new Loader();
if (this._thumbnailUrl){
_local1.load(new URLRequest(this._thumbnailUrl));
};
return (_local1);
}
public function get bytesLoaded():uint{
return ((this._loader) ? this._loader.bytesLoaded : this._contentSize);
}
public function get bytesTotal():uint{
return ((this._loader) ? this._loader.bytesTotal : this._contentSize);
}
public function get status():uint{
return (this._status);
}
function setStatus(_arg1:uint):void{
this._status = _arg1;
}
public function get groupId():uint{
return (this._group.id);
}
public function get groupName():String{
return (this._group.name);
}
public function get groupType():uint{
return (this._group.type);
}
public function get authorName():String{
return (this._authorName);
}
public function set authorName(_arg1:String):void{
this._authorName = _arg1;
}
public function get authorId():uint{
return (this._authorId);
}
public function set authorId(_arg1:uint):void{
this._authorId = _arg1;
}
public function get shared():Boolean{
return (true);
}
public function setKey(_arg1, _arg2):void{
var _local3:SaveKey;
if ((_arg1 is String)){
_local3 = this._group.getKeyByName(_arg1);
} else {
_local3 = this._group.getKeyById(_arg1);
};
if (_local3){
this._keys[_local3] = {id:_local3.id, val:_arg2};
};
}
public function getKey(_arg1){
var _local2:SaveKey;
if ((_arg1 is String)){
_local2 = this._group.getKeyByName(_arg1);
} else {
_local2 = this._group.getKeyById(_arg1);
};
if (_local2){
return (this._keys[_local2]);
};
return (null);
}
public function setRating(_arg1, _arg2:Number, _arg3:Number):void{
var _local4:SaveRating;
if ((_arg1 is String)){
_local4 = this._group.getRatingByName(_arg1);
} else {
_local4 = this._group.getRatingById(_arg1);
};
if (_local4){
this._ratings[_local4] = {id:_local4.id, name:_local4.name, votes:_arg2, score:_arg3};
};
}
public function getRating(_arg1):Object{
var _local2:SaveRating;
if ((_arg1 is String)){
_local2 = this._group.getRatingByName(_arg1);
} else {
_local2 = this._group.getRatingById(_arg1);
};
if (_local2){
return (this._ratings[_local2]);
};
return (null);
}
public function sendRating(_arg1:String, _arg2:Number):void{
var _local3:SaveRating = this._group.getRatingByName(_arg1);
if (!_local3){
trace((("[NewgroundsAPISaveFile] " + _arg1) + " is not a recognized save file"));
return;
};
if ((((_arg2 < _local3.minValue)) || ((_arg2 > _local3.maxValue)))){
trace(((("[NewgroundsAPISaveFile] Vote must be between " + _local3.minValue) + " and ") + _local3.maxValue));
return;
};
_local3.voted = true;
API.rateSaveFile(this, _local3, _arg2);
}
override public function toString():String{
var _local2:Object;
var _local3:Object;
var _local1 = (((((("Save File " + this._filename) + " ID: ") + this._id) + "\n ") + this._description) + "\n");
for each (_local2 in this._keys) {
_local1 = (_local1 + ((((" " + this._group.getKeyById(_local2.id).name) + ": ") + _local2.val) + "\n"));
};
for each (_local3 in this._ratings) {
_local1 = (_local1 + ((((((" " + this._group.getRatingById(_local3.id).name) + "\n Score: ") + _local3.score) + " Votes: ") + _local3.votes) + "\n"));
};
return (_local1);
}
public function toObject():Object{
var _local2:Object;
var _local1:Object = {group:this.groupId, filename:this.name, description:this.description, shared:true};
_local1.keys = [];
for each (_local2 in this._keys) {
_local1.keys.push({id:_local2.id, value:_local2.val});
};
return (_local1);
}
public function save(_arg1:Boolean=false, _arg2:Boolean=false):void{
API.saveFile(this, _arg1, _arg2);
}
public function loadContents():void{
if (this._fileUrl){
this._loader = new SmartURLLoader();
this._loader.responseFormat = URLLoaderDataFormat.BINARY;
this._loader.addEventListener(Event.COMPLETE, this.onContentsLoaded);
this._loader.addEventListener(IOErrorEvent.IO_ERROR, this.onContentsError);
this._loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, this.onContentsError);
this._loader.load(this._fileUrl);
};
}
private function onContentsError(_arg1:Event):void{
this._loader = null;
dispatchEvent(new APIEvent(APIEvent.FILE_LOADED, false));
this._contentSize = 0;
}
private function onContentsLoaded(_arg1:Event):void{
var _local2:ByteArray = _arg1.target.response;
this._contentSize = _local2.length;
_local2.uncompress();
var _local3:uint = _local2.readUnsignedByte();
if (_local3 == 0){
this._contents = new ByteArray();
this._contents.writeBytes(_local2, 1);
} else {
this._contents = _local2.readObject();
};
this._loader = null;
dispatchEvent(new APIEvent(APIEvent.FILE_LOADED, true, this.contents));
}
public function loadAuthorPage(){
API.loadUserPage(this._authorId, this._authorName);
}
function fileSaved(_arg1:Object):void{
this._id = _arg1.save_id;
this._thumbnailUrl = _arg1.thumbnail;
this._fileUrl = _arg1.file_url;
}
}
}//package com.newgrounds
Section 27
//SaveGroup (com.newgrounds.SaveGroup)
package com.newgrounds {
public class SaveGroup {
private var _name:String;
private var _id:uint;
private var _type:uint;
private var _keys:Array;
private var _ratings:Array;
private var _files:Array;
public static const TYPE_SYSTEM:uint = 0;
public static const TYPE_PRIVATE:uint = 1;
public static const TYPE_PUBLIC:uint = 2;
public static const TYPE_MODERATED:uint = 3;
public function SaveGroup(_arg1:uint, _arg2:String, _arg3:uint){
this._name = _arg2;
this._id = _arg1;
this._type = _arg3;
this._ratings = [];
this._keys = [];
this._files = [];
}
public function get name():String{
return (this._name);
}
public function get id():uint{
return (this._id);
}
public function get type():uint{
return (this._type);
}
public function get keys():Array{
return (this._keys.concat());
}
public function get ratings():Array{
return (this._ratings.concat());
}
public function addRating(_arg1:SaveRating):void{
this._ratings.push(_arg1);
}
public function getRatingById(_arg1:uint):SaveRating{
var _local2:uint;
while (_local2 < this._ratings.length) {
if (this._ratings[_local2].id == _arg1){
return (this._ratings[_local2]);
};
_local2++;
};
return (null);
}
public function getRatingByName(_arg1:String):SaveRating{
var _local2:uint;
while (_local2 < this._ratings.length) {
if (this._ratings[_local2].name == _arg1){
return (this._ratings[_local2]);
};
_local2++;
};
return (null);
}
public function addKey(_arg1:SaveKey):void{
this._keys.push(_arg1);
}
public function getKeyById(_arg1:uint):SaveKey{
var _local2:uint;
while (_local2 < this._keys.length) {
if (this._keys[_local2].id == _arg1){
return (this._keys[_local2]);
};
_local2++;
};
return (null);
}
public function getKeyByName(_arg1:String):SaveKey{
var _local2:uint;
while (_local2 < this._keys.length) {
if (this._keys[_local2].name == _arg1){
return (this._keys[_local2]);
};
_local2++;
};
return (null);
}
public function createQuery():SaveGroupQuery{
return (new SaveGroupQuery(this));
}
public function toString():String{
return ((((((("SaveGroup { name: " + this._name) + ", id: ") + this._id) + ", keys: ") + this._keys) + "}"));
}
public static function createFromObject(_arg1:Object):SaveGroup{
var _local4:Object;
var _local5:Object;
var _local2:SaveGroup = new SaveGroup(_arg1.group_id, _arg1.group_name, _arg1.group_type);
var _local3:uint;
while (_local3 < _arg1.keys.length) {
_local4 = _arg1.keys[_local3];
_local2.addKey(new SaveKey(_local4.id, _local4.name, _local4.type));
_local3++;
};
_local3 = 0;
while (_local3 < _arg1.ratings.length) {
_local5 = _arg1.ratings[_local3];
_local2.addRating(new SaveRating(_local5.id, _local5.name, _local5.float, _local5.min, _local5.max));
_local3++;
};
return (_local2);
}
}
}//package com.newgrounds
Section 28
//SaveGroupQuery (com.newgrounds.SaveGroupQuery)
package com.newgrounds {
import flash.events.*;
public class SaveGroupQuery extends EventDispatcher {
private var _group:SaveGroup;
private var _groupBy:Array;
private var _lookupKeys:Array;
private var _lookupRatings:Array;
private var _fileConditions:Array;
private var _keyConditions:Array;
private var _ratingConditions:Array;
private var _sortConditions:Array;
private var _page:uint;
private var _resultsPerPage:uint;
private var _randomizeResults:Boolean;
public static const TABLE_FILES:uint = 1;
public static const TABLE_KEYS:uint = 2;
public static const TABLE_RATINGS:uint = 3;
public static const FILE_ID:uint = 0;
public static const AUTHOR_ID:uint = 1;
public static const AUTHOR_NAME:uint = 2;
public static const FILE_NAME:uint = 3;
public static const CREATED_ON:uint = 4;
public static const UPDATED_ON:uint = 5;
public static const TOTAL_VIEWS:uint = 6;
public static const FILE_STATUS:uint = 7;
public static const SCORE:String = "score";
public static const TOTAL_VOTES:String = "votes";
public function SaveGroupQuery(_arg1:SaveGroup){
this._group = _arg1;
this.reset();
}
public function get group():SaveGroup{
return (this._group);
}
public function get groupId():uint{
return (this._group.id);
}
public function get resultsPerPage():uint{
return (this._resultsPerPage);
}
public function set resultsPerPage(_arg1:uint):void{
this._resultsPerPage = _arg1;
}
public function get page():uint{
return (this._page);
}
public function set page(_arg1:uint):void{
this._page = _arg1;
}
public function get isRandomized():Boolean{
return (this._randomizeResults);
}
public function set isRandomized(_arg1:Boolean):void{
this._randomizeResults = _arg1;
}
public function reset():void{
this._fileConditions = [];
this._keyConditions = [];
this._ratingConditions = [];
this._sortConditions = [];
this._groupBy = [];
this._lookupKeys = [];
this._lookupRatings = [];
this._randomizeResults = false;
this._resultsPerPage = 20;
this._page = 1;
}
public function includeKey(_arg1:String):void{
var _local2:SaveKey = this._group.getKeyByName(_arg1);
if (_local2){
this._lookupKeys.push(_local2.id);
};
}
public function includeRating(_arg1:String):void{
var _local2:SaveRating = this._group.getRatingByName(_arg1);
if (_local2){
this._lookupRatings.push(_local2.id);
};
}
public function excludeKey(_arg1:String):void{
var _local2:SaveKey = this._group.getKeyByName(_arg1);
var _local3:uint;
while (_local3 < this._lookupKeys.length) {
if (this._lookupKeys[_local3] == _local2.id){
this._lookupKeys.splice(_local3, 1);
return;
};
_local3++;
};
}
public function excludeRating(_arg1:String):void{
var _local2:SaveRating = this._group.getRatingByName(_arg1);
var _local3:uint;
while (_local3 < this._lookupRatings.length) {
if (this._lookupRatings[_local3] == _local2.id){
this._lookupRatings.splice(_local3, 1);
return;
};
_local3++;
};
}
public function groupBy(_arg1:uint):void{
this._groupBy.push({table:TABLE_FILES, field:_arg1});
}
public function groupByRating(_arg1:String):void{
var _local2:SaveRating = this._group.getRatingByName(_arg1);
if (!_local2){
return;
};
this._groupBy.push({table:TABLE_RATINGS, field:_local2.id});
}
public function groupByKey(_arg1:String):void{
var _local2:SaveKey = this._group.getKeyByName(_arg1);
if (!_local2){
return;
};
this._groupBy.push({table:TABLE_KEYS, field:_local2.id});
}
public function addFileCondition(_arg1:uint, _arg2:String, _arg3):void{
this._fileConditions.push({field:_arg1, operator:_arg2, value:_arg3});
}
public function addKeyCondition(_arg1:String, _arg2:String, _arg3):void{
var _local4:SaveKey = this._group.getKeyByName(_arg1);
if (!_local4){
return;
};
if (!this.checkValue(_arg3, _local4.type)){
return;
};
this._keyConditions.push({key_id:_local4.id, operator:_arg2, value:_arg3});
}
public function addRatingCondition(_arg1:String, _arg2:String, _arg3, _arg4:String="score"):void{
var _local5:SaveRating = this._group.getRatingByName(_arg1);
if (!_local5){
return;
};
this._ratingConditions.push({rating_id:_local5.id, operator:_arg2, value:_arg3, column:_arg4});
}
private function addSortCondition(_arg1:uint, _arg2:uint, _arg3:Boolean=false, _arg4=null):void{
var _local5:Object = {table:_arg1, field:_arg2, desc:_arg3};
if (_arg4){
_local5.extra = _arg4;
};
this._sortConditions.push(_local5);
}
public function sortOn(_arg1:uint, _arg2:Boolean=false):void{
this.addSortCondition(TABLE_FILES, _arg1, _arg2);
}
public function sortOnKey(_arg1:String, _arg2:Boolean=false):void{
this.addSortCondition(TABLE_KEYS, this._group.getKeyByName(_arg1).id, _arg2);
}
public function sortOnRating(_arg1:String, _arg2:Boolean=false, _arg3:String="score"):void{
this.addSortCondition(TABLE_RATINGS, this._group.getRatingByName(_arg1).id, _arg2, _arg3);
}
public function execute():void{
API.executeSaveQuery(this);
}
private function checkValue(_arg1, _arg2:uint):Boolean{
return (true);
}
override public function toString():String{
return ("");
}
public function toObject():Object{
var _local1:Object = {page:this._page, num_results:this._resultsPerPage};
if (this.isRandomized){
_local1.randomize = 1;
};
if (((this._fileConditions) && ((this._fileConditions.length > 0)))){
_local1.file_conditions = this._fileConditions;
};
if (((this._keyConditions) && ((this._keyConditions.length > 0)))){
_local1.key_conditions = this._keyConditions;
};
if (((this._ratingConditions) && ((this._ratingConditions.length > 0)))){
_local1.rating_conditions = this._ratingConditions;
};
if (((this._sortConditions) && ((this._sortConditions.length > 0)))){
_local1.sort_conditions = this._sortConditions;
};
if (((this._lookupKeys) && ((this._lookupKeys.length > 0)))){
_local1.lookup_keys = this._lookupKeys;
};
if (((this._lookupRatings) && ((this._lookupRatings.length > 0)))){
_local1.lookup_ratings = this._lookupRatings;
};
if (((this._groupBy) && ((this._groupBy.length > 0)))){
_local1.group_by = this._groupBy;
};
return (_local1);
}
}
}//package com.newgrounds
Section 29
//SaveKey (com.newgrounds.SaveKey)
package com.newgrounds {
public class SaveKey {
private var _id:uint;
private var _name:String;
private var _type:uint;
public static const TYPE_FLOAT:uint = 1;
public static const TYPE_INTEGER:uint = 2;
public static const TYPE_STRING:uint = 3;
public static const TYPE_BOOLEAN:uint = 4;
public function SaveKey(_arg1:uint, _arg2:String, _arg3:uint){
this._id = _arg1;
this._name = _arg2;
this._type = _arg3;
}
public function get id():uint{
return (this._id);
}
public function get name():String{
return (this._name);
}
public function get type():uint{
return (this._type);
}
public function isValueValid(_arg1):Boolean{
if (this._type == TYPE_INTEGER){
return ((((_arg1 is int)) || ((_arg1 is uint))));
};
if (this._type == TYPE_FLOAT){
return ((((((_arg1 is int)) || ((_arg1 is uint)))) || ((_arg1 is Number))));
};
if (this._type == TYPE_STRING){
return ((_arg1 is String));
};
if (this._type == TYPE_BOOLEAN){
return ((((((((_arg1 is Boolean)) || ((_arg1 === 0)))) || ((_arg1 === 1)))) || ((_arg1 == ""))));
};
return (false);
}
public function toString():String{
return (this._name);
}
}
}//package com.newgrounds
Section 30
//SaveRating (com.newgrounds.SaveRating)
package com.newgrounds {
public class SaveRating {
private var _id:uint;
private var _name:String;
private var _minValue:Number;
private var _maxValue:Number;
private var _isFloat:Boolean;
private var _voted:Boolean;
public function SaveRating(_arg1:uint, _arg2:String, _arg3:Boolean, _arg4:Number=-INF, _arg5:Number=INF){
this._id = _arg1;
this._name = _arg2;
this._isFloat = _arg3;
this._minValue = _arg4;
this._maxValue = _arg5;
}
public function get id():uint{
return (this._id);
}
public function get name():String{
return (this._name);
}
public function get minValue():Number{
return (this._minValue);
}
public function get maxValue():Number{
return (this._maxValue);
}
public function get isFloat():Boolean{
return (this._isFloat);
}
public function get voted():Boolean{
return (this._voted);
}
public function set voted(_arg1:Boolean):void{
this._voted = _arg1;
}
public function toString():String{
return (this._name);
}
}
}//package com.newgrounds
Section 31
//Score (com.newgrounds.Score)
package com.newgrounds {
public class Score {
private var _board:ScoreBoard;
private var _position:uint;
private var _username:String;
private var _value:String;
private var _numeric_value:uint;
private var _tag:String;
public function Score(_arg1:ScoreBoard, _arg2:Number, _arg3:String, _arg4:String, _arg5:uint, _arg6:String){
this._board = _arg1;
this._position = _arg2;
this._username = _arg3;
this._value = _arg4;
this._numeric_value = _arg5;
this._tag = _arg6;
}
public function get board():ScoreBoard{
return (this._board);
}
public function get position():uint{
return (this._position);
}
public function get username():String{
return (this._username);
}
public function get value():String{
return (this._value);
}
public function get numeric_value():uint{
return (this._numeric_value);
}
public function get tag():String{
return (this._tag);
}
}
}//package com.newgrounds
Section 32
//ScoreBoard (com.newgrounds.ScoreBoard)
package com.newgrounds {
import flash.events.*;
public class ScoreBoard extends EventDispatcher {
private var _name:String;
private var _id:uint;
private var _scores:Array;
private var _period:String;// = "Today"
private var _num_results:uint;// = 10
private var _numScores:uint;
private var _desiredNumResults:uint;
private var _startRank:uint;
private var _endRank:uint;
private var _page:uint;// = 1
private var _tag:String;
public function ScoreBoard(_arg1:uint, _arg2:String, _arg3:String){
this._name = _arg2;
this._id = _arg1;
this._scores = [];
this._tag = _arg3;
}
public function exists():Boolean{
return ((this._id > 0));
}
public function get id():Number{
return (this._id);
}
public function get name():String{
return (this._name);
}
public function get period():String{
return (this._period);
}
public function get page():uint{
return (this._page);
}
public function get num_results():uint{
return (this._num_results);
}
public function get scores():Array{
return (this._scores);
}
public function get tag():String{
return (this._tag);
}
public function get num_scores():uint{
return (this._numScores);
}
public function postScore(_arg1:uint):void{
API.postScore(this._name, _arg1);
}
public function loadScores(_arg1:String="Today", _arg2:uint=1, _arg3:uint=10):void{
this._period = _arg1;
if (((!(this._period)) || ((this._period == "")))){
this._period = ScoreBoardPeriod.TODAY;
};
this._page = _arg2;
this._num_results = _arg3;
this._desiredNumResults = 0;
API.loadScores(this);
}
public function loadScoresInRange(_arg1:String="Today", _arg2:uint=1, _arg3:uint=10):void{
if (_arg2 == 0){
_arg2 = 1;
};
if (_arg3 < _arg2){
_arg3 = _arg2;
};
this._period = _arg1;
if (((!(this._period)) || ((this._period == "")))){
this._period = ScoreBoardPeriod.TODAY;
};
this._desiredNumResults = ((_arg3 - _arg2) + 1);
this._num_results = this._desiredNumResults;
while (int(((_arg2 - 1) / this._num_results)) != int(((_arg3 - 1) / this._num_results))) {
this._num_results++;
};
this._page = ((_arg2 - 1) / this._num_results);
this._startRank = _arg2;
this._endRank = _arg3;
this._page++;
API.loadScores(this);
}
function setScores(_arg1:Array, _arg2:String, _arg3:Number, _arg4:Number, _arg5:uint):void{
var _local7:uint;
this._period = _arg2;
this._page = _arg3;
this._num_results = _arg4;
this._numScores = _arg5;
this._scores = [];
var _local6:uint;
while (_local6 < _arg1.length) {
_local7 = (((this._num_results * (this._page - 1)) + 1) + _local6);
if (((!(this._desiredNumResults)) || ((((_local7 >= this._startRank)) && ((_local7 <= this._endRank)))))){
this._scores.push(new Score(this, _local7, _arg1[_local6].username, _arg1[_local6].value, _arg1[_local6].numeric_value, _arg1[_local6].tag));
};
_local6++;
};
this._num_results = this._scores.length;
}
}
}//package com.newgrounds
Section 33
//ScoreBoardPeriod (com.newgrounds.ScoreBoardPeriod)
package com.newgrounds {
public class ScoreBoardPeriod {
public static const TODAY:String = "Today";
public static const WEEK:String = "This Week";
public static const MONTH:String = "This Month";
public static const YEAR:String = "This Year";
public static const ALL_TIME:String = "All-Time";
}
}//package com.newgrounds
Section 34
//SmartURLLoader (com.newgrounds.SmartURLLoader)
package com.newgrounds {
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.errors.*;
public class SmartURLLoader extends EventDispatcher {
private var _variables:Dictionary;
private var _files:Dictionary;
private var _hasVariables:Boolean;
private var _method:String;// = "GET"
private var _urlRequest:URLRequest;
private var _urlLoader:URLLoader;
private var _dataFormat:String;// = "text"
private var _openBrowser:Boolean;// = false
private var _preventCache:Boolean;// = false
var _command:String;
public var owner;
private static const CRLF:String = "
";
private static var _loaders:Dictionary = new Dictionary();
public function SmartURLLoader(){
this._urlRequest = new URLRequest();
this._variables = new Dictionary();
}
public function get responseFormat():String{
return (this._dataFormat);
}
public function set responseFormat(_arg1:String):void{
this._dataFormat = _arg1;
}
public function get response(){
return (this._urlLoader.data);
}
public function get hasFiles():Boolean{
return (Boolean(this._files));
}
public function get method():String{
return (this._method);
}
public function set method(_arg1:String):void{
if (((this.hasFiles) && ((_arg1 == URLRequestMethod.GET)))){
throw (new IllegalOperationError("GET cannot be used to upload files."));
};
this._method = _arg1;
}
public function get openBrowser():Boolean{
return (this._openBrowser);
}
public function set openBrowser(_arg1:Boolean):void{
this._openBrowser = _arg1;
}
public function get preventCache():Boolean{
return (this._preventCache);
}
public function set preventCache(_arg1:Boolean):void{
this._preventCache = _arg1;
}
public function get bytesLoaded():uint{
return ((this._urlLoader) ? this._urlLoader.bytesLoaded : 0);
}
public function get bytesTotal():uint{
return ((this._urlLoader) ? this._urlLoader.bytesTotal : 0);
}
public function addVariable(_arg1:String, _arg2=""):void{
this._variables[_arg1] = _arg2;
if (_arg2){
this._hasVariables = true;
};
}
public function addFile(_arg1:String, _arg2:ByteArray, _arg3:String, _arg4:String="application/octect-stream"):void{
this.method = URLRequestMethod.POST;
if (!this._files){
this._files = new Dictionary();
};
this._files[_arg1] = new File(_arg1, _arg2, _arg3, _arg4);
}
public function clearVariables():void{
this._variables = new Dictionary();
}
public function clearFiles():void{
this._files = null;
}
public function load(_arg1:String):void{
var urlVariables:URLVariables;
var key:String;
var boundary:String;
var i:uint;
var event:SecurityErrorEvent;
var url = _arg1;
this._urlRequest.url = url;
if (this._preventCache){
url = (url + ("?seed=" + Math.random()));
if (this._hasVariables){
url = (url + "&");
};
};
this._urlRequest.method = this._method;
if ((((this._urlRequest.method == URLRequestMethod.GET)) || (!(this.hasFiles)))){
this._urlRequest.contentType = "application/x-www-form-urlencoded";
if (this._hasVariables){
urlVariables = new URLVariables();
for (key in this._variables) {
urlVariables[key] = this._variables[key];
};
this._urlRequest.data = urlVariables;
};
} else {
boundary = "";
i = 0;
while (i < 32) {
boundary = (boundary + String.fromCharCode(uint((97 + (Math.random() * 25)))));
i = (i + 1);
};
this._urlRequest.contentType = (("multipart/form-data; boundary=\"" + boundary) + "\"");
this._urlRequest.data = this.buildMultipartData(boundary);
};
if (this.openBrowser){
navigateToURL(this._urlRequest, "_blank");
} else {
this._urlLoader = new URLLoader();
this._urlLoader.dataFormat = this._dataFormat;
this._urlLoader.addEventListener(Event.COMPLETE, this.onComplete);
this._urlLoader.addEventListener(ProgressEvent.PROGRESS, this.onProgress);
this._urlLoader.addEventListener(IOErrorEvent.IO_ERROR, this.onIOError);
this._urlLoader.addEventListener(HTTPStatusEvent.HTTP_STATUS, this.onHTTPStatus);
this._urlLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, this.onSecurityError);
_loaders[this._urlLoader] = this;
try {
this._urlLoader.load(this._urlRequest);
} catch(error:Error) {
event = new SecurityErrorEvent(SecurityErrorEvent.SECURITY_ERROR, false, false, error.message);
onSecurityError(event);
};
};
}
public function close():void{
try {
this._urlLoader.close();
} catch(e:Error) {
};
}
public function dispose():void{
this.close();
this._files = null;
this._variables = null;
if (this._urlLoader){
this._urlLoader.removeEventListener(Event.COMPLETE, this.onComplete);
this._urlLoader.removeEventListener(ProgressEvent.PROGRESS, this.onProgress);
this._urlLoader.removeEventListener(IOErrorEvent.IO_ERROR, this.onIOError);
this._urlLoader.removeEventListener(HTTPStatusEvent.HTTP_STATUS, this.onHTTPStatus);
this._urlLoader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, this.onSecurityError);
this._urlLoader = null;
};
this._urlRequest = null;
delete _loaders[this];
}
private function buildMultipartData(_arg1:String):ByteArray{
var _local3:String;
var _local4:File;
var _local2:ByteArray = new ByteArray();
_local2.endian = Endian.BIG_ENDIAN;
_arg1 = ("--" + _arg1);
for (_local3 in this._variables) {
_local2.writeUTFBytes((_arg1 + CRLF));
_local2.writeUTFBytes(((("Content-Disposition: form-data; name=\"" + _local3) + "\"") + CRLF));
_local2.writeUTFBytes(CRLF);
_local2.writeUTFBytes((this._variables[_local3] + CRLF));
};
if (this.hasFiles){
for each (_local4 in this._files) {
_local2.writeUTFBytes((_arg1 + CRLF));
_local2.writeUTFBytes(("Content-Disposition: form-data; name=\"Filename\"" + CRLF));
_local2.writeUTFBytes(CRLF);
_local2.writeUTFBytes((_local4.fileName + CRLF));
_local2.writeUTFBytes((_arg1 + CRLF));
_local2.writeUTFBytes(((((("Content-Disposition: form-data; name=\"" + _local4.dataField) + "\"; filename=\"") + _local4.fileName) + "\"") + CRLF));
_local2.writeUTFBytes((("Content-Type: " + _local4.contentType) + CRLF));
_local2.writeUTFBytes(CRLF);
_local2.writeBytes(_local4.data);
_local2.writeUTFBytes(CRLF);
};
_local2.writeUTFBytes((_arg1 + CRLF));
_local2.writeUTFBytes(("Content-Disposition: form-data; name=\"Upload\"" + CRLF));
_local2.writeUTFBytes(CRLF);
_local2.writeUTFBytes(("Submit Query" + CRLF));
};
_local2.writeUTFBytes((_arg1 + "--"));
_local2.position = 0;
_local2.position = 0;
return (_local2);
}
private function onComplete(_arg1:Event):void{
dispatchEvent(_arg1);
this.dispose();
}
private function onProgress(_arg1:ProgressEvent):void{
dispatchEvent(_arg1);
}
private function onIOError(_arg1:IOErrorEvent):void{
dispatchEvent(_arg1);
this.dispose();
}
private function onSecurityError(_arg1:SecurityErrorEvent):void{
dispatchEvent(_arg1);
this.dispose();
}
private function onHTTPStatus(_arg1:HTTPStatusEvent):void{
dispatchEvent(_arg1);
}
public static function closeAll():void{
var _local1:SmartURLLoader;
for each (_local1 in _loaders) {
if (_local1){
_local1.dispose();
};
};
_loaders = new Dictionary();
}
}
}//package com.newgrounds
import flash.utils.*;
class File {
private var fileName:String;
private var data:ByteArray;
private var dataField:String;
private var contentType:String;
private function File(_arg1:String, _arg2:ByteArray, _arg3:String="Filedata", _arg4:String="application/octet-stream"){
this.fileName = _arg1;
this.data = _arg2;
this.dataField = _arg3;
this.contentType = _arg4;
}
}
Section 35
//AdLoader (CPMStar.AdLoader)
package CPMStar {
import flash.events.*;
import flash.display.*;
import flash.net.*;
import flash.system.*;
public class AdLoader extends Sprite {
private var contentspotid:String;
private var cpmstarLoader:Loader;
public function AdLoader(_arg1:String){
this.contentspotid = _arg1;
addEventListener(Event.ADDED, addedHandler);
}
private function addedHandler(_arg1:Event):void{
var _local2:String;
var _local3:DisplayObjectContainer;
removeEventListener(Event.ADDED, addedHandler);
Security.allowDomain("server.cpmstar.com");
_local2 = "http://server.cpmstar.com/adviewas3.swf";
_local3 = parent;
cpmstarLoader = new Loader();
cpmstarLoader.contentLoaderInfo.addEventListener(Event.INIT, dispatchHandler);
cpmstarLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, dispatchHandler);
cpmstarLoader.load(new URLRequest(((_local2 + "?contentspotid=") + contentspotid)));
addChild(cpmstarLoader);
}
private function dispatchHandler(_arg1:Event):void{
dispatchEvent(_arg1);
}
}
}//package CPMStar
Section 36
//Color (fl.motion.Color)
package fl.motion {
import flash.display.*;
import flash.geom.*;
public class Color extends ColorTransform {
private var _tintMultiplier:Number;// = 0
private var _tintColor:Number;// = 0
public function Color(_arg1:Number=1, _arg2:Number=1, _arg3:Number=1, _arg4:Number=1, _arg5:Number=0, _arg6:Number=0, _arg7:Number=0, _arg8:Number=0){
_tintColor = 0;
_tintMultiplier = 0;
super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8);
}
public function setTint(_arg1:uint, _arg2:Number):void{
var _local3:uint;
var _local4:uint;
var _local5:uint;
this._tintColor = _arg1;
this._tintMultiplier = _arg2;
this.redMultiplier = (this.greenMultiplier = (this.blueMultiplier = (1 - _arg2)));
_local3 = ((_arg1 >> 16) & 0xFF);
_local4 = ((_arg1 >> 8) & 0xFF);
_local5 = (_arg1 & 0xFF);
this.redOffset = Math.round((_local3 * _arg2));
this.greenOffset = Math.round((_local4 * _arg2));
this.blueOffset = Math.round((_local5 * _arg2));
}
public function set tintColor(_arg1:uint):void{
this.setTint(_arg1, this.tintMultiplier);
}
public function get brightness():Number{
return ((this.redOffset) ? (1 - this.redMultiplier) : (this.redMultiplier - 1));
}
private function deriveTintColor():uint{
var _local1:Number;
var _local2:uint;
var _local3:uint;
var _local4:uint;
var _local5:uint;
_local1 = (1 / this.tintMultiplier);
_local2 = Math.round((this.redOffset * _local1));
_local3 = Math.round((this.greenOffset * _local1));
_local4 = Math.round((this.blueOffset * _local1));
_local5 = (((_local2 << 16) | (_local3 << 8)) | _local4);
return (_local5);
}
public function get tintMultiplier():Number{
return (this._tintMultiplier);
}
public function get tintColor():uint{
return (this._tintColor);
}
public function set brightness(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
if (_arg1 > 1){
_arg1 = 1;
} else {
if (_arg1 < -1){
_arg1 = -1;
};
};
_local2 = (1 - Math.abs(_arg1));
_local3 = 0;
if (_arg1 > 0){
_local3 = (_arg1 * 0xFF);
};
this.redMultiplier = (this.greenMultiplier = (this.blueMultiplier = _local2));
this.redOffset = (this.greenOffset = (this.blueOffset = _local3));
}
public function set tintMultiplier(_arg1:Number):void{
this.setTint(this.tintColor, _arg1);
}
private function parseXML(_arg1:XML=null):Color{
var _local2:XML;
var _local3:XML;
var _local4:String;
var _local5:uint;
if (!_arg1){
return (this);
};
_local2 = _arg1.elements()[0];
if (!_local2){
return (this);
};
for each (_local3 in _local2.attributes()) {
_local4 = _local3.localName();
if (_local4 == "tintColor"){
_local5 = (Number(_local3.toString()) as uint);
this.tintColor = _local5;
} else {
this[_local4] = Number(_local3.toString());
};
};
return (this);
}
public static function interpolateColor(_arg1:uint, _arg2:uint, _arg3:Number):uint{
var _local4:Number;
var _local5:uint;
var _local6:uint;
var _local7:uint;
var _local8:uint;
var _local9:uint;
var _local10:uint;
var _local11:uint;
var _local12:uint;
var _local13:uint;
var _local14:uint;
var _local15:uint;
var _local16:uint;
var _local17:uint;
_local4 = (1 - _arg3);
_local5 = ((_arg1 >> 24) & 0xFF);
_local6 = ((_arg1 >> 16) & 0xFF);
_local7 = ((_arg1 >> 8) & 0xFF);
_local8 = (_arg1 & 0xFF);
_local9 = ((_arg2 >> 24) & 0xFF);
_local10 = ((_arg2 >> 16) & 0xFF);
_local11 = ((_arg2 >> 8) & 0xFF);
_local12 = (_arg2 & 0xFF);
_local13 = ((_local5 * _local4) + (_local9 * _arg3));
_local14 = ((_local6 * _local4) + (_local10 * _arg3));
_local15 = ((_local7 * _local4) + (_local11 * _arg3));
_local16 = ((_local8 * _local4) + (_local12 * _arg3));
_local17 = ((((_local13 << 24) | (_local14 << 16)) | (_local15 << 8)) | _local16);
return (_local17);
}
public static function interpolateTransform(_arg1:ColorTransform, _arg2:ColorTransform, _arg3:Number):ColorTransform{
var _local4:Number;
var _local5:ColorTransform;
_local4 = (1 - _arg3);
_local5 = new ColorTransform(((_arg1.redMultiplier * _local4) + (_arg2.redMultiplier * _arg3)), ((_arg1.greenMultiplier * _local4) + (_arg2.greenMultiplier * _arg3)), ((_arg1.blueMultiplier * _local4) + (_arg2.blueMultiplier * _arg3)), ((_arg1.alphaMultiplier * _local4) + (_arg2.alphaMultiplier * _arg3)), ((_arg1.redOffset * _local4) + (_arg2.redOffset * _arg3)), ((_arg1.greenOffset * _local4) + (_arg2.greenOffset * _arg3)), ((_arg1.blueOffset * _local4) + (_arg2.blueOffset * _arg3)), ((_arg1.alphaOffset * _local4) + (_arg2.alphaOffset * _arg3)));
return (_local5);
}
public static function fromXML(_arg1:XML):Color{
return (Color(new (Color).parseXML(_arg1)));
}
}
}//package fl.motion
Section 37
//archerbangun_95 (MYTHWARGAME_fla.archerbangun_95)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class archerbangun_95 extends MovieClip {
public function archerbangun_95(){
addFrameScript(28, frame29);
}
function frame29(){
this["parent"].gotoAndStop(1);
this["parent"].WakeUp();
}
}
}//package MYTHWARGAME_fla
Section 38
//archermental_94 (MYTHWARGAME_fla.archermental_94)
package MYTHWARGAME_fla {
import flash.display.*;
public dynamic class archermental_94 extends MovieClip {
public function archermental_94(){
addFrameScript(11, frame12);
}
function frame12(){
stop();
}
}
}//package MYTHWARGAME_fla
Section 39
//body_411 (MYTHWARGAME_fla.body_411)
package MYTHWARGAME_fla {
import flash.display.*;
public dynamic class body_411 extends MovieClip {
public function body_411(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package MYTHWARGAME_fla
Section 40
//btsavedata_320 (MYTHWARGAME_fla.btsavedata_320)
package MYTHWARGAME_fla {
import flash.display.*;
import flash.text.*;
public dynamic class btsavedata_320 extends MovieClip {
public var cap:TextField;
}
}//package MYTHWARGAME_fla
Section 41
//DarkAgeDifficulty_390 (MYTHWARGAME_fla.DarkAgeDifficulty_390)
package MYTHWARGAME_fla {
import flash.display.*;
public dynamic class DarkAgeDifficulty_390 extends MovieClip {
public var btDiff0:SimpleButton;
public var btDiff1:SimpleButton;
public var btDiff2:SimpleButton;
}
}//package MYTHWARGAME_fla
Section 42
//darkelfbangun_11 (MYTHWARGAME_fla.darkelfbangun_11)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class darkelfbangun_11 extends MovieClip {
public function darkelfbangun_11(){
addFrameScript(26, frame27);
}
function frame27(){
this["parent"].gotoAndStop(1);
this["parent"].WakeUp();
}
}
}//package MYTHWARGAME_fla
Section 43
//darkelfmental_10 (MYTHWARGAME_fla.darkelfmental_10)
package MYTHWARGAME_fla {
import flash.display.*;
public dynamic class darkelfmental_10 extends MovieClip {
public function darkelfmental_10(){
addFrameScript(11, frame12);
}
function frame12(){
stop();
}
}
}//package MYTHWARGAME_fla
Section 44
//efekledakangeneral_221 (MYTHWARGAME_fla.efekledakangeneral_221)
package MYTHWARGAME_fla {
import flash.display.*;
public dynamic class efekledakangeneral_221 extends MovieClip {
public function efekledakangeneral_221(){
addFrameScript(10, frame11);
}
function frame11(){
stop();
}
}
}//package MYTHWARGAME_fla
Section 45
//grphdoubledmgpoin_427 (MYTHWARGAME_fla.grphdoubledmgpoin_427)
package MYTHWARGAME_fla {
import flash.display.*;
import flash.text.*;
public dynamic class grphdoubledmgpoin_427 extends MovieClip {
public var txCap:TextField;
}
}//package MYTHWARGAME_fla
Section 46
//grphnormaldmgpoin_170 (MYTHWARGAME_fla.grphnormaldmgpoin_170)
package MYTHWARGAME_fla {
import flash.display.*;
import flash.text.*;
public dynamic class grphnormaldmgpoin_170 extends MovieClip {
public var txCap:TextField;
}
}//package MYTHWARGAME_fla
Section 47
//grphpoisondmgpoin_425 (MYTHWARGAME_fla.grphpoisondmgpoin_425)
package MYTHWARGAME_fla {
import flash.display.*;
import flash.text.*;
public dynamic class grphpoisondmgpoin_425 extends MovieClip {
public var txCap:TextField;
}
}//package MYTHWARGAME_fla
Section 48
//handinside_415 (MYTHWARGAME_fla.handinside_415)
package MYTHWARGAME_fla {
import flash.display.*;
public dynamic class handinside_415 extends MovieClip {
public function handinside_415(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package MYTHWARGAME_fla
Section 49
//handsmouse_416 (MYTHWARGAME_fla.handsmouse_416)
package MYTHWARGAME_fla {
import flash.display.*;
public dynamic class handsmouse_416 extends MovieClip {
public function handsmouse_416(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package MYTHWARGAME_fla
Section 50
//handtyping_418 (MYTHWARGAME_fla.handtyping_418)
package MYTHWARGAME_fla {
import flash.display.*;
public dynamic class handtyping_418 extends MovieClip {
public function handtyping_418(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package MYTHWARGAME_fla
Section 51
//head_413 (MYTHWARGAME_fla.head_413)
package MYTHWARGAME_fla {
import flash.display.*;
public dynamic class head_413 extends MovieClip {
public function head_413(){
addFrameScript(174, frame175);
}
function frame175(){
stop();
}
}
}//package MYTHWARGAME_fla
Section 52
//iconattack_210 (MYTHWARGAME_fla.iconattack_210)
package MYTHWARGAME_fla {
import flash.display.*;
public dynamic class iconattack_210 extends MovieClip {
public function iconattack_210(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package MYTHWARGAME_fla
Section 53
//icondefense_211 (MYTHWARGAME_fla.icondefense_211)
package MYTHWARGAME_fla {
import flash.display.*;
public dynamic class icondefense_211 extends MovieClip {
public function icondefense_211(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package MYTHWARGAME_fla
Section 54
//iconultraattack_212 (MYTHWARGAME_fla.iconultraattack_212)
package MYTHWARGAME_fla {
import flash.display.*;
public dynamic class iconultraattack_212 extends MovieClip {
public function iconultraattack_212(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package MYTHWARGAME_fla
Section 55
//iconultradefense_209 (MYTHWARGAME_fla.iconultradefense_209)
package MYTHWARGAME_fla {
import flash.display.*;
public dynamic class iconultradefense_209 extends MovieClip {
public function iconultradefense_209(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package MYTHWARGAME_fla
Section 56
//keyboard_414 (MYTHWARGAME_fla.keyboard_414)
package MYTHWARGAME_fla {
import flash.display.*;
public dynamic class keyboard_414 extends MovieClip {
public function keyboard_414(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package MYTHWARGAME_fla
Section 57
//knightbangun_123 (MYTHWARGAME_fla.knightbangun_123)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class knightbangun_123 extends MovieClip {
public function knightbangun_123(){
addFrameScript(28, frame29);
}
function frame29(){
this["parent"].gotoAndStop(1);
this["parent"].WakeUp();
}
}
}//package MYTHWARGAME_fla
Section 58
//knightmental_122 (MYTHWARGAME_fla.knightmental_122)
package MYTHWARGAME_fla {
import flash.display.*;
public dynamic class knightmental_122 extends MovieClip {
public function knightmental_122(){
addFrameScript(11, frame12);
}
function frame12(){
stop();
}
}
}//package MYTHWARGAME_fla
Section 59
//lightning_420 (MYTHWARGAME_fla.lightning_420)
package MYTHWARGAME_fla {
import flash.display.*;
public dynamic class lightning_420 extends MovieClip {
public function lightning_420(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package MYTHWARGAME_fla
Section 60
//mcarcherattack_92 (MYTHWARGAME_fla.mcarcherattack_92)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class mcarcherattack_92 extends MovieClip {
public function mcarcherattack_92(){
addFrameScript(40, frame41);
}
function frame41(){
this["parent"].CreateMissile(1, 15, 46, 1, false, 3, 0.25);
}
}
}//package MYTHWARGAME_fla
Section 61
//mcarcherdie_93 (MYTHWARGAME_fla.mcarcherdie_93)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class mcarcherdie_93 extends MovieClip {
public function mcarcherdie_93(){
addFrameScript(71, frame72);
}
function frame72(){
stop();
this["parent"].Remove();
}
}
}//package MYTHWARGAME_fla
Section 62
//mcbaloon1die_100 (MYTHWARGAME_fla.mcbaloon1die_100)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class mcbaloon1die_100 extends MovieClip {
public function mcbaloon1die_100(){
addFrameScript(0, frame1, 25, frame26);
}
function frame1(){
this["root"].PlaySound("23", 0.75);
}
function frame26(){
stop();
this["parent"].Remove();
}
}
}//package MYTHWARGAME_fla
Section 63
//mcbaloon1serang_99 (MYTHWARGAME_fla.mcbaloon1serang_99)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class mcbaloon1serang_99 extends MovieClip {
public function mcbaloon1serang_99(){
addFrameScript(32, frame33, 38, frame39);
}
function frame39(){
this["parent"].CreateMissile(1, 15, 35, 0.75, false, 1);
}
function frame33(){
this["parent"].CreateMissile(1, 15, 35, 0.75, false, 1);
}
}
}//package MYTHWARGAME_fla
Section 64
//mcbaloon2die_105 (MYTHWARGAME_fla.mcbaloon2die_105)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class mcbaloon2die_105 extends MovieClip {
public function mcbaloon2die_105(){
addFrameScript(0, frame1, 30, frame31);
}
function frame1(){
this["root"].PlaySound("23", 0.75);
}
function frame31(){
stop();
this["parent"].Remove();
}
}
}//package MYTHWARGAME_fla
Section 65
//mcbaloon2serang_104 (MYTHWARGAME_fla.mcbaloon2serang_104)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class mcbaloon2serang_104 extends MovieClip {
public function mcbaloon2serang_104(){
addFrameScript(32, frame33);
}
function frame33(){
this["parent"].CreateMissile(3, 30, 25, 0.75, true, 2);
}
}
}//package MYTHWARGAME_fla
Section 66
//mcbaloon2walking_102 (MYTHWARGAME_fla.mcbaloon2walking_102)
package MYTHWARGAME_fla {
import flash.display.*;
public dynamic class mcbaloon2walking_102 extends MovieClip {
public function mcbaloon2walking_102(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package MYTHWARGAME_fla
Section 67
//mcbattletarget_400 (MYTHWARGAME_fla.mcbattletarget_400)
package MYTHWARGAME_fla {
import flash.display.*;
public dynamic class mcbattletarget_400 extends MovieClip {
public var icon1:MovieClip;
public var icon2:MovieClip;
}
}//package MYTHWARGAME_fla
Section 68
//mccannonattack_108 (MYTHWARGAME_fla.mccannonattack_108)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class mccannonattack_108 extends MovieClip {
public function mccannonattack_108(){
addFrameScript(65, frame66);
}
function frame66(){
this["parent"].CreateMissile(16, 50, 40, 1, true, 2);
}
}
}//package MYTHWARGAME_fla
Section 69
//mccannondie_109 (MYTHWARGAME_fla.mccannondie_109)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class mccannondie_109 extends MovieClip {
public function mccannondie_109(){
addFrameScript(0, frame1, 35, frame36);
}
function frame1(){
this["root"].PlaySound("23", 0.75);
}
function frame36(){
stop();
this["parent"].Remove();
}
}
}//package MYTHWARGAME_fla
Section 70
//mccatapultattack_112 (MYTHWARGAME_fla.mccatapultattack_112)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class mccatapultattack_112 extends MovieClip {
public function mccatapultattack_112(){
addFrameScript(46, frame47, 52, frame53);
}
function frame47(){
}
function frame53(){
this["parent"].CreateMissile(2, 15, 95, 1, false, 1);
}
}
}//package MYTHWARGAME_fla
Section 71
//mccatapultdie_113 (MYTHWARGAME_fla.mccatapultdie_113)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class mccatapultdie_113 extends MovieClip {
public function mccatapultdie_113(){
addFrameScript(0, frame1, 35, frame36);
}
function frame1(){
this["root"].PlaySound("23", 0.75);
}
function frame36(){
stop();
this["parent"].Remove();
}
}
}//package MYTHWARGAME_fla
Section 72
//mcchardescription_205 (MYTHWARGAME_fla.mcchardescription_205)
package MYTHWARGAME_fla {
import flash.display.*;
import flash.text.*;
public dynamic class mcchardescription_205 extends MovieClip {
public var txLvl:TextField;
public var txOrder:TextField;
public var txArm:TextField;
public var txNm:TextField;
public var txLife:TextField;
public var txDmg:TextField;
public var txType:TextField;
}
}//package MYTHWARGAME_fla
Section 73
//mcdarkelfattack_8 (MYTHWARGAME_fla.mcdarkelfattack_8)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class mcdarkelfattack_8 extends MovieClip {
public function mcdarkelfattack_8(){
addFrameScript(40, frame41);
}
function frame41(){
this["parent"].CreateMissile(1, -17, 43, 1, false, 1);
}
}
}//package MYTHWARGAME_fla
Section 74
//mcdarkelfdie_9 (MYTHWARGAME_fla.mcdarkelfdie_9)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class mcdarkelfdie_9 extends MovieClip {
public function mcdarkelfdie_9(){
addFrameScript(70, frame71);
}
function frame71(){
stop();
this["parent"].Remove();
}
}
}//package MYTHWARGAME_fla
Section 75
//mcdarkevilattack_14 (MYTHWARGAME_fla.mcdarkevilattack_14)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class mcdarkevilattack_14 extends MovieClip {
public function mcdarkevilattack_14(){
addFrameScript(36, frame37, 41, frame42);
}
function frame37(){
this["parent"].AttackEnemy();
}
function frame42(){
}
}
}//package MYTHWARGAME_fla
Section 76
//mcdarkevildie_15 (MYTHWARGAME_fla.mcdarkevildie_15)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class mcdarkevildie_15 extends MovieClip {
public function mcdarkevildie_15(){
addFrameScript(16, frame17);
}
function frame17(){
stop();
this["parent"].Remove();
}
}
}//package MYTHWARGAME_fla
Section 77
//mcdraculaattack_18 (MYTHWARGAME_fla.mcdraculaattack_18)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class mcdraculaattack_18 extends MovieClip {
public function mcdraculaattack_18(){
addFrameScript(23, frame24);
}
function frame24(){
this["parent"].CreateMissile(7, -35, 30);
this["parent"].CreateMissile(15, -35, 30, 1, false, 1);
}
}
}//package MYTHWARGAME_fla
Section 78
//mcdraculadie_19 (MYTHWARGAME_fla.mcdraculadie_19)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class mcdraculadie_19 extends MovieClip {
public function mcdraculadie_19(){
addFrameScript(21, frame22);
}
function frame22(){
stop();
this["parent"].Remove();
}
}
}//package MYTHWARGAME_fla
Section 79
//mcdragonattack_29 (MYTHWARGAME_fla.mcdragonattack_29)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class mcdragonattack_29 extends MovieClip {
public function mcdragonattack_29(){
addFrameScript(41, frame42);
}
function frame42(){
this["parent"].CreateMissile(4, -115, 30, 0.5);
this["parent"].CreateMissile(15, -115, 30, 1, true, 3);
}
}
}//package MYTHWARGAME_fla
Section 80
//mcdragondie_30 (MYTHWARGAME_fla.mcdragondie_30)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class mcdragondie_30 extends MovieClip {
public function mcdragondie_30(){
addFrameScript(0, frame1, 25, frame26);
}
function frame1(){
this["root"].PlaySound("23", 0.75);
}
function frame26(){
stop();
this["parent"].Remove();
}
}
}//package MYTHWARGAME_fla
Section 81
//mceagleattack_33 (MYTHWARGAME_fla.mceagleattack_33)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class mceagleattack_33 extends MovieClip {
public function mceagleattack_33(){
addFrameScript(41, frame42);
}
function frame42(){
this["parent"].CreateMissile(6, 0, -15, 1, false, 1);
}
}
}//package MYTHWARGAME_fla
Section 82
//mceagledie_36 (MYTHWARGAME_fla.mceagledie_36)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class mceagledie_36 extends MovieClip {
public function mceagledie_36(){
addFrameScript(0, frame1, 30, frame31);
}
function frame1(){
this["root"].PlaySound("23", 0.75);
}
function frame31(){
stop();
this["parent"].Remove();
}
}
}//package MYTHWARGAME_fla
Section 83
//mcghostattack_39 (MYTHWARGAME_fla.mcghostattack_39)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class mcghostattack_39 extends MovieClip {
public function mcghostattack_39(){
addFrameScript(40, frame41, 43, frame44, 44, frame45);
}
function frame44(){
}
function frame41(){
this["parent"].CreateMissile(5, -15, 40, 1.5);
this["parent"].CreateMissile(15, -15, 40, 1, false, 1);
}
function frame45(){
this["parent"].CreateMissile(15, -15, 40, 1, false, 1);
}
}
}//package MYTHWARGAME_fla
Section 84
//mcghostdie_40 (MYTHWARGAME_fla.mcghostdie_40)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class mcghostdie_40 extends MovieClip {
public function mcghostdie_40(){
addFrameScript(19, frame20);
}
function frame20(){
stop();
this["parent"].Remove();
}
}
}//package MYTHWARGAME_fla
Section 85
//mcghostshipattack_45 (MYTHWARGAME_fla.mcghostshipattack_45)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class mcghostshipattack_45 extends MovieClip {
public function mcghostshipattack_45(){
addFrameScript(10, frame11, 18, frame19);
}
function frame19(){
this["parent"].CreateMissile(15, -20, 20, 2, false, 1);
}
function frame11(){
this["parent"].CreateMissile(5, -20, 20, 2);
this["parent"].CreateMissile(15, -20, 20, 2, false, 1);
}
}
}//package MYTHWARGAME_fla
Section 86
//mcghostshipdie_46 (MYTHWARGAME_fla.mcghostshipdie_46)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class mcghostshipdie_46 extends MovieClip {
public function mcghostshipdie_46(){
addFrameScript(5, frame6, 35, frame36);
}
function frame6(){
this["root"].PlaySound("24");
}
function frame36(){
stop();
this["parent"].Remove();
}
}
}//package MYTHWARGAME_fla
Section 87
//mcgodshipattack_50 (MYTHWARGAME_fla.mcgodshipattack_50)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class mcgodshipattack_50 extends MovieClip {
public function mcgodshipattack_50(){
addFrameScript(32, frame33, 36, frame37, 40, frame41);
}
function frame37(){
this["parent"].CreateMissile(10, -30, 15, 0.75, true, 4);
}
function frame33(){
this["parent"].CreateMissile(10, -30, 15, 0.75, true, 4);
}
function frame41(){
this["parent"].CreateMissile(10, -30, 15, 0.75, true, 4);
}
}
}//package MYTHWARGAME_fla
Section 88
//mcgodshipdie_51 (MYTHWARGAME_fla.mcgodshipdie_51)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class mcgodshipdie_51 extends MovieClip {
public function mcgodshipdie_51(){
addFrameScript(0, frame1, 10, frame11, 40, frame41);
}
function frame1(){
this["root"].PlaySound("22");
}
function frame11(){
this["root"].PlaySound("24");
}
function frame41(){
stop();
this["parent"].Remove();
}
}
}//package MYTHWARGAME_fla
Section 89
//mcgreekshipattack_116 (MYTHWARGAME_fla.mcgreekshipattack_116)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class mcgreekshipattack_116 extends MovieClip {
public function mcgreekshipattack_116(){
addFrameScript(32, frame33, 38, frame39);
}
function frame39(){
this["parent"].CreateMissile(1, 30, 15, 0.75, false, 1);
}
function frame33(){
this["parent"].CreateMissile(1, 30, 15, 0.75, false, 1);
}
}
}//package MYTHWARGAME_fla
Section 90
//mcgreekshipdie_117 (MYTHWARGAME_fla.mcgreekshipdie_117)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class mcgreekshipdie_117 extends MovieClip {
public function mcgreekshipdie_117(){
addFrameScript(0, frame1, 10, frame11, 40, frame41);
}
function frame1(){
this["root"].PlaySound("22");
}
function frame11(){
this["root"].PlaySound("24");
}
function frame41(){
stop();
this["parent"].Remove();
}
}
}//package MYTHWARGAME_fla
Section 91
//mcknightattack_120 (MYTHWARGAME_fla.mcknightattack_120)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class mcknightattack_120 extends MovieClip {
public function mcknightattack_120(){
addFrameScript(38, frame39, 42, frame43);
}
function frame39(){
this["parent"].AttackEnemy();
}
function frame43(){
}
}
}//package MYTHWARGAME_fla
Section 92
//mcknightdie_121 (MYTHWARGAME_fla.mcknightdie_121)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class mcknightdie_121 extends MovieClip {
public function mcknightdie_121(){
addFrameScript(75, frame76);
}
function frame76(){
stop();
this["parent"].Remove();
}
}
}//package MYTHWARGAME_fla
Section 93
//mcogreattack_54 (MYTHWARGAME_fla.mcogreattack_54)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class mcogreattack_54 extends MovieClip {
public function mcogreattack_54(){
addFrameScript(39, frame40, 43, frame44);
}
function frame40(){
this["parent"].AttackEnemy();
}
function frame44(){
}
}
}//package MYTHWARGAME_fla
Section 94
//mcogredie_55 (MYTHWARGAME_fla.mcogredie_55)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class mcogredie_55 extends MovieClip {
public function mcogredie_55(){
addFrameScript(64, frame65);
}
function frame65(){
stop();
this["parent"].Remove();
}
}
}//package MYTHWARGAME_fla
Section 95
//mcpaladinattack_126 (MYTHWARGAME_fla.mcpaladinattack_126)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class mcpaladinattack_126 extends MovieClip {
public function mcpaladinattack_126(){
addFrameScript(36, frame37, 40, frame41);
}
function frame37(){
this["parent"].AttackEnemy();
}
function frame41(){
}
}
}//package MYTHWARGAME_fla
Section 96
//mcpaladindie_127 (MYTHWARGAME_fla.mcpaladindie_127)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class mcpaladindie_127 extends MovieClip {
public function mcpaladindie_127(){
addFrameScript(67, frame68);
}
function frame68(){
stop();
this["parent"].Remove();
}
}
}//package MYTHWARGAME_fla
Section 97
//mcpersianshipattack_132 (MYTHWARGAME_fla.mcpersianshipattack_132)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class mcpersianshipattack_132 extends MovieClip {
public function mcpersianshipattack_132(){
addFrameScript(32, frame33, 38, frame39);
}
function frame39(){
}
function frame33(){
this["parent"].CreateMissile(2, 35, 18, 0.75, true, 2);
}
}
}//package MYTHWARGAME_fla
Section 98
//mcpersianshipdie_133 (MYTHWARGAME_fla.mcpersianshipdie_133)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class mcpersianshipdie_133 extends MovieClip {
public function mcpersianshipdie_133(){
addFrameScript(0, frame1, 10, frame11, 40, frame41);
}
function frame1(){
this["root"].PlaySound("22");
}
function frame11(){
this["root"].PlaySound("24");
}
function frame41(){
stop();
this["parent"].Remove();
}
}
}//package MYTHWARGAME_fla
Section 99
//mcplane1attack_137 (MYTHWARGAME_fla.mcplane1attack_137)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class mcplane1attack_137 extends MovieClip {
public function mcplane1attack_137(){
addFrameScript(32, frame33, 37, frame38);
}
function frame38(){
this["parent"].CreateMissile(1, 40, 20, 0.75, false, 1);
}
function frame33(){
this["parent"].CreateMissile(1, 40, 20, 0.75, false, 1);
}
}
}//package MYTHWARGAME_fla
Section 100
//mcplane1die_138 (MYTHWARGAME_fla.mcplane1die_138)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class mcplane1die_138 extends MovieClip {
public function mcplane1die_138(){
addFrameScript(0, frame1, 25, frame26);
}
function frame1(){
this["root"].PlaySound("23", 0.75);
}
function frame26(){
stop();
this["parent"].Remove();
}
}
}//package MYTHWARGAME_fla
Section 101
//mcplane1walking_135 (MYTHWARGAME_fla.mcplane1walking_135)
package MYTHWARGAME_fla {
import flash.display.*;
public dynamic class mcplane1walking_135 extends MovieClip {
public function mcplane1walking_135(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package MYTHWARGAME_fla
Section 102
//mcplane2attack_142 (MYTHWARGAME_fla.mcplane2attack_142)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class mcplane2attack_142 extends MovieClip {
public function mcplane2attack_142(){
addFrameScript(32, frame33);
}
function frame33(){
this["parent"].CreateMissile(16, 50, 30, 0.75, true, 2);
}
}
}//package MYTHWARGAME_fla
Section 103
//mcplane2die_143 (MYTHWARGAME_fla.mcplane2die_143)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class mcplane2die_143 extends MovieClip {
public function mcplane2die_143(){
addFrameScript(0, frame1, 25, frame26);
}
function frame1(){
this["root"].PlaySound("23", 0.75);
}
function frame26(){
stop();
this["parent"].Remove();
}
}
}//package MYTHWARGAME_fla
Section 104
//mcplane2walking_140 (MYTHWARGAME_fla.mcplane2walking_140)
package MYTHWARGAME_fla {
import flash.display.*;
public dynamic class mcplane2walking_140 extends MovieClip {
public function mcplane2walking_140(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package MYTHWARGAME_fla
Section 105
//mcromanshipattack_146 (MYTHWARGAME_fla.mcromanshipattack_146)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class mcromanshipattack_146 extends MovieClip {
public function mcromanshipattack_146(){
addFrameScript(32, frame33);
}
function frame33(){
this["parent"].CreateMissile(2, 30, 16, 0.75, true, 2);
}
}
}//package MYTHWARGAME_fla
Section 106
//mcromanshipdie_147 (MYTHWARGAME_fla.mcromanshipdie_147)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class mcromanshipdie_147 extends MovieClip {
public function mcromanshipdie_147(){
addFrameScript(0, frame1, 10, frame11, 40, frame41);
}
function frame1(){
this["root"].PlaySound("22");
}
function frame11(){
this["root"].PlaySound("24");
}
function frame41(){
stop();
this["parent"].Remove();
}
}
}//package MYTHWARGAME_fla
Section 107
//mcsharkattack_58 (MYTHWARGAME_fla.mcsharkattack_58)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class mcsharkattack_58 extends MovieClip {
public function mcsharkattack_58(){
addFrameScript(26, frame27, 29, frame30, 37, frame38);
}
function frame27(){
}
function frame30(){
this["parent"].AttackEnemy();
}
function frame38(){
this["parent"].AttackEnemy();
}
}
}//package MYTHWARGAME_fla
Section 108
//mcsharkdie_60 (MYTHWARGAME_fla.mcsharkdie_60)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class mcsharkdie_60 extends MovieClip {
public function mcsharkdie_60(){
addFrameScript(6, frame7, 41, frame42);
}
function frame7(){
this["root"].PlaySound("24", 0.5);
}
function frame42(){
stop();
this["parent"].Remove();
}
}
}//package MYTHWARGAME_fla
Section 109
//mcskeletonattack_64 (MYTHWARGAME_fla.mcskeletonattack_64)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class mcskeletonattack_64 extends MovieClip {
public function mcskeletonattack_64(){
addFrameScript(42, frame43);
}
function frame43(){
this["parent"].CreateMissile(9, -10, 40, 1, false, 1);
}
}
}//package MYTHWARGAME_fla
Section 110
//mcskeletondie_65 (MYTHWARGAME_fla.mcskeletondie_65)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class mcskeletondie_65 extends MovieClip {
public function mcskeletondie_65(){
addFrameScript(59, frame60);
}
function frame60(){
stop();
this["parent"].Remove();
}
}
}//package MYTHWARGAME_fla
Section 111
//mcspearmanattack_150 (MYTHWARGAME_fla.mcspearmanattack_150)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class mcspearmanattack_150 extends MovieClip {
public function mcspearmanattack_150(){
addFrameScript(37, frame38, 41, frame42);
}
function frame38(){
this["parent"].AttackEnemy();
}
function frame42(){
}
}
}//package MYTHWARGAME_fla
Section 112
//mcspearmandie_151 (MYTHWARGAME_fla.mcspearmandie_151)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class mcspearmandie_151 extends MovieClip {
public function mcspearmandie_151(){
addFrameScript(73, frame74);
}
function frame74(){
stop();
this["parent"].Remove();
}
}
}//package MYTHWARGAME_fla
Section 113
//mcswordsmanattack_156 (MYTHWARGAME_fla.mcswordsmanattack_156)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class mcswordsmanattack_156 extends MovieClip {
public function mcswordsmanattack_156(){
addFrameScript(39, frame40, 43, frame44);
}
function frame40(){
this["parent"].AttackEnemy();
}
function frame44(){
}
}
}//package MYTHWARGAME_fla
Section 114
//mcswordsmandie_157 (MYTHWARGAME_fla.mcswordsmandie_157)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class mcswordsmandie_157 extends MovieClip {
public function mcswordsmandie_157(){
addFrameScript(70, frame71);
}
function frame71(){
stop();
this["parent"].Remove();
}
}
}//package MYTHWARGAME_fla
Section 115
//mcvampireattack_70 (MYTHWARGAME_fla.mcvampireattack_70)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class mcvampireattack_70 extends MovieClip {
public function mcvampireattack_70(){
addFrameScript(37, frame38, 41, frame42);
}
function frame38(){
this["parent"].AttackEnemy();
}
function frame42(){
}
}
}//package MYTHWARGAME_fla
Section 116
//mcvampiredie_71 (MYTHWARGAME_fla.mcvampiredie_71)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class mcvampiredie_71 extends MovieClip {
public function mcvampiredie_71(){
addFrameScript(59, frame60);
}
function frame60(){
stop();
this["parent"].Remove();
}
}
}//package MYTHWARGAME_fla
Section 117
//mcwhaleattack_76 (MYTHWARGAME_fla.mcwhaleattack_76)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class mcwhaleattack_76 extends MovieClip {
public function mcwhaleattack_76(){
addFrameScript(32, frame33, 55, frame56);
}
function frame33(){
}
function frame56(){
this["parent"].AttackEnemy();
}
}
}//package MYTHWARGAME_fla
Section 118
//mcwhaledie_77 (MYTHWARGAME_fla.mcwhaledie_77)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class mcwhaledie_77 extends MovieClip {
public function mcwhaledie_77(){
addFrameScript(10, frame11, 40, frame41);
}
function frame11(){
this["root"].PlaySound("24", 0.75);
}
function frame41(){
stop();
this["parent"].Remove();
}
}
}//package MYTHWARGAME_fla
Section 119
//mcvikingshipattack_162 (MYTHWARGAME_fla.mcvikingshipattack_162)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class mcvikingshipattack_162 extends MovieClip {
public function mcvikingshipattack_162(){
addFrameScript(32, frame33, 38, frame39);
}
function frame39(){
this["parent"].CreateMissile(1, 0, 15, 1, false, 1);
}
function frame33(){
this["parent"].CreateMissile(1, 0, 15, 1, false, 1);
}
}
}//package MYTHWARGAME_fla
Section 120
//mcvikingshipdie_163 (MYTHWARGAME_fla.mcvikingshipdie_163)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class mcvikingshipdie_163 extends MovieClip {
public function mcvikingshipdie_163(){
addFrameScript(0, frame1, 10, frame11, 40, frame41);
}
function frame1(){
this["root"].PlaySound("22");
}
function frame11(){
this["root"].PlaySound("24");
}
function frame41(){
stop();
this["parent"].Remove();
}
}
}//package MYTHWARGAME_fla
Section 121
//mcwitchattack_80 (MYTHWARGAME_fla.mcwitchattack_80)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class mcwitchattack_80 extends MovieClip {
public function mcwitchattack_80(){
addFrameScript(47, frame48);
}
function frame48(){
this["parent"].CreateMissile(14, -25, 20, 1, false, 2);
}
}
}//package MYTHWARGAME_fla
Section 122
//mcwizarddie_81 (MYTHWARGAME_fla.mcwizarddie_81)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class mcwizarddie_81 extends MovieClip {
public function mcwizarddie_81(){
addFrameScript(52, frame53);
}
function frame53(){
stop();
this["parent"].Remove();
}
}
}//package MYTHWARGAME_fla
Section 123
//mczombieattack_86 (MYTHWARGAME_fla.mczombieattack_86)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class mczombieattack_86 extends MovieClip {
public function mczombieattack_86(){
addFrameScript(48, frame49, 52, frame53);
}
function frame49(){
this["parent"].AttackEnemy();
}
function frame53(){
}
}
}//package MYTHWARGAME_fla
Section 124
//mczombiedie_87 (MYTHWARGAME_fla.mczombiedie_87)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class mczombiedie_87 extends MovieClip {
public function mczombiedie_87(){
addFrameScript(68, frame69);
}
function frame69(){
stop();
this["parent"].Remove();
}
}
}//package MYTHWARGAME_fla
Section 125
//MedievalAgeDifficulty_393 (MYTHWARGAME_fla.MedievalAgeDifficulty_393)
package MYTHWARGAME_fla {
import flash.display.*;
public dynamic class MedievalAgeDifficulty_393 extends MovieClip {
public var btDiff0:SimpleButton;
public var btDiff2:SimpleButton;
public var btDiff3:SimpleButton;
}
}//package MYTHWARGAME_fla
Section 126
//orangutanplay_410 (MYTHWARGAME_fla.orangutanplay_410)
package MYTHWARGAME_fla {
import flash.display.*;
public dynamic class orangutanplay_410 extends MovieClip {
public function orangutanplay_410(){
addFrameScript(174, frame175);
}
function frame175(){
stop();
}
}
}//package MYTHWARGAME_fla
Section 127
//paladinbangun_129 (MYTHWARGAME_fla.paladinbangun_129)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class paladinbangun_129 extends MovieClip {
public function paladinbangun_129(){
addFrameScript(28, frame29);
}
function frame29(){
this["parent"].gotoAndStop(1);
this["parent"].WakeUp();
}
}
}//package MYTHWARGAME_fla
Section 128
//paladinmental_128 (MYTHWARGAME_fla.paladinmental_128)
package MYTHWARGAME_fla {
import flash.display.*;
public dynamic class paladinmental_128 extends MovieClip {
public function paladinmental_128(){
addFrameScript(11, frame12);
}
function frame12(){
stop();
}
}
}//package MYTHWARGAME_fla
Section 129
//playgamesalltimes_421 (MYTHWARGAME_fla.playgamesalltimes_421)
package MYTHWARGAME_fla {
import flash.display.*;
public dynamic class playgamesalltimes_421 extends MovieClip {
public function playgamesalltimes_421(){
addFrameScript(174, frame175);
}
function frame175(){
stop();
}
}
}//package MYTHWARGAME_fla
Section 130
//skullbangun_67 (MYTHWARGAME_fla.skullbangun_67)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class skullbangun_67 extends MovieClip {
public function skullbangun_67(){
addFrameScript(26, frame27);
}
function frame27(){
this["parent"].gotoAndStop(1);
this["parent"].WakeUp();
}
}
}//package MYTHWARGAME_fla
Section 131
//skullmental_66 (MYTHWARGAME_fla.skullmental_66)
package MYTHWARGAME_fla {
import flash.display.*;
public dynamic class skullmental_66 extends MovieClip {
public function skullmental_66(){
addFrameScript(11, frame12);
}
function frame12(){
stop();
}
}
}//package MYTHWARGAME_fla
Section 132
//spearmanbangun_153 (MYTHWARGAME_fla.spearmanbangun_153)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class spearmanbangun_153 extends MovieClip {
public function spearmanbangun_153(){
addFrameScript(28, frame29);
}
function frame29(){
this["parent"].gotoAndStop(1);
this["parent"].WakeUp();
}
}
}//package MYTHWARGAME_fla
Section 133
//spearmanmental_152 (MYTHWARGAME_fla.spearmanmental_152)
package MYTHWARGAME_fla {
import flash.display.*;
public dynamic class spearmanmental_152 extends MovieClip {
public function spearmanmental_152(){
addFrameScript(11, frame12);
}
function frame12(){
stop();
}
}
}//package MYTHWARGAME_fla
Section 134
//swordsmanbangun_159 (MYTHWARGAME_fla.swordsmanbangun_159)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class swordsmanbangun_159 extends MovieClip {
public function swordsmanbangun_159(){
addFrameScript(29, frame30);
}
function frame30(){
this["parent"].gotoAndStop(1);
this["parent"].WakeUp();
}
}
}//package MYTHWARGAME_fla
Section 135
//swordsmanmental_158 (MYTHWARGAME_fla.swordsmanmental_158)
package MYTHWARGAME_fla {
import flash.display.*;
public dynamic class swordsmanmental_158 extends MovieClip {
public function swordsmanmental_158(){
addFrameScript(11, frame12);
}
function frame12(){
stop();
}
}
}//package MYTHWARGAME_fla
Section 136
//trialanimationlogofont_408 (MYTHWARGAME_fla.trialanimationlogofont_408)
package MYTHWARGAME_fla {
import flash.display.*;
public dynamic class trialanimationlogofont_408 extends MovieClip {
public function trialanimationlogofont_408(){
addFrameScript(184, frame185);
}
function frame185(){
stop();
}
}
}//package MYTHWARGAME_fla
Section 137
//vampirbangun_73 (MYTHWARGAME_fla.vampirbangun_73)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class vampirbangun_73 extends MovieClip {
public function vampirbangun_73(){
addFrameScript(23, frame24);
}
function frame24(){
this["parent"].gotoAndStop(1);
this["parent"].WakeUp();
}
}
}//package MYTHWARGAME_fla
Section 138
//vampirmental_72 (MYTHWARGAME_fla.vampirmental_72)
package MYTHWARGAME_fla {
import flash.display.*;
public dynamic class vampirmental_72 extends MovieClip {
public function vampirmental_72(){
addFrameScript(11, frame12);
}
function frame12(){
stop();
}
}
}//package MYTHWARGAME_fla
Section 139
//witchbangun_83 (MYTHWARGAME_fla.witchbangun_83)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class witchbangun_83 extends MovieClip {
public function witchbangun_83(){
addFrameScript(21, frame22);
}
function frame22(){
this["parent"].gotoAndStop(1);
this["parent"].WakeUp();
}
}
}//package MYTHWARGAME_fla
Section 140
//witchmental_82 (MYTHWARGAME_fla.witchmental_82)
package MYTHWARGAME_fla {
import flash.display.*;
public dynamic class witchmental_82 extends MovieClip {
public function witchmental_82(){
addFrameScript(11, frame12);
}
function frame12(){
stop();
}
}
}//package MYTHWARGAME_fla
Section 141
//zombiebangun_89 (MYTHWARGAME_fla.zombiebangun_89)
package MYTHWARGAME_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class zombiebangun_89 extends MovieClip {
public function zombiebangun_89(){
addFrameScript(26, frame27);
}
function frame27(){
this["parent"].gotoAndStop(1);
this["parent"].WakeUp();
}
}
}//package MYTHWARGAME_fla
Section 142
//zombiementa_88 (MYTHWARGAME_fla.zombiementa_88)
package MYTHWARGAME_fla {
import flash.display.*;
public dynamic class zombiementa_88 extends MovieClip {
public function zombiementa_88(){
addFrameScript(11, frame12);
}
function frame12(){
stop();
}
}
}//package MYTHWARGAME_fla
Section 143
//CActIcon (uiscr.CActIcon)
package uiscr {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.text.*;
public class CActIcon extends MovieClip {
private var nChar:uint;
private var hp:Number;
private var hpLeft:Number;
public var mcBar:MovieClip;
public var txNChar:TextField;
public function CActIcon(){
mouseEnabled = false;
nChar = 0;
hpLeft = 0;
}
public function Del():void{
var _local1:Number;
_local1 = Number(((hpLeft / nChar) / hp));
if (_local1 < 0){
_local1 = 0;
} else {
if (_local1 > 1){
_local1 = 1;
};
};
nChar--;
this["txNChar"].text = nChar;
this["mcBar"].scaleX = _local1;
}
public function Init(_arg1:Number, _arg2:String):void{
nChar++;
this["txNChar"].text = nChar;
hp = _arg1;
hpLeft = _arg1;
this["mcBar"].scaleX = 1;
gotoAndStop(_arg2);
}
public function GetNChar():uint{
return (nChar);
}
public function Add():void{
var _local1:Number;
_local1 = Number(((hpLeft / nChar) / hp));
if (_local1 < 0){
_local1 = 0;
} else {
if (_local1 > 1){
_local1 = 1;
};
};
nChar++;
this["txNChar"].text = nChar;
hpLeft = (hpLeft + hp);
this["mcBar"].scaleX = _local1;
}
public function Update(_arg1:Number):void{
var _local2:Number;
_local2 = Number(((hpLeft / nChar) / hp));
if (_local2 < 0){
_local2 = 0;
} else {
if (_local2 > 1){
_local2 = 1;
};
};
hpLeft = (hpLeft - _arg1);
this["mcBar"].scaleX = _local2;
}
}
}//package uiscr
Section 144
//CCredits (uiscr.CCredits)
package uiscr {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.text.*;
public class CCredits extends MovieClip {
public var btClose:SimpleButton;
public function CCredits(){
this["btClose"].addEventListener(MouseEvent.CLICK, Close, false, 0, true);
}
private function Close(_arg1:MouseEvent):void{
this["root"].PlaySound("88");
this["root"].ShowScreen("MainMenu");
}
public function Init():void{
}
}
}//package uiscr
Section 145
//CExitConfirm (uiscr.CExitConfirm)
package uiscr {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.text.*;
public class CExitConfirm extends MovieClip {
public var btYes:SimpleButton;
public var btCancel:SimpleButton;
public var btNo:SimpleButton;
public function Init():void{
btYes.addEventListener(MouseEvent.CLICK, Yes, false, 0, true);
btNo.addEventListener(MouseEvent.CLICK, No, false, 0, true);
btCancel.addEventListener(MouseEvent.CLICK, Cancel, false, 0, true);
visible = false;
}
private function Cancel(_arg1:MouseEvent):void{
this["root"].PlaySound("88");
visible = false;
}
private function Yes(_arg1:MouseEvent):void{
this["root"].PlaySound("88");
visible = false;
parent["isExit"] = true;
parent["mcSave"].cap.text = "Save Game";
parent["mcSave"].visible = true;
}
private function No(_arg1:MouseEvent):void{
this["root"].PlaySound("88");
this["root"].ResetData();
this["root"].ShowScreen("MainMenu");
}
}
}//package uiscr
Section 146
//CHelp (uiscr.CHelp)
package uiscr {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.text.*;
public class CHelp extends MovieClip {
public var btBack:SimpleButton;
public var btNext:SimpleButton;
public var btClose:SimpleButton;
public function CHelp(){
this["btClose"].addEventListener(MouseEvent.CLICK, Close, false, 0, true);
}
private function Close(_arg1:MouseEvent):void{
this["root"].PlaySound("88");
this["root"].ShowScreen("MainMenu");
}
public function Init():void{
}
}
}//package uiscr
Section 147
//CInstruction (uiscr.CInstruction)
package uiscr {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.text.*;
public class CInstruction extends MovieClip {
public var btContinue:SimpleButton;
public function Init():void{
this["btContinue"].addEventListener(MouseEvent.CLICK, Continue, false, 0, true);
}
private function Continue(_arg1:MouseEvent):void{
this["root"].PlaySound("88");
this["root"].ShowScreen("PLAY");
}
}
}//package uiscr
Section 148
//CMainMenu (uiscr.CMainMenu)
package uiscr {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.text.*;
public class CMainMenu extends MovieClip {
public var mcSave:mcsavedata;
public var btMenu0:SimpleButton;
public var btMenu4:SimpleButton;
public var btMenu5:SimpleButton;
public var btMenu8:SimpleButton;
public var btMenu2:SimpleButton;
public var btMenu3:SimpleButton;
public var btMenu7:MoreGamesBtn;
public var btMenu1:SimpleButton;
public var btMenu6:SimpleButton;
public var logo1:logo_bg;
public function CMainMenu(){
var _local1:int;
super();
_local1 = 0;
while (_local1 < 9) {
this[("btMenu" + _local1)].addEventListener(MouseEvent.CLICK, Select, false, 0, true);
_local1++;
};
this["logo1"].Init("http://www.belugerinstudios.com/");
this["mcSave"].visible = false;
}
private function Select(_arg1:MouseEvent):void{
var _local2:int;
var _local3:URLRequest;
_local2 = int(_arg1.currentTarget.name.charAt(6));
this["root"].PlaySound("88");
if (_local2 == 0){
trace("new game");
this["root"].ShowScreen("SelectRace");
} else {
if (_local2 == 1){
this["mcSave"].Init("load");
this["mcSave"].cap.text = "Load Game";
this["mcSave"].visible = true;
} else {
if (_local2 == 2){
trace("options");
this["root"].ShowScreen("Option");
} else {
if (_local2 == 3){
this["root"].ShowScreen("Help");
} else {
if (_local2 == 4){
this["root"].ShowScreen("Credits");
} else {
if (_local2 == 5){
root["curScr"] = "MainMenu";
this["root"].ShowScreen("Medal");
} else {
if (_local2 == 6){
root["curScr"] = "MainMenu";
this["root"].ShowScreen("Statistic");
} else {
if (_local2 == 7){
_local3 = new URLRequest("http://www.belugerinstudios.com/");
navigateToURL(_local3, "_blank");
} else {
if (_local2 == 8){
_local3 = new URLRequest("http://www.belugerinstudios.com/index.php?act=playgame&val=FL10082219");
navigateToURL(_local3, "_blank");
};
};
};
};
};
};
};
};
};
}
public function EnableContinue(_arg1:Boolean):void{
this["btMenu1"].mouseEnabled = _arg1;
if (!_arg1){
this["btMenu1"].alpha = 0.7;
} else {
if (!_arg1){
this["btMenu1"].alpha = 1;
};
};
}
}
}//package uiscr
Section 149
//CMap (uiscr.CMap)
package uiscr {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.text.*;
public class CMap extends MovieClip {
private var tooltip:Tooltip2;
private var map:Object;
public var frame:MovieClip;
private var warType:int;
private var classRef:Class;
private var mapContainer:MovieClip;
private var info:Array;
public var btWalktrough:SimpleButton;
public var logo1:logo_bg;
public function CMap(){
mapContainer = new MovieClip();
addChildAt(mapContainer, 0);
this["logo1"].Init("http://www.belugerinstudios.com/");
}
private function UpdateTooltipPos(_arg1:Event):void{
tooltip.x = (mouseX - (tooltip.width / 2));
tooltip.y = (mouseY + 20);
}
private function RollOver(_arg1:MouseEvent):void{
ShowTooltip(info);
}
private function ShowTooltip(_arg1:Array):void{
var _local2:int;
var _local3:int;
var _local4:int;
_local2 = _arg1.length;
_local3 = 0;
HideTooltip();
tooltip = new Tooltip2();
addChild(tooltip);
tooltip.x = (mouseX - (tooltip.width / 2));
tooltip.y = (mouseY + 20);
_local4 = 0;
while (_local4 < _local2) {
tooltip.cap.appendText(_arg1[_local4]);
if (_local3 < _arg1[_local4].length){
_local3 = _arg1[_local4].length;
};
_local4++;
};
tooltip.cap.width = int((_local3 * 6));
if (_local2 > 1){
tooltip.cap.height = (tooltip.cap.height * int((_local2 - 1)));
};
tooltip.addEventListener(Event.ENTER_FRAME, UpdateTooltipPos, false, 0, true);
}
public function Init(_arg1:int):void{
var _local2:int;
var _local3:String;
var _local4:String;
var _local5:int;
var _local6:int;
classRef = (getDefinitionByName(("Map" + _arg1)) as Class);
map = new classRef();
mapContainer.addChild(DisplayObject(map));
this["frame"].mouseEnabled = false;
_local2 = root["gameLevel"];
_local5 = 1;
while (_local5 <= 30) {
if (_local5 < 10){
_local3 = ("0" + String(_local5));
} else {
_local3 = String(_local5);
};
_local6 = 0;
while (_local6 < 4) {
_local4 = (("war" + _local6) + _local3);
if (this["map"][_local4] != null){
if (_local5 < _local2){
this["map"][_local4].gotoAndStop(2);
} else {
this["map"][_local4].gotoAndStop(1);
};
};
_local6++;
};
_local5++;
};
if (_local2 < 10){
_local3 = ("0" + String(_local2));
} else {
_local3 = String(_local2);
};
_local5 = 0;
while (_local5 < 4) {
_local4 = (("war" + _local5) + _local3);
if (this["map"][_local4] != null){
warType = _local5;
if (warType == 1){
this["map"]["battleTarget"]["icon1"].gotoAndStop(3);
this["map"]["battleTarget"]["icon2"].gotoAndStop(2);
info = new Array();
info.push((("LEVEL " + root["gameLevel"]) + ", Sea Battle"));
info.push("\n");
info.push("Available units : Sea and Air Units");
} else {
if (warType == 2){
this["map"]["battleTarget"]["icon1"].gotoAndStop(2);
this["map"]["battleTarget"]["icon2"].gotoAndStop(1);
info = new Array();
info.push((("LEVEL " + root["gameLevel"]) + ", Air Battle"));
info.push("\n");
info.push("Available units : Air and Ground Units");
} else {
this["map"]["battleTarget"]["icon1"].gotoAndStop(1);
this["map"]["battleTarget"]["icon2"].gotoAndStop(4);
info = new Array();
info.push((("LEVEL " + root["gameLevel"]) + ", Ground Battle"));
info.push("\n");
info.push("Available units : Ground Units");
};
};
this["map"]["battleTarget"].x = this["map"][_local4].x;
this["map"]["battleTarget"].y = this["map"][_local4].y;
this["map"]["battleTarget"].buttonMode = true;
this["map"]["battleTarget"].addEventListener(MouseEvent.CLICK, Continue, false, 0, true);
this["map"]["battleTarget"].addEventListener(MouseEvent.ROLL_OVER, RollOver, false, 0, true);
this["map"]["battleTarget"].addEventListener(MouseEvent.ROLL_OUT, RollOut, false, 0, true);
break;
};
_local5++;
};
this["btWalktrough"].addEventListener(MouseEvent.CLICK, Walktrough, false, 0, true);
}
private function HideTooltip():void{
if (tooltip != null){
removeChild(tooltip);
tooltip.removeEventListener(Event.ENTER_FRAME, UpdateTooltipPos);
tooltip = null;
};
}
private function RollOut(_arg1:MouseEvent):void{
HideTooltip();
}
private function Continue(_arg1:MouseEvent):void{
this["root"].PlaySound("88");
if (root["baseType"] == 1){
root["bgType"] = warType;
this["root"].ShowScreen("MediUpgrade");
} else {
root["bgType"] = (warType + 4);
this["root"].ShowScreen("DarkUpgrade");
};
}
private function Walktrough(_arg1:MouseEvent):void{
var _local2:URLRequest;
this["root"].PlaySound("88");
_local2 = new URLRequest("http://www.belugerinstudios.com/index.php?act=playgame&val=FL10082219");
navigateToURL(_local2, "_blank");
}
}
}//package uiscr
Section 150
//CMedal (uiscr.CMedal)
package uiscr {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.text.*;
public class CMedal extends MovieClip {
private var tooltip:Tooltip2;
public var medal1:MovieClip;
public var medal2:MovieClip;
public var medal3:MovieClip;
public var medal5:MovieClip;
public var medal9:MovieClip;
public var medal4:MovieClip;
public var medal6:MovieClip;
public var medal8:MovieClip;
public var medal0:MovieClip;
public var medal11:MovieClip;
public var medal10:MovieClip;
public var medal12:MovieClip;
private var map:Object;
public var medal7:MovieClip;
private var classRef:Class;
private var mapContainer:MovieClip;
private var decr:Array;
public var btClose:SimpleButton;
public function CMedal(){
decr = ["Kill 50 unit in one battle", "Kill 75 unit in one battle", "Kill 100 unit in one battle", "Kill 125 unit in one battle", "Kill 150 unit in one battle", "Unlock All Land Characters", "Unlock All Air Characters", "Unlock All Sea Characters", "Active All Skill Attack", "Win Easy Mode with Dark Age", "Win Normal Mode with Dark Age", "Win Normal Mode with Middle Age", "Win Hard Mode with Middle Age"];
super();
}
private function Close(_arg1:MouseEvent):void{
this["root"].PlaySound("88");
this["root"].ShowScreen(root["curScr"]);
}
private function RollOver(_arg1:MouseEvent):void{
var _local2:String;
var _local3:int;
var _local4:Array;
_local2 = String(_arg1.currentTarget.name);
_local3 = int(_local2.substr(5));
_local4 = new Array();
_local4.push(decr[_local3]);
ShowTooltip(_local4);
}
private function ShowTooltip(_arg1:Array):void{
var _local2:int;
var _local3:int;
var _local4:int;
_local2 = _arg1.length;
_local3 = 0;
HideTooltip();
tooltip = new Tooltip2();
addChild(tooltip);
tooltip.x = (mouseX - 25);
tooltip.y = (mouseY + 20);
_local4 = 0;
while (_local4 < _local2) {
tooltip.cap.appendText(_arg1[_local4]);
if (_local3 < _arg1[_local4].length){
_local3 = _arg1[_local4].length;
};
_local4++;
};
tooltip.cap.width = int((_local3 * 6));
if (_local2 > 1){
tooltip.cap.height = (tooltip.cap.height * int((_local2 - 1)));
};
tooltip.addEventListener(Event.ENTER_FRAME, UpdateTooltipPos, false, 0, true);
}
public function Init(_arg1:Array):void{
var _local2:int;
_local2 = 0;
while (_local2 <= 12) {
if (_arg1[_local2] == 1){
this[("medal" + _local2)].gotoAndStop(2);
} else {
this[("medal" + _local2)].gotoAndStop(1);
};
this[("medal" + _local2)].addEventListener(MouseEvent.ROLL_OVER, RollOver, false, 0, true);
this[("medal" + _local2)].addEventListener(MouseEvent.ROLL_OUT, RollOut, false, 0, true);
_local2++;
};
this["btClose"].addEventListener(MouseEvent.CLICK, Close, false, 0, true);
}
private function HideTooltip():void{
if (tooltip != null){
removeChild(tooltip);
tooltip.removeEventListener(Event.ENTER_FRAME, UpdateTooltipPos);
tooltip = null;
};
}
private function RollOut(_arg1:MouseEvent):void{
HideTooltip();
}
private function UpdateTooltipPos(_arg1:Event):void{
tooltip.x = (mouseX - 25);
tooltip.y = (mouseY + 20);
}
}
}//package uiscr
Section 151
//COption (uiscr.COption)
package uiscr {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.text.*;
public class COption extends MovieClip {
public var txMusic:TextField;
public var btMusic:MovieClip;
public var txSound:TextField;
public var btQual1:MovieClip;
public var btQual2:MovieClip;
public var btQual3:MovieClip;
public var btClose:SimpleButton;
public var btSound:MovieClip;
private function Close(_arg1:MouseEvent):void{
this["root"].PlaySound("88");
this["root"].ShowScreen("MainMenu");
}
public function Init():void{
if (root["mscOn"]){
root["mscOn"] = true;
this["btMusic"].gotoAndStop(1);
this["txMusic"].text = "on";
} else {
root["mscOn"] = false;
this["btMusic"].gotoAndStop(2);
this["txMusic"].text = "off";
};
if (root["sndOn"]){
root["sndOn"] = true;
this["btSound"].gotoAndStop(1);
this["txSound"].text = "on";
} else {
root["sndOn"] = false;
this["btSound"].gotoAndStop(2);
this["txSound"].text = "off";
};
if (root["quality"] == 1){
this["btQual1"].gotoAndStop(1);
this["btQual2"].gotoAndStop(2);
this["btQual3"].gotoAndStop(2);
} else {
if (root["quality"] == 2){
this["btQual1"].gotoAndStop(2);
this["btQual2"].gotoAndStop(1);
this["btQual3"].gotoAndStop(2);
} else {
if (root["quality"] == 3){
this["btQual1"].gotoAndStop(2);
this["btQual2"].gotoAndStop(2);
this["btQual3"].gotoAndStop(1);
};
};
};
this["btMusic"].buttonMode = true;
this["btSound"].buttonMode = true;
this["btQual1"].buttonMode = true;
this["btQual2"].buttonMode = true;
this["btQual3"].buttonMode = true;
this["btMusic"].addEventListener(MouseEvent.CLICK, SetSound, false, 0, true);
this["btSound"].addEventListener(MouseEvent.CLICK, SetSound, false, 0, true);
this["btQual1"].addEventListener(MouseEvent.CLICK, SetQual, false, 0, true);
this["btQual2"].addEventListener(MouseEvent.CLICK, SetQual, false, 0, true);
this["btQual3"].addEventListener(MouseEvent.CLICK, SetQual, false, 0, true);
this["btClose"].addEventListener(MouseEvent.CLICK, Close, false, 0, true);
}
private function SetQual(_arg1:MouseEvent):void{
this["root"].PlaySound("99");
if (_arg1.currentTarget == btQual1){
this["root"].SetQuality(1);
this["btQual1"].gotoAndStop(1);
this["btQual2"].gotoAndStop(2);
this["btQual3"].gotoAndStop(2);
} else {
if (_arg1.currentTarget == btQual2){
this["root"].SetQuality(2);
this["btQual1"].gotoAndStop(2);
this["btQual2"].gotoAndStop(1);
this["btQual3"].gotoAndStop(2);
} else {
if (_arg1.currentTarget == btQual3){
this["root"].SetQuality(3);
this["btQual1"].gotoAndStop(2);
this["btQual2"].gotoAndStop(2);
this["btQual3"].gotoAndStop(1);
};
};
};
}
private function SetSound(_arg1:MouseEvent):void{
this["root"].PlaySound("99");
if (_arg1.currentTarget == btMusic){
if (root["mscOn"]){
this["root"].TurnOffMusic();
this["btMusic"].gotoAndStop(2);
this["txMusic"].text = "off";
} else {
this["root"].TurnOnMusic();
this["btMusic"].gotoAndStop(1);
this["txMusic"].text = "on";
};
} else {
if (_arg1.currentTarget == btSound){
if (root["sndOn"]){
root["sndOn"] = false;
this["btSound"].gotoAndStop(2);
this["txSound"].text = "off";
} else {
root["sndOn"] = true;
this["btSound"].gotoAndStop(1);
this["txSound"].text = "on";
};
};
};
}
}
}//package uiscr
Section 152
//CPanelActChar (uiscr.CPanelActChar)
package uiscr {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.text.*;
public class CPanelActChar extends MovieClip {
private var id:uint;
private var warType:int;
private var tempObj:Object;
private var ico:Object;
private var info:Array;
private var icoRef:Class;
public function CPanelActChar(){
mouseEnabled = false;
}
public function Del(_arg1:String):void{
tempObj = new Object();
tempObj = getChildByName(_arg1);
if (tempObj != null){
tempObj.Del();
if (tempObj.GetNChar() == 0){
removeChild(DisplayObject(tempObj));
SetPos();
};
};
}
private function RollOver(_arg1:MouseEvent):void{
}
public function Init():void{
}
private function RollOut(_arg1:MouseEvent):void{
}
public function Add(_arg1:int, _arg2:String, _arg3:int):void{
id = _arg1;
tempObj = new Object();
tempObj = getChildByName(_arg2);
if (tempObj != null){
if (contains(DisplayObject(tempObj))){
tempObj.Add();
return;
};
};
if (id == 1){
icoRef = (getDefinitionByName("MedActIcon") as Class);
} else {
icoRef = (getDefinitionByName("DarkActIcon") as Class);
};
ico = new icoRef();
addChild(DisplayObject(ico));
ico.name = _arg2;
ico.Init(_arg3, _arg2);
SetPos();
}
private function SetPos():void{
var _local1:int;
if (id == 2){
_local1 = 0;
while (_local1 < numChildren) {
if (_local1 > 7){
getChildAt(_local1).x = (-42 - (55 * (_local1 - 8)));
} else {
if (_local1 > 3){
getChildAt(_local1).x = (-42 - (55 * (_local1 - 4)));
} else {
getChildAt(_local1).x = (-42 - (55 * _local1));
};
};
getChildAt(_local1).y = (10 + (20 * Math.floor((_local1 / 4))));
_local1++;
};
} else {
_local1 = 0;
while (_local1 < numChildren) {
if (_local1 > 7){
getChildAt(_local1).x = (10 + (55 * (_local1 - 8)));
} else {
if (_local1 > 3){
getChildAt(_local1).x = (10 + (55 * (_local1 - 4)));
} else {
getChildAt(_local1).x = (10 + (55 * _local1));
};
};
getChildAt(_local1).y = (10 + (20 * Math.floor((_local1 / 4))));
_local1++;
};
};
}
public function Update(_arg1:String, _arg2:Number):void{
tempObj = new Object();
tempObj = getChildByName(_arg1);
if (tempObj != null){
tempObj.Update(_arg2);
};
}
}
}//package uiscr
Section 153
//CPause (uiscr.CPause)
package uiscr {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.text.*;
public class CPause extends MovieClip {
public var txMusic:TextField;
public var btMusic:MovieClip;
public var txSound:TextField;
var timer:Timer;
public var btExit:SimpleButton;
public var btQual2:MovieClip;
public var btQual1:MovieClip;
public var btQual3:MovieClip;
public var btClose:SimpleButton;
public var btSound:MovieClip;
private function Close(_arg1:MouseEvent):void{
this["root"].PlaySound("88");
root["isPause"] = false;
this["root"].removeChild(this);
}
public function Init():void{
if (root["mscOn"]){
root["mscOn"] = true;
this["btMusic"].gotoAndStop(1);
this["txMusic"].text = "on";
} else {
root["mscOn"] = false;
this["btMusic"].gotoAndStop(2);
this["txMusic"].text = "off";
};
if (root["sndOn"]){
root["sndOn"] = true;
this["btSound"].gotoAndStop(1);
this["txSound"].text = "on";
} else {
root["sndOn"] = false;
this["btSound"].gotoAndStop(2);
this["txSound"].text = "off";
};
if (root["quality"] == 1){
this["btQual1"].gotoAndStop(1);
this["btQual2"].gotoAndStop(2);
this["btQual3"].gotoAndStop(2);
} else {
if (root["quality"] == 2){
this["btQual1"].gotoAndStop(2);
this["btQual2"].gotoAndStop(1);
this["btQual3"].gotoAndStop(2);
} else {
if (root["quality"] == 3){
this["btQual1"].gotoAndStop(2);
this["btQual2"].gotoAndStop(2);
this["btQual3"].gotoAndStop(1);
};
};
};
this["btMusic"].buttonMode = true;
this["btSound"].buttonMode = true;
this["btQual1"].buttonMode = true;
this["btQual2"].buttonMode = true;
this["btQual3"].buttonMode = true;
this["btMusic"].addEventListener(MouseEvent.CLICK, SetSound, false, 0, true);
this["btSound"].addEventListener(MouseEvent.CLICK, SetSound, false, 0, true);
this["btQual1"].addEventListener(MouseEvent.CLICK, SetQual, false, 0, true);
this["btQual2"].addEventListener(MouseEvent.CLICK, SetQual, false, 0, true);
this["btQual3"].addEventListener(MouseEvent.CLICK, SetQual, false, 0, true);
this["btClose"].addEventListener(MouseEvent.CLICK, Close, false, 0, true);
this["btExit"].addEventListener(MouseEvent.CLICK, Exit, false, 0, true);
}
private function Exit(_arg1:MouseEvent):void{
this["root"].PlaySound("88");
root["isPause"] = false;
this["root"].StopGame();
this["btMusic"].buttonMode = false;
this["btSound"].buttonMode = false;
this["btQual1"].buttonMode = false;
this["btQual2"].buttonMode = false;
this["btQual3"].buttonMode = false;
this["btMusic"].removeEventListener(MouseEvent.CLICK, SetSound);
this["btSound"].removeEventListener(MouseEvent.CLICK, SetSound);
this["btQual1"].removeEventListener(MouseEvent.CLICK, SetQual);
this["btQual2"].removeEventListener(MouseEvent.CLICK, SetQual);
this["btQual3"].removeEventListener(MouseEvent.CLICK, SetQual);
this["btClose"].enabled = false;
this["btClose"].removeEventListener(MouseEvent.CLICK, Close);
this["btExit"].enabled = false;
this["btExit"].removeEventListener(MouseEvent.CLICK, Exit);
timer = new Timer(1000, 2);
timer.start();
timer.addEventListener(TimerEvent.TIMER_COMPLETE, ExitNow, false, 0, true);
}
private function SetQual(_arg1:MouseEvent):void{
this["root"].PlaySound("99");
if (_arg1.currentTarget == btQual1){
this["root"].SetQuality(1);
this["btQual1"].gotoAndStop(1);
this["btQual2"].gotoAndStop(2);
this["btQual3"].gotoAndStop(2);
} else {
if (_arg1.currentTarget == btQual2){
this["root"].SetQuality(2);
this["btQual1"].gotoAndStop(2);
this["btQual2"].gotoAndStop(1);
this["btQual3"].gotoAndStop(2);
} else {
if (_arg1.currentTarget == btQual3){
this["root"].SetQuality(3);
this["btQual1"].gotoAndStop(2);
this["btQual2"].gotoAndStop(2);
this["btQual3"].gotoAndStop(1);
};
};
};
}
private function ExitNow(_arg1:TimerEvent):void{
timer.stop();
timer.removeEventListener(TimerEvent.TIMER_COMPLETE, ExitNow);
root["win"] = -1;
this["root"].RemoveBg();
this["root"].BgSound();
this["root"].ShowScreen("Map");
}
private function SetSound(_arg1:MouseEvent):void{
this["root"].PlaySound("99");
if (_arg1.currentTarget == btMusic){
if (root["mscOn"]){
this["root"].TurnOffMusic();
this["btMusic"].gotoAndStop(2);
this["txMusic"].text = "off";
} else {
this["root"].TurnOnMusic();
this["btMusic"].gotoAndStop(1);
this["txMusic"].text = "on";
};
} else {
if (_arg1.currentTarget == btSound){
if (root["sndOn"]){
root["sndOn"] = false;
this["btSound"].gotoAndStop(2);
this["txSound"].text = "off";
} else {
root["sndOn"] = true;
this["btSound"].gotoAndStop(1);
this["txSound"].text = "on";
};
};
};
}
}
}//package uiscr
Section 154
//CResult (uiscr.CResult)
package uiscr {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.text.*;
public class CResult extends MovieClip {
public var txLost1:TextField;
public var txLost2:TextField;
public var mcResult:MovieClip;
public var txKill2:TextField;
public var txKill3:TextField;
public var txKill0:TextField;
public var txKill1:TextField;
public var txLost0:TextField;
public var txLost3:TextField;
public var btMoreGames:MoreGamesBtn;
public var btClose:SimpleButton;
public var logo1:logo_bg;
public function CResult(){
this["btClose"].addEventListener(MouseEvent.CLICK, Close, false, 0, true);
this["btMoreGames"].addEventListener(MouseEvent.CLICK, MoreGames, false, 0, true);
this["logo1"].Init("http://www.belugerinstudios.com/");
}
private function Close(_arg1:MouseEvent):void{
this["root"].PlaySound("88");
this["root"].RemoveBg();
if (root["gameLevel"] == 31){
this["root"].ShowScreen("MainMenu");
} else {
this["root"].BgSound();
this["root"].ShowScreen("Map");
};
}
public function Init(_arg1:Array, _arg2:Array, _arg3:int):void{
var _local4:uint;
var _local5:int;
_local4 = 0;
this["mcResult"].gotoAndStop(_arg3);
_local5 = 0;
while (_local5 < _arg1.length) {
this[("txKill" + _local5)].text = String(_arg1[_local5]);
_local4 = (_local4 + int(_arg1[_local5]));
_local5++;
};
_local5 = 0;
while (_local5 < _arg2.length) {
this[("txLost" + _local5)].text = String(_arg2[_local5]);
_local5++;
};
if (_local4 >= 125){
if (root["myMedal"][3] == 0){
root["myMedal"][3] = 1;
this["root"].SaveMedalData();
};
} else {
if (_local4 >= 100){
if (root["myMedal"][2] == 0){
root["myMedal"][2] = 1;
this["root"].SaveMedalData();
};
} else {
if (_local4 >= 75){
if (root["myMedal"][1] == 0){
root["myMedal"][1] = 1;
this["root"].SaveMedalData();
};
} else {
if (_local4 >= 50){
if (root["myMedal"][0] == 0){
root["myMedal"][0] = 1;
this["root"].SaveMedalData();
};
};
};
};
};
if (root["gameLevel"] == 31){
if (root["mapId"] == 1){
if (root["myMedal"][9] == 0){
root["myMedal"][9] = 1;
this["root"].SaveMedalData();
};
} else {
if (root["mapId"] == 2){
if (root["myMedal"][10] == 0){
root["myMedal"][10] = 1;
this["root"].SaveMedalData();
};
} else {
if (root["mapId"] == 3){
if (root["myMedal"][11] == 0){
root["myMedal"][11] = 1;
this["root"].SaveMedalData();
};
} else {
if (root["mapId"] == 4){
if (root["myMedal"][12] == 0){
root["myMedal"][12] = 1;
this["root"].SaveMedalData();
};
};
};
};
};
};
}
private function MoreGames(_arg1:MouseEvent):void{
var _local2:URLRequest;
this["root"].PlaySound("88");
_local2 = new URLRequest("http://www.belugerinstudios.com/");
navigateToURL(_local2, "_blank");
}
}
}//package uiscr
Section 155
//CSave (uiscr.CSave)
package uiscr {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.text.*;
public class CSave extends MovieClip {
private var tooltip:Tooltip;
public var save1:MovieClip;
public var save3:MovieClip;
public var save0:SimpleButton;
public var save2:MovieClip;
public var cap:TextField;
private var func:String;
private function GetUSClockTime(_arg1:uint, _arg2:uint):String{
var _local3:String;
var _local4:String;
_local3 = "PM";
_local4 = DoubleDigitFormat(_arg2);
if (_arg1 > 12){
_arg1 = (_arg1 - 12);
} else {
if (_arg1 == 0){
_local3 = "AM";
_arg1 = 12;
} else {
if (_arg1 < 12){
_local3 = "AM";
};
};
};
return (((((DoubleDigitFormat(_arg1) + ":") + _local4) + " ") + _local3));
}
private function UpdateTooltipPos(_arg1:Event):void{
tooltip.x = (mouseX - 25);
tooltip.y = (mouseY + 20);
}
private function RollOver(_arg1:MouseEvent):void{
var _local2:String;
var _local3:int;
_local2 = String(_arg1.currentTarget.name);
_local3 = int(_local2.substr(4));
ShowTooltip(("Data Saved: " + root["dataDateColl"][_local3]));
}
private function ShowTooltip(_arg1:String):void{
HideTooltip();
tooltip = new Tooltip();
addChild(tooltip);
tooltip.x = (mouseX + 15);
tooltip.y = (mouseY - 10);
tooltip.cap.text = _arg1;
tooltip.cap.width = int((_arg1.length * 7));
tooltip.addEventListener(Event.ENTER_FRAME, UpdateTooltipPos, false, 0, true);
}
public function Init(_arg1:String):void{
var _local2:int;
func = _arg1;
_local2 = 0;
while (_local2 <= 3) {
if (_local2 > 0){
this[("save" + _local2)].cap.mouseEnabled = false;
if (root["dataDateColl"][_local2] == undefined){
this[("save" + _local2)].cap.text = "Empty";
if (func == "save"){
this[("save" + _local2)].buttonMode = true;
this[("save" + _local2)].addEventListener(MouseEvent.CLICK, Save, false, 0, true);
};
} else {
this[("save" + _local2)].buttonMode = true;
this[("save" + _local2)].cap.text = "Saved";
this[("save" + _local2)].addEventListener(MouseEvent.ROLL_OVER, RollOver, false, 0, true);
this[("save" + _local2)].addEventListener(MouseEvent.ROLL_OUT, RollOut, false, 0, true);
this[("save" + _local2)].addEventListener(MouseEvent.CLICK, Save, false, 0, true);
};
} else {
this[("save" + _local2)].addEventListener(MouseEvent.CLICK, Save, false, 0, true);
};
_local2++;
};
}
private function HideTooltip():void{
if (tooltip != null){
removeChild(tooltip);
tooltip.removeEventListener(Event.ENTER_FRAME, UpdateTooltipPos);
tooltip = null;
};
}
private function RollOut(_arg1:MouseEvent):void{
HideTooltip();
}
private function Save(_arg1:MouseEvent):void{
var _local2:String;
var _local3:int;
var _local4:Date;
_local2 = String(_arg1.currentTarget.name);
_local3 = int(_local2.substr(4));
this["root"].PlaySound("88");
if (_local3 == 0){
if (parent["isExit"]){
parent["isExit"] = false;
parent["mcConfirm"].visible = true;
};
} else {
if (func == "save"){
_local4 = new Date();
root["dataDateColl"][_local3] = ((((((int((_local4.getMonth() + 1)) + "/") + _local4.getDate()) + "/") + _local4.getFullYear()) + " ") + GetUSClockTime(_local4.getHours(), _local4.getMinutes()));
root["dataDate"] = root["dataDateColl"][_local3];
trace(root["dataDate"]);
this["root"].SaveGameData(("data" + _local3));
_arg1.currentTarget.cap.text = "Saved";
_arg1.currentTarget.addEventListener(MouseEvent.ROLL_OVER, RollOver, false, 0, true);
_arg1.currentTarget.addEventListener(MouseEvent.ROLL_OUT, RollOut, false, 0, true);
} else {
if (func == "load"){
this["root"].LoadGameData(("data" + _local3));
this["root"].ShowScreen("Map");
};
};
};
visible = false;
if (parent["isExit"]){
this["root"].ResetData();
this["root"].ShowScreen("MainMenu");
};
}
private function DoubleDigitFormat(_arg1:uint):String{
if (_arg1 < 10){
return (("0" + _arg1));
};
return (String(_arg1));
}
}
}//package uiscr
Section 156
//CSelectRace (uiscr.CSelectRace)
package uiscr {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.text.*;
public class CSelectRace extends MovieClip {
public var btSelect2:SimpleButton;
public var btSelect0:SimpleButton;
public var btSelect1:SimpleButton;
public var mcMDiff:MovieClip;
public var mcDDiff:MovieClip;
public function CSelectRace(){
var _local1:int;
super();
_local1 = 0;
while (_local1 < 3) {
this[("btSelect" + _local1)].addEventListener(MouseEvent.CLICK, Select, false, 0, true);
_local1++;
};
this["mcDDiff"].visible = false;
this["mcMDiff"].visible = false;
_local1 = 0;
while (_local1 < 4) {
if (this["mcDDiff"][("btDiff" + _local1)] != null){
this["mcDDiff"][("btDiff" + _local1)].addEventListener(MouseEvent.CLICK, SelectDDiff, false, 0, true);
};
_local1++;
};
_local1 = 0;
while (_local1 < 4) {
if (this["mcMDiff"][("btDiff" + _local1)] != null){
this["mcMDiff"][("btDiff" + _local1)].addEventListener(MouseEvent.CLICK, SelectMDiff, false, 0, true);
};
_local1++;
};
}
private function Select(_arg1:MouseEvent):void{
var _local2:int;
_local2 = int(_arg1.currentTarget.name.charAt(8));
this["root"].PlaySound("88");
if (_local2 == 0){
this["mcDDiff"].visible = true;
root["baseType"] = 2;
} else {
if (_local2 == 1){
this["mcMDiff"].visible = true;
root["baseType"] = 1;
} else {
if (_local2 == 2){
this["root"].ShowScreen("MainMenu");
};
};
};
}
private function SelectMDiff(_arg1:MouseEvent):void{
var _local2:int;
_local2 = int(_arg1.currentTarget.name.charAt(6));
this["root"].PlaySound("88");
if (_local2 == 0){
this["mcDDiff"].visible = false;
this["mcMDiff"].visible = false;
} else {
if (_local2 == 1){
} else {
if (_local2 == 2){
root["mapId"] = 3;
this["root"].InitANewGame();
this["root"].ShowScreen("Map");
} else {
if (_local2 == 3){
root["mapId"] = 4;
this["root"].InitANewGame();
this["root"].ShowScreen("Map");
};
};
};
};
}
private function SelectDDiff(_arg1:MouseEvent):void{
var _local2:int;
_local2 = int(_arg1.currentTarget.name.charAt(6));
this["root"].PlaySound("88");
if (_local2 == 0){
this["mcDDiff"].visible = false;
this["mcMDiff"].visible = false;
} else {
if (_local2 == 1){
root["mapId"] = 1;
this["root"].InitANewGame();
this["root"].ShowScreen("Map");
} else {
if (_local2 == 2){
root["mapId"] = 2;
this["root"].InitANewGame();
this["root"].ShowScreen("Map");
} else {
if (_local2 == 3){
};
};
};
};
}
}
}//package uiscr
Section 157
//CStatistic (uiscr.CStatistic)
package uiscr {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.text.*;
public class CStatistic extends MovieClip {
public var txStat0:TextField;
public var txStat3:TextField;
public var txStat4:TextField;
public var txStat5:TextField;
public var txStat1:TextField;
public var txStat2:TextField;
public var btClose:SimpleButton;
public function CStatistic(){
this["btClose"].addEventListener(MouseEvent.CLICK, Close, false, 0, true);
}
private function Close(_arg1:MouseEvent):void{
this["root"].PlaySound("88");
this["root"].ShowScreen(root["curScr"]);
}
public function Init(_arg1:Array):void{
var _local2:int;
_local2 = 0;
while (_local2 < _arg1.length) {
this[("txStat" + _local2)].text = String(_arg1[_local2]);
_local2++;
};
}
}
}//package uiscr
Section 158
//CUpgrade (uiscr.CUpgrade)
package uiscr {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.text.*;
import flash.filters.*;
public class CUpgrade extends MovieClip {
public var mLock8:MovieClip;
public var mLock9:MovieClip;
public var mLock4:MovieClip;
public var mLock3:MovieClip;
public var dLock10:MovieClip;
public var dLock11:MovieClip;
public var dLock12:MovieClip;
public var mLock2:MovieClip;
public var dSkil2:MovieClip;
public var dSkil5:MovieClip;
public var dSkil6:MovieClip;
public var dSkil7:MovieClip;
public var dSkil9:MovieClip;
public var dSkil3:MovieClip;
public var dSkil4:MovieClip;
public var dSkil8:MovieClip;
public var dLock14:MovieClip;
public var dLock13:MovieClip;
public var mcSave:mcsavedata;
public var dTure3:MovieClip;
public var dTure4:MovieClip;
public var dSkil0:MovieClip;
public var dSkil1:MovieClip;
public var txUpPoin:TextField;
public var dTure1:MovieClip;
public var dTure2:MovieClip;
private var tooltip:Tooltip2;
public var mcConfirm:mcexitconfirm;
public var dSkil11:MovieClip;
public var dSkil12:MovieClip;
public var dLock0:MovieClip;
public var dLock1:MovieClip;
public var dLock2:MovieClip;
public var dSkil10:MovieClip;
public var dLock6:MovieClip;
public var dSkil13:MovieClip;
public var dSkil14:MovieClip;
public var dLock9:MovieClip;
public var dLock3:MovieClip;
public var dLock5:MovieClip;
public var dLock7:MovieClip;
public var dLock8:MovieClip;
private var idColl1:Array;
public var dCastle:MovieClip;
private var idColl2:Array;
public var dLock4:MovieClip;
public var txGameLevel:TextField;
private var nAvaiUp:uint;
public var idColl:Array;
private var infoColl1:Array;
private var infoColl2:Array;
private var infoColl:Array;
public var mLeve11:MovieClip;
public var mLeve12:MovieClip;
public var mLeve13:MovieClip;
public var mLeve14:MovieClip;
public var mLeve0:MovieClip;
public var mLeve1:MovieClip;
public var mLeve2:MovieClip;
public var mLeve3:MovieClip;
public var mLeve5:MovieClip;
public var mLeve6:MovieClip;
public var mLeve4:MovieClip;
public var btNav2:SimpleButton;
public var mLeve7:MovieClip;
public var mLeve8:MovieClip;
public var btNav0:SimpleButton;
public var btNav1:SimpleButton;
public var btNav3:SimpleButton;
public var mLeve9:MovieClip;
private var skillColl:Array;
public var mLeve10:MovieClip;
public var btNav4:SimpleButton;
public var btNav5:SimpleButton;
private var type:String;
public var dLeve0:MovieClip;
public var dLeve1:MovieClip;
public var dLeve3:MovieClip;
public var dLeve4:MovieClip;
public var dLeve5:MovieClip;
public var dLeve8:MovieClip;
public var dLeve9:MovieClip;
private var turretLvlAvai:Array;
public var dLeve2:MovieClip;
public var mLock10:MovieClip;
public var mLock11:MovieClip;
public var mLock13:MovieClip;
public var mLock14:MovieClip;
public var dLeve6:MovieClip;
public var dLeve7:MovieClip;
public var mLock12:MovieClip;
public var dLeve10:MovieClip;
public var dLeve13:MovieClip;
public var dLeve14:MovieClip;
public var isExit:Boolean;
public var charAvai:Array;
public var dLeve11:MovieClip;
public var dLeve12:MovieClip;
public var mSkil10:MovieClip;
public var mSkil0:MovieClip;
public var mSkil1:MovieClip;
public var mSkil5:MovieClip;
public var mSkil11:MovieClip;
public var mSkil2:MovieClip;
public var mSkil3:MovieClip;
public var mSkil4:MovieClip;
public var mSkil7:MovieClip;
public var mSkil8:MovieClip;
public var mSkil13:MovieClip;
public var mSkil6:MovieClip;
public var mSkil12:MovieClip;
public var mSkil14:MovieClip;
public var mTure2:MovieClip;
public var mTure3:MovieClip;
public var mTure4:MovieClip;
public var mCastle:MovieClip;
public var mcUpPoin:MovieClip;
public var mTure1:MovieClip;
private var charAttrib:CCharAttrib;
public var mSkil9:MovieClip;
public var mLock0:MovieClip;
public var mLock1:MovieClip;
public var mLock5:MovieClip;
public var mLock6:MovieClip;
public var mLock7:MovieClip;
public function CUpgrade(){
infoColl1 = ["Swordman", "Archerman", "Spearman", "Lancer", "Paladin", "Catapult", "Cannon", "Zeppelin Archer", "Zeppelin Bomber", "Old Plane Archer", "Old Plane Bomber", "Viking Ship", "Roman Ship", "Persian Ship", "Greek Ship"];
infoColl2 = ["Zombie", "Skeleton", "Strigoi", "Lizardman", "Dark Evil", "Dark Elf", "Wizard", "Redcaps", "Griffin", "Ghost", "Dragon", "Giant Shark", "Giant Whale", "Pirate Ship", "Ghost Ship"];
idColl1 = ["Swordman", "Archer", "Spearman", "Knight", "Paladin", "Catapult", "Cannon", "Baloon1", "Baloon2", "Plane1", "Plane2", "Vikingship", "Romanship", "Persianship", "Greekship"];
idColl2 = ["Zombie", "Skeleton", "Vampire", "Ogre", "Darkevil", "Darkelf", "Wizard", "Dracula", "Eagle", "Ghost", "Dragon", "Shark", "Whale", "Godship", "Ghostship"];
turretLvlAvai = [0, 3, 5, 7, 9];
super();
}
private function ShowTooltip(_arg1:Array):void{
var _local2:int;
var _local3:int;
var _local4:int;
_local2 = _arg1.length;
_local3 = 0;
HideTooltip();
tooltip = new Tooltip2();
addChild(tooltip);
tooltip.x = (mouseX - (tooltip.width / 2));
tooltip.y = (mouseY + 20);
_local4 = 0;
while (_local4 < _local2) {
tooltip.cap.appendText(_arg1[_local4]);
if (_local3 < _arg1[_local4].length){
_local3 = _arg1[_local4].length;
};
_local4++;
};
tooltip.cap.width = int((_local3 * 6));
if (_local2 > 4){
tooltip.cap.height = int((_local2 * 9));
} else {
if (_local2 > 1){
tooltip.cap.height = int((_local2 * 11));
} else {
tooltip.cap.height = 18;
};
};
tooltip.addEventListener(Event.ENTER_FRAME, UpdateTooltipPos, false, 0, true);
}
private function UpgradeCastle(_arg1:MouseEvent):void{
var _local2:Number;
var _local3:int;
_local2 = int((root["baseAttrib"][(root["baseLevel"] + 1)] * 1000));
this["root"].PlaySound("99");
if (root["myUpPoin"] > 0){
var _local4 = root;
var _local5 = "baseLevel";
var _local6 = (_local4[_local5] + 1);
_local4[_local5] = _local6;
_local4 = root;
_local5 = "myUpPoin";
_local6 = (_local4[_local5] - 1);
_local4[_local5] = _local6;
this["txUpPoin"].text = root["myUpPoin"];
RemFilter(this[(type + "Castle")]);
HideTooltip();
this[(type + "Castle")].buttonMode = false;
this[(type + "Castle")].removeEventListener(MouseEvent.CLICK, UpgradeCastle);
_local3 = 1;
while (_local3 <= 4) {
if (turretLvlAvai[_local3] == root["baseLevel"]){
this[((type + "Ture") + _local3)].gotoAndStop(1);
_local4 = root;
_local5 = "nTurret";
_local6 = (_local4[_local5] + 1);
_local4[_local5] = _local6;
trace(("ntur" + root["nTurret"]));
};
_local3++;
};
};
}
private function CastleRollOver(_arg1:MouseEvent):void{
var _local2:int;
var _local3:int;
var _local4:Array;
_local2 = this["root"].GetBaseHp(root["baseLevel"]);
_local3 = this["root"].GetBaseHp((root["baseLevel"] + 1));
_local4 = new Array();
_local4.push(((("Base Lvl. " + root["baseLevel"]) + ", Life ") + _local2));
if ((((root["baseLevel"] < 10)) && ((root["baseLevel"] == root["tmpBaseLevel"])))){
_local4.push("\n");
_local4.push("Require 1 upgrade poin to level up");
_local4.push("\n");
_local4.push(("Life +" + int((_local3 - _local2))));
};
ShowTooltip(_local4);
}
private function HideTooltip():void{
if (tooltip != null){
removeChild(tooltip);
tooltip.removeEventListener(Event.ENTER_FRAME, UpdateTooltipPos);
tooltip = null;
};
}
private function SelectNav(_arg1:MouseEvent):void{
var _local2:String;
var _local3:int;
_local2 = String(_arg1.currentTarget.name);
_local3 = int(_local2.charAt(5));
this["root"].PlaySound("88");
if (_local3 == 0){
this["root"].ShowScreen("Map");
} else {
if (_local3 == 1){
this["root"].ShowScreen("Statistic");
} else {
if (_local3 == 2){
this["root"].ShowScreen("Medal");
} else {
if (_local3 == 3){
this["mcSave"].cap.text = "Save Game";
this["mcSave"].visible = true;
} else {
if (_local3 == 4){
if (root["gameLevel"] == 1){
this["root"].ShowScreen("Instruction");
} else {
this["root"].ShowScreen("PLAY");
};
} else {
if (_local3 == 5){
this["mcConfirm"].visible = true;
};
};
};
};
};
};
}
private function TurretRollOver(_arg1:MouseEvent):void{
var _local2:String;
var _local3:int;
var _local4:Array;
_local2 = String(_arg1.currentTarget.name);
_local3 = int(_local2.substr(5));
_local4 = new Array();
if (type == "m"){
if (_local3 == 1){
_local4.push("Fire Arrows Turret");
} else {
if (_local3 == 2){
_local4.push("Triple Arrows Turret");
} else {
if (_local3 == 3){
_local4.push("Spear Turret");
} else {
if (_local3 == 4){
_local4.push("Catapult");
};
};
};
};
} else {
if (_local3 == 1){
_local4.push("Magic Turret");
} else {
if (_local3 == 2){
_local4.push("Fire Arrows Turret");
} else {
if (_local3 == 3){
_local4.push("Poison Turret");
} else {
if (_local3 == 4){
_local4.push("Frost Turret");
};
};
};
};
};
if (turretLvlAvai[_local3] > root["baseLevel"]){
_local4.push("\n");
_local4.push(("Available at Base Lvl. " + turretLvlAvai[_local3]));
};
ShowTooltip(_local4);
}
private function RemFilter(_arg1:Object){
_arg1.filters = [];
}
private function SetFilter(_arg1:Object, _arg2:Number=0xFF00){
var _local3:GlowFilter;
_local3 = new GlowFilter();
_local3 = new GlowFilter();
_local3.color = _arg2;
_local3.blurX = 10;
_local3.blurY = 10;
_arg1.filters = [_local3];
}
private function UnlockChar(_arg1:MouseEvent):void{
var _local2:String;
var _local3:int;
var _local4:int;
var _local5:Array;
_local2 = String(_arg1.currentTarget.name);
_local3 = int(_local2.substr(5));
this["root"].PlaySound("99");
if (root["myUpPoin"] > 0){
var _local6 = root;
var _local7 = "myUpPoin";
var _local8 = (_local6[_local7] - 1);
_local6[_local7] = _local8;
this["txUpPoin"].text = root["myUpPoin"];
root["charUnlock"][_local3] = 1;
if (root["myMedal"][5] == 0){
_local5 = new Array();
_local4 = 0;
while (_local4 < 7) {
_local5[_local4] = root["charUnlock"][_local4];
_local4++;
};
if (_local5.indexOf(0) == -1){
root["myMedal"][5] = 1;
this["root"].SaveMedalData();
};
};
if (root["myMedal"][6] == 0){
_local5 = new Array();
_local4 = 7;
while (_local4 < 11) {
_local5[_local4] = root["charUnlock"][_local4];
_local4++;
};
if (_local5.indexOf(0) == -1){
root["myMedal"][6] = 1;
this["root"].SaveMedalData();
};
};
if (root["myMedal"][7] == 0){
_local5 = new Array();
_local4 = 11;
while (_local4 < 15) {
_local5[_local4] = root["charUnlock"][_local4];
_local4++;
};
if (_local5.indexOf(0) == -1){
root["myMedal"][7] = 1;
this["root"].SaveMedalData();
};
};
HideTooltip();
RemFilter(_arg1.currentTarget);
_arg1.currentTarget.gotoAndStop(1);
_arg1.currentTarget.buttonMode = false;
_arg1.currentTarget.removeEventListener(MouseEvent.ROLL_OVER, RollOver);
_arg1.currentTarget.removeEventListener(MouseEvent.ROLL_OUT, RollOut);
_arg1.currentTarget.removeEventListener(MouseEvent.CLICK, UnlockChar);
SetFilter(this[((type + "Skil") + _local3)]);
this[((type + "Skil") + _local3)].buttonMode = true;
this[((type + "Skil") + _local3)].addEventListener(MouseEvent.CLICK, UgradeSkill, false, 0, true);
SetFilter(this[((type + "Leve") + _local3)]);
this[((type + "Leve") + _local3)].gotoAndStop(1);
this[((type + "Leve") + _local3)].buttonMode = true;
this[((type + "Leve") + _local3)].addEventListener(MouseEvent.CLICK, UpgradeLevel, false, 0, true);
};
}
private function UpgradeLevel(_arg1:MouseEvent):void{
var _local2:String;
var _local3:int;
_local2 = String(_arg1.currentTarget.name);
_local3 = int(_local2.substr(5));
this["root"].PlaySound("99");
if (root["myUpPoin"] > 0){
var _local4 = root["charLevel"];
var _local5 = _local3;
var _local6 = (_local4[_local5] + 1);
_local4[_local5] = _local6;
_local4 = root;
_local5 = "myUpPoin";
_local6 = (_local4[_local5] - 1);
_local4[_local5] = _local6;
this["txUpPoin"].text = root["myUpPoin"];
RemFilter(_arg1.currentTarget);
HideTooltip();
_arg1.currentTarget.buttonMode = false;
_arg1.currentTarget.removeEventListener(MouseEvent.CLICK, UpgradeLevel);
};
}
private function UgradeSkill(_arg1:MouseEvent):void{
var _local2:String;
var _local3:int;
_local2 = String(_arg1.currentTarget.name);
_local3 = int(_local2.substr(5));
this["root"].PlaySound("99");
if (root["myUpPoin"] > 0){
var _local4 = root;
var _local5 = "myUpPoin";
var _local6 = (_local4[_local5] - 1);
_local4[_local5] = _local6;
this["txUpPoin"].text = root["myUpPoin"];
root["charUpgrade"][_local3] = 1;
if (root["myMedal"][8] == 0){
if (root["charUpgrade"].indexOf(0) == -1){
root["myMedal"][8] = 1;
this["root"].SaveMedalData();
};
};
HideTooltip();
RemFilter(_arg1.currentTarget);
_arg1.currentTarget.gotoAndStop(1);
_arg1.currentTarget.buttonMode = false;
_arg1.currentTarget.removeEventListener(MouseEvent.CLICK, UgradeSkill);
};
}
private function UpPoinRollOver(_arg1:MouseEvent):void{
var _local2:Array;
_local2 = new Array();
_local2.push("Upgrade Poin");
ShowTooltip(_local2);
}
private function RollOver(_arg1:MouseEvent):void{
var _local2:String;
var _local3:int;
var _local4:String;
var _local5:Array;
var _local6:String;
_local2 = String(_arg1.currentTarget.name);
_local3 = int(_local2.substr(5));
_local4 = _local2.substr(1, 4);
_local5 = new Array();
if (_local4 == "Lock"){
if (root["charUnlock"][_local3]){
if (charAvai[_local3]){
_local5.push((infoColl[_local3] + " unlocked"));
} else {
_local5.push((infoColl[_local3] + " unlocked, not available at next battle"));
};
} else {
if (charAvai[_local3]){
_local5.push(infoColl[_local3]);
} else {
_local5.push((infoColl[_local3] + ", not available at next battle"));
};
_local5.push("\n");
if (root["gameLevel"] >= root["canUnlockChar"][_local3]){
_local5.push("Require 1 upgrade poin to unlock");
} else {
_local5.push((("Require game level" + root["canUnlockChar"][_local3]) + " + 1 upgrade poin to unlock"));
};
};
} else {
if (_local4 == "Skil"){
if (skillColl[_local3] == 1){
_local6 = "20% chance to 2x normal damage";
} else {
if (skillColl[_local3] == 2){
_local6 = "20% chance to toss damage";
} else {
if (skillColl[_local3] == 3){
_local6 = "20% chance to fire damage";
} else {
if (skillColl[_local3] == 4){
_local6 = "20% chance to blast damage";
} else {
if (skillColl[_local3] == 5){
_local6 = "20% chance to poison damage";
} else {
if (skillColl[_local3] == 6){
_local6 = "20% chance to 3x normal damage";
};
};
};
};
};
};
if (root["charUpgrade"][_local3]){
if (charAvai[_local3]){
_local5.push(((infoColl[_local3] + "'s skill ") + _local6));
} else {
_local5.push((((infoColl[_local3] + "'s skill ") + _local6) + ", not available at next battle"));
};
} else {
if (charAvai[_local3]){
_local5.push(((infoColl[_local3] + "'s skill ") + _local6));
} else {
_local5.push((((infoColl[_local3] + "'s skill ") + _local6) + ", not available at next battle"));
};
_local5.push("\n");
if (root["charUnlock"][_local3]){
_local5.push("Require 1 upgrade poin to unlock");
} else {
_local5.push("Unlock the unit to upgrade it");
};
};
} else {
if (_local4 == "Leve"){
if (root["charLevel"][_local3] < 10){
if (root["charUnlock"][_local3]){
if (charAvai[_local3]){
_local5.push(((infoColl[_local3] + " Lvl. ") + root["charLevel"][_local3]));
} else {
_local5.push((((infoColl[_local3] + " Lvl. ") + root["charLevel"][_local3]) + ", not available at next battle"));
};
if (root["charLevel"][_local3] == root["tmpCharLevel"][_local3]){
_local5.push("\n");
_local5.push("Require 1 upgrade poin to level up");
_local5.push("\n");
_local5.push("Life +5, Attack +2, Armor +1");
};
} else {
_local5.push(infoColl[_local3]);
_local5.push("\n");
_local5.push("Unlock the unit to upgrade it");
};
} else {
_local5.push(((infoColl[_local3] + " Lvl. ") + root["charLevel"][_local3]));
};
};
};
};
ShowTooltip(_local5);
}
private function UpdateTooltipPos(_arg1:Event):void{
tooltip.x = (mouseX - (tooltip.width / 2));
tooltip.y = (mouseY + 20);
}
public function Init(_arg1:int):void{
var _local2:int;
this["mcSave"].visible = false;
this["mcSave"].Init("save");
this["mcConfirm"].Init();
isExit = false;
this["txGameLevel"].text = root["gameLevel"];
infoColl = new Array();
idColl = new Array();
if (_arg1 == 1){
infoColl = infoColl1;
idColl = idColl1;
type = "m";
} else {
if (_arg1 == 2){
infoColl = infoColl2;
idColl = idColl2;
type = "d";
};
};
charAvai = new Array();
if ((((root["bgType"] == 0)) || ((root["bgType"] == 4)))){
charAvai = [1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0];
} else {
if ((((root["bgType"] == 1)) || ((root["bgType"] == 5)))){
charAvai = [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1];
} else {
if ((((root["bgType"] == 2)) || ((root["bgType"] == 6)))){
charAvai = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0];
} else {
if ((((root["bgType"] == 3)) || ((root["bgType"] == 7)))){
charAvai = [1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0];
};
};
};
};
charAttrib = new CCharAttrib();
skillColl = new Array();
skillColl = charAttrib.GetDataById(idColl, "skilltyp");
nAvaiUp = 0;
_local2 = 0;
while (_local2 < 15) {
this[((type + "Lock") + _local2)].gotoAndStop(2);
this[((type + "Lock") + _local2)].addEventListener(MouseEvent.ROLL_OVER, RollOver, false, 0, true);
this[((type + "Lock") + _local2)].addEventListener(MouseEvent.ROLL_OUT, RollOut, false, 0, true);
this[((type + "Skil") + _local2)].gotoAndStop(2);
this[((type + "Skil") + _local2)].addEventListener(MouseEvent.ROLL_OVER, RollOver, false, 0, true);
this[((type + "Skil") + _local2)].addEventListener(MouseEvent.ROLL_OUT, RollOut, false, 0, true);
this[((type + "Leve") + _local2)].gotoAndStop(2);
this[((type + "Leve") + _local2)].addEventListener(MouseEvent.ROLL_OVER, RollOver, false, 0, true);
this[((type + "Leve") + _local2)].addEventListener(MouseEvent.ROLL_OUT, RollOut, false, 0, true);
if (root["charUnlock"][_local2]){
this[((type + "Lock") + _local2)].gotoAndStop(1);
this[((type + "Leve") + _local2)].gotoAndStop(1);
if (root["charLevel"][_local2] < 10){
if (root["charLevel"][_local2] == root["tmpCharLevel"][_local2]){
if (charAvai[_local2]){
SetFilter(this[((type + "Leve") + _local2)]);
} else {
SetFilter(this[((type + "Leve") + _local2)], 0xFFFF00);
};
this[((type + "Leve") + _local2)].buttonMode = true;
this[((type + "Leve") + _local2)].addEventListener(MouseEvent.CLICK, UpgradeLevel, false, 0, true);
nAvaiUp++;
};
};
} else {
this[((type + "Lock") + _local2)].gotoAndStop(2);
if (root["gameLevel"] >= root["canUnlockChar"][_local2]){
if (charAvai[_local2]){
SetFilter(this[((type + "Lock") + _local2)]);
} else {
SetFilter(this[((type + "Lock") + _local2)], 0xFFFF00);
};
this[((type + "Lock") + _local2)].buttonMode = true;
this[((type + "Lock") + _local2)].addEventListener(MouseEvent.CLICK, UnlockChar, false, 0, true);
nAvaiUp++;
};
};
if (!root["charUpgrade"][_local2]){
if (root["charUnlock"][_local2]){
if (charAvai[_local2]){
SetFilter(this[((type + "Skil") + _local2)]);
} else {
SetFilter(this[((type + "Skil") + _local2)], 0xFFFF00);
};
this[((type + "Skil") + _local2)].buttonMode = true;
this[((type + "Skil") + _local2)].addEventListener(MouseEvent.CLICK, UgradeSkill, false, 0, true);
nAvaiUp++;
};
} else {
this[((type + "Skil") + _local2)].gotoAndStop(1);
};
_local2++;
};
if ((((root["baseLevel"] < 10)) && ((root["baseLevel"] == root["tmpBaseLevel"])))){
SetFilter(this[(type + "Castle")]);
this[(type + "Castle")].buttonMode = true;
this[(type + "Castle")].addEventListener(MouseEvent.CLICK, UpgradeCastle, false, 0, true);
nAvaiUp++;
};
this[(type + "Castle")].addEventListener(MouseEvent.ROLL_OVER, CastleRollOver, false, 0, true);
this[(type + "Castle")].addEventListener(MouseEvent.ROLL_OUT, RollOut, false, 0, true);
_local2 = 1;
while (_local2 <= 4) {
if (turretLvlAvai[_local2] > root["baseLevel"]){
this[((type + "Ture") + _local2)].gotoAndStop(2);
} else {
this[((type + "Ture") + _local2)].gotoAndStop(1);
};
this[((type + "Ture") + _local2)].addEventListener(MouseEvent.ROLL_OVER, TurretRollOver, false, 0, true);
this[((type + "Ture") + _local2)].addEventListener(MouseEvent.ROLL_OUT, RollOut, false, 0, true);
_local2++;
};
_local2 = 0;
while (_local2 <= 5) {
this[("btNav" + _local2)].addEventListener(MouseEvent.CLICK, SelectNav, false, 0, true);
_local2++;
};
this["mcUpPoin"].addEventListener(MouseEvent.ROLL_OVER, UpPoinRollOver, false, 0, true);
this["mcUpPoin"].addEventListener(MouseEvent.ROLL_OUT, RollOut, false, 0, true);
trace(("nup" + nAvaiUp));
if (root["myUpPoin"] > nAvaiUp){
root["myUpPoin"] = nAvaiUp;
};
this["txUpPoin"].text = root["myUpPoin"];
}
private function RollOut(_arg1:MouseEvent):void{
HideTooltip();
}
}
}//package uiscr
Section 159
//Archer (Archer)
package {
public dynamic class Archer extends CRangeUnit {
}
}//package
Section 160
//Baloon1 (Baloon1)
package {
public dynamic class Baloon1 extends CRangeAirUnit {
}
}//package
Section 161
//Baloon2 (Baloon2)
package {
public dynamic class Baloon2 extends CRangeAirUnit {
}
}//package
Section 162
//Base1 (Base1)
package {
import flash.display.*;
public dynamic class Base1 extends MovieClip {
}
}//package
Section 163
//Base11 (Base11)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class Base11 extends CBase {
public function Base11(){
addFrameScript(1, frame2, 7, frame8, 13, frame14, 24, frame25);
}
function frame14(){
this["root"].PlaySound("21");
}
function frame8(){
this["root"].PlaySound("21");
}
function frame25(){
stop();
}
function frame2(){
this["root"].PlaySound("21");
}
}
}//package
Section 164
//Base12 (Base12)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class Base12 extends CBase {
public function Base12(){
addFrameScript(1, frame2, 7, frame8, 13, frame14, 24, frame25);
}
function frame14(){
this["root"].PlaySound("21");
}
function frame8(){
this["root"].PlaySound("21");
}
function frame25(){
stop();
}
function frame2(){
this["root"].PlaySound("21");
}
}
}//package
Section 165
//Base13 (Base13)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class Base13 extends CBase {
public function Base13(){
addFrameScript(1, frame2, 7, frame8, 13, frame14, 24, frame25);
}
function frame14(){
this["root"].PlaySound("21");
}
function frame8(){
this["root"].PlaySound("21");
}
function frame25(){
stop();
}
function frame2(){
this["root"].PlaySound("21");
}
}
}//package
Section 166
//Base2 (Base2)
package {
import flash.display.*;
public dynamic class Base2 extends MovieClip {
}
}//package
Section 167
//Base21 (Base21)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class Base21 extends CBase {
public function Base21(){
addFrameScript(1, frame2, 7, frame8, 13, frame14, 24, frame25);
}
function frame14(){
this["root"].PlaySound("21");
}
function frame8(){
this["root"].PlaySound("21");
}
function frame25(){
stop();
}
function frame2(){
this["root"].PlaySound("21");
}
}
}//package
Section 168
//Base22 (Base22)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class Base22 extends CBase {
public function Base22(){
addFrameScript(1, frame2, 7, frame8, 13, frame14, 24, frame25);
}
function frame14(){
this["root"].PlaySound("21");
}
function frame8(){
this["root"].PlaySound("21");
}
function frame25(){
stop();
}
function frame2(){
this["root"].PlaySound("21");
}
}
}//package
Section 169
//Base23 (Base23)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class Base23 extends CBase {
public function Base23(){
addFrameScript(1, frame2, 7, frame8, 13, frame14, 24, frame25);
}
function frame14(){
this["root"].PlaySound("21");
}
function frame8(){
this["root"].PlaySound("21");
}
function frame25(){
stop();
}
function frame2(){
this["root"].PlaySound("21");
}
}
}//package
Section 170
//BaseArea1 (BaseArea1)
package {
public dynamic class BaseArea1 extends CBaseUnit {
}
}//package
Section 171
//BaseArea2 (BaseArea2)
package {
public dynamic class BaseArea2 extends CBaseUnit {
}
}//package
Section 172
//BaseLife (BaseLife)
package {
public dynamic class BaseLife extends CBaseLife {
}
}//package
Section 173
//BGPART11 (BGPART11)
package {
public dynamic class BGPART11 extends CBgContainer {
}
}//package
Section 174
//BGPART12 (BGPART12)
package {
public dynamic class BGPART12 extends CBgPart {
}
}//package
Section 175
//BGPART13 (BGPART13)
package {
public dynamic class BGPART13 extends CBgPart {
}
}//package
Section 176
//BGPART14 (BGPART14)
package {
public dynamic class BGPART14 extends CBgPart {
}
}//package
Section 177
//BGPART15 (BGPART15)
package {
public dynamic class BGPART15 extends CBgContainer {
}
}//package
Section 178
//BGPART16 (BGPART16)
package {
public dynamic class BGPART16 extends CBgPart {
}
}//package
Section 179
//BGPART17 (BGPART17)
package {
public dynamic class BGPART17 extends CBgPart {
}
}//package
Section 180
//BGPART21 (BGPART21)
package {
public dynamic class BGPART21 extends CBgContainer {
}
}//package
Section 181
//BGPART22 (BGPART22)
package {
public dynamic class BGPART22 extends CBgPart {
}
}//package
Section 182
//BGPART31 (BGPART31)
package {
public dynamic class BGPART31 extends CBgContainer {
}
}//package
Section 183
//BGPART32 (BGPART32)
package {
public dynamic class BGPART32 extends CBgPart {
}
}//package
Section 184
//BGPART33 (BGPART33)
package {
public dynamic class BGPART33 extends CBgPart {
}
}//package
Section 185
//BGPART41 (BGPART41)
package {
public dynamic class BGPART41 extends CBgContainer {
}
}//package
Section 186
//BGPART42 (BGPART42)
package {
public dynamic class BGPART42 extends CBgPart {
}
}//package
Section 187
//BGPART43 (BGPART43)
package {
public dynamic class BGPART43 extends CBgPart {
}
}//package
Section 188
//BGPART44 (BGPART44)
package {
public dynamic class BGPART44 extends CBgContainer {
}
}//package
Section 189
//BGPART45 (BGPART45)
package {
public dynamic class BGPART45 extends CBgPart {
}
}//package
Section 190
//BGPART46 (BGPART46)
package {
public dynamic class BGPART46 extends CBgPart {
}
}//package
Section 191
//BGPART51 (BGPART51)
package {
public dynamic class BGPART51 extends CBgContainer {
}
}//package
Section 192
//BGPART52 (BGPART52)
package {
public dynamic class BGPART52 extends CBgPart {
}
}//package
Section 193
//BGPART61 (BGPART61)
package {
public dynamic class BGPART61 extends CBgContainer {
}
}//package
Section 194
//BGPART62 (BGPART62)
package {
public dynamic class BGPART62 extends CBgPart {
}
}//package
Section 195
//BGPART63 (BGPART63)
package {
public dynamic class BGPART63 extends CBgPart {
}
}//package
Section 196
//BloEff (BloEff)
package {
import flash.display.*;
public dynamic class BloEff extends MovieClip {
public function BloEff(){
addFrameScript(0, frame1, 10, frame11);
}
function frame1(){
stop();
}
function frame11(){
x = -100;
y = -100;
stop();
}
}
}//package
Section 197
//BurEff (BurEff)
package {
import flash.display.*;
public dynamic class BurEff extends MovieClip {
public function BurEff(){
addFrameScript(0, frame1, 17, frame18);
}
function frame18(){
x = -100;
y = -100;
stop();
}
function frame1(){
stop();
}
}
}//package
Section 198
//CAiAttrib (CAiAttrib)
package {
import flash.net.*;
import flash.xml.*;
public class CAiAttrib {
private var charAttrib:CCharAttrib;
private var unitData:XML;
private var objId:Object;
private var arenaColl:Array;
public function CAiAttrib(){
unitData = <aiunit>
<char>
<unit spwn_lvl="1" lnd_cmp="1" sea_cmp="0" air_cmp="1" skll_lvl="6">swordman</unit>
<unit spwn_lvl="5" lnd_cmp="1" sea_cmp="0" air_cmp="1" skll_lvl="11">spearman</unit>
<unit spwn_lvl="14" lnd_cmp="1" sea_cmp="0" air_cmp="1" skll_lvl="12">knight</unit>
<unit spwn_lvl="19" lnd_cmp="1" sea_cmp="0" air_cmp="1" skll_lvl="24">paladin</unit>
<unit spwn_lvl="2" lnd_cmp="1" sea_cmp="0" air_cmp="1" skll_lvl="11">archer</unit>
<unit spwn_lvl="11" lnd_cmp="1" sea_cmp="0" air_cmp="1" skll_lvl="18">catapult</unit>
<unit spwn_lvl="25" lnd_cmp="1" sea_cmp="0" air_cmp="1" skll_lvl="28">cannon</unit>
<unit spwn_lvl="1" lnd_cmp="0" sea_cmp="1" air_cmp="1" skll_lvl="7">baloon1</unit>
<unit spwn_lvl="8" lnd_cmp="0" sea_cmp="1" air_cmp="1" skll_lvl="13">baloon2</unit>
<unit spwn_lvl="16" lnd_cmp="0" sea_cmp="1" air_cmp="1" skll_lvl="21">plane1</unit>
<unit spwn_lvl="24" lnd_cmp="0" sea_cmp="1" air_cmp="1" skll_lvl="27">plane2</unit>
<unit spwn_lvl="1" lnd_cmp="0" sea_cmp="1" air_cmp="0" skll_lvl="6">vikingship</unit>
<unit spwn_lvl="5" lnd_cmp="0" sea_cmp="1" air_cmp="0" skll_lvl="9">romanship</unit>
<unit spwn_lvl="13" lnd_cmp="0" sea_cmp="1" air_cmp="0" skll_lvl="20">persianship</unit>
<unit spwn_lvl="21" lnd_cmp="0" sea_cmp="1" air_cmp="0" skll_lvl="24">greekship</unit>
</char>
<char>
<unit spwn_lvl="1" lnd_cmp="1" sea_cmp="0" air_cmp="1" skll_lvl="7">zombie</unit>
<unit spwn_lvl="6" lnd_cmp="1" sea_cmp="0" air_cmp="1" skll_lvl="12">vampire</unit>
<unit spwn_lvl="14" lnd_cmp="1" sea_cmp="0" air_cmp="1" skll_lvl="18">ogre</unit>
<unit spwn_lvl="20" lnd_cmp="1" sea_cmp="0" air_cmp="1" skll_lvl="25">darkevil</unit>
<unit spwn_lvl="2" lnd_cmp="1" sea_cmp="0" air_cmp="1" skll_lvl="10">skeleton</unit>
<unit spwn_lvl="10" lnd_cmp="1" sea_cmp="0" air_cmp="1" skll_lvl="17">darkelf</unit>
<unit spwn_lvl="24" lnd_cmp="1" sea_cmp="0" air_cmp="1" skll_lvl="27">wizard</unit>
<unit spwn_lvl="1" lnd_cmp="0" sea_cmp="1" air_cmp="1" skll_lvl="6">dracula</unit>
<unit spwn_lvl="7" lnd_cmp="0" sea_cmp="1" air_cmp="1" skll_lvl="12">eagle</unit>
<unit spwn_lvl="15" lnd_cmp="0" sea_cmp="1" air_cmp="1" skll_lvl="20">ghost</unit>
<unit spwn_lvl="23" lnd_cmp="0" sea_cmp="1" air_cmp="1" skll_lvl="26">dragon</unit>
<unit spwn_lvl="1" lnd_cmp="0" sea_cmp="1" air_cmp="0" skll_lvl="8">shark</unit>
<unit spwn_lvl="6" lnd_cmp="0" sea_cmp="1" air_cmp="0" skll_lvl="10">whale</unit>
<unit spwn_lvl="14" lnd_cmp="0" sea_cmp="1" air_cmp="0" skll_lvl="21">godship</unit>
<unit spwn_lvl="22" lnd_cmp="0" sea_cmp="1" air_cmp="0" skll_lvl="25">ghostship</unit>
</char>
</aiunit>
;
arenaColl = ["lnd_cmp", "sea_cmp", "air_cmp", "lnd_cmp", "lnd_cmp", "sea_cmp", "air_cmp", "lnd_cmp"];
charAttrib = new CCharAttrib();
super();
}
private function InitId():void{
}
public function GetAvailableObj(_arg1:int, _arg2:int, _arg3:int):Array{
var _local4:Object;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:String;
var _local10:Array;
var _local11:String;
var _local12:int;
_local8 = unitData.children()[(_arg1 - 1)].children().length();
_local10 = new Array();
_local9 = arenaColl[_arg2];
_local12 = 0;
while (_local12 < _local8) {
_local5 = int(unitData.children()[(_arg1 - 1)].children()[_local12].attribute("spwn_lvl"));
_local6 = int(unitData.children()[(_arg1 - 1)].children()[_local12].attribute(_local9));
_local7 = int(unitData.children()[(_arg1 - 1)].children()[_local12].attribute("skll_lvl"));
if ((((_local5 <= _arg3)) && (_local6))){
_local11 = String(unitData.children()[(_arg1 - 1)].children()[_local12]);
_local4 = new Object();
_local4.stime = charAttrib.GetAttribute(_local11, "spwn");
_local4.price = charAttrib.GetAttribute(_local11, "price");
_local4.skill = _local7;
_local4.unit = (_local11.charAt(0).toUpperCase() + _local11.substr(1));
_local10.push(_local4);
};
_local12++;
};
return (_local10);
}
}
}//package
Section 199
//CAirUnit (CAirUnit)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.media.*;
import fl.transitions.easing.*;
public class CAirUnit extends MovieClip {
public var px:int;
public var isAttack:Boolean;// = false
public var isIdle:Boolean;// = false
public var lvl:int;
private var isStop:Boolean;// = false
public var isBounce:Boolean;
public var skill:int;
public var arm:int;
public var speed:Number;
public var unitTyp:String;
public var curPx:int;
public var isDefend:Boolean;// = false
public var tacticType:int;
private var dx:Number;
private var dy:Number;
public var att:int;
public var skillTyp:int;
public var mainTarget:Number;
public var fBound:Number;
public var forceSpd:Number;
public var attrib:Array;
public var targetO:Object;
public var sPos:int;
public var bodyH:Number;
public var targetX:Number;
public var targetY:Number;
public var bodyW:Number;
public var life:int;
public var isDie:Boolean;
public var attCnt:int;
public var child:Object;
public var isBack:Boolean;// = false
public var isRetreat:Boolean;// = false
public var curSpd:Number;
public var price:int;
public var isAlly:Boolean;
public var runTimer:Timer;
public var attType:uint;
private var afterPause:Boolean;
public var defaultSpd:Number;
public var spd:int;
public var rng:Number;
public var nm:String;
public var hasSkill:Boolean;
public var destX:Number;
public var defTarget:Number;
public function CAirUnit(){
isAttack = false;
isIdle = false;
isBack = false;
isRetreat = false;
isDefend = false;
isStop = false;
super();
gotoAndStop(1);
isDie = true;
bodyW = (this["mcHP"].width / 2);
bodyH = (this["mcHP"].height / 2);
}
public function IsThereCloseTarget():Boolean{
var _local1:Boolean;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
_local1 = false;
if (isAlly){
if (sPos == 0){
_local2 = int((x / 50));
_local4 = (x + 250);
_local3 = int((_local4 / 50));
_local5 = _local2;
while (_local5 <= _local3) {
if (root["bgContainer"]["enmyColl"][_local5].length > 0){
_local1 = true;
break;
} else {
_local1 = false;
};
_local5++;
};
} else {
_local4 = (x - 250);
_local2 = int((_local4 / 50));
_local3 = int((x / 50));
_local5 = _local2;
while (_local5 <= _local3) {
if (root["bgContainer"]["enmyColl"][_local5].length > 0){
_local1 = true;
break;
} else {
_local1 = false;
};
_local5++;
};
};
} else {
if (sPos == 0){
_local2 = int((x / 50));
_local4 = (x + 250);
_local3 = int((_local4 / 50));
_local5 = _local2;
while (_local5 <= _local3) {
if (root["bgContainer"]["allyColl"][_local5].length > 0){
_local1 = true;
break;
} else {
_local1 = false;
};
_local5++;
};
} else {
_local4 = (x - 250);
_local2 = int((_local4 / 50));
_local3 = int((x / 50));
_local5 = _local2;
while (_local5 <= _local3) {
if (root["bgContainer"]["allyColl"][_local5].length > 0){
_local1 = true;
break;
} else {
_local1 = false;
};
_local5++;
};
};
};
return (_local1);
}
public function CheckAvaiEnemy():void{
}
public function Moving(_arg1:Event):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
if (root["isStopGame"]){
if (runTimer != null){
runTimer.stop();
runTimer.removeEventListener(TimerEvent.TIMER, Moving);
};
child = DisplayObject(getChildAt(0));
if (child != null){
child.gotoAndStop(1);
};
return;
};
if (!root["isPause"]){
if (afterPause){
afterPause = false;
child = DisplayObject(getChildAt(0));
if (child != null){
child.play();
};
};
if (isDie){
if (((!(root["firstKill"])) && (!(isAlly)))){
root["firstKill"] = true;
this["root"].SetNGMedal(1);
};
speed = 0;
if (currentLabel != "die"){
gotoAndStop("die");
};
if (runTimer != null){
runTimer.stop();
runTimer.removeEventListener(TimerEvent.TIMER, Moving);
};
};
if (!isAttack){
_local2 = y;
_local3 = 0;
_local4 = (x - destX);
if (!isStop){
if (x > destX){
scaleX = -1;
} else {
scaleX = 1;
};
};
_local5 = (-(Math.atan2(_local4, _local3)) / (Math.PI / 180));
dy = (speed * Math.cos((_local5 * (Math.PI / 180))));
dx = (speed * Math.sin((_local5 * (Math.PI / 180))));
if (Math.sqrt(((_local4 * _local4) + (_local3 * _local3))) > speed){
x = (x + (dx / 2));
} else {
if (tacticType == 0){
if (!isStop){
DefendTheBase();
isStop = true;
isDefend = true;
isRetreat = false;
isIdle = false;
speed = curSpd;
};
} else {
if (tacticType == 1){
isIdle = true;
CheckAvaiEnemy();
isDefend = false;
} else {
if ((((tacticType == 2)) || ((tacticType == 3)))){
isDefend = false;
};
};
};
};
};
UpdateThis();
if (root["isStopGame"]){
runTimer.stop();
runTimer.removeEventListener(TimerEvent.TIMER, Moving);
child = DisplayObject(getChildAt(0));
if (child != null){
child.gotoAndStop(1);
};
};
} else {
if (!afterPause){
afterPause = true;
child = DisplayObject(getChildAt(0));
if (child != null){
child.stop();
};
};
};
}
public function SetDestination(_arg1:int):void{
if (_arg1 == 0){
if (sPos == 0){
destX = 275;
} else {
destX = 1325;
};
destX = (destX + (RandomNum(1, 10) * RandomNum(-1, 1)));
if (isAttack){
StopAttack();
};
isRetreat = true;
if ((((sPos == 0)) && ((x < destX)))){
isRetreat = false;
} else {
if ((((sPos == 1)) && ((x > destX)))){
isRetreat = false;
};
};
} else {
if (_arg1 == 1){
if (sPos == 0){
destX = (x + 125);
destX = (destX + (RandomNum(1, 10) * RandomNum(-1, 1)));
if (destX > mainTarget){
destX = mainTarget;
};
} else {
destX = (x - 125);
destX = (destX + (RandomNum(1, 10) * RandomNum(-1, 1)));
if (destX < mainTarget){
destX = mainTarget;
};
};
isDefend = false;
isIdle = false;
isRetreat = false;
} else {
if (_arg1 == 2){
destX = mainTarget;
isDefend = false;
isIdle = false;
isRetreat = false;
} else {
if (_arg1 == 3){
destX = mainTarget;
isDefend = false;
isIdle = false;
isRetreat = false;
if (!isAlly){
if (attType == 0){
root["bgContainer"].RemoveArrValue(root["bgContainer"]["aiMeleeColl"], this);
} else {
root["bgContainer"].RemoveArrValue(root["bgContainer"]["aiRangeColl"], this);
};
};
};
};
};
};
if (!isAttack){
child = DisplayObject(getChildAt(0));
if (child != null){
child.play();
};
isStop = false;
};
if (isDie){
if (currentLabel != "die"){
gotoAndStop("die");
};
};
}
public function Remove():void{
if (!isAlly){
if (attType == 0){
root["bgContainer"].RemoveArrValue(root["bgContainer"]["aiMeleeColl"], this);
} else {
root["bgContainer"].RemoveArrValue(root["bgContainer"]["aiRangeColl"], this);
};
root["bgContainer"].RemoveArrValue(root["bgContainer"]["allAiColl"], this);
var _local1 = root;
var _local2 = "aiTroopOut";
var _local3 = (_local1[_local2] - 1);
_local1[_local2] = _local3;
if (root["aiTroopOut"] < 0){
root["aiTroopOut"] = 0;
};
if (root["aiTroop"] < root["maxTroop"]){
root["bgContainer"].AddAiPopTroop();
};
} else {
_local1 = root;
_local2 = "myTroopOut";
_local3 = (_local1[_local2] - 1);
_local1[_local2] = _local3;
if (root["myTroopOut"] < 0){
root["myTroopOut"] = 0;
};
if (root["myTroop"] < root["maxTroop"]){
root["bgContainer"].AddMyPopTroop();
};
};
gotoAndStop(1);
x = -600;
}
public function StopAttack():void{
}
public function DefendTheBase():void{
if (sPos == 0){
if (scaleX == -1){
scaleX = 1;
};
} else {
if (scaleX == 1){
scaleX = -1;
};
};
if (!isAlly){
if (attType == 0){
root["bgContainer"]["aiMeleeColl"].push(this);
} else {
root["bgContainer"]["aiRangeColl"].push(this);
};
};
}
public function UpdateThis():void{
}
public function Init(_arg1:String, _arg2:int, _arg3:Boolean, _arg4:int, _arg5:Boolean, _arg6:int):void{
isAlly = _arg3;
lvl = _arg4;
hasSkill = _arg5;
isDie = false;
isAttack = false;
isIdle = false;
isBack = false;
isRetreat = false;
isDefend = false;
isStop = false;
gotoAndStop(1);
sPos = _arg2;
if (sPos == 0){
x = ((0 - (width / 2)) - RandomNum(0, 5));
mainTarget = 1500;
defTarget = (150 + 125);
} else {
x = ((1600 + (width / 2)) + RandomNum(0, 5));
mainTarget = 100;
defTarget = (1450 - 125);
};
if ((((_arg1 == "dracula")) || ((_arg1 == "ghost")))){
y = -240;
} else {
if (_arg1 == "eagle"){
y = -300;
} else {
y = -360;
};
};
destX = mainTarget;
SetAttributes(_arg1);
if (_arg6 == -1){
if (root["aiStrategy"] == 0){
tacticType = 0;
} else {
if (root["aiStrategy"] == 1){
if (attType == 0){
if (RandomNum(1, 2) == 1){
tacticType = 0;
} else {
tacticType = 2;
};
} else {
if (RandomNum(1, 4) == 1){
tacticType = 0;
} else {
tacticType = 1;
};
};
} else {
if (root["aiStrategy"] == 2){
tacticType = 3;
};
};
};
} else {
tacticType = _arg6;
};
SetDestination(tacticType);
forceSpd = 0.25;
speed = ((defaultSpd * forceSpd) * 1.5);
curSpd = speed;
px = int((x / 50));
if (px < 0){
px = 0;
} else {
if (px > 31){
px = 31;
};
};
curPx = px;
mouseEnabled = false;
afterPause = false;
}
public function SetAttributes(_arg1:String):void{
}
public function GetAngle(_arg1:Number, _arg2:Number):Number{
return (((Math.atan2(_arg2, _arg1) * 180) / Math.PI));
}
public function GetDistance(_arg1:Number, _arg2:Number):Number{
return (Math.sqrt(((_arg1 * _arg1) + (_arg2 * _arg2))));
}
public function GetAvailableTarget(_arg1:Array):Object{
var _local2:int;
var _local3:Object;
_local2 = _arg1.length;
_local3 = null;
if (_local2 == 1){
_local3 = _arg1[0];
} else {
if (_local2 > 1){
_local3 = _arg1[RandomNum(0, (_local2 - 1))];
};
};
if (_local3 != null){
if (_local3.isDie){
_local3 = null;
};
};
return (_local3);
}
public function RandomNum(_arg1:Number, _arg2:Number):Number{
return ((Math.floor((Math.random() * ((_arg2 - _arg1) + 1))) + _arg1));
}
public function Retreat():void{
}
}
}//package
Section 200
//Cannon (Cannon)
package {
public dynamic class Cannon extends CRangeUnit {
}
}//package
Section 201
//Catapult (Catapult)
package {
public dynamic class Catapult extends CRangeUnit {
}
}//package
Section 202
//CBase (CBase)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.media.*;
import fl.transitions.easing.*;
public class CBase extends MovieClip {
public var turret3:TurretM3;
public var turret4:TurretM4;
public var turret5:TurretD1;
public var turret1:TurretM1;
public var turret8:TurretD4;
public var turret7:TurretD3;
public var turret2:TurretM2;
public var turret6:TurretD2;
public function InitDarkTurret(_arg1:int, _arg2:int, _arg3:Boolean){
var _local4:int;
_local4 = 1;
while (_local4 <= 4) {
this[("turret" + (_local4 + 4))].visible = false;
_local4++;
};
if (_arg1 == 0){
return;
};
if (_arg1 > 4){
_arg1 = 4;
};
_local4 = 1;
while (_local4 <= _arg1) {
this[("turret" + (_local4 + 4))].visible = true;
this[("turret" + (_local4 + 4))].Init((_local4 + 4), _arg2, _arg3);
_local4++;
};
}
public function InitMedTurret(_arg1:int, _arg2:int, _arg3:Boolean){
var _local4:int;
_local4 = 1;
while (_local4 <= 4) {
this[("turret" + _local4)].visible = false;
_local4++;
};
trace(("turret" + _arg1));
if (_arg1 == 0){
return;
};
if (_arg1 > 4){
_arg1 = 4;
};
_local4 = 1;
while (_local4 <= _arg1) {
this[("turret" + _local4)].visible = true;
this[("turret" + _local4)].Init(_local4, _arg2, _arg3);
_local4++;
};
}
}
}//package
Section 203
//CBaseLife (CBaseLife)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.text.*;
public class CBaseLife extends MovieClip {
private var lifeRem:int;
private var life:int;
public var mcBar:MovieClip;
private var dp:Number;
public function Init(_arg1:int):void{
life = _arg1;
lifeRem = _arg1;
dp = 0;
this["mcBar"].x = 0;
UpdateHp(0);
}
public function GetLeftHp():int{
return (lifeRem);
}
public function MaxHp():int{
return (life);
}
private function RandomNum(_arg1:Number, _arg2:Number):Number{
return ((Math.floor((Math.random() * ((_arg2 - _arg1) + 1))) + _arg1));
}
public function UpdateHp(_arg1:int):void{
lifeRem = (lifeRem - Math.abs(_arg1));
if (lifeRem < 0){
lifeRem = 0;
this["mcBar"].x = -150;
return;
};
dp = (life / 150);
this["mcBar"].x = (this["mcBar"].x - Math.round((Math.abs(_arg1) / dp)));
if (this["mcBar"].x < -150){
this["mcBar"].x = -150;
};
}
}
}//package
Section 204
//CBaseUnit (CBaseUnit)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.media.*;
import fl.transitions.easing.*;
public class CBaseUnit extends MovieClip {
public var bodyW:Number;
private var life:Number;
private var id:int;
public var mcHP:MovieClip;
private var delay:Timer;
public var bodyH:Number;
public function Init(_arg1:int){
id = _arg1;
bodyW = (this["mcHP"].width / 2);
bodyH = (this["mcHP"].height / 2);
if (root["baseType"] == 1){
if (_arg1 == 1){
life = this["root"].GetBaseHp(root["baseLevel"]);
} else {
life = this["root"].GetBaseHp(this["root"].GetAiLvl(root["gameLevel"]));
};
} else {
if (_arg1 == 1){
life = this["root"].GetBaseHp(this["root"].GetAiLvl(root["gameLevel"]));
} else {
life = this["root"].GetBaseHp(root["baseLevel"]);
};
};
}
public function BounceThis(_arg1:Number, _arg2:int):void{
}
public function SetDamage(_arg1:int, _arg2:Boolean=false):void{
var _local3:int;
var _local4:Object;
var _local5:int;
var _local6:int;
if (!root["isStopGame"]){
root["charPanel"].UpdateBaseHp(id, _arg1);
_local3 = 10;
if (id == root["baseType"]){
_local5 = root["nTurret"];
} else {
_local5 = parent["nAiTurret"];
};
_local6 = 0;
while (_local6 < _local5) {
if (GetLife() <= Number(((life * _local3) / 100))){
_local4 = root["bgContainer"].getChildByName(("base" + id));
if (id == 1){
_local4[("turret" + int((_local6 + 1)))].Stop();
} else {
_local4[("turret" + int(((_local6 + 1) + 4)))].Stop();
};
break;
};
_local3 = (_local3 + 20);
_local6++;
};
if (GetLife() <= 0){
_local4 = root["bgContainer"].getChildByName(("base" + id));
_local4.gotoAndPlay("destroy");
if (root["baseType"] == id){
root["win"] = 2;
} else {
root["win"] = 1;
};
this["root"].StopGame();
delay = new Timer(1000, 3);
delay.start();
delay.addEventListener(TimerEvent.TIMER_COMPLETE, ShowResult, false, 0, true);
};
};
}
public function GetLife():int{
return (root["charPanel"].GetBaseHp(id));
}
private function ShowResult(_arg1:TimerEvent):void{
delay.stop();
delay.removeEventListener(TimerEvent.TIMER_COMPLETE, ShowResult);
this["root"].ShowScreen("Result");
}
public function GetPoison():void{
}
}
}//package
Section 205
//CBgContainer (CBgContainer)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class CBgContainer extends MovieClip {
public var allyColl:Array;
public var missileContainer:MovieClip;
private var objRef:Class;
public var targetColl:Array;
private var ac:int;// = 1
private var mcExpEcnt:int;
private var mcFroEcnt:int;
public var allAiColl:Array;
public var SXPOS1:Number;// = 125
public var SXPOS2:Number;// = 1500
public var unitColl:Array;
public var aiRangeColl:Array;
public var enmyColl:Array;
private var aiQueque:Array;
private var nGroup:uint;
public var base:Object;
public var levelObj:Object;
private var tEff:Timer;
private var WSTAGE:int;
public var turret:Object;
private var tMyPop:Timer;
public var nUnit:int;// = 0
public var aiAttrib:CAiAttrib;
private var mcDPcounter:int;// = 0
public var aiMeleeColl:Array;
private var char:Object;
public var charColl:Array;
private var mcBloEcnt:int;
private var aiCreateChance:uint;
private var mcBurEcnt:int;
private var spd:Number;// = 0
public var charAttrib:CCharAttrib;
private var charCounter:Object;
private var charContainer:MovieClip;
public var nAiTurret:int;
private var mcPoiEcnt:int;
public var damageContainer:MovieClip;
public var turetContainer:MovieClip;
public var effectContainer:MovieClip;
private var tQueque:Timer;
public function CBgContainer(){
SXPOS1 = 125;
SXPOS2 = 1500;
spd = 0;
ac = 1;
unitColl = new Array();
nUnit = 0;
targetColl = [[], [300, 1400], [1300, 200]];
mcDPcounter = 0;
aiQueque = new Array();
super();
WSTAGE = 800;
mouseEnabled = false;
mouseChildren = false;
}
private function CreateMcEffect():void{
var _local1:Class;
var _local2:Object;
var _local3:int;
mcBloEcnt = 0;
mcExpEcnt = 30;
mcBurEcnt = 60;
mcFroEcnt = 90;
mcPoiEcnt = 120;
effectContainer = new MovieClip();
addChild(effectContainer);
_local3 = 0;
while (_local3 < 30) {
_local1 = (getDefinitionByName("BloEff") as Class);
_local2 = new (_local1);
effectContainer.addChild(DisplayObject(_local2));
effectContainer.setChildIndex(DisplayObject(_local2), _local3);
_local2.x = -100;
_local2.y = -100;
_local2.gotoAndStop(1);
_local3++;
};
_local3 = 30;
while (_local3 < 60) {
_local1 = (getDefinitionByName("ExpEff") as Class);
_local2 = new (_local1);
effectContainer.addChild(DisplayObject(_local2));
effectContainer.setChildIndex(DisplayObject(_local2), _local3);
_local2.x = -100;
_local2.y = -100;
_local2.gotoAndStop(1);
_local3++;
};
_local3 = 60;
while (_local3 < 90) {
_local1 = (getDefinitionByName("BurEff") as Class);
_local2 = new (_local1);
effectContainer.addChild(DisplayObject(_local2));
effectContainer.setChildIndex(DisplayObject(_local2), _local3);
_local2.x = -100;
_local2.y = -100;
_local2.gotoAndStop(1);
_local3++;
};
_local3 = 90;
while (_local3 < 120) {
_local1 = (getDefinitionByName("FroEff") as Class);
_local2 = new (_local1);
effectContainer.addChild(DisplayObject(_local2));
effectContainer.setChildIndex(DisplayObject(_local2), _local3);
_local2.x = -100;
_local2.y = -100;
_local2.gotoAndStop(1);
_local3++;
};
_local3 = 120;
while (_local3 < 150) {
_local1 = (getDefinitionByName("PoiEff") as Class);
_local2 = new (_local1);
effectContainer.addChild(DisplayObject(_local2));
effectContainer.setChildIndex(DisplayObject(_local2), _local3);
_local2.x = -100;
_local2.y = -100;
_local2.gotoAndStop(1);
_local3++;
};
}
private function CreateAiUnit(_arg1:TimerEvent):void{
var _local2:int;
var _local3:int;
if (!root["isPause"]){
if (root["isStopGame"]){
return;
};
_local2 = tQueque.currentCount;
_local3 = 0;
while (_local3 < root["aiColl"].length) {
if (((((_local2 % root["aiColl"][_local3].stime) == 0)) && ((RandomNum(1, aiCreateChance) == 1)))){
if ((((((root["aiGold"] > root["aiColl"][_local3].price)) && ((root["aiTroop"] > 0)))) && ((root["aiTroopOut"] < root["maxTroop"])))){
if (root["baseType"] == 1){
ProdChar2(root["aiColl"][_local3].id, false, this["root"].GetAiLvl(root["gameLevel"]), root["aiColl"][_local3].skill);
} else {
ProdChar(root["aiColl"][_local3].id, false, this["root"].GetAiLvl(root["gameLevel"]), root["aiColl"][_local3].skill);
};
root["aiGold"] = (root["aiGold"] - root["aiColl"][_local3].price);
var _local4 = root;
var _local5 = "aiTroop";
var _local6 = (_local4[_local5] - 1);
_local4[_local5] = _local6;
_local4 = root;
_local5 = "aiTroopOut";
_local6 = (_local4[_local5] + 1);
_local4[_local5] = _local6;
root["charPanel"]["txGold2"].text = root["aiGold"];
root["charPanel"].ShowTroopData(2, root["aiTroop"]);
};
};
if ((_local2 % 5) == 0){
if (root["aiStrategy"] == 0){
if (root["aiTroopOut"] == root["maxTroop"]){
if (aiMeleeColl.length >= nGroup){
SetCharToMove(aiMeleeColl, aiMeleeColl.length);
};
if (aiRangeColl.length >= nGroup){
SetCharToMove(aiRangeColl, aiRangeColl.length);
};
};
} else {
if (root["aiStrategy"] == 1){
if (aiMeleeColl.length >= nGroup){
SetCharToMove(aiMeleeColl, nGroup);
};
if (aiRangeColl.length >= nGroup){
SetCharToMove(aiRangeColl, nGroup);
};
} else {
if (root["aiStrategy"] == 2){
};
};
};
};
_local3++;
};
};
}
public function ScrollBg(_arg1:int):void{
if (_arg1 == 1){
if (spd < 0){
spd = (spd * -1);
};
x = (x + (spd * ac));
} else {
if (_arg1 == 2){
if (spd > 0){
spd = (spd * -1);
};
x = (x + (spd * ac));
} else {
if (_arg1 == 0){
};
};
};
if (x > 0){
x = 0;
root["atBound"] = true;
} else {
if (x < (WSTAGE - 1600)){
x = (WSTAGE - 1600);
root["atBound"] = true;
};
};
}
public function Stop():void{
if (tQueque != null){
tQueque.stop();
tQueque.removeEventListener(TimerEvent.TIMER, CreateAiUnit);
};
}
public function RemoveArrValue(_arg1:Array, _arg2):void{
var _local3:int;
if (_arg2 == null){
return;
};
_local3 = _arg1.indexOf(_arg2);
if (_local3 != -1){
_arg1.splice(_local3, 1);
};
}
public function ProdChar2(_arg1:String, _arg2:Boolean, _arg3:int, _arg4:Boolean, _arg5:int=-1):void{
var _local6:*;
do {
var _local7 = charCounter;
var _local8 = _arg1;
var _local9 = (_local7[_local8] + 1);
_local7[_local8] = _local9;
if (charCounter[_arg1] >= (root["maxTroop"] + 5)){
charCounter[_arg1] = 0;
};
_local6 = new Object();
_local6 = charContainer.getChildByName((_arg1 + charCounter[_arg1]));
} while (!(_local6.isDie));
_local6.Init(_arg1.toLowerCase(), 1, _arg2, _arg3, _arg4, _arg5);
_local6.scaleX = -1;
if (!_arg2){
allAiColl.push(char);
};
}
private function StopEff(_arg1:TimerEvent):void{
tEff.stop();
tEff.removeEventListener(TimerEvent.TIMER, CreateEff);
tEff.removeEventListener(TimerEvent.TIMER_COMPLETE, StopEff);
}
public function CallDamagePoin(_arg1:Number, _arg2:Number, _arg3:int, _arg4:Number=1):void{
var _local5:Object;
_local5 = damageContainer.getChildAt(mcDPcounter);
_local5.x = _arg1;
_local5.y = _arg2;
_local5.scaleX = _arg4;
_local5.scaleY = _arg4;
_local5.mcCap.txCap.text = String(_arg3);
_local5.play();
mcDPcounter++;
if (mcDPcounter >= 100){
mcDPcounter = 0;
};
}
private function AddAiPopNow(_arg1:TimerEvent):void{
_arg1.currentTarget.stop();
_arg1.currentTarget.removeEventListener(TimerEvent.TIMER_COMPLETE, AddAiPopNow);
_arg1.currentTarget.removeEventListener(TimerEvent.TIMER, AddAiPopOnDelay);
var _local2 = root;
var _local3 = "aiTroop";
var _local4 = (_local2[_local3] + 1);
_local2[_local3] = _local4;
if (root["aiTroop"] > root["maxTroop"]){
root["aiTroop"] = root["maxTroop"];
};
if (root["aiTroopOut"] == root["maxTroop"]){
root["aiTroop"] = 0;
};
root["charPanel"].ShowTroopData(2, root["aiTroop"]);
}
public function AddMyPopTroop():void{
var _local1:Timer;
if (root["myTroopOut"] >= root["maxTroop"]){
return;
};
_local1 = new Timer(1000, 3);
_local1.start();
_local1.addEventListener(TimerEvent.TIMER_COMPLETE, AddMyPopNow, false, 0, true);
_local1.addEventListener(TimerEvent.TIMER, AddMyPopOnDelay, false, 0, true);
}
private function SetDefaultChrLvl():void{
var _local1:Array;
_local1 = new Array();
charAttrib = new CCharAttrib();
}
private function AddAiPopOnDelay(_arg1:TimerEvent):void{
if (root["isStopGame"]){
_arg1.currentTarget.stop();
_arg1.currentTarget.removeEventListener(TimerEvent.TIMER_COMPLETE, AddAiPopNow);
_arg1.currentTarget.removeEventListener(TimerEvent.TIMER, AddAiPopOnDelay);
};
}
private function CreateMcDamagePoin():void{
var _local1:Class;
var _local2:Object;
var _local3:int;
damageContainer = new MovieClip();
addChild(damageContainer);
_local3 = 0;
while (_local3 < 100) {
_local1 = (getDefinitionByName(("DamagePoin" + 1)) as Class);
_local2 = new (_local1);
damageContainer.addChild(DisplayObject(_local2));
_local2.name = ("dp1" + _local3);
_local2.x = -10;
_local2.y = -10;
_local2.gotoAndStop(1);
_local3++;
};
}
public function Update(_arg1:TimerEvent):void{
var _local2:Object;
var _local3:int;
_local3 = 0;
while (_local3 < charContainer.numChildren) {
_local2 = charContainer.getChildAt(_local3);
if (_local2 != null){
_local2.Update();
};
_local3++;
};
}
private function CreateMcUnits1():void{
var _local1:Class;
var _local2:Object;
var _local3:int;
var _local4:int;
_local3 = 0;
while (_local3 < root["myColl"].length) {
charCounter[String(root["myColl"][_local3])] = 0;
_local4 = 0;
while (_local4 < (root["maxTroop"] + 5)) {
_local1 = (getDefinitionByName(root["myColl"][_local3]) as Class);
_local2 = new (_local1);
charContainer.addChild(DisplayObject(_local2));
_local2.name = (String(root["myColl"][_local3]) + _local4);
_local2.x = -600;
_local2.y = -400;
_local4++;
};
_local3++;
};
}
private function CreateMcUnits2():void{
var _local1:Class;
var _local2:Object;
var _local3:int;
var _local4:int;
_local3 = 0;
while (_local3 < root["aiColl"].length) {
charCounter[String(root["aiColl"][_local3].id)] = 0;
_local4 = 0;
while (_local4 < (root["maxTroop"] + 5)) {
_local1 = (getDefinitionByName(root["aiColl"][_local3].id) as Class);
_local2 = new (_local1);
charContainer.addChild(DisplayObject(_local2));
_local2.name = (String(root["aiColl"][_local3].id) + _local4);
_local2.x = -600;
_local2.y = -400;
_local4++;
};
_local3++;
};
}
private function GetQueQue():void{
aiMeleeColl = new Array();
aiRangeColl = new Array();
allAiColl = new Array();
nGroup = ((root["aiTroop"] * 20) / 100);
if (nGroup < 3){
nGroup = 3;
} else {
if (nGroup > 6){
nGroup = 6;
};
};
aiCreateChance = Math.ceil((root["gameLevel"] / 7));
if (aiCreateChance <= 1){
aiCreateChance = 2;
};
tQueque = new Timer(1000);
tQueque.start();
tQueque.addEventListener(TimerEvent.TIMER, CreateAiUnit, false, 0, true);
}
public function AddAiPopTroop():void{
var _local1:Timer;
if (root["aiTroopOut"] >= root["maxTroop"]){
return;
};
_local1 = new Timer(1000, 3);
_local1.start();
_local1.addEventListener(TimerEvent.TIMER_COMPLETE, AddAiPopNow, false, 0, true);
_local1.addEventListener(TimerEvent.TIMER, AddAiPopOnDelay, false, 0, true);
}
public function SetSpeed(_arg1:int):void{
ac = _arg1;
}
public function SetAlphaBase():void{
var _local1:int;
if (root["baseType"] == 1){
_local1 = 0;
while (_local1 < 3) {
getChildByName("base1").alpha = 1;
if (allyColl[_local1].length > 0){
getChildByName("base1").alpha = 0.5;
break;
};
_local1++;
};
_local1 = 31;
while (_local1 > 28) {
getChildByName("base2").alpha = 1;
if (enmyColl[_local1].length > 0){
getChildByName("base2").alpha = 0.5;
break;
};
_local1--;
};
} else {
_local1 = 0;
while (_local1 < 3) {
getChildByName("base1").alpha = 1;
if (enmyColl[_local1].length > 0){
getChildByName("base1").alpha = 0.5;
break;
};
_local1++;
};
_local1 = 31;
while (_local1 > 28) {
getChildByName("base2").alpha = 1;
if (allyColl[_local1].length > 0){
getChildByName("base2").alpha = 0.5;
break;
};
_local1--;
};
};
}
public function Init(_arg1:int, _arg2:int, _arg3:Number):void{
var _local4:int;
var _local5:int;
var _local6:int;
_local4 = this["root"].GetAiLvl(root["gameLevel"]);
if (_local4 >= 9){
nAiTurret = 4;
} else {
if (_local4 >= 7){
nAiTurret = 3;
} else {
if (_local4 >= 5){
nAiTurret = 2;
} else {
if (_local4 >= 3){
nAiTurret = 1;
};
};
};
};
spd = _arg3;
charContainer = new MovieClip();
addChild(charContainer);
missileContainer = new MovieClip();
addChild(missileContainer);
allyColl = new Array();
enmyColl = new Array();
_local5 = 0;
while (_local5 < 32) {
allyColl[_local5] = new Array();
enmyColl[_local5] = new Array();
_local5++;
};
charColl = new Array();
_local5 = 0;
while (_local5 < 30) {
charColl[_local5] = new Array();
_local5++;
};
objRef = (getDefinitionByName(("Base1" + _arg2)) as Class);
base = new objRef();
addChild(DisplayObject(base));
base.name = "base1";
base.gotoAndStop(1);
base.x = 0;
base.y = -110;
if (_arg1 == 1){
base.InitMedTurret(root["nTurret"], 0, true);
} else {
base.InitMedTurret(nAiTurret, 0, false);
};
objRef = (getDefinitionByName("BaseArea1") as Class);
base = new objRef();
addChild(DisplayObject(base));
base.name = "baseArea1";
base.x = SXPOS1;
base.y = -140;
base.visible = false;
base.Init(1);
_local6 = int(((base.x + (base.width / 2)) / 50));
if (_arg1 == 1){
allyColl[_local6].push(base);
} else {
enmyColl[_local6].push(base);
};
objRef = (getDefinitionByName(("Base2" + _arg2)) as Class);
base = new objRef();
addChild(DisplayObject(base));
base.name = "base2";
base.gotoAndStop(1);
base.x = 1600;
base.y = -110;
base.scaleX = -1;
if (_arg1 == 1){
base.InitDarkTurret(nAiTurret, 1, false);
} else {
base.InitDarkTurret(root["nTurret"], 1, true);
};
objRef = (getDefinitionByName("BaseArea2") as Class);
base = new objRef();
addChild(DisplayObject(base));
base.name = "baseArea2";
base.x = SXPOS2;
base.y = -140;
base.visible = false;
base.Init(2);
_local6 = int(((base.x - (base.width / 2)) / 50));
if (_arg1 == 1){
enmyColl[_local6].push(base);
} else {
allyColl[_local6].push(base);
};
turetContainer = new MovieClip();
addChild(turetContainer);
CreateMcEffect();
CreateMcDamagePoin();
root["maxTroop"] = (10 + (Math.floor((root["gameLevel"] / 10)) * 5));
root["myTroop"] = root["maxTroop"];
root["aiTroop"] = root["maxTroop"];
charCounter = new Object();
CreateMcUnits1();
CreateMcUnits2();
SetDefaultChrLvl();
GetQueQue();
}
private function AddMyPopNow(_arg1:TimerEvent):void{
_arg1.currentTarget.stop();
_arg1.currentTarget.removeEventListener(TimerEvent.TIMER_COMPLETE, AddMyPopNow);
_arg1.currentTarget.removeEventListener(TimerEvent.TIMER, AddMyPopOnDelay);
var _local2 = root;
var _local3 = "myTroop";
var _local4 = (_local2[_local3] + 1);
_local2[_local3] = _local4;
if (root["myTroop"] > root["maxTroop"]){
root["myTroop"] = root["maxTroop"];
};
if (root["myTroopOut"] == root["maxTroop"]){
root["myTroop"] = 0;
};
root["charPanel"].ShowTroopData(1, root["myTroop"]);
}
private function CreateEff(_arg1:int, _arg2:Number, _arg3:Number):void{
var _local4:Object;
if (root["isStopGame"]){
tEff.stop();
tEff.removeEventListener(TimerEvent.TIMER, CreateEff);
tEff.removeEventListener(TimerEvent.TIMER_COMPLETE, StopEff);
};
if (_arg1 == 2){
_local4 = effectContainer.getChildAt(mcExpEcnt);
_local4.x = (_arg2 + RandomNum(-10, 10));
_local4.y = _arg3;
_local4.scaleX = (_local4.scaleY = (RandomNum(6, 10) / 10));
_local4.gotoAndPlay(2);
mcExpEcnt++;
if (mcExpEcnt >= 60){
mcExpEcnt = 30;
};
this["root"].PlaySound("21");
} else {
if (_arg1 == 5){
_local4 = effectContainer.getChildAt(mcPoiEcnt);
_local4.x = (_arg2 + (RandomNum(-3, 3) * 5));
_local4.y = ((_arg3 - RandomNum(0, 5)) - 10);
_local4.scaleX = (_local4.scaleY = (RandomNum(15, 20) / 10));
_local4.gotoAndPlay(2);
mcPoiEcnt++;
if (mcPoiEcnt >= 150){
mcPoiEcnt = 120;
};
};
};
}
private function AddMyPopOnDelay(_arg1:TimerEvent):void{
if (root["isStopGame"]){
_arg1.currentTarget.stop();
_arg1.currentTarget.removeEventListener(TimerEvent.TIMER_COMPLETE, AddMyPopNow);
_arg1.currentTarget.removeEventListener(TimerEvent.TIMER, AddMyPopOnDelay);
};
}
public function ChangeStrategy(_arg1:int, _arg2:int):void{
var _local3:Object;
var _local4:int;
if (charColl[_arg1].length == 0){
return;
};
_local4 = 0;
while (_local4 < charColl[_arg1].length) {
_local3 = charColl[_arg1][_local4];
if (_local3 != null){
if (!_local3.isDie){
_local3.tacticType = _arg2;
_local3.SetDestination(_local3.tacticType);
};
} else {
charColl[_arg1].splice(_local4, 1);
};
_local4++;
};
}
public function ProdChar(_arg1:String, _arg2:Boolean, _arg3:int, _arg4:Boolean, _arg5:int=-1):void{
var _local6:*;
do {
var _local7 = charCounter;
var _local8 = _arg1;
var _local9 = (_local7[_local8] + 1);
_local7[_local8] = _local9;
if (charCounter[_arg1] >= (root["maxTroop"] + 5)){
charCounter[_arg1] = 0;
};
_local6 = new Object();
_local6 = charContainer.getChildByName((_arg1 + charCounter[_arg1]));
} while (!(_local6.isDie));
_local6.Init(_arg1.toLowerCase(), 0, _arg2, _arg3, _arg4, _arg5);
if (!_arg2){
allAiColl.push(_local6);
};
}
public function SetAllCharToMove():void{
var _local1:uint;
var _local2:Object;
var _local3:Array;
var _local4:int;
_local1 = 0;
_local3 = new Array();
_local4 = 0;
while (_local4 < allAiColl.length) {
_local2 = new Object();
_local2 = allAiColl[_local4];
if (_local2 != null){
_local2.SetDestination(3);
};
_local4++;
};
}
private function SetDepth():void{
var _local1:int;
unitColl.sortOn("y", Array.NUMERIC);
_local1 = unitColl.length;
while (_local1--) {
if (charContainer.getChildIndex(unitColl[_local1]) != _local1){
charContainer.setChildIndex(unitColl[_local1], _local1);
};
};
}
private function RandomNum(_arg1:Number, _arg2:Number):Number{
return ((Math.floor((Math.random() * ((_arg2 - _arg1) + 1))) + _arg1));
}
public function CallEffect(_arg1:int, _arg2:Number, _arg3:Number, _arg4:Number=1):void{
var obj:Object;
var _eff = _arg1;
var _xp = _arg2;
var _yp = _arg3;
var _scale = _arg4;
if (_eff == 1){
obj = effectContainer.getChildAt(mcBloEcnt);
obj.x = _xp;
obj.y = _yp;
obj.scaleX = (obj.scaleY = _scale);
obj.gotoAndPlay(2);
mcBloEcnt++;
if (mcBloEcnt >= 30){
mcBloEcnt = 0;
};
} else {
if (_eff == 2){
tEff = new Timer(100, 5);
tEff.start();
tEff.addEventListener(TimerEvent.TIMER, function (_arg1:TimerEvent){
CreateEff(_eff, _xp, _yp);
}, false, 0, true);
tEff.addEventListener(TimerEvent.TIMER_COMPLETE, StopEff, false, 0, true);
} else {
if (_eff == 3){
obj = effectContainer.getChildAt(mcBurEcnt);
obj.x = _xp;
obj.y = _yp;
if (_scale == 1){
obj.scaleX = (obj.scaleY = (RandomNum(6, 9) / 10));
} else {
obj.scaleX = (obj.scaleY = _scale);
};
obj.gotoAndPlay(2);
mcBurEcnt++;
if (mcBurEcnt >= 90){
mcBurEcnt = 60;
};
this["root"].PlaySound("22");
} else {
if (_eff == 4){
obj = effectContainer.getChildAt(mcFroEcnt);
obj.x = _xp;
obj.y = _yp;
obj.scaleX = (obj.scaleY = (RandomNum(6, 9) / 10));
obj.gotoAndPlay(2);
mcFroEcnt++;
if (mcFroEcnt >= 120){
mcFroEcnt = 90;
};
} else {
if (_eff == 5){
tEff = new Timer(100, 5);
tEff.start();
tEff.addEventListener(TimerEvent.TIMER, function (_arg1:TimerEvent){
CreateEff(_eff, _xp, _yp);
}, false, 0, true);
tEff.addEventListener(TimerEvent.TIMER_COMPLETE, StopEff, false, 0, true);
};
};
};
};
};
}
public function SetCharToMove(_arg1:Array, _arg2:uint):void{
var _local3:uint;
var _local4:Object;
var _local5:Array;
var _local6:int;
_local3 = 0;
_local5 = new Array();
_local6 = 0;
while (_local6 < _arg2) {
_local5[_local6] = _arg1[_local6];
_local6++;
};
_local6 = 0;
while (_local6 < _local5.length) {
_local4 = new Object();
_local4 = _local5[_local6];
if (((!((_local4 == null))) && (!(_local4.isDie)))){
_local4.SetDestination(3);
};
_local6++;
};
}
}
}//package
Section 206
//CBgPart (CBgPart)
package {
import flash.display.*;
public class CBgPart extends MovieClip {
private var ac:int;// = 1
private var spd:Number;// = 0
public function CBgPart(){
spd = 0;
ac = 1;
super();
}
public function ScrollBg(_arg1:int):void{
if (!root["atBound"]){
if (_arg1 == 1){
if (spd < 0){
spd = (spd * -1);
};
x = (x + (spd * ac));
} else {
if (_arg1 == 2){
if (spd > 0){
spd = (spd * -1);
};
x = (x + (spd * ac));
} else {
if (_arg1 == 0){
};
};
};
};
}
public function SetSpeed(_arg1:int):void{
ac = _arg1;
}
public function Init(_arg1:Number){
spd = _arg1;
mouseEnabled = false;
mouseChildren = false;
}
}
}//package
Section 207
//CCharAttrib (CCharAttrib)
package {
import flash.net.*;
import flash.xml.*;
public class CCharAttrib {
private var objId:Object;
private var charXmlData:XML;
public function CCharAttrib(){
charXmlData = <char>
<unit id='zombie' sndatt='01' life='50' att='8' arm='2' spd='2' rng='0.25' spwn='3' eff='5' price='100' buy='0' skill='0' atttype='0' bounce='1' skilltyp='1' unitType='land' poison='0'/>
<unit id='vampire' sndatt='02' life='60' att='10' arm='2' spd='3' rng='0.25' spwn='5' eff='6' price='150' buy='0' skill='0' atttype='0' bounce='1' skilltyp='5' unitType='land' poison='0'/>
<unit id='ogre' sndatt='03' life='75' att='15' arm='3' spd='2' rng='0.5' spwn='7' eff='10' price='200' buy='0' skill='0' atttype='0' bounce='0' skilltyp='2' unitType='land' poison='0'/>
<unit id='darkevil' sndatt='04' life='80' att='20' arm='2' spd='2' rng='1' spwn='9' eff='8' price='250' buy='0' skill='0' atttype='0' bounce='0' skilltyp='6' unitType='land' poison='0'/>
<unit id='skeleton' sndatt='05' life='40' att='5' arm='1' spd='2' rng='6' spwn='5' eff='8' price='125' buy='0' skill='0' atttype='1' bounce='1' skilltyp='1' unitType='land' poison='0'/>
<unit id='darkelf' sndatt='06' life='50' att='8' arm='2' spd='3' rng='9' spwn='10' eff='10' price='150' buy='0' skill='0' atttype='1' bounce='1' skilltyp='3' unitType='land' poison='0'/>
<unit id='wizard' sndatt='07' life='60' att='12' arm='1' spd='2' rng='5' spwn='12' eff='15' price='200' buy='0' skill='0' atttype='1' bounce='1' skilltyp='6' unitType='land' poison='0'/>
<unit id='dracula' sndatt='08' life='45' att='9' arm='2' spd='6' rng='4' spwn='4' eff='10' price='200' buy='0' skill='0' atttype='1' bounce='0' skilltyp='5' unitType='air' poison='0'/>
<unit id='eagle' sndatt='09' life='65' att='9' arm='4' spd='10' rng='6' spwn='8' eff='15' price='400' buy='0' skill='0' atttype='1' bounce='0' skilltyp='2' unitType='air' poison='0'/>
<unit id='ghost' sndatt='10' life='70' att='7' arm='3' spd='4' rng='7' spwn='12' eff='20' price='800' buy='0' skill='0' atttype='1' bounce='0' skilltyp='2' unitType='air' poison='0'/>
<unit id='dragon' sndatt='11' life='100' att='10' arm='5' spd='9' rng='10' spwn='16' eff='25' price='1000' buy='0' skill='0' atttype='1' bounce='0' skilltyp='2' unitType='air' poison='0'/>
<unit id='shark' sndatt='12' life='65' att='10' arm='3' spd='5' rng='0.25' spwn='4' eff='15' price='500' buy='0' skill='0' atttype='0' bounce='0' skilltyp='1' unitType='sea' poison='0'/>
<unit id='whale' sndatt='13' life='70' att='12' arm='4' spd='3' rng='0.25' spwn='8' eff='20' price='1000' buy='0' skill='0' atttype='0' bounce='0' skilltyp='1' unitType='sea' poison='0'/>
<unit id='godship' sndatt='14' life='85' att='6' arm='5' spd='5' rng='10' spwn='12' eff='25' price='2000' buy='0' skill='0' atttype='1' bounce='0' skilltyp='1' unitType='sea' poison='0'/>
<unit id='ghostship' sndatt='15' life='100' att='8' arm='5' spd='7' rng='8' spwn='16' eff='30' price='4000' buy='0' skill='0' atttype='1' bounce='0' skilltyp='1' unitType='sea' poison='0'/>
<unit id='swordman' sndatt='16' life='50' att='8' arm='2' spd='2' rng='0.25' spwn='3' eff='5' price='100' buy='0' skill='0' atttype='0' bounce='1' skilltyp='1' unitType='land' poison='1'/>
<unit id='spearman' sndatt='04' life='60' att='10' arm='2' spd='1.75' rng='0.5' spwn='5' eff='7' price='150' buy='0' skill='0' atttype='0' bounce='1' skilltyp='1' unitType='land' poison='1'/>
<unit id='knight' sndatt='04' life='75' att='15' arm='3' spd='4' rng='0.5' spwn='7' eff='8' price='200' buy='0' skill='0' atttype='0' bounce='1' skilltyp='1' unitType='land' poison='1'/>
<unit id='paladin' sndatt='16' life='80' att='20' arm='2' spd='3' rng='0.25' spwn='9' eff='10' price='250' buy='0' skill='0' atttype='0' bounce='1' skilltyp='6' unitType='land' poison='1'/>
<unit id='archer' sndatt='06' life='40' att='5' arm='1' spd='3' rng='8' spwn='5' eff='7' price='125' buy='0' skill='0' atttype='1' bounce='1' skilltyp='4' unitType='land' poison='1'/>
<unit id='catapult' sndatt='17' life='50' att='10' arm='2' spd='2' rng='10' spwn='10' eff='9' price='150' buy='0' skill='0' atttype='1' bounce='0' skilltyp='6' unitType='land' poison='0'/>
<unit id='cannon' sndatt='18' life='60' att='10' arm='2' spd='1' rng='11' spwn='12' eff='14' price='200' buy='0' skill='0' atttype='1' bounce='0' skilltyp='2' unitType='land' poison='0'/>
<unit id='baloon1' sndatt='14' life='50' att='5' arm='2' spd='3' rng='8' spwn='4' eff='8' price='200' buy='0' skill='0' atttype='1' bounce='0' skilltyp='1' unitType='air' poison='0'/>
<unit id='baloon2' sndatt='18' life='65' att='10' arm='3' spd='5' rng='8' spwn='8' eff='12' price='400' buy='0' skill='0' atttype='1' bounce='0' skilltyp='2' unitType='air' poison='0'/>
<unit id='plane1' sndatt='14' life='80' att='6' arm='4' spd='6' rng='9' spwn='12' eff='17' price='800' buy='0' skill='0' atttype='1' bounce='0' skilltyp='2' unitType='air' poison='0'/>
<unit id='plane2' sndatt='18' life='100' att='10' arm='5' spd='7' rng='11' spwn='16' eff='22' price='1000' buy='0' skill='0' atttype='1' bounce='0' skilltyp='2' unitType='air' poison='0'/>
<unit id='vikingship' sndatt='14' life='50' att='5' arm='3' spd='3' rng='9' spwn='4' eff='12' price='500' buy='0' skill='0' atttype='1' bounce='0' skilltyp='1' unitType='sea' poison='0'/>
<unit id='romanship' sndatt='18' life='70' att='10' arm='4' spd='3' rng='9' spwn='8' eff='18' price='1000' buy='0' skill='0' atttype='1' bounce='0' skilltyp='1' unitType='sea' poison='0'/>
<unit id='persianship' sndatt='18' life='85' att='5' arm='5' spd='5' rng='10' spwn='12' eff='22' price='2000' buy='0' skill='0' atttype='1' bounce='0' skilltyp='3' unitType='sea' poison='0'/>
<unit id='greekship' sndatt='14' life='100' att='8' arm='5' spd='5' rng='12' spwn='16' eff='26' price='4000' buy='0' skill='0' atttype='1' bounce='0' skilltyp='1' unitType='sea' poison='0'/>
</char>
;
super();
InitId();
}
public function GetAttrib(_arg1:String, _arg2:int):Array{
var _local3:int;
var _local4:Array;
var _local5:int;
var _local6:Number;
var _local7:int;
_local3 = objId[_arg1];
_local4 = new Array();
_local4.push(charXmlData.children()[_local3].attribute("id"));
_local7 = int(charXmlData.children()[_local3].attribute("atttype"));
if (_local7 == 0){
_local5 = int((charXmlData.children()[_local3].attribute("life") * 1.5));
} else {
_local5 = charXmlData.children()[_local3].attribute("life");
};
_local4.push(_local5);
_local4.push(charXmlData.children()[_local3].attribute("att"));
_local4.push(charXmlData.children()[_local3].attribute("arm"));
_local5 = int((charXmlData.children()[_local3].attribute("spd") * 1.5));
_local4.push(_local5);
_local4.push(charXmlData.children()[_local3].attribute("rng"));
(_local5 == int(charXmlData.children()[_local3].attribute("spwn")));
if (_arg2 == 4){
_local5 = Math.round((_local5 / 2));
};
_local4.push(_local5);
_local4.push(charXmlData.children()[_local3].attribute("eff"));
_local4.push(charXmlData.children()[_local3].attribute("price"));
_local4.push(charXmlData.children()[_local3].attribute("buy"));
_local4.push(charXmlData.children()[_local3].attribute("skill"));
_local4.push(_local7);
_local4.push(charXmlData.children()[_local3].attribute("bounce"));
_local4.push(charXmlData.children()[_local3].attribute("skilltyp"));
_local4.push(charXmlData.children()[_local3].attribute("unitType"));
_local4.push(charXmlData.children()[_local3].attribute("poison"));
_local4.push(charXmlData.children()[_local3].attribute("sndatt"));
return (_local4);
}
public function GetAttribute(_arg1:String, _arg2:String):Number{
var _local3:int;
_local3 = objId[_arg1];
return (Number(charXmlData.children()[_local3].attribute(_arg2)));
}
private function InitId():void{
var _local1:String;
var _local2:int;
var _local3:int;
objId = new Object();
_local2 = charXmlData.children().length();
trace(_local2);
_local3 = 0;
while (_local3 < _local2) {
_local1 = String(charXmlData.children()[_local3].attribute("id"));
objId[_local1] = _local3;
_local3++;
};
}
public function GetDataBy(_arg1:String):Array{
var _local2:Array;
var _local3:int;
var _local4:int;
_local2 = new Array();
_local3 = charXmlData.children().length();
_local4 = 0;
while (_local4 < _local3) {
_local2.push(charXmlData.children()[_local4].attribute(_arg1));
_local4++;
};
return (_local2);
}
public function GetDataById(_arg1:Array, _arg2:String):Array{
var _local3:Array;
var _local4:int;
var _local5:int;
var _local6:int;
_local3 = new Array();
_local4 = charXmlData.children().length();
_local5 = 0;
while (_local5 < _arg1.length) {
_local6 = 0;
while (_local6 < _local4) {
if (String(_arg1[_local5]).toLowerCase() == String(charXmlData.children()[_local6].attribute("id"))){
_local3.push(charXmlData.children()[_local6].attribute(_arg2));
};
_local6++;
};
_local5++;
};
return (_local3);
}
public function GetIndex(_arg1:String):int{
return (objId[_arg1]);
}
}
}//package
Section 208
//CCharIcon (CCharIcon)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.text.*;
public class CCharIcon extends MovieClip {
private var tDel:Timer;
private var per:Number;
private var ra:Number;
public var price:int;
public var isNA:Boolean;
private var c:Number;
public var isLock:Boolean;
private var cy:Number;
private var cx:Number;
private var hBar:Number;
private var shape:Shape;
public var chrId:String;
private var chrStrtgy:int;
public var mcDelay:MovieClip;
private var nDur:int;
private var tPause:Timer;
public function CCharIcon(){
gotoAndStop(1);
mcDelay.visible = false;
isLock = true;
isNA = true;
buttonMode = false;
hBar = 30;
}
public function Init(_arg1:Number, _arg2:int, _arg3:Boolean, _arg4:Boolean):void{
isLock = _arg3;
isNA = _arg4;
if (((!(isNA)) && (!(isLock)))){
gotoAndStop(2);
buttonMode = true;
nDur = (_arg1 * 5);
price = _arg2;
shape = new Shape();
addChild(shape);
mcDelay.visible = true;
mcDelay.mask = shape;
mcDelay.mouseEnabled = false;
};
}
private function OnPause(_arg1:TimerEvent):void{
if (!root["isPause"]){
tDel.start();
tPause.stop();
tPause.removeEventListener(TimerEvent.TIMER, OnPause);
};
}
public function StartDelay(_arg1:int):void{
chrStrtgy = _arg1;
tDel = new Timer(200, nDur);
tDel.addEventListener(TimerEvent.TIMER, OnDelaying, false, 0, true);
tDel.addEventListener(TimerEvent.TIMER_COMPLETE, DelayEnd, false, 0, true);
tDel.start();
}
private function DelayEnd(_arg1:TimerEvent):void{
var _local2:String;
var _local3:*;
tDel.stop();
tDel.removeEventListener(TimerEvent.TIMER, OnDelaying);
tDel.removeEventListener(TimerEvent.TIMER_COMPLETE, DelayEnd);
if (shape != null){
shape.graphics.clear();
removeChild(shape);
shape = null;
};
mouseEnabled = true;
_local2 = name;
_local3 = int(_local2.substr(5));
chrId = parent["idColl"][_local3];
if (root["baseType"] == 1){
root["bgContainer"].ProdChar(chrId, true, root["charLevel"][_local3], root["charUpgrade"][_local3], chrStrtgy);
} else {
root["bgContainer"].ProdChar2(chrId, true, root["charLevel"][_local3], root["charUpgrade"][_local3], chrStrtgy);
};
var _local4 = root;
var _local5 = "myTroopOut";
var _local6 = (_local4[_local5] + 1);
_local4[_local5] = _local6;
addEventListener(MouseEvent.CLICK, parent["Select"], false, 0, true);
}
private function OnDelaying(_arg1:TimerEvent):void{
var _local2:*;
var _local3:Number;
var _local4:Number;
if (root["isPause"]){
tDel.stop();
tPause = new Timer(10);
tPause.addEventListener(TimerEvent.TIMER, OnPause, false, 0, true);
tPause.start();
};
if (root["isStopGame"]){
tDel.stop();
tDel.removeEventListener(TimerEvent.TIMER, OnDelaying);
tDel.removeEventListener(TimerEvent.TIMER_COMPLETE, DelayEnd);
};
per = ((tDel.currentCount / nDur) * 100);
c = Math.round((per * -1.84));
cx = 15;
cy = 15;
ra = ((30 / 2) * -1);
if (shape != null){
shape.graphics.clear();
removeChild(shape);
shape = null;
};
shape = new Shape();
shape.graphics.moveTo(cx, cy);
shape.graphics.beginFill(0xFF0000);
_local2 = 0;
while (_local2 >= c) {
_local3 = ((Math.sin(((Math.PI / 90) * _local2)) * ra) + cx);
_local4 = ((Math.cos(((Math.PI / 90) * _local2)) * ra) + cy);
shape.graphics.lineTo(_local3, _local4);
_local2--;
};
shape.graphics.endFill();
addChild(shape);
mcDelay.mask = shape;
}
public function Disable(_arg1:Boolean):void{
}
}
}//package
Section 209
//CCharPanel (CCharPanel)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.text.*;
public class CCharPanel extends MovieClip {
private var tooltip:Tooltip;
public var txNTroop1:TextField;
public var txNTroop2:TextField;
public var lifeColl:Array;
public var iconM10:icd24;
public var iconM13:icd28;
public var iconM14:icd22;
private var charAvailable:Array;
public var iconM12:icd29;
public var iconM11:icd30;
private var typAttColl:Array;
public var iconD10:icd5;
public var iconD11:icd11;
public var iconD12:icd16;
public var iconD14:icd23;
public var iconD13:icd21;
private var idColl1:Array;
private var idColl2:Array;
private var warType:Array;
public var mcDec:MovieClip;
public var iconD0:icd18;
public var iconD1:icd12;
public var iconD2:icd15;
public var iconD3:icd9;
public var iconD4:icd3;
public var iconD6:icd17;
public var iconD7:icd4;
public var iconD8:icd7;
public var iconD9:icd6;
public var iconD5:icd2;
public var mcNTroop1:MovieClip;
public var mcNTroop2:MovieClip;
private var infoColl:Array;
private var infoColl1:Array;
public var mcLife1:BaseLife;
public var mcLife2:BaseLife;
public var idColl:Array;
private var armorColl:Array;
private var infoColl2:Array;
public var txGold:TextField;
private var damageColl:Array;
public var charId:String;
public var mcGold:MovieClip;
public var mcDec2:MovieClip;
public var strtgyColl:Array;
private var type:String;
private var spwnTimeColl:Array;
public var txGameLvl:TextField;
public var txGold2:TextField;
public var iconM0:icd14;
public var iconM1:icd1;
public var iconM2:icd13;
public var iconM4:icd10;
public var iconM5:icd26;
public var iconM6:icd27;
public var iconM7:icd19;
public var iconM9:icd25;
public var iconM3:icd8;
public var mcStrtgy:CharStrtgy;
public var iconM8:icd20;
private var priceColl:Array;
public var mcGold2:MovieClip;
public var logo1:logo_bg;
public function CCharPanel(){
infoColl1 = ["Swordman", "Archerman", "Spearman", "Lancer", "Paladin", "Catapult", "Cannon", "Zeppelin Archer", "Zeppelin Bomber", "Old Plane Archer", "Old Plane Bomber", "Viking Ship", "Roman Ship", "Persian Ship", "Greek Ship"];
infoColl2 = ["Zombie", "Skeleton", "Strigoi", "Lizardman", "Dark Evil", "Dark Elf", "Wizard", "Redcaps", "Griffin", "Ghost", "Dragon", "Giant Shark", "Giant Whale", "Pirate Ship", "Ghost Ship"];
idColl1 = ["Swordman", "Archer", "Spearman", "Knight", "Paladin", "Catapult", "Cannon", "Baloon1", "Baloon2", "Plane1", "Plane2", "Vikingship", "Romanship", "Persianship", "Greekship"];
idColl2 = ["Zombie", "Skeleton", "Vampire", "Ogre", "Darkevil", "Darkelf", "Wizard", "Dracula", "Eagle", "Ghost", "Dragon", "Shark", "Whale", "Godship", "Ghostship"];
warType = ["land", "sea", "air", "land", "land", "sea", "air", "land"];
super();
mouseEnabled = false;
}
public function UpdateBaseHp(_arg1:int, _arg2:int):void{
this[("mcLife" + _arg1)].UpdateHp(_arg2);
}
private function ShowTooltip(_arg1:String):void{
HideTooltip();
tooltip = new Tooltip();
addChild(tooltip);
tooltip.x = (mouseX + 15);
tooltip.y = (mouseY - 10);
tooltip.cap.text = _arg1;
tooltip.cap.width = int((_arg1.length * 7));
tooltip.addEventListener(Event.ENTER_FRAME, UpdateTooltipPos, false, 0, true);
}
private function HideTooltip():void{
if (tooltip != null){
removeChild(tooltip);
tooltip.removeEventListener(Event.ENTER_FRAME, UpdateTooltipPos);
tooltip = null;
};
}
public function GetBaseHp(_arg1:int):int{
return (this[("mcLife" + _arg1)].GetLeftHp());
}
private function Factorial(_arg1:int):Number{
var _local2:Number;
_local2 = 1;
_arg1--;
if (_arg1 == 1){
_local2 = 2;
} else {
if (_arg1 > 1){
while (_arg1--) {
_local2 = (_local2 * 2);
};
};
};
return (_local2);
}
private function UpdateTooltipPos(_arg1:Event):void{
tooltip.x = (mouseX + 15);
tooltip.y = (mouseY - 10);
}
public function Select(_arg1:MouseEvent):void{
var _local2:String;
var _local3:int;
_local2 = String(_arg1.currentTarget.name);
_local3 = int(_local2.substr(5));
if ((((((root["myGold"] >= _arg1.currentTarget.price)) && ((root["myTroop"] > 0)))) && ((root["myTroopOut"] < root["maxTroop"])))){
root["myGold"] = (root["myGold"] - _arg1.currentTarget.price);
this["txGold"].text = root["myGold"];
var _local4 = root;
var _local5 = "myTroop";
var _local6 = (_local4[_local5] - 1);
_local4[_local5] = _local6;
ShowTroopData(1, root["myTroop"]);
_arg1.currentTarget.StartDelay(strtgyColl[_local3]);
_arg1.currentTarget.removeEventListener(MouseEvent.CLICK, Select);
};
}
private function RollOver(_arg1:MouseEvent):void{
var _local2:String;
var _local3:String;
var _local4:int;
var _local5:uint;
var _local6:int;
if (_arg1.currentTarget == mcGold){
_local2 = "Your Gold";
} else {
if (_arg1.currentTarget == mcGold2){
_local2 = "Enemy Gold";
} else {
if (_arg1.currentTarget == mcNTroop1){
_local2 = "Your troop(s) remaining at the base";
} else {
if (_arg1.currentTarget == mcNTroop2){
_local2 = "Enemy troop(s) remaining at the base";
} else {
if (_arg1.currentTarget == mcLife1){
_local2 = ((mcLife1.GetLeftHp() + "/") + mcLife1.MaxHp());
} else {
if (_arg1.currentTarget == mcLife2){
_local2 = ((mcLife2.GetLeftHp() + "/") + mcLife2.MaxHp());
} else {
if (_arg1.currentTarget.isLock){
_local2 = "locked";
ShowTooltip(_local2);
return;
};
if (_arg1.currentTarget.isNA){
_local2 = " NA ";
ShowTooltip(_local2);
return;
};
_local3 = String(_arg1.currentTarget.name);
_local4 = int(_local3.substr(5));
_local2 = (((String(infoColl[_local4]) + " (") + priceColl[_local4]) + " G)");
mcStrtgy.x = (_arg1.currentTarget.x + 15);
mcStrtgy.y = _arg1.currentTarget.y;
mcStrtgy.Init(strtgyColl[_local4], _local4, idColl[_local4]);
this["mcDec"].visible = true;
this["mcDec"].txNm.text = infoColl[_local4];
_local5 = root["charLevel"][_local4];
this["mcDec"].txLvl.text = _local5;
if (typAttColl[_local4] == 1){
this["mcDec"].txType.text = "Type: Range Att.";
} else {
this["mcDec"].txType.text = "Type: Melee Att.";
};
if (strtgyColl[_local4] == 0){
this["mcDec"].txOrder.text = "Order: Full Deffend";
} else {
if (strtgyColl[_local4] == 1){
this["mcDec"].txOrder.text = "Order: Deffend";
} else {
if (strtgyColl[_local4] == 2){
this["mcDec"].txOrder.text = "Order: Attack";
} else {
this["mcDec"].txOrder.text = "Order: Full Attack";
};
};
};
if (typAttColl[_local4] == 0){
_local6 = int((lifeColl[_local4] * 1.5));
} else {
_local6 = int(lifeColl[_local4]);
};
this["mcDec"].txLife.text = (_local6 + (5 * (_local5 - 1)));
this["mcDec"].txDmg.text = (int(damageColl[_local4]) + (2 * (_local5 - 1)));
this["mcDec"].txArm.text = (int(armorColl[_local4]) + (1 * (_local5 - 1)));
this["logo1"].visible = false;
};
};
};
};
};
};
ShowTooltip(_local2);
}
public function Init(_arg1:int):void{
var _local2:int;
var _local3:String;
this["mcDec"].visible = false;
this["mcDec2"].visible = false;
this["mcDec2"].gotoAndStop(1);
infoColl = new Array();
if (_arg1 == 1){
infoColl = infoColl1;
idColl = idColl1;
type = "M";
} else {
if (_arg1 == 2){
infoColl = infoColl2;
idColl = idColl2;
type = "D";
};
};
lifeColl = new Array();
lifeColl = root["bgContainer"]["charAttrib"].GetDataById(idColl, "life");
damageColl = new Array();
damageColl = root["bgContainer"]["charAttrib"].GetDataById(idColl, "att");
armorColl = new Array();
armorColl = root["bgContainer"]["charAttrib"].GetDataById(idColl, "arm");
spwnTimeColl = new Array();
spwnTimeColl = root["bgContainer"]["charAttrib"].GetDataById(idColl, "spwn");
priceColl = new Array();
priceColl = root["bgContainer"]["charAttrib"].GetDataById(idColl, "price");
typAttColl = new Array();
typAttColl = root["bgContainer"]["charAttrib"].GetDataById(idColl, "atttype");
strtgyColl = new Array();
_local2 = 0;
while (_local2 < typAttColl.length) {
if (typAttColl[_local2] == 0){
strtgyColl[_local2] = 2;
} else {
strtgyColl[_local2] = 1;
};
_local2++;
};
if (_arg1 == 1){
this["mcLife1"].Init(this["root"].GetBaseHp(root["baseLevel"]));
this["mcLife2"].Init(this["root"].GetBaseHp(Math.ceil((root["gameLevel"] / 3))));
} else {
this["mcLife1"].Init(this["root"].GetBaseHp(Math.ceil((root["gameLevel"] / 3))));
this["mcLife2"].Init(this["root"].GetBaseHp(root["baseLevel"]));
};
this["txGold"].text = root["myGold"];
this["txGold2"].text = root["aiGold"];
this["txGameLvl"].text = root["gameLevel"];
ShowTroopData(1, root["myTroop"]);
ShowTroopData(2, root["aiTroop"]);
_local3 = root["levelAttrib"].GetBattleArea(root["mapId"], root["gameLevel"]);
if (_local3 == "land"){
charAvailable = [1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0];
} else {
if (_local3 == "sea"){
charAvailable = [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1];
} else {
if (_local3 == "air"){
charAvailable = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0];
};
};
};
_local2 = 0;
while (_local2 < 15) {
this[(("icon" + type) + _local2)].addEventListener(MouseEvent.ROLL_OVER, RollOver, false, 0, true);
this[(("icon" + type) + _local2)].addEventListener(MouseEvent.ROLL_OUT, RollOut, false, 0, true);
if (root["charUnlock"][_local2]){
if (charAvailable[_local2]){
this[(("icon" + type) + _local2)].Init(Number(spwnTimeColl[_local2]), Number(priceColl[_local2]), false, false);
this[(("icon" + type) + _local2)].addEventListener(MouseEvent.CLICK, Select, false, 0, true);
} else {
this[(("icon" + type) + _local2)].Init(Number(spwnTimeColl[_local2]), Number(priceColl[_local2]), false, true);
};
};
_local2++;
};
mcGold.addEventListener(MouseEvent.ROLL_OVER, RollOver, false, 0, true);
mcGold.addEventListener(MouseEvent.ROLL_OUT, RollOut, false, 0, true);
mcGold2.addEventListener(MouseEvent.ROLL_OVER, RollOver, false, 0, true);
mcGold2.addEventListener(MouseEvent.ROLL_OUT, RollOut, false, 0, true);
mcNTroop1.addEventListener(MouseEvent.ROLL_OVER, RollOver, false, 0, true);
mcNTroop1.addEventListener(MouseEvent.ROLL_OUT, RollOut, false, 0, true);
mcNTroop2.addEventListener(MouseEvent.ROLL_OVER, RollOver, false, 0, true);
mcNTroop2.addEventListener(MouseEvent.ROLL_OUT, RollOut, false, 0, true);
mcLife1.addEventListener(MouseEvent.ROLL_OVER, RollOver, false, 0, true);
mcLife1.addEventListener(MouseEvent.ROLL_OUT, RollOut, false, 0, true);
mcLife2.addEventListener(MouseEvent.ROLL_OVER, RollOver, false, 0, true);
mcLife2.addEventListener(MouseEvent.ROLL_OUT, RollOut, false, 0, true);
mouseEnabled = false;
this["logo1"].Init("http://www.belugerinstudios.com/");
}
private function RollOut(_arg1:MouseEvent):void{
HideTooltip();
this["mcDec"].visible = false;
this["logo1"].visible = true;
}
public function ShowTroopData(_arg1:uint, _arg2:int):void{
this[("txNTroop" + _arg1)].text = _arg2;
}
}
}//package
Section 210
//CCharStrtgy (CCharStrtgy)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.text.*;
public class CCharStrtgy extends MovieClip {
public var icon1:MovieClip;
private var SY:Number;// = -100
private var SX:Number;// = -100
private var chrId:String;
private var idx:int;
public var icon0:MovieClip;
public var icon2:MovieClip;
public var icon3:MovieClip;
public function CCharStrtgy(){
var _local1:int;
SX = -100;
SY = -100;
super();
x = SX;
y = SY;
_local1 = 0;
while (_local1 < 4) {
this[("icon" + _local1)].addEventListener(MouseEvent.ROLL_OVER, RollOver, false, 0, true);
this[("icon" + _local1)].addEventListener(MouseEvent.ROLL_OUT, RollOut, false, 0, true);
this[("icon" + _local1)].addEventListener(MouseEvent.CLICK, Select, false, 0, true);
this[("icon" + _local1)].buttonMode = true;
_local1++;
};
}
private function Select(_arg1:MouseEvent):void{
var _local2:int;
var _local3:int;
_local2 = int(_arg1.currentTarget.name.charAt(4));
Init(_local2, idx, chrId);
parent["strtgyColl"][idx] = _local2;
_local3 = root["bgContainer"]["charAttrib"].GetIndex(chrId.toLowerCase());
root["bgContainer"].ChangeStrategy(_local3, _local2);
}
private function RollOver(_arg1:MouseEvent):void{
var _local2:int;
_local2 = int(_arg1.currentTarget.name.charAt(4));
parent["mcDec2"].gotoAndStop(int((_local2 + 1)));
parent["mcDec2"].visible = true;
parent["logo1"].visible = false;
}
public function Init(_arg1:int, _arg2:int, _arg3:String):void{
var _local4:int;
idx = _arg2;
chrId = _arg3;
_local4 = 0;
while (_local4 < 4) {
this[("icon" + _local4)].gotoAndStop(1);
_local4++;
};
this[("icon" + _arg1)].gotoAndStop(2);
}
private function RollOut(_arg1:MouseEvent):void{
var _local2:int;
_local2 = int(_arg1.currentTarget.name.charAt(4));
parent["mcDec2"].visible = false;
parent["logo1"].visible = true;
}
}
}//package
Section 211
//CGroundUnit (CGroundUnit)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.media.*;
import fl.transitions.easing.*;
public class CGroundUnit extends MovieClip {
public var px:int;
public var isAttack:Boolean;// = false
public var isIdle:Boolean;// = false
public var lvl:int;
private var isStop:Boolean;// = false
public var isBounce:Boolean;
public var skill:int;
public var arm:int;
public var speed:Number;
public var unitTyp:String;
public var curPx:int;
public var isDefend:Boolean;// = false
public var tacticType:int;
private var dx:Number;
private var dy:Number;
public var att:int;
public var skillTyp:int;
public var mainTarget:Number;
public var fBound:Number;
public var forceSpd:Number;
public var attrib:Array;
public var targetO:Object;
public var sPos:int;
public var bodyH:Number;
public var targetX:Number;
public var targetY:Number;
public var bodyW:Number;
public var life:int;
public var isDie:Boolean;
public var attCnt:int;
public var child:Object;
public var isBack:Boolean;// = false
public var isRetreat:Boolean;// = false
public var curSpd:Number;
public var price:int;
public var isAlly:Boolean;
public var runTimer:Timer;
public var attType:uint;
private var afterPause:Boolean;
public var defaultSpd:Number;
public var spd:int;
public var rng:Number;
public var poisonEff:Boolean;
public var nm:String;
public var hasSkill:Boolean;
public var destX:Number;
public var defTarget:Number;
public static var YPOS:int = -140;
public function CGroundUnit(){
isAttack = false;
isIdle = false;
isBack = false;
isRetreat = false;
isDefend = false;
isStop = false;
super();
gotoAndStop(1);
isDie = true;
bodyW = (this["mcHP"].width / 2);
bodyH = (this["mcHP"].height / 2);
}
public function IsThereCloseTarget():Boolean{
var _local1:Boolean;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
_local1 = false;
if (isAlly){
if (sPos == 0){
_local2 = int((x / 50));
_local4 = (x + 250);
_local3 = int((_local4 / 50));
_local5 = _local2;
while (_local5 <= _local3) {
if (root["bgContainer"]["enmyColl"][_local5].length > 0){
_local1 = true;
break;
} else {
_local1 = false;
};
_local5++;
};
} else {
_local4 = (x - 250);
_local2 = int((_local4 / 50));
_local3 = int((x / 50));
_local5 = _local2;
while (_local5 <= _local3) {
if (root["bgContainer"]["enmyColl"][_local5].length > 0){
_local1 = true;
break;
} else {
_local1 = false;
};
_local5++;
};
};
} else {
if (sPos == 0){
_local2 = int((x / 50));
_local4 = (x + 250);
_local3 = int((_local4 / 50));
_local5 = _local2;
while (_local5 <= _local3) {
if (root["bgContainer"]["allyColl"][_local5].length > 0){
_local1 = true;
break;
} else {
_local1 = false;
};
_local5++;
};
} else {
_local4 = (x - 250);
_local2 = int((_local4 / 50));
_local3 = int((x / 50));
_local5 = _local2;
while (_local5 <= _local3) {
if (root["bgContainer"]["allyColl"][_local5].length > 0){
_local1 = true;
break;
} else {
_local1 = false;
};
_local5++;
};
};
};
return (_local1);
}
public function CheckAvaiEnemy():void{
}
public function Moving(_arg1:Event):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
if (root["isStopGame"]){
if (runTimer != null){
runTimer.stop();
runTimer.removeEventListener(TimerEvent.TIMER, Moving);
};
child = DisplayObject(getChildAt(0));
if (child != null){
child.gotoAndStop(1);
};
return;
};
if (!root["isPause"]){
if (afterPause){
afterPause = false;
child = DisplayObject(getChildAt(0));
if (child != null){
child.play();
};
};
if (isDie){
if (((!(root["firstKill"])) && (!(isAlly)))){
root["firstKill"] = true;
this["root"].SetNGMedal(1);
};
speed = 0;
if (currentLabel != "die"){
gotoAndStop("die");
};
if (runTimer != null){
runTimer.stop();
runTimer.removeEventListener(TimerEvent.TIMER, Moving);
};
};
if (!isAttack){
_local2 = y;
_local3 = 0;
_local4 = (x - destX);
if (!isStop){
if (x > destX){
scaleX = -1;
} else {
scaleX = 1;
};
};
_local5 = (-(Math.atan2(_local4, _local3)) / (Math.PI / 180));
dy = (speed * Math.cos((_local5 * (Math.PI / 180))));
dx = (speed * Math.sin((_local5 * (Math.PI / 180))));
if (Math.sqrt(((_local4 * _local4) + (_local3 * _local3))) > speed){
x = (x + (dx / 2));
} else {
if (tacticType == 0){
child = DisplayObject(getChildAt(0));
if (child != null){
child.gotoAndStop("idle");
};
if (!isStop){
DefendTheBase();
isStop = true;
isDefend = true;
isRetreat = false;
isIdle = false;
speed = curSpd;
};
} else {
if (tacticType == 1){
child = DisplayObject(getChildAt(0));
if (child != null){
child.gotoAndStop("idle");
};
isIdle = true;
CheckAvaiEnemy();
isDefend = false;
} else {
if ((((tacticType == 2)) || ((tacticType == 3)))){
isDefend = false;
};
};
};
};
};
UpdateThis();
} else {
if (!afterPause){
afterPause = true;
child = DisplayObject(getChildAt(0));
if (child != null){
child.stop();
};
};
};
}
public function SetDestination(_arg1:int):void{
if (_arg1 == 0){
if (sPos == 0){
destX = 275;
} else {
destX = 1325;
};
destX = (destX + (RandomNum(1, 10) * RandomNum(-1, 1)));
if (isAttack){
StopAttack();
};
isRetreat = true;
if ((((sPos == 0)) && ((x < destX)))){
isRetreat = false;
} else {
if ((((sPos == 1)) && ((x > destX)))){
isRetreat = false;
};
};
} else {
if (_arg1 == 1){
if (sPos == 0){
destX = (x + 125);
destX = (destX + (RandomNum(1, 10) * RandomNum(-1, 1)));
if (destX > mainTarget){
destX = mainTarget;
};
} else {
destX = (x - 125);
destX = (destX + (RandomNum(1, 10) * RandomNum(-1, 1)));
if (destX < mainTarget){
destX = mainTarget;
};
};
isDefend = false;
} else {
if (_arg1 == 2){
destX = mainTarget;
isDefend = false;
isIdle = false;
isRetreat = false;
} else {
if (_arg1 == 3){
destX = mainTarget;
isDefend = false;
isIdle = false;
isRetreat = false;
if (!isAlly){
if (attType == 0){
root["bgContainer"].RemoveArrValue(root["bgContainer"]["aiMeleeColl"], this);
} else {
root["bgContainer"].RemoveArrValue(root["bgContainer"]["aiRangeColl"], this);
};
};
};
};
};
};
if (!isAttack){
child = DisplayObject(getChildAt(0));
if (child != null){
child.play();
};
isStop = false;
};
if (isDie){
if (currentLabel != "die"){
gotoAndStop("die");
};
};
}
public function Remove():void{
if (!isAlly){
if (attType == 0){
root["bgContainer"].RemoveArrValue(root["bgContainer"]["aiMeleeColl"], this);
} else {
root["bgContainer"].RemoveArrValue(root["bgContainer"]["aiRangeColl"], this);
};
root["bgContainer"].RemoveArrValue(root["bgContainer"]["allAiColl"], this);
var _local1 = root;
var _local2 = "aiTroopOut";
var _local3 = (_local1[_local2] - 1);
_local1[_local2] = _local3;
if (root["aiTroopOut"] < 0){
root["aiTroopOut"] = 0;
};
if (root["aiTroop"] < root["maxTroop"]){
root["bgContainer"].AddAiPopTroop();
};
} else {
_local1 = root;
_local2 = "myTroopOut";
_local3 = (_local1[_local2] - 1);
_local1[_local2] = _local3;
if (root["myTroopOut"] < 0){
root["myTroopOut"] = 0;
};
if (root["myTroop"] < root["maxTroop"]){
root["bgContainer"].AddMyPopTroop();
};
};
gotoAndStop(1);
x = -600;
}
public function StopAttack():void{
}
public function DefendTheBase():void{
if (sPos == 0){
if (scaleX == -1){
scaleX = 1;
};
} else {
if (scaleX == 1){
scaleX = -1;
};
};
if (!isAlly){
if (attType == 0){
root["bgContainer"]["aiMeleeColl"].push(this);
} else {
root["bgContainer"]["aiRangeColl"].push(this);
};
};
}
public function UpdateThis():void{
}
public function Init(_arg1:String, _arg2:int, _arg3:Boolean, _arg4:int, _arg5:Boolean, _arg6:int):void{
isAlly = _arg3;
lvl = _arg4;
hasSkill = _arg5;
isDie = false;
isAttack = false;
isIdle = false;
isBack = false;
isRetreat = false;
isDefend = false;
isStop = false;
gotoAndStop(1);
targetO = new Object();
sPos = _arg2;
if (sPos == 0){
x = ((0 - (width / 2)) - RandomNum(0, 5));
mainTarget = 1550;
defTarget = (150 + 125);
} else {
x = ((1600 + (width / 2)) + RandomNum(0, 5));
mainTarget = 50;
defTarget = (1450 - 125);
};
y = YPOS;
destX = mainTarget;
SetAttributes(_arg1);
if (_arg6 == -1){
if (root["aiStrategy"] == 0){
tacticType = 0;
} else {
if (root["aiStrategy"] == 1){
if (attType == 0){
if (RandomNum(1, 2) == 1){
tacticType = 0;
} else {
tacticType = 2;
};
} else {
if (RandomNum(1, 4) == 1){
tacticType = 0;
} else {
tacticType = 1;
};
};
} else {
if (root["aiStrategy"] == 2){
tacticType = 3;
};
};
};
} else {
tacticType = _arg6;
};
SetDestination(tacticType);
forceSpd = 0.25;
speed = ((defaultSpd * forceSpd) * 1.5);
curSpd = speed;
px = int((x / 50));
if (px < 0){
px = 0;
} else {
if (px > 31){
px = 31;
};
};
curPx = px;
mouseEnabled = false;
afterPause = false;
}
public function SetAttributes(_arg1:String):void{
}
public function GetAngle(_arg1:Number, _arg2:Number):Number{
return (((Math.atan2(_arg2, _arg1) * 180) / Math.PI));
}
public function GetDistance(_arg1:Number, _arg2:Number):Number{
return (Math.sqrt(((_arg1 * _arg1) + (_arg2 * _arg2))));
}
public function GetAvailableTarget(_arg1:Array):Object{
var _local2:int;
var _local3:Object;
_local2 = _arg1.length;
_local3 = null;
if (_local2 == 1){
_local3 = _arg1[0];
} else {
if (_local2 > 1){
_local3 = _arg1[RandomNum(0, (_local2 - 1))];
};
};
if (_local3 != null){
if (_local3.isDie){
_local3 = null;
};
};
return (_local3);
}
public function RandomNum(_arg1:Number, _arg2:Number):Number{
return ((Math.floor((Math.random() * ((_arg2 - _arg1) + 1))) + _arg1));
}
public function Retreat():void{
}
}
}//package
Section 212
//CharPanel1 (CharPanel1)
package {
public dynamic class CharPanel1 extends CCharPanel {
}
}//package
Section 213
//CharPanel2 (CharPanel2)
package {
public dynamic class CharPanel2 extends CCharPanel {
}
}//package
Section 214
//CharStrtgy (CharStrtgy)
package {
public dynamic class CharStrtgy extends CCharStrtgy {
}
}//package
Section 215
//CLevelAttrib (CLevelAttrib)
package {
import flash.net.*;
import flash.xml.*;
public class CLevelAttrib {
private var charAttrib:CCharAttrib;
private var hpAiConfNormal:Array;
private var hpAiConfHard:Array;
private var hpAiAfterLose:Array;
private var leveldata:XML;
private var mychardata:XML;
private var hpAiConfEasy:Array;
public function CLevelAttrib(){
charAttrib = new CCharAttrib();
hpAiAfterLose = [0, 60, 58, 56, 54, 52, 50, 48, 46, 44, 42, 40, 38, 36, 34, 32, 30, 28, 26, 24, 22, 20, 18, 16, 14, 12, 10, 8, 6, 4, 2];
hpAiConfEasy = [0, 35, 35, 35, 35, 35, 30, 30, 30, 30, 30, 25, 25, 25, 25, 25, 20, 20, 20, 20, 20, 15, 15, 15, 15, 15, 10, 10, 10, 10, 10];
hpAiConfNormal = [0, 30, 30, 30, 30, 30, 25, 25, 25, 25, 25, 20, 20, 20, 20, 20, 15, 15, 15, 15, 15, 10, 10, 10, 10, 10, 5, 5, 5, 5, 5];
hpAiConfHard = [0, 25, 25, 25, 25, 25, 20, 20, 20, 20, 20, 15, 15, 15, 15, 15, 10, 10, 10, 10, 10, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0];
leveldata = <mylevel>
<champ1>
<level _lvl='1' _area='land' _xp='0'>
<char _lvl='1'>Swordman</char>
</level>
<level _lvl='2' _area='land' _xp='1'>
<char _lvl='1'>Swordman</char>
<char _lvl='1'>Archer</char>
</level>
<level _lvl='3' _area='land' _xp='1'>
<char _lvl='2'>Swordman</char>
<char _lvl='1'>Archer</char>
</level>
<level _lvl='4' _area='land' _xp='2'>
<char _lvl='3'>Swordman</char>
<char _lvl='2'>Archer</char>
</level>
<level _lvl='5' _area='land' _xp='2'>
<char _lvl='3'>Swordman</char>
<char _lvl='2'>Archer</char>
<char _lvl='1'>Spearman</char>
</level>
<level _lvl='6' _area='sea' _xp='2'>
<char _lvl='1'>Baloon1</char>
<char _lvl='1'>Vikingship</char>
</level>
<level _lvl='7' _area='sea' _xp='4'>
<char _lvl='1'>Baloon1</char>
<char _lvl='1'>Baloon2</char>
<char _lvl='2'>Vikingship</char>
<char _lvl='1'>Romanship</char>
</level>
<level _lvl='8' _area='sea' _xp='6'>
<char _lvl='2'>Baloon1</char>
<char _lvl='2'>Baloon2</char>
<char _lvl='1'>Plane1</char>
<char _lvl='3'>Vikingship</char>
<char _lvl='2'>Romanship</char>
<char _lvl='1'>Persianship</char>
</level>
<level _lvl='9' _area='land' _xp='2'>
<char _lvl='3'>Swordman</char>
<char _lvl='3'>Archer</char>
<char _lvl='1'>Spearman</char>
<char _lvl='1'>Knight</char>
</level>
<level _lvl='10' _area='land' _xp='3'>
<char _lvl='4'>Swordman</char>
<char _lvl='3'>Archer</char>
<char _lvl='2'>Spearman</char>
<char _lvl='1'>Knight</char>
</level>
<level _lvl='11' _area='air' _xp='6'>
<char _lvl='4'>Swordman</char>
<char _lvl='3'>Archer</char>
<char _lvl='2'>Spearman</char>
<char _lvl='1'>Knight</char>
<char _lvl='3'>Baloon1</char>
<char _lvl='3'>Baloon2</char>
<char _lvl='2'>Plane1</char>
<char _lvl='1'>Plane2</char>
</level>
<level _lvl='12' _area='land' _xp='4'>
<char _lvl='5'>Swordman</char>
<char _lvl='4'>Archer</char>
<char _lvl='3'>Spearman</char>
<char _lvl='2'>Knight</char>
<char _lvl='1'>Paladin</char>
</level>
<level _lvl='13' _area='air' _xp='8'>
<char _lvl='5'>Swordman</char>
<char _lvl='5'>Archer</char>
<char _lvl='3'>Spearman</char>
<char _lvl='3'>Knight</char>
<char _lvl='1'>Paladin</char>
<char _lvl='4'>Baloon1</char>
<char _lvl='4'>Baloon2</char>
<char _lvl='3'>Plane1</char>
<char _lvl='2'>Plane2</char>
</level>
<level _lvl='14' _area='land' _xp='3'>
<char _lvl='6'>Swordman</char>
<char _lvl='5'>Archer</char>
<char _lvl='4'>Spearman</char>
<char _lvl='3'>Knight</char>
<char _lvl='2'>Paladin</char>
</level>
<level _lvl='15' _area='air' _xp='9'>
<char _lvl='6'>Swordman</char>
<char _lvl='6'>Archer</char>
<char _lvl='4'>Spearman</char>
<char _lvl='4'>Knight</char>
<char _lvl='2'>Paladin</char>
<char _lvl='1'>Catapult</char>
<char _lvl='5'>Baloon1</char>
<char _lvl='5'>Baloon2</char>
<char _lvl='4'>Plane1</char>
<char _lvl='3'>Plane2</char>
</level>
<level _lvl='16' _area='land' _xp='5'>
<char _lvl='7'>Swordman</char>
<char _lvl='6'>Archer</char>
<char _lvl='5'>Spearman</char>
<char _lvl='4'>Knight</char>
<char _lvl='3'>Paladin</char>
<char _lvl='1'>Catapult</char>
</level>
<level _lvl='17' _area='land' _xp='4'>
<char _lvl='7'>Swordman</char>
<char _lvl='7'>Archer</char>
<char _lvl='5'>Spearman</char>
<char _lvl='5'>Knight</char>
<char _lvl='3'>Paladin</char>
<char _lvl='2'>Catapult</char>
</level>
<level _lvl='18' _area='land' _xp='3'>
<char _lvl='8'>Swordman</char>
<char _lvl='7'>Archer</char>
<char _lvl='6'>Spearman</char>
<char _lvl='5'>Knight</char>
<char _lvl='4'>Paladin</char>
<char _lvl='2'>Catapult</char>
</level>
<level _lvl='19' _area='land' _xp='4'>
<char _lvl='8'>Swordman</char>
<char _lvl='8'>Archer</char>
<char _lvl='6'>Spearman</char>
<char _lvl='6'>Knight</char>
<char _lvl='4'>Paladin</char>
<char _lvl='3'>Catapult</char>
</level>
<level _lvl='20' _area='land' _xp='5'>
<char _lvl='9'>Swordman</char>
<char _lvl='8'>Archer</char>
<char _lvl='7'>Spearman</char>
<char _lvl='6'>Knight</char>
<char _lvl='5'>Paladin</char>
<char _lvl='3'>Catapult</char>
<char _lvl='1'>Cannon</char>
</level>
<level _lvl='21' _area='air' _xp='9'>
<char _lvl='9'>Swordman</char>
<char _lvl='9'>Archer</char>
<char _lvl='7'>Spearman</char>
<char _lvl='7'>Knight</char>
<char _lvl='5'>Paladin</char>
<char _lvl='4'>Catapult</char>
<char _lvl='2'>Cannon</char>
<char _lvl='6'>Baloon1</char>
<char _lvl='6'>Baloon2</char>
<char _lvl='5'>Plane1</char>
<char _lvl='4'>Plane2</char>
</level>
<level _lvl='22' _area='air' _xp='10'>
<char _lvl='10'>Swordman</char>
<char _lvl='9'>Archer</char>
<char _lvl='8'>Spearman</char>
<char _lvl='7'>Knight</char>
<char _lvl='6'>Paladin</char>
<char _lvl='4'>Catapult</char>
<char _lvl='3'>Cannon</char>
<char _lvl='7'>Baloon1</char>
<char _lvl='7'>Baloon2</char>
<char _lvl='6'>Plane1</char>
<char _lvl='5'>Plane2</char>
</level>
<level _lvl='23' _area='air' _xp='9'>
<char _lvl='10'>Swordman</char>
<char _lvl='10'>Archer</char>
<char _lvl='8'>Spearman</char>
<char _lvl='8'>Knight</char>
<char _lvl='6'>Paladin</char>
<char _lvl='5'>Catapult</char>
<char _lvl='4'>Cannon</char>
<char _lvl='8'>Baloon1</char>
<char _lvl='8'>Baloon2</char>
<char _lvl='7'>Plane1</char>
<char _lvl='6'>Plane2</char>
</level>
<level _lvl='24' _area='land' _xp='4'>
<char _lvl='10'>Swordman</char>
<char _lvl='10'>Archer</char>
<char _lvl='9'>Spearman</char>
<char _lvl='8'>Knight</char>
<char _lvl='7'>Paladin</char>
<char _lvl='5'>Catapult</char>
<char _lvl='5'>Cannon</char>
</level>
<level _lvl='25' _area='land' _xp='5'>
<char _lvl='10'>Swordman</char>
<char _lvl='10'>Archer</char>
<char _lvl='9'>Spearman</char>
<char _lvl='9'>Knight</char>
<char _lvl='7'>Paladin</char>
<char _lvl='6'>Catapult</char>
<char _lvl='6'>Cannon</char>
</level>
<level _lvl='26' _area='land' _xp='4'>
<char _lvl='10'>Swordman</char>
<char _lvl='10'>Archer</char>
<char _lvl='10'>Spearman</char>
<char _lvl='9'>Knight</char>
<char _lvl='8'>Paladin</char>
<char _lvl='7'>Catapult</char>
<char _lvl='7'>Cannon</char>
</level>
<level _lvl='27' _area='sea' _xp='8'>
<char _lvl='9'>Baloon1</char>
<char _lvl='9'>Baloon2</char>
<char _lvl='8'>Plane1</char>
<char _lvl='7'>Plane2</char>
<char _lvl='4'>Vikingship</char>
<char _lvl='3'>Romanship</char>
<char _lvl='2'>Persianship</char>
<char _lvl='1'>Greekship</char>
</level>
<level _lvl='28' _area='land' _xp='4'>
<char _lvl='10'>Swordman</char>
<char _lvl='10'>Archer</char>
<char _lvl='10'>Spearman</char>
<char _lvl='10'>Knight</char>
<char _lvl='8'>Paladin</char>
<char _lvl='8'>Catapult</char>
<char _lvl='8'>Cannon</char>
</level>
<level _lvl='29' _area='land' _xp='3'>
<char _lvl='10'>Swordman</char>
<char _lvl='10'>Archer</char>
<char _lvl='10'>Spearman</char>
<char _lvl='10'>Knight</char>
<char _lvl='9'>Paladin</char>
<char _lvl='9'>Catapult</char>
<char _lvl='9'>Cannon</char>
</level>
<level _lvl='30' _area='land' _xp='3'>
<char _lvl='10'>Swordman</char>
<char _lvl='10'>Archer</char>
<char _lvl='10'>Spearman</char>
<char _lvl='10'>Knight</char>
<char _lvl='10'>Paladin</char>
<char _lvl='10'>Catapult</char>
<char _lvl='10'>Cannon</char>
</level>
</champ1>
<champ2>
<level _lvl='1' _area='land' _xp='0'>
<char _lvl='1'>Swordman</char>
</level>
<level _lvl='2' _area='land' _xp='1'>
<char _lvl='1'>Swordman</char>
<char _lvl='1'>Archer</char>
</level>
<level _lvl='3' _area='sea' _xp='2'>
<char _lvl='1'>Baloon1</char>
<char _lvl='1'>Vikingship</char>
</level>
<level _lvl='4' _area='land' _xp='3'>
<char _lvl='2'>Swordman</char>
<char _lvl='1'>Archer</char>
</level>
<level _lvl='5' _area='air' _xp='2'>
<char _lvl='2'>Swordman</char>
<char _lvl='2'>Archer</char>
<char _lvl='1'>Spearman</char>
<char _lvl='1'>Baloon1</char>
</level>
<level _lvl='6' _area='sea' _xp='3'>
<char _lvl='1'>Baloon1</char>
<char _lvl='1'>Baloon2</char>
<char _lvl='2'>Vikingship</char>
<char _lvl='1'>Romanship</char>
</level>
<level _lvl='7' _area='air' _xp='3'>
<char _lvl='3'>Swordman</char>
<char _lvl='2'>Archer</char>
<char _lvl='1'>Spearman</char>
<char _lvl='2'>Baloon1</char>
<char _lvl='1'>Baloon2</char>
</level>
<level _lvl='8' _area='sea' _xp='4'>
<char _lvl='2'>Baloon1</char>
<char _lvl='2'>Baloon2</char>
<char _lvl='3'>Vikingship</char>
<char _lvl='2'>Romanship</char>
<char _lvl='1'>Persianship</char>
</level>
<level _lvl='9' _area='air' _xp='4'>
<char _lvl='3'>Swordman</char>
<char _lvl='3'>Archer</char>
<char _lvl='2'>Spearman</char>
<char _lvl='3'>Baloon1</char>
<char _lvl='2'>Baloon2</char>
<char _lvl='1'>Plane1</char>
</level>
<level _lvl='10' _area='land' _xp='3'>
<char _lvl='4'>Swordman</char>
<char _lvl='3'>Archer</char>
<char _lvl='2'>Spearman</char>
<char _lvl='1'>Knight</char>
</level>
<level _lvl='11' _area='air' _xp='3'>
<char _lvl='4'>Swordman</char>
<char _lvl='4'>Archer</char>
<char _lvl='3'>Spearman</char>
<char _lvl='1'>Knight</char>
<char _lvl='3'>Baloon1</char>
<char _lvl='3'>Baloon2</char>
<char _lvl='1'>Plane1</char>
</level>
<level _lvl='12' _area='land' _xp='3'>
<char _lvl='5'>Swordman</char>
<char _lvl='4'>Archer</char>
<char _lvl='3'>Spearman</char>
<char _lvl='2'>Knight</char>
</level>
<level _lvl='13' _area='air' _xp='7'>
<char _lvl='6'>Swordman</char>
<char _lvl='5'>Archer</char>
<char _lvl='4'>Spearman</char>
<char _lvl='2'>Knight</char>
<char _lvl='1'>Paladin</char>
<char _lvl='4'>Baloon1</char>
<char _lvl='3'>Baloon2</char>
<char _lvl='2'>Plane1</char>
</level>
<level _lvl='14' _area='sea' _xp='5'>
<char _lvl='4'>Baloon1</char>
<char _lvl='4'>Baloon2</char>
<char _lvl='2'>Plane1</char>
<char _lvl='4'>Vikingship</char>
<char _lvl='3'>Romanship</char>
<char _lvl='2'>Persianship</char>
<char _lvl='1'>Greekship</char>
</level>
<level _lvl='15' _area='air' _xp='6'>
<char _lvl='6'>Swordman</char>
<char _lvl='5'>Archer</char>
<char _lvl='4'>Spearman</char>
<char _lvl='3'>Knight</char>
<char _lvl='1'>Paladin</char>
<char _lvl='5'>Baloon1</char>
<char _lvl='4'>Baloon2</char>
<char _lvl='3'>Plane1</char>
<char _lvl='1'>Plane2</char>
</level>
<level _lvl='16' _area='sea' _xp='8'>
<char _lvl='5'>Baloon1</char>
<char _lvl='5'>Baloon2</char>
<char _lvl='3'>Plane1</char>
<char _lvl='1'>Plane2</char>
<char _lvl='5'>Vikingship</char>
<char _lvl='4'>Romanship</char>
<char _lvl='3'>Persianship</char>
<char _lvl='2'>Greekship</char>
</level>
<level _lvl='17' _area='air' _xp='8'>
<char _lvl='6'>Swordman</char>
<char _lvl='6'>Archer</char>
<char _lvl='5'>Spearman</char>
<char _lvl='3'>Knight</char>
<char _lvl='2'>Paladin</char>
<char _lvl='1'>Catapult</char>
<char _lvl='6'>Baloon1</char>
<char _lvl='5'>Baloon2</char>
<char _lvl='4'>Plane1</char>
<char _lvl='2'>Plane2</char>
</level>
<level _lvl='18' _area='sea' _xp='6'>
<char _lvl='6'>Baloon1</char>
<char _lvl='6'>Baloon2</char>
<char _lvl='4'>Plane1</char>
<char _lvl='2'>Plane2</char>
<char _lvl='6'>Vikingship</char>
<char _lvl='5'>Romanship</char>
<char _lvl='4'>Persianship</char>
<char _lvl='3'>Greekship</char>
</level>
<level _lvl='19' _area='air' _xp='8'>
<char _lvl='7'>Swordman</char>
<char _lvl='6'>Archer</char>
<char _lvl='5'>Spearman</char>
<char _lvl='4'>Knight</char>
<char _lvl='2'>Paladin</char>
<char _lvl='1'>Catapult</char>
<char _lvl='1'>Cannon</char>
<char _lvl='7'>Baloon1</char>
<char _lvl='6'>Baloon2</char>
<char _lvl='5'>Plane1</char>
<char _lvl='3'>Plane2</char>
</level>
<level _lvl='20' _area='land' _xp='5'>
<char _lvl='7'>Swordman</char>
<char _lvl='7'>Archer</char>
<char _lvl='6'>Spearman</char>
<char _lvl='4'>Knight</char>
<char _lvl='3'>Paladin</char>
<char _lvl='2'>Catapult</char>
<char _lvl='2'>Cannon</char>
</level>
<level _lvl='21' _area='air' _xp='6'>
<char _lvl='8'>Swordman</char>
<char _lvl='7'>Archer</char>
<char _lvl='6'>Spearman</char>
<char _lvl='5'>Knight</char>
<char _lvl='3'>Paladin</char>
<char _lvl='3'>Catapult</char>
<char _lvl='3'>Cannon</char>
<char _lvl='7'>Baloon1</char>
<char _lvl='7'>Baloon2</char>
<char _lvl='5'>Plane1</char>
<char _lvl='3'>Plane2</char>
</level>
<level _lvl='22' _area='air' _xp='9'>
<char _lvl='8'>Swordman</char>
<char _lvl='8'>Archer</char>
<char _lvl='7'>Spearman</char>
<char _lvl='5'>Knight</char>
<char _lvl='4'>Paladin</char>
<char _lvl='4'>Catapult</char>
<char _lvl='4'>Cannon</char>
<char _lvl='8'>Baloon1</char>
<char _lvl='7'>Baloon2</char>
<char _lvl='6'>Plane1</char>
<char _lvl='4'>Plane2</char>
</level>
<level _lvl='23' _area='air' _xp='11'>
<char _lvl='9'>Swordman</char>
<char _lvl='8'>Archer</char>
<char _lvl='7'>Spearman</char>
<char _lvl='6'>Knight</char>
<char _lvl='5'>Paladin</char>
<char _lvl='5'>Catapult</char>
<char _lvl='5'>Cannon</char>
<char _lvl='8'>Baloon1</char>
<char _lvl='8'>Baloon2</char>
<char _lvl='6'>Plane1</char>
<char _lvl='5'>Plane2</char>
</level>
<level _lvl='24' _area='sea' _xp='8'>
<char _lvl='9'>Baloon1</char>
<char _lvl='8'>Baloon2</char>
<char _lvl='7'>Plane1</char>
<char _lvl='6'>Plane2</char>
<char _lvl='7'>Vikingship</char>
<char _lvl='6'>Romanship</char>
<char _lvl='5'>Persianship</char>
<char _lvl='4'>Greekship</char>
</level>
<level _lvl='25' _area='air' _xp='8'>
<char _lvl='9'>Swordman</char>
<char _lvl='9'>Archer</char>
<char _lvl='8'>Spearman</char>
<char _lvl='6'>Knight</char>
<char _lvl='6'>Paladin</char>
<char _lvl='6'>Catapult</char>
<char _lvl='6'>Cannon</char>
<char _lvl='9'>Baloon1</char>
<char _lvl='9'>Baloon2</char>
<char _lvl='7'>Plane1</char>
<char _lvl='7'>Plane2</char>
</level>
<level _lvl='26' _area='land' _xp='5'>
<char _lvl='10'>Swordman</char>
<char _lvl='9'>Archer</char>
<char _lvl='8'>Spearman</char>
<char _lvl='7'>Knight</char>
<char _lvl='7'>Paladin</char>
<char _lvl='7'>Catapult</char>
<char _lvl='7'>Cannon</char>
</level>
<level _lvl='27' _area='sea' _xp='8'>
<char _lvl='10'>Baloon1</char>
<char _lvl='9'>Baloon2</char>
<char _lvl='8'>Plane1</char>
<char _lvl='8'>Plane2</char>
<char _lvl='8'>Vikingship</char>
<char _lvl='7'>Romanship</char>
<char _lvl='6'>Persianship</char>
<char _lvl='5'>Greekship</char>
</level>
<level _lvl='28' _area='air' _xp='10'>
<char _lvl='10'>Swordman</char>
<char _lvl='10'>Archer</char>
<char _lvl='9'>Spearman</char>
<char _lvl='8'>Knight</char>
<char _lvl='8'>Paladin</char>
<char _lvl='8'>Catapult</char>
<char _lvl='8'>Cannon</char>
<char _lvl='10'>Baloon1</char>
<char _lvl='10'>Baloon2</char>
<char _lvl='9'>Plane1</char>
<char _lvl='9'>Plane2</char>
</level>
<level _lvl='29' _area='air' _xp='6'>
<char _lvl='10'>Swordman</char>
<char _lvl='10'>Archer</char>
<char _lvl='9'>Spearman</char>
<char _lvl='9'>Knight</char>
<char _lvl='9'>Paladin</char>
<char _lvl='9'>Catapult</char>
<char _lvl='9'>Cannon</char>
<char _lvl='10'>Baloon1</char>
<char _lvl='10'>Baloon2</char>
<char _lvl='10'>Plane1</char>
<char _lvl='10'>Plane2</char>
</level>
<level _lvl='30' _area='land' _xp='5'>
<char _lvl='10'>Swordman</char>
<char _lvl='10'>Archer</char>
<char _lvl='10'>Spearman</char>
<char _lvl='10'>Knight</char>
<char _lvl='10'>Paladin</char>
<char _lvl='10'>Catapult</char>
<char _lvl='10'>Cannon</char>
</level>
</champ2>
<champ3>
<level _lvl='1' _area='land' _xp='0'>
<char _lvl='1'>Zombie</char>
</level>
<level _lvl='2' _area='land' _xp='2'>
<char _lvl='2'>Zombie</char>
<char _lvl='1'>Skeleton</char>
</level>
<level _lvl='3' _area='sea' _xp='2'>
<char _lvl='1'>Dracula</char>
<char _lvl='1'>Shark</char>
</level>
<level _lvl='4' _area='land' _xp='2'>
<char _lvl='2'>Zombie</char>
<char _lvl='1'>Skeleton</char>
<char _lvl='1'>Vampire</char>
</level>
<level _lvl='5' _area='air' _xp='3'>
<char _lvl='3'>Zombie</char>
<char _lvl='2'>Skeleton</char>
<char _lvl='1'>Vampire</char>
<char _lvl='1'>Dracula</char>
<char _lvl='1'>Eagle</char>
</level>
<level _lvl='6' _area='sea' _xp='4'>
<char _lvl='2'>Dracula</char>
<char _lvl='1'>Eagle</char>
<char _lvl='2'>Shark</char>
<char _lvl='1'>Whale</char>
</level>
<level _lvl='7' _area='air' _xp='4'>
<char _lvl='3'>Zombie</char>
<char _lvl='2'>Skeleton</char>
<char _lvl='1'>Vampire</char>
<char _lvl='2'>Dracula</char>
<char _lvl='2'>Eagle</char>
</level>
<level _lvl='8' _area='sea' _xp='4'>
<char _lvl='3'>Dracula</char>
<char _lvl='2'>Eagle</char>
<char _lvl='3'>Shark</char>
<char _lvl='2'>Whale</char>
<char _lvl='1'>Godship</char>
</level>
<level _lvl='9' _area='land' _xp='3'>
<char _lvl='4'>Zombie</char>
<char _lvl='3'>Skeleton</char>
<char _lvl='2'>Vampire</char>
<char _lvl='1'>Ogre</char>
</level>
<level _lvl='10' _area='land' _xp='4'>
<char _lvl='4'>Zombie</char>
<char _lvl='3'>Skeleton</char>
<char _lvl='3'>Vampire</char>
<char _lvl='2'>Ogre</char>
<char _lvl='1'>Darkevil</char>
</level>
<level _lvl='11' _area='air' _xp='4'>
<char _lvl='5'>Zombie</char>
<char _lvl='4'>Skeleton</char>
<char _lvl='3'>Vampire</char>
<char _lvl='2'>Ogre</char>
<char _lvl='1'>Darkevil</char>
<char _lvl='3'>Dracula</char>
<char _lvl='2'>Eagle</char>
<char _lvl='1'>Ghost</char>
</level>
<level _lvl='12' _area='land' _xp='3'>
<char _lvl='5'>Zombie</char>
<char _lvl='4'>Skeleton</char>
<char _lvl='4'>Vampire</char>
<char _lvl='3'>Ogre</char>
<char _lvl='2'>Darkevil</char>
</level>
<level _lvl='13' _area='air' _xp='7'>
<char _lvl='6'>Zombie</char>
<char _lvl='5'>Skeleton</char>
<char _lvl='4'>Vampire</char>
<char _lvl='3'>Ogre</char>
<char _lvl='2'>Darkevil</char>
<char _lvl='1'>Darkelf</char>
<char _lvl='4'>Dracula</char>
<char _lvl='3'>Eagle</char>
<char _lvl='1'>Ghost</char>
</level>
<level _lvl='14' _area='sea' _xp='5'>
<char _lvl='4'>Dracula</char>
<char _lvl='3'>Eagle</char>
<char _lvl='2'>Ghost</char>
<char _lvl='4'>Shark</char>
<char _lvl='3'>Whale</char>
<char _lvl='2'>Godship</char>
<char _lvl='1'>Ghostship</char>
</level>
<level _lvl='15' _area='air' _xp='8'>
<char _lvl='6'>Zombie</char>
<char _lvl='5'>Skeleton</char>
<char _lvl='5'>Vampire</char>
<char _lvl='4'>Ogre</char>
<char _lvl='3'>Darkevil</char>
<char _lvl='1'>Darkelf</char>
<char _lvl='5'>Dracula</char>
<char _lvl='4'>Eagle</char>
<char _lvl='2'>Ghost</char>
<char _lvl='1'>Dragon</char>
</level>
<level _lvl='16' _area='sea' _xp='7'>
<char _lvl='5'>Dracula</char>
<char _lvl='4'>Eagle</char>
<char _lvl='3'>Ghost</char>
<char _lvl='1'>Dragon</char>
<char _lvl='5'>Shark</char>
<char _lvl='4'>Whale</char>
<char _lvl='3'>Godship</char>
<char _lvl='2'>Ghostship</char>
</level>
<level _lvl='17' _area='air' _xp='7'>
<char _lvl='7'>Zombie</char>
<char _lvl='6'>Skeleton</char>
<char _lvl='5'>Vampire</char>
<char _lvl='4'>Ogre</char>
<char _lvl='3'>Darkevil</char>
<char _lvl='2'>Darkelf</char>
<char _lvl='6'>Dracula</char>
<char _lvl='5'>Eagle</char>
<char _lvl='3'>Ghost</char>
<char _lvl='2'>Dragon</char>
</level>
<level _lvl='18' _area='sea' _xp='6'>
<char _lvl='6'>Dracula</char>
<char _lvl='5'>Eagle</char>
<char _lvl='4'>Ghost</char>
<char _lvl='2'>Dragon</char>
<char _lvl='6'>Shark</char>
<char _lvl='5'>Whale</char>
<char _lvl='4'>Godship</char>
<char _lvl='3'>Ghostship</char>
</level>
<level _lvl='19' _area='sea' _xp='9'>
<char _lvl='7'>Dracula</char>
<char _lvl='6'>Eagle</char>
<char _lvl='4'>Ghost</char>
<char _lvl='3'>Dragon</char>
<char _lvl='7'>Shark</char>
<char _lvl='6'>Whale</char>
<char _lvl='5'>Godship</char>
<char _lvl='4'>Ghostship</char>
</level>
<level _lvl='20' _area='land' _xp='6'>
<char _lvl='7'>Zombie</char>
<char _lvl='6'>Skeleton</char>
<char _lvl='6'>Vampire</char>
<char _lvl='5'>Ogre</char>
<char _lvl='4'>Darkevil</char>
<char _lvl='3'>Darkelf</char>
<char _lvl='1'>Wizard</char>
</level>
<level _lvl='21' _area='air' _xp='7'>
<char _lvl='8'>Zombie</char>
<char _lvl='7'>Skeleton</char>
<char _lvl='6'>Vampire</char>
<char _lvl='5'>Ogre</char>
<char _lvl='4'>Darkevil</char>
<char _lvl='4'>Darkelf</char>
<char _lvl='2'>Wizard</char>
<char _lvl='7'>Dracula</char>
<char _lvl='6'>Eagle</char>
<char _lvl='5'>Ghost</char>
<char _lvl='4'>Dragon</char>
</level>
<level _lvl='22' _area='air' _xp='12'>
<char _lvl='8'>Zombie</char>
<char _lvl='7'>Skeleton</char>
<char _lvl='7'>Vampire</char>
<char _lvl='6'>Ogre</char>
<char _lvl='5'>Darkevil</char>
<char _lvl='5'>Darkelf</char>
<char _lvl='3'>Wizard</char>
<char _lvl='8'>Dracula</char>
<char _lvl='7'>Eagle</char>
<char _lvl='5'>Ghost</char>
<char _lvl='5'>Dragon</char>
</level>
<level _lvl='23' _area='air' _xp='7'>
<char _lvl='9'>Zombie</char>
<char _lvl='8'>Skeleton</char>
<char _lvl='7'>Vampire</char>
<char _lvl='6'>Ogre</char>
<char _lvl='6'>Darkevil</char>
<char _lvl='6'>Darkelf</char>
<char _lvl='4'>Wizard</char>
<char _lvl='8'>Dracula</char>
<char _lvl='7'>Eagle</char>
<char _lvl='6'>Ghost</char>
<char _lvl='6'>Dragon</char>
</level>
<level _lvl='24' _area='sea' _xp='9'>
<char _lvl='9'>Dracula</char>
<char _lvl='8'>Eagle</char>
<char _lvl='7'>Ghost</char>
<char _lvl='7'>Dragon</char>
<char _lvl='8'>Shark</char>
<char _lvl='7'>Whale</char>
<char _lvl='6'>Godship</char>
<char _lvl='5'>Ghostship</char>
</level>
<level _lvl='25' _area='sea' _xp='7'>
<char _lvl='9'>Dracula</char>
<char _lvl='8'>Eagle</char>
<char _lvl='8'>Ghost</char>
<char _lvl='8'>Dragon</char>
<char _lvl='9'>Shark</char>
<char _lvl='8'>Whale</char>
<char _lvl='7'>Godship</char>
<char _lvl='6'>Ghostship</char>
</level>
<level _lvl='26' _area='land' _xp='6'>
<char _lvl='9'>Zombie</char>
<char _lvl='8'>Skeleton</char>
<char _lvl='8'>Vampire</char>
<char _lvl='7'>Ogre</char>
<char _lvl='7'>Darkevil</char>
<char _lvl='7'>Darkelf</char>
<char _lvl='5'>Wizard</char>
</level>
<level _lvl='27' _area='sea' _xp='8'>
<char _lvl='10'>Dracula</char>
<char _lvl='9'>Eagle</char>
<char _lvl='9'>Ghost</char>
<char _lvl='9'>Dragon</char>
<char _lvl='10'>Shark</char>
<char _lvl='9'>Whale</char>
<char _lvl='8'>Godship</char>
<char _lvl='7'>Ghostship</char>
</level>
<level _lvl='28' _area='land' _xp='7'>
<char _lvl='10'>Zombie</char>
<char _lvl='9'>Skeleton</char>
<char _lvl='8'>Vampire</char>
<char _lvl='8'>Ogre</char>
<char _lvl='8'>Darkevil</char>
<char _lvl='8'>Darkelf</char>
<char _lvl='6'>Wizard</char>
</level>
<level _lvl='29' _area='air' _xp='8'>
<char _lvl='10'>Zombie</char>
<char _lvl='9'>Skeleton</char>
<char _lvl='9'>Vampire</char>
<char _lvl='9'>Ogre</char>
<char _lvl='9'>Darkevil</char>
<char _lvl='9'>Darkelf</char>
<char _lvl='7'>Wizard</char>
<char _lvl='10'>Dracula</char>
<char _lvl='10'>Eagle</char>
<char _lvl='10'>Ghost</char>
<char _lvl='10'>Dragon</char>
</level>
<level _lvl='30' _area='land' _xp='6'>
<char _lvl='10'>Zombie</char>
<char _lvl='10'>Skeleton</char>
<char _lvl='10'>Vampire</char>
<char _lvl='10'>Ogre</char>
<char _lvl='10'>Darkevil</char>
<char _lvl='10'>Darkelf</char>
<char _lvl='8'>Wizard</char>
</level>
</champ3>
<champ4>
<level _lvl='1' _area='land' _xp='0'>
<char _lvl='1'>Zombie</char>
<char _lvl='1'>Skeleton</char>
</level>
<level _lvl='2' _area='land' _xp='2'>
<char _lvl='2'>Zombie</char>
<char _lvl='2'>Skeleton</char>
</level>
<level _lvl='3' _area='sea' _xp='2'>
<char _lvl='1'>Dracula</char>
<char _lvl='1'>Shark</char>
</level>
<level _lvl='4' _area='sea' _xp='3'>
<char _lvl='2'>Dracula</char>
<char _lvl='2'>Shark</char>
</level>
<level _lvl='5' _area='land' _xp='2'>
<char _lvl='2'>Zombie</char>
<char _lvl='2'>Skeleton</char>
<char _lvl='1'>Vampire</char>
</level>
<level _lvl='6' _area='sea' _xp='2'>
<char _lvl='2'>Dracula</char>
<char _lvl='1'>Eagle</char>
<char _lvl='2'>Shark</char>
<char _lvl='1'>Whale</char>
</level>
<level _lvl='7' _area='sea' _xp='3'>
<char _lvl='3'>Dracula</char>
<char _lvl='1'>Eagle</char>
<char _lvl='3'>Shark</char>
<char _lvl='1'>Whale</char>
</level>
<level _lvl='8' _area='sea' _xp='3'>
<char _lvl='3'>Dracula</char>
<char _lvl='2'>Eagle</char>
<char _lvl='3'>Shark</char>
<char _lvl='2'>Whale</char>
<char _lvl='1'>Godship</char>
</level>
<level _lvl='9' _area='air' _xp='6'>
<char _lvl='3'>Zombie</char>
<char _lvl='3'>Skeleton</char>
<char _lvl='2'>Vampire</char>
<char _lvl='1'>Ogre</char>
<char _lvl='4'>Dracula</char>
<char _lvl='2'>Eagle</char>
<char _lvl='1'>Ghost</char>
</level>
<level _lvl='10' _area='land' _xp='3'>
<char _lvl='3'>Zombie</char>
<char _lvl='3'>Skeleton</char>
<char _lvl='3'>Vampire</char>
<char _lvl='2'>Ogre</char>
</level>
<level _lvl='11' _area='sea' _xp='3'>
<char _lvl='4'>Dracula</char>
<char _lvl='3'>Eagle</char>
<char _lvl='1'>Ghost</char>
<char _lvl='4'>Shark</char>
<char _lvl='2'>Whale</char>
<char _lvl='1'>Godship</char>
<char _lvl='1'>Ghostship</char>
</level>
<level _lvl='12' _area='sea' _xp='5'>
<char _lvl='5'>Dracula</char>
<char _lvl='3'>Eagle</char>
<char _lvl='2'>Ghost</char>
<char _lvl='4'>Shark</char>
<char _lvl='3'>Whale</char>
<char _lvl='2'>Godship</char>
<char _lvl='1'>Ghostship</char>
</level>
<level _lvl='13' _area='air' _xp='7'>
<char _lvl='4'>Zombie</char>
<char _lvl='4'>Skeleton</char>
<char _lvl='3'>Vampire</char>
<char _lvl='3'>Ogre</char>
<char _lvl='1'>Darkevil</char>
<char _lvl='5'>Dracula</char>
<char _lvl='4'>Eagle</char>
<char _lvl='2'>Ghost</char>
<char _lvl='1'>Dragon</char>
</level>
<level _lvl='14' _area='land' _xp='7'>
<char _lvl='5'>Zombie</char>
<char _lvl='5'>Skeleton</char>
<char _lvl='4'>Vampire</char>
<char _lvl='4'>Ogre</char>
<char _lvl='2'>Darkevil</char>
</level>
<level _lvl='15' _area='sea' _xp='5'>
<char _lvl='6'>Dracula</char>
<char _lvl='4'>Eagle</char>
<char _lvl='3'>Ghost</char>
<char _lvl='1'>Dragon</char>
<char _lvl='5'>Shark</char>
<char _lvl='3'>Whale</char>
<char _lvl='2'>Godship</char>
<char _lvl='2'>Ghostship</char>
</level>
<level _lvl='16' _area='air' _xp='10'>
<char _lvl='5'>Zombie</char>
<char _lvl='5'>Skeleton</char>
<char _lvl='5'>Vampire</char>
<char _lvl='5'>Ogre</char>
<char _lvl='3'>Darkevil</char>
<char _lvl='1'>Darkelf</char>
<char _lvl='6'>Dracula</char>
<char _lvl='5'>Eagle</char>
<char _lvl='3'>Ghost</char>
<char _lvl='2'>Dragon</char>
</level>
<level _lvl='17' _area='sea' _xp='4'>
<char _lvl='7'>Dracula</char>
<char _lvl='5'>Eagle</char>
<char _lvl='4'>Ghost</char>
<char _lvl='2'>Dragon</char>
<char _lvl='5'>Shark</char>
<char _lvl='4'>Whale</char>
<char _lvl='3'>Godship</char>
<char _lvl='2'>Ghostship</char>
</level>
<level _lvl='18' _area='land' _xp='6'>
<char _lvl='6'>Zombie</char>
<char _lvl='6'>Skeleton</char>
<char _lvl='6'>Vampire</char>
<char _lvl='6'>Ogre</char>
<char _lvl='4'>Darkevil</char>
<char _lvl='2'>Darkelf</char>
</level>
<level _lvl='19' _area='sea' _xp='5'>
<char _lvl='7'>Dracula</char>
<char _lvl='6'>Eagle</char>
<char _lvl='4'>Ghost</char>
<char _lvl='3'>Dragon</char>
<char _lvl='6'>Shark</char>
<char _lvl='4'>Whale</char>
<char _lvl='3'>Godship</char>
<char _lvl='3'>Ghostship</char>
</level>
<level _lvl='20' _area='air' _xp='11'>
<char _lvl='7'>Zombie</char>
<char _lvl='7'>Skeleton</char>
<char _lvl='7'>Vampire</char>
<char _lvl='7'>Ogre</char>
<char _lvl='5'>Darkevil</char>
<char _lvl='3'>Darkelf</char>
<char _lvl='1'>Wizard</char>
<char _lvl='8'>Dracula</char>
<char _lvl='6'>Eagle</char>
<char _lvl='5'>Ghost</char>
<char _lvl='3'>Dragon</char>
</level>
<level _lvl='21' _area='sea' _xp='6'>
<char _lvl='8'>Dracula</char>
<char _lvl='7'>Eagle</char>
<char _lvl='5'>Ghost</char>
<char _lvl='4'>Dragon</char>
<char _lvl='6'>Shark</char>
<char _lvl='5'>Whale</char>
<char _lvl='4'>Godship</char>
<char _lvl='4'>Ghostship</char>
</level>
<level _lvl='22' _area='sea' _xp='8'>
<char _lvl='9'>Dracula</char>
<char _lvl='7'>Eagle</char>
<char _lvl='6'>Ghost</char>
<char _lvl='4'>Dragon</char>
<char _lvl='7'>Shark</char>
<char _lvl='5'>Whale</char>
<char _lvl='5'>Godship</char>
<char _lvl='5'>Ghostship</char>
</level>
<level _lvl='23' _area='air' _xp='10'>
<char _lvl='8'>Zombie</char>
<char _lvl='8'>Skeleton</char>
<char _lvl='8'>Vampire</char>
<char _lvl='8'>Ogre</char>
<char _lvl='6'>Darkevil</char>
<char _lvl='4'>Darkelf</char>
<char _lvl='2'>Wizard</char>
<char _lvl='9'>Dracula</char>
<char _lvl='8'>Eagle</char>
<char _lvl='6'>Ghost</char>
<char _lvl='5'>Dragon</char>
</level>
<level _lvl='24' _area='sea' _xp='6'>
<char _lvl='10'>Dracula</char>
<char _lvl='8'>Eagle</char>
<char _lvl='7'>Ghost</char>
<char _lvl='6'>Dragon</char>
<char _lvl='7'>Shark</char>
<char _lvl='6'>Whale</char>
<char _lvl='6'>Godship</char>
<char _lvl='6'>Ghostship</char>
</level>
<level _lvl='25' _area='sea' _xp='7'>
<char _lvl='10'>Dracula</char>
<char _lvl='9'>Eagle</char>
<char _lvl='7'>Ghost</char>
<char _lvl='7'>Dragon</char>
<char _lvl='8'>Shark</char>
<char _lvl='7'>Whale</char>
<char _lvl='7'>Godship</char>
<char _lvl='7'>Ghostship</char>
</level>
<level _lvl='26' _area='land' _xp='8'>
<char _lvl='9'>Zombie</char>
<char _lvl='9'>Skeleton</char>
<char _lvl='9'>Vampire</char>
<char _lvl='9'>Ogre</char>
<char _lvl='7'>Darkevil</char>
<char _lvl='5'>Darkelf</char>
<char _lvl='3'>Wizard</char>
</level>
<level _lvl='27' _area='sea' _xp='5'>
<char _lvl='10'>Dracula</char>
<char _lvl='9'>Eagle</char>
<char _lvl='8'>Ghost</char>
<char _lvl='8'>Dragon</char>
<char _lvl='8'>Shark</char>
<char _lvl='8'>Whale</char>
<char _lvl='8'>Godship</char>
<char _lvl='8'>Ghostship</char>
</level>
<level _lvl='28' _area='sea' _xp='8'>
<char _lvl='10'>Dracula</char>
<char _lvl='10'>Eagle</char>
<char _lvl='9'>Ghost</char>
<char _lvl='9'>Dragon</char>
<char _lvl='9'>Shark</char>
<char _lvl='9'>Whale</char>
<char _lvl='9'>Godship</char>
<char _lvl='9'>Ghostship</char>
</level>
<level _lvl='29' _area='sea' _xp='6'>
<char _lvl='10'>Dracula</char>
<char _lvl='10'>Eagle</char>
<char _lvl='10'>Ghost</char>
<char _lvl='10'>Dragon</char>
<char _lvl='10'>Shark</char>
<char _lvl='10'>Whale</char>
<char _lvl='10'>Godship</char>
<char _lvl='10'>Ghostship</char>
</level>
<level _lvl='30' _area='land' _xp='7'>
<char _lvl='10'>Zombie</char>
<char _lvl='10'>Skeleton</char>
<char _lvl='10'>Vampire</char>
<char _lvl='10'>Ogre</char>
<char _lvl='8'>Darkevil</char>
<char _lvl='6'>Darkelf</char>
<char _lvl='4'>Wizard</char>
</level>
</champ4>
</mylevel>
;
mychardata = <mychar>
<champ1 _gold='3500'>
<char _id='Zombie'>1</char>
<char _id='Skeleton'>1</char>
<char _id='Vampire'>4</char>
<char _id='Ogre'>7</char>
<char _id='Darkevil'>13</char>
<char _id='Darkelf'>10</char>
<char _id='Wizard'>19</char>
<char _id='Dracula'>1</char>
<char _id='Eagle'>4</char>
<char _id='Ghost'>7</char>
<char _id='Dragon'>10</char>
<char _id='Shark'>1</char>
<char _id='Whale'>4</char>
<char _id='Godship'>7</char>
<char _id='Ghostship'>10</char>
</champ1>
<champ2 _gold='3000'>
<char _id='Zombie'>1</char>
<char _id='Skeleton'>1</char>
<char _id='Vampire'>4</char>
<char _id='Ogre'>10</char>
<char _id='Darkevil'>16</char>
<char _id='Darkelf'>13</char>
<char _id='Wizard'>19</char>
<char _id='Dracula'>1</char>
<char _id='Eagle'>5</char>
<char _id='Ghost'>9</char>
<char _id='Dragon'>15</char>
<char _id='Shark'>1</char>
<char _id='Whale'>5</char>
<char _id='Godship'>8</char>
<char _id='Ghostship'>14</char>
</champ2>
<champ3 _gold='2500'>
<char _id='Swordman'>1</char>
<char _id='Archer'>1</char>
<char _id='Spearman'>4</char>
<char _id='Knight'>7</char>
<char _id='Paladin'>10</char>
<char _id='Catapult'>13</char>
<char _id='Cannon'>20</char>
<char _id='Baloon1'>1</char>
<char _id='Baloon2'>5</char>
<char _id='Plane1'>8</char>
<char _id='Plane2'>13</char>
<char _id='Vikingship'>1</char>
<char _id='Romanship'>6</char>
<char _id='Persianship'>8</char>
<char _id='Greekship'>14</char>
</champ3>
<champ4 _gold='2000'>
<char _id='Swordman'>1</char>
<char _id='Archer'>1</char>
<char _id='Spearman'>5</char>
<char _id='Knight'>9</char>
<char _id='Paladin'>13</char>
<char _id='Catapult'>16</char>
<char _id='Cannon'>20</char>
<char _id='Baloon1'>1</char>
<char _id='Baloon2'>6</char>
<char _id='Plane1'>9</char>
<char _id='Plane2'>13</char>
<char _id='Vikingship'>1</char>
<char _id='Romanship'>6</char>
<char _id='Persianship'>8</char>
<char _id='Greekship'>11</char>
</champ4>
</mychar>
;
super();
}
public function GetMyGold(_arg1:int):Number{
_arg1--;
return (Number(mychardata.children()[_arg1].attribute("_gold")));
}
public function GetUnlockLevel(_arg1:int):Array{
var _local2:int;
var _local3:int;
var _local4:Array;
var _local5:int;
_local4 = new Array();
_arg1--;
_local2 = mychardata.children()[_arg1].children().length();
_local5 = 0;
while (_local5 < _local2) {
_local3 = int(mychardata.children()[_arg1].children()[_local5]);
_local4.push(_local3);
_local5++;
};
return (_local4);
}
public function SetWeakAiHp(_arg1:uint):uint{
return (hpAiAfterLose[_arg1]);
}
public function GetUpgradePoin(_arg1:int, _arg2:int):int{
_arg1--;
_arg2--;
return (int(leveldata.children()[_arg1].children()[_arg2].attribute("_xp")));
}
public function GetAvailableChar(_arg1:int, _arg2:int):Array{
var _local3:Object;
var _local4:int;
var _local5:Array;
var _local6:String;
var _local7:int;
_local5 = new Array();
_arg1--;
_arg2--;
_local4 = leveldata.children()[_arg1].children()[_arg2].children().length();
_local7 = 0;
while (_local7 < _local4) {
_local3 = new Object();
_local6 = leveldata.children()[_arg1].children()[_arg2].children()[_local7];
_local3.id = _local6;
_local3.lvl = leveldata.children()[_arg1].children()[_arg2].children()[_local7].attribute("_lvl");
_local3.stime = charAttrib.GetAttribute(_local6.toLowerCase(), "spwn");
_local3.price = charAttrib.GetAttribute(_local6.toLowerCase(), "price");
if (_local3.lvl == 5){
_local3.skill = 1;
} else {
_local3.skill = 0;
};
_local5.push(_local3);
_local7++;
};
return (_local5);
}
public function GetAiHpConf(_arg1:int, _arg2:uint):uint{
var _local3:int;
_local3 = 0;
if (_arg1 == 1){
_local3 = hpAiConfEasy[_arg2];
} else {
if ((((_arg1 == 2)) || ((_arg1 == 3)))){
_local3 = hpAiConfNormal[_arg2];
} else {
_local3 = hpAiConfHard[_arg2];
};
};
return (_local3);
}
public function GetMyChar(_arg1:int, _arg2:Array):Array{
var _local3:Array;
var _local4:String;
var _local5:int;
var _local6:int;
_local3 = new Array();
_arg1--;
_local5 = mychardata.children()[_arg1].children().length();
_local6 = 0;
while (_local6 < _arg2.length) {
if (_arg2[_local6]){
_local4 = mychardata.children()[_arg1].children()[_local6].attribute("_id");
_local3.push(_local4);
};
_local6++;
};
return (_local3);
}
public function GetBattleArea(_arg1:int, _arg2:int):String{
_arg1--;
_arg2--;
return (leveldata.children()[_arg1].children()[_arg2].attribute("_area"));
}
}
}//package
Section 216
//CLogo (CLogo)
package {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public class CLogo extends MovieClip {
private var url:String;// = ""
private var req:URLRequest;
public function CLogo(){
url = "";
super();
buttonMode = true;
}
public function Init(_arg1:String=""):void{
url = _arg1;
req = new URLRequest(url);
addEventListener(MouseEvent.CLICK, OnClick, false, 0, true);
}
public function OnClick(_arg1:MouseEvent):void{
navigateToURL(req, "_blank");
}
}
}//package
Section 217
//CMain (CMain)
package {
import flash.events.*;
import flash.display.*;
import com.newgrounds.*;
import com.newgrounds.components.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import CPMStar.*;
import flash.text.*;
import flash.xml.*;
public class CMain extends MovieClip {
private var mscColl:Array;
public var aiTroop:int;
private var classRef:Class;
private var tmpGold:Number;
private var mscVol:Number;// = 1
public var scr:Object;
public var ad:DisplayObject;
private var nMscPlay:uint;// = 0
private var bgChn:SoundChannel;
public var myGold:Number;
public var firstKill:Boolean;
public var mscOn:Boolean;// = true
public var percent:Number;
public var charUnlock:Array;
public var __setPropDict:Dictionary;
private var bgXmlData:XML;
public var charPanel:Object;
public var splash:logoBG;
public var myTroopOut:int;
public var __id0_:APIConnector;
public var isStopGame:Boolean;
public var maxTroop:int;
public var tmpCharUpgrade:Array;
public var tmpCharLevel:Array;
private var bgVol:Number;
public var dataDate:String;
private var sndRef:Class;
public var aiHpConf:Number;
public var tmpUpPoin:uint;
public var status_txt:TextField;
public var CPMStarContentSpotID:String;
public var btPlay:SimpleButton;
public var adBox:MovieClip;
public var downloadSize:Number;
private var frames:int;// = 0
public var aiGold:Number;
public var tmpCharUnlock:Array;
private var inGame:Boolean;// = false
public var gameLevel:int;
public var myMedal:Array;
private var nLose:uint;
public var myColl:Array;
public var canUnlockChar:Array;
public var bgError:domainError;
private var prevTimer:Number;// = 0
private var curTimer:Number;// = 0
public var aiTroopOut:int;
private var sFlg:int;
public var quality:uint;// = 1
public var tempGSLost:Array;
public var nTurret:int;
public var myTroop:int;
public var atBound:Boolean;// = false
public var isPause:Boolean;
public var baseAttrib:Array;
public var firstWin:Boolean;
public var bgType:int;
public var baseLevel:uint;
public var aiColl:Array;
public var tempGSKill:Array;
private var txtBox:TextField;
private var aiStrategyColl:Array;
private var zz:int;// = 0
public var mcMouseCL:MovieClip;
private var isLose:Boolean;
private var medalData:SharedObject;
public var mcMouseCR:MovieClip;
public var gameStat:Array;
private var layer:Layer;
public var myUpPoin:uint;
public var tmpSkillUnlock:Array;
public var levelAttrib:CLevelAttrib;
private var runTimer:Timer;
public var sndOn:Boolean;// = true
public var totalSize:Number;
private var tSound:Timer;
public var snd:Object;
private var myData:SharedObject;
private var sndBuff:Array;
public var panelActIcon1:PanelActIcon;
public var panelActIcon2:PanelActIcon;
public var mapId:int;
private var me:MenuBtn;
private var mg:MoreGamesBtn;
public var dataDateColl:Array;
public var baseType:int;
public var aiStrategy:int;
public var bgContainer:Object;
public var curScr:String;
public var charLevel:Array;
private var bgPart:Object;
public var charUpgrade:Array;
public var tmpBaseLevel:uint;
public var logo1:logo_bg;
public var win:int;
private var nBgPart:int;
public function CMain(){
__setPropDict = new Dictionary(true);
bgXmlData = <bg>
<type id='1'>
<part id='BGPART11' xp='0' yp='500' sp='1'/>
<part id='BGPART12' xp='0' yp='289.3' sp='0.8'/>
<part id='BGPART13' xp='0' yp='265.7' sp='0.7'/>
<part id='BGPART14' xp='0' yp='294' sp='0.6'/>
</type>
<type id='2'>
<part id='BGPART21' xp='0' yp='500' sp='1'/>
<part id='BGPART22' xp='0' yp='282' sp='0.6'/>
</type>
<type id='3'>
<part id='BGPART31' xp='0' yp='500' sp='1'/>
<part id='BGPART32' xp='0' yp='442' sp='0.7'/>
<part id='BGPART33' xp='0' yp='421' sp='0.6'/>
</type>
<type id='1'>
<part id='BGPART15' xp='0' yp='500' sp='1'/>
<part id='BGPART16' xp='0' yp='267' sp='0.7'/>
<part id='BGPART17' xp='0' yp='375' sp='0.6'/>
</type>
<type id='1'>
<part id='BGPART41' xp='-800' yp='500' sp='1'/>
<part id='BGPART42' xp='-639' yp='308.7' sp='0.8'/>
<part id='BGPART43' xp='-479' yp='274.1' sp='0.6'/>
</type>
<type id='2'>
<part id='BGPART51' xp='-800' yp='500' sp='1'/>
<part id='BGPART52' xp='-479' yp='291.9' sp='0.6'/>
</type>
<type id='3'>
<part id='BGPART61' xp='-800' yp='500' sp='1'/>
<part id='BGPART62' xp='-555' yp='422' sp='0.7'/>
<part id='BGPART63' xp='-478' yp='411' sp='0.6'/>
</type>
<type id='1'>
<part id='BGPART44' xp='-800' yp='500' sp='1'/>
<part id='BGPART45' xp='-556' yp='270' sp='0.7'/>
<part id='BGPART46' xp='-477' yp='365' sp='0.6'/>
</type>
</bg>
;
atBound = false;
baseAttrib = [0, 1, 2, 4, 8, 16, 32, 64, 128, 0x0100, 0x0200];
aiStrategyColl = [0, 1, 1, 2, 0, 1, 2, 0, 1, 1, 2, 0, 1, 2, 0, 1, 1, 2, 0, 1, 2, 1, 2, 2, 0, 0, 1, 2, 1, 2, 0];
mscOn = true;
sndOn = true;
quality = 1;
frames = 0;
prevTimer = 0;
curTimer = 0;
zz = 0;
mscColl = new Array();
mscVol = 1;
nMscPlay = 0;
inGame = false;
super();
addFrameScript(0, frame1, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 1, frame2, 2, frame3, 3, frame4);
stage.frameRate = 30;
}
private function MouseUp(_arg1:Event):void{
SetSpeedBg(1);
ScrollBg(sFlg);
}
public function PlayTheGame(_arg1:MouseEvent):void{
var _local2:String;
var _local3:Number;
var _local4:Number;
var _local5:String;
var _local6:Number;
var _local7:Number;
if (((!((adBox == null))) && (!((ad == null))))){
adBox.removeChild(ad);
removeChild(adBox);
};
_local2 = stage.loaderInfo.url;
_local3 = (_local2.indexOf("://") + 3);
_local4 = _local2.indexOf("/", _local3);
_local5 = _local2.substring(_local3, _local4);
_local6 = (_local5.lastIndexOf(".") - 1);
_local7 = (_local5.lastIndexOf(".", _local6) + 1);
_local5 = _local5.substring(_local7, _local5.length);
gotoAndStop(1, "splash");
}
public function RemoveBg():void{
var _local1:int;
_local1 = (nBgPart - 1);
while (_local1 > 0) {
if (DisplayObject(getChildByName(("bg" + int((_local1 + 1))))) != null){
removeChild(DisplayObject(getChildByName(("bg" + int((_local1 + 1))))));
};
_local1--;
};
removeChild(DisplayObject(bgContainer));
removeChild(DisplayObject(charPanel));
removeChild(layer);
}
public function IncSndVol():void{
tSound = new Timer(100);
tSound.start();
tSound.addEventListener(TimerEvent.TIMER, IncreasingVolume, false, 0, true);
}
private function ScrollBg(_arg1:int):void{
var _local2:int;
_local2 = 1;
while (_local2 <= nBgPart) {
MovieClip(getChildByName(("bg" + _local2))).ScrollBg(_arg1);
_local2++;
};
}
public function SaveMedalData():void{
medalData = SharedObject.getLocal("medal");
medalData.data.mymedal = myMedal;
medalData.flush();
medalData.close();
}
private function SetBg(_arg1:int, _arg2:int):void{
var _local3:String;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:int;
var _local8:int;
nBgPart = bgXmlData.children()[_arg2].child("part").length();
_local7 = bgXmlData.children()[_arg2].attribute("id");
_local8 = (nBgPart - 1);
while (_local8 > 0) {
_local3 = bgXmlData.children()[_arg2].children()[_local8].attribute("id");
_local4 = bgXmlData.children()[_arg2].children()[_local8].attribute("xp");
_local5 = bgXmlData.children()[_arg2].children()[_local8].attribute("yp");
_local6 = (bgXmlData.children()[_arg2].children()[_local8].attribute("sp") * 5);
classRef = (getDefinitionByName(_local3) as Class);
bgPart = new classRef();
addChild(DisplayObject(bgPart));
bgPart.name = ("bg" + int((_local8 + 1)));
bgPart.x = _local4;
bgPart.y = _local5;
bgPart.Init(_local6);
_local8--;
};
_local3 = bgXmlData.children()[_arg2].children()[0].attribute("id");
_local4 = bgXmlData.children()[_arg2].children()[0].attribute("xp");
_local5 = bgXmlData.children()[_arg2].children()[0].attribute("yp");
_local6 = (bgXmlData.children()[_arg2].children()[0].attribute("sp") * 5);
classRef = (getDefinitionByName(_local3) as Class);
bgContainer = new classRef();
addChild(DisplayObject(bgContainer));
bgContainer.name = "bg1";
bgContainer.x = _local4;
bgContainer.y = _local5;
bgContainer.Init(_arg1, _local7, _local6);
layer = new Layer();
addChild(layer);
classRef = (getDefinitionByName(("CharPanel" + _arg1)) as Class);
charPanel = new classRef();
addChild(DisplayObject(charPanel));
charPanel.Init(_arg1);
charPanel.name = "cpanel";
charPanel.x = 0;
charPanel.y = 480;
}
public function TurnOnMusic():void{
mscOn = true;
if (!inGame){
PlayBgSound2(1, bgVol);
} else {
PlayBgSound(0);
};
}
public function StopBgSoundEvent():void{
if (bgChn != null){
bgChn.removeEventListener(Event.SOUND_COMPLETE, LoopMusic);
bgChn = null;
};
}
public function SetNGMedal(_arg1:int):void{
if (_arg1 == 1){
API.unlockMedal("First Blood");
trace("berhasil1");
} else {
if (_arg1 == 2){
API.unlockMedal("Win first time");
trace("berhasil2");
} else {
if (_arg1 == 3){
API.unlockMedal("Half Battle");
} else {
if (_arg1 == 4){
API.unlockMedal("Completed");
};
};
};
};
}
private function SetSpeedBg(_arg1:int):void{
var _local2:int;
_local2 = 1;
while (_local2 <= nBgPart) {
MovieClip(getChildByName(("bg" + _local2))).SetSpeed(_arg1);
_local2++;
};
}
private function MoreGames(_arg1:MouseEvent):void{
var _local2:URLRequest;
_local2 = new URLRequest("http://www.belugerinstudios.com/");
navigateToURL(_local2, "_blank");
}
public function PlaySound(_arg1:String, _arg2:Number=1, _arg3:int=0):void{
var _local4:Object;
var _local5:SoundChannel;
var _local6:SoundTransform;
if (sndOn){
if ((((_arg1 == "88")) || ((_arg1 == "99")))){
sndRef = (getDefinitionByName(("snd" + _arg1)) as Class);
_local4 = new sndRef();
_local5 = _local4.play(0, _arg3);
return;
};
if (!sndBuff[int(_arg1)]){
sndBuff[int(_arg1)] = true;
sndRef = (getDefinitionByName(("snd" + _arg1)) as Class);
_local4 = new sndRef();
_local5 = _local4.play(0, _arg3);
_local6 = new SoundTransform(_arg2, 0);
_local5.soundTransform = _local6;
};
};
}
function frame6(){
bgError.Init("http://www.belugerinstudios.com/");
}
function frame1(){
if ((((__setPropDict[__id0_] == undefined)) || (!((((int(__setPropDict[__id0_]) >= 1)) && ((int(__setPropDict[__id0_]) <= 5))))))){
__setPropDict[__id0_] = currentFrame;
__setProp___id0__preloader_Layer15_1();
};
stop();
logo1.Init("http://www.belugerinstudios.com/");
CPMStarContentSpotID = "2886Q744DE5F5";
ad = new AdLoader(CPMStarContentSpotID);
adBox.addChild(ad);
addEventListener(Event.ENTER_FRAME, Loading, false, 0, true);
}
function frame4(){
if ((((__setPropDict[__id0_] == undefined)) || (!((((int(__setPropDict[__id0_]) >= 1)) && ((int(__setPropDict[__id0_]) <= 5))))))){
__setPropDict[__id0_] = currentFrame;
__setProp___id0__preloader_Layer15_1();
};
}
public function StartANewGame():void{
var _local1:int;
levelAttrib = new CLevelAttrib();
aiColl = new Array();
aiColl = levelAttrib.GetAvailableChar(mapId, gameLevel);
myColl = new Array();
myColl = levelAttrib.GetMyChar(mapId, charUnlock);
if (!isLose){
aiHpConf = (levelAttrib.GetAiHpConf(mapId, gameLevel) / 100);
} else {
aiHpConf = ((levelAttrib.GetAiHpConf(mapId, gameLevel) / 100) + (levelAttrib.SetWeakAiHp(nLose) / 100));
nLose--;
};
aiStrategy = aiStrategyColl[gameLevel];
if (mapId == 4){
aiGold = (2500 + ((gameLevel * 1000) * 2));
} else {
aiGold = (2500 + (gameLevel * 1000));
};
SetBg(baseType, bgType);
sFlg = 0;
aiTroopOut = 0;
myTroopOut = 0;
win = 0;
setChildIndex(mcMouseCL, (numChildren - 1));
setChildIndex(mcMouseCR, (numChildren - 1));
mcMouseCL.addEventListener(MouseEvent.ROLL_OVER, RollOver, false, 0, true);
mcMouseCL.addEventListener(MouseEvent.ROLL_OUT, RollOut, false, 0, true);
mcMouseCL.addEventListener(MouseEvent.MOUSE_DOWN, MouseDown, false, 0, true);
mcMouseCL.addEventListener(MouseEvent.MOUSE_UP, MouseUp, false, 0, true);
mcMouseCR.addEventListener(MouseEvent.ROLL_OVER, RollOver, false, 0, true);
mcMouseCR.addEventListener(MouseEvent.ROLL_OUT, RollOut, false, 0, true);
mcMouseCR.addEventListener(MouseEvent.MOUSE_DOWN, MouseDown, false, 0, true);
mcMouseCR.addEventListener(MouseEvent.MOUSE_UP, MouseUp, false, 0, true);
stage.addEventListener(Event.MOUSE_LEAVE, MouseLeave, false, 0, true);
mg = new MoreGamesBtn();
addChild(mg);
mg.x = 400;
mg.y = 12;
mg.scaleX = (mg.scaleY = 0.75);
mg.addEventListener(MouseEvent.CLICK, MoreGames, false, 0, true);
me = new MenuBtn();
addChild(me);
me.x = 400;
me.y = 35;
me.scaleX = (me.scaleY = 0.75);
me.addEventListener(MouseEvent.CLICK, Pause, false, 0, true);
mouseEnabled = false;
isStopGame = false;
isPause = false;
tempGSKill = new Array();
tempGSKill = [0, 0, 0, 0];
tempGSLost = new Array();
tempGSLost = [0, 0, 0, 0];
panelActIcon1 = new PanelActIcon();
addChild(panelActIcon1);
panelActIcon1.x = 0;
panelActIcon1.y = 0;
panelActIcon2 = new PanelActIcon();
addChild(panelActIcon2);
panelActIcon2.x = 800;
panelActIcon2.y = 0;
inGame = true;
sndBuff = new Array();
_local1 = 1;
while (_local1 <= 24) {
sndBuff[_local1] = false;
_local1++;
};
runTimer = new Timer(25);
runTimer.start();
runTimer.addEventListener(TimerEvent.TIMER, EnterFrame, false, 0, true);
}
public function SetQuality(_arg1:uint):void{
if (_arg1 == 1){
stage.quality = StageQuality.HIGH;
} else {
if (_arg1 == 2){
stage.quality = StageQuality.MEDIUM;
} else {
if (_arg1 == 3){
stage.quality = StageQuality.LOW;
};
};
};
quality = _arg1;
}
function frame3(){
if ((((__setPropDict[__id0_] == undefined)) || (!((((int(__setPropDict[__id0_]) >= 1)) && ((int(__setPropDict[__id0_]) <= 5))))))){
__setPropDict[__id0_] = currentFrame;
__setProp___id0__preloader_Layer15_1();
};
}
function frame8(){
MainMenu();
}
public function GetBaseHp(_arg1:int):int{
var _local2:Array;
_local2 = [0, 100, 200, 400, 700, 1100, 1600, 2200, 2900, 3700, 4600];
return (_local2[_arg1]);
}
function frame7(){
splash.Init("http://www.belugerinstudios.com/");
splash.gotoAndPlay(2);
}
private function IncreasingVolume(_arg1:TimerEvent):void{
var _local2:SoundTransform;
if (mscOn){
_local2 = bgChn.soundTransform;
mscVol = (mscVol + 0.1);
_local2.volume = mscVol;
bgChn.soundTransform = _local2;
if (mscVol >= 0.75){
mscVol = 0.75;
tSound.stop();
tSound.removeEventListener(TimerEvent.TIMER, IncreasingVolume);
};
};
}
private function Factorial(_arg1:int):Number{
var _local2:Number;
_local2 = 1;
_arg1--;
if (_arg1 == 1){
_local2 = 2;
} else {
if (_arg1 > 1){
while (_arg1--) {
_local2 = (_local2 * 2);
};
};
};
return (_local2);
}
function frame5(){
if ((((__setPropDict[__id0_] == undefined)) || (!((((int(__setPropDict[__id0_]) >= 1)) && ((int(__setPropDict[__id0_]) <= 5))))))){
__setPropDict[__id0_] = currentFrame;
__setProp___id0__preloader_Layer15_1();
};
btPlay.addEventListener(MouseEvent.CLICK, PlayTheGame, false, 0, true);
}
public function LoadMedalData():void{
myData = SharedObject.getLocal("medal");
if (myData.data.mymedal == undefined){
myMedal = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
} else {
myMedal = myData.data.mymedal;
};
myData.close();
}
public function MainMenu():void{
var _local1:int;
dataDateColl = new Array();
_local1 = 1;
while (_local1 <= 3) {
LoadGameData(String(("data" + _local1)));
dataDateColl[_local1] = dataDate;
_local1++;
};
LoadMedalData();
classRef = (getDefinitionByName("MainMenu") as Class);
scr = new classRef();
addChild(DisplayObject(scr));
BgSound();
_local1 = 1;
while (_local1 <= 3) {
if (dataDateColl[_local1] == undefined){
scr.EnableContinue(false);
} else {
scr.EnableContinue(true);
break;
};
_local1++;
};
}
private function MouseDown(_arg1:Event):void{
SetSpeedBg(5);
}
private function DecreasingVolume(_arg1:TimerEvent):void{
var _local2:SoundTransform;
if (mscOn){
_local2 = bgChn.soundTransform;
mscVol = (mscVol - 0.1);
_local2.volume = mscVol;
bgChn.soundTransform = _local2;
if (mscVol <= 0){
mscVol = 0;
tSound.stop();
tSound.removeEventListener(TimerEvent.TIMER, DecreasingVolume);
PlayBgSound(0);
IncSndVol();
};
};
}
public function Loading(_arg1:Event){
totalSize = stage.loaderInfo.bytesTotal;
downloadSize = stage.loaderInfo.bytesLoaded;
percent = Math.floor(((downloadSize / totalSize) * 100));
status_txt.text = (("loading " + String(percent)) + " %");
if (percent == 100){
removeEventListener(Event.ENTER_FRAME, Loading);
gotoAndStop(5);
};
}
private function RollOver(_arg1:MouseEvent):void{
if (_arg1.currentTarget == mcMouseCL){
sFlg = 1;
} else {
if (_arg1.currentTarget == mcMouseCR){
sFlg = 2;
};
};
if (atBound){
atBound = false;
};
}
function frame2(){
if ((((__setPropDict[__id0_] == undefined)) || (!((((int(__setPropDict[__id0_]) >= 1)) && ((int(__setPropDict[__id0_]) <= 5))))))){
__setPropDict[__id0_] = currentFrame;
__setProp___id0__preloader_Layer15_1();
};
}
private function PlayBgSound2(_arg1:uint, _arg2:Number):void{
var _local3:SoundTransform;
sndRef = (getDefinitionByName(("Music" + _arg1)) as Class);
snd = new sndRef();
bgChn = snd.play();
_local3 = new SoundTransform(_arg2, 0);
bgChn.soundTransform = _local3;
bgChn.addEventListener(Event.SOUND_COMPLETE, LoopMusic, false, 0, true);
}
function __setProp___id0__preloader_Layer15_1(){
try {
__id0_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id0_.debugMode = true;
__id0_.encryptionKey = "cXShODfTdIRYPwy0DN2ZKXhJgT4cSuwi ";
__id0_.movieId = "13734:Nzyr77eU ";
__id0_.movieVersion = "1.0";
__id0_.showConnectingPopup = true;
__id0_.useErrorPopup = true;
__id0_.useMedalPopup = true;
try {
__id0_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
private function MouseLeave(_arg1:Event):void{
if (sFlg != 0){
sFlg = 0;
};
ScrollBg(sFlg);
}
private function PlayBgSound3(_arg1:uint, _arg2:Number=1):void{
var _local3:SoundTransform;
sndRef = (getDefinitionByName(("Music" + _arg1)) as Class);
snd = new sndRef();
bgChn = snd.play();
_local3 = new SoundTransform(_arg2, 0);
bgChn.soundTransform = _local3;
}
public function DecSndVol():void{
if (tSound != null){
tSound.stop();
tSound.removeEventListener(TimerEvent.TIMER, DecreasingVolume);
};
tSound = new Timer(100);
tSound.start();
tSound.addEventListener(TimerEvent.TIMER, DecreasingVolume, false, 0, true);
}
public function onMedalUnlocked(_arg1:APIEvent):void{
var _local2:Medal;
if (_arg1.success){
_local2 = _arg1.data.medal;
trace((((("You unlocked '" + _local2.name) + "'! (value: ") + _local2.value) + " points)"));
};
}
private function SoundComplete(_arg1:Event):void{
}
public function GetAiLvl(_arg1:int):int{
return (Math.ceil((_arg1 / 3)));
}
public function InitANewGame():void{
var _local1:int;
levelAttrib = new CLevelAttrib();
myGold = levelAttrib.GetMyGold(mapId);
canUnlockChar = new Array();
canUnlockChar = levelAttrib.GetUnlockLevel(mapId);
charUnlock = new Array();
charLevel = new Array();
charUpgrade = new Array();
charUnlock = [1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0];
charLevel = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
charUpgrade = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
gameStat = [0, 0, 0, 0, 0, 0];
gameLevel = 1;
baseLevel = (tmpBaseLevel = 1);
nTurret = 0;
myUpPoin = levelAttrib.GetUpgradePoin(mapId, gameLevel);
tmpGold = myGold;
tmpUpPoin = myUpPoin;
tmpBaseLevel = baseLevel;
tmpCharUnlock = new Array();
tmpCharLevel = new Array();
tmpCharUpgrade = new Array();
_local1 = 0;
while (_local1 < 15) {
tmpCharUnlock[_local1] = charUnlock[_local1];
tmpCharLevel[_local1] = charLevel[_local1];
tmpCharUpgrade[_local1] = charUpgrade[_local1];
_local1++;
};
isLose = false;
nLose = 30;
firstKill = false;
firstWin = false;
}
public function SaveGameData(_arg1:String):void{
myData = SharedObject.getLocal(_arg1);
myData.clear();
myData.data.mapid = mapId;
myData.data.gamelvl = gameLevel;
myData.data.mygold = myGold;
myData.data.charunlock = charUnlock;
myData.data.charupgrade = charUpgrade;
myData.data.charlvl = charLevel;
myData.data.baselvl = baseLevel;
myData.data.gamestat = gameStat;
myData.data.datadate = dataDate;
myData.data.basetype = baseType;
myData.data.bgtype = bgType;
myData.data.myuppoin = myUpPoin;
myData.data.canunlock = canUnlockChar;
myData.data.islose = isLose;
myData.data.nlose = nLose;
myData.flush();
myData.close();
}
public function ResetData():void{
}
private function RollOut(_arg1:MouseEvent):void{
if (sFlg != 0){
sFlg = 0;
};
SetSpeedBg(1);
}
public function StopGame():void{
isStopGame = true;
runTimer.stop();
runTimer.removeEventListener(TimerEvent.TIMER, EnterFrame);
bgContainer.Stop();
mcMouseCL.removeEventListener(MouseEvent.ROLL_OVER, RollOver);
mcMouseCL.removeEventListener(MouseEvent.ROLL_OUT, RollOut);
mcMouseCL.removeEventListener(MouseEvent.MOUSE_DOWN, MouseDown);
mcMouseCL.removeEventListener(MouseEvent.MOUSE_UP, MouseUp);
mcMouseCR.removeEventListener(MouseEvent.ROLL_OVER, RollOver);
mcMouseCR.removeEventListener(MouseEvent.ROLL_OUT, RollOut);
mcMouseCR.removeEventListener(MouseEvent.MOUSE_DOWN, MouseDown);
mcMouseCR.removeEventListener(MouseEvent.MOUSE_UP, MouseUp);
stage.removeEventListener(Event.MOUSE_LEAVE, MouseLeave);
}
public function BgSound(_arg1:Number=1):void{
if (bgChn != null){
bgChn.stop();
bgChn = null;
};
bgVol = _arg1;
if (mscOn){
PlayBgSound2(2, bgVol);
};
}
private function EnterFrame(_arg1:TimerEvent):void{
ScrollBg(sFlg);
zz++;
if (zz == 25){
zz = 1;
};
sndBuff[zz] = false;
bgContainer.SetAlphaBase();
}
public function TurnOffMusic():void{
mscOn = false;
SoundMixer.stopAll();
StopBgSoundEvent();
}
private function LoopMusic(_arg1:Event):void{
if (mscOn){
bgChn.removeEventListener(Event.SOUND_COMPLETE, LoopMusic);
if (!inGame){
PlayBgSound2(1, bgVol);
} else {
DecSndVol();
};
};
}
private function RandomNum(_arg1:Number, _arg2:Number):Number{
return ((Math.floor((Math.random() * ((_arg2 - _arg1) + 1))) + _arg1));
}
private function Pause(_arg1:MouseEvent):void{
isPause = true;
classRef = (getDefinitionByName("PauseMenu") as Class);
scr = new classRef();
addChild(DisplayObject(scr));
scr.Init();
}
private function PlayBgSound(_arg1:Number):void{
var _local2:uint;
var _local3:SoundTransform;
_local2 = RandomNum(3, 6);
sndRef = (getDefinitionByName(("Music" + _local2)) as Class);
snd = new sndRef();
if (_local2 == 6){
bgChn = snd.play(0, 10);
} else {
bgChn = snd.play(0, 5);
};
_local3 = new SoundTransform(_arg1, 0);
bgChn.soundTransform = _local3;
bgChn.addEventListener(Event.SOUND_COMPLETE, LoopMusic, false, 0, true);
}
public function LoadGameData(_arg1:String):void{
var _local2:int;
myData = SharedObject.getLocal(_arg1);
mapId = myData.data.mapid;
gameLevel = myData.data.gamelvl;
myGold = myData.data.mygold;
charUnlock = new Array();
charLevel = new Array();
charUpgrade = new Array();
if (myData.data.charunlock == undefined){
charUnlock = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
} else {
charUnlock = myData.data.charunlock;
};
if (myData.data.charupgrade == undefined){
charUpgrade = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
} else {
charUpgrade = myData.data.charupgrade;
};
if (myData.data.charlvl == undefined){
charLevel = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
} else {
charLevel = myData.data.charlvl;
};
baseLevel = myData.data.baselvl;
if (myData.data.gamestat == undefined){
gameStat = [0, 0, 0, 0, 0, 0];
} else {
gameStat = myData.data.gamestat;
};
dataDate = myData.data.datadate;
baseType = myData.data.basetype;
bgType = myData.data.bgtype;
myUpPoin = myData.data.myuppoin;
canUnlockChar = myData.data.canunlock;
isLose = myData.data.islose;
nLose = myData.data.nlose;
if (baseLevel >= 9){
nTurret = 4;
} else {
if (baseLevel >= 7){
nTurret = 3;
} else {
if (baseLevel >= 5){
nTurret = 2;
} else {
if (baseLevel >= 3){
nTurret = 1;
};
};
};
};
tmpGold = myGold;
tmpUpPoin = myUpPoin;
tmpCharUnlock = new Array();
tmpCharLevel = new Array();
tmpCharUpgrade = new Array();
_local2 = 0;
while (_local2 < 15) {
tmpCharUnlock[_local2] = charUnlock[_local2];
tmpCharLevel[_local2] = charLevel[_local2];
tmpCharUpgrade[_local2] = charUpgrade[_local2];
_local2++;
};
tmpBaseLevel = baseLevel;
myData.close();
}
public function ShowScreen(_arg1:String):void{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
if (_arg1 == "Result"){
inGame = false;
if (mscOn){
if (bgChn != null){
bgChn.stop();
bgChn = null;
};
StopBgSoundEvent();
};
if (win == 1){
if (mscOn){
PlayBgSound3(8);
};
isLose = false;
nLose = 30;
var _local6 = gameStat;
var _local7 = 4;
var _local8 = (_local6[_local7] + 1);
_local6[_local7] = _local8;
tmpUpPoin = myUpPoin;
tmpCharUnlock = new Array();
tmpCharLevel = new Array();
tmpCharUpgrade = new Array();
_local3 = 0;
while (_local3 < 15) {
tmpCharUnlock[_local3] = charUnlock[_local3];
tmpCharLevel[_local3] = charLevel[_local3];
tmpCharUpgrade[_local3] = charUpgrade[_local3];
_local3++;
};
tmpBaseLevel = baseLevel;
gameLevel++;
myGold = (myGold + Math.round((750 * gameLevel)));
tmpGold = myGold;
if (gameLevel < 31){
myUpPoin = (myUpPoin + levelAttrib.GetUpgradePoin(mapId, gameLevel));
tmpUpPoin = myUpPoin;
};
if (!firstWin){
firstWin = true;
SetNGMedal(2);
};
} else {
if (win == 2){
if (mscOn){
PlayBgSound3(9);
};
isLose = true;
_local6 = gameStat;
_local7 = 5;
_local8 = (_local6[_local7] + 1);
_local6[_local7] = _local8;
myGold = tmpGold;
myGold = (myGold + 500);
myUpPoin = tmpUpPoin;
myUpPoin++;
charUnlock = new Array();
charLevel = new Array();
charUpgrade = new Array();
_local4 = 0;
while (_local4 < 15) {
charUnlock[_local4] = tmpCharUnlock[_local4];
charLevel[_local4] = tmpCharLevel[_local4];
charUpgrade[_local4] = tmpCharUpgrade[_local4];
_local4++;
};
baseLevel = tmpBaseLevel;
};
};
if (gameLevel == 31){
win = 3;
SetNGMedal(3);
} else {
if (gameLevel == 16){
SetNGMedal(4);
};
};
classRef = (getDefinitionByName(_arg1) as Class);
scr = new classRef();
addChild(DisplayObject(scr));
scr.Init(tempGSKill, tempGSLost, win);
_local2 = 0;
while (_local2 < 4) {
gameStat[_local2] = (gameStat[_local2] + tempGSKill[_local2]);
_local2++;
};
return;
};
if (_arg1 != null){
removeChild(DisplayObject(scr));
(scr == null);
};
if (_arg1 == "PLAY"){
StartANewGame();
return;
};
classRef = (getDefinitionByName(_arg1) as Class);
scr = new classRef();
addChild(DisplayObject(scr));
if (_arg1 == "Map"){
if (win == -1){
myGold = tmpGold;
myUpPoin = tmpUpPoin;
charUnlock = new Array();
charLevel = new Array();
charUpgrade = new Array();
_local5 = 0;
while (_local5 < 15) {
charUnlock[_local5] = tmpCharUnlock[_local5];
charLevel[_local5] = tmpCharLevel[_local5];
charUpgrade[_local5] = tmpCharUpgrade[_local5];
_local5++;
};
baseLevel = tmpBaseLevel;
};
scr.Init(mapId);
} else {
if (_arg1 == "MediUpgrade"){
curScr = _arg1;
scr.Init(1);
} else {
if (_arg1 == "DarkUpgrade"){
curScr = _arg1;
scr.Init(2);
} else {
if (_arg1 == "Medal"){
scr.Init(myMedal);
} else {
if (_arg1 == "Statistic"){
scr.Init(gameStat);
} else {
if (_arg1 == "Option"){
scr.Init();
} else {
if (_arg1 == "MainMenu"){
BgSound();
} else {
if (_arg1 == "Credits"){
} else {
if (_arg1 == "PauseMenu"){
scr.Init();
} else {
if (_arg1 == "Help"){
} else {
if (_arg1 == "Instruction"){
scr.Init();
};
};
};
};
};
};
};
};
};
};
};
}
}
}//package
Section 218
//CMeleeUnit (CMeleeUnit)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import fl.motion.*;
import flash.geom.*;
import flash.media.*;
import fl.transitions.easing.*;
public class CMeleeUnit extends CGroundUnit {
private var objRef:Class;
private var isHasPoison:Boolean;
private var poisonT:Timer;
private var t0:Number;// = 0
private var isToss:Boolean;// = false
private var sndAtt:String;
private var poisonAble:Boolean;
private var angle:Number;
private var anc1:Point;
public var mcHP:MovieClip;
private var anc2:Point;
public var missile:Object;
private var cont:Point;
private var spdColl:Array;
private var bounceDmg:int;// = 0
private var tDelay:Timer;
private var spdIdx:int;
private var idleTimer:Timer;
private var tPause:Timer;
private var curPos:Point;
public function CMeleeUnit(){
spdColl = [0, 0.019, 0.018, 0.017, 0.016, 0.015, 0.014, 0.013, 0.012, 0.011, 0.01];
t0 = 0;
curPos = new Point();
bounceDmg = 0;
isToss = false;
super();
}
public function AttackEnemy():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
if (targetO == null){
StopAttack();
return;
};
this["root"].PlaySound(sndAtt);
if (sPos == 0){
fBound = (targetO.x - targetO.bodyW);
scaleX = 1;
} else {
fBound = (targetO.x + targetO.bodyW);
scaleX = -1;
};
if (targetO != null){
_local1 = (targetO.x + (RandomNum(0, targetO.bodyW) * RandomNum(-1, 1)));
_local2 = (targetO.y - RandomNum(5, targetO.bodyH));
if (hasSkill){
if (RandomNum(1, 5) == 1){
if (skillTyp == 1){
targetO.SetDamage((att * 2), true);
this["root"]["bgContainer"].CallEffect(1, _local1, _local2, 1);
} else {
if (skillTyp == 2){
if (targetO.isBounce){
if (x > targetO.x){
_local3 = (targetO.x - (RandomNum(10, 15) * 10));
if (_local3 < 210){
_local3 = 210;
};
} else {
if (x < targetO.x){
_local3 = (targetO.x + (RandomNum(10, 15) * 10));
if (_local3 > 1390){
_local3 = 1390;
};
};
};
targetO.BounceThis(_local3, int((att * 1.5)));
} else {
targetO.SetDamage((att * 1.5), true);
this["root"]["bgContainer"].CallEffect(1, _local1, _local2, 1);
};
} else {
if (skillTyp == 3){
targetO.SetDamage((att * 2), true);
this["root"]["bgContainer"].CallEffect(3, _local1, _local2, 1);
} else {
if (skillTyp == 4){
targetO.SetDamage((att * 2), true);
this["root"]["bgContainer"].CallEffect(2, _local1, _local2, 1);
} else {
if (skillTyp == 5){
targetO.SetDamage(att);
targetO.GetPoison();
} else {
if (skillTyp == 6){
targetO.SetDamage((att * 3), true);
this["root"]["bgContainer"].CallEffect(1, _local1, _local2, 1);
};
};
};
};
};
};
return;
};
};
targetO.SetDamage(att);
this["root"]["bgContainer"].CallEffect(1, _local1, _local2, 1);
};
if (targetO.GetLife() < 20){
targetO = GetTargetToAtt();
StopAttack();
};
}
private function IsOutArea():Boolean{
return ((((x >= 0)) && ((x <= 1600))));
}
override public function CheckAvaiEnemy():void{
if (IsThereATarget()){
destX = mainTarget;
isIdle = false;
child = DisplayObject(getChildAt(0));
child.play();
if (idleTimer != null){
idleTimer.stop();
idleTimer.removeEventListener(TimerEvent.TIMER, OnIdle);
idleTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, IdleOver);
};
} else {
isIdle = true;
idleTimer = new Timer(1000, RandomNum(1, 3));
idleTimer.start();
idleTimer.addEventListener(TimerEvent.TIMER, OnIdle, false, 0, true);
idleTimer.addEventListener(TimerEvent.TIMER_COMPLETE, IdleOver, false, 0, true);
};
}
public function Attack():void{
if (!isAttack){
isAttack = true;
if (sPos == 0){
if (scaleX == -1){
scaleX = 1;
};
} else {
if (scaleX == 1){
scaleX = -1;
};
};
gotoAndStop("att");
isIdle = false;
};
}
public function SetDamage(_arg1:int, _arg2:Boolean=false):void{
var _local3:int;
var _local4:int;
_local3 = (Math.abs(_arg1) - arm);
if (_local3 <= 0){
_local3 = 1;
};
_local4 = _local3;
if (_local4 > life){
_local4 = life;
};
life = (life - _local3);
if (sPos == 0){
root["panelActIcon1"].Update(nm, _local4);
} else {
root["panelActIcon2"].Update(nm, _local4);
};
if (_arg2){
this["root"]["bgContainer"].CallDamagePoin(x, (y - bodyH), _local3, 1.5);
} else {
this["root"]["bgContainer"].CallDamagePoin(x, (y - bodyH), _local3);
};
if ((((((life <= 0)) && (!(isDie)))) && (!(isToss)))){
if (sPos == 0){
root["panelActIcon1"].Del(nm);
} else {
root["panelActIcon2"].Del(nm);
};
isDie = true;
px = int(((x + (bodyW * scaleX)) / 50));
if (isAlly){
root["bgContainer"].RemoveArrValue(root["bgContainer"]["allyColl"][px], this);
root["bgContainer"].RemoveArrValue(root["bgContainer"]["allyColl"][curPx], this);
CountLostStat();
} else {
root["bgContainer"].RemoveArrValue(root["bgContainer"]["enmyColl"][px], this);
root["bgContainer"].RemoveArrValue(root["bgContainer"]["enmyColl"][curPx], this);
CountKillStat();
};
return;
};
if ((((life <= 20)) && ((life > 0)))){
Retreat();
};
}
private function Factorial(_arg1:int):Number{
var _local2:Number;
_local2 = 1;
_arg1--;
if (_arg1 == 1){
_local2 = 2;
} else {
if (_arg1 > 1){
while (_arg1--) {
_local2 = (_local2 * 2);
};
};
};
return (_local2);
}
private function OnIdle(_arg1:TimerEvent):void{
if (root["isStopGame"]){
idleTimer.stop();
idleTimer.removeEventListener(TimerEvent.TIMER, OnIdle);
idleTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, IdleOver);
};
}
public function IsThereATarget():Boolean{
var _local1:Boolean;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
_local1 = false;
if (isAlly){
if (sPos == 0){
_local2 = int((x / 50));
if (_local2 < 0){
_local2 = 0;
};
_local4 = (x + 500);
_local3 = int((_local4 / 50));
if (_local3 > 31){
_local3 = 31;
};
_local5 = _local2;
while (_local5 <= _local3) {
if (root["bgContainer"]["enmyColl"][_local5].length > 0){
_local1 = true;
break;
} else {
_local1 = false;
};
_local5++;
};
} else {
_local2 = int((x / 50));
if (_local2 > 31){
_local2 = 31;
};
_local4 = (x - rng);
_local3 = int((_local4 / 50));
if (_local3 < 0){
_local3 = 0;
};
_local5 = _local2;
while (_local5 >= _local3) {
if (root["bgContainer"]["enmyColl"][_local5].length > 0){
_local1 = true;
break;
} else {
_local1 = false;
};
_local5--;
};
};
} else {
if (sPos == 0){
_local2 = int((x / 50));
if (_local2 < 0){
_local2 = 0;
};
_local4 = (x + 500);
_local3 = int((_local4 / 50));
if (_local3 > 31){
_local3 = 31;
};
_local5 = _local2;
while (_local5 <= _local3) {
if (root["bgContainer"]["allyColl"][_local5].length > 0){
_local1 = true;
break;
} else {
_local1 = false;
};
_local5++;
};
} else {
_local2 = int((x / 50));
if (_local2 > 31){
_local2 = 31;
};
_local4 = (x - rng);
_local3 = int((_local4 / 50));
if (_local3 < 0){
_local3 = 0;
};
_local5 = _local2;
while (_local5 >= _local3) {
if (root["bgContainer"]["allyColl"][_local5].length > 0){
_local1 = true;
break;
} else {
_local1 = false;
};
_local5--;
};
};
};
return (_local1);
}
private function IdleOver(_arg1:TimerEvent):void{
idleTimer.stop();
idleTimer.removeEventListener(TimerEvent.TIMER, OnIdle);
idleTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, IdleOver);
if (isAttack){
return;
};
if (isRetreat){
tacticType = 0;
};
SetDestination(tacticType);
isIdle = false;
if (child == null){
return;
};
if (child != null){
child = DisplayObject(getChildAt(0));
child.play();
};
}
private function CountKillStat():void{
if (unitTyp == "land"){
var _local1 = root["tempGSKill"];
var _local2:int;
var _local3 = (_local1[_local2] + 1);
_local1[_local2] = _local3;
} else {
if (unitTyp == "air"){
_local1 = root["tempGSKill"];
_local2 = 2;
_local3 = (_local1[_local2] + 1);
_local1[_local2] = _local3;
} else {
if (unitTyp == "sea"){
_local1 = root["tempGSKill"];
_local2 = 3;
_local3 = (_local1[_local2] + 1);
_local1[_local2] = _local3;
};
};
};
root["myGold"] = (root["myGold"] + Math.round((0.75 * price)));
root["charPanel"]["txGold"].text = root["myGold"];
}
override public function StopAttack():void{
isAttack = false;
if (currentLabel != "die"){
gotoAndStop("walk");
};
}
override public function UpdateThis():void{
px = int(((x + (bodyW * scaleX)) / 50));
if (px > 31){
px = 31;
} else {
if (px < 0){
px = 0;
};
};
if (px != curPx){
if (isAlly){
root["bgContainer"].RemoveArrValue(root["bgContainer"]["allyColl"][curPx], this);
root["bgContainer"]["allyColl"][px].push(this);
} else {
root["bgContainer"].RemoveArrValue(root["bgContainer"]["enmyColl"][curPx], this);
root["bgContainer"]["enmyColl"][px].push(this);
};
curPx = px;
};
if (((((!(isIdle)) && (!(isRetreat)))) && (!(isDie)))){
ReadyToAttack();
};
if (((((isDefend) && (!(isDie)))) && (IsThereCloseTarget()))){
SetDestination(2);
};
}
override public function SetAttributes(_arg1:String):void{
var _local2:int;
var _local3:Color;
var _local4:Number;
attrib = new Array();
attrib = root["bgContainer"]["charAttrib"].GetAttrib(_arg1, root["mapId"]);
nm = attrib[0];
if (isAlly){
life = (int(attrib[1]) + (5 * (lvl - 1)));
att = (int(attrib[2]) + (2 * (lvl - 1)));
arm = (int(attrib[3]) + (1 * (lvl - 1)));
} else {
if (root["mapId"] == 1){
_local4 = 1.1;
} else {
if ((((root["mapId"] == 2)) || ((root["mapId"] == 3)))){
_local4 = 1.2;
} else {
if (root["mapId"] == 4){
_local4 = 1.3;
};
};
};
life = ((int((attrib[1] * _local4)) + (5 * (lvl - 1))) - Math.round((int(attrib[1]) * root["aiHpConf"])));
att = ((int((attrib[2] * _local4)) + (2 * (lvl - 1))) - Math.round((int(attrib[2]) * root["aiHpConf"])));
arm = ((int((attrib[3] * _local4)) + (1 * (lvl - 1))) - Math.round((int(attrib[3]) * root["aiHpConf"])));
};
defaultSpd = Number(attrib[4]);
rng = Number((attrib[5] * 30));
skill = int(attrib[7]);
price = int(attrib[8]);
attType = int(attrib[11]);
isBounce = Boolean(int(attrib[12]));
skillTyp = int(attrib[13]);
unitTyp = String(attrib[14]);
poisonAble = Boolean(int(attrib[15]));
isHasPoison = false;
isToss = false;
sndAtt = String(attrib[16]);
if (sPos == 0){
root["panelActIcon1"].Add(1, nm, life);
} else {
root["panelActIcon2"].Add(2, nm, life);
};
attCnt = 0;
_local2 = root["bgContainer"]["charAttrib"].GetIndex(_arg1);
root["bgContainer"].charColl[_local2].push(this);
_local3 = new Color();
this.transform.colorTransform = _local3;
runTimer = new Timer(10);
runTimer.start();
runTimer.addEventListener(TimerEvent.TIMER, Moving, false, 0, true);
}
private function OnPause(_arg1:TimerEvent):void{
if (!root["isPause"]){
poisonT.start();
tPause.stop();
tPause.removeEventListener(TimerEvent.TIMER, OnPause);
};
}
private function ReadyToAttack():void{
var _local1:Number;
targetO = null;
targetO = GetTargetToAtt();
if (targetO != null){
if (sPos == 0){
fBound = (targetO.x - targetO.bodyW);
} else {
fBound = (targetO.x + targetO.bodyW);
};
_local1 = GetDistance((x - fBound), (y - targetO.y));
if (_local1 <= rng){
Attack();
};
};
}
public function Bouncing(_arg1:TimerEvent):void{
curPos.x = x;
curPos.y = y;
x = (((Math.pow((1 - t0), 2) * anc1.x) + (((2 * t0) * (1 - t0)) * cont.x)) + (Math.pow(t0, 2) * anc2.x));
y = (((Math.pow((1 - t0), 2) * anc1.y) + (((2 * t0) * (1 - t0)) * cont.y)) + (Math.pow(t0, 2) * anc2.y));
t0 = (t0 + (spdColl[spdIdx] * 2));
if (t0 >= 1){
runTimer.stop();
runTimer.removeEventListener(TimerEvent.TIMER, Bouncing);
SetDamage(bounceDmg);
gotoAndStop("wake");
};
}
public function BounceThis(_arg1:Number, _arg2:int):void{
var _local3:Number;
var _local4:Number;
if (isAlly){
root["bgContainer"].RemoveArrValue(root["bgContainer"]["allyColl"][curPx], this);
} else {
root["bgContainer"].RemoveArrValue(root["bgContainer"]["enmyColl"][curPx], this);
};
gotoAndStop("toss");
isToss = true;
runTimer.stop();
runTimer.removeEventListener(TimerEvent.TIMER, Moving);
bounceDmg = _arg2;
t0 = 0;
_local3 = (x - _arg1);
_local4 = Math.abs(_local3);
anc1 = new Point(x, YPOS);
anc2 = new Point(_arg1, YPOS);
cont = new Point((x - (((_local4 / 2) * Math.abs(_local3)) / _local3)), -(Math.abs((YPOS - (_local4 / 2)))));
spdIdx = Math.ceil((_local4 / 30));
if (spdIdx >= spdColl.length){
spdIdx = (spdColl.length - 1);
};
runTimer = new Timer(10);
runTimer.start();
runTimer.addEventListener(TimerEvent.TIMER, Bouncing, false, 0, true);
}
public function GetLife():int{
return (life);
}
public function WakeUp():void{
isAttack = false;
runTimer = new Timer(10);
runTimer.start();
runTimer.addEventListener(TimerEvent.TIMER, Moving, false, 0, true);
if ((((life <= 0)) && (!(isDie)))){
if (sPos == 0){
root["panelActIcon1"].Del(nm);
} else {
root["panelActIcon2"].Del(nm);
};
isDie = true;
px = int(((x + (bodyW * scaleX)) / 50));
if (isAlly){
root["bgContainer"].RemoveArrValue(root["bgContainer"]["allyColl"][px], this);
root["bgContainer"].RemoveArrValue(root["bgContainer"]["allyColl"][curPx], this);
CountLostStat();
} else {
root["bgContainer"].RemoveArrValue(root["bgContainer"]["enmyColl"][px], this);
root["bgContainer"].RemoveArrValue(root["bgContainer"]["enmyColl"][curPx], this);
CountKillStat();
};
};
isToss = false;
}
private function OnPoisonEnd(_arg1:TimerEvent):void{
var _local2:Color;
isHasPoison = false;
poisonT.stop();
poisonT.addEventListener(TimerEvent.TIMER, OnPoison);
poisonT.addEventListener(TimerEvent.TIMER_COMPLETE, OnPoisonEnd);
_local2 = new Color();
this.transform.colorTransform = _local2;
}
override public function Retreat():void{
var _local1:int;
if ((((tacticType == 2)) || ((tacticType == 1)))){
_local1 = tacticType;
tacticType = 0;
SetDestination(tacticType);
if ((((sPos == 0)) && ((x < destX)))){
tacticType = _local1;
SetDestination(tacticType);
isRetreat = false;
return;
};
if ((((sPos == 1)) && ((x > destX)))){
tacticType = _local1;
SetDestination(tacticType);
isRetreat = false;
return;
};
speed = (speed * 1.5);
StopAttack();
isRetreat = true;
};
}
private function CountLostStat():void{
if (unitTyp == "land"){
var _local1 = root["tempGSLost"];
var _local2:int;
var _local3 = (_local1[_local2] + 1);
_local1[_local2] = _local3;
} else {
if (unitTyp == "air"){
_local1 = root["tempGSLost"];
_local2 = 2;
_local3 = (_local1[_local2] + 1);
_local1[_local2] = _local3;
} else {
if (unitTyp == "sea"){
_local1 = root["tempGSLost"];
_local2 = 3;
_local3 = (_local1[_local2] + 1);
_local1[_local2] = _local3;
};
};
};
root["aiGold"] = (root["aiGold"] + Math.round((0.75 * price)));
root["charPanel"]["txGold2"].text = root["aiGold"];
}
public function GetPoison():void{
var _local1:Color;
if (((poisonAble) && (!(isHasPoison)))){
isHasPoison = true;
_local1 = new Color();
_local1.setTint(0xFF00, 0.25);
this.transform.colorTransform = _local1;
poisonT = new Timer(1000, 3);
poisonT.start();
poisonT.addEventListener(TimerEvent.TIMER, OnPoison, false, 0, true);
poisonT.addEventListener(TimerEvent.TIMER_COMPLETE, OnPoisonEnd, false, 0, true);
};
}
private function OnPoison(_arg1:TimerEvent):void{
if (root["isPause"]){
poisonT.stop();
tPause = new Timer(10);
tPause.addEventListener(TimerEvent.TIMER, OnPause, false, 0, true);
tPause.start();
};
SetDamage((3 + arm));
if (((root["isStopGame"]) || (isDie))){
poisonT.stop();
poisonT.addEventListener(TimerEvent.TIMER, OnPoison);
poisonT.addEventListener(TimerEvent.TIMER_COMPLETE, OnPoisonEnd);
};
}
public function GetTargetToAtt():Object{
var _local1:Object;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
_local1 = new Object();
if (isAlly){
if (sPos == 0){
_local2 = int((x / 50));
if (_local2 < 0){
_local2 = 0;
};
_local4 = (x + rng);
_local3 = int((_local4 / 50));
if (_local3 > 31){
_local3 = 31;
};
_local5 = _local2;
while (_local5 <= _local3) {
if (root["bgContainer"]["enmyColl"][_local5].length > 0){
_local1 = GetAvailableTarget(root["bgContainer"]["enmyColl"][_local5]);
break;
} else {
_local1 = null;
};
_local5++;
};
} else {
_local2 = int((x / 50));
if (_local2 > 31){
_local2 = 31;
};
_local4 = (x - rng);
_local3 = int((_local4 / 50));
if (_local3 < 0){
_local3 = 0;
};
_local5 = _local2;
while (_local5 >= _local3) {
if (root["bgContainer"]["enmyColl"][_local5].length > 0){
_local1 = GetAvailableTarget(root["bgContainer"]["enmyColl"][_local5]);
break;
} else {
_local1 = null;
};
_local5--;
};
};
} else {
if (sPos == 0){
_local2 = int((x / 50));
if (_local2 < 0){
_local2 = 0;
};
_local4 = (x + rng);
_local3 = int((_local4 / 50));
if (_local3 > 31){
_local3 = 31;
};
_local5 = _local2;
while (_local5 <= _local3) {
if (root["bgContainer"]["allyColl"][_local5].length > 0){
_local1 = GetAvailableTarget(root["bgContainer"]["allyColl"][_local5]);
break;
} else {
_local1 = null;
};
_local5++;
};
} else {
_local2 = int((x / 50));
if (_local2 > 31){
_local2 = 31;
};
_local4 = (x - rng);
_local3 = int((_local4 / 50));
if (_local3 < 0){
_local3 = 0;
};
_local5 = _local2;
while (_local5 >= _local3) {
if (root["bgContainer"]["allyColl"][_local5].length > 0){
_local1 = GetAvailableTarget(root["bgContainer"]["allyColl"][_local5]);
break;
} else {
_local1 = null;
};
_local5--;
};
};
};
return (_local1);
}
}
}//package
Section 219
//CMissileA (CMissileA)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.media.*;
import fl.transitions.easing.*;
public class CMissileA extends MovieClip {
private var dmg:int;
private var effScl:Number;
private var px:Number;
private var anc1:Point;
private var anc2:Point;
public var mcHP:MovieClip;
var curPos:Point;
private var cont:Point;
private var spdColl:Array;
private var spcSkill:int;
var t:Number;// = 0
private var spdIdx:int;
private var ty:int;
private var tx:int;
private var rt:Timer;
private var aly:int;
var angle:Number;
private var isArea:Boolean;
private var targetO:Object;
private var eff:int;
public function CMissileA(){
t = 0;
curPos = new Point();
spdColl = [0, 0.019, 0.018, 0.017, 0.016, 0.015, 0.014, 0.013, 0.012, 0.011, 0.01];
super();
}
public function Init(_arg1:Number, _arg2:Number, _arg3:Object, _arg4:Boolean=false, _arg5:int=0, _arg6:Number=1, _arg7:int=0):void{
var _local8:Number;
var _local9:Number;
x = _arg1;
y = _arg2;
if (_arg3 == null){
this["parent"].removeChild(this);
};
targetO = new Object();
targetO = _arg3;
isArea = _arg4;
eff = _arg5;
effScl = _arg6;
spcSkill = _arg7;
aly = int(name.charAt(1));
dmg = int(name.substr(2));
tx = RandomNum((targetO.x - (targetO.width / 2)), (targetO.x + (targetO.width / 2)));
ty = RandomNum(targetO.y, (targetO.y - (targetO.height / 2)));
_local8 = (_arg1 - tx);
_local9 = Math.abs(_local8);
anc1 = new Point(_arg1, _arg2);
anc2 = new Point(tx, ty);
cont = new Point((_arg1 - (((_local9 / 2) * Math.abs(_local8)) / _local8)), -(Math.abs((_arg2 - (_local9 / 3)))));
spdIdx = Math.ceil((_local9 / 30));
if (spdIdx >= spdColl.length){
spdIdx = (spdColl.length - 1);
};
rt = new Timer(10);
rt.start();
rt.addEventListener(TimerEvent.TIMER, Moving, false, 0, true);
mouseEnabled = false;
mouseChildren = false;
}
private function GetAngle(_arg1:Number, _arg2:Number):Number{
return (((Math.atan2(_arg2, _arg1) * 180) / Math.PI));
}
private function HitTarget():void{
var _local1:int;
var _local2:int;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
if (isArea){
_local1 = int((targetO.x / 50));
SetAreaDmg(_local1);
_local2 = (_local1 - 1);
if (_local2 < 0){
_local2 = 0;
};
if (_local2 != _local1){
SetAreaDmg(_local2);
};
_local2 = (_local1 + 1);
if (_local2 > 31){
_local2 = 31;
};
if (_local2 != _local1){
SetAreaDmg(_local2);
};
};
if (targetO != null){
_local3 = (targetO.x + (RandomNum(0, targetO.bodyW) * RandomNum(-1, 1)));
if (eff == 4){
_local4 = targetO.y;
} else {
_local4 = (targetO.y - RandomNum(5, targetO.bodyH));
};
if (spcSkill == 0){
targetO.SetDamage(dmg);
this["root"]["bgContainer"].CallEffect(eff, _local3, _local4, effScl);
} else {
if (spcSkill == 1){
targetO.SetDamage((dmg * 2), true);
this["root"]["bgContainer"].CallEffect(1, _local3, _local4, effScl);
} else {
if (spcSkill == 2){
if (targetO.isBounce){
if (targetO.sPos == 0){
_local7 = (targetO.x - targetO.bodyW);
if (x > _local7){
_local5 = (targetO.x - (RandomNum(8, 12) * 10));
if (_local5 < 210){
_local5 = targetO.x;
};
} else {
_local5 = targetO.x;
};
} else {
_local7 = (targetO.x + targetO.bodyW);
if (x < _local7){
_local5 = (targetO.x + (RandomNum(8, 12) * 10));
if (_local5 > 1390){
_local5 = targetO.x;
};
} else {
_local5 = targetO.x;
};
};
targetO.BounceThis(_local5, int((dmg * 1.5)));
this["root"]["bgContainer"].CallEffect(eff, x, y, effScl);
} else {
targetO.SetDamage((dmg * 1.5), true);
this["root"]["bgContainer"].CallEffect(1, _local3, _local4, 1);
};
} else {
if (spcSkill == 3){
targetO.SetDamage((dmg * 2), true);
this["root"]["bgContainer"].CallEffect(3, _local3, _local4, 0.75);
} else {
if (spcSkill == 4){
targetO.SetDamage((dmg * 2), true);
this["root"]["bgContainer"].CallEffect(2, _local3, _local4, 1);
} else {
if (spcSkill == 5){
targetO.SetDamage(dmg);
targetO.GetPoison();
if (isArea){
this["root"]["bgContainer"].CallEffect(eff, x, targetO.y, effScl);
};
} else {
if (spcSkill == 6){
targetO.SetDamage((dmg * 3), true);
this["root"]["bgContainer"].CallEffect(1, _local3, _local4, 1);
};
};
};
};
};
};
};
targetO = null;
};
rt.stop();
rt.removeEventListener(TimerEvent.TIMER, Moving);
this["parent"].removeChild(this);
}
public function Moving(_arg1:TimerEvent):void{
var _local2:int;
var _local3:int;
if (root["isStopGame"]){
rt.stop();
rt.removeEventListener(TimerEvent.TIMER, Moving);
stop();
return;
};
if (!root["isPause"]){
curPos.x = x;
curPos.y = y;
x = (((Math.pow((1 - t), 2) * anc1.x) + (((2 * t) * (1 - t)) * cont.x)) + (Math.pow(t, 2) * anc2.x));
y = (((Math.pow((1 - t), 2) * anc1.y) + (((2 * t) * (1 - t)) * cont.y)) + (Math.pow(t, 2) * anc2.y));
angle = GetAngle((x - curPos.x), (y - curPos.y));
rotation = angle;
t = (t + (spdColl[spdIdx] * 2.5));
if (t >= 1){
if (isArea){
_local2 = int((x / 50));
SetAreaDmg(_local2);
_local3 = (_local2 - 1);
if (_local3 < 0){
_local3 = 0;
};
if (_local3 != _local2){
SetAreaDmg(_local3);
};
_local3 = (_local2 + 1);
if (_local3 > 31){
_local3 = 31;
};
if (_local3 != _local2){
SetAreaDmg(_local3);
};
};
this["root"]["bgContainer"].CallEffect(eff, x, y, effScl);
rt.stop();
rt.removeEventListener(TimerEvent.TIMER, Moving);
this["parent"].removeChild(this);
return;
};
CheckHitTest();
};
}
private function GetDistance(_arg1:Number, _arg2:Number):Number{
return (Math.sqrt(((_arg1 * _arg1) + (_arg2 * _arg2))));
}
private function RandomNum(_arg1:Number, _arg2:Number):Number{
return ((Math.floor((Math.random() * ((_arg2 - _arg1) + 1))) + _arg1));
}
private function CheckHitTest():void{
var _local1:int;
if (targetO != null){
if (targetO.mcHP != null){
if (this["mcHP"].hitTestObject(DisplayObject(targetO.mcHP))){
HitTarget();
};
};
} else {
px = int((x / 50));
if (aly == 1){
_local1 = 0;
while (_local1 < root["bgContainer"]["enmyColl"][px].length) {
targetO = new Object();
targetO = root["bgContainer"]["enmyColl"][px][_local1];
if (targetO != null){
if (targetO.mcHP != null){
if (this["mcHP"].hitTestObject(DisplayObject(targetO.mcHP))){
HitTarget();
break;
};
};
};
_local1++;
};
} else {
_local1 = 0;
while (_local1 < root["bgContainer"]["allyColl"][px].length) {
targetO = new Object();
targetO = root["bgContainer"]["allyColl"][px][_local1];
if (targetO != null){
if (targetO.mcHP != null){
if (this["mcHP"].hitTestObject(DisplayObject(targetO.mcHP))){
HitTarget();
break;
};
};
};
_local1++;
};
};
};
}
private function SetAreaDmg(_arg1:int):void{
var _local2:Object;
var _local3:int;
var _local4:Number;
var _local5:Number;
var _local6:Number;
if (aly == 1){
_local3 = 0;
while (_local3 < root["bgContainer"]["enmyColl"][_arg1].length) {
_local2 = new Object();
_local2 = root["bgContainer"]["enmyColl"][_arg1][_local3];
if (((!((_local2 == null))) && ((GetDistance((x - _local2.x), (_local2.y - y)) < 100)))){
if (spcSkill == 2){
if (_local2.isBounce){
if (_local2.sPos == 0){
_local6 = (_local2.x - _local2.bodyW);
if (x > _local6){
_local4 = (_local2.x - (RandomNum(8, 12) * 10));
if (_local4 < 210){
_local4 = _local2.x;
};
} else {
_local4 = _local2.x;
};
} else {
_local6 = (_local2.x + _local2.bodyW);
if (x < _local6){
_local4 = (_local2.x + (RandomNum(8, 12) * 10));
if (_local4 > 1390){
_local4 = _local2.x;
};
} else {
_local4 = _local2.x;
};
};
_local2.BounceThis(_local4, int((dmg * 1.5)));
_local2 = null;
} else {
_local2.SetDamage(int((dmg / 2)));
_local2 = null;
};
} else {
if (spcSkill == 5){
_local2.GetPoison();
_local2 = null;
} else {
_local2.SetDamage(int((dmg / 2)));
_local2 = null;
};
};
};
_local3++;
};
} else {
_local3 = 0;
while (_local3 < root["bgContainer"]["allyColl"][_arg1].length) {
_local2 = new Object();
_local2 = root["bgContainer"]["allyColl"][_arg1][_local3];
if (((!((_local2 == null))) && ((GetDistance((x - _local2.x), (_local2.y - y)) < 100)))){
if (spcSkill == 2){
if (_local2.isBounce){
if (_local2.sPos == 0){
_local6 = (_local2.x - _local2.bodyW);
if (x > _local6){
_local4 = (_local2.x - (RandomNum(8, 12) * 10));
if (_local4 < 210){
_local4 = _local2.x;
};
} else {
_local4 = _local2.x;
};
} else {
_local6 = (_local2.x + _local2.bodyW);
if (x < _local6){
_local4 = (_local2.x + (RandomNum(8, 12) * 10));
if (_local4 > 1390){
_local4 = _local2.x;
};
} else {
_local4 = _local2.x;
};
};
_local2.BounceThis(_local4, int((dmg * 1.5)));
_local2 = null;
} else {
_local2.SetDamage(int((dmg / 2)));
_local2 = null;
};
} else {
if (spcSkill == 5){
_local2.GetPoison();
_local2 = null;
} else {
_local2.SetDamage(int((dmg / 2)));
_local2 = null;
};
};
};
_local3++;
};
};
}
}
}//package
Section 220
//CMissileB (CMissileB)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.media.*;
import fl.transitions.easing.*;
public class CMissileB extends MovieClip {
private var dmg:int;
private var px:Number;
private var tx:int;
private var ty:int;
private var aly:int;
var angle:Number;
private var targetO:Object;
public function Init(_arg1:Number, _arg2:Number, _arg3:Object, _arg4:Boolean=false, _arg5:int=0, _arg6:Number=1, _arg7:int=0):void{
x = _arg1;
y = _arg2;
targetO = new Object();
targetO = _arg3;
aly = int(name.charAt(1));
dmg = int(name.substr(2));
tx = RandomNum((targetO.x - (targetO.width / 2)), (targetO.x + (targetO.width / 2)));
ty = (targetO.y - (targetO.height / 2));
angle = GetAngle((x - tx), (y - ty));
scaleY = 0.5;
rotation = angle;
mouseEnabled = false;
mouseChildren = false;
}
private function GetAngle(_arg1:Number, _arg2:Number):Number{
return (((Math.atan2(_arg2, _arg1) * 180) / Math.PI));
}
private function RandomNum(_arg1:Number, _arg2:Number):Number{
return ((Math.floor((Math.random() * ((_arg2 - _arg1) + 1))) + _arg1));
}
}
}//package
Section 221
//CMissileD (CMissileD)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.media.*;
import fl.transitions.easing.*;
public class CMissileD extends MovieClip {
private var dmg:int;
private var effScl:Number;
private var px:Number;
public var mcHP:MovieClip;
private var speed:int;// = 10
private var sy:int;
private var spcSkill:int;
private var rt:Timer;
private var sx:int;
private var ty:int;
private var tx:int;
private var aly:int;
private var angle:Number;
private var isArea:Boolean;
private var targetO:Object;
private var eff:int;
public function CMissileD(){
speed = 10;
super();
}
public function Init(_arg1:Number, _arg2:Number, _arg3:Object, _arg4:Boolean=false, _arg5:int=0, _arg6:Number=1, _arg7:int=0):void{
x = (sx = _arg1);
y = (sy = _arg2);
isArea = _arg4;
eff = _arg5;
effScl = _arg6;
spcSkill = _arg7;
targetO = new Object();
targetO = _arg3;
aly = int(name.charAt(1));
dmg = int(name.substr(2));
tx = RandomNum((targetO.x - (targetO.width / 2)), (targetO.x + (targetO.width / 2)));
ty = (targetO.y - (targetO.height / 2));
angle = GetAngle((x - tx), (y - ty));
rotation = angle;
rt = new Timer(10);
rt.start();
rt.addEventListener(TimerEvent.TIMER, Moving, false, 0, true);
mouseEnabled = false;
mouseChildren = false;
}
private function HitTarget():void{
var _local1:int;
var _local2:int;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
if (isArea){
_local1 = int((targetO.x / 50));
SetAreaDmg(_local1);
_local2 = (_local1 - 1);
if (_local2 < 0){
_local2 = 0;
};
if (_local2 != _local1){
SetAreaDmg(_local2);
};
_local2 = (_local1 + 1);
if (_local2 > 31){
_local2 = 31;
};
if (_local2 != _local1){
SetAreaDmg(_local2);
};
};
if (targetO != null){
_local3 = (targetO.x + (RandomNum(0, targetO.bodyW) * RandomNum(-1, 1)));
if (eff == 4){
_local4 = targetO.y;
} else {
_local4 = (targetO.y - RandomNum(5, targetO.bodyH));
};
if (spcSkill == 0){
targetO.SetDamage(dmg);
this["root"]["bgContainer"].CallEffect(eff, _local3, _local4, effScl);
} else {
if (spcSkill == 1){
targetO.SetDamage((dmg * 2), true);
this["root"]["bgContainer"].CallEffect(1, _local3, _local4, effScl);
} else {
if (spcSkill == 2){
if (targetO.isBounce){
if (targetO.sPos == 0){
_local7 = (targetO.x - targetO.bodyW);
if (x > _local7){
_local5 = (targetO.x - (RandomNum(8, 12) * 10));
if (_local5 < 210){
_local5 = targetO.x;
};
} else {
_local5 = targetO.x;
};
} else {
_local7 = (targetO.x + targetO.bodyW);
if (x < _local7){
_local5 = (targetO.x + (RandomNum(8, 12) * 10));
if (_local5 > 1390){
_local5 = targetO.x;
};
} else {
_local5 = targetO.x;
};
};
targetO.BounceThis(_local5, int((dmg * 1.5)));
this["root"]["bgContainer"].CallEffect(eff, x, y, effScl);
} else {
targetO.SetDamage((dmg * 1.5), true);
this["root"]["bgContainer"].CallEffect(1, _local3, _local4, 1);
};
} else {
if (spcSkill == 3){
targetO.SetDamage((dmg * 2), true);
this["root"]["bgContainer"].CallEffect(3, _local3, _local4, 1);
} else {
if (spcSkill == 4){
targetO.SetDamage((dmg * 2), true);
this["root"]["bgContainer"].CallEffect(2, _local3, _local4, 1);
} else {
if (spcSkill == 5){
targetO.SetDamage(dmg);
targetO.GetPoison();
if (isArea){
this["root"]["bgContainer"].CallEffect(eff, x, targetO.y, effScl);
};
} else {
if (spcSkill == 6){
targetO.SetDamage((dmg * 3), true);
this["root"]["bgContainer"].CallEffect(1, _local3, _local4, 1);
};
};
};
};
};
};
};
targetO = null;
};
rt.stop();
rt.removeEventListener(TimerEvent.TIMER, Moving);
this["parent"].removeChild(this);
}
private function GetAngle(_arg1:Number, _arg2:Number):Number{
return (((Math.atan2(_arg2, _arg1) * 180) / Math.PI));
}
private function Moving(_arg1:TimerEvent):void{
if (root["isStopGame"]){
rt.stop();
rt.removeEventListener(TimerEvent.TIMER, Moving);
return;
};
if (!root["isPause"]){
y = (y - (speed * Math.cos(((angle - 90) * (Math.PI / 180)))));
x = (x + (speed * Math.sin(((angle - 90) * (Math.PI / 180)))));
if (GetDistance((x - sx), (sy - y)) > 500){
targetO = null;
rt.stop();
rt.removeEventListener(TimerEvent.TIMER, Moving);
this["parent"].removeChild(this);
return;
};
CheckHitTest();
};
}
private function GetDistance(_arg1:Number, _arg2:Number):Number{
return (Math.sqrt(((_arg1 * _arg1) + (_arg2 * _arg2))));
}
private function SetAreaDmg(_arg1:int):void{
var _local2:Object;
var _local3:int;
var _local4:Number;
var _local5:Number;
var _local6:Number;
if (aly == 1){
_local3 = 0;
while (_local3 < root["bgContainer"]["enmyColl"][_arg1].length) {
_local2 = new Object();
_local2 = root["bgContainer"]["enmyColl"][_arg1][_local3];
if (((!((_local2 == null))) && ((GetDistance((x - _local2.x), (_local2.y - y)) < 100)))){
if (spcSkill == 2){
if (_local2.isBounce){
if (_local2.sPos == 0){
_local6 = (_local2.x - _local2.bodyW);
if (x > _local6){
_local4 = (_local2.x - (RandomNum(8, 12) * 10));
if (_local4 < 210){
_local4 = _local2.x;
};
} else {
_local4 = _local2.x;
};
} else {
_local6 = (_local2.x + _local2.bodyW);
if (x < _local6){
_local4 = (_local2.x + (RandomNum(8, 12) * 10));
if (_local4 > 1390){
_local4 = _local2.x;
};
} else {
_local4 = _local2.x;
};
};
_local2.BounceThis(_local4, int((dmg * 1.5)));
_local2 = null;
} else {
_local2.SetDamage(int((dmg / 2)));
_local2 = null;
};
} else {
if (spcSkill == 5){
_local2.GetPoison();
_local2 = null;
} else {
_local2.SetDamage(int((dmg / 2)));
_local2 = null;
};
};
};
_local3++;
};
} else {
_local3 = 0;
while (_local3 < root["bgContainer"]["allyColl"][_arg1].length) {
_local2 = new Object();
_local2 = root["bgContainer"]["allyColl"][_arg1][_local3];
if (((!((_local2 == null))) && ((GetDistance((x - _local2.x), (_local2.y - y)) < 100)))){
if (spcSkill == 2){
if (_local2.isBounce){
if (_local2.sPos == 0){
_local6 = (_local2.x - _local2.bodyW);
if (x > _local6){
_local4 = (_local2.x - (RandomNum(8, 12) * 10));
if (_local4 < 210){
_local4 = _local2.x;
};
} else {
_local4 = _local2.x;
};
} else {
_local6 = (_local2.x + _local2.bodyW);
if (x < _local6){
_local4 = (_local2.x + (RandomNum(8, 12) * 10));
if (_local4 > 1390){
_local4 = _local2.x;
};
} else {
_local4 = _local2.x;
};
};
_local2.BounceThis(_local4, int((dmg * 1.5)));
_local2 = null;
} else {
_local2.SetDamage(int((dmg / 2)));
_local2 = null;
};
} else {
if (spcSkill == 5){
_local2.GetPoison();
_local2 = null;
} else {
_local2.SetDamage(int((dmg / 2)));
_local2 = null;
};
};
};
_local3++;
};
};
}
private function RandomNum(_arg1:Number, _arg2:Number):Number{
return ((Math.floor((Math.random() * ((_arg2 - _arg1) + 1))) + _arg1));
}
private function CheckHitTest():void{
var _local1:int;
if (targetO != null){
if (targetO.mcHP != null){
if (this["mcHP"].hitTestObject(DisplayObject(targetO.mcHP))){
HitTarget();
};
};
} else {
px = int((x / 50));
if (aly == 1){
_local1 = 0;
while (_local1 < root["bgContainer"]["enmyColl"][px].length) {
targetO = new Object();
targetO = root["bgContainer"]["enmyColl"][px][_local1];
if (targetO != null){
if (targetO.mcHP != null){
if (this["mcHP"].hitTestObject(DisplayObject(targetO.mcHP))){
HitTarget();
break;
};
};
};
_local1++;
};
} else {
_local1 = 0;
while (_local1 < root["bgContainer"]["allyColl"][px].length) {
targetO = new Object();
targetO = root["bgContainer"]["allyColl"][px][_local1];
if (targetO != null){
if (targetO.mcHP != null){
if (this["mcHP"].hitTestObject(DisplayObject(targetO.mcHP))){
HitTarget();
break;
};
};
};
_local1++;
};
};
};
}
}
}//package
Section 222
//CRangeAirUnit (CRangeAirUnit)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import fl.motion.*;
import flash.geom.*;
import flash.media.*;
import fl.transitions.easing.*;
public class CRangeAirUnit extends CAirUnit {
private var objRef:Class;
private var isHasPoison:Boolean;
private var poisonT:Timer;
private var sndAtt:String;
private var poisonAble:Boolean;
public var mcHP:MovieClip;
public var missile:Object;
private var tDelay:Timer;
private var idleTimer:Timer;
private var tPause:Timer;
public function CRangeAirUnit(){
gotoAndStop("walk");
}
private function IsOutArea():Boolean{
return ((((x >= 0)) && ((x <= 1600))));
}
override public function CheckAvaiEnemy():void{
if (IsThereATarget()){
destX = mainTarget;
isIdle = false;
if (idleTimer != null){
idleTimer.stop();
idleTimer.removeEventListener(TimerEvent.TIMER, OnIdle);
idleTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, IdleOver);
};
} else {
isIdle = true;
idleTimer = new Timer(1000, RandomNum(1, 3));
idleTimer.start();
idleTimer.addEventListener(TimerEvent.TIMER, OnIdle, false, 0, true);
idleTimer.addEventListener(TimerEvent.TIMER_COMPLETE, IdleOver, false, 0, true);
};
}
public function SetDamage(_arg1:int, _arg2:Boolean=false):void{
var _local3:int;
var _local4:int;
_local3 = (Math.abs(_arg1) - arm);
if (_local3 <= 0){
_local3 = 1;
};
_local4 = _local3;
if (_local4 > life){
_local4 = life;
};
life = (life - _local3);
if (sPos == 0){
root["panelActIcon1"].Update(nm, _local4);
} else {
root["panelActIcon2"].Update(nm, _local4);
};
if (_arg2){
this["root"]["bgContainer"].CallDamagePoin(x, (y - bodyH), _local3, 1.5);
} else {
this["root"]["bgContainer"].CallDamagePoin(x, (y - bodyH), _local3);
};
if ((((life <= 0)) && (!(isDie)))){
if (sPos == 0){
root["panelActIcon1"].Del(nm);
} else {
root["panelActIcon2"].Del(nm);
};
isDie = true;
px = int(((x + (bodyW * scaleX)) / 50));
if (isAlly){
root["bgContainer"].RemoveArrValue(root["bgContainer"]["allyColl"][px], this);
root["bgContainer"].RemoveArrValue(root["bgContainer"]["allyColl"][curPx], this);
CountLostStat();
} else {
root["bgContainer"].RemoveArrValue(root["bgContainer"]["enmyColl"][px], this);
root["bgContainer"].RemoveArrValue(root["bgContainer"]["enmyColl"][curPx], this);
CountKillStat();
};
return;
};
if ((((life <= 20)) && ((life > 0)))){
Retreat();
};
}
public function CreateMissile(_arg1:int, _arg2:Number, _arg3:Number, _arg4:Number=1, _arg5:Boolean=false, _arg6:int=0, _arg7:Number=1):void{
if (targetO == null){
targetO = GetTargetToAtt();
StopAttack();
return;
};
if (_arg1 != 15){
this["root"].PlaySound(sndAtt);
};
objRef = (getDefinitionByName(("Missile" + _arg1)) as Class);
missile = new objRef();
root["bgContainer"]["missileContainer"].addChild(DisplayObject(missile));
missile.scaleX = (missile.scaleY = _arg4);
missile.name = (("m" + int(isAlly)) + att);
if (hasSkill){
if (RandomNum(1, 5) == 1){
missile.Init((x + _arg2), (y - _arg3), targetO, _arg5, _arg6, _arg7, skillTyp);
} else {
missile.Init((x + _arg2), (y - _arg3), targetO, _arg5, _arg6, _arg7);
};
} else {
missile.Init((x + _arg2), (y - _arg3), targetO, _arg5, _arg6, _arg7);
};
if (targetO.GetLife() < 20){
targetO = GetTargetToAtt();
StopAttack();
};
}
public function Attack():void{
if (!isAttack){
isAttack = true;
if (sPos == 0){
if (scaleX == -1){
scaleX = 1;
};
} else {
if (scaleX == 1){
scaleX = -1;
};
};
gotoAndStop("att");
isIdle = false;
};
}
private function Factorial(_arg1:int):Number{
var _local2:Number;
_local2 = 1;
_arg1--;
if (_arg1 == 1){
_local2 = 2;
} else {
if (_arg1 > 1){
while (_arg1--) {
_local2 = (_local2 * 2);
};
};
};
return (_local2);
}
private function OnIdle(_arg1:TimerEvent):void{
if (root["isStopGame"]){
idleTimer.stop();
idleTimer.removeEventListener(TimerEvent.TIMER, OnIdle);
idleTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, IdleOver);
};
}
public function IsThereATarget():Boolean{
var _local1:Boolean;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
_local1 = false;
if (isAlly){
if (sPos == 0){
_local2 = int((x / 50));
if (_local2 < 0){
_local2 = 0;
};
_local4 = (x + 500);
_local3 = int((_local4 / 50));
if (_local3 > 31){
_local3 = 31;
};
_local5 = _local2;
while (_local5 <= _local3) {
if (root["bgContainer"]["enmyColl"][_local5].length > 0){
_local1 = true;
break;
} else {
_local1 = false;
};
_local5++;
};
} else {
_local2 = int((x / 50));
if (_local2 > 31){
_local2 = 31;
};
_local4 = (x - rng);
_local3 = int((_local4 / 50));
if (_local3 < 0){
_local3 = 0;
};
_local5 = _local2;
while (_local5 >= _local3) {
if (root["bgContainer"]["enmyColl"][_local5].length > 0){
_local1 = true;
break;
} else {
_local1 = false;
};
_local5--;
};
};
} else {
if (sPos == 0){
_local2 = int((x / 50));
if (_local2 < 0){
_local2 = 0;
};
_local4 = (x + 500);
_local3 = int((_local4 / 50));
if (_local3 > 31){
_local3 = 31;
};
_local5 = _local2;
while (_local5 <= _local3) {
if (root["bgContainer"]["allyColl"][_local5].length > 0){
_local1 = true;
break;
} else {
_local1 = false;
};
_local5++;
};
} else {
_local2 = int((x / 50));
if (_local2 > 31){
_local2 = 31;
};
_local4 = (x - rng);
_local3 = int((_local4 / 50));
if (_local3 < 0){
_local3 = 0;
};
_local5 = _local2;
while (_local5 >= _local3) {
if (root["bgContainer"]["allyColl"][_local5].length > 0){
_local1 = true;
break;
} else {
_local1 = false;
};
_local5--;
};
};
};
return (_local1);
}
private function IdleOver(_arg1:TimerEvent):void{
idleTimer.stop();
idleTimer.removeEventListener(TimerEvent.TIMER, OnIdle);
idleTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, IdleOver);
if (isAttack){
return;
};
if (isRetreat){
tacticType = 0;
};
SetDestination(tacticType);
isIdle = false;
}
private function CountKillStat():void{
if (unitTyp == "land"){
var _local1 = root["tempGSKill"];
var _local2 = 1;
var _local3 = (_local1[_local2] + 1);
_local1[_local2] = _local3;
} else {
if (unitTyp == "air"){
_local1 = root["tempGSKill"];
_local2 = 2;
_local3 = (_local1[_local2] + 1);
_local1[_local2] = _local3;
} else {
if (unitTyp == "sea"){
_local1 = root["tempGSKill"];
_local2 = 3;
_local3 = (_local1[_local2] + 1);
_local1[_local2] = _local3;
};
};
};
root["myGold"] = (root["myGold"] + Math.round((0.75 * price)));
root["charPanel"]["txGold"].text = root["myGold"];
}
override public function StopAttack():void{
isAttack = false;
if (currentLabel != "die"){
gotoAndStop("walk");
};
}
override public function UpdateThis():void{
px = int(((x + (bodyW * scaleX)) / 50));
if (px > 31){
px = 31;
} else {
if (px < 0){
px = 0;
};
};
if (px != curPx){
if (isAlly){
root["bgContainer"].RemoveArrValue(root["bgContainer"]["allyColl"][curPx], this);
root["bgContainer"]["allyColl"][px].push(this);
} else {
root["bgContainer"].RemoveArrValue(root["bgContainer"]["enmyColl"][curPx], this);
root["bgContainer"]["enmyColl"][px].push(this);
};
curPx = px;
};
if (((((!(isIdle)) && (!(isRetreat)))) && (!(isDie)))){
ReadyToAttack();
};
if (((((isDefend) && (!(isDie)))) && (IsThereCloseTarget()))){
SetDestination(2);
};
}
override public function SetAttributes(_arg1:String):void{
var _local2:int;
var _local3:Color;
var _local4:Number;
attrib = new Array();
attrib = root["bgContainer"]["charAttrib"].GetAttrib(_arg1, root["mapId"]);
nm = attrib[0];
if (isAlly){
life = (int(attrib[1]) + (5 * (lvl - 1)));
att = (int(attrib[2]) + (2 * (lvl - 1)));
arm = (int(attrib[3]) + (1 * (lvl - 1)));
} else {
if (root["mapId"] == 1){
_local4 = 1.1;
} else {
if ((((root["mapId"] == 2)) || ((root["mapId"] == 3)))){
_local4 = 1.2;
} else {
if (root["mapId"] == 4){
_local4 = 1.3;
};
};
};
life = ((int((attrib[1] * _local4)) + (5 * (lvl - 1))) - Math.round((int(attrib[1]) * root["aiHpConf"])));
att = ((int((attrib[2] * _local4)) + (2 * (lvl - 1))) - Math.round((int(attrib[2]) * root["aiHpConf"])));
arm = ((int((attrib[3] * _local4)) + (1 * (lvl - 1))) - Math.round((int(attrib[3]) * root["aiHpConf"])));
};
defaultSpd = attrib[4];
rng = Number((attrib[5] * 30));
skill = int(attrib[7]);
price = int(attrib[8]);
attType = int(attrib[11]);
isBounce = Boolean(int(attrib[12]));
skillTyp = int(attrib[13]);
unitTyp = String(attrib[14]);
poisonAble = Boolean(int(attrib[15]));
isHasPoison = false;
sndAtt = String(attrib[16]);
if (sPos == 0){
root["panelActIcon1"].Add(1, nm, life);
} else {
root["panelActIcon2"].Add(2, nm, life);
};
attCnt = 0;
_local2 = root["bgContainer"]["charAttrib"].GetIndex(_arg1);
root["bgContainer"].charColl[_local2].push(this);
_local3 = new Color();
this.transform.colorTransform = _local3;
runTimer = new Timer(10);
runTimer.start();
runTimer.addEventListener(TimerEvent.TIMER, Moving, false, 0, true);
}
private function OnPause(_arg1:TimerEvent):void{
if (!root["isPause"]){
poisonT.start();
tPause.stop();
tPause.removeEventListener(TimerEvent.TIMER, OnPause);
};
}
private function ReadyToAttack():void{
var _local1:Number;
targetO = null;
targetO = GetTargetToAtt();
if (targetO != null){
if (sPos == 0){
fBound = (targetO.x - targetO.bodyW);
} else {
fBound = (targetO.x + targetO.bodyW);
};
_local1 = GetDistance((x - fBound), 0);
if (_local1 <= rng){
if (sPos == 0){
if ((x + bodyW) > fBound){
return;
};
} else {
if ((x - bodyW) < fBound){
return;
};
};
Attack();
};
};
}
public function BounceThis(_arg1:Number, _arg2:int):void{
}
public function GetLife():int{
return (life);
}
private function OnPoisonEnd(_arg1:TimerEvent):void{
var _local2:Color;
isHasPoison = false;
poisonT.stop();
poisonT.addEventListener(TimerEvent.TIMER, OnPoison);
poisonT.addEventListener(TimerEvent.TIMER_COMPLETE, OnPoisonEnd);
_local2 = new Color();
this.transform.colorTransform = _local2;
}
override public function Retreat():void{
var _local1:int;
if ((((tacticType == 2)) || ((tacticType == 1)))){
_local1 = tacticType;
tacticType = 0;
SetDestination(tacticType);
if ((((sPos == 0)) && ((x < destX)))){
tacticType = _local1;
SetDestination(tacticType);
isRetreat = false;
return;
};
if ((((sPos == 1)) && ((x > destX)))){
tacticType = _local1;
SetDestination(tacticType);
isRetreat = false;
return;
};
speed = (speed * 1.5);
StopAttack();
isRetreat = true;
};
}
private function CountLostStat():void{
if (unitTyp == "land"){
var _local1 = root["tempGSLost"];
var _local2 = 1;
var _local3 = (_local1[_local2] + 1);
_local1[_local2] = _local3;
} else {
if (unitTyp == "air"){
_local1 = root["tempGSLost"];
_local2 = 2;
_local3 = (_local1[_local2] + 1);
_local1[_local2] = _local3;
} else {
if (unitTyp == "sea"){
_local1 = root["tempGSLost"];
_local2 = 3;
_local3 = (_local1[_local2] + 1);
_local1[_local2] = _local3;
};
};
};
root["aiGold"] = (root["aiGold"] + Math.round((0.75 * price)));
root["charPanel"]["txGold2"].text = root["aiGold"];
}
public function GetPoison():void{
var _local1:Color;
if (((poisonAble) && (!(isHasPoison)))){
isHasPoison = true;
_local1 = new Color();
_local1.setTint(0xFF00, 0.25);
this.transform.colorTransform = _local1;
poisonT = new Timer(1000, 3);
poisonT.start();
poisonT.addEventListener(TimerEvent.TIMER, OnPoison, false, 0, true);
poisonT.addEventListener(TimerEvent.TIMER_COMPLETE, OnPoisonEnd, false, 0, true);
};
}
private function OnPoison(_arg1:TimerEvent):void{
if (root["isPause"]){
poisonT.stop();
tPause = new Timer(10);
tPause.addEventListener(TimerEvent.TIMER, OnPause, false, 0, true);
tPause.start();
};
SetDamage((3 + arm));
if (((root["isStopGame"]) || (isDie))){
poisonT.stop();
poisonT.addEventListener(TimerEvent.TIMER, OnPoison);
poisonT.addEventListener(TimerEvent.TIMER_COMPLETE, OnPoisonEnd);
return;
};
}
public function GetTargetToAtt():Object{
var _local1:Object;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
_local1 = new Object();
if (isAlly){
if (sPos == 0){
_local2 = int(((x + bodyW) / 50));
if (_local2 < 0){
_local2 = 0;
};
_local4 = ((x + bodyW) + rng);
_local3 = int((_local4 / 50));
if (_local3 > 31){
_local3 = 31;
};
_local5 = _local2;
while (_local5 <= _local3) {
if (root["bgContainer"]["enmyColl"][_local5].length > 0){
_local1 = GetAvailableTarget(root["bgContainer"]["enmyColl"][_local5]);
break;
} else {
_local1 = null;
};
_local5++;
};
} else {
_local2 = int(((x - bodyW) / 50));
if (_local2 > 31){
_local2 = 31;
};
_local4 = ((x - bodyW) - rng);
_local3 = int((_local4 / 50));
if (_local3 < 0){
_local3 = 0;
};
_local5 = _local2;
while (_local5 >= _local3) {
if (root["bgContainer"]["enmyColl"][_local5].length > 0){
_local1 = GetAvailableTarget(root["bgContainer"]["enmyColl"][_local5]);
break;
} else {
_local1 = null;
};
_local5--;
};
};
} else {
if (sPos == 0){
_local2 = int(((x + bodyW) / 50));
if (_local2 < 0){
_local2 = 0;
};
_local4 = ((x + bodyW) + rng);
_local3 = int((_local4 / 50));
if (_local3 > 31){
_local3 = 31;
};
_local5 = _local2;
while (_local5 <= _local3) {
if (root["bgContainer"]["allyColl"][_local5].length > 0){
_local1 = GetAvailableTarget(root["bgContainer"]["allyColl"][_local5]);
break;
} else {
_local1 = null;
};
_local5++;
};
} else {
_local2 = int(((x - bodyW) / 50));
if (_local2 > 31){
_local2 = 31;
};
_local4 = ((x - bodyW) - rng);
_local3 = int((_local4 / 50));
if (_local3 < 0){
_local3 = 0;
};
_local5 = _local2;
while (_local5 >= _local3) {
if (root["bgContainer"]["allyColl"][_local5].length > 0){
_local1 = GetAvailableTarget(root["bgContainer"]["allyColl"][_local5]);
break;
} else {
_local1 = null;
};
_local5--;
};
};
};
return (_local1);
}
}
}//package
Section 223
//CRangeUnit (CRangeUnit)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import fl.motion.*;
import flash.geom.*;
import flash.media.*;
import fl.transitions.easing.*;
public class CRangeUnit extends CGroundUnit {
private var objRef:Class;
private var isHasPoison:Boolean;
private var poisonT:Timer;
private var t0:Number;// = 0
private var isToss:Boolean;// = false
private var sndAtt:String;
private var poisonAble:Boolean;
private var angle:Number;
private var anc1:Point;
public var mcHP:MovieClip;
private var anc2:Point;
public var missile:Object;
private var cont:Point;
private var spdColl:Array;
private var bounceDmg:int;// = 0
private var tDelay:Timer;
private var spdIdx:int;
private var idleTimer:Timer;
private var tPause:Timer;
private var curPos:Point;
public function CRangeUnit(){
spdColl = [0, 0.019, 0.018, 0.017, 0.016, 0.015, 0.014, 0.013, 0.012, 0.011, 0.01];
t0 = 0;
curPos = new Point();
bounceDmg = 0;
isToss = false;
super();
gotoAndStop("walk");
}
private function IsOutArea():Boolean{
return ((((x >= 0)) && ((x <= 1600))));
}
override public function CheckAvaiEnemy():void{
if (IsThereATarget()){
destX = mainTarget;
isIdle = false;
child = DisplayObject(getChildAt(0));
child.play();
if (idleTimer != null){
idleTimer.stop();
idleTimer.removeEventListener(TimerEvent.TIMER, OnIdle);
idleTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, IdleOver);
};
} else {
isIdle = true;
idleTimer = new Timer(1000, RandomNum(1, 3));
idleTimer.start();
idleTimer.addEventListener(TimerEvent.TIMER, OnIdle, false, 0, true);
idleTimer.addEventListener(TimerEvent.TIMER_COMPLETE, IdleOver, false, 0, true);
};
}
public function CreateMissile(_arg1:int, _arg2:Number, _arg3:Number, _arg4:Number=1, _arg5:Boolean=false, _arg6:int=0, _arg7:Number=1):void{
if (targetO == null){
targetO = GetTargetToAtt();
StopAttack();
return;
};
if (_arg1 != 15){
this["root"].PlaySound(sndAtt);
};
objRef = (getDefinitionByName(("Missile" + _arg1)) as Class);
missile = new objRef();
root["bgContainer"]["missileContainer"].addChild(DisplayObject(missile));
missile.scaleX = (missile.scaleY = _arg4);
missile.name = (("m" + int(isAlly)) + att);
if (hasSkill){
if (RandomNum(1, 5) == 1){
missile.Init((x + _arg2), (y - _arg3), targetO, _arg5, _arg6, _arg7, skillTyp);
} else {
missile.Init((x + _arg2), (y - _arg3), targetO, _arg5, _arg6, _arg7);
};
} else {
missile.Init((x + _arg2), (y - _arg3), targetO, _arg5, _arg6, _arg7);
};
if (targetO.GetLife() < 20){
targetO = GetTargetToAtt();
StopAttack();
};
}
public function Attack():void{
if (!isAttack){
isAttack = true;
if (sPos == 0){
if (scaleX == -1){
scaleX = 1;
};
} else {
if (scaleX == 1){
scaleX = -1;
};
};
gotoAndStop("att");
isIdle = false;
};
}
public function SetDamage(_arg1:int, _arg2:Boolean=false):void{
var _local3:int;
var _local4:int;
_local3 = (Math.abs(_arg1) - arm);
if (_local3 <= 0){
_local3 = 1;
};
_local4 = _local3;
if (_local4 > life){
_local4 = life;
};
life = (life - _local3);
if (sPos == 0){
root["panelActIcon1"].Update(nm, _local4);
} else {
root["panelActIcon2"].Update(nm, _local4);
};
if (_arg2){
this["root"]["bgContainer"].CallDamagePoin(x, (y - bodyH), _local3, 1.5);
} else {
this["root"]["bgContainer"].CallDamagePoin(x, (y - bodyH), _local3);
};
if ((((((life <= 0)) && (!(isDie)))) && (!(isToss)))){
if (sPos == 0){
root["panelActIcon1"].Del(nm);
} else {
root["panelActIcon2"].Del(nm);
};
isDie = true;
px = int(((x + (bodyW * scaleX)) / 50));
if (isAlly){
root["bgContainer"].RemoveArrValue(root["bgContainer"]["allyColl"][px], this);
root["bgContainer"].RemoveArrValue(root["bgContainer"]["allyColl"][curPx], this);
CountLostStat();
} else {
root["bgContainer"].RemoveArrValue(root["bgContainer"]["enmyColl"][px], this);
root["bgContainer"].RemoveArrValue(root["bgContainer"]["enmyColl"][curPx], this);
CountKillStat();
};
return;
};
if ((((life <= 20)) && ((life > 0)))){
Retreat();
};
}
private function Factorial(_arg1:int):Number{
var _local2:Number;
_local2 = 1;
_arg1--;
if (_arg1 == 1){
_local2 = 2;
} else {
if (_arg1 > 1){
while (_arg1--) {
_local2 = (_local2 * 2);
};
};
};
return (_local2);
}
private function OnIdle(_arg1:TimerEvent):void{
if (root["isStopGame"]){
idleTimer.stop();
idleTimer.removeEventListener(TimerEvent.TIMER, OnIdle);
idleTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, IdleOver);
};
}
public function IsThereATarget():Boolean{
var _local1:Boolean;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
_local1 = false;
if (isAlly){
if (sPos == 0){
_local2 = int((x / 50));
if (_local2 < 0){
_local2 = 0;
};
_local4 = (x + 500);
_local3 = int((_local4 / 50));
if (_local3 > 31){
_local3 = 31;
};
_local5 = _local2;
while (_local5 <= _local3) {
if (root["bgContainer"]["enmyColl"][_local5].length > 0){
_local1 = true;
break;
} else {
_local1 = false;
};
_local5++;
};
} else {
_local2 = int((x / 50));
if (_local2 > 31){
_local2 = 31;
};
_local4 = (x - rng);
_local3 = int((_local4 / 50));
if (_local3 < 0){
_local3 = 0;
};
_local5 = _local2;
while (_local5 >= _local3) {
if (root["bgContainer"]["enmyColl"][_local5].length > 0){
_local1 = true;
break;
} else {
_local1 = false;
};
_local5--;
};
};
} else {
if (sPos == 0){
_local2 = int((x / 50));
if (_local2 < 0){
_local2 = 0;
};
_local4 = (x + 500);
_local3 = int((_local4 / 50));
if (_local3 > 31){
_local3 = 31;
};
_local5 = _local2;
while (_local5 <= _local3) {
if (root["bgContainer"]["allyColl"][_local5].length > 0){
_local1 = true;
break;
} else {
_local1 = false;
};
_local5++;
};
} else {
_local2 = int((x / 50));
if (_local2 > 31){
_local2 = 31;
};
_local4 = (x - rng);
_local3 = int((_local4 / 50));
if (_local3 < 0){
_local3 = 0;
};
_local5 = _local2;
while (_local5 >= _local3) {
if (root["bgContainer"]["allyColl"][_local5].length > 0){
_local1 = true;
break;
} else {
_local1 = false;
};
_local5--;
};
};
};
return (_local1);
}
private function IdleOver(_arg1:TimerEvent):void{
idleTimer.stop();
idleTimer.removeEventListener(TimerEvent.TIMER, OnIdle);
idleTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, IdleOver);
if (isAttack){
return;
};
if (isRetreat){
tacticType = 0;
};
SetDestination(tacticType);
isIdle = false;
if (child == null){
return;
};
if (child != null){
child = DisplayObject(getChildAt(0));
child.play();
};
}
private function CountKillStat():void{
if (unitTyp == "land"){
var _local1 = root["tempGSKill"];
var _local2 = 1;
var _local3 = (_local1[_local2] + 1);
_local1[_local2] = _local3;
} else {
if (unitTyp == "air"){
_local1 = root["tempGSKill"];
_local2 = 2;
_local3 = (_local1[_local2] + 1);
_local1[_local2] = _local3;
} else {
if (unitTyp == "sea"){
_local1 = root["tempGSKill"];
_local2 = 3;
_local3 = (_local1[_local2] + 1);
_local1[_local2] = _local3;
};
};
};
root["myGold"] = (root["myGold"] + Math.round((0.75 * price)));
root["charPanel"]["txGold"].text = root["myGold"];
}
override public function StopAttack():void{
isAttack = false;
if (currentLabel != "die"){
gotoAndStop("walk");
};
}
override public function UpdateThis():void{
px = int(((x + (bodyW * scaleX)) / 50));
if (px > 31){
px = 31;
} else {
if (px < 0){
px = 0;
};
};
if (px != curPx){
if (isAlly){
root["bgContainer"].RemoveArrValue(root["bgContainer"]["allyColl"][curPx], this);
root["bgContainer"]["allyColl"][px].push(this);
} else {
root["bgContainer"].RemoveArrValue(root["bgContainer"]["enmyColl"][curPx], this);
root["bgContainer"]["enmyColl"][px].push(this);
};
curPx = px;
};
if (((((!(isIdle)) && (!(isRetreat)))) && (!(isDie)))){
ReadyToAttack();
};
if (((((isDefend) && (!(isDie)))) && (IsThereCloseTarget()))){
SetDestination(2);
};
}
override public function SetAttributes(_arg1:String):void{
var _local2:int;
var _local3:Color;
var _local4:Number;
attrib = new Array();
attrib = root["bgContainer"]["charAttrib"].GetAttrib(_arg1, root["mapId"]);
nm = attrib[0];
if (isAlly){
life = (int(attrib[1]) + (5 * (lvl - 1)));
att = (int(attrib[2]) + (2 * (lvl - 1)));
arm = (int(attrib[3]) + (1 * (lvl - 1)));
} else {
if (root["mapId"] == 1){
_local4 = 1.1;
} else {
if ((((root["mapId"] == 2)) || ((root["mapId"] == 3)))){
_local4 = 1.2;
} else {
if (root["mapId"] == 4){
_local4 = 1.3;
};
};
};
life = ((int((attrib[1] * _local4)) + (5 * (lvl - 1))) - Math.round((int(attrib[1]) * root["aiHpConf"])));
att = ((int((attrib[2] * _local4)) + (2 * (lvl - 1))) - Math.round((int(attrib[2]) * root["aiHpConf"])));
arm = ((int((attrib[3] * _local4)) + (1 * (lvl - 1))) - Math.round((int(attrib[3]) * root["aiHpConf"])));
};
defaultSpd = attrib[4];
rng = Number((attrib[5] * 30));
skill = int(attrib[7]);
price = int(attrib[8]);
attType = int(attrib[11]);
isBounce = Boolean(int(attrib[12]));
skillTyp = int(attrib[13]);
unitTyp = String(attrib[14]);
poisonAble = Boolean(int(attrib[15]));
isHasPoison = false;
isToss = false;
sndAtt = String(attrib[16]);
if (sPos == 0){
root["panelActIcon1"].Add(1, nm, life);
} else {
root["panelActIcon2"].Add(2, nm, life);
};
attCnt = 0;
_local2 = root["bgContainer"]["charAttrib"].GetIndex(_arg1);
root["bgContainer"].charColl[_local2].push(this);
_local3 = new Color();
this.transform.colorTransform = _local3;
runTimer = new Timer(10);
runTimer.start();
runTimer.addEventListener(TimerEvent.TIMER, Moving, false, 0, true);
}
private function OnPause(_arg1:TimerEvent):void{
if (!root["isPause"]){
poisonT.start();
tPause.stop();
tPause.removeEventListener(TimerEvent.TIMER, OnPause);
};
}
private function ReadyToAttack():void{
var _local1:Number;
targetO = null;
targetO = GetTargetToAtt();
if (targetO != null){
if (sPos == 0){
fBound = (targetO.x - targetO.bodyW);
} else {
fBound = (targetO.x + targetO.bodyW);
};
_local1 = GetDistance((x - fBound), (y - targetO.y));
if (_local1 <= rng){
Attack();
};
};
}
public function Bouncing(_arg1:TimerEvent):void{
curPos.x = x;
curPos.y = y;
x = (((Math.pow((1 - t0), 2) * anc1.x) + (((2 * t0) * (1 - t0)) * cont.x)) + (Math.pow(t0, 2) * anc2.x));
y = (((Math.pow((1 - t0), 2) * anc1.y) + (((2 * t0) * (1 - t0)) * cont.y)) + (Math.pow(t0, 2) * anc2.y));
t0 = (t0 + (spdColl[spdIdx] * 2));
if (t0 >= 1){
runTimer.stop();
runTimer.removeEventListener(TimerEvent.TIMER, Bouncing);
SetDamage(bounceDmg);
gotoAndStop("wake");
};
}
public function BounceThis(_arg1:Number, _arg2:int):void{
var _local3:Number;
var _local4:Number;
if (isAlly){
root["bgContainer"].RemoveArrValue(root["bgContainer"]["allyColl"][curPx], this);
} else {
root["bgContainer"].RemoveArrValue(root["bgContainer"]["enmyColl"][curPx], this);
};
gotoAndStop("toss");
isToss = true;
runTimer.stop();
runTimer.removeEventListener(TimerEvent.TIMER, Moving);
bounceDmg = _arg2;
t0 = 0;
_local3 = (x - _arg1);
_local4 = Math.abs(_local3);
anc1 = new Point(x, YPOS);
anc2 = new Point(_arg1, YPOS);
cont = new Point((x - (((_local4 / 2) * Math.abs(_local3)) / _local3)), -(Math.abs((YPOS - (_local4 / 2)))));
spdIdx = Math.ceil((_local4 / 30));
if (spdIdx >= spdColl.length){
spdIdx = (spdColl.length - 1);
};
runTimer = new Timer(10);
runTimer.start();
runTimer.addEventListener(TimerEvent.TIMER, Bouncing, false, 0, true);
}
public function GetLife():int{
return (life);
}
public function WakeUp():void{
isAttack = false;
runTimer = new Timer(10);
runTimer.start();
runTimer.addEventListener(TimerEvent.TIMER, Moving, false, 0, true);
if ((((life <= 0)) && (!(isDie)))){
if (sPos == 0){
root["panelActIcon1"].Del(nm);
} else {
root["panelActIcon2"].Del(nm);
};
isDie = true;
px = int(((x + (bodyW * scaleX)) / 50));
if (isAlly){
root["bgContainer"].RemoveArrValue(root["bgContainer"]["allyColl"][px], this);
root["bgContainer"].RemoveArrValue(root["bgContainer"]["allyColl"][curPx], this);
CountLostStat();
} else {
root["bgContainer"].RemoveArrValue(root["bgContainer"]["enmyColl"][px], this);
root["bgContainer"].RemoveArrValue(root["bgContainer"]["enmyColl"][curPx], this);
CountKillStat();
};
};
isToss = false;
}
private function OnPoisonEnd(_arg1:TimerEvent):void{
var _local2:Color;
isHasPoison = false;
poisonT.stop();
poisonT.addEventListener(TimerEvent.TIMER, OnPoison);
poisonT.addEventListener(TimerEvent.TIMER_COMPLETE, OnPoisonEnd);
_local2 = new Color();
this.transform.colorTransform = _local2;
}
override public function Retreat():void{
var _local1:int;
if ((((tacticType == 2)) || ((tacticType == 1)))){
_local1 = tacticType;
tacticType = 0;
SetDestination(tacticType);
if ((((sPos == 0)) && ((x < destX)))){
tacticType = _local1;
SetDestination(tacticType);
isRetreat = false;
return;
};
if ((((sPos == 1)) && ((x > destX)))){
tacticType = _local1;
SetDestination(tacticType);
isRetreat = false;
return;
};
speed = (speed * 1.5);
StopAttack();
isRetreat = true;
};
}
private function CountLostStat():void{
if (unitTyp == "land"){
var _local1 = root["tempGSLost"];
var _local2 = 1;
var _local3 = (_local1[_local2] + 1);
_local1[_local2] = _local3;
} else {
if (unitTyp == "air"){
_local1 = root["tempGSLost"];
_local2 = 2;
_local3 = (_local1[_local2] + 1);
_local1[_local2] = _local3;
} else {
if (unitTyp == "sea"){
_local1 = root["tempGSLost"];
_local2 = 3;
_local3 = (_local1[_local2] + 1);
_local1[_local2] = _local3;
};
};
};
root["aiGold"] = (root["aiGold"] + Math.round((0.75 * price)));
root["charPanel"]["txGold2"].text = root["aiGold"];
}
public function GetPoison():void{
var _local1:Color;
if (((poisonAble) && (!(isHasPoison)))){
isHasPoison = true;
_local1 = new Color();
_local1.setTint(0xFF00, 0.25);
this.transform.colorTransform = _local1;
poisonT = new Timer(1000, 3);
poisonT.start();
poisonT.addEventListener(TimerEvent.TIMER, OnPoison, false, 0, true);
poisonT.addEventListener(TimerEvent.TIMER_COMPLETE, OnPoisonEnd, false, 0, true);
};
}
private function OnPoison(_arg1:TimerEvent):void{
if (root["isPause"]){
poisonT.stop();
tPause = new Timer(10);
tPause.addEventListener(TimerEvent.TIMER, OnPause, false, 0, true);
tPause.start();
};
SetDamage((3 + arm));
if (((root["isStopGame"]) || (isDie))){
poisonT.stop();
poisonT.addEventListener(TimerEvent.TIMER, OnPoison);
poisonT.addEventListener(TimerEvent.TIMER_COMPLETE, OnPoisonEnd);
};
}
public function GetTargetToAtt():Object{
var _local1:Object;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
_local1 = new Object();
if (isAlly){
if (sPos == 0){
_local2 = int(((x + bodyW) / 50));
if (_local2 < 0){
_local2 = 0;
};
_local4 = ((x + bodyW) + rng);
_local3 = int((_local4 / 50));
if (_local3 > 31){
_local3 = 31;
};
_local5 = _local2;
while (_local5 <= _local3) {
if (root["bgContainer"]["enmyColl"][_local5].length > 0){
_local1 = GetAvailableTarget(root["bgContainer"]["enmyColl"][_local5]);
break;
} else {
_local1 = null;
};
_local5++;
};
} else {
_local2 = int(((x - bodyW) / 50));
if (_local2 > 31){
_local2 = 31;
};
_local4 = ((x - bodyW) - rng);
_local3 = int((_local4 / 50));
if (_local3 < 0){
_local3 = 0;
};
_local5 = _local2;
while (_local5 >= _local3) {
if (root["bgContainer"]["enmyColl"][_local5].length > 0){
_local1 = GetAvailableTarget(root["bgContainer"]["enmyColl"][_local5]);
break;
} else {
_local1 = null;
};
_local5--;
};
};
} else {
if (sPos == 0){
_local2 = int(((x + bodyW) / 50));
if (_local2 < 0){
_local2 = 0;
};
_local4 = ((x + bodyW) + rng);
_local3 = int((_local4 / 50));
if (_local3 > 31){
_local3 = 31;
};
_local5 = _local2;
while (_local5 <= _local3) {
if (root["bgContainer"]["allyColl"][_local5].length > 0){
_local1 = GetAvailableTarget(root["bgContainer"]["allyColl"][_local5]);
break;
} else {
_local1 = null;
};
_local5++;
};
} else {
_local2 = int(((x - bodyW) / 50));
if (_local2 > 31){
_local2 = 31;
};
_local4 = ((x - bodyW) - rng);
_local3 = int((_local4 / 50));
if (_local3 < 0){
_local3 = 0;
};
_local5 = _local2;
while (_local5 >= _local3) {
if (root["bgContainer"]["allyColl"][_local5].length > 0){
_local1 = GetAvailableTarget(root["bgContainer"]["allyColl"][_local5]);
break;
} else {
_local1 = null;
};
_local5--;
};
};
};
return (_local1);
}
}
}//package
Section 224
//Credits (Credits)
package {
import uiscr.*;
public dynamic class Credits extends CCredits {
}
}//package
Section 225
//CTurret (CTurret)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.media.*;
import fl.transitions.easing.*;
public class CTurret extends MovieClip {
private var currDestX:Number;
private var life:int;
private var isAttack:Boolean;
private var objRef:Class;
private var lvl:int;
public var missile:Object;
private var arm:int;
private var SY:Number;
private var tDelay:Timer;
private var sndAtt:String;
private var SX:Number;
private var delay:int;
private var delayTimer:Timer;
private var spotY:Number;
private var type:int;
private var att:int;
private var spd:int;
private var skillTyp:uint;
private var isAlly:Boolean;
private var rng:Number;
private var nm:String;
private var angle:Number;
private var runTimer:Timer;
private var sPos:int;
private var targetO:Object;
private var tPause:Timer;
private var spotX:Number;
public function CTurret(){
gotoAndStop("walk");
}
private function GetTargetToAtt():Object{
var _local1:Object;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
_local1 = new Object();
if (isAlly){
if (sPos == 0){
_local2 = int((x / 50));
_local4 = (x + rng);
if (_local4 > 1600){
_local4 = 1600;
};
_local3 = int((_local4 / 50));
_local5 = _local2;
while (_local5 <= _local3) {
if (root["bgContainer"]["enmyColl"][_local5].length > 0){
_local1 = GetAvailableTarget(root["bgContainer"]["enmyColl"][_local5]);
break;
} else {
_local1 = null;
};
_local5++;
};
} else {
_local2 = int((spotX / 50));
_local4 = (spotX - rng);
if (_local4 < 0){
_local4 = 0;
};
_local3 = int((_local4 / 50));
_local5 = _local2;
while (_local5 >= _local3) {
if (root["bgContainer"]["enmyColl"][_local5].length > 0){
_local1 = GetAvailableTarget(root["bgContainer"]["enmyColl"][_local5]);
break;
} else {
_local1 = null;
};
_local5--;
};
};
} else {
if (sPos == 0){
_local2 = int((x / 50));
_local4 = (x + rng);
if (_local4 > 1600){
_local4 = 1600;
};
_local3 = int((_local4 / 50));
_local5 = _local2;
while (_local5 <= _local3) {
if (root["bgContainer"]["allyColl"][_local5].length > 0){
_local1 = GetAvailableTarget(root["bgContainer"]["allyColl"][_local5]);
break;
} else {
_local1 = null;
};
_local5++;
};
} else {
_local2 = int((spotX / 50));
_local4 = (spotX - rng);
if (_local4 < 0){
_local4 = 0;
};
_local3 = int((_local4 / 50));
_local5 = _local2;
while (_local5 >= _local3) {
if (root["bgContainer"]["allyColl"][_local5].length > 0){
_local1 = GetAvailableTarget(root["bgContainer"]["allyColl"][_local5]);
break;
} else {
_local1 = null;
};
_local5--;
};
};
};
return (_local1);
}
public function Stop():void{
runTimer.stop();
runTimer.removeEventListener(TimerEvent.TIMER, Running);
gotoAndPlay("destroy");
}
private function StopAttack():void{
isAttack = false;
}
public function Init(_arg1:int, _arg2:int, _arg3:Boolean):void{
type = _arg1;
sPos = _arg2;
isAlly = _arg3;
isAttack = false;
if (root["nTurret"] <= 1){
att = 10;
} else {
if (root["nTurret"] == 2){
att = 12;
} else {
if (root["nTurret"] == 3){
att = 14;
} else {
if (root["nTurret"] == 4){
att = 16;
};
};
};
};
skillTyp = 0;
if (type == 1){
rng = (10 * 50);
delay = 2;
sndAtt = "06";
} else {
if (type == 2){
rng = (10 * 50);
delay = 6;
sndAtt = "06";
} else {
if (type == 3){
rng = (8 * 50);
delay = 3;
sndAtt = "14";
} else {
if (type == 4){
rng = (12 * 50);
delay = 6;
sndAtt = "17";
} else {
if (type == 5){
rng = (6 * 50);
delay = 2;
sndAtt = "07";
} else {
if (type == 6){
rng = (12 * 50);
delay = 6;
sndAtt = "06";
} else {
if (type == 7){
rng = (8 * 50);
delay = 3;
skillTyp = 5;
sndAtt = "19";
} else {
if (type == 8){
rng = (6 * 50);
delay = 6;
sndAtt = "20";
};
};
};
};
};
};
};
};
SX = (this["parent"].x + x);
SY = (this["parent"].y + y);
spotX = (this["parent"].x - x);
spotY = (this["parent"].y - y);
runTimer = new Timer(10);
runTimer.start();
runTimer.addEventListener(TimerEvent.TIMER, Running, false, 0, true);
}
private function OnPause(_arg1:TimerEvent):void{
if (!root["isPause"]){
delayTimer.start();
tPause.stop();
tPause.removeEventListener(TimerEvent.TIMER, OnPause);
};
}
private function GetAngle(_arg1:Number, _arg2:Number):Number{
return (((Math.atan2(_arg2, _arg1) * 180) / Math.PI));
}
public function CreateMissile(_arg1:int, _arg2:Number, _arg3:Number, _arg4:Number=1, _arg5:Boolean=false, _arg6:int=0, _arg7:Number=1):void{
delayTimer = new Timer(1000, delay);
delayTimer.start();
delayTimer.addEventListener(TimerEvent.TIMER, Delaying, false, 0, true);
delayTimer.addEventListener(TimerEvent.TIMER_COMPLETE, DelayCompleted, false, 0, true);
if (targetO == null){
targetO = GetTargetToAtt();
StopAttack();
return;
};
if (_arg1 != 15){
this["root"].PlaySound(sndAtt);
};
objRef = (getDefinitionByName(("Missile" + _arg1)) as Class);
missile = new objRef();
root["bgContainer"]["turetContainer"].addChild(DisplayObject(missile));
missile.scaleX = (missile.scaleY = _arg4);
missile.name = (("m" + int(isAlly)) + att);
if (type == 5){
rotation = (180 - (GetAngle((spotX - targetO.x), (spotY - targetO.y)) / 4));
};
missile.Init((SX + _arg2), (SY - _arg3), targetO, _arg5, _arg6, _arg7, skillTyp);
}
private function GetDistance(_arg1:Number, _arg2:Number):Number{
return (Math.sqrt(((_arg1 * _arg1) + (_arg2 * _arg2))));
}
private function Attack():void{
if (!isAttack){
isAttack = true;
gotoAndPlay("shoot");
};
}
private function DelayCompleted(_arg1:TimerEvent):void{
delayTimer.stop();
delayTimer.removeEventListener(TimerEvent.TIMER, Delaying);
delayTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, DelayCompleted);
isAttack = false;
}
private function Running(_arg1:TimerEvent):void{
if (!root["isPause"]){
if (!isAttack){
targetO = GetTargetToAtt();
};
if (targetO != null){
Attack();
};
};
if (root["isStopGame"]){
runTimer.stop();
runTimer.removeEventListener(TimerEvent.TIMER, Running);
};
}
private function Delaying(_arg1:TimerEvent):void{
if (root["isPause"]){
delayTimer.stop();
tPause = new Timer(10);
tPause.addEventListener(TimerEvent.TIMER, OnPause, false, 0, true);
tPause.start();
};
}
private function RandomNum(_arg1:Number, _arg2:Number):Number{
return ((Math.floor((Math.random() * ((_arg2 - _arg1) + 1))) + _arg1));
}
private function GetAvailableTarget(_arg1:Array):Object{
var _local2:int;
var _local3:Object;
_local2 = _arg1.length;
_local3 = null;
if (_local2 == 1){
_local3 = _arg1[0];
} else {
if (_local2 > 1){
_local3 = _arg1[RandomNum(0, (_local2 - 1))];
};
};
return (_local3);
}
}
}//package
Section 226
//DamagePoin1 (DamagePoin1)
package {
import flash.display.*;
public dynamic class DamagePoin1 extends MovieClip {
public var mcCap:MovieClip;
public function DamagePoin1(){
addFrameScript(0, frame1, 20, frame21);
}
function frame1(){
stop();
}
function frame21(){
x = -10;
y = -10;
}
}
}//package
Section 227
//DamagePoin2 (DamagePoin2)
package {
import flash.display.*;
public dynamic class DamagePoin2 extends MovieClip {
public var mcCap:MovieClip;
public function DamagePoin2(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 228
//DamagePoin3 (DamagePoin3)
package {
import flash.display.*;
public dynamic class DamagePoin3 extends MovieClip {
public var mcCap:MovieClip;
public function DamagePoin3(){
addFrameScript(0, frame1, 20, frame21);
}
function frame1(){
stop();
}
function frame21(){
x = -10;
y = -10;
}
}
}//package
Section 229
//DarkActIcon (DarkActIcon)
package {
import uiscr.*;
public dynamic class DarkActIcon extends CActIcon {
}
}//package
Section 230
//Darkelf (Darkelf)
package {
public dynamic class Darkelf extends CRangeUnit {
}
}//package
Section 231
//Darkevil (Darkevil)
package {
public dynamic class Darkevil extends CMeleeUnit {
}
}//package
Section 232
//DarkUpgrade (DarkUpgrade)
package {
import uiscr.*;
public dynamic class DarkUpgrade extends CUpgrade {
}
}//package
Section 233
//domainError (domainError)
package {
public dynamic class domainError extends CLogo {
}
}//package
Section 234
//Dracula (Dracula)
package {
public dynamic class Dracula extends CRangeAirUnit {
}
}//package
Section 235
//Dragon (Dragon)
package {
public dynamic class Dragon extends CRangeAirUnit {
}
}//package
Section 236
//Eagle (Eagle)
package {
public dynamic class Eagle extends CRangeAirUnit {
}
}//package
Section 237
//ExpEff (ExpEff)
package {
import flash.display.*;
public dynamic class ExpEff extends MovieClip {
public function ExpEff(){
addFrameScript(0, frame1, 11, frame12);
}
function frame12(){
x = -100;
y = -100;
stop();
}
function frame1(){
stop();
}
}
}//package
Section 238
//FroEff (FroEff)
package {
import flash.display.*;
public dynamic class FroEff extends MovieClip {
public function FroEff(){
addFrameScript(0, frame1, 33, frame34);
}
function frame1(){
stop();
}
function frame34(){
x = -100;
y = -100;
stop();
}
}
}//package
Section 239
//Ghost (Ghost)
package {
public dynamic class Ghost extends CRangeAirUnit {
}
}//package
Section 240
//Ghostship (Ghostship)
package {
public dynamic class Ghostship extends CRangeUnit {
}
}//package
Section 241
//Godship (Godship)
package {
public dynamic class Godship extends CRangeUnit {
}
}//package
Section 242
//Greekship (Greekship)
package {
public dynamic class Greekship extends CRangeUnit {
}
}//package
Section 243
//Help (Help)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import uiscr.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class Help extends CHelp {
public function Help(){
addFrameScript(0, frame1, 1, frame2);
}
public function Next(_arg1:MouseEvent):void{
this["root"].PlaySound("88");
btNext.removeEventListener(MouseEvent.CLICK, Next);
gotoAndStop(2);
}
public function Prev(_arg1:MouseEvent):void{
this["root"].PlaySound("88");
btBack.removeEventListener(MouseEvent.CLICK, Prev);
gotoAndStop(1);
}
function frame1(){
stop();
btNext.addEventListener(MouseEvent.CLICK, Next, false, 0, true);
}
function frame2(){
btBack.addEventListener(MouseEvent.CLICK, Prev, false, 0, true);
}
}
}//package
Section 244
//icd1 (icd1)
package {
public dynamic class icd1 extends CCharIcon {
}
}//package
Section 245
//icd10 (icd10)
package {
public dynamic class icd10 extends CCharIcon {
}
}//package
Section 246
//icd11 (icd11)
package {
public dynamic class icd11 extends CCharIcon {
}
}//package
Section 247
//icd12 (icd12)
package {
public dynamic class icd12 extends CCharIcon {
}
}//package
Section 248
//icd13 (icd13)
package {
public dynamic class icd13 extends CCharIcon {
}
}//package
Section 249
//icd14 (icd14)
package {
public dynamic class icd14 extends CCharIcon {
}
}//package
Section 250
//icd15 (icd15)
package {
public dynamic class icd15 extends CCharIcon {
}
}//package
Section 251
//icd16 (icd16)
package {
public dynamic class icd16 extends CCharIcon {
}
}//package
Section 252
//icd17 (icd17)
package {
public dynamic class icd17 extends CCharIcon {
}
}//package
Section 253
//icd18 (icd18)
package {
public dynamic class icd18 extends CCharIcon {
}
}//package
Section 254
//icd19 (icd19)
package {
public dynamic class icd19 extends CCharIcon {
}
}//package
Section 255
//icd2 (icd2)
package {
public dynamic class icd2 extends CCharIcon {
}
}//package
Section 256
//icd20 (icd20)
package {
public dynamic class icd20 extends CCharIcon {
}
}//package
Section 257
//icd21 (icd21)
package {
public dynamic class icd21 extends CCharIcon {
}
}//package
Section 258
//icd22 (icd22)
package {
public dynamic class icd22 extends CCharIcon {
}
}//package
Section 259
//icd23 (icd23)
package {
public dynamic class icd23 extends CCharIcon {
}
}//package
Section 260
//icd24 (icd24)
package {
public dynamic class icd24 extends CCharIcon {
}
}//package
Section 261
//icd25 (icd25)
package {
public dynamic class icd25 extends CCharIcon {
}
}//package
Section 262
//icd26 (icd26)
package {
public dynamic class icd26 extends CCharIcon {
}
}//package
Section 263
//icd27 (icd27)
package {
public dynamic class icd27 extends CCharIcon {
}
}//package
Section 264
//icd28 (icd28)
package {
public dynamic class icd28 extends CCharIcon {
}
}//package
Section 265
//icd29 (icd29)
package {
public dynamic class icd29 extends CCharIcon {
}
}//package
Section 266
//icd3 (icd3)
package {
public dynamic class icd3 extends CCharIcon {
}
}//package
Section 267
//icd30 (icd30)
package {
public dynamic class icd30 extends CCharIcon {
}
}//package
Section 268
//icd4 (icd4)
package {
public dynamic class icd4 extends CCharIcon {
}
}//package
Section 269
//icd5 (icd5)
package {
public dynamic class icd5 extends CCharIcon {
}
}//package
Section 270
//icd6 (icd6)
package {
public dynamic class icd6 extends CCharIcon {
}
}//package
Section 271
//icd7 (icd7)
package {
public dynamic class icd7 extends CCharIcon {
}
}//package
Section 272
//icd8 (icd8)
package {
public dynamic class icd8 extends CCharIcon {
}
}//package
Section 273
//icd9 (icd9)
package {
public dynamic class icd9 extends CCharIcon {
}
}//package
Section 274
//Instruction (Instruction)
package {
import uiscr.*;
public dynamic class Instruction extends CInstruction {
}
}//package
Section 275
//Knight (Knight)
package {
public dynamic class Knight extends CMeleeUnit {
}
}//package
Section 276
//Layer (Layer)
package {
import flash.display.*;
public dynamic class Layer extends MovieClip {
}
}//package
Section 277
//logo_bg (logo_bg)
package {
public dynamic class logo_bg extends CLogo {
}
}//package
Section 278
//logoBG (logoBG)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class logoBG extends CLogo {
public function logoBG(){
addFrameScript(194, frame195);
}
function frame195(){
stop();
this["root"].gotoAndStop(1, "mainmenu");
}
}
}//package
Section 279
//MainMenu (MainMenu)
package {
import uiscr.*;
public dynamic class MainMenu extends CMainMenu {
}
}//package
Section 280
//Map (Map)
package {
import uiscr.*;
public dynamic class Map extends CMap {
}
}//package
Section 281
//Map1 (Map1)
package {
import flash.display.*;
public dynamic class Map1 extends MovieClip {
public var war213:MovieClip;
public var war223:MovieClip;
public var war107:MovieClip;
public var war108:MovieClip;
public var war221:MovieClip;
public var war222:MovieClip;
public var war106:MovieClip;
public var war127:MovieClip;
public var battleTarget:MovieClip;
public var war003:MovieClip;
public var war019:MovieClip;
public var war017:MovieClip;
public var war018:MovieClip;
public var war002:MovieClip;
public var war305:MovieClip;
public var war028:MovieClip;
public var war029:MovieClip;
public var war309:MovieClip;
public var war316:MovieClip;
public var war310:MovieClip;
public var war312:MovieClip;
public var war314:MovieClip;
public var war301:MovieClip;
public var war320:MovieClip;
public var war324:MovieClip;
public var war325:MovieClip;
public var war326:MovieClip;
public var war304:MovieClip;
public var war330:MovieClip;
public var war215:MovieClip;
public var war211:MovieClip;
}
}//package
Section 282
//Map2 (Map2)
package {
import flash.display.*;
public dynamic class Map2 extends MovieClip {
public var war213:MovieClip;
public var war221:MovieClip;
public var war223:MovieClip;
public var war225:MovieClip;
public var war228:MovieClip;
public var war106:MovieClip;
public var war108:MovieClip;
public var war222:MovieClip;
public var war116:MovieClip;
public var war229:MovieClip;
public var war114:MovieClip;
public var war118:MovieClip;
public var war004:MovieClip;
public var war001:MovieClip;
public var war127:MovieClip;
public var battleTarget:MovieClip;
public var war124:MovieClip;
public var war012:MovieClip;
public var war010:MovieClip;
public var war002:MovieClip;
public var war103:MovieClip;
public var war020:MovieClip;
public var war026:MovieClip;
public var war030:MovieClip;
public var war205:MovieClip;
public var war207:MovieClip;
public var war209:MovieClip;
public var war215:MovieClip;
public var war211:MovieClip;
public var war219:MovieClip;
public var war217:MovieClip;
}
}//package
Section 283
//Map3 (Map3)
package {
import flash.display.*;
public dynamic class Map3 extends MovieClip {
public var war213:MovieClip;
public var war221:MovieClip;
public var war223:MovieClip;
public var war108:MovieClip;
public var war222:MovieClip;
public var war116:MovieClip;
public var war229:MovieClip;
public var war119:MovieClip;
public var war114:MovieClip;
public var war106:MovieClip;
public var war118:MovieClip;
public var war125:MovieClip;
public var war127:MovieClip;
public var battleTarget:MovieClip;
public var war124:MovieClip;
public var war012:MovieClip;
public var war010:MovieClip;
public var war009:MovieClip;
public var war103:MovieClip;
public var war028:MovieClip;
public var war304:MovieClip;
public var war020:MovieClip;
public var war030:MovieClip;
public var war302:MovieClip;
public var war026:MovieClip;
public var war301:MovieClip;
public var war205:MovieClip;
public var war207:MovieClip;
public var war215:MovieClip;
public var war211:MovieClip;
public var war217:MovieClip;
}
}//package
Section 284
//Map4 (Map4)
package {
import flash.display.*;
public dynamic class Map4 extends MovieClip {
public var war213:MovieClip;
public var war220:MovieClip;
public var war223:MovieClip;
public var war104:MovieClip;
public var war107:MovieClip;
public var war103:MovieClip;
public var war106:MovieClip;
public var war108:MovieClip;
public var war115:MovieClip;
public var war119:MovieClip;
public var war117:MovieClip;
public var war121:MovieClip;
public var war125:MovieClip;
public var war129:MovieClip;
public var war112:MovieClip;
public var war127:MovieClip;
public var battleTarget:MovieClip;
public var war122:MovieClip;
public var war128:MovieClip;
public var war018:MovieClip;
public var war124:MovieClip;
public var war005:MovieClip;
public var war030:MovieClip;
public var war302:MovieClip;
public var war310:MovieClip;
public var war314:MovieClip;
public var war301:MovieClip;
public var war326:MovieClip;
public var war209:MovieClip;
public var war111:MovieClip;
public var war216:MovieClip;
}
}//package
Section 285
//mcexitconfirm (mcexitconfirm)
package {
import uiscr.*;
public dynamic class mcexitconfirm extends CExitConfirm {
}
}//package
Section 286
//mcsavedata (mcsavedata)
package {
import uiscr.*;
public dynamic class mcsavedata extends CSave {
}
}//package
Section 287
//MedActIcon (MedActIcon)
package {
import uiscr.*;
public dynamic class MedActIcon extends CActIcon {
}
}//package
Section 288
//Medal (Medal)
package {
import uiscr.*;
public dynamic class Medal extends CMedal {
}
}//package
Section 289
//MediUpgrade (MediUpgrade)
package {
import uiscr.*;
public dynamic class MediUpgrade extends CUpgrade {
}
}//package
Section 290
//MenuBtn (MenuBtn)
package {
import flash.display.*;
public dynamic class MenuBtn extends SimpleButton {
}
}//package
Section 291
//Missile1 (Missile1)
package {
public dynamic class Missile1 extends CMissileA {
public function Missile1(){
addFrameScript(4, frame5);
}
function frame5(){
stop();
}
}
}//package
Section 292
//Missile10 (Missile10)
package {
public dynamic class Missile10 extends CMissileA {
}
}//package
Section 293
//Missile11 (Missile11)
package {
public dynamic class Missile11 extends CMissileA {
public function Missile11(){
addFrameScript(9, frame10);
}
function frame10(){
stop();
}
}
}//package
Section 294
//Missile12 (Missile12)
package {
public dynamic class Missile12 extends CMissileB {
public function Missile12(){
addFrameScript(25, frame26);
}
function frame26(){
stop();
}
}
}//package
Section 295
//Missile13 (Missile13)
package {
public dynamic class Missile13 extends CMissileA {
public function Missile13(){
addFrameScript(9, frame10);
}
function frame10(){
stop();
}
}
}//package
Section 296
//Missile14 (Missile14)
package {
public dynamic class Missile14 extends CMissileD {
}
}//package
Section 297
//Missile15 (Missile15)
package {
public dynamic class Missile15 extends CMissileD {
}
}//package
Section 298
//Missile16 (Missile16)
package {
public dynamic class Missile16 extends CMissileA {
public function Missile16(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 299
//Missile2 (Missile2)
package {
public dynamic class Missile2 extends CMissileA {
}
}//package
Section 300
//Missile3 (Missile3)
package {
public dynamic class Missile3 extends CMissileA {
}
}//package
Section 301
//Missile4 (Missile4)
package {
public dynamic class Missile4 extends CMissileB {
public function Missile4(){
addFrameScript(17, frame18);
}
function frame18(){
stop();
}
}
}//package
Section 302
//Missile5 (Missile5)
package {
public dynamic class Missile5 extends CMissileB {
public function Missile5(){
addFrameScript(26, frame27);
}
function frame27(){
stop();
}
}
}//package
Section 303
//Missile6 (Missile6)
package {
public dynamic class Missile6 extends CMissileD {
}
}//package
Section 304
//Missile7 (Missile7)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class Missile7 extends CMissileB {
public function Missile7(){
addFrameScript(19, frame20);
}
function frame20(){
this["parent"].removeChild(this);
stop();
}
}
}//package
Section 305
//Missile8 (Missile8)
package {
public dynamic class Missile8 extends CMissileD {
public function Missile8(){
addFrameScript(6, frame7);
}
function frame7(){
stop();
}
}
}//package
Section 306
//Missile9 (Missile9)
package {
public dynamic class Missile9 extends CMissileA {
}
}//package
Section 307
//MoreGamesBtn (MoreGamesBtn)
package {
import flash.display.*;
public dynamic class MoreGamesBtn extends SimpleButton {
}
}//package
Section 308
//Music1 (Music1)
package {
import flash.media.*;
public dynamic class Music1 extends Sound {
}
}//package
Section 309
//Music2 (Music2)
package {
import flash.media.*;
public dynamic class Music2 extends Sound {
}
}//package
Section 310
//Music3 (Music3)
package {
import flash.media.*;
public dynamic class Music3 extends Sound {
}
}//package
Section 311
//Music4 (Music4)
package {
import flash.media.*;
public dynamic class Music4 extends Sound {
}
}//package
Section 312
//Music5 (Music5)
package {
import flash.media.*;
public dynamic class Music5 extends Sound {
}
}//package
Section 313
//Music6 (Music6)
package {
import flash.media.*;
public dynamic class Music6 extends Sound {
}
}//package
Section 314
//Music8 (Music8)
package {
import flash.media.*;
public dynamic class Music8 extends Sound {
}
}//package
Section 315
//Music9 (Music9)
package {
import flash.media.*;
public dynamic class Music9 extends Sound {
}
}//package
Section 316
//NewgroundsAPIAsset_big_popup_background (NewgroundsAPIAsset_big_popup_background)
package {
import flash.display.*;
public dynamic class NewgroundsAPIAsset_big_popup_background extends MovieClip {
public var tl:MovieClip;
public var br:MovieClip;
public var tr:MovieClip;
public var l:MovieClip;
public var shadow:MovieClip;
public var r:MovieClip;
public var b:MovieClip;
public var bl:MovieClip;
public var t:MovieClip;
public var c:MovieClip;
}
}//package
Section 317
//Ogre (Ogre)
package {
public dynamic class Ogre extends CMeleeUnit {
}
}//package
Section 318
//Option (Option)
package {
import uiscr.*;
public dynamic class Option extends COption {
}
}//package
Section 319
//Paladin (Paladin)
package {
public dynamic class Paladin extends CMeleeUnit {
}
}//package
Section 320
//PanelActIcon (PanelActIcon)
package {
import uiscr.*;
public dynamic class PanelActIcon extends CPanelActChar {
}
}//package
Section 321
//PauseMenu (PauseMenu)
package {
import uiscr.*;
public dynamic class PauseMenu extends CPause {
}
}//package
Section 322
//Persianship (Persianship)
package {
public dynamic class Persianship extends CRangeUnit {
}
}//package
Section 323
//Plane1 (Plane1)
package {
public dynamic class Plane1 extends CRangeAirUnit {
}
}//package
Section 324
//Plane2 (Plane2)
package {
public dynamic class Plane2 extends CRangeAirUnit {
}
}//package
Section 325
//PoiEff (PoiEff)
package {
import flash.display.*;
public dynamic class PoiEff extends MovieClip {
public function PoiEff(){
addFrameScript(0, frame1, 24, frame25);
}
function frame1(){
stop();
}
function frame25(){
x = -100;
y = -100;
stop();
}
}
}//package
Section 326
//Result (Result)
package {
import uiscr.*;
public dynamic class Result extends CResult {
}
}//package
Section 327
//Romanship (Romanship)
package {
public dynamic class Romanship extends CRangeUnit {
}
}//package
Section 328
//SelectRace (SelectRace)
package {
import uiscr.*;
public dynamic class SelectRace extends CSelectRace {
}
}//package
Section 329
//Shark (Shark)
package {
public dynamic class Shark extends CMeleeUnit {
}
}//package
Section 330
//Skeleton (Skeleton)
package {
public dynamic class Skeleton extends CRangeUnit {
}
}//package
Section 331
//snd01 (snd01)
package {
import flash.media.*;
public dynamic class snd01 extends Sound {
}
}//package
Section 332
//snd02 (snd02)
package {
import flash.media.*;
public dynamic class snd02 extends Sound {
}
}//package
Section 333
//snd03 (snd03)
package {
import flash.media.*;
public dynamic class snd03 extends Sound {
}
}//package
Section 334
//snd04 (snd04)
package {
import flash.media.*;
public dynamic class snd04 extends Sound {
}
}//package
Section 335
//snd05 (snd05)
package {
import flash.media.*;
public dynamic class snd05 extends Sound {
}
}//package
Section 336
//snd06 (snd06)
package {
import flash.media.*;
public dynamic class snd06 extends Sound {
}
}//package
Section 337
//snd07 (snd07)
package {
import flash.media.*;
public dynamic class snd07 extends Sound {
}
}//package
Section 338
//snd08 (snd08)
package {
import flash.media.*;
public dynamic class snd08 extends Sound {
}
}//package
Section 339
//snd09 (snd09)
package {
import flash.media.*;
public dynamic class snd09 extends Sound {
}
}//package
Section 340
//snd10 (snd10)
package {
import flash.media.*;
public dynamic class snd10 extends Sound {
}
}//package
Section 341
//snd11 (snd11)
package {
import flash.media.*;
public dynamic class snd11 extends Sound {
}
}//package
Section 342
//snd12 (snd12)
package {
import flash.media.*;
public dynamic class snd12 extends Sound {
}
}//package
Section 343
//snd13 (snd13)
package {
import flash.media.*;
public dynamic class snd13 extends Sound {
}
}//package
Section 344
//snd14 (snd14)
package {
import flash.media.*;
public dynamic class snd14 extends Sound {
}
}//package
Section 345
//snd15 (snd15)
package {
import flash.media.*;
public dynamic class snd15 extends Sound {
}
}//package
Section 346
//snd16 (snd16)
package {
import flash.media.*;
public dynamic class snd16 extends Sound {
}
}//package
Section 347
//snd17 (snd17)
package {
import flash.media.*;
public dynamic class snd17 extends Sound {
}
}//package
Section 348
//snd18 (snd18)
package {
import flash.media.*;
public dynamic class snd18 extends Sound {
}
}//package
Section 349
//snd19 (snd19)
package {
import flash.media.*;
public dynamic class snd19 extends Sound {
}
}//package
Section 350
//snd20 (snd20)
package {
import flash.media.*;
public dynamic class snd20 extends Sound {
}
}//package
Section 351
//snd21 (snd21)
package {
import flash.media.*;
public dynamic class snd21 extends Sound {
}
}//package
Section 352
//snd22 (snd22)
package {
import flash.media.*;
public dynamic class snd22 extends Sound {
}
}//package
Section 353
//snd23 (snd23)
package {
import flash.media.*;
public dynamic class snd23 extends Sound {
}
}//package
Section 354
//snd24 (snd24)
package {
import flash.media.*;
public dynamic class snd24 extends Sound {
}
}//package
Section 355
//snd88 (snd88)
package {
import flash.media.*;
public dynamic class snd88 extends Sound {
}
}//package
Section 356
//snd99 (snd99)
package {
import flash.media.*;
public dynamic class snd99 extends Sound {
}
}//package
Section 357
//Spearman (Spearman)
package {
public dynamic class Spearman extends CMeleeUnit {
}
}//package
Section 358
//Statistic (Statistic)
package {
import uiscr.*;
public dynamic class Statistic extends CStatistic {
}
}//package
Section 359
//Swordman (Swordman)
package {
public dynamic class Swordman extends CMeleeUnit {
}
}//package
Section 360
//Tooltip (Tooltip)
package {
import flash.display.*;
import flash.text.*;
public dynamic class Tooltip extends MovieClip {
public var cap:TextField;
}
}//package
Section 361
//Tooltip2 (Tooltip2)
package {
import flash.display.*;
import flash.text.*;
public dynamic class Tooltip2 extends MovieClip {
public var cap:TextField;
}
}//package
Section 362
//TurretD1 (TurretD1)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class TurretD1 extends CTurret {
public function TurretD1(){
addFrameScript(0, frame1, 9, frame10, 19, frame20, 20, frame21, 29, frame30);
}
function frame10(){
CreateMissile(8, 0, 0, 1, false, 1);
}
function frame1(){
stop();
}
function frame21(){
this["root"].PlaySound("21");
}
function frame20(){
rotation = 180;
gotoAndStop(1);
}
function frame30(){
visible = false;
}
}
}//package
Section 363
//TurretD2 (TurretD2)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class TurretD2 extends CTurret {
public function TurretD2(){
addFrameScript(0, frame1, 9, frame10, 13, frame14, 19, frame20, 20, frame21, 29, frame30);
}
function frame14(){
CreateMissile(1, -48, -20, 1, false, 3, 0.25);
}
function frame10(){
CreateMissile(1, -48, -20, 1, false, 3, 0.25);
}
function frame1(){
stop();
}
function frame21(){
this["root"].PlaySound("21");
}
function frame20(){
gotoAndStop(1);
}
function frame30(){
visible = false;
}
}
}//package
Section 364
//TurretD3 (TurretD3)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class TurretD3 extends CTurret {
public function TurretD3(){
addFrameScript(0, frame1, 4, frame5, 14, frame15, 15, frame16, 24, frame25);
}
function frame15(){
gotoAndStop(1);
}
function frame1(){
stop();
}
function frame25(){
visible = false;
}
function frame5(){
CreateMissile(13, -65, 15, 1, true, 5);
}
function frame16(){
this["root"].PlaySound("21");
}
}
}//package
Section 365
//TurretD4 (TurretD4)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class TurretD4 extends CTurret {
public function TurretD4(){
addFrameScript(0, frame1, 4, frame5, 8, frame9, 14, frame15, 15, frame16, 24, frame25);
}
function frame15(){
gotoAndStop(1);
}
function frame1(){
stop();
}
function frame25(){
visible = false;
}
function frame5(){
CreateMissile(12, -80, 0);
CreateMissile(15, -80, 0, 1, true, 4);
}
function frame9(){
CreateMissile(15, -80, 0, 1, true, 4);
}
function frame16(){
this["root"].PlaySound("21");
}
}
}//package
Section 366
//TurretM1 (TurretM1)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class TurretM1 extends CTurret {
public function TurretM1(){
addFrameScript(0, frame1, 12, frame13, 19, frame20, 20, frame21, 29, frame30);
}
function frame1(){
stop();
}
function frame13(){
CreateMissile(11, 0, 0, 1, false, 3, 0.25);
}
function frame21(){
this["root"].PlaySound("21");
}
function frame20(){
gotoAndStop(1);
}
function frame30(){
visible = false;
}
}
}//package
Section 367
//TurretM2 (TurretM2)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class TurretM2 extends CTurret {
public function TurretM2(){
addFrameScript(0, frame1, 9, frame10, 13, frame14, 17, frame18, 24, frame25, 25, frame26, 34, frame35);
}
function frame14(){
CreateMissile(11, 0, 10, 1, false, 1);
}
function frame10(){
CreateMissile(11, 0, 10, 1, false, 1);
}
function frame18(){
CreateMissile(11, 0, 10, 1, false, 1);
}
function frame1(){
stop();
}
function frame25(){
gotoAndStop(1);
}
function frame26(){
this["root"].PlaySound("21");
}
function frame35(){
visible = false;
}
}
}//package
Section 368
//TurretM3 (TurretM3)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class TurretM3 extends CTurret {
public function TurretM3(){
addFrameScript(0, frame1, 14, frame15, 19, frame20, 20, frame21, 29, frame30);
}
function frame15(){
CreateMissile(11, 0, 0, 1, false, 1);
}
function frame1(){
stop();
}
function frame21(){
this["root"].PlaySound("21");
}
function frame20(){
gotoAndStop(1);
}
function frame30(){
visible = false;
}
}
}//package
Section 369
//TurretM4 (TurretM4)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.xml.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
public dynamic class TurretM4 extends CTurret {
public function TurretM4(){
addFrameScript(0, frame1, 11, frame12, 24, frame25, 25, frame26, 34, frame35);
}
function frame12(){
CreateMissile(2, 0, 30, 1, true, 2);
}
function frame1(){
stop();
}
function frame25(){
gotoAndStop(1);
}
function frame26(){
this["root"].PlaySound("21");
}
function frame35(){
visible = false;
}
}
}//package
Section 370
//Vampire (Vampire)
package {
public dynamic class Vampire extends CMeleeUnit {
}
}//package
Section 371
//Whale (Whale)
package {
public dynamic class Whale extends CMeleeUnit {
}
}//package
Section 372
//Vikingship (Vikingship)
package {
public dynamic class Vikingship extends CRangeUnit {
}
}//package
Section 373
//Wizard (Wizard)
package {
public dynamic class Wizard extends CRangeUnit {
}
}//package
Section 374
//Zombie (Zombie)
package {
public dynamic class Zombie extends CMeleeUnit {
}
}//package