Section 1
//Base64 (classes.base64.Base64)
package classes.base64 {
import flash.utils.*;
public class Base64 {
public static const version:String = "1.0.0";
private static const BASE64_CHARS:String = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
public function Base64(){
throw (new Error("Base64 class is static container only"));
}
public static function encode(_arg1:String):String{
var _local2:ByteArray;
_local2 = new ByteArray();
_local2.writeUTFBytes(_arg1);
return (encodeByteArray(_local2));
}
public static function encodeByteArray(_arg1:ByteArray):String{
var _local2:String;
var _local3:Array;
var _local4:Array;
var _local5:uint;
var _local6:uint;
var _local7:uint;
_local2 = "";
_local4 = new Array(4);
_arg1.position = 0;
while (_arg1.bytesAvailable > 0) {
_local3 = new Array();
_local5 = 0;
while ((((_local5 < 3)) && ((_arg1.bytesAvailable > 0)))) {
_local3[_local5] = _arg1.readUnsignedByte();
_local5++;
};
_local4[0] = ((_local3[0] & 252) >> 2);
_local4[1] = (((_local3[0] & 3) << 4) | (_local3[1] >> 4));
_local4[2] = (((_local3[1] & 15) << 2) | (_local3[2] >> 6));
_local4[3] = (_local3[2] & 63);
_local6 = _local3.length;
while (_local6 < 3) {
_local4[(_local6 + 1)] = 64;
_local6++;
};
_local7 = 0;
while (_local7 < _local4.length) {
_local2 = (_local2 + BASE64_CHARS.charAt(_local4[_local7]));
_local7++;
};
};
return (_local2);
}
public static function decode(_arg1:String):String{
var _local2:ByteArray;
_local2 = decodeToByteArray(_arg1);
return (_local2.readUTFBytes(_local2.length));
}
public static function decodeToByteArray(_arg1:String):ByteArray{
var _local2:ByteArray;
var _local3:Array;
var _local4:Array;
var _local5:uint;
var _local6:uint;
var _local7:uint;
_local2 = new ByteArray();
_local3 = new Array(4);
_local4 = new Array(3);
_local5 = 0;
while (_local5 < _arg1.length) {
_local6 = 0;
while ((((_local6 < 4)) && (((_local5 + _local6) < _arg1.length)))) {
_local3[_local6] = BASE64_CHARS.indexOf(_arg1.charAt((_local5 + _local6)));
_local6++;
};
_local4[0] = ((_local3[0] << 2) + ((_local3[1] & 48) >> 4));
_local4[1] = (((_local3[1] & 15) << 4) + ((_local3[2] & 60) >> 2));
_local4[2] = (((_local3[2] & 3) << 6) + _local3[3]);
_local7 = 0;
while (_local7 < _local4.length) {
if (_local3[(_local7 + 1)] == 64){
break;
};
_local2.writeByte(_local4[_local7]);
_local7++;
};
_local5 = (_local5 + 4);
};
_local2.position = 0;
return (_local2);
}
}
}//package classes.base64
Section 2
//MD5 (classes.crypto.MD5)
package classes.crypto {
import classes.utils.*;
public class MD5 {
private 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 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 function f(_arg1:int, _arg2:int, _arg3:int):int{
return (((_arg1 & _arg2) | (~(_arg1) & _arg3)));
}
private 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 function h(_arg1:int, _arg2:int, _arg3:int):int{
return (((_arg1 ^ _arg2) ^ _arg3));
}
private function i(_arg1:int, _arg2:int, _arg3:int):int{
return ((_arg2 ^ (_arg1 | ~(_arg3))));
}
private function transform(_arg1:Function, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int, _arg8:int):int{
var _local9:int;
_local9 = (((_arg2 + int(_arg1(_arg3, _arg4, _arg5))) + _arg6) + _arg8);
return ((IntUtil.rol(_local9, _arg7) + _arg3));
}
private function g(_arg1:int, _arg2:int, _arg3:int):int{
return (((_arg1 & _arg3) | (_arg2 & ~(_arg3))));
}
private function createBlocks(_arg1:String):Array{
var _local2:Array;
var _local3:int;
var _local4:int;
var _local5:int;
_local2 = new Array();
_local3 = (_arg1.length * 8);
_local4 = 0xFF;
_local5 = 0;
while (_local5 < _local3) {
_local2[(_local5 >> 5)] = (_local2[(_local5 >> 5)] | ((_arg1.charCodeAt((_local5 / 8)) & _local4) << (_local5 % 32)));
_local5 = (_local5 + 8);
};
_local2[(_local3 >> 5)] = (_local2[(_local3 >> 5)] | (128 << (_local3 % 32)));
_local2[((((_local3 + 64) >>> 9) << 4) + 14)] = _local3;
return (_local2);
}
public function hash(_arg1:String):String{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:Array;
var _local11:int;
var _local12:int;
_local2 = 1732584193;
_local3 = -271733879;
_local4 = -1732584194;
_local5 = 271733878;
_local10 = createBlocks(_arg1);
_local11 = _local10.length;
_local12 = 0;
while (_local12 < _local11) {
_local6 = _local2;
_local7 = _local3;
_local8 = _local4;
_local9 = _local5;
_local2 = ff(_local2, _local3, _local4, _local5, _local10[(_local12 + 0)], 7, -680876936);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[(_local12 + 1)], 12, -389564586);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[(_local12 + 2)], 17, 606105819);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[(_local12 + 3)], 22, -1044525330);
_local2 = ff(_local2, _local3, _local4, _local5, _local10[(_local12 + 4)], 7, -176418897);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[(_local12 + 5)], 12, 1200080426);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[(_local12 + 6)], 17, -1473231341);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[(_local12 + 7)], 22, -45705983);
_local2 = ff(_local2, _local3, _local4, _local5, _local10[(_local12 + 8)], 7, 1770035416);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[(_local12 + 9)], 12, -1958414417);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[(_local12 + 10)], 17, -42063);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[(_local12 + 11)], 22, -1990404162);
_local2 = ff(_local2, _local3, _local4, _local5, _local10[(_local12 + 12)], 7, 1804603682);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[(_local12 + 13)], 12, -40341101);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[(_local12 + 14)], 17, -1502002290);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[(_local12 + 15)], 22, 1236535329);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[(_local12 + 1)], 5, -165796510);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[(_local12 + 6)], 9, -1069501632);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[(_local12 + 11)], 14, 643717713);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[(_local12 + 0)], 20, -373897302);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[(_local12 + 5)], 5, -701558691);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[(_local12 + 10)], 9, 38016083);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[(_local12 + 15)], 14, -660478335);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[(_local12 + 4)], 20, -405537848);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[(_local12 + 9)], 5, 568446438);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[(_local12 + 14)], 9, -1019803690);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[(_local12 + 3)], 14, -187363961);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[(_local12 + 8)], 20, 1163531501);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[(_local12 + 13)], 5, -1444681467);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[(_local12 + 2)], 9, -51403784);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[(_local12 + 7)], 14, 1735328473);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[(_local12 + 12)], 20, -1926607734);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[(_local12 + 5)], 4, -378558);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[(_local12 + 8)], 11, -2022574463);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[(_local12 + 11)], 16, 1839030562);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[(_local12 + 14)], 23, -35309556);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[(_local12 + 1)], 4, -1530992060);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[(_local12 + 4)], 11, 1272893353);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[(_local12 + 7)], 16, -155497632);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[(_local12 + 10)], 23, -1094730640);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[(_local12 + 13)], 4, 681279174);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[(_local12 + 0)], 11, -358537222);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[(_local12 + 3)], 16, -722521979);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[(_local12 + 6)], 23, 76029189);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[(_local12 + 9)], 4, -640364487);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[(_local12 + 12)], 11, -421815835);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[(_local12 + 15)], 16, 530742520);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[(_local12 + 2)], 23, -995338651);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[(_local12 + 0)], 6, -198630844);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[(_local12 + 7)], 10, 1126891415);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[(_local12 + 14)], 15, -1416354905);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[(_local12 + 5)], 21, -57434055);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[(_local12 + 12)], 6, 1700485571);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[(_local12 + 3)], 10, -1894986606);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[(_local12 + 10)], 15, -1051523);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[(_local12 + 1)], 21, -2054922799);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[(_local12 + 8)], 6, 1873313359);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[(_local12 + 15)], 10, -30611744);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[(_local12 + 6)], 15, -1560198380);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[(_local12 + 13)], 21, 1309151649);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[(_local12 + 4)], 6, -145523070);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[(_local12 + 11)], 10, -1120210379);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[(_local12 + 2)], 15, 718787259);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[(_local12 + 9)], 21, -343485551);
_local2 = (_local2 + _local6);
_local3 = (_local3 + _local7);
_local4 = (_local4 + _local8);
_local5 = (_local5 + _local9);
_local12 = (_local12 + 16);
};
return ((((IntUtil.toHex(_local2) + IntUtil.toHex(_local3)) + IntUtil.toHex(_local4)) + IntUtil.toHex(_local5)));
}
private 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));
}
}
}//package classes.crypto
Section 3
//FlashChecker (classes.gamezhero.FlashChecker)
package classes.gamezhero {
import flash.display.*;
public dynamic class FlashChecker extends MovieClip {
public var b:SimpleButton;
public function FlashChecker(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package classes.gamezhero
Section 4
//Music (classes.media.Music)
package classes.media {
import flash.utils.*;
import flash.media.*;
import flash.events.*;
public class Music {
public var m_bMute:Boolean;// = false
public var musicInArr:Array;
private var musicArch:Dictionary;
public var musicVolume:Number;// = 0.5
private var musicArchByID:Object;
public var musicOutArr:Array;
public var timerSub:Timer;
private var activeMusic:String;// = ""
public function Music(){
musicArch = new Dictionary();
musicArchByID = new Object();
activeMusic = "";
musicVolume = 0.5;
m_bMute = false;
musicOutArr = new Array();
musicInArr = new Array();
timerSub = new Timer(50, 0);
super();
}
public function getVolume():Number{
return (musicVolume);
}
public function playMusic(_arg1:String, _arg2:String, _arg3:Number=0):void{
var soundFactory:Sound;
var sndClass:Class;
var id = _arg1;
var sName = _arg2;
var nPos = _arg3;
if (activeMusic != id){
musicOut(activeMusic);
activeMusic = id;
try {
sndClass = (getDefinitionByName(sName) as Class);
} catch(e:ReferenceError) {
return;
};
soundFactory = (new (sndClass) as Sound);
iniMusic(id, soundFactory, nPos);
musicIn(activeMusic);
};
}
private function completeHandler(_arg1:Event):void{
}
public function get mute():Boolean{
return (m_bMute);
}
public function setMusicVolume(_arg1:Number):void{
var _local2:*;
var _local3:SoundTransform;
musicVolume = _arg1;
for (_local2 in musicArch) {
_local3 = _local2.soundTransform;
_local3.volume = (m_bMute) ? 0 : musicVolume;
_local2.soundTransform = _local3;
};
}
public function iniMusic(_arg1:String, _arg2:Sound, _arg3:Number=0):void{
var _local4:Number;
var _local5:SoundChannel;
var _local6:SoundTransform;
_local4 = 100000;
_local5 = _arg2.play(0, _local4);
_local6 = _local5.soundTransform;
_local6.pan = 0;
_local6.volume = 0;
_local5.soundTransform = _local6;
_local5.addEventListener(Event.SOUND_COMPLETE, completeHandler);
musicArch[_local5] = {id:_arg1, sound:_arg2};
musicArchByID[_arg1] = _local5;
}
public function stopMusics():void{
var _local1:*;
var _local2:*;
var _local3:Object;
var _local4:Sound;
if (!m_bMute){
for (_local1 in musicArchByID) {
musicOut(_local1);
};
} else {
for (_local2 in musicArch) {
_local3 = musicArch[_local2];
_local4 = _local3.sound;
if (_local4 != null){
};
_local2.stop();
};
};
activeMusic = "";
}
public function musicOut(_arg1:String):void{
if (musicArchByID[_arg1] != undefined){
musicOutArr.push(_arg1);
timerSub.addEventListener("timer", updateMusicValue);
timerSub.start();
};
}
public function musicIn(_arg1:String):void{
if (musicArchByID[_arg1] != undefined){
musicInArr.push(_arg1);
timerSub.addEventListener("timer", updateMusicValue);
timerSub.start();
};
}
public function set mute(_arg1:Boolean):void{
var _local2:*;
var _local3:SoundTransform;
m_bMute = _arg1;
for (_local2 in musicArch) {
_local3 = _local2.soundTransform;
_local3.volume = (m_bMute) ? 0 : musicVolume;
_local2.soundTransform = _local3;
};
}
private function updateMusicValue(_arg1:TimerEvent=null):void{
var _local2:Number;
var _local3:SoundTransform;
var _local4:SoundChannel;
_local2 = 0;
while (_local2 < musicInArr.length) {
_local4 = musicArchByID[musicInArr[_local2]];
_local3 = _local4.soundTransform;
_local3.volume = (_local3.volume + 0.025);
if (m_bMute){
_local3.volume = 0;
} else {
_local3.volume = ((_local3.volume)>=musicVolume) ? musicVolume : _local3.volume;
};
_local4.soundTransform = _local3;
if ((((_local3.volume == musicVolume)) || (m_bMute))){
musicInArr.splice(_local2, 1);
_local2--;
};
_local2++;
};
_local2 = 0;
while (_local2 < musicOutArr.length) {
_local4 = musicArchByID[musicOutArr[_local2]];
_local3 = _local4.soundTransform;
_local3.volume = (_local3.volume - 0.025);
_local3.volume = ((_local3.volume)<=0) ? 0 : _local3.volume;
_local4.soundTransform = _local3;
if (_local3.volume == 0){
_local4.stop();
musicOutArr.splice(_local2, 1);
_local2--;
};
_local2++;
};
if ((((musicInArr.length == 0)) && ((musicOutArr.length == 0)))){
timerSub.removeEventListener("timer", updateMusicValue);
timerSub.stop();
};
}
}
}//package classes.media
Section 5
//SoundFX (classes.media.SoundFX)
package classes.media {
import flash.utils.*;
import flash.media.*;
import flash.events.*;
public class SoundFX {
private var soundArch:Dictionary;
private var m_bMute:Boolean;// = false
public var soundVolume:Number;// = 0.5
private var soundArchByID:Object;
public function SoundFX(){
soundArch = new Dictionary();
soundArchByID = new Object();
soundVolume = 0.5;
m_bMute = false;
super();
}
public function get mute():Boolean{
return (m_bMute);
}
public function stopSounds():void{
var _local1:*;
for (_local1 in soundArch) {
_local1.stop();
_local1.addEventListener(Event.SOUND_COMPLETE, completeHandler);
delete soundArch[_local1];
};
soundArchByID = new Object();
soundArch = new Dictionary();
}
public function iniSound(_arg1, _arg2:Sound, _arg3:Number, _arg4, _arg5:Number):void{
var _local6:Number;
var _local7:SoundChannel;
var _local8:SoundTransform;
var _local9:SoundChannel;
_local6 = ((_arg4)=="infinity") ? 1000 : _arg4;
_local7 = _arg2.play(0, _local6);
_local8 = _local7.soundTransform;
_local8.pan = _arg3;
if (m_bMute){
_local8.volume = 0;
} else {
_local8.volume = (soundVolume * _arg5);
};
_local7.soundTransform = _local8;
_local7.addEventListener(Event.SOUND_COMPLETE, completeHandler);
soundArch[_local7] = {id:_arg1, sound:_arg2, loopFlag:_arg4, pan:_arg3, kof:_arg5};
if (_arg1 != null){
_local9 = (soundArchByID[_arg1] as SoundChannel);
if (_local9 != null){
_local9.stop();
};
soundArchByID[_arg1] = _local7;
};
}
public function setPanByID(_arg1:String, _arg2:Number):void{
var _local3:*;
var _local4:SoundTransform;
_local3 = soundArchByID[_arg1];
if (_local3 != undefined){
_local4 = _local3.soundTransform;
soundArch[_local3].pan = _arg2;
_local4.pan = _arg2;
_local3.soundTransform = _local4;
};
}
private function completeHandler(_arg1:Event):void{
var _local2:*;
var _local3:Sound;
var _local4:Sound;
var _local5:*;
var _local6:Number;
var _local7:Number;
_local2 = _arg1.target;
if (soundArch[_local2].loopFlag == "infinity"){
_local3 = soundArch[_local2].id;
_local4 = soundArch[_local2].sound;
_local5 = soundArch[_local2].loopFlag;
_local6 = soundArch[_local2].pan;
_local7 = soundArch[_local2].kof;
iniSound(_local3, _local4, _local5, _local6, _local7);
};
delete soundArch[_local2];
}
public function set mute(_arg1:Boolean):void{
var _local2:*;
var _local3:SoundTransform;
m_bMute = _arg1;
for (_local2 in soundArch) {
_local3 = _local2.soundTransform;
_local3.volume = (m_bMute) ? 0 : (soundVolume * soundArch[_local2].kof);
_local2.soundTransform = _local3;
};
}
public function setSoundVolume(_arg1:Number):void{
var _local2:*;
var _local3:SoundTransform;
soundVolume = _arg1;
for (_local2 in soundArch) {
_local3 = _local2.soundTransform;
_local3.volume = (m_bMute) ? 0 : (soundVolume * soundArch[_local2].kof);
_local2.soundTransform = _local3;
};
}
public function setVolumeKofByID(_arg1:String, _arg2:Number):void{
var _local3:*;
var _local4:SoundTransform;
_local3 = soundArchByID[_arg1];
if (_local3 != undefined){
soundArch[_local3].kof = _arg2;
_local4 = _local3.soundTransform;
_local4.volume = (soundVolume * soundArch[_local3].kof);
_local3.soundTransform = _local4;
};
}
public function getSoundVolume():Number{
return (soundVolume);
}
public function playSound(_arg1, _arg2:String, _arg3=0, _arg4:Number=0, _arg5:Number=1){
var sndClass:Class;
var soundFactory:Sound;
var id = _arg1;
var sName = _arg2;
var loopFlag = _arg3;
var pan = _arg4;
var kof = _arg5;
try {
sndClass = (getDefinitionByName(sName) as Class);
soundFactory = (new (sndClass) as Sound);
} catch(e:ReferenceError) {
trace("НЕТ ТАКОГО ЗВУКА :", sName);
return;
};
iniSound(id, soundFactory, pan, loopFlag, kof);
}
public function removeSoundByID(_arg1:String):void{
var _local2:*;
_local2 = soundArchByID[_arg1];
if (_local2 != undefined){
_local2.stop();
_local2.addEventListener(Event.SOUND_COMPLETE, completeHandler);
delete soundArch[_local2];
};
}
}
}//package classes.media
Section 6
//ClassLoader (classes.utils.ClassLoader)
package classes.utils {
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.system.*;
public class ClassLoader extends EventDispatcher {
private var loader:Loader;
private var request:URLRequest;
private var swfLib:String;
private var loadedClass:Class;
public static var CLASS_LOADED:String = "classLoaded";
public static var LOAD_ERROR:String = "loadError";
public function ClassLoader(){
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
loader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
}
public function getClass(_arg1:String):Class{
var className = _arg1;
try {
return ((loader.contentLoaderInfo.applicationDomain.getDefinition(className) as Class));
} catch(e:Error) {
trace("ERROR");
};
return (null);
}
private function securityErrorHandler(_arg1:Event):void{
dispatchEvent(new Event(ClassLoader.LOAD_ERROR));
}
private function completeHandler(_arg1:Event):void{
dispatchEvent(new Event(ClassLoader.CLASS_LOADED));
}
private function ioErrorHandler(_arg1:Event):void{
dispatchEvent(new Event(ClassLoader.LOAD_ERROR));
}
public function load(_arg1:String):void{
var _local2:LoaderContext;
swfLib = _arg1;
request = new URLRequest(swfLib);
_local2 = new LoaderContext();
_local2.applicationDomain = new ApplicationDomain();
loader.load(request, _local2);
}
}
}//package classes.utils
Section 7
//IntUtil (classes.utils.IntUtil)
package classes.utils {
public class IntUtil {
private static var hexChars:String = "0123456789abcdef";
public static function toHex(_arg1:int, _arg2:Boolean=false):String{
var _local3:String;
var _local4:int;
var _local5:int;
_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);
}
public static function ror(_arg1:int, _arg2:int):uint{
var _local3:int;
_local3 = (32 - _arg2);
return (((_arg1 << _local3) | (_arg1 >>> (32 - _local3))));
}
public static function rol(_arg1:int, _arg2:int):int{
return (((_arg1 << _arg2) | (_arg1 >>> (32 - _arg2))));
}
}
}//package classes.utils
Section 8
//Global (classes.Global)
package classes {
import flash.utils.*;
import main.*;
import flash.net.*;
import classes.media.*;
public class Global {
public static const DEBUG:Boolean = true;
private static const GAMEZ_HERO_URL:String = "http://files.gamezhero.com/online/ghostcastle/ghostcastle.swf";
private static const cGlobal:Global = new (Global);
;
public static var sound_interface:SoundFX;
public static var _game_width_2:Number = (_game_width / 2);
public static var _score:Number;
public static var _context_url:String;
public static var _sound_volume_interface:Number = 0.6;
public static var music_interface:Music;
public static var sound_game:SoundFX;
public static var _language:String;
public static var _urls:Array = new Array();
public static var _sound_volume_game:Number = 0.3;
public static var music_game:Music;
public static var _music_volume_interface:Number = 0.3;
public static var _game_height_2:Number = (_game_height / 2);
public static var _game_height:Number = 400;
public static var _game_width:Number = 550;
public static var _music_volume_game:Number = 0.5;
public static var _game_stored_data:SharedObject = SharedObject.getLocal("mummymaze-gamezhero.com");
public static var _levelID:String;
public function Global(){
_urls["send_to_friends"] = "http://www.gamezhero.com/sendtofriends/ghostcastle-games.html?utm_campaign=ghostcastle&utm_source=ghostcastle&utm_medium=send_to_friends";
_urls["play_more_games"] = "http://www.gamezhero.com/?utm_campaign=ghostcastle&utm_source=ghostcastle&utm_medium=more_free_games";
_urls["zorro_logo"] = "http://www.gamezhero.com/?utm_campaign=ghostcastle&utm_source=ghostcastle&utm_medium=zorro_logo";
_urls["zorro_logo_pause"] = "http://www.gamezhero.com/?utm_campaign=ghostcastle&utm_source=ghostcastle&utm_medium=zorro_logo_pause";
_urls["put_this_game"] = "http://www.gamezhero.com/freewebsitegames/ghostcastle-games.html?utm_campaign=ghostcastle&utm_source=ghostcastle&utm_medium=free_web_site_games";
_urls["view_top_score"] = "http://www.gamezhero.com/topscore/ghostcastle/?utm_campaign=ghostcastle&utm_source=ghostcastle&utm_medium=top_score";
_urls["score"] = "http://files.gamezhero.com/online/ghostcastle/score/score.swf";
_urls["error"] = "http://www.gamezhero.com/sendtofriends/ghostcastle-games.html?utm_campaign=ghostcastle&utm_source=ghostcastle&utm_medium=error";
_urls["preloader"] = "http://www.gamezhero.com/?utm_campaign=ghostcastle&utm_source=ghostcastle&utm_medium=preloader";
_urls["play_more_games_context"] = "http://www.gamezhero.com/?utm_campaign=ghostcastle&utm_source=ghostcastle&utm_medium=context_menu";
_urls["put_this_game_context"] = "http://www.gamezhero.com/freewebsitegames.html?utm_campaign=ghostcastle&utm_source=ghostcastle&utm_medium=free_games_for_website_context_menu";
_urls["send_to_friends_context"] = "http://www.gamezhero.com/sendtofriends/ghostcastle-games.html?utm_campaign=ghostcastle&utm_source=ghostcastle&utm_medium=send_to_friends_context_menu";
_urls[Global_Settings.URL_ID_VIDEO_HELP] = "http://www.youtube.com/watch?v=KUL1HQGJe-o";
}
public static function set musicValue(_arg1:Number):void{
if (_game_stored_data != null){
if (_game_stored_data.data != null){
_game_stored_data.data.musicValue = _arg1;
};
};
}
public static function setShowIntroBeforeGame(_arg1:Boolean):void{
Global._game_stored_data.data.show_intro_before_game = (_arg1) ? 1 : 0;
}
public static function set soundMute(_arg1:Boolean):void{
if (_game_stored_data != null){
if (_game_stored_data.data != null){
_game_stored_data.data.soundMute = _arg1;
};
};
}
public static function get soundValue():Number{
if (_game_stored_data != null){
if (_game_stored_data.data != null){
if (_game_stored_data.data.soundValue != null){
return (_game_stored_data.data.soundValue);
};
};
};
return (sound_game.soundVolume);
}
public static function getURLByID(_arg1:String, _arg2:String="_blank"):Boolean{
return (getURL(_urls[_arg1], _arg2));
}
public static function getURL(_arg1:String, _arg2:String="_blank"):Boolean{
var requestURL:URLRequest;
var url = _arg1;
var windowName = _arg2;
try {
requestURL = new URLRequest(url);
trace("!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
trace((("navigateToURL(" + requestURL.url) + ",\"_blank\");"));
navigateToURL(requestURL, windowName);
return (true);
} catch(e:Error) {
trace("!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
trace((("ERROR in getURL(" + url) + ")"));
trace(e.message);
trace("!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
};
return (false);
}
public static function set musicMute(_arg1:Boolean):void{
if (_game_stored_data != null){
if (_game_stored_data.data != null){
_game_stored_data.data.musicMute = _arg1;
};
};
}
public static function getShowIntroBeforeGame():Number{
return (Global._game_stored_data.data.show_intro_before_game);
}
public static function set soundValue(_arg1:Number):void{
if (_game_stored_data != null){
if (_game_stored_data.data != null){
_game_stored_data.data.soundValue = _arg1;
};
};
}
public static function get musicValue():Number{
if (_game_stored_data != null){
if (_game_stored_data.data != null){
if (_game_stored_data.data.musicValue != null){
return (_game_stored_data.data.musicValue);
};
};
};
return (_music_volume_game);
}
public static function get soundMute():Boolean{
if (_game_stored_data != null){
if (_game_stored_data.data != null){
if (_game_stored_data.data.soundMute != null){
return (_game_stored_data.data.soundMute);
};
};
};
return (sound_game.mute);
}
public static function clone(_arg1:Object){
var _local2:ByteArray;
_local2 = new ByteArray();
_local2.writeObject(_arg1);
_local2.position = 0;
return (_local2.readObject());
}
public static function getSckore():Number{
return (_score);
}
public static function get musicMute():Boolean{
if (_game_stored_data != null){
if (_game_stored_data.data != null){
if (_game_stored_data.data.musicMute != null){
return (_game_stored_data.data.musicMute);
};
};
};
return (music_game.mute);
}
public static function addSckore(_arg1:Number):void{
_score = (_score + _arg1);
if (_score < 0){
_score = 0;
};
}
public static function setSckore(_arg1:Number):void{
_score = _arg1;
}
public static function isRunFromGamezHero():Boolean{
return ((_context_url == GAMEZ_HERO_URL));
}
}
}//package classes
Section 9
//BtnSoundControl (com.Denis.BtnSoundControl)
package com.Denis {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
public class BtnSoundControl extends MovieClip {
public var begun:MovieClip;
public var flag:Boolean;// = false
public var current_volume:Number;
public var dx:Number;
public var xMax:Number;// = 46
public var x0:Number;// = 2
public static var CHANGE:String = "change";
public function BtnSoundControl(){
x0 = 2;
xMax = 46;
dx = (xMax - x0);
current_volume = x0;
flag = false;
super();
this.addEventListener(Event.ENTER_FRAME, ini);
addEventListener(Event.REMOVED, listenRemove);
}
public function ini(_arg1:Event=null):void{
this.removeEventListener(Event.ENTER_FRAME, ini);
if (((!((getChildByName("begun") == null))) && (!((stage == null))))){
this["begun"].buttonMode = true;
this["begun"].useHandCursor = true;
this["begun"].mouseChildren = false;
this["begun"].addEventListener(MouseEvent.MOUSE_DOWN, downAction);
stage.addEventListener(MouseEvent.MOUSE_UP, upAction);
};
}
private function listenRemove(_arg1:Event):void{
clearEvents();
}
public function moveAction(_arg1:MouseEvent=null):void{
var _local2:Event;
current_volume = (((this["begun"] as MovieClip).x - x0) / dx);
_local2 = new Event(CHANGE);
this.dispatchEvent(_local2);
}
public function downAction(_arg1:MouseEvent=null):void{
var _local2:Number;
_local2 = (this["begun"] as MovieClip).y;
this["begun"].startDrag(false, new Rectangle(x0, _local2, (x0 + dx), 0));
stage.addEventListener(MouseEvent.MOUSE_MOVE, moveAction, false, 0, true);
}
public function enable(_arg1:Boolean=true):void{
trace(("THIS " + this.alpha));
if (_arg1){
ini();
this["begun"].alpha = 1;
} else {
clearEvents();
this["begun"].enabled = false;
this["begun"].alpha = 0.5;
};
}
public function set volue(_arg1:Number):void{
current_volume = _arg1;
update();
}
public function upAction(_arg1:MouseEvent=null):void{
if (this["begun"] != null){
this["begun"].stopDrag();
};
if (stage != null){
stage.removeEventListener(MouseEvent.MOUSE_MOVE, moveAction);
};
}
public function get volue():Number{
return (current_volume);
}
public function update():void{
(this["begun"] as MovieClip).x = (x0 + Math.round((current_volume * dx)));
}
public function clearEvents():void{
this["begun"].removeEventListener(MouseEvent.MOUSE_DOWN, downAction);
stage.removeEventListener(MouseEvent.MOUSE_UP, upAction);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, moveAction);
}
}
}//package com.Denis
Section 10
//MD5 (com.gamezhero.as3.crypto.MD5)
package com.gamezhero.as3.crypto {
import com.gamezhero.as3.utils.*;
public class MD5 {
private 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 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 function f(_arg1:int, _arg2:int, _arg3:int):int{
return (((_arg1 & _arg2) | (~(_arg1) & _arg3)));
}
private 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 function h(_arg1:int, _arg2:int, _arg3:int):int{
return (((_arg1 ^ _arg2) ^ _arg3));
}
private function i(_arg1:int, _arg2:int, _arg3:int):int{
return ((_arg2 ^ (_arg1 | ~(_arg3))));
}
private function transform(_arg1:Function, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int, _arg8:int):int{
var _local9:int;
_local9 = (((_arg2 + int(_arg1(_arg3, _arg4, _arg5))) + _arg6) + _arg8);
return ((IntUtil.rol(_local9, _arg7) + _arg3));
}
private function g(_arg1:int, _arg2:int, _arg3:int):int{
return (((_arg1 & _arg3) | (_arg2 & ~(_arg3))));
}
private function createBlocks(_arg1:String):Array{
var _local2:Array;
var _local3:int;
var _local4:int;
var _local5:int;
_local2 = new Array();
_local3 = (_arg1.length * 8);
_local4 = 0xFF;
_local5 = 0;
while (_local5 < _local3) {
_local2[(_local5 >> 5)] = (_local2[(_local5 >> 5)] | ((_arg1.charCodeAt((_local5 / 8)) & _local4) << (_local5 % 32)));
_local5 = (_local5 + 8);
};
_local2[(_local3 >> 5)] = (_local2[(_local3 >> 5)] | (128 << (_local3 % 32)));
_local2[((((_local3 + 64) >>> 9) << 4) + 14)] = _local3;
return (_local2);
}
public function hash(_arg1:String):String{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:Array;
var _local11:int;
var _local12:int;
_local2 = 1732584193;
_local3 = -271733879;
_local4 = -1732584194;
_local5 = 271733878;
_local10 = createBlocks(_arg1);
_local11 = _local10.length;
_local12 = 0;
while (_local12 < _local11) {
_local6 = _local2;
_local7 = _local3;
_local8 = _local4;
_local9 = _local5;
_local2 = ff(_local2, _local3, _local4, _local5, _local10[(_local12 + 0)], 7, -680876936);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[(_local12 + 1)], 12, -389564586);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[(_local12 + 2)], 17, 606105819);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[(_local12 + 3)], 22, -1044525330);
_local2 = ff(_local2, _local3, _local4, _local5, _local10[(_local12 + 4)], 7, -176418897);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[(_local12 + 5)], 12, 1200080426);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[(_local12 + 6)], 17, -1473231341);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[(_local12 + 7)], 22, -45705983);
_local2 = ff(_local2, _local3, _local4, _local5, _local10[(_local12 + 8)], 7, 1770035416);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[(_local12 + 9)], 12, -1958414417);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[(_local12 + 10)], 17, -42063);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[(_local12 + 11)], 22, -1990404162);
_local2 = ff(_local2, _local3, _local4, _local5, _local10[(_local12 + 12)], 7, 1804603682);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[(_local12 + 13)], 12, -40341101);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[(_local12 + 14)], 17, -1502002290);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[(_local12 + 15)], 22, 1236535329);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[(_local12 + 1)], 5, -165796510);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[(_local12 + 6)], 9, -1069501632);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[(_local12 + 11)], 14, 643717713);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[(_local12 + 0)], 20, -373897302);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[(_local12 + 5)], 5, -701558691);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[(_local12 + 10)], 9, 38016083);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[(_local12 + 15)], 14, -660478335);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[(_local12 + 4)], 20, -405537848);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[(_local12 + 9)], 5, 568446438);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[(_local12 + 14)], 9, -1019803690);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[(_local12 + 3)], 14, -187363961);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[(_local12 + 8)], 20, 1163531501);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[(_local12 + 13)], 5, -1444681467);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[(_local12 + 2)], 9, -51403784);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[(_local12 + 7)], 14, 1735328473);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[(_local12 + 12)], 20, -1926607734);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[(_local12 + 5)], 4, -378558);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[(_local12 + 8)], 11, -2022574463);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[(_local12 + 11)], 16, 1839030562);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[(_local12 + 14)], 23, -35309556);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[(_local12 + 1)], 4, -1530992060);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[(_local12 + 4)], 11, 1272893353);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[(_local12 + 7)], 16, -155497632);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[(_local12 + 10)], 23, -1094730640);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[(_local12 + 13)], 4, 681279174);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[(_local12 + 0)], 11, -358537222);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[(_local12 + 3)], 16, -722521979);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[(_local12 + 6)], 23, 76029189);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[(_local12 + 9)], 4, -640364487);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[(_local12 + 12)], 11, -421815835);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[(_local12 + 15)], 16, 530742520);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[(_local12 + 2)], 23, -995338651);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[(_local12 + 0)], 6, -198630844);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[(_local12 + 7)], 10, 1126891415);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[(_local12 + 14)], 15, -1416354905);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[(_local12 + 5)], 21, -57434055);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[(_local12 + 12)], 6, 1700485571);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[(_local12 + 3)], 10, -1894986606);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[(_local12 + 10)], 15, -1051523);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[(_local12 + 1)], 21, -2054922799);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[(_local12 + 8)], 6, 1873313359);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[(_local12 + 15)], 10, -30611744);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[(_local12 + 6)], 15, -1560198380);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[(_local12 + 13)], 21, 1309151649);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[(_local12 + 4)], 6, -145523070);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[(_local12 + 11)], 10, -1120210379);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[(_local12 + 2)], 15, 718787259);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[(_local12 + 9)], 21, -343485551);
_local2 = (_local2 + _local6);
_local3 = (_local3 + _local7);
_local4 = (_local4 + _local8);
_local5 = (_local5 + _local9);
_local12 = (_local12 + 16);
};
return ((((IntUtil.toHex(_local2) + IntUtil.toHex(_local3)) + IntUtil.toHex(_local4)) + IntUtil.toHex(_local5)));
}
private 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));
}
}
}//package com.gamezhero.as3.crypto
Section 11
//RemotingLevelsEvent (com.gamezhero.as3.remoting.events.RemotingLevelsEvent)
package com.gamezhero.as3.remoting.events {
import flash.events.*;
public class RemotingLevelsEvent extends Event {
private var value_;
private var result_;
public static const GET_PAGE_LIST:String = "GET_PAGE_LIST";
public static const SET_LEVEL:String = "SET_LEVEL";
public static const ERROR:String = "LEVEL_REMOTIN_ERROR";
public static const SET_LEVEL_RATE:String = "SET_LEVEL_RATE";
public static const GET_LEVEL:String = "GET_LEVEL";
public static const GET_PAGE_AMOUNT:String = "GET_PAGE_AMOUNT";
public function RemotingLevelsEvent(_arg1:String){
super(_arg1);
}
public function get result(){
return (result_);
}
public function set value(_arg1):void{
value_ = _arg1;
}
override public function toString():String{
return (formatToString("RemotinLevelsEvent"));
}
public function get value(){
return (value_);
}
public function set result(_arg1):void{
result_ = _arg1;
}
}
}//package com.gamezhero.as3.remoting.events
Section 12
//LevelStructure (com.gamezhero.as3.remoting.structure.LevelStructure)
package com.gamezhero.as3.remoting.structure {
public class LevelStructure {
public var level_author:String;
public var level_email:String;
public var level_name:String;
public var level_value:String;
public var level_rate:Number;
public function LevelStructure(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:Number){
level_name = _arg1;
level_value = _arg2;
level_author = _arg3;
level_email = _arg4;
level_rate = _arg5;
}
public function getArray():Array{
var _local1:Array;
_local1 = new Array();
_local1["level_name"] = level_name;
_local1["level_value"] = level_value;
_local1["level_author"] = level_author;
_local1["level_email"] = level_email;
_local1["level_rate"] = level_rate;
return (_local1);
}
public function toString():String{
return (((((((((level_name + " ") + level_author) + " ") + level_email) + " ") + String(level_rate)) + " ") + level_value));
}
}
}//package com.gamezhero.as3.remoting.structure
Section 13
//RemotingEventDispatcher (com.gamezhero.as3.remoting.RemotingEventDispatcher)
package com.gamezhero.as3.remoting {
import flash.events.*;
public class RemotingEventDispatcher extends EventDispatcher {
public function RemotingEventDispatcher(_arg1:IEventDispatcher=null){
super(_arg1);
}
}
}//package com.gamezhero.as3.remoting
Section 14
//RemotingLevelResponder (com.gamezhero.as3.remoting.RemotingLevelResponder)
package com.gamezhero.as3.remoting {
import flash.net.*;
public class RemotingLevelResponder extends Responder {
public var func_res:Function;
public var name:String;// = null
public var func_status:Function;
public var my_result;
public function RemotingLevelResponder(_arg1:String, _arg2, _arg3:Function, _arg4:Function=null){
name = null;
name = _arg1;
func_res = _arg3;
func_status = _arg4;
my_result = _arg2;
super(result_, status_);
}
private function result_(_arg1):void{
func_res.call(null, name, my_result, _arg1);
}
private function status_(_arg1):void{
func_status.call(null, name, my_result, _arg1);
}
}
}//package com.gamezhero.as3.remoting
Section 15
//RemotingLevelsGateway (com.gamezhero.as3.remoting.RemotingLevelsGateway)
package com.gamezhero.as3.remoting {
import flash.events.*;
import com.gamezhero.as3.remoting.structure.*;
import com.gamezhero.as3.remoting.events.*;
import flash.net.*;
import com.gamezhero.as3.crypto.*;
public class RemotingLevelsGateway {
private var rs:RemotingService;
private var gatewayURL:String;
private var ed:RemotingEventDispatcher;
public static const SORT_BY_RATE:int = 2;
public static const ERROR:String = "REMOTING_LEVEL_ERROR";
public static const SORT_BY_RATE_DEC:int = 3;
public static const SORT_UNDEF:int = -1;
public static const SORT_BY_DATE:int = 6;
public static const SORT_BY_NAME:int = 0;
public static const SORT_BY_NAME_DEC:int = 1;
public static const SORT_BY_DATE_DEC:int = 7;
public static const SORT_BY_AUTHOR:int = 4;
public static const SORT_BY_AUTHOR_DEC:int = 5;
public function RemotingLevelsGateway(_arg1:String=null){
var strServicePath = _arg1;
super();
trace(("Init remoting, path = " + strServicePath));
ed = new RemotingEventDispatcher();
try {
init(strServicePath);
} catch(e:ArgumentError) {
};
}
public function getPageList(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):void{
var responder:RemotingLevelResponder;
var gameID = _arg1;
var pageIndex = _arg2;
var amountInPage = _arg3;
var sortFlag = _arg4;
trace("getPageList", gameID, pageIndex, amountInPage, sortFlag);
try {
responder = new RemotingLevelResponder(RemotingLevelsEvent.GET_PAGE_LIST, pageIndex, onResult, onFault);
rs.call("levels.getPageList", (responder as Responder), gameID, pageIndex, amountInPage, sortFlag);
} catch(e:ArgumentError) {
onFault(RemotingLevelsEvent.GET_PAGE_LIST, pageIndex, {name:"get page list"});
};
}
public function getPagesAmount(_arg1:Number, _arg2:Number):void{
var responder:RemotingLevelResponder;
var gameID = _arg1;
var amountInPage = _arg2;
try {
responder = new RemotingLevelResponder(RemotingLevelsEvent.GET_PAGE_AMOUNT, null, onResult, onFault);
rs.call("levels.getPagesAmount", (responder as Responder), gameID, amountInPage);
} catch(e:ArgumentError) {
onFault(RemotingLevelsEvent.GET_PAGE_AMOUNT, null, {name:"get pages amount"});
};
}
public function setLevel(_arg1:Number, _arg2:String, _arg3:LevelStructure):void{
var responder:RemotingLevelResponder;
var code:String;
var arr:Array;
var gameID = _arg1;
var levelID = _arg2;
var levelData = _arg3;
try {
responder = new RemotingLevelResponder(RemotingLevelsEvent.SET_LEVEL, levelID, onResult, onFault);
code = new MD5().hash(((gameID + levelData.level_name) + levelData.level_value));
arr = levelData.getArray();
rs.call("levels.setLevel", (responder as Responder), gameID, levelID, arr, code);
} catch(e:ArgumentError) {
onFault(RemotingLevelsEvent.SET_LEVEL, levelID, {name:"set level"});
};
}
public function removeEventListener(_arg1:String, _arg2:Function):void{
ed.removeEventListener(_arg1, _arg2);
}
public function addEventListener(_arg1:String, _arg2:Function):void{
ed.addEventListener(_arg1, _arg2);
}
public function getLevel(_arg1:Number, _arg2:String):void{
var responder:RemotingLevelResponder;
var gameID = _arg1;
var levelID = _arg2;
try {
responder = new RemotingLevelResponder(RemotingLevelsEvent.GET_LEVEL, levelID, onResult, onFault);
rs.call("levels.getLevel", (responder as Responder), gameID, levelID);
} catch(e:ArgumentError) {
onFault(RemotingLevelsEvent.GET_LEVEL, levelID, {name:"get level"});
};
}
private function init(_arg1:String=null):Boolean{
var strServicePath = _arg1;
gatewayURL = strServicePath;
try {
rs = new RemotingService(gatewayURL);
rs.addEventListener(NetStatusEvent.NET_STATUS, listenError);
} catch(e:ArgumentError) {
return (false);
};
return (true);
}
public function setLevelRate(_arg1:Number, _arg2:String, _arg3:Number):void{
var responder:RemotingLevelResponder;
var code:String;
var gameID = _arg1;
var levelID = _arg2;
var rate = _arg3;
try {
responder = new RemotingLevelResponder(RemotingLevelsEvent.SET_LEVEL_RATE, levelID, onResult, onFault);
code = new MD5().hash(String(((gameID + levelID) + rate)));
rs.call("levels.setLevelRate", (responder as Responder), gameID, levelID, rate, code);
} catch(e:ArgumentError) {
onFault(RemotingLevelsEvent.SET_LEVEL_RATE, levelID, {name:"set level rate"});
};
}
private function onFault(_arg1:String, _arg2, _arg3:Object):void{
var _local4:RemotingLevelsEvent;
_local4 = new RemotingLevelsEvent(RemotingLevelsEvent.ERROR);
_local4.value = _arg1;
_local4.result = _arg2;
ed.dispatchEvent(_local4);
}
private function listenError(_arg1:NetStatusEvent):void{
onFault(null, null, null);
}
private function onResult(_arg1:String, _arg2, _arg3):void{
var _local4:RemotingLevelsEvent;
_local4 = new RemotingLevelsEvent(_arg1);
_local4.value = _arg3;
_local4.result = _arg2;
ed.dispatchEvent(_local4);
}
}
}//package com.gamezhero.as3.remoting
Section 16
//RemotingService (com.gamezhero.as3.remoting.RemotingService)
package com.gamezhero.as3.remoting {
import flash.net.*;
public class RemotingService extends NetConnection {
public function RemotingService(_arg1:String){
objectEncoding = ObjectEncoding.AMF3;
connect(_arg1);
}
}
}//package com.gamezhero.as3.remoting
Section 17
//ClassLoader (com.gamezhero.as3.utils.ClassLoader)
package com.gamezhero.as3.utils {
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.system.*;
public class ClassLoader extends EventDispatcher {
private var loader:Loader;
private var request:URLRequest;
private var swfLib:String;
private var loadedClass:Class;
public static var CLASS_LOADED:String = "classLoaded";
public static var LOAD_ERROR:String = "loadError";
public function ClassLoader(){
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
loader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
}
public function getClass(_arg1:String):Class{
var className = _arg1;
try {
return ((loader.contentLoaderInfo.applicationDomain.getDefinition(className) as Class));
} catch(e:Error) {
trace("ERROR");
};
return (null);
}
private function securityErrorHandler(_arg1:Event):void{
dispatchEvent(new Event(ClassLoader.LOAD_ERROR));
}
private function completeHandler(_arg1:Event):void{
dispatchEvent(new Event(ClassLoader.CLASS_LOADED));
}
private function ioErrorHandler(_arg1:Event):void{
dispatchEvent(new Event(ClassLoader.LOAD_ERROR));
}
public function load(_arg1:String):void{
var _local2:LoaderContext;
swfLib = _arg1;
request = new URLRequest(swfLib);
_local2 = new LoaderContext();
_local2.applicationDomain = new ApplicationDomain();
loader.load(request, _local2);
}
}
}//package com.gamezhero.as3.utils
Section 18
//IntUtil (com.gamezhero.as3.utils.IntUtil)
package com.gamezhero.as3.utils {
public class IntUtil {
private static var hexChars:String = "0123456789abcdef";
public static function toHex(_arg1:int, _arg2:Boolean=false):String{
var _local3:String;
var _local4:int;
var _local5:int;
_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);
}
public static function ror(_arg1:int, _arg2:int):uint{
var _local3:int;
_local3 = (32 - _arg2);
return (((_arg1 << _local3) | (_arg1 >>> (32 - _local3))));
}
public static function rol(_arg1:int, _arg2:int):int{
return (((_arg1 << _arg2) | (_arg1 >>> (32 - _arg2))));
}
}
}//package com.gamezhero.as3.utils
Section 19
//GamePreloader (com.gamezhero.as3.GamePreloader)
package com.gamezhero.as3 {
import flash.display.*;
import flash.utils.*;
import flash.events.*;
import flash.net.*;
import flash.ui.*;
public class GamePreloader extends MovieClip {
private var obj:Object;
private var urls:Dictionary;
public var bg:MovieClip;
private var rate_old:Number;
public var intro:MovieClip;
private var par:MovieClip;
private var scale_old:String;
private var align_old:String;
public static const finish:String = "PRELOAD_COMPLETE";
public function GamePreloader(_arg1:MovieClip, _arg2:Object){
var _local3:ContextMenu;
var _local4:ContextMenuBuiltInItems;
var _local5:String;
var _local6:ContextMenuItem;
urls = new Dictionary();
super();
obj = _arg2;
par = _arg1;
par.addChild(this);
stage.addEventListener(Event.RESIZE, resizeStage);
this.addEventListener(Event.ENTER_FRAME, iniPreloader);
scale_old = stage.scaleMode;
align_old = stage.align;
rate_old = stage.frameRate;
resizeStage(null);
_local3 = new ContextMenu();
_local3.hideBuiltInItems();
_local4 = _local3.builtInItems;
for (_local5 in _arg2.gamezhero_menu) {
_local6 = new ContextMenuItem(_local5);
_local6.caption = _local5;
urls[_local6] = _arg2.gamezhero_menu[_local5];
_local6.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, getURLContextMenu);
_local3.customItems.push(_local6);
};
par.loaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
par.loaderInfo.addEventListener(Event.COMPLETE, comp);
this.parent.contextMenu = _local3;
this.addEventListener(MouseEvent.MOUSE_DOWN, getURLPreloader);
this.useHandCursor = true;
this.buttonMode = true;
}
public function comp(_arg1:Event=null):void{
}
public function action(_arg1:Event=null):void{
var _local2:Event;
stage.scaleMode = scale_old;
stage.align = align_old;
stage.frameRate = rate_old;
this.removeEventListener(Event.ENTER_FRAME, iniPreloader);
stage.removeEventListener(Event.RESIZE, resizeStage);
par.loaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
par.loaderInfo.removeEventListener(Event.COMPLETE, comp);
_local2 = new Event(finish);
this.dispatchEvent(_local2);
par.removeChild(this);
}
public function getURLPreloader(_arg1:MouseEvent=null):void{
getURL(obj.gamezhero_url);
}
public function getURL(_arg1:String):void{
var _local2:URLRequest;
_local2 = new URLRequest(_arg1);
navigateToURL(_local2, "_blank");
}
public function ioErrorHandler(_arg1:Event):void{
}
public function resizeStage(_arg1:Event):void{
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
stage.frameRate = 20;
this["bg"].width = Math.round(stage.stageWidth);
this["bg"].height = Math.round(stage.stageHeight);
this["intro"].x = Math.round((stage.stageWidth / 2));
this["intro"].y = Math.round((stage.stageHeight / 2));
}
public function getURLContextMenu(_arg1:ContextMenuEvent=null):void{
getURL(urls[_arg1.target]);
}
public function iniPreloader(_arg1:Event):void{
var _local2:Number;
_local2 = (-128 + (132 * (par.loaderInfo.bytesLoaded / par.loaderInfo.bytesTotal)));
this["intro"]["pr"]["begun"].x = (this["intro"]["pr"]["begun"].x - ((this["intro"]["pr"]["begun"].x - _local2) / 5));
if (par.loaderInfo.bytesLoaded != par.loaderInfo.bytesTotal){
if (this["intro"].currentLabel == "stopFrame"){
this["intro"].stop();
};
} else {
if (this["intro"].currentLabel == "stopFrame"){
this["intro"].play();
};
if (this["intro"].currentFrame == this["intro"].totalFrames){
this["intro"].stop();
action();
};
if (obj.debug){
action();
};
};
}
}
}//package com.gamezhero.as3
Section 20
//SubmitArea (com.gamezhero.as3.SubmitArea)
package com.gamezhero.as3 {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import com.gamezhero.as3.crypto.*;
import com.gamezhero.as3.utils.*;
import flash.system.*;
public class SubmitArea extends MovieClip {
private var x_pos:Number;// = 0
private var goal:MovieClip;
private var language:String;
private var infoText:TextField;
private var score_value:Number;// = 0
private var y_pos:Number;// = 0
public var secret:MD5;
private var scoreLibrary:ClassLoader;
private var score;
public var versionGame:String;// = "1.0"
public static const CONTINUE:String = "gamezhero_continue";
public static const SUBMITED:String = "gamezhero_submited";
public function SubmitArea(_arg1:MovieClip, _arg2:int, _arg3:int, _arg4:Number, _arg5:Array, _arg6:String="ENG"){
var _local7:String;
var _local8:uint;
versionGame = "1.0";
score_value = 0;
x_pos = 0;
y_pos = 0;
super();
x_pos = _arg2;
y_pos = _arg3;
goal = _arg1;
score_value = _arg4;
language = _arg6;
Security.allowDomain("www.gamezhero.com", "gamezhero.com", "files.gamezhero.com", "*.gamezhero.com");
secret = new MD5();
scoreLibrary = new ClassLoader();
scoreLibrary.addEventListener(ClassLoader.LOAD_ERROR, loadErrorHandler);
scoreLibrary.addEventListener(ClassLoader.CLASS_LOADED, classLoadedHandler);
_local7 = "";
_local8 = 0;
while (_local8 < _arg5.length) {
_local7 = (_local7 + String.fromCharCode(_arg5[_local8]));
_local8++;
};
trace(_local7);
scoreLibrary.load(_local7);
createIniText();
infoText.text = "loading score...";
goal.addChild(this);
}
public function submitAction(_arg1:String=""):void{
diactivateAllEvents();
goal.removeChild(this);
dispatchEvent(new Event(SUBMITED));
}
public function loadErrorHandler(_arg1:Event=null):void{
(infoText as TextField).text = "error loading";
}
public function diactivateAllEvents():void{
scoreLibrary.removeEventListener(ClassLoader.LOAD_ERROR, loadErrorHandler);
scoreLibrary.removeEventListener(ClassLoader.CLASS_LOADED, classLoadedHandler);
}
public function createIniText():void{
var _local1:TextFormat;
infoText = new TextField();
infoText.autoSize = TextFieldAutoSize.LEFT;
_local1 = new TextFormat();
_local1.color = 0;
_local1.size = 11;
_local1.font = "Arial";
infoText.defaultTextFormat = _local1;
this.addChild(infoText);
infoText.x = 10;
infoText.y = 10;
}
public function continueAction():void{
diactivateAllEvents();
goal.removeChild(this);
dispatchEvent(new Event(CONTINUE));
}
public function classLoadedHandler(_arg1:Event=null):void{
var _local2:Class;
this.x = x_pos;
this.y = y_pos;
(infoText as TextField).text = "";
_local2 = scoreLibrary.getClass("Score");
score = new _local2((this as MovieClip), null, score_value, language);
this.addChild(score);
}
}
}//package com.gamezhero.as3
Section 21
//CommonFunc (com.CommonFunc)
package com {
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import classes.crypto.*;
import classes.base64.*;
public class CommonFunc {
public static const UINT_UNDEF:uint = 4294967295;
public static const NUM_UNDEF:Number = 0;
public static const USE_BASE64:Boolean = true;
public static const INT_UNDEF:int = -1;
public static function isMetaParent(_arg1:DisplayObject, _arg2:DisplayObjectContainer):Boolean{
var _local3:DisplayObject;
if ((((_arg1 == null)) || ((_arg2 == null)))){
return (false);
};
if (_arg1 == _arg2){
return (true);
};
_local3 = _arg1.parent;
return (isMetaParent(_local3, _arg2));
}
public static function nAbs(_arg1:Number):Number{
return (((_arg1 < 0)) ? -(_arg1) : _arg1);
}
public static function stringToByteArray(_arg1:String):ByteArray{
var _local2:int;
var _local3:int;
var _local4:ByteArray;
var _local5:uint;
var _local6:uint;
var _local7:uint;
var _local8:int;
var _local9:int;
_local2 = _arg1.length;
_local3 = (_local2 >> 1);
if (_local3 > 0){
_local4 = new ByteArray();
_local4.length = _local3;
_local8 = 0;
_local9 = 0;
while (_local9 < _local3) {
if (_local8 >= _local2){
return (null);
};
do {
_local7 = parseInt(_arg1.charAt(_local8), 16);
_local8++;
} while (((!(isFinite(_local7))) && ((_local8 < _local2))));
if (_local8 >= _local2){
return (null);
};
do {
_local6 = parseInt(_arg1.charAt(_local8), 16);
_local8++;
} while (((!(isFinite(_local6))) && ((_local8 < _local2))));
_local5 = ((_local7 << 4) + _local6);
_local4.position = _local9;
_local4.writeByte(_local5);
_local9++;
};
if (_local9 < _local4.length){
return (null);
};
return (_local4);
};
return (null);
}
public static function iAbs(_arg1:int):int{
return (((_arg1 < 0)) ? -(_arg1) : _arg1);
}
public static function uncompressString(_arg1:String):String{
var byteArray:ByteArray;
var srtCompressed = _arg1;
if (srtCompressed != null){
if (USE_BASE64){
byteArray = base64ToByteArray(srtCompressed);
} else {
byteArray = stringToByteArray(srtCompressed);
};
if (((!((byteArray == null))) && ((byteArray.length > 0)))){
try {
byteArray.uncompress();
} catch(e:ArgumentError) {
trace(e);
return (null);
};
byteArray.position = 0;
return (byteArray.readMultiByte(byteArray.length, ""));
};
};
return (null);
}
public static function cubicEaseInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0, _arg6:Number=0):Number{
var _local7:Number;
var _local8:Number;
_local7 = (_arg1 / _arg4);
_local8 = ((((-2 * _local7) * _local7) * _local7) + ((3 * _local7) * _local7));
return ((_arg2 + (_arg3 * _local8)));
}
public static function getURL(_arg1:String, _arg2:String="_blank"):void{
var requestURL:URLRequest;
var url = _arg1;
var windowName = _arg2;
try {
requestURL = new URLRequest(url);
navigateToURL(requestURL, windowName);
} catch(e:Error) {
};
}
public static function compressString(_arg1:String):String{
var _local2:MD5;
var _local3:String;
var _local4:String;
var _local5:String;
var _local6:int;
var _local7:ByteArray;
var _local8:int;
if (_arg1 != null){
_local2 = new MD5();
_local6 = _arg1.length;
_local7 = new ByteArray();
_local7.writeMultiByte(_arg1, "");
if (_local7 != null){
_local7.compress();
if (USE_BASE64){
_local5 = byteArrayToBase64(_local7);
} else {
_local5 = byteArrayToString(_local7);
};
_local8 = _local5.length;
trace((("compress rate: " + ((_local8 / _local6) * 100)) + "%"));
trace(("string_uncompress.length = " + _local6));
trace(("string_compress.length = " + _local8));
_local3 = _local2.hash(_local5);
_local4 = _local2.hash(_arg1);
trace(("hash uncompressed: " + _local4));
trace(("hash compressed: " + _local3));
return (_local5);
};
};
return (null);
}
public static function byteArrayToBase64(_arg1:ByteArray):String{
return (Base64.encodeByteArray(_arg1));
}
public static function byteArrayToString(_arg1:ByteArray):String{
var _local2:uint;
var _local3:uint;
var _local4:uint;
var _local5:String;
var _local6:int;
var _local7:int;
_local5 = "";
if (_arg1 != null){
_local6 = _arg1.length;
if (_local6 > 0){
_arg1.position = 0;
_local7 = 0;
while (_local7 < _local6) {
_local2 = (_arg1.readByte() & 0xFF);
_local3 = (_local2 & 15);
_local4 = (_local2 >> 4);
_local5 = (_local5 + (_local4.toString(16) + _local3.toString(16)));
_local7++;
};
return (_local5);
};
};
return (null);
}
public static function base64ToByteArray(_arg1):ByteArray{
return (Base64.decodeToByteArray(_arg1));
}
}
}//package com
Section 22
//FPS (com.FPS)
package com {
import flash.display.*;
import flash.utils.*;
import flash.events.*;
import flash.text.*;
import flash.system.*;
public class FPS extends Sprite {
private var timer:Timer;
private var frames:int;// = 0
private var field:TextField;
public function FPS(){
frames = 0;
super();
field = new TextField();
field.defaultTextFormat = new TextFormat("arial", 10, 0xFF0000, true);
field.autoSize = "left";
field.selectable = false;
addChild(field);
timer = new Timer(1000);
timer.addEventListener(TimerEvent.TIMER, displayCount);
addEventListener(Event.ENTER_FRAME, count);
addEventListener(Event.ADDED_TO_STAGE, initTimer);
addEventListener(Event.REMOVED_FROM_STAGE, stopTimer);
mouseEnabled = false;
}
private function initTimer(_arg1:Event=null):void{
timer.start();
}
private function count(_arg1:Event):void{
frames++;
}
private function stopTimer(_arg1:Event):void{
timer.stop();
}
private function displayCount(_arg1:TimerEvent):void{
var _local2:int;
_local2 = (System.totalMemory >> 10);
field.text = (((("FPS : " + frames) + "\nMEM : ") + _local2) + "kb ");
frames = 0;
}
}
}//package com
Section 23
//IntPoint (com.IntPoint)
package com {
public class IntPoint {
public var m_iX:int;
public var m_iY:int;
public function IntPoint(_arg1:int=-1, _arg2:int=-1){
m_iX = _arg1;
m_iY = _arg2;
}
}
}//package com
Section 24
//TElastic (com.TElastic)
package com {
import flash.display.*;
import flash.events.*;
public class TElastic extends MovieClip {
private var m_nX_To:Number;// = 0
private var m_nHeight_To:Number;// = 0
private var m_nY_From:Number;// = 0
private var m_nHeight_From:Number;// = 0
private var m_nY_To:Number;// = 0
private var m_nX_From:Number;// = 0
private var m_nSpeed:Number;// = 6
private var m_bElastic:Boolean;// = false
private var m_nWidth_From:Number;// = 0
private var m_nWidth_To:Number;// = 0
public function TElastic(){
m_nWidth_To = 0;
m_nWidth_From = 0;
m_nHeight_To = 0;
m_nHeight_From = 0;
m_nX_To = 0;
m_nX_From = 0;
m_nY_To = 0;
m_nY_From = 0;
m_bElastic = false;
m_nSpeed = 6;
super();
m_nWidth_To = (m_nWidth_From = width);
m_nHeight_To = (m_nHeight_From = height);
m_nX_To = (m_nX_From = x);
m_nY_To = (m_nY_From = y);
}
private function speedBy(_arg1:Number):Number{
if (_arg1 > 0){
_arg1 = ((2 * _arg1) - 1);
_arg1 = (m_nSpeed * ((-(_arg1) * _arg1) + 1.07));
return (_arg1);
};
_arg1 = ((2 * _arg1) + 1);
_arg1 = (m_nSpeed * ((_arg1 * _arg1) - 1.07));
return (_arg1);
}
public function onFinishedResize_X():void{
}
public function onFinishedResize_Y():void{
}
public function collapsRight():void{
x = (x + width);
width = 0;
}
public function onFinishedResize_Height():void{
}
override public function set height(_arg1:Number):void{
if (!m_bElastic){
m_nHeight_To = _arg1;
m_nHeight_From = _arg1;
super.height = _arg1;
} else {
if (m_nHeight_To != _arg1){
m_nHeight_To = _arg1;
m_nHeight_From = height;
};
};
}
public function get speed():Number{
return (m_nSpeed);
}
public function onFinishedResize_Width():void{
}
public function set speed(_arg1:Number):void{
m_nSpeed = _arg1;
}
override public function set width(_arg1:Number):void{
if (!m_bElastic){
super.width = _arg1;
m_nWidth_To = _arg1;
m_nWidth_From = _arg1;
} else {
if (m_nWidth_To != _arg1){
m_nWidth_To = _arg1;
m_nWidth_From = width;
};
};
}
public function checkIsResize():void{
}
public function set elastic(_arg1:Boolean):void{
if (m_bElastic != _arg1){
m_bElastic = _arg1;
if (m_bElastic){
addEventListener(Event.ENTER_FRAME, listenEnterFrame, false, 0, true);
} else {
removeEventListener(Event.ENTER_FRAME, listenEnterFrame, false);
};
};
}
private function listenEnterFrame(_arg1:Event):void{
var _local2:Number;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
if (m_bElastic){
_local3 = x;
_local4 = y;
_local5 = width;
_local6 = height;
if (m_nWidth_To != m_nWidth_From){
_local2 = ((m_nWidth_To - _local5) / CommonFunc.iAbs((m_nWidth_To - m_nWidth_From)));
_local7 = speedBy(_local2);
_local8 = (_local5 + _local7);
if (((((((_local8 - m_nWidth_To) > 0)) && (((_local5 - m_nWidth_To) < 0)))) || (((((_local8 - m_nWidth_To) < 0)) && (((_local5 - m_nWidth_To) > 0)))))){
super.width = m_nWidth_To;
onFinishedResize_Width();
checkIsResize();
m_nWidth_From = m_nWidth_To;
} else {
super.width = _local8;
};
};
if (m_nHeight_To != m_nHeight_From){
_local2 = ((m_nHeight_To - _local6) / CommonFunc.iAbs((m_nHeight_To - m_nHeight_From)));
_local9 = speedBy(_local2);
_local10 = (_local6 + _local9);
if (((((((_local10 - m_nHeight_To) > 0)) && (((_local6 - m_nHeight_To) < 0)))) || (((((_local10 - m_nHeight_To) < 0)) && (((_local6 - m_nHeight_To) > 0)))))){
super.height = m_nHeight_To;
onFinishedResize_Height();
checkIsResize();
m_nHeight_From = m_nHeight_To;
} else {
super.height = _local10;
};
};
if (m_nX_To != m_nX_From){
_local2 = ((m_nX_To - _local3) / Math.abs((m_nX_From - m_nX_To)));
_local11 = speedBy(_local2);
_local12 = (_local3 + _local11);
if (((((((_local12 - m_nX_To) > 0)) && (((_local3 - m_nX_To) < 0)))) || (((((_local12 - m_nX_To) < 0)) && (((_local3 - m_nX_To) > 0)))))){
super.x = m_nX_To;
onFinishedResize_X();
checkIsResize();
m_nX_From = m_nX_To;
} else {
super.x = _local12;
};
};
if (m_nY_To != m_nY_From){
_local2 = ((m_nY_To - _local4) / Math.abs((m_nY_From - m_nY_To)));
_local13 = speedBy(_local2);
_local14 = (_local4 + _local13);
if (((((((_local14 - m_nY_To) > 0)) && (((_local4 - m_nY_To) < 0)))) || (((((_local14 - m_nY_To) < 0)) && (((_local4 - m_nY_To) > 0)))))){
super.y = m_nY_To;
onFinishedResize_Y();
checkIsResize();
m_nY_From = m_nY_To;
} else {
super.y = _local14;
};
};
};
}
public function get elastic():Boolean{
return (m_bElastic);
}
public function fullScreen():void{
x = 0;
y = 0;
width = stage.width;
height = stage.height;
}
override public function set y(_arg1:Number):void{
if (!m_bElastic){
m_nY_To = _arg1;
m_nY_From = _arg1;
super.y = _arg1;
} else {
if (m_nY_To != _arg1){
m_nY_To = _arg1;
m_nY_From = y;
};
};
}
override public function set x(_arg1:Number):void{
if (!m_bElastic){
m_nX_To = _arg1;
m_nX_From = _arg1;
super.x = _arg1;
} else {
if (m_nX_To != _arg1){
m_nX_To = _arg1;
m_nX_From = x;
};
};
}
}
}//package com
Section 25
//TElementWithText (com.TElementWithText)
package com {
import flash.display.*;
import main.*;
public class TElementWithText extends MovieClip {
public function TElementWithText(){
stop();
setLang(Language_Settings.getInstance().getCurrentLang());
mouseEnabled = false;
}
public function init():void{
}
public function setLang(_arg1:String):void{
gotoAndStop(_arg1);
}
}
}//package com
Section 26
//TLang (com.TLang)
package com {
public class TLang {
private var m_strCurLang:String;
public var m_arTextForLang:Array;
public var m_arTextForAllLang:Array;
public static const TEXT_SHARP_BLUE:int = 116;
public static const PT:String = "PRT";
public static const TEXT_FIRE:int = 106;
public static const TEXT_MSG_CANT_SOLVE_EDIT_LEVEL_TITLE:int = 2002;
public static const TEXT_VASE:int = 107;
public static const COUNTRY_USA:uint = 0;
public static const TEXT_SHARP_GREEN:int = 118;
public static const COUNTRY_RUSSIA:uint = 3;
public static const TEXT_RAFT:int = 126;
public static const IT:String = "ITA";
public static const TEXT_KEY_BLUE:int = 113;
public static const TEXT_FLAG:int = 105;
public static const RU:String = "RUS";
public static const TEXT_TORCH:int = 112;
public static const TEXT_KEY_GREEN:int = 115;
public static const TEXT_MSG_REMOVE_LEVEL_TITLE:int = 2000;
public static const COUNTRY_POLAND:uint = 11;
public static const COUNTRY_BRAZIL:uint = 7;
public static const TEXT_FLOOR:int = 100;
public static const TEXT_KEY_RED:int = 114;
public static const TEXT_WATER:int = 102;
private static const COUNTRY_TO_LANG:Array = new Array({country:COUNTRY_USA, lang:US}, {country:COUNTRY_SPAIN, lang:ES}, {country:COUNTRY_ITALY, lang:IT}, {country:COUNTRY_RUSSIA, lang:RU}, {country:COUNTRY_GERMANY, lang:DE}, {country:COUNTRY_FRENCH, lang:FR}, {country:COUNTRY_PORTUGAL, lang:PT}, {country:COUNTRY_BRAZIL, lang:PT}, {country:COUNTRY_MEXICO, lang:ES}, {country:COUNTRY_UKRAINE, lang:UA}, {country:COUNTRY_AUSTRALIA, lang:US}, {country:COUNTRY_POLAND, lang:PL});
public static const TEXT_WATER_BUBBLES:int = 103;
public static const TEXT_CANDLESTICK:int = 109;
public static const COUNTRY_ITALY:uint = 2;
public static const TEXT_TILE:int = 101;
public static const DE:String = "DEU";
public static const COUNTRY_FRENCH:uint = 5;
public static const UA:String = "UKR";
public static const COUNTRY_UKRAINE:uint = 9;
public static const TEXT_BOX:int = 108;
public static const TEXT_WALL:int = 104;
public static const TEXT_GATE:int = 119;
public static const US:String = "ENG";
public static const COUNTRY_SPAIN:uint = 1;
public static const COUNTRY_MEXICO:uint = 8;
public static const TEXT_INFO_HELP:int = 125;
public static const TEXT_HORNS:int = 110;
public static const ES:String = "ESP";
public static const TEXT_SHIELD:int = 111;
public static const COUNTRY_GERMANY:uint = 4;
public static const FR:String = "FRA";
public static const TEXT_HERO:int = 121;
public static const COUNTRY_AUSTRALIA:uint = 10;
public static const TEXT_STAIRWAY:int = 120;
public static const TEXT_MADAM:int = 124;
public static const TEXT_GHOST:int = 122;
public static const TEXT_KNIGHT:int = 123;
public static const COUNTRY_PORTUGAL:uint = 6;
public static const TEXT_SHARP_RED:int = 117;
public static const TEXT_MSG_REMOVE_LEVEL_TEXT:int = 2001;
public static const TEXT_MSG_CANT_SOLVE_EDIT_LEVEL_TEXT:int = 2003;
public static const PL:String = "POL";
protected static var _instance:TLang;
public function TLang(){
init();
}
public function getText(_arg1:uint, _arg2:String=null, _arg3:Boolean=false):String{
var _local4:Object;
if (_arg2 == null){
_arg2 = getCurrentLang();
};
for each (_local4 in m_arTextForLang) {
if ((((_local4.lang == _arg2)) && ((_local4.id == _arg1)))){
return (_local4.text);
};
};
if (!_arg3){
for each (_local4 in m_arTextForAllLang) {
if (_local4.id == _arg1){
return (_local4.text);
};
};
};
return (null);
}
public function setCurrentLang(_arg1:String):Boolean{
var _local2:Object;
for each (_local2 in COUNTRY_TO_LANG) {
if (((!((_local2 == null))) && ((_local2.lang == _arg1)))){
m_strCurLang = _arg1;
return (true);
};
};
return (false);
}
protected function init():void{
m_arTextForLang = new Array();
m_arTextForAllLang = new Array();
addTextForAllLang(COUNTRY_USA, "English");
addTextForAllLang(COUNTRY_SPAIN, "Espanol");
addTextForAllLang(COUNTRY_ITALY, "Italiana");
addTextForAllLang(COUNTRY_RUSSIA, "Русский");
addTextForAllLang(COUNTRY_GERMANY, "Deutsche");
addTextForAllLang(COUNTRY_FRENCH, "Francais");
addTextForAllLang(COUNTRY_PORTUGAL, "Portuguesa");
addTextForAllLang(COUNTRY_BRAZIL, "Portuguesa");
addTextForAllLang(COUNTRY_MEXICO, "Espanol");
addTextForAllLang(COUNTRY_UKRAINE, "Українська");
addTextForAllLang(COUNTRY_AUSTRALIA, "English");
addTextForAllLang(COUNTRY_POLAND, "Polski");
addTextForAllLang(TEXT_FLOOR, "Floor");
addText(RU, TEXT_FLOOR, "Пол");
addText(UA, TEXT_FLOOR, "Підлога");
addTextForAllLang(TEXT_TILE, "Tile");
addText(RU, TEXT_TILE, "Плитка");
addText(UA, TEXT_TILE, "Плитка");
addText(IT, TEXT_TILE, "Piastrella");
addTextForAllLang(TEXT_WATER, "Water");
addText(US, TEXT_WATER, "Water");
addText(ES, TEXT_WATER, "Water");
addText(IT, TEXT_WATER, "Water");
addText(RU, TEXT_WATER, "Вода");
addText(DE, TEXT_WATER, "Water");
addText(FR, TEXT_WATER, "Water");
addText(PT, TEXT_WATER, "Water");
addText(UA, TEXT_WATER, "Вода");
addText(PL, TEXT_WATER, "Water");
addTextForAllLang(TEXT_WATER_BUBBLES, "Bubbles");
addText(RU, TEXT_WATER_BUBBLES, "Пузыри");
addText(UA, TEXT_WATER_BUBBLES, "Бульбашки");
addTextForAllLang(TEXT_WALL, "Wall");
addText(RU, TEXT_WALL, "Стена");
addText(UA, TEXT_WALL, "Мур");
addTextForAllLang(TEXT_FLAG, "Flag");
addText(RU, TEXT_FLAG, "Флаг");
addText(UA, TEXT_FLAG, "Прапор");
addTextForAllLang(TEXT_HORNS, "Horns");
addText(RU, TEXT_HORNS, "Рога");
addText(UA, TEXT_HORNS, "Рога");
addTextForAllLang(TEXT_SHIELD, "Shield");
addText(RU, TEXT_SHIELD, "Щит");
addText(UA, TEXT_SHIELD, "Щит");
addTextForAllLang(TEXT_TORCH, "Torch");
addText(RU, TEXT_TORCH, "Факел");
addText(UA, TEXT_TORCH, "Смолоскип");
addTextForAllLang(TEXT_FIRE, "Fire");
addText(RU, TEXT_FIRE, "Огонь");
addText(UA, TEXT_FIRE, "Вогнище");
addTextForAllLang(TEXT_VASE, "Vase");
addText(RU, TEXT_VASE, "Ваза");
addText(UA, TEXT_VASE, "Ваза");
addTextForAllLang(TEXT_BOX, "Box");
addText(RU, TEXT_BOX, "Ящик");
addText(UA, TEXT_BOX, "Скриня");
addTextForAllLang(TEXT_CANDLESTICK, "Candlestick");
addText(RU, TEXT_CANDLESTICK, "Подсвечник");
addText(UA, TEXT_CANDLESTICK, "Свічник");
addTextForAllLang(TEXT_KEY_BLUE, "Blue Key");
addText(RU, TEXT_KEY_BLUE, "Голубой Ключ");
addText(UA, TEXT_KEY_BLUE, "Блакитний Ключ");
addTextForAllLang(TEXT_KEY_RED, "Red Key");
addText(RU, TEXT_KEY_RED, "Красный Ключ");
addText(UA, TEXT_KEY_RED, "Червоний Ключ");
addTextForAllLang(TEXT_KEY_GREEN, "Green Key");
addText(RU, TEXT_KEY_GREEN, "Зеленый Ключ");
addText(UA, TEXT_KEY_GREEN, "Зелений Ключ");
addTextForAllLang(TEXT_SHARP_BLUE, "Blue Sharp");
addText(RU, TEXT_SHARP_BLUE, "Голубая Колючка");
addText(UA, TEXT_SHARP_BLUE, "Блакитна Колючка");
addTextForAllLang(TEXT_SHARP_RED, "Red Sharp");
addText(RU, TEXT_SHARP_RED, "Красная Колючка");
addText(UA, TEXT_SHARP_RED, "Червона Колючка");
addTextForAllLang(TEXT_SHARP_GREEN, "Green Sharp");
addText(RU, TEXT_SHARP_GREEN, "Зеленая Колючка");
addText(UA, TEXT_SHARP_GREEN, "Зелена Колючка");
addTextForAllLang(TEXT_GATE, "Fence");
addText(RU, TEXT_GATE, "Решетка");
addText(UA, TEXT_GATE, "Огорожа");
addTextForAllLang(TEXT_STAIRWAY, "Stairway");
addText(RU, TEXT_STAIRWAY, "Лестница");
addText(UA, TEXT_STAIRWAY, "Сходи");
addTextForAllLang(TEXT_HERO, "Girl");
addText(RU, TEXT_HERO, "Девочка");
addText(UA, TEXT_HERO, "Дівчатко");
addTextForAllLang(TEXT_GHOST, "Ghost");
addText(RU, TEXT_GHOST, "Призрак");
addText(UA, TEXT_GHOST, "Привид");
addTextForAllLang(TEXT_KNIGHT, "Knight");
addText(RU, TEXT_KNIGHT, "Рыцарь");
addText(UA, TEXT_KNIGHT, "Лицар");
addTextForAllLang(TEXT_MADAM, "Madam");
addText(RU, TEXT_MADAM, "Госпожа");
addText(UA, TEXT_MADAM, "Мадам");
addTextForAllLang(TEXT_INFO_HELP, "Info");
addText(UA, TEXT_INFO_HELP, "Інформація");
addText(RU, TEXT_INFO_HELP, "Информация");
addTextForAllLang(TEXT_RAFT, "Raft");
addText(UA, TEXT_RAFT, "Пліт");
addText(RU, TEXT_RAFT, "Плот");
addTextForAllLang(TEXT_MSG_REMOVE_LEVEL_TITLE, "Attention!");
addText(RU, TEXT_MSG_REMOVE_LEVEL_TITLE, "Внимание");
addText(UA, TEXT_MSG_REMOVE_LEVEL_TITLE, "Увага");
addTextForAllLang(TEXT_MSG_REMOVE_LEVEL_TEXT, "Do you really want remove level?");
addText(RU, TEXT_MSG_REMOVE_LEVEL_TEXT, "Действительно хотите удалить уровень?");
addTextForAllLang(TEXT_MSG_CANT_SOLVE_EDIT_LEVEL_TITLE, "Attention!");
addText(RU, TEXT_MSG_CANT_SOLVE_EDIT_LEVEL_TITLE, "Внимание");
addText(UA, TEXT_MSG_CANT_SOLVE_EDIT_LEVEL_TITLE, "Увага");
addTextForAllLang(TEXT_MSG_CANT_SOLVE_EDIT_LEVEL_TEXT, "Сan't Solve Edit Level");
addText(RU, TEXT_MSG_CANT_SOLVE_EDIT_LEVEL_TEXT, "Нет возможнсоти пройти данный уровень");
}
protected function addTextForAllLang(_arg1:uint, _arg2:String):void{
m_arTextForAllLang.push({id:_arg1, text:_arg2});
}
protected function addText(_arg1:String, _arg2:uint, _arg3:String):void{
if (getText(_arg2, _arg1, true) == null){
if (_arg1 != null){
m_arTextForLang.push({lang:_arg1, id:_arg2, text:_arg3});
} else {
addTextForAllLang(_arg2, _arg3);
};
} else {
trace("!!!!!!!!!!!!!!!!!!!!!!");
trace("TLang.addText");
trace(("strLang=" + _arg1));
trace(("idLabel=" + _arg2));
trace("такой лейбл уже есть");
trace("!!!!!!!!!!!!!!!!!!!!!!");
};
}
public function getCurrentLang():String{
return (m_strCurLang);
}
public static function getInstance():TLang{
if (TLang._instance == null){
TLang._instance = new (TLang);
};
return (TLang._instance);
}
public static function getLangByCountry(_arg1:uint):String{
var _local2:Object;
for each (_local2 in COUNTRY_TO_LANG) {
if (_local2.country == _arg1){
return (_local2.lang);
};
};
return (null);
}
}
}//package com
Section 27
//TSimpleCheckit (com.TSimpleCheckit)
package com {
import flash.display.*;
import flash.events.*;
public class TSimpleCheckit extends MovieClip {
private var m_bOver:Boolean;// = false
private var m_bSelected:Boolean;// = false
public static const ON_SELECT:String = "onSelect";
public function TSimpleCheckit(){
m_bSelected = false;
m_bOver = false;
super();
stop();
addEventListener(MouseEvent.MOUSE_OVER, listenOver, false, 0, true);
addEventListener(MouseEvent.MOUSE_DOWN, listenDown, false, 0, true);
addEventListener(MouseEvent.MOUSE_UP, listenUp, false, 0, true);
addEventListener(MouseEvent.MOUSE_OUT, listenOut, false, 0, true);
}
private function listenDown(_arg1:MouseEvent):void{
if (m_bSelected){
gotoAndStop("on_down");
} else {
gotoAndStop("off_down");
};
}
private function listenOut(_arg1:MouseEvent):void{
m_bOver = false;
updateView();
}
private function updateView():void{
if (m_bSelected){
if (m_bOver){
gotoAndStop("on_over");
} else {
gotoAndStop("on_out");
};
} else {
if (m_bOver){
gotoAndStop("off_over");
} else {
gotoAndStop("off_out");
};
};
}
public function set selected(_arg1:Boolean):void{
m_bSelected = _arg1;
updateView();
}
private function listenOver(_arg1:MouseEvent):void{
m_bOver = true;
updateView();
}
public function get selected():Boolean{
return (m_bSelected);
}
public function onSelect(_arg1:Boolean):void{
m_bSelected = _arg1;
dispatchEvent(new Event(ON_SELECT));
}
private function listenUp(_arg1:MouseEvent):void{
if (m_bSelected){
onSelect(false);
} else {
onSelect(true);
};
_arg1.stopPropagation();
updateView();
}
}
}//package com
Section 28
//AddingBeforeLevelCommand (editor.controller.AddingBeforeLevelCommand)
package editor.controller {
import game.model.*;
import org.puremvc.as3.interfaces.*;
import org.puremvc.as3.patterns.command.*;
public class AddingBeforeLevelCommand extends SimpleCommand implements ICommand {
override public function execute(_arg1:INotification):void{
var _local2:LevelProxy;
var _local3:LevelsProxy;
trace("AddingLevelCommand public function execute( note:INotification ) : void");
_local2 = (_arg1.getBody() as LevelProxy);
trace(("pLevelBefore=" + _local2));
if (_local2 != null){
_local3 = _local2.parent;
if (_local3 != null){
_local3.insertItemBefore(_local2);
};
} else {
_local3 = (_arg1.getBody() as LevelsProxy);
if (_local3 != null){
_local3.insertItemBefore(null);
};
};
}
}
}//package editor.controller
Section 29
//GotoMenuCommand (editor.controller.GotoMenuCommand)
package editor.controller {
import org.puremvc.as3.interfaces.*;
import main.*;
import main.controller.*;
import org.puremvc.as3.patterns.command.*;
import main.model.*;
public class GotoMenuCommand extends SimpleCommand implements ICommand {
override public function execute(_arg1:INotification):void{
trace("GotoMenuCommand public function execute( note:INotification ) : void");
sendNotification(ApplicationFacade.CHANGE_PAGE, new PageCommandStruct(PagesProxy.PAGE_MENU));
}
}
}//package editor.controller
Section 30
//LevelUseTemplate_Empty (editor.controller.LevelUseTemplate_Empty)
package editor.controller {
import game.model.*;
import org.puremvc.as3.interfaces.*;
import org.puremvc.as3.patterns.command.*;
public class LevelUseTemplate_Empty extends SimpleCommand implements ICommand {
override public function execute(_arg1:INotification):void{
var _local2:LevelProxy;
trace("LevelUseTemplate_Empty public function execute( note:INotification ) : void");
_local2 = (_arg1.getBody() as LevelProxy);
if (_local2 != null){
_local2.useTemplate_Empty();
};
}
}
}//package editor.controller
Section 31
//LevelUseTemplate_FillFloor_Ground (editor.controller.LevelUseTemplate_FillFloor_Ground)
package editor.controller {
import game.model.*;
import org.puremvc.as3.interfaces.*;
import org.puremvc.as3.patterns.command.*;
public class LevelUseTemplate_FillFloor_Ground extends SimpleCommand implements ICommand {
override public function execute(_arg1:INotification):void{
var _local2:LevelProxy;
trace("LevelUseTemplate_FillFloor_Ground public function execute( note:INotification ) : void");
_local2 = (_arg1.getBody() as LevelProxy);
if (_local2 != null){
_local2.useTemplate_FillFloor_Ground();
};
}
}
}//package editor.controller
Section 32
//LevelUseTemplate_FillFloor_Ground_Rand (editor.controller.LevelUseTemplate_FillFloor_Ground_Rand)
package editor.controller {
import game.model.*;
import org.puremvc.as3.interfaces.*;
import org.puremvc.as3.patterns.command.*;
public class LevelUseTemplate_FillFloor_Ground_Rand extends SimpleCommand implements ICommand {
override public function execute(_arg1:INotification):void{
var _local2:LevelProxy;
trace("LevelUseTemplate_FillFloor_Ground_Rand!");
_local2 = (_arg1.getBody() as LevelProxy);
if (_local2 != null){
_local2.useTemplate_FillFloor_Ground_Rand();
};
}
}
}//package editor.controller
Section 33
//LevelUseTemplate_FillFloor_TileDark (editor.controller.LevelUseTemplate_FillFloor_TileDark)
package editor.controller {
import game.model.*;
import org.puremvc.as3.interfaces.*;
import org.puremvc.as3.patterns.command.*;
public class LevelUseTemplate_FillFloor_TileDark extends SimpleCommand implements ICommand {
override public function execute(_arg1:INotification):void{
var _local2:LevelProxy;
trace("LevelUseTemplate_FillFloor_TileDark public function execute( note:INotification ) : void");
_local2 = (_arg1.getBody() as LevelProxy);
if (_local2 != null){
_local2.useTemplate_FillFloor_TileDark();
};
}
}
}//package editor.controller
Section 34
//LevelUseTemplate_FillFloor_TileLight (editor.controller.LevelUseTemplate_FillFloor_TileLight)
package editor.controller {
import game.model.*;
import org.puremvc.as3.interfaces.*;
import org.puremvc.as3.patterns.command.*;
public class LevelUseTemplate_FillFloor_TileLight extends SimpleCommand implements ICommand {
override public function execute(_arg1:INotification):void{
var _local2:LevelProxy;
trace("LevelUseTemplate_FillFloor_TileLight public function execute( note:INotification ) : void");
_local2 = (_arg1.getBody() as LevelProxy);
if (_local2 != null){
_local2.useTemplate_FillFloor_TileLight();
};
}
}
}//package editor.controller
Section 35
//LevelUseTemplate_WallBox (editor.controller.LevelUseTemplate_WallBox)
package editor.controller {
import game.model.*;
import org.puremvc.as3.interfaces.*;
import org.puremvc.as3.patterns.command.*;
public class LevelUseTemplate_WallBox extends SimpleCommand implements ICommand {
override public function execute(_arg1:INotification):void{
var _local2:LevelProxy;
trace("LevelUseTemplate_WallBox public function execute( note:INotification ) : void");
_local2 = (_arg1.getBody() as LevelProxy);
if (_local2 != null){
_local2.useTemplate_WallBox();
};
}
}
}//package editor.controller
Section 36
//LoadingLevelCommand (editor.controller.LoadingLevelCommand)
package editor.controller {
import game.model.*;
import org.puremvc.as3.interfaces.*;
import main.*;
import editor.model.*;
import org.puremvc.as3.patterns.command.*;
public class LoadingLevelCommand extends SimpleCommand implements ICommand {
override public function execute(_arg1:INotification):void{
var _local2:String;
var _local3:LevelsProxy;
var _local4:LoadingLevelsCommandStruct;
var _local5:LevelProxy;
var _local6:GameProxy;
var _local7:EditorProxy;
_local4 = (_arg1.getBody() as LoadingLevelsCommandStruct);
_local2 = _local4.m_strText;
_local3 = _local4.m_pLevels;
if (Global_Settings.COMPRESS_SAVE_LOAD){
_local5 = LevelProxy.parseXMLStringCompressed(_local2, _local3);
} else {
_local5 = LevelProxy.parseXMLString(_local2, _local3);
};
if (((!((_local5 == null))) && (!((_local3 == null))))){
_local3.addItem(_local5);
sendNotification(ApplicationFacade.LEVEL_LOAD, _local5);
_local6 = (facade.retrieveProxy(GameProxy.NAME) as GameProxy);
if (_local6 != null){
};
_local7 = (facade.retrieveProxy(EditorProxy.NAME) as EditorProxy);
if (_local7 != null){
};
} else {
sendNotification(ApplicationFacade.LEVEL_LOAD, null);
};
}
}
}//package editor.controller
Section 37
//LoadingLevelsCommand (editor.controller.LoadingLevelsCommand)
package editor.controller {
import game.model.*;
import org.puremvc.as3.interfaces.*;
import main.*;
import editor.model.*;
import org.puremvc.as3.patterns.command.*;
public class LoadingLevelsCommand extends SimpleCommand implements ICommand {
override public function execute(_arg1:INotification):void{
var _local2:String;
var _local3:LevelsProxy;
var _local4:LoadingLevelsCommandStruct;
var _local5:LevelsProxy;
var _local6:GameProxy;
var _local7:EditorProxy;
trace("@");
trace("LoadingLevelsCommand public function execute( note:INotification ) : void");
_local4 = (_arg1.getBody() as LoadingLevelsCommandStruct);
_local2 = _local4.m_strText;
_local3 = _local4.m_pLevels;
if (Global_Settings.COMPRESS_SAVE_LOAD){
_local5 = LevelsProxy.parseXMLStringCompressed(_local2, _local3);
} else {
_local5 = LevelsProxy.parseXMLString(_local2, _local3);
};
trace(("pLevels=" + _local5));
if (_local5 != null){
if (_local3 != null){
trace("убираем старые уровни");
facade.removeProxy(_local3.getProxyName());
};
facade.registerProxy(_local5);
trace("before sendNotification(ApplicationFacade.LEVELS_LOAD, pLevels);");
sendNotification(ApplicationFacade.LEVELS_LOAD, _local5);
trace("after sendNotification(ApplicationFacade.LEVELS_LOAD, pLevels);");
trace(("pLevels.length=" + _local5.length));
if (_local5.length > 0){
_local5.select = _local5.getItem(0);
};
_local6 = (facade.retrieveProxy(GameProxy.NAME) as GameProxy);
if (_local6 != null){
};
_local7 = (facade.retrieveProxy(EditorProxy.NAME) as EditorProxy);
if (_local7 != null){
_local7.levelsProxy = _local5;
};
} else {
sendNotification(ApplicationFacade.LEVELS_LOAD, null);
};
}
}
}//package editor.controller
Section 38
//LoadingLevelsCommandStruct (editor.controller.LoadingLevelsCommandStruct)
package editor.controller {
import game.model.*;
public class LoadingLevelsCommandStruct {
public var m_strText:String;
public var m_pLevels:LevelsProxy;
public function LoadingLevelsCommandStruct(_arg1:LevelsProxy, _arg2:String){
m_pLevels = _arg1;
m_strText = _arg2;
}
}
}//package editor.controller
Section 39
//RemovingLevelCommand (editor.controller.RemovingLevelCommand)
package editor.controller {
import game.model.*;
import org.puremvc.as3.interfaces.*;
import org.puremvc.as3.patterns.command.*;
public class RemovingLevelCommand extends SimpleCommand implements ICommand {
override public function execute(_arg1:INotification):void{
var _local2:LevelProxy;
var _local3:LevelsProxy;
trace("RemovingLevelCommand public function execute( note:INotification ) : void");
_local2 = (_arg1.getBody() as LevelProxy);
if (_local2 != null){
_local3 = _local2.parent;
_local3.removeItem(_local2);
};
}
}
}//package editor.controller
Section 40
//SelectingElementCommand (editor.controller.SelectingElementCommand)
package editor.controller {
import org.puremvc.as3.interfaces.*;
import editor.model.*;
import org.puremvc.as3.patterns.command.*;
public class SelectingElementCommand extends SimpleCommand implements ICommand {
override public function execute(_arg1:INotification):void{
var _local2:ElementProxy;
var _local3:ElementsProxy;
var _local4:EditorProxy;
_local2 = (_arg1.getBody() as ElementProxy);
_local3 = (facade.retrieveProxy(ElementsProxy.NAME) as ElementsProxy);
if (_local3 != null){
_local3.select = _local2;
};
if (_local2 != null){
_local4 = (facade.retrieveProxy(EditorProxy.NAME) as EditorProxy);
if (_local4 != null){
_local4.doubleInterpret = _local2.m_nDoubleInterpret;
_local4.moveByX = _local2.m_nMoveByX;
_local4.moveByY = _local2.m_nMoveByY;
_local4.activeLayerID = _local2.m_nIDLayer;
_local4.activeValue = _local2.m_id;
};
};
}
}
}//package editor.controller
Section 41
//SelectingLevelCommand (editor.controller.SelectingLevelCommand)
package editor.controller {
import game.model.*;
import org.puremvc.as3.interfaces.*;
import org.puremvc.as3.patterns.command.*;
public class SelectingLevelCommand extends SimpleCommand implements ICommand {
override public function execute(_arg1:INotification):void{
var _local2:LevelProxy;
var _local3:LevelsProxy;
_local2 = (_arg1.getBody() as LevelProxy);
if (_local2 != null){
_local3 = _local2.parent;
if (_local3 != null){
_local3.select = _local2;
};
} else {
_local3 = (_arg1.getBody() as LevelsProxy);
if (_local3 != null){
_local3.select = null;
};
};
}
}
}//package editor.controller
Section 42
//SelectPosCommand (editor.controller.SelectPosCommand)
package editor.controller {
import org.puremvc.as3.interfaces.*;
import editor.model.*;
import org.puremvc.as3.patterns.command.*;
public class SelectPosCommand extends SimpleCommand implements ICommand {
override public function execute(_arg1:INotification):void{
var _local2:EventSelectPos;
var _local3:EditorProxy;
_local2 = (_arg1.getBody() as EventSelectPos);
_local3 = (facade.retrieveProxy(EditorProxy.NAME) as EditorProxy);
_local3.selectPos(_local2);
}
}
}//package editor.controller
Section 43
//EditorProxy (editor.model.EditorProxy)
package editor.model {
import game.model.*;
import org.puremvc.as3.interfaces.*;
import com.*;
import main.*;
import org.puremvc.as3.patterns.proxy.*;
public class EditorProxy extends Proxy implements IProxy {
private var m_nDoubleInterpret:int;// = -1
private var m_nMoveByX:int;// = 0
private var m_nMoveByY:int;// = 0
var m_pLevels:LevelsProxy;
var m_nActiveLayer:int;// = -1
var m_pElements:ElementsProxy;
var m_nActiveValue:int;// = -1
var m_nActiveValue_Invert:int;// = -1
var m_bDrawInvert:Boolean;// = false
public static const NAME:String = "EditorProxy";
public function EditorProxy(_arg1:LevelsProxy){
m_nActiveLayer = CommonFunc.INT_UNDEF;
m_bDrawInvert = false;
m_nActiveValue = CommonFunc.INT_UNDEF;
m_nActiveValue_Invert = CommonFunc.INT_UNDEF;
m_nDoubleInterpret = ElementProxy.FOR_DOUBLE_UNDEF;
m_nMoveByX = 0;
m_nMoveByY = 0;
super(NAME, Number(0));
m_pLevels = _arg1;
m_pElements = new ElementsProxy();
facade.registerProxy(m_pElements);
activeLayerID = LevelProxy.LAYER_ID_GROUND;
activeValue = -1;
m_nActiveValue_Invert = 0;
}
public function set activeLayerID(_arg1:int):void{
m_nActiveLayer = _arg1;
sendNotification(ApplicationFacade.CHANGE_ACTIVE_LAYER, _arg1);
}
public function set activeValue(_arg1:int):void{
m_nActiveValue = _arg1;
}
public function getLevelByID(_arg1:int):LevelProxy{
return (levelsProxy.getItemByID(_arg1));
}
private function get doubleInterpret():int{
return (m_nDoubleInterpret);
}
public function get levelsProxy():LevelsProxy{
return (m_pLevels);
}
public function set moveByX(_arg1:int):void{
if (m_nMoveByX != _arg1){
m_nMoveByX = _arg1;
sendNotification(ApplicationFacade.CHANGE_MOVEBYX, _arg1);
};
}
public function set moveByY(_arg1:int):void{
if (m_nMoveByY != _arg1){
m_nMoveByY = _arg1;
sendNotification(ApplicationFacade.CHANGE_MOVEBYY, _arg1);
};
}
public function get activeLayerID():int{
return (m_nActiveLayer);
}
public function selectPos(_arg1:EventSelectPos):void{
var _local2:LevelProxy;
var _local3:LayerProxy;
var _local4:IntPoint;
var _local5:int;
_local2 = levelProxy;
_local3 = activeLayer;
_local4 = _arg1.m_point;
if (_local3 != null){
if (_local4 != null){
};
if (_arg1.m_bStart){
if (m_nActiveValue != CommonFunc.INT_UNDEF){
_local5 = _local3.getValue(_local4);
if (m_nActiveValue == _local5){
m_bDrawInvert = true;
} else {
m_bDrawInvert = false;
};
} else {
m_bDrawInvert = _local3.isThere(_local4);
};
};
_local2.lock();
if (m_bDrawInvert){
_local3.setValue(_local4, m_nActiveValue_Invert);
} else {
_local3.setValue(_local4, m_nActiveValue);
};
_local2.unlock();
};
}
public function get moveByX():int{
return (m_nMoveByX);
}
public function get levelProxy():LevelProxy{
var _local1:LevelsProxy;
_local1 = levelsProxy;
if (_local1 != null){
return (_local1.select);
};
return (null);
}
public function set activeLayer(_arg1:LayerProxy):void{
activeLayerID = _arg1.id;
}
public function get moveByY():int{
return (m_nMoveByY);
}
public function get selectLevel():LevelProxy{
var _local1:LevelsProxy;
_local1 = levelsProxy;
if (_local1 != null){
return (_local1.select);
};
return (null);
}
public function get activeLayer():LayerProxy{
var _local1:LevelProxy;
_local1 = levelProxy;
if (_local1 != null){
return (_local1.getLayerByID(m_nActiveLayer));
};
return (null);
}
public function set doubleInterpret(_arg1:int):void{
if (m_nDoubleInterpret != _arg1){
m_nDoubleInterpret = _arg1;
sendNotification(ApplicationFacade.CHANGE_DOUBLE_INTERPRET, _arg1);
};
}
public function set levelsProxy(_arg1:LevelsProxy):void{
m_pLevels = _arg1;
}
}
}//package editor.model
Section 44
//ElementProxy (editor.model.ElementProxy)
package editor.model {
import org.puremvc.as3.interfaces.*;
import main.*;
import org.puremvc.as3.patterns.proxy.*;
public class ElementProxy extends Proxy implements IProxy {
public var m_nDoubleInterpret:int;// = 0
public var m_nIDElement:int;
private var m_arCollection:Array;
public var m_nMoveByY:int;// = 0
public var m_nIDLayer:int;
public var m_id:int;
public var m_nMoveByX:int;// = 0
public var m_strName:String;
private var m_pSelectElement:ElementProxy;
public static const FOR_DOUBLE_CELL:int = 0;
public static const FOR_DOUBLE_ODD_X_EVEN_Y:int = 3;
public static const NAME:String = "ElementProxy";
public static const FOR_DOUBLE_DIAGONAL:int = 1;
public static const FOR_DOUBLE_ODD:int = 2;
public static const FOR_DOUBLE_UNDEF:int = -1;
public function ElementProxy(_arg1:int=-1, _arg2:int=-1, _arg3:int=-1, _arg4:String="", _arg5:int=-1, _arg6:int=0, _arg7:int=0){
m_nDoubleInterpret = FOR_DOUBLE_CELL;
m_nMoveByX = 0;
m_nMoveByY = 0;
m_arCollection = new Array();
m_id = _arg1;
m_nIDLayer = _arg2;
m_nIDElement = _arg3;
m_strName = _arg4;
m_nDoubleInterpret = _arg5;
m_nMoveByX = _arg6;
m_nMoveByY = _arg7;
super(((((((NAME + "_") + _arg1) + "_") + _arg2) + "_") + _arg3));
}
public function getElement(_arg1:int):ElementProxy{
if ((((_arg1 >= 0)) && ((_arg1 < m_arCollection.length)))){
return (m_arCollection[_arg1]);
};
return (null);
}
public function get count():int{
return (m_arCollection.length);
}
public function get select():ElementProxy{
return (m_pSelectElement);
}
public function set select(_arg1:ElementProxy):void{
if (m_pSelectElement != null){
sendNotification(ApplicationFacade.ELEMENT_UNSELECTED, m_pSelectElement);
};
m_pSelectElement = _arg1;
sendNotification(ApplicationFacade.ELEMENT_SELECTED, m_pSelectElement);
}
public function addElement(_arg1:ElementProxy):Boolean{
if (_arg1 == null){
return (false);
};
if (m_pSelectElement == null){
m_pSelectElement = _arg1;
};
m_arCollection.push(_arg1);
return (true);
}
}
}//package editor.model
Section 45
//ElementsProxy (editor.model.ElementsProxy)
package editor.model {
import game.model.*;
import org.puremvc.as3.interfaces.*;
import com.*;
import main.*;
import game.view.*;
import org.puremvc.as3.patterns.proxy.*;
public class ElementsProxy extends Proxy implements IProxy {
private var m_pLevel:LevelProxy;
private var m_arCollection:Array;
private var m_pSelectElement:ElementProxy;
public static const NAME:String = "ElementsProxy";
public function ElementsProxy(){
m_arCollection = new Array();
super(NAME);
trace("CONSTRUCTOR public function ElementsProxy() ");
init();
}
public function getElement(_arg1:int):ElementProxy{
if ((((_arg1 >= 0)) && ((_arg1 < m_arCollection.length)))){
return (m_arCollection[_arg1]);
};
return (null);
}
private function init():void{
var _local1:ElementProxy;
var _local2:ElementProxy;
m_arCollection = new Array();
_local2 = new ElementProxy(Sprites.SPR_ID_FLOOR_GROUND_DARK, LevelProxy.LAYER_ID_GROUND, Sprites.ICON_ID_FLOOR_GROUND_DARK, TLang.getInstance().getText(TLang.TEXT_FLOOR));
_local1 = new ElementProxy(Sprites.SPR_ID_FLOOR_GROUND_DARK, LevelProxy.LAYER_ID_GROUND, Sprites.ICON_ID_FLOOR_GROUND_DARK, TLang.getInstance().getText(TLang.TEXT_FLOOR));
_local2.addElement(_local1);
_local2.addElement(new ElementProxy(Sprites.SPR_ID_FLOOR_GROUND_LIGHT, LevelProxy.LAYER_ID_GROUND, Sprites.ICON_ID_FLOOR_GROUND_LIGHT, TLang.getInstance().getText(TLang.TEXT_FLOOR)));
_local2.addElement(new ElementProxy(Sprites.SPR_ID_FLOOR_TILE_LIGHT, LevelProxy.LAYER_ID_GROUND, Sprites.ICON_ID_FLOOR_TILE_LIGHT, TLang.getInstance().getText(TLang.TEXT_TILE)));
_local2.addElement(new ElementProxy(Sprites.SPR_ID_FLOOR_TILE_DARK, LevelProxy.LAYER_ID_GROUND, Sprites.ICON_ID_FLOOR_TILE_DARK, TLang.getInstance().getText(TLang.TEXT_TILE)));
m_arCollection.push(_local2);
_local2 = new ElementProxy(Sprites.SPR_ID_TRAP_KEY_BLUE, LevelProxy.LAYER_ID_GROUND_TRAPS, Sprites.ICON_ID_TRAP_KEY_BLUE, TLang.getInstance().getText(TLang.TEXT_KEY_BLUE));
_local2.addElement(new ElementProxy(Sprites.SPR_ID_TRAP_KEY_BLUE, LevelProxy.LAYER_ID_GROUND_TRAPS, Sprites.ICON_ID_TRAP_KEY_BLUE, TLang.getInstance().getText(TLang.TEXT_KEY_BLUE)));
_local2.addElement(new ElementProxy(Sprites.SPR_ID_TRAP_KEY_GREEN, LevelProxy.LAYER_ID_GROUND_TRAPS, Sprites.ICON_ID_TRAP_KEY_GREEN, TLang.getInstance().getText(TLang.TEXT_KEY_GREEN)));
_local2.addElement(new ElementProxy(Sprites.SPR_ID_TRAP_KEY_RED, LevelProxy.LAYER_ID_GROUND_TRAPS, Sprites.ICON_ID_TRAP_KEY_RED, TLang.getInstance().getText(TLang.TEXT_KEY_RED)));
_local2.addElement(new ElementProxy(Sprites.SPR_ID_TRAP_SHARP_BLUE, LevelProxy.LAYER_ID_GROUND_TRAPS, Sprites.ICON_ID_TRAP_SHARP_BLUE, TLang.getInstance().getText(TLang.TEXT_SHARP_BLUE)));
_local2.addElement(new ElementProxy(Sprites.SPR_ID_TRAP_SHARP_RED, LevelProxy.LAYER_ID_GROUND_TRAPS, Sprites.ICON_ID_TRAP_SHARP_RED, TLang.getInstance().getText(TLang.TEXT_SHARP_RED)));
_local2.addElement(new ElementProxy(Sprites.SPR_ID_TRAP_SHARP_GREEN, LevelProxy.LAYER_ID_GROUND_TRAPS, Sprites.ICON_ID_TRAP_SHARP_GREEN, TLang.getInstance().getText(TLang.TEXT_SHARP_GREEN)));
m_arCollection.push(_local2);
_local2 = new ElementProxy(Sprites.SPR_ID_LABYRINTH_STAIRWAY_RIGHT, LevelProxy.LAYER_ID_LABYRINTH, Sprites.ICON_ID_LABYRINTH_STAIRWAY_RIGHT, TLang.getInstance().getText(TLang.TEXT_STAIRWAY), ElementProxy.FOR_DOUBLE_ODD);
_local2.addElement(new ElementProxy(Sprites.SPR_ID_LABYRINTH_STAIRWAY_RIGHT, LevelProxy.LAYER_ID_LABYRINTH, Sprites.ICON_ID_LABYRINTH_STAIRWAY_RIGHT, TLang.getInstance().getText(TLang.TEXT_STAIRWAY), ElementProxy.FOR_DOUBLE_ODD));
_local2.addElement(new ElementProxy(Sprites.SPR_ID_LABYRINTH_STAIRWAY_UP, LevelProxy.LAYER_ID_LABYRINTH, Sprites.ICON_ID_LABYRINTH_STAIRWAY_UP, TLang.getInstance().getText(TLang.TEXT_STAIRWAY), ElementProxy.FOR_DOUBLE_ODD));
_local2.addElement(new ElementProxy(Sprites.SPR_ID_LABYRINTH_STAIRWAY_LEFT, LevelProxy.LAYER_ID_LABYRINTH, Sprites.ICON_ID_LABYRINTH_STAIRWAY_LEFT, TLang.getInstance().getText(TLang.TEXT_STAIRWAY), ElementProxy.FOR_DOUBLE_ODD));
m_arCollection.push(_local2);
_local2 = new ElementProxy(Sprites.SPR_ID_DEF, LevelProxy.LAYER_ID_LABYRINTH, Sprites.ICON_ID_LABYRINTH, TLang.getInstance().getText(TLang.TEXT_WALL), ElementProxy.FOR_DOUBLE_DIAGONAL);
_local2.addElement(new ElementProxy(Sprites.SPR_ID_DEF, LevelProxy.LAYER_ID_LABYRINTH, Sprites.ICON_ID_LABYRINTH, TLang.getInstance().getText(TLang.TEXT_WALL), ElementProxy.FOR_DOUBLE_DIAGONAL));
_local2.addElement(new ElementProxy(Sprites.SPR_ID_LABYRINTH_WALL_H_FENCE, LevelProxy.LAYER_ID_LABYRINTH, Sprites.ICON_ID_LABYRINTH_WALL_H_FENCE, TLang.getInstance().getText(TLang.TEXT_GATE), ElementProxy.FOR_DOUBLE_ODD_X_EVEN_Y, 0, 2));
m_arCollection.push(_local2);
_local2 = new ElementProxy(Sprites.SPR_ID_LABYRINTH_ITEM_ENSIGN_00, LevelProxy.LAYER_ID_LABYRINTH_ITEMS, Sprites.ICON_ID_LABYRINTH_ITEM_ENSIGN_00, TLang.getInstance().getText(TLang.TEXT_FLAG));
_local2.addElement(new ElementProxy(Sprites.SPR_ID_LABYRINTH_ITEM_ENSIGN_00, LevelProxy.LAYER_ID_LABYRINTH_ITEMS, Sprites.ICON_ID_LABYRINTH_ITEM_ENSIGN_00, TLang.getInstance().getText(TLang.TEXT_FLAG), ElementProxy.FOR_DOUBLE_UNDEF, 0, 1));
_local2.addElement(new ElementProxy(Sprites.SPR_ID_LABYRINTH_ITEM_ENSIGN_BOW, LevelProxy.LAYER_ID_LABYRINTH_ITEMS, Sprites.ICON_ID_LABYRINTH_ITEM_ENSIGN_BOW, TLang.getInstance().getText(TLang.TEXT_FLAG), ElementProxy.FOR_DOUBLE_UNDEF, 0, 1));
_local2.addElement(new ElementProxy(Sprites.SPR_ID_LABYRINTH_ITEM_ENSIGN_TOWER, LevelProxy.LAYER_ID_LABYRINTH_ITEMS, Sprites.ICON_ID_LABYRINTH_ITEM_ENSIGN_TOWER, TLang.getInstance().getText(TLang.TEXT_FLAG), ElementProxy.FOR_DOUBLE_UNDEF, 0, 1));
_local2.addElement(new ElementProxy(Sprites.SPR_ID_LABYRINTH_ITEM_HORNS, LevelProxy.LAYER_ID_LABYRINTH_ITEMS, Sprites.ICON_ID_LABYRINTH_ITEM_HORNS, TLang.getInstance().getText(TLang.TEXT_HORNS), ElementProxy.FOR_DOUBLE_UNDEF, 0, 1));
_local2.addElement(new ElementProxy(Sprites.SPR_ID_LABYRINTH_ITEM_SHIELD_RED, LevelProxy.LAYER_ID_LABYRINTH_ITEMS, Sprites.ICON_ID_LABYRINTH_ITEM_SHIELD_RED, TLang.getInstance().getText(TLang.TEXT_SHIELD), ElementProxy.FOR_DOUBLE_UNDEF, 0, 1));
_local2.addElement(new ElementProxy(Sprites.SPR_ID_LABYRINTH_ITEM_SHIELD_GREEN, LevelProxy.LAYER_ID_LABYRINTH_ITEMS, Sprites.ICON_ID_LABYRINTH_ITEM_SHIELD_GREEN, TLang.getInstance().getText(TLang.TEXT_SHIELD), ElementProxy.FOR_DOUBLE_UNDEF, 0, 1));
_local2.addElement(new ElementProxy(Sprites.SPR_ID_LABYRINTH_ITEM_SHIELD_BLACK_N_WHITE, LevelProxy.LAYER_ID_LABYRINTH_ITEMS, Sprites.ICON_ID_LABYRINTH_ITEM_SHIELD_BLACK_N_WHITE, TLang.getInstance().getText(TLang.TEXT_SHIELD), ElementProxy.FOR_DOUBLE_UNDEF, 0, 1));
_local2.addElement(new ElementProxy(Sprites.SPR_ID_LABYRINTH_ITEM_TORCH, LevelProxy.LAYER_ID_LABYRINTH_ANIMATION, Sprites.ICON_ID_LABYRINTH_ITEM_TORCH, TLang.getInstance().getText(TLang.TEXT_TORCH), ElementProxy.FOR_DOUBLE_UNDEF, 0, 1));
m_arCollection.push(_local2);
_local2 = new ElementProxy(Sprites.SPR_ID_DEF, LevelProxy.LAYER_ID_WATER, Sprites.ICON_ID_WATER, TLang.getInstance().getText(TLang.TEXT_WATER));
_local2.addElement(new ElementProxy(Sprites.SPR_ID_DEF, LevelProxy.LAYER_ID_WATER, Sprites.ICON_ID_WATER, TLang.getInstance().getText(TLang.TEXT_WATER)));
_local2.addElement(new ElementProxy(Sprites.SPR_ID_WATER_BUBBLES, LevelProxy.LAYER_ID_WATER_ANIMATION, Sprites.ICON_ID_BUBBLE, TLang.getInstance().getText(TLang.TEXT_WATER_BUBBLES)));
_local2.addElement(new ElementProxy(Sprites.SPR_ID_RAFT, LevelProxy.LAYER_ID_SWIM, Sprites.ICON_ID_RAFT, TLang.getInstance().getText(TLang.TEXT_RAFT)));
m_arCollection.push(_local2);
_local2 = new ElementProxy(Sprites.SPR_ID_ITEM_FIRE, LevelProxy.LAYER_ID_OBJECTS, Sprites.ICON_ID_ITEM_FIRE, TLang.getInstance().getText(TLang.TEXT_FIRE));
_local2.addElement(new ElementProxy(Sprites.SPR_ID_ITEM_FIRE, LevelProxy.LAYER_ID_OBJECTS, Sprites.ICON_ID_ITEM_FIRE, TLang.getInstance().getText(TLang.TEXT_FIRE)));
_local2.addElement(new ElementProxy(Sprites.SPR_ID_ITEM_VASE, LevelProxy.LAYER_ID_OBJECTS, Sprites.ICON_ID_ITEM_VASE, TLang.getInstance().getText(TLang.TEXT_VASE)));
_local2.addElement(new ElementProxy(Sprites.SPR_ID_ITEM_BOX, LevelProxy.LAYER_ID_OBJECTS, Sprites.ICON_ID_ITEM_BOX, TLang.getInstance().getText(TLang.TEXT_BOX)));
_local2.addElement(new ElementProxy(Sprites.SPR_ID_ITEM_CANDLESTICK, LevelProxy.LAYER_ID_OBJECTS, Sprites.ICON_ID_ITEM_CANDLESTICK, TLang.getInstance().getText(TLang.TEXT_CANDLESTICK)));
m_arCollection.push(_local2);
_local2 = new ElementProxy(Sprites.SPR_ID_CHARACTER_HERO, LevelProxy.LAYER_ID_CHARACTERS, Sprites.ICON_ID_CHARACTER_HERO, TLang.getInstance().getText(TLang.TEXT_HERO));
_local2.addElement(new ElementProxy(Sprites.SPR_ID_CHARACTER_HERO, LevelProxy.LAYER_ID_CHARACTERS, Sprites.ICON_ID_CHARACTER_HERO, TLang.getInstance().getText(TLang.TEXT_HERO)));
_local2.addElement(new ElementProxy(Sprites.SPR_ID_CHARACTER_GHOST, LevelProxy.LAYER_ID_CHARACTERS, Sprites.ICON_ID_CHARACTER_GHOST, TLang.getInstance().getText(TLang.TEXT_GHOST)));
_local2.addElement(new ElementProxy(Sprites.SPR_ID_CHARACTER_KNIGHT, LevelProxy.LAYER_ID_CHARACTERS, Sprites.ICON_ID_CHARACTER_KNIGHT, TLang.getInstance().getText(TLang.TEXT_KNIGHT)));
_local2.addElement(new ElementProxy(Sprites.SPR_ID_CHARACTER_MADAM, LevelProxy.LAYER_ID_CHARACTERS, Sprites.ICON_ID_CHARACTER_MADAM, TLang.getInstance().getText(TLang.TEXT_MADAM)));
m_arCollection.push(_local2);
select = _local1;
}
public function get count():int{
return (m_arCollection.length);
}
public function get selectedElement():ElementProxy{
return (m_pSelectElement);
}
public function get selectedElement_LayerID():int{
if (m_pSelectElement != null){
return (m_pSelectElement.m_nIDLayer);
};
return (CommonFunc.INT_UNDEF);
}
public function set select(_arg1:ElementProxy):void{
if (m_pSelectElement != null){
sendNotification(ApplicationFacade.ELEMENT_UNSELECTED, m_pSelectElement);
};
m_pSelectElement = _arg1;
sendNotification(ApplicationFacade.ELEMENT_SELECTED, m_pSelectElement);
}
}
}//package editor.model
Section 46
//EventSelectPos (editor.model.EventSelectPos)
package editor.model {
import com.*;
public class EventSelectPos {
public var m_bStart:Boolean;
public var m_point:IntPoint;
public function EventSelectPos(_arg1:Boolean, _arg2:IntPoint){
m_bStart = _arg1;
m_point = _arg2;
}
}
}//package editor.model
Section 47
//UI_Editor (editor.view.components.UI_Editor)
package editor.view.components {
import main.view.components.*;
import game.view.components.*;
import main.model.*;
public class UI_Editor extends UI_Page {
public var openWindow_mc:UI_Open_Window;
public var levelsSelector_mc:UI_LevelsSelector;
public var level_mc:UI_Level;
public var saveWindow_mc:UI_Save_Window;
public var level_url_msg_mc:UI_Msg_Level_Url;
public var elementsHolder_mc:UI_Elements_Holder;
public var msgWindow_mc:UI_Msg_Window;
public static const LEVEL_URL_MSG_NAME:String = "level_url_msg_mc";
private static const DEF_PAGE:int = PagesProxy.PAGE_MENU;
public static const NAME:String = "PageEditor";
}
}//package editor.view.components
Section 48
//UI_ElementCollectionSelector (editor.view.components.UI_ElementCollectionSelector)
package editor.view.components {
import flash.display.*;
import flash.utils.*;
import flash.events.*;
import com.*;
import fl.transitions.*;
import fl.motion.easing.*;
public class UI_ElementCollectionSelector extends MovieClip {
private var m_timer:Timer;
private var m_arElementsTween:Array;
private var m_arElement:Array;
private var m_nHeight_Normal:int;
private var m_nHeadHeight:int;// = 32
private var m_uiBevel:Shape;
private var m_uiHead:UI_ElementSelector;
private var m_bCheckitAlignRight:Boolean;// = false
private var m_bShowAfter:Boolean;// = true
private var m_bShowed:Boolean;// = false
private var m_nFullHeight:int;
public var open_btn:Btn_Show_Elements;
private static const OFFSET_WIDTH:int = 2;
private static const OFFSET_TOP:int = 32;
public static const LEFT_INDENT:int = 2;
private static const TIME_FOR_SHOW_ELEMENTS_DIFFERENCE:Number = 0.1;
private static const OFFSET_BEVEL:int = 2;
private static const WAIT_FOR_HIDE:int = 250;
private static const OFFSET_LEFT:int = 32;
private static const BEVEL_LINE_COLOR:int = 0xFFFFFF;
public static const ON_CHANGE_HEIGHT:String = "onChangeHeight";
private static const OFFSET_HEIGHT:int = 2;
private static const BEVEL_FILL_COLOR:int = 0xDDDDDD;
public function UI_ElementCollectionSelector(){
var _local1:TSimpleCheckit;
m_arElement = new Array();
m_bShowed = false;
m_bShowAfter = true;
m_nHeadHeight = OFFSET_TOP;
m_bCheckitAlignRight = false;
super();
_local1 = openBtn;
if (_local1 != null){
_local1.selected = m_bShowed;
_local1.addEventListener(TSimpleCheckit.ON_SELECT, listenOpenBtn, false, 0, true);
};
}
private function listenOpenBtn(_arg1:Event):void{
setShow(!(m_bShowed));
}
private function showElements(_arg1:Boolean):void{
var _local2:int;
var _local3:UI_ElementSelector;
var _local4:Number;
var _local5:int;
_local2 = m_arElement.length;
if (_local2 > 0){
m_arElementsTween = new Array(_local2);
_local4 = (1 / _local2);
_local5 = 0;
while (_local5 < _local2) {
_local3 = m_arElement[_local5];
if (_local3 != null){
addChild(_local3);
if (_arg1){
_local3.setShow(true, ((_local5 + 1) * TIME_FOR_SHOW_ELEMENTS_DIFFERENCE));
} else {
_local3.setShow(false, ((_local2 - _local5) * TIME_FOR_SHOW_ELEMENTS_DIFFERENCE));
};
};
_local5++;
};
_local3 = m_arElement[0];
if (_arg1){
rearrange();
dispatchEvent(new Event(ON_CHANGE_HEIGHT, true, true));
} else {
if (_local3 != null){
_local3.addEventListener(UI_ElementSelector.ON_FADE_OUT, listenOnElementsFadeOut, false, 0, true);
};
};
};
}
public function addElement(_arg1:UI_ElementSelector):Boolean{
var _local2:int;
var _local3:UI_ElementSelector;
var _local4:TSimpleCheckit;
if (_arg1 != null){
_local3 = lastElement;
if (_local3 != null){
_local2 = (_local3.actualHeight + _local3.y);
} else {
if (m_uiHead != null){
_local2 = m_uiHead.headHeight;
} else {
_local2 = m_nHeadHeight;
};
};
if (m_uiHead != null){
};
_arg1.x = OFFSET_LEFT;
if (!m_bCheckitAlignRight){
_local4 = openBtn;
if (_local4 != null){
_arg1.x = ((OFFSET_LEFT + _local4.x) + _local4.width);
};
};
_arg1.y = _local2;
addChild(_arg1);
m_arElement.push(_arg1);
_arg1.visible = false;
m_nFullHeight = (m_nFullHeight + _arg1.actualHeight);
return (true);
};
return (false);
}
private function listenOpenBtnBevelMotionFinish_Show(_arg1:TweenEvent):void{
showElements(true);
}
public function get openBtnWidth():int{
var _local1:TSimpleCheckit;
_local1 = openBtn;
if (_local1 != null){
return ((_local1.x + _local1.width));
};
return (0);
}
public function set headHeight(_arg1:int):void{
m_nHeadHeight = _arg1;
}
public function rearrange():void{
var _local1:int;
var _local2:UI_ElementSelector;
var _local3:int;
var _local4:int;
var _local5:TSimpleCheckit;
var _local6:int;
_local1 = m_arElement.length;
_local3 = m_uiHead.headHeight;
_local4 = 0;
while (_local4 < _local1) {
_local2 = m_arElement[_local4];
if (_local2 != null){
_local2.y = _local3;
_local3 = (_local3 + _local2.actualHeight);
};
_local4++;
};
_local5 = openBtn;
if (_local5 != null){
if (!m_bCheckitAlignRight){
_local5.x = -(_local5.width);
} else {
_local6 = m_uiHead.headWidth;
_local5.x = _local6;
};
};
}
private function listenOpenBtnBevelMotionFinish_Hide(_arg1:TweenEvent):void{
m_uiBevel.visible = false;
}
public function get actualHeight():int{
if (m_bShowed){
return (m_nFullHeight);
};
return (0);
}
public function setShow(_arg1:Boolean):void{
var _local2:TSimpleCheckit;
if (m_bShowed != _arg1){
m_bShowed = _arg1;
_local2 = openBtn;
if (_local2 != null){
_local2.selected = _arg1;
};
if (_arg1){
showElements(true);
} else {
showElements(false);
};
};
}
private function showBevel(_arg1:Boolean):Boolean{
var _local2:Tween;
if (m_uiBevel == null){
if (!drawBevel()){
return (false);
};
};
if (_arg1){
m_uiBevel.visible = true;
if (_local2 != null){
_local2.stop();
};
_local2 = new Tween(m_uiBevel, "height", Elastic.easeOut, m_uiBevel.height, m_nHeight_Normal, 1, true);
_local2.removeEventListener(TweenEvent.MOTION_FINISH, listenOpenBtnBevelMotionFinish_Show, false);
_local2.addEventListener(TweenEvent.MOTION_FINISH, listenOpenBtnBevelMotionFinish_Show, false, 0, true);
} else {
if (_local2 != null){
_local2.removeEventListener(TweenEvent.MOTION_FINISH, listenOpenBtnBevelMotionFinish_Hide, false);
_local2.stop();
};
_local2 = new Tween(m_uiBevel, "height", Elastic.easeOut, m_uiBevel.height, 0, 1, true);
_local2.addEventListener(TweenEvent.MOTION_FINISH, listenOpenBtnBevelMotionFinish_Hide, false, 0, true);
};
return (true);
}
private function get lastElement():UI_ElementSelector{
var _local1:int;
_local1 = m_arElement.length;
if (_local1 > 0){
return (m_arElement[(_local1 - 1)]);
};
return (null);
}
private function drawBevel():Boolean{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:UI_ElementSelector;
var _local6:int;
var _local7:Graphics;
var _local8:int;
var _local9:int;
var _local10:int;
var _local11:int;
trace("UI_ElementCollectionSelector private function drawBevel():Boolean");
_local1 = int.MIN_VALUE;
_local2 = int.MIN_VALUE;
_local3 = int.MAX_VALUE;
_local4 = int.MAX_VALUE;
_local6 = m_arElement.length;
while (--_local6 >= 0) {
_local5 = m_arElement[_local6];
if (_local5 != null){
_local8 = _local5.x;
_local9 = _local5.y;
_local10 = (_local8 + _local5.width);
_local11 = (_local11 + _local5.height);
if (_local3 > _local8){
_local3 = _local8;
};
if (_local4 > _local9){
_local4 = _local9;
};
if (_local1 < _local10){
_local1 = _local10;
};
if (_local2 < _local11){
_local2 = _local11;
};
};
};
if ((((((((_local1 == int.MIN_VALUE)) || ((_local2 == int.MIN_VALUE)))) || ((_local3 == int.MAX_VALUE)))) || ((_local4 == int.MAX_VALUE)))){
return (false);
};
if (m_uiBevel != null){
removeChild(m_uiBevel);
};
m_uiBevel = new Shape();
_local7 = m_uiBevel.graphics;
_local7.beginFill(BEVEL_FILL_COLOR);
_local7.lineStyle(1, BEVEL_LINE_COLOR);
_local7.drawRoundRect(((0 - OFFSET_WIDTH) - OFFSET_BEVEL), ((0 - OFFSET_HEIGHT) - OFFSET_BEVEL), (((_local1 - _local3) + OFFSET_WIDTH) + OFFSET_BEVEL), (((_local2 - _local4) + OFFSET_HEIGHT) + (2 * OFFSET_BEVEL)), 8, 8);
_local7.endFill();
addChildAt(m_uiBevel, 1);
m_uiBevel.x = _local3;
m_uiBevel.y = _local4;
m_nHeight_Normal = m_uiBevel.height;
return (true);
}
private function listenOnElementsFadeOut(_arg1:Event):void{
trace("X");
trace("UI_ElementCollectionSelector private function listenOnElementsFadeOut(event:Event):void");
rearrange();
dispatchEvent(new Event(ON_CHANGE_HEIGHT, true, true));
}
public function get checkitAlignRight():Boolean{
return (m_bCheckitAlignRight);
}
private function get openBtn():TSimpleCheckit{
return ((getChildByName("open_btn") as TSimpleCheckit));
}
public function set head(_arg1:UI_ElementSelector):void{
m_uiHead = _arg1;
}
}
}//package editor.view.components
Section 49
//UI_Elements_Holder (editor.view.components.UI_Elements_Holder)
package editor.view.components {
import flash.display.*;
import flash.utils.*;
import flash.events.*;
import com.*;
import main.view.components.*;
import fl.transitions.*;
public class UI_Elements_Holder extends UI_Window {
private var m_uiScroll:UI_Scroll;
public var show_btn:Btn_Show;
public var wall_mc:UI_ElementSelector;
private var m_bActive:Boolean;// = true
private var m_nElementsZeroY:int;
public var scroll_mc:UI_Scroll;
public var head_mc:MovieClip;
public var btn_open:SimpleButton;
public var btn_play_level:SimpleButton;
public var btn_template_wallbox:SimpleButton;
public var btn_goto_menu:SimpleButton;
private var m_uiElements:UI_ElementsSelector;
private var m_timer:Timer;
private var m_arTweenAlhpaBtns:Array;
public var btn_template_fill_floor_tile_dark:SimpleButton;
public var btn_save:SimpleButton;
private var m_arBtns:Array;
public var btn_template_empty:SimpleButton;
private var m_bShowed:Boolean;// = false
public var btn_template_fill_floor_ground:SimpleButton;
private var m_bShowAfter:Boolean;// = true
public var btn_template_fill_floor_ground_random:SimpleButton;
public var bg_mc:MovieClip;
public var btn_template_fill_floor_tile_light:SimpleButton;
public var elements_mc:UI_ElementsSelector;
public static const ON_PLAY_LEVEL:String = "onPlayLevel";
public static const ON_ROLLOVER_ON_BTN:String = "onRollOverOnBtn";
public static const BG_NAME:String = "bg_mc";
public static const NAME:String = "UI_Elements_Holder";
private static const OFFSET_TOP:int = 32;
public static const ON_TEMPATE_FILL_FLOOR_TILE_LIGHT:String = "onTemplateFillFloorTileLight";
public static const ON_TEMPATE_WALL_BOX:String = "onTemplateWallBox";
public static const ON_SAVE:String = "onLevelsSave";
public static const ELEMENTS_SELECTOR_NAME:String = "elements_mc";
private static const WAIT_FOR_SHOW:int = 50;
private static const WAIT_FOR_HIDE:int = 250;
public static const ON_OPEN:String = "onLevelsOpen";
public static const ON_TEMPATE_EMPTY:String = "onTemplateEmpty";
public static const ON_TEMPATE_FILL_FLOOR_GROUND_RAND:String = "onTemplateFillFloorGroundRand";
public static const ON_GOTO_MENU:String = "onGotoMenu";
public static const ON_TEMPATE_FILL_FLOOR_GROUND:String = "onTemplateFillFloorGround";
public static const ON_TEMPATE_FILL_FLOOR_TILE_DARK:String = "onTemplateFillFloorTileDark";
public function UI_Elements_Holder(){
var _local1:int;
var _local2:DisplayObject;
m_bShowed = false;
m_bShowAfter = true;
m_bActive = true;
m_arBtns = new Array();
m_arTweenAlhpaBtns = new Array();
super();
disappearOnHide = false;
_local1 = clientWidth;
_local2 = getChildByName("head_mc");
if (_local2 != null){
_local1 = (_local1 + _local2.width);
};
setShowRect((600 - _local1), 0, CommonFunc.INT_UNDEF, CommonFunc.INT_UNDEF);
setHideRect(600, 0, CommonFunc.INT_UNDEF, CommonFunc.INT_UNDEF);
show = false;
m_uiScroll = (getChildByName("scroll_mc") as UI_Scroll);
if (m_uiScroll == null){
m_uiScroll = new UI_Scroll();
addChild(m_uiScroll);
};
m_uiScroll.addEventListener(UI_Scroll.ON_SCROLL, listenOnScroll, false, 0, true);
addEventListener(MouseEvent.MOUSE_WHEEL, listenOnWheel, false, 0, true);
setListenersToBtn("btn_open", listenerOnOpen);
setListenersToBtn("btn_save", listenerOnSave);
setListenersToBtn("btn_template_empty", listenerOnTemplate_Empty);
setListenersToBtn("btn_template_wallbox", listenerOnTemplate_WallBox);
setListenersToBtn("btn_template_fill_floor_ground", listenerOnTemplate_FillFloorGround);
setListenersToBtn("btn_template_fill_floor_ground_random", listenerOnTemplate_FillFloorGroundRand);
setListenersToBtn("btn_template_fill_floor_tile_light", listenerOnTemplate_FillFloorTileLight);
setListenersToBtn("btn_template_fill_floor_tile_dark", listenerOnTemplate_FillFloorTileDark);
setListenersToBtn("btn_play_level", listenerOnPlayLevel);
setListenersToBtn("btn_goto_menu", listenerOnGotoMenu);
}
public function set active(_arg1:Boolean):void{
var _local2:Tween;
var _local3:SimpleButton;
var _local4:Tween;
m_bActive = _arg1;
for each (_local2 in m_arTweenAlhpaBtns) {
if (_local2 != null){
_local2.stop();
};
};
m_arTweenAlhpaBtns = new Array();
for each (_local3 in m_arBtns) {
if (_local3 != null){
_local3.mouseEnabled = _arg1;
_local4 = new Tween(_local3, "alpha", CommonFunc.cubicEaseInOut, _local3.alpha, (_arg1) ? 1 : 0.5, 0.5, true);
m_arTweenAlhpaBtns.push(_local4);
_local4.start();
};
};
}
private function listenerOnTemplate_FillFloorTileDark(_arg1:MouseEvent):void{
if (m_bActive){
dispatchEvent(new Event(ON_TEMPATE_FILL_FLOOR_TILE_DARK));
};
}
private function listenerOnTemplate_FillFloorGround(_arg1:MouseEvent):void{
if (m_bActive){
dispatchEvent(new Event(ON_TEMPATE_FILL_FLOOR_GROUND));
};
}
private function listenerOnGotoMenu(_arg1:MouseEvent):void{
if (m_bActive){
dispatchEvent(new Event(ON_GOTO_MENU));
};
}
private function listenerOnPlayLevel(_arg1:MouseEvent):void{
if (m_bActive){
dispatchEvent(new Event(ON_PLAY_LEVEL));
};
}
public function get actualHeight():int{
if (m_uiElements != null){
return (m_uiElements.actualHeight);
};
return (0);
}
private function listenerOnTemplate_WallBox(_arg1:MouseEvent):void{
if (m_bActive){
dispatchEvent(new Event(ON_TEMPATE_WALL_BOX));
};
}
private function listenerOnOpen(_arg1:MouseEvent):void{
if (m_bActive){
dispatchEvent(new Event(ON_OPEN));
};
}
private function listenOnScroll(_arg1:Event):void{
m_uiElements.y = (m_nElementsZeroY - m_uiScroll.pos);
}
public function get clientWidth():int{
var _local1:DisplayObject;
_local1 = getChildByName(BG_NAME);
if (_local1 != null){
return (_local1.width);
};
return (width);
}
public function get clientHeight():int{
var _local1:DisplayObject;
_local1 = getChildByName(BG_NAME);
if (_local1 != null){
return (_local1.height);
};
return (height);
}
private function listenOnWheel(_arg1:MouseEvent):void{
m_uiScroll.pos = (m_uiScroll.pos - (5 * _arg1.delta));
}
private function listenOnRollover(_arg1:MouseEvent):void{
if (m_bActive){
dispatchEvent(new Event(ON_ROLLOVER_ON_BTN));
};
}
private function listenerOnTemplate_FillFloorTileLight(_arg1:MouseEvent):void{
if (m_bActive){
dispatchEvent(new Event(ON_TEMPATE_FILL_FLOOR_TILE_LIGHT));
};
}
private function listenerOnTemplate_FillFloorGroundRand(_arg1:MouseEvent):void{
if (m_bActive){
dispatchEvent(new Event(ON_TEMPATE_FILL_FLOOR_GROUND_RAND));
};
}
private function listenOnResizeElements(_arg1:Event):void{
var _local2:int;
_local2 = (m_uiElements.actualHeight - clientHeight);
if (_local2 > 0){
m_uiScroll.maxPos = _local2;
} else {
m_uiScroll.maxPos = 0;
};
}
public function get uiElements():UI_ElementsSelector{
return (m_uiElements);
}
private function listenerOnTemplate_Empty(_arg1:MouseEvent):void{
if (m_bActive){
dispatchEvent(new Event(ON_TEMPATE_EMPTY));
};
}
private function listenerOnSave(_arg1:MouseEvent):void{
if (m_bActive){
dispatchEvent(new Event(ON_SAVE));
};
}
private function setListenersToBtn(_arg1:String, _arg2:Function):Boolean{
var _local3:SimpleButton;
if (((!((_arg1 == null))) && (!((_arg2 == null))))){
_local3 = (getChildByName(_arg1) as SimpleButton);
if (_local3 != null){
_local3.addEventListener(MouseEvent.MOUSE_UP, _arg2, false, 0, true);
_local3.addEventListener(MouseEvent.MOUSE_OVER, listenOnRollover, false, 0, true);
m_arBtns.push(_local3);
return (true);
};
};
return (false);
}
public function set elements(_arg1:UI_ElementsSelector):void{
if (m_uiElements != null){
m_uiElements.removeEventListener(UI_ElementsSelector.ON_RESIZE, listenOnResizeElements, false);
};
m_uiElements = _arg1;
m_uiElements.addEventListener(UI_ElementsSelector.ON_RESIZE, listenOnResizeElements, false, 0, true);
if (getChildIndex(m_uiScroll) < getChildIndex(m_uiElements)){
setChildIndex(m_uiScroll, getChildIndex(m_uiElements));
};
if (_arg1 != null){
m_nElementsZeroY = _arg1.y;
};
}
}
}//package editor.view.components
Section 50
//UI_ElementSelector (editor.view.components.UI_ElementSelector)
package editor.view.components {
import flash.display.*;
import flash.events.*;
import com.*;
import editor.view.*;
import game.view.*;
import fl.transitions.*;
import flash.text.*;
import flash.geom.*;
import fl.motion.easing.*;
public class UI_ElementSelector extends MovieClip {
private var m_tweenFade_Text:Tween;
private var m_nZoom:Number;// = 1
private var m_idLayer:int;
private var m_id:int;
private var m_tweenFade:Tween;
private var m_bActive:Boolean;// = false
private var m_uiChildCollection:UI_ElementCollectionSelector;
private var m_spBevel:Sprite;
private var m_nHeadHeight:int;
private var m_bFocus:Boolean;// = false
public var name_txt:TextField;
private var m_nXText_Def:int;// = -2147483648
private var m_uiElementsSelector:UI_ElementsSelector;
public var collection_mc:UI_ElementCollectionSelector;
private var m_bmElement:Bitmap;
private var m_nFixWidth:int;// = 150
private var m_uiHolder:UI_Elements_Holder;
private static const OFFSET_WIDTH:int = 2;
private static const OFFSET_H_SPACE:int = 2;
private static const BEVEL_STYLE_FOCUSED:int = 2;
private static const MAX_ELEMENT_HEIGHT:int = 30;
private static const BEVEL_FILL_INACTIVE_COLOR:int = 0xCCCCCC;
public static const ON_FADE_OUT:String = "onFadeOut";
private static const BEVEL_STYLE_DEF:int = 0;
private static const OFFSET_HEIGHT:int = 2;
private static const RIGHT_INDENT_FOR_HOLDER:int = 20;
public static const ELEMENT_FOCUS:String = "elementFocus";
private static const BEVEL_FILL_ACTIVE_COLOR:int = 15706537;
private static const FIX_WIDTH_BY_HOLDER:Boolean = true;
private static const BEVEL_STYLE_ACTIVE:int = 1;
private static const BEVEL_LINE_COLOR:int = 0xFFFFFF;
public static const ELEMENT_SELECT:String = "elementSelect";
public function UI_ElementSelector(){
m_bActive = false;
m_bFocus = false;
m_nFixWidth = 150;
m_nZoom = 1;
m_nXText_Def = int.MIN_VALUE;
super();
useHandCursor = true;
buttonMode = true;
addEventListener(Event.ADDED_TO_STAGE, listenOnAdded, false, 0, true);
}
private function updateBevelStyle():void{
createBavel(m_bActive, m_bFocus);
}
private function listenDown(_arg1:MouseEvent):void{
}
private function listenOver(_arg1:MouseEvent):void{
dispatchEvent(new Event(ELEMENT_FOCUS));
}
private function listenOut(_arg1:MouseEvent):void{
}
public function get id():int{
return (m_id);
}
private function listenFadeInFinish(_arg1:TweenEvent):void{
}
private function get tfName():TextField{
return ((getChildByName("name_txt") as TextField));
}
public function rearrange():void{
if (m_uiChildCollection != null){
m_uiChildCollection.rearrange();
};
}
public function get layerID():int{
return (m_idLayer);
}
public function get headHeight():int{
if (m_bmElement != null){
return (((m_bmElement.height + (2 * OFFSET_HEIGHT)) + OFFSET_H_SPACE));
};
return (0);
}
public function set id(_arg1:int):void{
m_id = _arg1;
}
public function set elementName(_arg1:String):void{
var _local2:TextField;
_local2 = tfName;
if (((!((_local2 == null))) && (!((_arg1 == null))))){
_local2.text = _arg1;
_local2.autoSize = TextFieldAutoSize.LEFT;
};
}
public function set layerID(_arg1:int):void{
m_idLayer = _arg1;
}
public function get actualHeight():int{
var _local1:int;
_local1 = headHeight;
if (m_uiChildCollection != null){
_local1 = (_local1 + m_uiChildCollection.actualHeight);
};
return (_local1);
}
public function listenChangeChildCollection(_arg1:ElementsCollectionSelectorMediator):void{
if (_arg1 != null){
if (_arg1.count > 0){
if (!m_uiChildCollection.checkitAlignRight){
x = m_uiChildCollection.openBtnWidth;
};
};
};
}
public function set fixWidth(_arg1:int):void{
m_nFixWidth = _arg1;
}
public function set elementID(_arg1:int):void{
var _local2:MovieClip;
var _local3:Rectangle;
var _local4:Matrix;
var _local5:int;
var _local6:int;
var _local7:BitmapData;
if (m_bmElement == null){
m_bmElement = new Bitmap();
addChild(m_bmElement);
};
_local2 = Sprites.getItem(_arg1, true, true);
addChild(_local2);
_local2.x = 0;
_local2.y = 0;
_local3 = _local2.getBounds(this);
removeChild(_local2);
_local4 = new Matrix(m_nZoom, 0, 0, m_nZoom, (-(_local3.x) * m_nZoom), (-(_local3.y) * m_nZoom));
_local5 = (_local2.width * m_nZoom);
_local6 = (_local2.height * m_nZoom);
if ((((_local5 > 1)) && ((_local6 > 0)))){
_local7 = new BitmapData(_local5, _local6, true, 0);
_local7.lock();
_local7.draw(_local2, _local4);
_local7.unlock();
m_bmElement.bitmapData = _local7;
};
}
public function setShow(_arg1:Boolean, _arg2:Number=1):void{
var _local3:Point;
if (_arg1){
visible = true;
alpha = 0;
_local3 = new Point(stage.width, stage.height);
_local3 = this.globalToLocal(_local3);
if (m_tweenFade != null){
m_tweenFade.stop();
};
m_tweenFade = new Tween(this, "alpha", CommonFunc.cubicEaseInOut, alpha, 1, _arg2, true);
m_tweenFade.addEventListener(TweenEvent.MOTION_FINISH, listenFadeInFinish, false, 0, true);
if (m_tweenFade_Text != null){
m_tweenFade_Text.stop();
};
m_tweenFade_Text = new Tween(tfName, "x", Elastic.easeInOut, m_uiHolder.clientWidth, m_nXText_Def, _arg2, true);
} else {
alpha = 1;
_local3 = new Point(stage.width, stage.height);
_local3 = this.globalToLocal(_local3);
if (m_tweenFade != null){
m_tweenFade.stop();
};
m_tweenFade = new Tween(this, "alpha", CommonFunc.cubicEaseInOut, alpha, 0, _arg2, true);
m_tweenFade.addEventListener(TweenEvent.MOTION_FINISH, listenFadeOutFinish, false, 0, true);
if (m_tweenFade_Text != null){
m_tweenFade_Text.stop();
};
m_tweenFade_Text = new Tween(tfName, "x", Elastic.easeInOut, tfName.x, m_uiHolder.clientWidth, _arg2, true);
m_tweenFade.start();
m_tweenFade_Text.start();
};
}
public function createElement(_arg1:int, _arg2:int, _arg3:int, _arg4:String):Boolean{
var _local5:TextField;
id = _arg1;
layerID = _arg2;
elementID = _arg3;
elementName = _arg4;
_local5 = tfName;
if (_local5 != null){
m_nXText_Def = _local5.x;
_local5.mouseEnabled = false;
};
createBavel(m_bActive);
return (true);
}
private function listenOnAdded(_arg1:Event):void{
var _local2:UI_Elements_Holder;
var _local3:UI_ElementsSelector;
var _local4:MovieClip;
_local4 = (parent as MovieClip);
while (_local4 != null) {
_local2 = (_local4 as UI_Elements_Holder);
_local3 = (_local4 as UI_ElementsSelector);
if (_local2 != null){
m_uiHolder = _local2;
if (m_uiElementsSelector != null){
createBavel(m_bActive, m_bFocus);
return;
};
};
if (_local3 != null){
m_uiElementsSelector = _local3;
if (m_uiHolder != null){
createBavel(m_bActive, m_bFocus);
return;
};
};
_local4 = (_local4.parent as MovieClip);
};
}
private function setBevelStyle(_arg1:int):void{
}
private function get holderWidth():int{
if (m_uiElementsSelector != null){
return (m_uiElementsSelector.clientWidth);
};
return (CommonFunc.INT_UNDEF);
}
public function set focus(_arg1:Boolean):void{
m_bFocus = _arg1;
updateBevelStyle();
}
public function set childCollection(_arg1:UI_ElementCollectionSelector):void{
m_uiChildCollection = _arg1;
}
private function listenUp(_arg1:MouseEvent):void{
_arg1.stopPropagation();
dispatchEvent(new Event(ELEMENT_SELECT));
}
private function createBavel(_arg1:Boolean=false, _arg2:Boolean=false):void{
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:Graphics;
var _local7:int;
var _local8:Point;
var _local9:TextField;
if (m_bmElement != null){
_local4 = (m_bmElement.height + (2 * OFFSET_HEIGHT));
m_nHeadHeight = _local4;
_local3 = holderWidth;
if (((FIX_WIDTH_BY_HOLDER) && (!((_local3 == CommonFunc.INT_UNDEF))))){
_local8 = new Point(x, y);
_local8 = parent.localToGlobal(_local8);
_local8 = elementsSelector.globalToLocal(_local8);
_local3 = (((_local3 - _local8.x) - RIGHT_INDENT_FOR_HOLDER) - UI_ElementCollectionSelector.LEFT_INDENT);
} else {
if (m_nFixWidth != CommonFunc.INT_UNDEF){
_local3 = m_nFixWidth;
} else {
_local9 = tfName;
if (_local9 != null){
_local3 = (((tfName)!=null) ? (m_nXText_Def + _local9.width) : 0 + (2 * OFFSET_WIDTH));
_local9.y = ((_local4 - _local9.height) >> 1);
};
};
};
_local5 = CommonFunc.INT_UNDEF;
if (m_spBevel == null){
m_spBevel = (getChildByName("bevel") as Sprite);
if (m_spBevel == null){
m_spBevel = new Sprite();
addChildAt(m_spBevel, 0);
};
} else {
_local5 = m_spBevel.height;
};
_local6 = m_spBevel.graphics;
_local6.clear();
if (_arg1){
_local6.beginFill(BEVEL_FILL_ACTIVE_COLOR, (_arg2) ? 1 : 0.5);
} else {
_local6.beginFill(BEVEL_FILL_INACTIVE_COLOR, (_arg2) ? 1 : 0.5);
};
_local6.lineStyle();
_local6.drawRoundRect(-(OFFSET_WIDTH), -(OFFSET_HEIGHT), _local3, _local4, 8, 8);
_local6.endFill();
m_spBevel.addEventListener(MouseEvent.MOUSE_OVER, listenOver, false, 0, true);
m_spBevel.addEventListener(MouseEvent.MOUSE_OUT, listenOut, false, 0, true);
m_spBevel.addEventListener(MouseEvent.MOUSE_DOWN, listenDown, false, 0, true);
m_spBevel.addEventListener(MouseEvent.MOUSE_UP, listenUp, false, 0, true);
_local7 = m_spBevel.height;
if ((((_local5 == CommonFunc.INT_UNDEF)) || (!((_local7 == _local5))))){
dispatchEvent(new Event(UI_ElementCollectionSelector.ON_CHANGE_HEIGHT, true, true));
};
};
}
public function get headWidth():int{
if (m_bmElement != null){
return (m_spBevel.width);
};
return (0);
}
private function listenFadeOutFinish(_arg1:TweenEvent):void{
visible = false;
tfName.x = m_nXText_Def;
dispatchEvent(new Event(ON_FADE_OUT));
}
private function get elementsSelector():UI_ElementsSelector{
return ((m_uiHolder.getChildByName(UI_Elements_Holder.ELEMENTS_SELECTOR_NAME) as UI_ElementsSelector));
}
public function set select(_arg1:Boolean):void{
m_bActive = _arg1;
updateBevelStyle();
}
}
}//package editor.view.components
Section 51
//UI_ElementsSelector (editor.view.components.UI_ElementsSelector)
package editor.view.components {
import flash.display.*;
import flash.utils.*;
import flash.events.*;
import fl.transitions.*;
public class UI_ElementsSelector extends MovieClip {
private var m_timer:Timer;
private var m_uiScroll:UI_Scroll;
private var m_arElement:Array;
private var m_bShowAfter:Boolean;// = true
private var m_bShowed:Boolean;// = false
private var m_tweenShow:Tween;
public var bg_mc:MovieClip;
private var m_uiHolder:UI_Elements_Holder;
public static const BG_NAME:String = "bg_mc";
private static const OFFSET_TOP:int = 2;
public static const NAME:String = "UI_ElementsSelector";
private static const ALWAYS_VISIBLE_WIDTH:int = 30;
private static const WAIT_FOR_HIDE:int = 250;
private static const OFFSET_LEFT:int = 2;
public static const ON_RESIZE:String = "onResize";
private static const OFFSET_HEIGHT:int = 2;
private static const WAIT_FOR_SHOW:int = 50;
public function UI_ElementsSelector(){
m_bShowed = false;
m_bShowAfter = true;
m_arElement = new Array();
super();
}
public function set active(_arg1:Boolean):void{
}
private function get elementsWidth():int{
var _local1:MovieClip;
_local1 = (getChildByName("bg_mc") as MovieClip);
if (_local1 != null){
return (_local1.width);
};
return (0);
}
public function addElement(_arg1:UI_ElementSelector):Boolean{
var _local2:int;
var _local3:UI_ElementSelector;
if (_arg1 != null){
_local3 = lastElement;
if (_local3 != null){
_local2 = (_local3.actualHeight + _local3.y);
} else {
_local2 = OFFSET_TOP;
};
_arg1.x = (_arg1.x + OFFSET_LEFT);
_arg1.y = _local2;
addChild(_arg1);
_arg1.addEventListener(UI_ElementCollectionSelector.ON_CHANGE_HEIGHT, listenChildChangeHeight, false, 0, true);
m_arElement.push(_arg1);
return (true);
};
return (false);
}
private function listenChildChangeHeight(_arg1:Event):void{
rearrange();
}
public function rearrange():void{
var _local1:UI_ElementSelector;
var _local2:int;
var _local3:int;
var _local4:int;
_local2 = m_arElement.length;
_local3 = OFFSET_TOP;
_local4 = 0;
while (_local4 < _local2) {
_local1 = m_arElement[_local4];
_local1.rearrange();
_local1.y = _local3;
_local3 = (_local3 + _local1.actualHeight);
_local4++;
};
dispatchEvent(new Event(ON_RESIZE));
}
public function set holder(_arg1:UI_Elements_Holder):void{
m_uiHolder = _arg1;
}
public function get actualHeight():int{
var _local1:int;
var _local2:UI_ElementSelector;
_local1 = OFFSET_TOP;
for each (_local2 in m_arElement) {
if (_local2 != null){
_local1 = (_local1 + _local2.actualHeight);
};
};
return (_local1);
}
public function getItem(_arg1:int):UI_ElementSelector{
if ((((_arg1 >= 0)) && ((_arg1 < m_arElement.length)))){
return (m_arElement[_arg1]);
};
return (null);
}
private function get lastElement():UI_ElementSelector{
var _local1:int;
_local1 = m_arElement.length;
if (_local1 > 0){
return (m_arElement[(_local1 - 1)]);
};
return (null);
}
public function get holder():UI_Elements_Holder{
return (m_uiHolder);
}
public function get clientWidth():int{
var _local1:DisplayObject;
_local1 = getChildByName(BG_NAME);
if (_local1 != null){
return (_local1.width);
};
return (width);
}
public function get clientHeight():int{
var _local1:DisplayObject;
_local1 = getChildByName(BG_NAME);
if (_local1 != null){
return (_local1.height);
};
return (height);
}
public function get length():int{
return (m_arElement.length);
}
}
}//package editor.view.components
Section 52
//UI_LevelSelector (editor.view.components.UI_LevelSelector)
package editor.view.components {
import flash.display.*;
import flash.events.*;
import game.model.*;
import main.view.components.*;
import fl.transitions.*;
import flash.text.*;
public class UI_LevelSelector extends MovieClip {
private var m_nPlayState:int;// = -1
public var grade_txt:TextField;
private var m_bSelect:Boolean;// = false
private var m_bCanPlay:Boolean;// = false
private var m_bActive:Boolean;// = false
private var m_bAddTail:Boolean;// = false
public var btn_mc:UI_Simple_Btn;
private var m_bWin:Boolean;// = false
private var m_bInActive:Boolean;// = false
private var m_tweenAlpha:Tween;
public var bg_mc:MovieClip;
public var itemName_txt:TextField;
private static const ITEM_NAME_NAME:String = "itemName_txt";
private static const BG_NAME:String = "bg_mc";
private static const GRADE_NAME:String = "grade_txt";
public static const ON_SELECT:String = "onSelect";
public function UI_LevelSelector(){
var _local1:TextField;
m_bSelect = false;
m_bActive = false;
m_bInActive = false;
m_bAddTail = false;
m_bWin = false;
m_bCanPlay = false;
m_nPlayState = LevelProxy.INIT_STYLE_UNDEF;
super();
this.useHandCursor = true;
this.buttonMode = true;
_local1 = itemNameTF;
if (_local1 != null){
_local1.mouseEnabled = false;
};
_local1 = (getChildByName(GRADE_NAME) as TextField);
if (_local1 != null){
_local1.mouseEnabled = false;
};
updateView();
addEventListener(MouseEvent.MOUSE_UP, listenOnUp, false, 0, true);
addEventListener(MouseEvent.MOUSE_OVER, listenOnRollover, false, 0, true);
}
public function get active():Boolean{
return (m_bActive);
}
public function get select():Boolean{
return (m_bSelect);
}
private function updateView():void{
if (m_bAddTail){
gotoAndStop("addtail");
} else {
switch (m_nPlayState){
case LevelProxy.PLAY_STATE_CAN_PLAY:
gotoAndStop("can_play");
break;
case LevelProxy.PLAY_STATE_LOCK:
gotoAndStop("inactive");
break;
case LevelProxy.PLAY_STATE_WIN:
gotoAndStop("win");
break;
default:
if (m_bActive){
if (m_bSelect){
gotoAndStop("select");
} else {
gotoAndStop("unselect");
};
} else {
gotoAndStop("inactive");
};
break;
};
};
}
public function set active(_arg1:Boolean):void{
trace("X");
trace("UI_LevelsSelector public function set active(bSet:Boolean):void");
trace(("this=" + this));
trace(("bSet=" + _arg1));
m_bActive = _arg1;
updateView();
}
private function get itemNameTF():TextField{
return ((getChildByName("itemName_txt") as TextField));
}
public function get itemName():String{
var _local1:TextField;
_local1 = itemNameTF;
if (_local1 != null){
return (_local1.text);
};
return ("");
}
private function listenOnUp(_arg1:MouseEvent):void{
if (!m_bInActive){
dispatchEvent(new Event(ON_SELECT));
};
}
public function get tail():Boolean{
return (m_bAddTail);
}
private function listenOnRollover(_arg1:MouseEvent):void{
trace("X");
trace("UI_LevelSelector private function listenOnRollover(event:MouseEvent):void");
trace(("event.target=" + _arg1.target));
if (!m_bInActive){
dispatchEvent(new Event(UI_LevelsSelector.ON_ROLLOVER_ON_BTN));
};
}
public function set itemName(_arg1:String):void{
var _local2:TextField;
trace("X");
trace("UI_LevelsSelector public function set itemName(strName:String):void");
_local2 = itemNameTF;
trace(("tf=" + _local2));
trace(("strName=" + _arg1));
if (((!((_local2 == null))) && (!((_arg1 == null))))){
_local2.text = _arg1;
};
}
public function get bgWidth():int{
var _local1:MovieClip;
_local1 = (getChildByName(BG_NAME) as MovieClip);
if (_local1 != null){
return (_local1.width);
};
return (width);
}
public function set tail(_arg1:Boolean):void{
if (m_bAddTail != _arg1){
m_bAddTail = _arg1;
updateView();
};
}
public function set playState(_arg1:int):void{
if (m_nPlayState != _arg1){
m_nPlayState = _arg1;
updateView();
};
}
public function set grade(_arg1:String):void{
var _local2:TextField;
_local2 = (getChildByName(GRADE_NAME) as TextField);
if (((!((_local2 == null))) && (!((_arg1 == null))))){
_local2.text = _arg1;
};
}
public function get playState():int{
return (m_nPlayState);
}
public function get bgHeight():int{
var _local1:MovieClip;
_local1 = (getChildByName(BG_NAME) as MovieClip);
if (_local1 != null){
return (_local1.height);
};
return (height);
}
public function set inactive(_arg1:Boolean):void{
trace("X");
trace("UI_LevelSelector public function set inactive(bSet:Boolean):void");
trace(("bSet=" + _arg1));
m_bInActive = _arg1;
mouseEnabled = !(m_bInActive);
}
public function get grade():String{
var _local1:TextField;
_local1 = (getChildByName(GRADE_NAME) as TextField);
if (_local1 != null){
return (_local1.text);
};
return (null);
}
public function set select(_arg1:Boolean):void{
m_bSelect = _arg1;
updateView();
}
}
}//package editor.view.components
Section 53
//UI_LevelsSelector (editor.view.components.UI_LevelsSelector)
package editor.view.components {
import flash.display.*;
import flash.utils.*;
import flash.events.*;
import com.*;
import main.*;
import fl.transitions.*;
import flash.ui.*;
public class UI_LevelsSelector extends TElastic {
var m_nWidth:int;
public var show_btn:Btn_Show;
public var btn_add:SimpleButton;
var m_arItems:Array;
public var btn_open:SimpleButton;
public var head_mc:MovieClip;
public var btn_template_wallbox:SimpleButton;
public var btn_play_level:SimpleButton;
public var btn_goto_menu:SimpleButton;
var m_tweenShow:Tween;
private var m_timer:Timer;
public var levels_bg_mc:MovieClip;
public var btn_template_fill_floor_tile_dark:SimpleButton;
var m_nHeight:int;
public var btn_play_levels:SimpleButton;
public var btn_save:SimpleButton;
public var btn_template_empty:SimpleButton;
public var btn_template_fill_floor_ground:SimpleButton;
public var btn_del:SimpleButton;
var m_bShowAfter:Boolean;// = false
var m_bShowed:Boolean;// = false
public var btn_template_fill_floor_ground_random:SimpleButton;
public var btn_template_fill_floor_tile_light:SimpleButton;
public static const ON_PLAY_LEVEL:String = "onPlayLevel";
public static const ON_PLAY_LEVELS:String = "onPlayLevels";
private static const WAIT_FOR_SHOW:int = 50;
public static const ON_DEL:String = "onLevelDel";
public static const ON_TEMPATE_FILL_FLOOR_TILE_LIGHT:String = "onTemplateFillFloorTileLight";
public static const ON_TEMPATE_WALL_BOX:String = "onTemplateWallBox";
public static const ON_SAVE:String = "onLevelsSave";
public static const MID_H_SPACE:int = 8;
public static const ON_ADD:String = "onLevelAdd";
public static const TOP_SPACE:int = (8 + 35);
private static const WAIT_FOR_HIDE:int = 250;
public static const ON_OPEN:String = "onLevelsOpen";
public static const ON_TEMPATE_EMPTY:String = "onTemplateEmpty";
public static const ON_PRED_LEVEL:String = "onPredLevel";
public static const ON_TEMPATE_FILL_FLOOR_GROUND_RAND:String = "onTemplateFillFloorGroundRand";
public static const ON_ROLLOVER_ON_BTN:String = "onRollOverOnBtn";
public static const ON_GOTO_MENU:String = "onGotoMenu";
public static const ON_TEMPATE_FILL_FLOOR_GROUND:String = "onTemplateFillFloorGround";
public static const ON_NEXT_LEVEL:String = "onNextLevel";
public static const ON_TEMPATE_FILL_FLOOR_TILE_DARK:String = "onTemplateFillFloorTileDark";
public static const LEFT_SPACE:int = 8;
public static const MID_V_SPACE:int = 8;
public function UI_LevelsSelector(){
var _local1:MovieClip;
var _local2:TSimpleCheckit;
m_arItems = new Array();
m_bShowed = false;
m_bShowAfter = false;
super();
setListenersToBtn("btn_open", listenerOnOpen);
setListenersToBtn("btn_save", listenerOnSave);
setListenersToBtn("btn_add", listenerOnAdd);
setListenersToBtn("btn_del", listenerOnDel);
setListenersToBtn("btn_template_empty", listenerOnTemplate_Empty);
setListenersToBtn("btn_template_wallbox", listenerOnTemplate_WallBox);
setListenersToBtn("btn_template_fill_floor_ground", listenerOnTemplate_FillFloorGround);
setListenersToBtn("btn_template_fill_floor_ground_random", listenerOnTemplate_FillFloorGroundRand);
setListenersToBtn("btn_template_fill_floor_tile_light", listenerOnTemplate_FillFloorTileLight);
setListenersToBtn("btn_template_fill_floor_tile_dark", listenerOnTemplate_FillFloorTileDark);
setListenersToBtn("btn_play_level", listenerOnPlayLevel);
setListenersToBtn("btn_play_levels", listenerOnPlayLevels);
setListenersToBtn("btn_goto_menu", listenerOnGotoMenu);
_local1 = (getChildByName("levels_bg_mc") as MovieClip);
if (_local1 != null){
m_nWidth = _local1.width;
m_nHeight = _local1.height;
} else {
m_nWidth = width;
m_nHeight = height;
};
_local2 = (getChildByName("show_btn") as TSimpleCheckit);
if (_local2 != null){
_local2.selected = true;
_local2.addEventListener(TSimpleCheckit.ON_SELECT, listenOpenBtn, false, 0, true);
};
addEventListener(MouseEvent.MOUSE_DOWN, listenMouseDown, false, 0, true);
addEventListener(Event.REMOVED, listenRemove, false, 0, true);
addEventListener(Event.ADDED_TO_STAGE, listenOnAddToStage, false, 0, true);
}
private function listenOnAddToStage(_arg1:Event):void{
stage.addEventListener(KeyboardEvent.KEY_DOWN, listenKeyDown, false, 0, true);
}
private function listenerOnTemplate_FillFloorTileDark(_arg1:MouseEvent):void{
dispatchEvent(new Event(ON_TEMPATE_FILL_FLOOR_TILE_DARK));
}
private function removeShowTimer():void{
if (m_timer != null){
m_timer.removeEventListener(TimerEvent.TIMER, listenTimeOver, false);
m_timer = null;
};
}
private function listenerOnTemplate_FillFloorGround(_arg1:MouseEvent):void{
dispatchEvent(new Event(ON_TEMPATE_FILL_FLOOR_GROUND));
}
private function listenTimeOver(_arg1:TimerEvent):void{
setShow(m_bShowAfter);
removeShowTimer();
}
private function listenerOnGotoMenu(_arg1:MouseEvent):void{
dispatchEvent(new Event(ON_GOTO_MENU));
}
private function listenerOnPlayLevel(_arg1:MouseEvent):void{
dispatchEvent(new Event(ON_PLAY_LEVEL));
}
private function showAfterTime(_arg1:Boolean):void{
m_bShowAfter = _arg1;
removeShowTimer();
m_timer = new Timer((_arg1) ? WAIT_FOR_SHOW : WAIT_FOR_HIDE, 1);
m_timer.addEventListener(TimerEvent.TIMER, listenTimeOver, false, 0, true);
m_timer.start();
}
public function rearrangeView(_arg1:int=0, _arg2:int=-1):void{
var _local3:UI_LevelSelector;
var _local4:UI_LevelSelector;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
if (_arg2 == CommonFunc.INT_UNDEF){
_arg2 = (m_arItems.length - 1);
};
_local5 = _arg1;
_local3 = getItem((_local5 - 1));
if (_local3 != null){
_local6 = _local3.x;
_local7 = _local3.y;
_local8 = _local3.bgWidth;
} else {
_local6 = (LEFT_SPACE - MID_H_SPACE);
_local7 = TOP_SPACE;
_local8 = 0;
};
while (_local5 <= _arg2) {
_local4 = m_arItems[_local5];
if (_local4 != null){
_local6 = (_local6 + (_local8 + MID_H_SPACE));
_local8 = _local4.bgWidth;
if ((_local6 + _local8) < m_nWidth){
} else {
_local6 = LEFT_SPACE;
_local9 = _local4.bgHeight;
_local7 = (_local7 + (_local9 + MID_V_SPACE));
};
_local4.x = _local6;
_local4.y = _local7;
};
_local5++;
};
}
public function setShow(_arg1:Boolean):void{
var _local2:TSimpleCheckit;
if (m_bShowed != _arg1){
m_bShowed = _arg1;
_local2 = (getChildByName("show_btn") as TSimpleCheckit);
if (_local2 != null){
_local2.selected = _arg1;
};
if (_arg1){
if (m_tweenShow != null){
m_tweenShow.stop();
};
m_tweenShow = new Tween(this, "y", CommonFunc.cubicEaseInOut, y, (Global_Settings.stageHeight - m_nHeight), 0.4, true);
} else {
if (m_tweenShow != null){
m_tweenShow.stop();
};
m_tweenShow = new Tween(this, "y", CommonFunc.cubicEaseInOut, y, Global_Settings.stageHeight, 0.4, true);
};
};
}
private function listenerOnTemplate_WallBox(_arg1:MouseEvent):void{
dispatchEvent(new Event(ON_TEMPATE_WALL_BOX));
}
private function listenerOnOpen(_arg1:MouseEvent):void{
dispatchEvent(new Event(ON_OPEN));
}
private function get lastItem():UI_LevelSelector{
var _local1:int;
_local1 = m_arItems.length;
if (_local1 > 0){
return (m_arItems[(_local1 - 1)]);
};
return (null);
}
private function listenMouseDown(_arg1:MouseEvent):void{
_arg1.stopPropagation();
}
private function listenOnRollover(_arg1:MouseEvent):void{
dispatchEvent(new Event(ON_ROLLOVER_ON_BTN));
}
public function get show():Boolean{
return (this.m_bShowed);
}
private function listenerOnTemplate_FillFloorTileLight(_arg1:MouseEvent):void{
dispatchEvent(new Event(ON_TEMPATE_FILL_FLOOR_TILE_LIGHT));
}
private function listenMouseOver(_arg1:MouseEvent):void{
showAfterTime(true);
}
private function listenRemove(_arg1:Event):void{
stage.removeEventListener(KeyboardEvent.KEY_DOWN, listenKeyDown, false);
removeEventListener(MouseEvent.MOUSE_DOWN, listenMouseDown, false);
removeEventListener(Event.REMOVED, listenRemove, false);
}
public function removeAllItem():void{
var _local1:UI_LevelSelector;
for each (_local1 in m_arItems) {
if (_local1 != null){
removeChild(_local1);
};
};
m_arItems = new Array();
}
public function pushItem(_arg1:UI_LevelSelector):Boolean{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:UI_LevelSelector;
if (_arg1 != null){
_local4 = _arg1.bgWidth;
_local5 = lastItem;
if (_local5 == null){
_local2 = LEFT_SPACE;
_local3 = TOP_SPACE;
} else {
_local2 = ((_local5.x + _local5.bgWidth) + MID_H_SPACE);
if ((_local2 + _local4) > m_nWidth){
_local2 = LEFT_SPACE;
_local3 = ((_local5.y + _local5.bgHeight) + MID_V_SPACE);
} else {
_local3 = _local5.y;
};
};
addChild(_arg1);
_arg1.x = _local2;
_arg1.y = _local3;
m_arItems.push(_arg1);
return (true);
};
return (false);
}
private function listenMouseOut(_arg1:MouseEvent):void{
showAfterTime(false);
}
private function listenerOnDel(_arg1:MouseEvent):void{
dispatchEvent(new Event(ON_DEL));
}
private function listenerOnTemplate_FillFloorGroundRand(_arg1:MouseEvent):void{
dispatchEvent(new Event(ON_TEMPATE_FILL_FLOOR_GROUND_RAND));
}
public function insertItem(_arg1:int, _arg2:UI_LevelSelector):Boolean{
m_arItems.splice(_arg1, 0, _arg2);
addChild(_arg2);
rearrangeView(_arg1);
return (true);
}
public function getItem(_arg1:int):UI_LevelSelector{
if ((((_arg1 >= 0)) && ((_arg1 < m_arItems.length)))){
return (m_arItems[_arg1]);
};
return (null);
}
public function removeItem(_arg1:UI_LevelSelector):Boolean{
var _local2:int;
_local2 = m_arItems.indexOf(_arg1);
if (_local2 >= 0){
m_arItems.splice(_local2, 1);
removeChild(_arg1);
rearrangeView(_local2);
return (true);
};
return (false);
}
private function listenerOnTemplate_Empty(_arg1:MouseEvent):void{
dispatchEvent(new Event(ON_TEMPATE_EMPTY));
}
private function listenerOnSave(_arg1:MouseEvent):void{
dispatchEvent(new Event(ON_SAVE));
}
private function listenerOnPlayLevels(_arg1:MouseEvent):void{
dispatchEvent(new Event(ON_PLAY_LEVELS));
}
private function listenKeyDown(_arg1:KeyboardEvent):void{
switch (_arg1.keyCode){
case Keyboard.LEFT:
if (_arg1.ctrlKey){
dispatchEvent(new Event(ON_PRED_LEVEL));
};
break;
case Keyboard.RIGHT:
if (_arg1.ctrlKey){
dispatchEvent(new Event(ON_NEXT_LEVEL));
};
break;
case 80:
if (_arg1.ctrlKey){
dispatchEvent(new Event(ON_PLAY_LEVEL));
};
};
}
private function setListenersToBtn(_arg1:String, _arg2:Function):Boolean{
var _local3:SimpleButton;
if (((!((_arg1 == null))) && (!((_arg2 == null))))){
_local3 = (getChildByName(_arg1) as SimpleButton);
if (_local3 != null){
_local3.addEventListener(MouseEvent.MOUSE_UP, _arg2, false, 0, true);
_local3.addEventListener(MouseEvent.MOUSE_OVER, listenOnRollover, false, 0, true);
return (true);
};
};
return (false);
}
private function listenOpenBtn(_arg1:Event):void{
setShow(!(m_bShowed));
}
private function listenerOnAdd(_arg1:MouseEvent):void{
dispatchEvent(new Event(ON_ADD));
}
}
}//package editor.view.components
Section 54
//UI_Msg_Icons (editor.view.components.UI_Msg_Icons)
package editor.view.components {
import flash.display.*;
import com.*;
public class UI_Msg_Icons extends MovieClip {
private var m_nIcon:int;// = -1
public static const MSG_ICON_ASK:int = 1;
public static const MSG_ICON_INFORMATION:int = 2;
public static const MSG_ICON_WARNING:int = 0;
public function UI_Msg_Icons(){
m_nIcon = CommonFunc.INT_UNDEF;
super();
stop();
}
public function get icon():int{
return (m_nIcon);
}
public function set icon(_arg1:int):void{
trace("&");
trace("UI_Msg_Icons public function set icon(nIcon:int):void");
trace(("nIcon=" + _arg1));
switch (_arg1){
case MSG_ICON_WARNING:
gotoAndStop("warning");
visible = true;
break;
case MSG_ICON_ASK:
gotoAndStop("ask");
visible = true;
break;
case MSG_ICON_INFORMATION:
gotoAndStop("information");
visible = true;
break;
default:
visible = false;
break;
};
m_nIcon = _arg1;
}
}
}//package editor.view.components
Section 55
//UI_Msg_Level_Url (editor.view.components.UI_Msg_Level_Url)
package editor.view.components {
import flash.display.*;
import flash.events.*;
import main.view.components.*;
import flash.text.*;
import flash.system.*;
public class UI_Msg_Level_Url extends UI_Window {
public var show_btn:Btn_Show;
public var toClipBoard_mc:SimpleButton;
public var ok_btn:SimpleButton;
public var msg_txt:TextField;
public var bg_mc:MovieClip;
private static const MSG_TXT_NAME:String = "msg_txt";
private static const OK_BTN:String = "ok_btn";
private static const TO_CLIPBOARD_BTN:String = "toClipBoard_mc";
public function UI_Msg_Level_Url(){
var _local1:SimpleButton;
var _local2:TextField;
super();
setShowRect(x, y, width, height);
setHideRect(300, 300, 0, 0);
disappearOnHide = true;
_local1 = (getChildByName(OK_BTN) as SimpleButton);
if (_local1 != null){
_local1.addEventListener(MouseEvent.CLICK, listenOk, false, 0, true);
};
_local1 = (getChildByName(TO_CLIPBOARD_BTN) as SimpleButton);
if (_local1 != null){
_local1.addEventListener(MouseEvent.CLICK, listenToClipboard, false, 0, true);
};
hideShowOnOpenBtn = true;
_local2 = (getChildByName(MSG_TXT_NAME) as TextField);
if (_local2 != null){
_local2.addEventListener(MouseEvent.CLICK, listenOnClick, false, 0, true);
};
}
private function listenOk(_arg1:MouseEvent):void{
setShow(false);
}
private function listenToClipboard(_arg1:MouseEvent):void{
var _local2:TextField;
_local2 = (getChildByName(MSG_TXT_NAME) as TextField);
if (_local2 != null){
_local2.setSelection(0, _local2.text.length);
System.setClipboard(_local2.text);
};
setShow(false);
}
private function listenOnClick(_arg1:MouseEvent):void{
var _local2:TextField;
_local2 = (getChildByName(MSG_TXT_NAME) as TextField);
if (_local2 != null){
_local2.setSelection(0, _local2.text.length);
System.setClipboard(_local2.text);
};
}
public function get value():String{
var _local1:TextField;
_local1 = (getChildByName(MSG_TXT_NAME) as TextField);
if (_local1 != null){
return (_local1.text);
};
return ("");
}
public function set value(_arg1:String):void{
var _local2:TextField;
trace("X");
trace("UI_Msg_Level_Url public function set value(strValue:String):void");
trace(("strValue=" + _arg1));
_local2 = (getChildByName(MSG_TXT_NAME) as TextField);
trace(("tf=" + _local2));
trace(("strValue=" + _arg1));
if (_local2 != null){
if (_arg1 != null){
_local2.text = _arg1;
} else {
_local2.text = "";
};
_local2.setSelection(0, (_local2.text.length - 1));
};
}
}
}//package editor.view.components
Section 56
//UI_Msg_Net_Error_Try_Again (editor.view.components.UI_Msg_Net_Error_Try_Again)
package editor.view.components {
import flash.display.*;
public class UI_Msg_Net_Error_Try_Again extends MovieClip {
public function UI_Msg_Net_Error_Try_Again(){
addFrameScript(0, frame1, 15, frame16);
}
public function set show(_arg1:Boolean):void{
if (_arg1){
gotoAndPlay("show");
} else {
gotoAndPlay("hide");
};
}
function frame16(){
stop();
}
function frame1(){
stop();
}
}
}//package editor.view.components
Section 57
//UI_Msg_Window (editor.view.components.UI_Msg_Window)
package editor.view.components {
import flash.display.*;
import flash.events.*;
import main.*;
import main.view.components.*;
import flash.text.*;
public class UI_Msg_Window extends UI_Window {
public var yes_btn:SimpleButton;
public var title_txt:TextField;
public var show_btn:Btn_Show;
public var msg_txt:TextField;
public var bg_mc:MovieClip;
public var icons_mc:UI_Msg_Icons;
public var no_btn:SimpleButton;
public static const ON_NO:String = "onNo";
public static const ON_YES:String = "onYes";
public function UI_Msg_Window(){
var _local1:SimpleButton;
super();
_local1 = (getChildByName("yes_btn") as SimpleButton);
if (_local1 != null){
_local1.addEventListener(MouseEvent.MOUSE_UP, listenOnYes, false, 0, true);
};
_local1 = (getChildByName("no_btn") as SimpleButton);
if (_local1 != null){
_local1.addEventListener(MouseEvent.MOUSE_UP, listenOnNo, false, 0, true);
};
setShowRect(((Global_Settings.stageWidth - width) >> 1), ((Global_Settings.stageHeight - height) >> 1), width, height);
setHideRect((Global_Settings.stageWidth >> 1), (Global_Settings.stageHeight >> 1), 1, 1);
disappearOnHide = true;
}
private function listenOnYes(_arg1:MouseEvent):void{
dispatchEvent(new Event(ON_YES));
}
public function get text():String{
var _local1:TextField;
_local1 = (getChildByName("msg_txt") as TextField);
if (_local1 != null){
return (_local1.text);
};
return (null);
}
public function get title():String{
var _local1:TextField;
_local1 = (getChildByName("title_txt") as TextField);
if (_local1 != null){
return (_local1.text);
};
return (null);
}
private function listenOnNo(_arg1:MouseEvent):void{
dispatchEvent(new Event(ON_NO));
}
public function set text(_arg1:String):void{
var _local2:TextField;
_local2 = (getChildByName("msg_txt") as TextField);
if (((!((_local2 == null))) && (!((_arg1 == null))))){
_local2.text = _arg1;
};
}
public function set cancelButton(_arg1:Boolean):void{
var _local2:SimpleButton;
var _local3:MovieClip;
_local2 = (getChildByName("no_btn") as SimpleButton);
if (_local2 != null){
_local2.visible = _arg1;
};
_local3 = (getChildByName("no_icon_mc") as MovieClip);
if (_local3 != null){
_local3.visible = _arg1;
_local3.mouseEnabled = false;
};
}
public function set title(_arg1:String):void{
var _local2:TextField;
_local2 = (getChildByName("title_txt") as TextField);
if (((!((_local2 == null))) && (!((_arg1 == null))))){
_local2.text = _arg1;
};
}
public function set icon(_arg1:int):void{
var _local2:UI_Msg_Icons;
_local2 = (getChildByName("icons_mc") as UI_Msg_Icons);
if (_local2 != null){
_local2.icon = _arg1;
};
}
}
}//package editor.view.components
Section 58
//UI_Open_Window (editor.view.components.UI_Open_Window)
package editor.view.components {
import flash.display.*;
import flash.events.*;
import main.view.components.*;
import flash.text.*;
import flash.ui.*;
public class UI_Open_Window extends UI_Window {
public var yes_btn:SimpleButton;
public var show_btn:Btn_Show;
public var open_txt:TextField;
public var bg_mc:MovieClip;
public var no_btn:SimpleButton;
public static const ON_ROLLOVER:String = "onRollOver";
private static const FT_TEXT:String = "open_txt";
public static const ON_YES:String = "onYes";
public static const ON_NO:String = "onNo";
public function UI_Open_Window(){
var _local1:SimpleButton;
super();
_local1 = (getChildByName("yes_btn") as SimpleButton);
if (_local1 != null){
_local1.addEventListener(MouseEvent.MOUSE_UP, listenOnYes, false, 0, true);
_local1.addEventListener(MouseEvent.MOUSE_OVER, listenRollover, false, 0, true);
};
_local1 = (getChildByName("no_btn") as SimpleButton);
if (_local1 != null){
_local1.addEventListener(MouseEvent.MOUSE_UP, listenOnNo, false, 0, true);
_local1.addEventListener(MouseEvent.MOUSE_OVER, listenRollover, false, 0, true);
};
setShowRect(100, 100, width, height);
setHideRect(250, 300, 0, 0);
disappearOnHide = true;
addEventListener(KeyboardEvent.KEY_DOWN, listenKeyDown, false, 0, true);
}
private function listenOnYes(_arg1:MouseEvent):void{
dispatchEvent(new Event(ON_YES));
}
public function get text():String{
var _local1:TextField;
_local1 = (getChildByName(FT_TEXT) as TextField);
if (_local1 != null){
return (_local1.text);
};
return (null);
}
private function listenOnNo(_arg1:MouseEvent):void{
dispatchEvent(new Event(ON_NO));
}
override protected function onShow():void{
var _local1:TextField;
_local1 = (getChildByName(FT_TEXT) as TextField);
stage.focus = _local1;
}
public function set text(_arg1:String):void{
var _local2:TextField;
_local2 = (getChildByName(FT_TEXT) as TextField);
if (((!((_local2 == null))) && (!((_arg1 == null))))){
_local2.text = _arg1;
};
}
private function listenKeyDown(_arg1:KeyboardEvent):void{
switch (_arg1.keyCode){
case Keyboard.ENTER:
dispatchEvent(new Event(ON_YES));
break;
case Keyboard.ESCAPE:
dispatchEvent(new Event(ON_NO));
break;
};
}
private function listenRollover(_arg1:MouseEvent):void{
dispatchEvent(new Event(ON_ROLLOVER));
}
}
}//package editor.view.components
Section 59
//UI_Save_Window (editor.view.components.UI_Save_Window)
package editor.view.components {
import flash.display.*;
import flash.events.*;
import main.view.components.*;
import shared_levels.view.components.*;
import flash.text.*;
import flash.system.*;
public class UI_Save_Window extends UI_Window {
public var title_txt:TextField;
public var show_btn:Btn_Show;
public var sendto_btn:SimpleButton;
public var toClipboard_btn:SimpleButton;
public var ok_btn:SimpleButton;
public var email_txt:TextField;
public var save_txt:TextField;
public var user_name_txt:TextField;
public var bg_mc:MovieClip;
public var progress_mc:UI_Loading;
public static const ON_OK:String = "onOk";
private static const ACTIVE_ALPHA:Number = 1;
private static const ERROR_MSG_NAME:String = "progress_mc";
private static const INACTIVE_ALPHA:Number = 0.5;
private static const USER_NAME_TEXT:String = "user_name_txt";
public static const ON_SEND:String = "onSend";
public static const ON_ROLLOVER:String = "onRollOver";
private static const TITLE_TEXT:String = "title_txt";
private static const EMAIL_TEXT:String = "email_txt";
private static const SEND_TO_BTN_NAME:String = "sendto_btn";
private static const PROGRESS_NAME:String = "progress_mc";
private static const FT_TEXT:String = "save_txt";
public function UI_Save_Window(){
var _local1:TextField;
super();
progress = false;
setShowRect(100, 100, width, height);
setHideRect(350, 300, 0, 0);
disappearOnHide = true;
_local1 = (getChildByName(FT_TEXT) as TextField);
if (_local1 != null){
_local1.addEventListener(MouseEvent.CLICK, listenOnClick, false, 0, true);
};
}
public function set userName(_arg1:String):void{
var _local2:TextField;
_local2 = (getChildByName(USER_NAME_TEXT) as TextField);
if (((!((_local2 == null))) && (!((_arg1 == null))))){
_local2.text = _arg1;
};
}
public function get userName():String{
var _local1:TextField;
_local1 = (getChildByName(USER_NAME_TEXT) as TextField);
if (_local1 != null){
return (_local1.text);
};
return (null);
}
private function listenOnClick(_arg1:MouseEvent):void{
var _local2:TextField;
_local2 = (getChildByName(FT_TEXT) as TextField);
if (_local2 != null){
_local2.setSelection(0, _local2.text.length);
System.setClipboard(_local2.text);
};
}
public function set email(_arg1:String):void{
var _local2:TextField;
_local2 = (getChildByName(EMAIL_TEXT) as TextField);
if (((!((_local2 == null))) && (!((_arg1 == null))))){
_local2.text = _arg1;
};
}
public function get text():String{
var _local1:TextField;
_local1 = (getChildByName(FT_TEXT) as TextField);
if (_local1 != null){
return (_local1.text);
};
return (null);
}
public function get levelTitle():String{
var _local1:TextField;
_local1 = (getChildByName(TITLE_TEXT) as TextField);
if (_local1 != null){
return (_local1.text);
};
return (null);
}
public function set cancel(_arg1:Boolean):void{
var _local2:UI_Loading;
_local2 = (getChildByName(PROGRESS_NAME) as UI_Loading);
if (_local2 != null){
_local2.cancel = _arg1;
};
}
private function listenOnToClipboard(_arg1:MouseEvent):void{
System.setClipboard(text);
setShow(false);
}
public function set levelTitle(_arg1:String):void{
var _local2:TextField;
_local2 = (getChildByName(TITLE_TEXT) as TextField);
if (((!((_local2 == null))) && (!((_arg1 == null))))){
_local2.text = _arg1;
};
}
override protected function onShow():void{
var _local1:TextField;
_local1 = (getChildByName(FT_TEXT) as TextField);
stage.focus = _local1;
}
public function set canShareLevel(_arg1:Boolean):void{
var _local2:SimpleButton;
_local2 = (getChildByName(SEND_TO_BTN_NAME) as SimpleButton);
if (_local2 != null){
_local2.visible = _arg1;
};
}
private function listenOnOk(_arg1:MouseEvent):void{
dispatchEvent(new Event(ON_OK));
}
public function set text(_arg1:String):void{
var _local2:TextField;
if (_arg1 != null){
_local2 = (getChildByName(FT_TEXT) as TextField);
if (_local2 != null){
_local2.text = _arg1;
};
};
}
public function get email():String{
var _local1:TextField;
_local1 = (getChildByName(EMAIL_TEXT) as TextField);
if (_local1 != null){
return (_local1.text);
};
return (null);
}
private function listenOnSendTo(_arg1:MouseEvent):void{
dispatchEvent(new Event(ON_SEND));
}
public function set tryAgain(_arg1:Boolean):void{
var _local2:UI_Loading;
_local2 = (getChildByName(PROGRESS_NAME) as UI_Loading);
if (_local2 != null){
_local2.tryAgain = _arg1;
};
}
public function set progress(_arg1:Boolean):void{
var _local2:SimpleButton;
var _local3:UI_Loading;
_local2 = (getChildByName("ok_btn") as SimpleButton);
if (_local2 != null){
if (_arg1){
_local2.alpha = INACTIVE_ALPHA;
_local2.enabled = false;
_local2.removeEventListener(MouseEvent.MOUSE_UP, listenOnOk);
_local2.removeEventListener(MouseEvent.MOUSE_OVER, listenRollover);
} else {
_local2.alpha = ACTIVE_ALPHA;
_local2.enabled = true;
_local2.addEventListener(MouseEvent.MOUSE_UP, listenOnOk, false, 0, true);
_local2.addEventListener(MouseEvent.MOUSE_OVER, listenRollover, false, 0, true);
};
};
_local2 = (getChildByName("toClipboard_btn") as SimpleButton);
if (_local2 != null){
if (_arg1){
_local2.alpha = INACTIVE_ALPHA;
_local2.enabled = false;
_local2.removeEventListener(MouseEvent.MOUSE_UP, listenOnToClipboard, false);
_local2.removeEventListener(MouseEvent.MOUSE_OVER, listenRollover, false);
} else {
_local2.alpha = ACTIVE_ALPHA;
_local2.enabled = true;
_local2.addEventListener(MouseEvent.MOUSE_UP, listenOnToClipboard, false, 0, true);
_local2.addEventListener(MouseEvent.MOUSE_OVER, listenRollover, false, 0, true);
};
};
_local2 = (getChildByName(SEND_TO_BTN_NAME) as SimpleButton);
if (_local2 != null){
if (_arg1){
_local2.alpha = INACTIVE_ALPHA;
_local2.enabled = false;
_local2.removeEventListener(MouseEvent.MOUSE_UP, listenOnSendTo, false);
_local2.removeEventListener(MouseEvent.MOUSE_OVER, listenRollover, false);
} else {
_local2.alpha = ACTIVE_ALPHA;
_local2.enabled = true;
_local2.addEventListener(MouseEvent.MOUSE_UP, listenOnSendTo, false, 0, true);
_local2.addEventListener(MouseEvent.MOUSE_OVER, listenRollover, false, 0, true);
};
};
_local3 = (getChildByName(PROGRESS_NAME) as UI_Loading);
if (_local3 != null){
_local3.loading = _arg1;
};
hideShowOnOpenBtn = !(_arg1);
}
private function listenRollover(_arg1:MouseEvent):void{
dispatchEvent(new Event(ON_ROLLOVER));
}
}
}//package editor.view.components
Section 60
//UI_Scroll (editor.view.components.UI_Scroll)
package editor.view.components {
import flash.display.*;
import flash.utils.*;
import flash.events.*;
public class UI_Scroll extends MovieClip {
private var m_timer:Timer;
public var up_scroll_btn:SimpleButton;
private var m_nPos:int;// = 0
public var down_scroll_btn:SimpleButton;
private var m_nMaxPos:int;
private var m_nDPos:int;
public static const D_POS:int = 10;
public static const ON_SCROLL:String = "onScroll";
public function UI_Scroll(){
var _local1:DisplayObject;
m_timer = new Timer((1000 / 25));
m_nPos = 0;
super();
_local1 = getChildByName("up_scroll_btn");
if (_local1 != null){
_local1.addEventListener(MouseEvent.MOUSE_DOWN, listenUpScrollDown, false, 0, true);
_local1.addEventListener(MouseEvent.MOUSE_UP, listenUpScrollUp, false, 0, true);
};
_local1 = getChildByName("down_scroll_btn");
if (_local1 != null){
_local1.addEventListener(MouseEvent.MOUSE_DOWN, listenDownScrollDown, false, 0, true);
_local1.addEventListener(MouseEvent.MOUSE_UP, listenDownScrollUp, false, 0, true);
};
}
private function updateBtns():void{
var _local1:DisplayObject;
_local1 = getChildByName("up_scroll_btn");
_local1.alpha = ((m_nPos)==0) ? 0.5 : 1;
_local1 = getChildByName("down_scroll_btn");
_local1.alpha = ((m_nPos)==m_nMaxPos) ? 0.5 : 1;
}
public function set show(_arg1:Boolean):void{
if (visible != _arg1){
visible = _arg1;
if (!_arg1){
stopScroll();
};
};
}
private function listenUpScrollUp(_arg1:MouseEvent):void{
stopScroll();
}
public function get pos():int{
return (m_nPos);
}
private function listenUpScrollDown(_arg1:MouseEvent):void{
startScroll(-(D_POS));
}
private function stopScroll():void{
if (m_timer != null){
m_timer.stop();
m_timer.removeEventListener(TimerEvent.TIMER, listenTimer, false);
};
}
public function set pos(_arg1:int):void{
if (_arg1 > m_nMaxPos){
_arg1 = m_nMaxPos;
};
if (_arg1 < 0){
_arg1 = 0;
};
m_nPos = _arg1;
updateBtns();
dispatchEvent(new Event(ON_SCROLL));
}
public function set maxPos(_arg1:int):void{
m_nMaxPos = _arg1;
if (m_nPos > m_nMaxPos){
pos = m_nMaxPos;
} else {
updateBtns();
};
}
private function listenDownScrollUp(_arg1:MouseEvent):void{
stopScroll();
}
private function listenTimer(_arg1:TimerEvent):void{
var _local2:int;
_local2 = (m_nPos + m_nDPos);
if ((((_local2 > m_nMaxPos)) || ((_local2 < 0)))){
stopScroll();
};
pos = _local2;
}
private function startScroll(_arg1:int):void{
m_nDPos = _arg1;
stopScroll();
if (m_timer == null){
m_timer = new Timer((1000 / 25));
};
m_timer.addEventListener(TimerEvent.TIMER, listenTimer, false, 0, true);
m_timer.start();
}
private function listenDownScrollDown(_arg1:MouseEvent):void{
startScroll(D_POS);
}
}
}//package editor.view.components
Section 61
//EditorMediator (editor.view.EditorMediator)
package editor.view {
import flash.display.*;
import flash.events.*;
import game.model.*;
import org.puremvc.as3.interfaces.*;
import com.*;
import shared_levels.model.*;
import main.*;
import editor.model.*;
import editor.view.components.*;
import game.view.*;
import main.view.*;
import main.view.components.*;
import game.view.components.*;
import flash.ui.*;
public class EditorMediator extends PageMediator {
private var m_mLevelMouseCatcher:LevelMouseCatcherMediator;
private var m_mLevel:LevelMediator;
private var m_mElementsSelector:ElementsSelectorMediator;
private var m_pEditor:EditorProxy;
private var m_mSaveWindow:SaveWindowMediator;
private var m_mMsgLevelUrl:MsgLevelUrlMediator;
private var m_mOpenWindow:OpenWindowMediator;
private var m_mLevelsSelector:LevelsSelectorMediator;
public static const ON_SAVE_BTN:int = (PageEvent.COM_TYPE_LAST + 2);
public static const ON_OPEN_BTN:int = (PageEvent.COM_TYPE_LAST + 3);
public static const NAME:String = "EditorPageMediator";
public static const ON_NEW_BTN:int = (PageEvent.COM_TYPE_LAST + 1);
public function EditorMediator(_arg1:Object){
var _local2:UI_Elements_Holder;
var _local3:UI_ElementsSelector;
var _local4:UI_LevelsSelector;
var _local5:UI_Open_Window;
var _local6:UI_Save_Window;
var _local7:UI_Msg_Level_Url;
super(_arg1);
m_pEditor = (facade.retrieveProxy(EditorProxy.NAME) as EditorProxy);
showLevel(m_pEditor.selectLevel);
m_mLevelMouseCatcher = new LevelMouseCatcherMediator((m_mLevel.ui as DisplayObject));
facade.registerMediator(m_mLevelMouseCatcher);
_local2 = (ui.getChildByName("elementsHolder_mc") as UI_Elements_Holder);
_local3 = (_local2.getChildByName(UI_Elements_Holder.ELEMENTS_SELECTOR_NAME) as UI_ElementsSelector);
trace(("uiElementsSelector=" + _local3));
if (_local3 == null){
};
_local2.elements = _local3;
m_mElementsSelector = new ElementsSelectorMediator(_local3);
facade.registerMediator(m_mElementsSelector);
_local4 = (ui.getChildByName("levelsSelector_mc") as UI_LevelsSelector);
if (_local4 == null){
_local4 = new UI_LevelsSelector();
ui.addChild(_local4);
};
m_mLevelsSelector = new LevelsSelectorMediator(_local4);
facade.registerMediator(m_mLevelsSelector);
_local5 = (ui.getChildByName("openWindow_mc") as UI_Open_Window);
if (_local5 == null){
_local5 = new UI_Open_Window();
ui.addChild(_local5);
};
_local5.visible = false;
m_mOpenWindow = new OpenWindowMediator(_local5, m_pEditor.levelsProxy);
facade.registerMediator(m_mOpenWindow);
m_mOpenWindow.show = false;
_local6 = (ui.getChildByName("saveWindow_mc") as UI_Save_Window);
if (_local6 == null){
_local6 = new UI_Save_Window();
ui.addChild(_local6);
};
_local6.visible = false;
m_mSaveWindow = new SaveWindowMediator(_local6);
facade.registerMediator(m_mSaveWindow);
m_mSaveWindow.show = false;
ui.stage.addEventListener(KeyboardEvent.KEY_DOWN, listenKeyDown, false, 0, true);
ui.stage.focus = ui.stage;
_local7 = (ui.getChildByName(UI_Editor.LEVEL_URL_MSG_NAME) as UI_Msg_Level_Url);
trace(("uiMsgLevelUrl=" + _local7));
if (_local7 == null){
_local7 = new UI_Msg_Level_Url();
ui.addChild(_local7);
};
m_mMsgLevelUrl = new MsgLevelUrlMediator(_local7);
facade.registerMediator(m_mMsgLevelUrl);
m_mMsgLevelUrl.setShow(false, false);
_local2.addEventListener(UI_Elements_Holder.ON_OPEN, listenOnOpen, false, 0, true);
_local2.addEventListener(UI_Elements_Holder.ON_SAVE, listenOnSave, false, 0, true);
_local2.addEventListener(UI_Elements_Holder.ON_ROLLOVER_ON_BTN, listenOnRollOver, false, 0, true);
_local2.addEventListener(UI_Elements_Holder.ON_TEMPATE_EMPTY, listenTemplate_Empty, false, 0, true);
_local2.addEventListener(UI_Elements_Holder.ON_TEMPATE_WALL_BOX, listenTemplate_WallBox, false, 0, true);
_local2.addEventListener(UI_Elements_Holder.ON_TEMPATE_FILL_FLOOR_GROUND, listenTemplate_FillFloorGround, false, 0, true);
_local2.addEventListener(UI_Elements_Holder.ON_TEMPATE_FILL_FLOOR_GROUND_RAND, listenTemplate_FillFloorGroundRand, false, 0, true);
_local2.addEventListener(UI_Elements_Holder.ON_TEMPATE_FILL_FLOOR_TILE_LIGHT, listenTemplate_FillFloorTileLight, false, 0, true);
_local2.addEventListener(UI_Elements_Holder.ON_TEMPATE_FILL_FLOOR_TILE_DARK, listenTemplate_FillFloorTileDark, false, 0, true);
_local2.addEventListener(UI_Elements_Holder.ON_PLAY_LEVEL, listenPlayLevel, false, 0, true);
_local2.addEventListener(UI_Elements_Holder.ON_GOTO_MENU, listenGotoMenu, false, 0, true);
}
private function listenTemplate_Empty(_arg1:Event):void{
sendNotification(ApplicationFacade.LEVEL_USE_TEMPLATE_EMPTY, m_pEditor.levelProxy);
sendNotification(ApplicationFacade.CLICK_ON_BTN);
}
private function showLevel(_arg1:LevelProxy):Boolean{
var _local2:int;
var _local3:int;
var _local4:UI_Level;
if (_arg1 != null){
if (m_mLevel != null){
if (m_mLevel.proxy == _arg1){
return (true);
};
_local2 = m_mLevel.ui.x;
_local3 = m_mLevel.ui.y;
if (((!((m_mLevel.ui == null))) && ((m_mLevel.ui.parent == ui)))){
ui.removeChild(m_mLevel.ui);
};
m_mLevel.clear();
facade.removeMediator(m_mLevel.getMediatorName());
};
_local4 = (ui.getChildByName("level_mc") as UI_Level);
if (_local4 == null){
_local4 = new UI_Level();
ui.addChildAt(_local4, 1);
_local4.x = _local2;
_local4.y = _local3;
};
m_mLevel = new LevelMediator(_local4, _arg1);
facade.registerMediator(m_mLevel);
if (((!((m_mLevelMouseCatcher == null))) && (!((m_mLevel == null))))){
m_mLevelMouseCatcher.target = m_mLevel.ui;
};
return (true);
};
return (false);
}
private function onSelectPoint(_arg1:EventSelectPos):void{
sendNotification(ApplicationFacade.EDITOR_SELECT_POS, _arg1);
}
private function listenOnRollOver(_arg1:Event):void{
sendNotification(ApplicationFacade.ROLL_ON_BTN);
}
override public function inactivate(_arg1:Boolean=true):void{
var _local2:UI_Elements_Holder;
trace("X");
trace("EditorMediator override public function inactivate(bSet:Boolean=true):void");
trace(("bSet=" + _arg1));
super.inactivate(_arg1);
if (m_mElementsSelector != null){
m_mElementsSelector.active = !(_arg1);
};
_local2 = (ui.getChildByName("elementsHolder_mc") as UI_Elements_Holder);
if (_local2 != null){
_local2.active = !(_arg1);
};
}
private function onLevelSelected(_arg1:LevelProxy):void{
showLevel(_arg1);
}
private function listenOnSave(_arg1:Event):void{
sendNotification(ApplicationFacade.LEVEL_ASK_SAVING, m_pEditor.levelsProxy);
sendNotification(ApplicationFacade.CLICK_ON_BTN);
}
private function onLoadLevel(_arg1:LevelProxy):void{
if (_arg1 == null){
} else {
m_mOpenWindow.show = false;
};
}
public function init():void{
m_mElementsSelector.init();
m_mLevelsSelector.levels = m_pEditor.levelsProxy;
}
protected function get ui():UI_Editor{
return ((viewComponent as UI_Editor));
}
private function listenTemplate_FillFloorTileDark(_arg1:Event):void{
sendNotification(ApplicationFacade.LEVEL_USE_TEMPLATE_FILL_FLOOR_TILE_DARK, m_pEditor.levelProxy);
sendNotification(ApplicationFacade.CLICK_ON_BTN);
}
private function onAskSavingLevel():void{
var _local1:LevelProxy;
var _local2:String;
if (m_mSaveWindow.show){
m_mSaveWindow.show = false;
} else {
_local1 = levelProxy;
if (_local1 != null){
if (Global_Settings.COMPRESS_SAVE_LOAD){
_local2 = _local1.toXMLStringCompressed;
} else {
_local2 = _local1.toXMLString;
};
if (_local2 != null){
m_mSaveWindow.text = _local2;
};
m_mSaveWindow.show = true;
trace(("pLevel.canSolve=" + _local1.canSolve));
m_mSaveWindow.canShareLevel = _local1.canSolve;
};
};
}
private function listenPlayLevel(_arg1:Event):void{
sendNotification(ApplicationFacade.PLAY_EDIT_LEVEL, m_pEditor.levelProxy);
sendNotification(ApplicationFacade.CLICK_ON_BTN);
}
private function listenTemplate_FillFloorGround(_arg1:Event):void{
sendNotification(ApplicationFacade.LEVEL_USE_TEMPLATE_FILL_FLOOR_GROUND, m_pEditor.levelProxy);
sendNotification(ApplicationFacade.CLICK_ON_BTN);
}
private function onAskSaving():void{
var _local1:LevelsProxy;
var _local2:String;
if (m_mSaveWindow.show){
m_mSaveWindow.show = false;
} else {
_local1 = levelsProxy;
if (_local1 != null){
if (Global_Settings.COMPRESS_SAVE_LOAD){
_local2 = _local1.toXMLStringCompressed;
} else {
_local2 = _local1.toXMLString;
};
if (_local2 != null){
m_mSaveWindow.text = _local2;
};
m_mSaveWindow.show = true;
};
};
}
private function getPLevelByID(_arg1:int):LevelProxy{
return (m_pEditor.getLevelByID(_arg1));
}
private function get levelsProxy():LevelsProxy{
if (m_pEditor != null){
return (m_pEditor.levelsProxy);
};
return (null);
}
private function listenTemplate_WallBox(_arg1:Event):void{
sendNotification(ApplicationFacade.LEVEL_USE_TEMPLATE_WALL_BOX, m_pEditor.levelProxy);
sendNotification(ApplicationFacade.CLICK_ON_BTN);
}
private function onAskLoading():void{
m_mOpenWindow.loadingLevels = true;
m_mOpenWindow.show = !(m_mOpenWindow.show);
m_mOpenWindow.text = "";
}
override public function onRemove():void{
super.onRemove();
if (m_mLevel != null){
facade.removeMediator(m_mLevel.getMediatorName());
};
if (m_mLevelMouseCatcher != null){
facade.removeMediator(m_mLevelMouseCatcher.getMediatorName());
};
if (m_mElementsSelector != null){
facade.removeMediator(m_mElementsSelector.getMediatorName());
};
if (m_mLevelsSelector != null){
facade.removeMediator(m_mLevelsSelector.getMediatorName());
};
if (m_mOpenWindow != null){
facade.removeMediator(m_mOpenWindow.getMediatorName());
};
if (m_mSaveWindow != null){
facade.removeMediator(m_mSaveWindow.getMediatorName());
};
if (ui != null){
if (ui.stage != null){
ui.stage.removeEventListener(KeyboardEvent.KEY_DOWN, listenKeyDown, false);
};
};
}
override public function handleNotification(_arg1:INotification):void{
switch (_arg1.getName()){
case ApplicationFacade.SELECT_POS:
onSelectPoint((_arg1.getBody() as EventSelectPos));
break;
case ApplicationFacade.CHANGE_ACTIVE_LAYER:
onChangeActiveLayer((_arg1.getBody() as int));
break;
case ApplicationFacade.CHANGE_DOUBLE_INTERPRET:
onChangeDoubleInterpret((_arg1.getBody() as int));
break;
case ApplicationFacade.CHANGE_MOVEBYX:
onChangeMoveByX((_arg1.getBody() as int));
break;
case ApplicationFacade.CHANGE_MOVEBYY:
onChangeMoveByY((_arg1.getBody() as int));
break;
case ApplicationFacade.ELEMENT_SELECTED:
onElementSelected((_arg1.getBody() as ElementProxy));
break;
case ApplicationFacade.LEVEL_SELECTED:
onLevelSelected((_arg1.getBody() as LevelProxy));
break;
case ApplicationFacade.LEVELS_ASK_LOADING:
onAskLoading();
break;
case ApplicationFacade.LEVELS_ASK_SAVING:
onAskSaving();
break;
case ApplicationFacade.LEVELS_LOAD:
onLoad((_arg1.getBody() as LevelsProxy));
break;
case ApplicationFacade.LEVEL_ASK_LOADING:
onAskLoadingLevel();
break;
case ApplicationFacade.LEVEL_ASK_SAVING:
onAskSavingLevel();
break;
case ApplicationFacade.LEVEL_LOAD:
onLoadLevel((_arg1.getBody() as LevelProxy));
break;
case ApplicationFacade.SL_RECEIVE_SET_LEVEL:
onReceiveSetLevel((_arg1.getBody() as SharedLevelProxy));
break;
};
super.handleNotification(_arg1);
}
private function onChangeDoubleInterpret(_arg1:int):void{
m_mLevelMouseCatcher.doubleInterpret = _arg1;
}
override public function onRegister():void{
super.onRegister();
init();
}
private function listenGotoMenu(_arg1:Event):void{
sendNotification(ApplicationFacade.GOTO_MENU_FROM_EDIT);
sendNotification(ApplicationFacade.CLICK_ON_BTN);
}
private function listenKeyDown(_arg1:KeyboardEvent):void{
switch (_arg1.keyCode){
case Keyboard.ESCAPE:
m_mElementsSelector.show = !(m_mElementsSelector.show);
m_mLevelsSelector.show = false;
break;
case 83:
if (_arg1.ctrlKey){
sendNotification(ApplicationFacade.LEVEL_ASK_SAVING);
};
break;
case 79:
if (_arg1.ctrlKey){
if (_arg1.altKey){
sendNotification(ApplicationFacade.LEVELS_ASK_LOADING);
} else {
sendNotification(ApplicationFacade.LEVEL_ASK_LOADING);
};
};
break;
case Keyboard.DELETE:
if (_arg1.ctrlKey){
m_mLevelsSelector.tryDel();
};
break;
};
}
private function onElementSelected(_arg1:ElementProxy):void{
}
override public function listNotificationInterests():Array{
var _local1:Array;
_local1 = super.listNotificationInterests();
_local1.push(ApplicationFacade.SELECT_POS);
_local1.push(ApplicationFacade.CHANGE_ACTIVE_LAYER);
_local1.push(ApplicationFacade.ELEMENT_SELECTED);
_local1.push(ApplicationFacade.CHANGE_DOUBLE_INTERPRET);
_local1.push(ApplicationFacade.CHANGE_MOVEBYX);
_local1.push(ApplicationFacade.CHANGE_MOVEBYY);
_local1.push(ApplicationFacade.LEVEL_SELECTED);
_local1.push(ApplicationFacade.LEVELS_ASK_SAVING);
_local1.push(ApplicationFacade.LEVELS_ASK_LOADING);
_local1.push(ApplicationFacade.LEVELS_LOAD);
_local1.push(ApplicationFacade.LEVEL_ASK_SAVING);
_local1.push(ApplicationFacade.LEVEL_ASK_LOADING);
_local1.push(ApplicationFacade.LEVEL_LOAD);
_local1.push(ApplicationFacade.CANT_SOLVE_EDIT_LEVEL);
_local1.push(ApplicationFacade.SL_RECEIVE_SET_LEVEL);
return (_local1);
}
private function onChangeMoveByX(_arg1:int):void{
m_mLevelMouseCatcher.moveByX = _arg1;
}
private function onLoad(_arg1:LevelsProxy):void{
if (_arg1 == null){
} else {
m_mOpenWindow.show = false;
};
}
private function listenPlayLevels(_arg1:Event):void{
sendNotification(ApplicationFacade.PLAY_EDIT_LEVELS, m_pEditor.levelsProxy);
sendNotification(ApplicationFacade.CLICK_ON_BTN);
}
override protected function onCommand(_arg1:int, _arg2:Object):void{
super.onCommand(_arg1, _arg2);
switch (_arg1){
case ON_NEW_BTN:
break;
case ON_SAVE_BTN:
break;
case ON_OPEN_BTN:
break;
};
}
private function onReceiveSetLevel(_arg1:SharedLevelProxy):void{
trace("X");
trace("EditorMediator private function onReceiveSetLevel(pSL:SharedLevelProxy):void");
trace(("pSL=" + _arg1));
if (_arg1 != null){
trace(("pSL.url=" + _arg1.url));
m_mMsgLevelUrl.value = _arg1.url;
m_mMsgLevelUrl.show = true;
};
}
private function listenOnOpen(_arg1:Event):void{
sendNotification(ApplicationFacade.LEVEL_ASK_LOADING, m_pEditor.levelsProxy);
sendNotification(ApplicationFacade.CLICK_ON_BTN);
}
private function onChangeMoveByY(_arg1:int):void{
m_mLevelMouseCatcher.moveByY = _arg1;
}
private function getLayerType(_arg1:int):int{
var _local2:LevelProxy;
_local2 = m_pEditor.selectLevel;
if (_local2 != null){
return (_local2.getLayerTypeByID(_arg1));
};
return (CommonFunc.INT_UNDEF);
}
private function get levelProxy():LevelProxy{
if (m_pEditor != null){
return (m_pEditor.selectLevel);
};
return (null);
}
private function onAskLoadingLevel():void{
m_mOpenWindow.loadingLevels = false;
m_mOpenWindow.show = !(m_mOpenWindow.show);
m_mOpenWindow.text = "";
}
private function onChangeActiveLayer(_arg1:int):void{
var _local2:int;
_local2 = getLayerType(_arg1);
m_mLevelMouseCatcher.layerType = _local2;
}
private function listenTemplate_FillFloorTileLight(_arg1:Event):void{
sendNotification(ApplicationFacade.LEVEL_USE_TEMPLATE_FILL_FLOOR_TILE_LIGHT, m_pEditor.levelProxy);
sendNotification(ApplicationFacade.CLICK_ON_BTN);
}
private function listenTemplate_FillFloorGroundRand(_arg1:Event):void{
sendNotification(ApplicationFacade.LEVEL_USE_TEMPLATE_FILL_FLOOR_GROUND_RAND, m_pEditor.levelProxy);
sendNotification(ApplicationFacade.CLICK_ON_BTN);
}
}
}//package editor.view
Section 62
//ElementsCollectionSelectorMediator (editor.view.ElementsCollectionSelectorMediator)
package editor.view {
import org.puremvc.as3.interfaces.*;
import main.*;
import editor.model.*;
import editor.view.components.*;
import org.puremvc.as3.patterns.mediator.*;
public class ElementsCollectionSelectorMediator extends Mediator implements IMediator {
private var m_mTopElement:ElementSelectorMediator;
private var m_arCollection:Array;
private var m_pFocusElement:ElementProxy;
private var m_pActiveElement:ElementProxy;
private var m_pElement:ElementProxy;
public static const NAME:String = "ElementsCollectionSelectorMediator";
public function ElementsCollectionSelectorMediator(_arg1:Object, _arg2:ElementProxy){
m_arCollection = new Array();
m_pElement = _arg2;
super(_arg2.getProxyName(), _arg1);
init();
}
private function setElementFocus(_arg1:Boolean, _arg2:ElementProxy):void{
var _local3:ElementSelectorMediator;
_local3 = getElementMediator(_arg2);
if (_local3 != null){
_local3.focus = _arg1;
};
}
public function set topElement(_arg1:ElementSelectorMediator):void{
m_mTopElement = _arg1;
}
private function init():void{
var _local1:ElementProxy;
var _local2:int;
var _local3:int;
_local2 = m_pElement.count;
if (_local2 <= 0){
ui.visible = false;
} else {
_local3 = 0;
while (_local3 < _local2) {
_local1 = m_pElement.getElement(_local3);
if (_local1 != null){
addElement(_local1);
};
_local3++;
};
ui.setShow(false);
};
}
private function onFocusElement(_arg1:ElementProxy):void{
if (m_pFocusElement != _arg1){
setElementFocus(false, m_pFocusElement);
m_pFocusElement = _arg1;
setElementFocus(true, m_pFocusElement);
};
}
private function getElementMediator(_arg1:ElementProxy):ElementSelectorMediator{
var _local2:ElementSelectorMediator;
for each (_local2 in m_arCollection) {
if (((!((_local2 == null))) && ((_local2.activeElement == _arg1)))){
return (_local2);
};
};
return (null);
}
override public function listNotificationInterests():Array{
return ([ApplicationFacade.ELEMENT_FOCUSED, ApplicationFacade.ELEMENT_SELECTING, ApplicationFacade.ELEMENT_SELECTED, ApplicationFacade.ELEMENT_UNSELECTED]);
}
public function get ui():UI_ElementCollectionSelector{
return ((viewComponent as UI_ElementCollectionSelector));
}
private function setElementSelect(_arg1:Boolean, _arg2:ElementProxy):void{
var _local3:ElementSelectorMediator;
_local3 = getElementMediator(_arg2);
if (_local3 != null){
_local3.select = _arg1;
if (topElement != null){
topElement.activeElement = _local3.proxy;
};
};
}
private function addElement(_arg1:ElementProxy):Boolean{
var _local2:UI_ElementSelector;
var _local3:ElementSelectorMediator;
if (_arg1 != null){
_local2 = new UI_ElementSelector();
_local3 = new ElementSelectorMediator(_local2, _arg1);
if (_local2.createElement(_arg1.m_id, _arg1.m_nIDLayer, _arg1.m_nIDElement, _arg1.m_strName)){
ui.addElement(_local2);
m_arCollection.push(_local3);
return (true);
};
};
return (false);
}
private function onElementSelected(_arg1:Boolean, _arg2:ElementProxy):void{
setElementSelect(_arg1, _arg2);
}
public function get proxy():ElementProxy{
return (m_pElement);
}
public function get count():int{
return (m_arCollection.length);
}
override public function handleNotification(_arg1:INotification):void{
switch (_arg1.getName()){
case ApplicationFacade.ELEMENT_FOCUSED:
onFocusElement((_arg1.getBody() as ElementProxy));
break;
case ApplicationFacade.ELEMENT_SELECTING:
onSelectingElement((_arg1.getBody() as ElementProxy));
break;
case ApplicationFacade.ELEMENT_SELECTED:
onElementSelected(true, (_arg1.getBody() as ElementProxy));
break;
case ApplicationFacade.ELEMENT_UNSELECTED:
onElementSelected(false, (_arg1.getBody() as ElementProxy));
break;
};
super.handleNotification(_arg1);
}
private function onSelectingElement(_arg1:ElementProxy):void{
}
public function get topElement():ElementSelectorMediator{
return (m_mTopElement);
}
}
}//package editor.view
Section 63
//ElementSelectorMediator (editor.view.ElementSelectorMediator)
package editor.view {
import flash.events.*;
import org.puremvc.as3.interfaces.*;
import main.*;
import editor.model.*;
import editor.view.components.*;
import org.puremvc.as3.patterns.mediator.*;
public class ElementSelectorMediator extends Mediator implements IMediator {
private var m_pActiveElement:ElementProxy;
private var m_pElement:ElementProxy;
private var m_mElementsCollection:ElementsCollectionSelectorMediator;
public static const NAME:String = "ElementSelectorMediator";
public function ElementSelectorMediator(_arg1:Object, _arg2:ElementProxy){
m_pElement = _arg2;
super(((NAME + "_") + _arg2.getProxyName()), _arg1);
initCollection();
activeElement = _arg2.select;
ui.addEventListener(UI_ElementSelector.ELEMENT_FOCUS, listenFocus, false, 0, true);
ui.addEventListener(UI_ElementSelector.ELEMENT_SELECT, listenSelect, false, 0, true);
}
public function set focus(_arg1:Boolean):void{
ui.focus = _arg1;
}
private function initCollection():void{
var _local1:UI_ElementCollectionSelector;
_local1 = (ui.getChildByName("collection_mc") as UI_ElementCollectionSelector);
if (_local1 == null){
_local1 = new UI_ElementCollectionSelector();
ui.addChild(_local1);
};
_local1.head = ui;
ui.childCollection = _local1;
m_mElementsCollection = new ElementsCollectionSelectorMediator(_local1, proxy);
m_mElementsCollection.topElement = this;
ui.listenChangeChildCollection(m_mElementsCollection);
facade.registerMediator(m_mElementsCollection);
}
private function listenFocus(_arg1:Event):void{
sendNotification(ApplicationFacade.ELEMENT_FOCUSED, m_pActiveElement);
}
override public function listNotificationInterests():Array{
return ([ApplicationFacade.ELEMENT_SELECTED, ApplicationFacade.ELEMENT_UNSELECTED]);
}
public function get ui():UI_ElementSelector{
return ((viewComponent as UI_ElementSelector));
}
public function get activeElement():ElementProxy{
return (m_pActiveElement);
}
private function listenSelect(_arg1:Event):void{
sendNotification(ApplicationFacade.ELEMENT_SELECTING, m_pActiveElement);
}
public function set activeElement(_arg1:ElementProxy):void{
if (_arg1 == null){
_arg1 = proxy;
};
m_pActiveElement = _arg1;
if (m_pActiveElement != null){
ui.createElement(m_pActiveElement.m_id, m_pActiveElement.m_nIDLayer, m_pActiveElement.m_nIDElement, m_pActiveElement.m_strName);
};
}
public function get proxy():ElementProxy{
return (m_pElement);
}
override public function handleNotification(_arg1:INotification):void{
switch (_arg1.getName()){
case ApplicationFacade.ELEMENT_SELECTED:
case ApplicationFacade.ELEMENT_UNSELECTED:
break;
};
super.handleNotification(_arg1);
}
public function set select(_arg1:Boolean):void{
ui.select = _arg1;
}
}
}//package editor.view
Section 64
//ElementsSelectorMediator (editor.view.ElementsSelectorMediator)
package editor.view {
import flash.events.*;
import org.puremvc.as3.interfaces.*;
import main.*;
import editor.model.*;
import editor.view.components.*;
import org.puremvc.as3.patterns.mediator.*;
public class ElementsSelectorMediator extends Mediator implements IMediator {
private var m_pFocusElement:ElementProxy;
private var m_pActiveElement:ElementProxy;
private var m_pElements:ElementsProxy;
private var m_arElement:Array;
public static const NAME:String = "ElementsSelectorMediator";
public function ElementsSelectorMediator(_arg1:Object){
m_arElement = new Array();
super(NAME, _arg1);
m_pElements = (facade.retrieveProxy(ElementsProxy.NAME) as ElementsProxy);
ui.addEventListener(UI_ElementsSelector.ON_RESIZE, listenOnResize, false, 0, true);
}
private function onElementSelected(_arg1:Boolean, _arg2:ElementProxy):void{
setElementSelect(_arg1, _arg2);
if (_arg1){
sendNotification(ApplicationFacade.CLICK_ON_BTN, _arg2);
};
}
private function addElement(_arg1:ElementProxy):Boolean{
var _local2:UI_ElementSelector;
var _local3:ElementSelectorMediator;
if (_arg1 != null){
_local2 = new UI_ElementSelector();
_local3 = new ElementSelectorMediator(_local2, _arg1);
if (_local2.createElement(_arg1.m_id, _arg1.m_nIDLayer, _arg1.m_nIDElement, _arg1.m_strName)){
ui.addElement(_local2);
m_arElement.push(_local3);
return (true);
};
};
return (false);
}
public function set active(_arg1:Boolean):void{
ui.active = _arg1;
}
private function onSelectingElement(_arg1:ElementProxy):void{
}
public function init():Boolean{
var _local1:int;
var _local2:int;
var _local3:ElementProxy;
if (m_pElements != null){
_local1 = m_pElements.count;
_local2 = 0;
while (_local2 < _local1) {
_local3 = m_pElements.getElement(_local2);
if (_local3 == null){
} else {
addElement(_local3);
};
_local2++;
};
ui.rearrange();
sendNotification(ApplicationFacade.ELEMENT_SELECTING, m_pElements.selectedElement);
return (true);
};
return (false);
}
public function set show(_arg1:Boolean):void{
var _local2:UI_Elements_Holder;
_local2 = (ui.parent as UI_Elements_Holder);
if (_local2 != null){
_local2.show = _arg1;
};
}
private function onFocusElement(_arg1:ElementProxy):void{
if (m_pFocusElement != _arg1){
setElementFocus(false, m_pFocusElement);
m_pFocusElement = _arg1;
setElementFocus(true, m_pFocusElement);
sendNotification(ApplicationFacade.ROLL_ON_BTN, _arg1);
};
}
private function getElementMediator(_arg1:ElementProxy):ElementSelectorMediator{
var _local2:ElementSelectorMediator;
for each (_local2 in m_arElement) {
if (((!((_local2 == null))) && ((_local2.activeElement == _arg1)))){
return (_local2);
};
};
return (null);
}
override public function listNotificationInterests():Array{
return ([ApplicationFacade.ELEMENT_FOCUSED, ApplicationFacade.ELEMENT_SELECTING, ApplicationFacade.ELEMENT_SELECTED, ApplicationFacade.ELEMENT_UNSELECTED]);
}
private function listenOnResize(_arg1:Event):void{
}
public function get ui():UI_ElementsSelector{
return ((viewComponent as UI_ElementsSelector));
}
public function clearElements():void{
var _local1:ElementSelectorMediator;
var _local2:UI_ElementSelector;
for each (_local1 in m_arElement) {
if (_local1 != null){
_local2 = _local1.ui;
ui.removeChild(_local2);
facade.removeMediator(_local1.getMediatorName());
};
};
m_arElement = new Array();
}
private function setElementSelect(_arg1:Boolean, _arg2:ElementProxy):void{
var _local3:ElementSelectorMediator;
_local3 = getElementMediator(_arg2);
if (_local3 != null){
_local3.select = _arg1;
};
}
override public function handleNotification(_arg1:INotification):void{
switch (_arg1.getName()){
case ApplicationFacade.ELEMENT_FOCUSED:
onFocusElement((_arg1.getBody() as ElementProxy));
break;
case ApplicationFacade.ELEMENT_SELECTING:
onSelectingElement((_arg1.getBody() as ElementProxy));
break;
case ApplicationFacade.ELEMENT_SELECTED:
onElementSelected(true, (_arg1.getBody() as ElementProxy));
break;
case ApplicationFacade.ELEMENT_UNSELECTED:
onElementSelected(false, (_arg1.getBody() as ElementProxy));
break;
};
super.handleNotification(_arg1);
}
public function get show():Boolean{
var _local1:UI_Elements_Holder;
_local1 = (ui.parent as UI_Elements_Holder);
if (_local1 != null){
return (_local1.show);
};
return (false);
}
private function setElementFocus(_arg1:Boolean, _arg2:ElementProxy):void{
var _local3:ElementSelectorMediator;
_local3 = getElementMediator(_arg2);
if (_local3 != null){
_local3.focus = _arg1;
};
}
}
}//package editor.view
Section 65
//LevelMouseCatcherMediator (editor.view.LevelMouseCatcherMediator)
package editor.view {
import flash.display.*;
import flash.events.*;
import game.model.*;
import org.puremvc.as3.interfaces.*;
import com.*;
import main.*;
import editor.model.*;
import game.model.Elements.Character.*;
import flash.geom.*;
import org.puremvc.as3.patterns.mediator.*;
public class LevelMouseCatcherMediator extends Mediator implements IMediator {
private var m_nDoubleInterpret:int;
private var m_nY_Old:int;
private var m_nX_Old:int;
private var m_oTarget:DisplayObjectContainer;
private var m_nMoveByY:int;// = 0
private var m_bStartOnTarget:Boolean;
private var m_nMoveByX:int;// = 0
private var m_nMoveByForTargetX:int;// = 0
private var m_nMoveByForTargetY:int;// = 0
private var m_pointLastOver:IntPoint;
private var m_nStyle:int;
public static const CATCHER_STYLE_MATRIX:int = (CommonFunc.INT_UNDEF + 1);
public static const CATCHER_STYLE_UNDEF:int = -1;
public static const CATCHER_STYLE_DIAGONAL:int = (CommonFunc.INT_UNDEF + 2);
public static const NAME:String = "LevelMouseCatcherMediator";
public function LevelMouseCatcherMediator(_arg1:DisplayObject){
var _local2:Point;
m_nDoubleInterpret = ElementProxy.FOR_DOUBLE_UNDEF;
m_nMoveByX = 0;
m_nMoveByY = 0;
m_nMoveByForTargetX = 0;
m_nMoveByForTargetY = 0;
m_nStyle = CATCHER_STYLE_MATRIX;
target = (_arg1 as DisplayObjectContainer);
if (_arg1 != null){
_local2 = new Point(_arg1.x, _arg1.y);
_local2 = _arg1.parent.localToGlobal(_local2);
super(NAME, _arg1.stage);
m_nMoveByForTargetX = _local2.x;
m_nMoveByForTargetY = _local2.y;
if (ui != null){
ui.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown, false, 0, true);
ui.addEventListener(MouseEvent.MOUSE_UP, onMouseUp, false, 0, true);
ui.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove, false, 0, true);
};
};
}
public function get target():DisplayObjectContainer{
return (m_oTarget);
}
private function mouseOver(_arg1:int, _arg2:int):void{
var _local3:IntPoint;
var _local4:EventSelectPos;
_local3 = convertMouseToPos(_arg1, _arg2);
if (_local3 != null){
if (m_pointLastOver != null){
if ((((m_pointLastOver.m_iX == _local3.m_iX)) && ((m_pointLastOver.m_iY == _local3.m_iY)))){
return;
};
};
m_pointLastOver = _local3;
_local4 = new EventSelectPos(true, m_pointLastOver);
sendNotification(ApplicationFacade.OVER_POS, _local4);
};
}
public function set moveByX(_arg1:int):void{
m_nMoveByX = _arg1;
}
public function set target(_arg1:DisplayObjectContainer):void{
m_oTarget = _arg1;
}
public function get ui():Stage{
return ((viewComponent as Stage));
}
public function get style():int{
return (m_nStyle);
}
private function catchMouse(_arg1:Boolean, _arg2:int, _arg3:int):void{
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
_arg2 = (_arg2 - m_nMoveByForTargetX);
_arg3 = (_arg3 - m_nMoveByForTargetY);
switch (m_nStyle){
case CATCHER_STYLE_MATRIX:
_local6 = ((_arg2 / Global_Settings.CELL_WIDTH) + m_nMoveByX);
_local7 = ((_arg3 / Global_Settings.CELL_HEIGHT) + m_nMoveByY);
if (((((_arg1) || (!((_local6 == m_nX_Old))))) || (!((_local7 == m_nY_Old))))){
catchPos(new EventSelectPos(_arg1, new IntPoint(_local6, _local7)));
m_nX_Old = _local6;
m_nY_Old = _local7;
};
break;
case CATCHER_STYLE_DIAGONAL:
switch (m_nDoubleInterpret){
case ElementProxy.FOR_DOUBLE_CELL:
_local4 = (_arg2 / Global_Settings.CELL_WIDTH_HALF);
_local4 = (_local4 + m_nMoveByX);
_local5 = (_arg3 / Global_Settings.CELL_HEIGHT_HALF);
_local5 = (_local5 + m_nMoveByY);
_local6 = _local4;
_local7 = _local5;
if (((((_arg1) || (!((_local6 == m_nX_Old))))) || (!((_local7 == m_nY_Old))))){
catchPos(new EventSelectPos(_arg1, new IntPoint(_local6, _local7)));
m_nX_Old = _local6;
m_nY_Old = _local7;
};
break;
case ElementProxy.FOR_DOUBLE_DIAGONAL:
_local4 = (Math.floor(((_arg2 + _arg3) / 50)) + 1);
_local5 = Math.floor(((_arg2 - _arg3) / 50));
_local6 = ((_local4 + _local5) + m_nMoveByX);
_local7 = (((_local4 - _local5) - 1) + m_nMoveByY);
if (((((_arg1) || (!((_local6 == m_nX_Old))))) || (!((_local7 == m_nY_Old))))){
catchPos(new EventSelectPos(_arg1, new IntPoint(_local6, _local7)));
m_nX_Old = _local6;
m_nY_Old = _local7;
};
break;
case ElementProxy.FOR_DOUBLE_ODD:
_local4 = (_arg2 / Global_Settings.CELL_WIDTH);
_local4 = (_local4 << 1);
++_local4;
_local4 = (_local4 + m_nMoveByX);
_local5 = (_arg3 / Global_Settings.CELL_HEIGHT);
_local5 = (_local5 << 1);
++_local5;
_local5 = (_local5 + m_nMoveByY);
_local6 = _local4;
_local7 = _local5;
if (((((_arg1) || (!((_local6 == m_nX_Old))))) || (!((_local7 == m_nY_Old))))){
catchPos(new EventSelectPos(_arg1, new IntPoint(_local6, _local7)));
m_nX_Old = _local6;
m_nY_Old = _local7;
};
break;
case ElementProxy.FOR_DOUBLE_ODD_X_EVEN_Y:
_local4 = (_arg2 / Global_Settings.CELL_WIDTH);
_local4 = (_local4 << 1);
++_local4;
_local4 = (_local4 + m_nMoveByX);
_local5 = (_arg3 / Global_Settings.CELL_HEIGHT);
_local5 = (_local5 << 1);
_local5 = (_local5 + m_nMoveByY);
_local6 = _local4;
_local7 = _local5;
if (((((_arg1) || (!((_local6 == m_nX_Old))))) || (!((_local7 == m_nY_Old))))){
catchPos(new EventSelectPos(_arg1, new IntPoint(_local6, _local7)));
m_nX_Old = _local6;
m_nY_Old = _local7;
};
break;
};
break;
};
}
private function catchPos(_arg1:EventSelectPos):void{
sendNotification(ApplicationFacade.SELECT_POS, _arg1);
}
public function onMouseUp(_arg1:MouseEvent):void{
m_bStartOnTarget = false;
}
private function convertMouseToPos(_arg1:int, _arg2:int):IntPoint{
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
_arg1 = (_arg1 - m_nMoveByForTargetX);
_arg2 = (_arg2 - m_nMoveByForTargetY);
switch (m_nStyle){
case CATCHER_STYLE_MATRIX:
_local3 = ((_arg1 / Global_Settings.CELL_WIDTH) + m_nMoveByX);
_local4 = ((_arg2 / Global_Settings.CELL_HEIGHT) + m_nMoveByY);
return (new IntPoint(_local3, _local4));
case CATCHER_STYLE_DIAGONAL:
switch (m_nDoubleInterpret){
case ElementProxy.FOR_DOUBLE_CELL:
_local3 = (_arg1 / Global_Settings.CELL_WIDTH_HALF);
_local3 = (_local3 + m_nMoveByX);
_local4 = (_arg2 / Global_Settings.CELL_HEIGHT_HALF);
_local4 = (_local4 + m_nMoveByY);
return (new IntPoint(_local3, _local4));
case ElementProxy.FOR_DOUBLE_DIAGONAL:
_local5 = (Math.floor(((_arg1 + _arg2) / 50)) + 1);
_local6 = Math.floor(((_arg1 - _arg2) / 50));
_local3 = ((_local5 + _local6) + m_nMoveByX);
_local4 = (((_local5 - _local6) - 1) + m_nMoveByY);
return (new IntPoint(_local3, _local4));
case ElementProxy.FOR_DOUBLE_ODD:
_local3 = (_arg1 / Global_Settings.CELL_WIDTH);
_local3 = (_local3 << 1);
_local3++;
_local3 = (_local3 + m_nMoveByX);
_local4 = (_arg2 / Global_Settings.CELL_HEIGHT);
_local4 = (_local4 << 1);
++_local4;
_local4 = (_local4 + m_nMoveByY);
return (new IntPoint(_local3, _local4));
case ElementProxy.FOR_DOUBLE_ODD_X_EVEN_Y:
_local3 = (_arg1 / Global_Settings.CELL_WIDTH);
_local3 = (_local3 << 1);
_local3++;
_local3 = (_local3 + m_nMoveByX);
_local4 = (_arg2 / Global_Settings.CELL_HEIGHT);
_local4 = (_local4 << 1);
_local4 = (_local4 + m_nMoveByY);
return (new IntPoint(_local3, _local4));
};
break;
};
return (null);
}
public function onMouseDown(_arg1:MouseEvent):void{
if (CommonFunc.isMetaParent((_arg1.target as DisplayObject), m_oTarget)){
catchMouse(true, _arg1.stageX, _arg1.stageY);
m_bStartOnTarget = true;
} else {
m_bStartOnTarget = false;
};
}
override public function handleNotification(_arg1:INotification):void{
switch (_arg1.getName()){
case ApplicationFacade.ELEMENT_FINISH_STATE:
onElementFinishState((_arg1.getBody() as LayerElementProxy_Character_Hero));
break;
};
super.handleNotification(_arg1);
}
public function set layerType(_arg1:int):void{
switch (_arg1){
case LayerProxy.LAYER_TYPE_DOUBLE_DENSITY:
case LayerProxy.LAYER_TYPE_LABYRINTH:
m_nStyle = CATCHER_STYLE_DIAGONAL;
break;
default:
m_nStyle = CATCHER_STYLE_MATRIX;
break;
};
}
override public function listNotificationInterests():Array{
return ([ApplicationFacade.ELEMENT_FINISH_STATE]);
}
private function onElementFinishState(_arg1:LayerElementProxy_Character_Hero):void{
if (_arg1 != null){
m_pointLastOver = null;
mouseOver(ui.mouseX, ui.mouseY);
};
}
public function set style(_arg1:int):void{
m_nStyle = _arg1;
}
public function set moveByY(_arg1:int):void{
m_nMoveByY = _arg1;
}
public function onMouseMove(_arg1:MouseEvent):void{
if (((_arg1.buttonDown) && (m_bStartOnTarget))){
catchMouse(false, _arg1.stageX, _arg1.stageY);
};
mouseOver(_arg1.stageX, _arg1.stageY);
}
public function set doubleInterpret(_arg1:int):void{
m_nDoubleInterpret = _arg1;
}
}
}//package editor.view
Section 66
//LevelSelectorMediator (editor.view.LevelSelectorMediator)
package editor.view {
import flash.display.*;
import flash.events.*;
import game.model.*;
import org.puremvc.as3.interfaces.*;
import main.*;
import editor.view.components.*;
import org.puremvc.as3.patterns.mediator.*;
public class LevelSelectorMediator extends Mediator implements IMediator {
private var m_pLevel:LevelProxy;
private var m_pLevels:LevelsProxy;
public static const NAME:String = "LevelSelectorMediator";
public function LevelSelectorMediator(_arg1:Object, _arg2:LevelProxy, _arg3:LevelsProxy=null){
var _local4:String;
_local4 = NAME;
if (_arg2 != null){
_local4 = (_local4 + ("_" + _arg2.id.toString()));
};
super(_local4, _arg1);
m_pLevel = _arg2;
if (m_pLevel != null){
m_pLevels = m_pLevel.parent;
} else {
m_pLevels = _arg3;
};
itemName = "";
ui.addEventListener(UI_LevelSelector.ON_SELECT, listenSelect, false, 0, true);
ui.addEventListener(UI_LevelsSelector.ON_ROLLOVER_ON_BTN, listenOnRollover, false, 0, true);
}
public function get playState():int{
return (ui.playState);
}
public function set playState(_arg1:int):void{
ui.playState = _arg1;
}
public function get active():Boolean{
if (ui != null){
return (ui.active);
};
return (false);
}
public function set itemName(_arg1:String):void{
trace("X");
trace("LevelSelectorMediator public function set itemName(strName:String):void");
trace(("ui=" + ui));
trace(("strName=" + _arg1));
if (ui != null){
ui.itemName = _arg1;
};
}
public function get grade():String{
if (ui != null){
return (ui.grade);
};
return (null);
}
public function clear():void{
var _local1:UI_LevelSelector;
var _local2:DisplayObjectContainer;
_local1 = ui;
if (_local1 != null){
_local2 = _local1.parent;
if (_local2 != null){
_local2.removeChild(_local1);
};
};
}
public function get tail():Boolean{
if (ui != null){
return (ui.tail);
};
return (false);
}
public function get ui():UI_LevelSelector{
return ((viewComponent as UI_LevelSelector));
}
public function set active(_arg1:Boolean):void{
if (ui != null){
ui.active = _arg1;
};
}
public function set inactive(_arg1:Boolean):void{
if (ui != null){
ui.inactive = _arg1;
};
}
private function listenSelect(_arg1:Event):void{
if (proxy == null){
sendNotification(ApplicationFacade.LEVEL_SELECTING, m_pLevels);
} else {
sendNotification(ApplicationFacade.LEVEL_SELECTING, proxy);
};
}
public function get proxy():LevelProxy{
return (m_pLevel);
}
public function set tail(_arg1:Boolean):void{
if (ui != null){
ui.tail = _arg1;
};
}
public function get select():Boolean{
if (ui != null){
return (ui.select);
};
return (false);
}
private function listenOnRollover(_arg1:Event):void{
sendNotification(ApplicationFacade.ROLL_ON_BTN, this);
}
public function set select(_arg1:Boolean):void{
ui.select = _arg1;
}
public function set grade(_arg1:String):void{
if (ui != null){
ui.grade = _arg1;
};
}
public function get itemName():String{
if (ui != null){
return (ui.itemName);
};
return ("");
}
}
}//package editor.view
Section 67
//LevelsSelectorMediator (editor.view.LevelsSelectorMediator)
package editor.view {
import flash.events.*;
import game.model.*;
import org.puremvc.as3.interfaces.*;
import com.*;
import main.*;
import editor.view.components.*;
import org.puremvc.as3.patterns.mediator.*;
public class LevelsSelectorMediator extends Mediator implements IMediator {
private var m_arLevels:Array;
private var m_pLevels:LevelsProxy;
private var m_mSelectSelectorLevel:LevelSelectorMediator;
private var m_mMsgWindow:MsgWindowMediator;
public static const NAME:String = "LevelsSelectorMediator";
public function LevelsSelectorMediator(_arg1:Object){
m_arLevels = new Array();
super(NAME, _arg1);
ui.addEventListener(UI_LevelsSelector.ON_ADD, listenOnAdd, false, 0, true);
ui.addEventListener(UI_LevelsSelector.ON_DEL, listenOnDel, false, 0, true);
ui.addEventListener(UI_LevelsSelector.ON_OPEN, listenOnOpen, false, 0, true);
ui.addEventListener(UI_LevelsSelector.ON_SAVE, listenOnSave, false, 0, true);
ui.addEventListener(UI_LevelsSelector.ON_ROLLOVER_ON_BTN, listenOnRollOver, false, 0, true);
ui.addEventListener(UI_LevelsSelector.ON_TEMPATE_EMPTY, listenTemplate_Empty, false, 0, true);
ui.addEventListener(UI_LevelsSelector.ON_TEMPATE_WALL_BOX, listenTemplate_WallBox, false, 0, true);
ui.addEventListener(UI_LevelsSelector.ON_TEMPATE_FILL_FLOOR_GROUND, listenTemplate_FillFloorGround, false, 0, true);
ui.addEventListener(UI_LevelsSelector.ON_TEMPATE_FILL_FLOOR_GROUND_RAND, listenTemplate_FillFloorGroundRand, false, 0, true);
ui.addEventListener(UI_LevelsSelector.ON_TEMPATE_FILL_FLOOR_TILE_LIGHT, listenTemplate_FillFloorTileLight, false, 0, true);
ui.addEventListener(UI_LevelsSelector.ON_TEMPATE_FILL_FLOOR_TILE_DARK, listenTemplate_FillFloorTileDark, false, 0, true);
ui.addEventListener(UI_LevelsSelector.ON_PLAY_LEVEL, listenPlayLevel, false, 0, true);
ui.addEventListener(UI_LevelsSelector.ON_PLAY_LEVELS, listenPlayLevels, false, 0, true);
ui.addEventListener(UI_LevelsSelector.ON_GOTO_MENU, listenGotoMenu, false, 0, true);
}
private function listenTemplate_FillFloorTileLight(_arg1:Event):void{
sendNotification(ApplicationFacade.LEVEL_USE_TEMPLATE_FILL_FLOOR_TILE_LIGHT, m_pLevels.select);
sendNotification(ApplicationFacade.CLICK_ON_BTN);
}
private function init():void{
var _local1:LevelProxy;
var _local2:LevelSelectorMediator;
var _local3:int;
var _local4:int;
var _local5:LevelProxy;
clear();
if (m_pLevels != null){
_local3 = m_pLevels.length;
_local4 = 0;
while (_local4 < _local3) {
_local1 = m_pLevels.getItem(_local4);
_local2 = createLevel(_local1);
if (_local2 != null){
ui.pushItem(_local2.ui);
m_arLevels.push(_local2);
};
_local4++;
};
_local2 = createLevel(null, true);
if (_local2 != null){
ui.pushItem(_local2.ui);
m_arLevels.push(_local2);
};
if (m_arLevels.length > 1){
_local5 = m_pLevels.select;
if (_local5 == null){
_local2 = m_arLevels[0];
_local5 = m_pLevels.getItem(0);
} else {
_local2 = getMediatorByProxy(_local5);
};
if (_local2 != null){
if (_local5 != null){
sendNotification(ApplicationFacade.LEVEL_SELECTING, _local5);
};
};
};
};
}
private function listenOnRollOver(_arg1:Event):void{
sendNotification(ApplicationFacade.ROLL_ON_BTN);
}
private function onCantSolveEditLevel(_arg1:LevelProxy):void{
if (_arg1 != null){
MsgWindowMediator.showMessageBox(ui.parent, null, null, TLang.getInstance().getText(TLang.TEXT_MSG_CANT_SOLVE_EDIT_LEVEL_TITLE), TLang.getInstance().getText(TLang.TEXT_MSG_CANT_SOLVE_EDIT_LEVEL_TEXT), UI_Msg_Icons.MSG_ICON_INFORMATION, false);
};
}
private function onLevelSelected(_arg1:Boolean, _arg2:LevelProxy):void{
var _local3:LevelSelectorMediator;
if (_arg2 != null){
_local3 = getMediatorByProxy(_arg2);
if (_local3 != null){
if (_arg1){
select = _local3;
};
};
} else {
sendNotification(ApplicationFacade.LEVEL_ADDING, m_pLevels);
};
}
public function get ui():UI_LevelsSelector{
return ((viewComponent as UI_LevelsSelector));
}
private function listenOnSave(_arg1:Event):void{
sendNotification(ApplicationFacade.LEVEL_ASK_SAVING, m_pLevels);
sendNotification(ApplicationFacade.CLICK_ON_BTN);
}
private function listenOnDel(_arg1:Event):void{
tryDel();
sendNotification(ApplicationFacade.CLICK_ON_BTN);
}
private function listenTemplate_FillFloorTileDark(_arg1:Event):void{
sendNotification(ApplicationFacade.LEVEL_USE_TEMPLATE_FILL_FLOOR_TILE_DARK, m_pLevels.select);
sendNotification(ApplicationFacade.CLICK_ON_BTN);
}
private function listenTemplate_WallBox(_arg1:Event):void{
sendNotification(ApplicationFacade.LEVEL_USE_TEMPLATE_WALL_BOX, m_pLevels.select);
sendNotification(ApplicationFacade.CLICK_ON_BTN);
}
public function getMediatorByProxy(_arg1:LevelProxy):LevelSelectorMediator{
var _local2:LevelSelectorMediator;
for each (_local2 in m_arLevels) {
if (((!((_local2 == null))) && ((_local2.proxy == _arg1)))){
return (_local2);
};
};
return (null);
}
private function getPos(_arg1:LevelSelectorMediator):int{
var _local2:int;
_local2 = m_arLevels.length;
while (--_local2 >= 0) {
if (m_arLevels[_local2] == _arg1){
return (_local2);
};
};
return (CommonFunc.INT_UNDEF);
}
private function listenPlayLevel(_arg1:Event):void{
sendNotification(ApplicationFacade.PLAY_EDIT_LEVEL, m_pLevels.select);
sendNotification(ApplicationFacade.CLICK_ON_BTN);
}
private function listenTemplate_FillFloorGround(_arg1:Event):void{
sendNotification(ApplicationFacade.LEVEL_USE_TEMPLATE_FILL_FLOOR_GROUND, m_pLevels.select);
sendNotification(ApplicationFacade.CLICK_ON_BTN);
}
private function listenOnAdd(_arg1:Event):void{
sendNotification(ApplicationFacade.LEVEL_ADDING, m_pLevels.select);
sendNotification(ApplicationFacade.CLICK_ON_BTN);
}
override public function handleNotification(_arg1:INotification):void{
switch (_arg1.getName()){
case ApplicationFacade.LEVEL_SELECTED:
onLevelSelected(true, (_arg1.getBody() as LevelProxy));
break;
case ApplicationFacade.LEVEL_UNSELECTED:
onLevelSelected(false, (_arg1.getBody() as LevelProxy));
break;
case ApplicationFacade.LEVEL_ADD:
onLevelAdd((_arg1.getBody() as LevelProxy));
break;
case ApplicationFacade.LEVEL_REMOVE:
onLevelRemove((_arg1.getBody() as LevelProxy));
break;
case ApplicationFacade.LEVELS_LOAD:
onLevelsLoad((_arg1.getBody() as LevelsProxy));
break;
case ApplicationFacade.CANT_SOLVE_EDIT_LEVEL:
onCantSolveEditLevel((_arg1.getBody() as LevelProxy));
break;
};
super.handleNotification(_arg1);
}
private function onLevelRemove(_arg1:LevelProxy):void{
removeLevel(_arg1);
}
private function insertLevel(_arg1:LevelProxy):Boolean{
var _local2:int;
var _local3:LevelSelectorMediator;
_local2 = m_pLevels.getItemPos(_arg1);
_local3 = createLevel(_arg1);
if (_local3 != null){
m_arLevels.splice(_local2, 0, _local3);
ui.insertItem(_local2, _local3.ui);
sendNotification(ApplicationFacade.LEVEL_SELECTING, _arg1);
return (true);
};
return (false);
}
private function onLevelsLoad(_arg1:LevelsProxy):void{
levels = _arg1;
}
public function clear():void{
var _local1:LevelSelectorMediator;
for each (_local1 in m_arLevels) {
if (_local1 != null){
facade.removeMediator(_local1.getMediatorName());
};
};
ui.removeAllItem();
m_arLevels = new Array();
}
private function listenTemplate_Empty(_arg1:Event):void{
sendNotification(ApplicationFacade.LEVEL_USE_TEMPLATE_EMPTY, m_pLevels.select);
sendNotification(ApplicationFacade.CLICK_ON_BTN);
}
public function tryDel():void{
if ((((m_pLevels.length > 1)) && (!((m_pLevels.select == null))))){
MsgWindowMediator.showMessageBox(ui.parent, ApplicationFacade.LEVEL_REMOVING, m_pLevels.select, TLang.getInstance().getText(TLang.TEXT_MSG_REMOVE_LEVEL_TITLE), TLang.getInstance().getText(TLang.TEXT_MSG_REMOVE_LEVEL_TEXT));
};
}
public function set levels(_arg1:LevelsProxy):void{
m_pLevels = _arg1;
init();
}
override public function listNotificationInterests():Array{
return ([ApplicationFacade.LEVEL_SELECTED, ApplicationFacade.LEVEL_UNSELECTED, ApplicationFacade.LEVEL_ADD, ApplicationFacade.LEVEL_REMOVE, ApplicationFacade.LEVELS_LOAD, ApplicationFacade.CANT_SOLVE_EDIT_LEVEL]);
}
private function listenGotoMenu(_arg1:Event):void{
sendNotification(ApplicationFacade.GOTO_MENU_FROM_EDIT);
sendNotification(ApplicationFacade.CLICK_ON_BTN);
}
private function createLevel(_arg1:LevelProxy, _arg2:Boolean=false):LevelSelectorMediator{
var _local3:UI_LevelSelector;
var _local4:LevelSelectorMediator;
if (((!((_arg1 == null))) || (_arg2))){
_local3 = new UI_LevelSelector();
_local4 = new LevelSelectorMediator(_local3, _arg1, m_pLevels);
facade.registerMediator(_local4);
if (_arg2){
_local4.tail = true;
} else {
_local4.active = true;
};
return (_local4);
};
return (null);
}
private function listenPlayLevels(_arg1:Event):void{
sendNotification(ApplicationFacade.PLAY_EDIT_LEVELS, m_pLevels);
sendNotification(ApplicationFacade.CLICK_ON_BTN);
}
private function removeLevel(_arg1:LevelProxy):Boolean{
var _local2:LevelSelectorMediator;
var _local3:int;
var _local4:int;
_local2 = getMediatorByProxy(_arg1);
_local3 = getPos(_local2);
if (_local2 != null){
m_arLevels.splice(_local3, 1);
ui.removeItem(_local2.ui);
facade.removeMediator(_local2.getMediatorName());
_local4 = (m_arLevels.length - 1);
if (_local4 > 0){
if (_local3 >= _local4){
_local3 = (_local4 - 1);
};
_local2 = m_arLevels[_local3];
if (_local2 != null){
sendNotification(ApplicationFacade.LEVEL_SELECTING, _local2.proxy);
};
};
return (true);
};
return (false);
}
private function listenOnOpen(_arg1:Event):void{
sendNotification(ApplicationFacade.LEVEL_ASK_LOADING, m_pLevels);
sendNotification(ApplicationFacade.CLICK_ON_BTN);
}
private function listenTemplate_FillFloorGroundRand(_arg1:Event):void{
sendNotification(ApplicationFacade.LEVEL_USE_TEMPLATE_FILL_FLOOR_GROUND_RAND, m_pLevels.select);
sendNotification(ApplicationFacade.CLICK_ON_BTN);
}
public function set select(_arg1:LevelSelectorMediator):void{
if (_arg1 != null){
if (m_mSelectSelectorLevel != null){
m_mSelectSelectorLevel.select = false;
};
_arg1.select = true;
m_mSelectSelectorLevel = _arg1;
};
}
public function set show(_arg1:Boolean):void{
ui.setShow(_arg1);
}
private function onLevelAdd(_arg1:LevelProxy):void{
insertLevel(_arg1);
}
public function get show():Boolean{
return (ui.show);
}
}
}//package editor.view
Section 68
//MsgLevelUrlMediator (editor.view.MsgLevelUrlMediator)
package editor.view {
import org.puremvc.as3.interfaces.*;
import editor.view.components.*;
import org.puremvc.as3.patterns.mediator.*;
public class MsgLevelUrlMediator extends Mediator implements IMediator {
public static const NAME:String = "MsgLevelUrlMediatorextends";
public function MsgLevelUrlMediator(_arg1:Object){
super(NAME, _arg1);
}
public function set value(_arg1:String):void{
ui.value = _arg1;
}
public function set show(_arg1:Boolean):void{
setShow(_arg1);
}
public function get ui():UI_Msg_Level_Url{
return ((viewComponent as UI_Msg_Level_Url));
}
public function setShow(_arg1:Boolean, _arg2:Boolean=true):void{
ui.setShow(_arg1, _arg2);
}
}
}//package editor.view
Section 69
//MsgWindowMediator (editor.view.MsgWindowMediator)
package editor.view {
import flash.display.*;
import flash.events.*;
import org.puremvc.as3.interfaces.*;
import editor.view.components.*;
import org.puremvc.as3.patterns.facade.*;
import org.puremvc.as3.patterns.mediator.*;
public class MsgWindowMediator extends Mediator implements IMediator {
public var m_strCommand:String;
public var m_oParam:Object;
public static const NAME:String = "MsgWindowMediator";
public function MsgWindowMediator(_arg1:Object){
super(NAME, _arg1);
ui.addEventListener(UI_Msg_Window.ON_YES, listenOnYes, false, 0, true);
ui.addEventListener(UI_Msg_Window.ON_NO, listenOnNo, false, 0, true);
}
public function get title():String{
return (ui.title);
}
public function set title(_arg1:String):void{
ui.title = _arg1;
}
public function set show(_arg1:Boolean):void{
setShow(_arg1);
}
private function listenOnYes(_arg1:Event):void{
facade.sendNotification(m_strCommand, m_oParam);
show = false;
}
public function set cancelButton(_arg1:Boolean):void{
ui.cancelButton = _arg1;
}
public function set text(_arg1:String):void{
if (_arg1 != null){
ui.text = _arg1;
};
}
public function get ui():UI_Msg_Window{
return ((viewComponent as UI_Msg_Window));
}
public function get text():String{
return (ui.text);
}
private function listenOnNo(_arg1:Event):void{
show = false;
}
public function set modal(_arg1:Boolean):void{
ui.modal = _arg1;
}
public function set icon(_arg1:int):void{
ui.icon = _arg1;
}
public function get show():Boolean{
return (ui.show);
}
public function setShow(_arg1:Boolean, _arg2:Boolean=true):void{
if (!_arg1){
facade.removeMediator(getMediatorName());
};
ui.setShow(_arg1, _arg2);
}
public static function showMessageBox(_arg1:DisplayObjectContainer, _arg2:String, _arg3:Object, _arg4:String, _arg5:String, _arg6:int=0, _arg7:Boolean=true):void{
var _local8:UI_Msg_Window;
var _local9:MsgWindowMediator;
if (_arg1 != null){
_local8 = (_arg1.getChildByName("msgWindow_mc") as UI_Msg_Window);
if (_local8 == null){
_local8 = new UI_Msg_Window();
_arg1.addChild(_local8);
};
_local9 = new MsgWindowMediator(_local8);
_local9 = new MsgWindowMediator(_local8);
_local9.modal = true;
_local9.m_strCommand = _arg2;
_local9.m_oParam = _arg3;
_local9.title = _arg4;
_local9.text = _arg5;
_local9.icon = _arg6;
_local9.cancelButton = _arg7;
_local9.setShow(false, false);
_local9.show = true;
Facade.getInstance().registerMediator(_local9);
};
}
}
}//package editor.view
Section 70
//OpenWindowMediator (editor.view.OpenWindowMediator)
package editor.view {
import flash.events.*;
import game.model.*;
import org.puremvc.as3.interfaces.*;
import main.*;
import editor.view.components.*;
import editor.controller.*;
import org.puremvc.as3.patterns.mediator.*;
public class OpenWindowMediator extends Mediator implements IMediator {
private var m_bLoadingLevels:Boolean;
private var m_pLevels:LevelsProxy;
public static const NAME:String = "OpenWindowMediator";
public function OpenWindowMediator(_arg1:Object, _arg2:LevelsProxy){
super(NAME, _arg1);
m_pLevels = _arg2;
ui.addEventListener(UI_Open_Window.ON_YES, listenOnYes, false, 0, true);
ui.addEventListener(UI_Open_Window.ON_NO, listenOnNo, false, 0, true);
}
public function get text():String{
return (ui.text);
}
private function listenOnYes(_arg1:Event):void{
if (m_bLoadingLevels){
facade.sendNotification(ApplicationFacade.LEVELS_LOADING, new LoadingLevelsCommandStruct(m_pLevels, ui.text));
} else {
facade.sendNotification(ApplicationFacade.LEVEL_LOADING, new LoadingLevelsCommandStruct(m_pLevels, ui.text));
};
}
public function set show(_arg1:Boolean):void{
ui.setShow(_arg1);
}
public function get ui():UI_Open_Window{
return ((viewComponent as UI_Open_Window));
}
public function set loadingLevels(_arg1:Boolean):void{
m_bLoadingLevels = _arg1;
}
private function listenOnNo(_arg1:Event):void{
show = false;
}
public function set text(_arg1:String):void{
ui.text = _arg1;
}
public function get show():Boolean{
return (ui.show);
}
}
}//package editor.view
Section 71
//SaveWindowMediator (editor.view.SaveWindowMediator)
package editor.view {
import flash.events.*;
import com.gamezhero.as3.remoting.structure.*;
import org.puremvc.as3.interfaces.*;
import shared_levels.model.*;
import main.*;
import editor.view.components.*;
import shared_levels.view.components.*;
import org.puremvc.as3.patterns.mediator.*;
public class SaveWindowMediator extends Mediator implements IMediator {
private var m_pSLevels:SharedLevelsProxy;
private var m_pSO:SharedObjectProxy;
private var m_bSaveLevels:Boolean;
public static const NAME:String = "SaveWindowMediator";
public function SaveWindowMediator(_arg1:Object){
super(NAME, _arg1);
ui.addEventListener(UI_Save_Window.ON_OK, listenOnOk, false, 0, true);
ui.addEventListener(UI_Save_Window.ON_SEND, listenOnSend, false, 0, true);
m_pSLevels = (facade.retrieveProxy(SharedLevelsProxy.NAME) as SharedLevelsProxy);
m_pSO = (facade.retrieveProxy(SharedObjectProxy.NAME) as SharedObjectProxy);
ui.email = m_pSO.getLastEmail();
ui.levelTitle = m_pSO.getLastLevelName();
ui.userName = m_pSO.getUserName();
ui.addEventListener(UI_Loading.ON_TRY_AGAIN, listenOnTryAgain, false, 0, true);
ui.addEventListener(UI_Loading.ON_CANCEL, listenOnCancel, false, 0, true);
ui.progress = false;
ui.tryAgain = false;
}
private function get progress():Boolean{
if (m_pSLevels != null){
return (m_pSLevels.progress);
};
return (false);
}
private function listenOnCancel(_arg1:Event):void{
show = false;
}
private function listenOnOk(_arg1:Event):void{
if (!progress){
show = false;
};
}
public function set show(_arg1:Boolean):void{
ui.setShow(_arg1);
}
private function send():void{
sendNotification(ApplicationFacade.SL_POST_LEVEL, new LevelStructure(ui.levelTitle, ui.text, ui.userName, ui.email, 5));
}
private function onRequestSetLevel(_arg1:LevelStructure):void{
ui.tryAgain = false;
progress = true;
}
public function set saveLevels(_arg1:Boolean):void{
m_bSaveLevels = _arg1;
}
override public function listNotificationInterests():Array{
return ([ApplicationFacade.SL_RECEIVE_SET_LEVEL, ApplicationFacade.SL_REQUEST_SET_LEVEL, ApplicationFacade.SL_RECEIVE_ERROR]);
}
public function set text(_arg1:String):void{
ui.text = _arg1;
}
public function get ui():UI_Save_Window{
return ((viewComponent as UI_Save_Window));
}
private function onReceiveSetLevel(_arg1:SharedLevelProxy):void{
trace("X");
trace("SaveWindowMediator private function onReceiveSetLevel(pSL:SharedLevelProxy):void");
trace(("pSL=" + _arg1));
if (_arg1 != null){
if (_arg1.isUrlHaveError()){
onError();
} else {
show = false;
};
};
progress = false;
}
public function set canShareLevel(_arg1:Boolean):void{
ui.canShareLevel = _arg1;
}
public function get text():String{
return (ui.text);
}
private function listenOnSend(_arg1:Event):void{
send();
}
private function onError(_arg1:String=null):void{
ui.tryAgain = true;
ui.progress = false;
}
private function set progress(_arg1:Boolean):void{
ui.progress = _arg1;
}
override public function handleNotification(_arg1:INotification):void{
switch (_arg1.getName()){
case ApplicationFacade.SL_RECEIVE_SET_LEVEL:
onReceiveSetLevel((_arg1.getBody() as SharedLevelProxy));
break;
case ApplicationFacade.SL_REQUEST_SET_LEVEL:
onRequestSetLevel((_arg1.getBody() as LevelStructure));
break;
case ApplicationFacade.SL_RECEIVE_ERROR:
onError((_arg1.getBody() as String));
break;
};
super.handleNotification(_arg1);
}
public function get show():Boolean{
return (ui.show);
}
private function listenOnTryAgain(_arg1:Event):void{
send();
}
}
}//package editor.view
Section 72
//Elastic (fl.motion.easing.Elastic)
package fl.motion.easing {
public class Elastic {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0, _arg6:Number=0):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * 0.3);
};
if (((!(_arg5)) || ((_arg5 < Math.abs(_arg3))))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / (2 * Math.PI)) * Math.asin((_arg3 / _arg5)));
};
return (((((_arg5 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6))) + _arg3) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0, _arg6:Number=0):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * 0.3);
};
if (((!(_arg5)) || ((_arg5 < Math.abs(_arg3))))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / (2 * Math.PI)) * Math.asin((_arg3 / _arg5)));
};
--_arg1;
return ((-(((_arg5 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6)))) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0, _arg6:Number=0):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 == 2){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * (0.3 * 1.5));
};
if (((!(_arg5)) || ((_arg5 < Math.abs(_arg3))))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / (2 * Math.PI)) * Math.asin((_arg3 / _arg5)));
};
if (_arg1 < 1){
--_arg1;
return (((-0.5 * ((_arg5 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6)))) + _arg2));
};
--_arg1;
return ((((((_arg5 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6))) * 0.5) + _arg3) + _arg2));
}
}
}//package fl.motion.easing
Section 73
//Tween (fl.transitions.Tween)
package fl.transitions {
import flash.display.*;
import flash.utils.*;
import flash.events.*;
public class Tween extends EventDispatcher {
private var _position:Number;// = NAN
public var prevTime:Number;// = NAN
public var prevPos:Number;// = NAN
public var isPlaying:Boolean;// = false
public var begin:Number;// = NAN
private var _fps:Number;// = NAN
private var _time:Number;// = NAN
public var change:Number;// = NAN
private var _finish:Number;// = NAN
public var looping:Boolean;// = false
private var _intervalID:uint;// = 0
public var func:Function;
private var _timer:Timer;// = null
private var _startTime:Number;// = NAN
public var prop:String;// = ""
private var _duration:Number;// = NAN
public var obj:Object;// = null
public var useSeconds:Boolean;// = false
protected static var _mc:MovieClip = new MovieClip();
public function Tween(_arg1:Object, _arg2:String, _arg3:Function, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Boolean=false){
isPlaying = false;
obj = null;
prop = "";
func = function (_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
};
begin = NaN;
change = NaN;
useSeconds = false;
prevTime = NaN;
prevPos = NaN;
looping = false;
_duration = NaN;
_time = NaN;
_fps = NaN;
_position = NaN;
_startTime = NaN;
_intervalID = 0;
_finish = NaN;
_timer = null;
super();
if (!arguments.length){
return;
};
this.obj = _arg1;
this.prop = _arg2;
this.begin = _arg4;
this.position = _arg4;
this.duration = _arg6;
this.useSeconds = _arg7;
if ((_arg3 is Function)){
this.func = _arg3;
};
this.finish = _arg5;
this._timer = new Timer(100);
this.start();
}
public function continueTo(_arg1:Number, _arg2:Number):void{
this.begin = this.position;
this.finish = _arg1;
if (!isNaN(_arg2)){
this.duration = _arg2;
};
this.start();
}
public function stop():void{
this.stopEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_STOP, this._time, this._position));
}
private function fixTime():void{
if (this.useSeconds){
this._startTime = (getTimer() - (this._time * 1000));
};
}
public function set FPS(_arg1:Number):void{
var _local2:Boolean;
_local2 = this.isPlaying;
this.stopEnterFrame();
this._fps = _arg1;
if (_local2){
this.startEnterFrame();
};
}
public function get finish():Number{
return ((this.begin + this.change));
}
public function get duration():Number{
return (this._duration);
}
protected function startEnterFrame():void{
var _local1:Number;
if (isNaN(this._fps)){
_mc.addEventListener(Event.ENTER_FRAME, this.onEnterFrame, false, 0, true);
} else {
_local1 = (1000 / this._fps);
this._timer.delay = _local1;
this._timer.addEventListener(TimerEvent.TIMER, this.timerHandler, false, 0, true);
this._timer.start();
};
this.isPlaying = true;
}
public function set time(_arg1:Number):void{
this.prevTime = this._time;
if (_arg1 > this.duration){
if (this.looping){
this.rewind((_arg1 - this._duration));
this.update();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_LOOP, this._time, this._position));
} else {
if (this.useSeconds){
this._time = this._duration;
this.update();
};
this.stop();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_FINISH, this._time, this._position));
};
} else {
if (_arg1 < 0){
this.rewind();
this.update();
} else {
this._time = _arg1;
this.update();
};
};
}
protected function stopEnterFrame():void{
if (isNaN(this._fps)){
_mc.removeEventListener(Event.ENTER_FRAME, this.onEnterFrame);
} else {
this._timer.stop();
};
this.isPlaying = false;
}
public function getPosition(_arg1:Number=NaN):Number{
if (isNaN(_arg1)){
_arg1 = this._time;
};
return (this.func(_arg1, this.begin, this.change, this._duration));
}
public function set finish(_arg1:Number):void{
this.change = (_arg1 - this.begin);
}
public function set duration(_arg1:Number):void{
this._duration = ((_arg1)<=0) ? Infinity : _arg1;
}
public function setPosition(_arg1:Number):void{
this.prevPos = this._position;
if (this.prop.length){
this.obj[this.prop] = (this._position = _arg1);
};
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_CHANGE, this._time, this._position));
}
public function resume():void{
this.fixTime();
this.startEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_RESUME, this._time, this._position));
}
public function fforward():void{
this.time = this._duration;
this.fixTime();
}
protected function onEnterFrame(_arg1:Event):void{
this.nextFrame();
}
public function get position():Number{
return (this.getPosition(this._time));
}
public function yoyo():void{
this.continueTo(this.begin, this.time);
}
public function nextFrame():void{
if (this.useSeconds){
this.time = ((getTimer() - this._startTime) / 1000);
} else {
this.time = (this._time + 1);
};
}
protected function timerHandler(_arg1:TimerEvent):void{
this.nextFrame();
_arg1.updateAfterEvent();
}
public function get FPS():Number{
return (this._fps);
}
public function rewind(_arg1:Number=0):void{
this._time = _arg1;
this.fixTime();
this.update();
}
public function set position(_arg1:Number):void{
this.setPosition(_arg1);
}
public function get time():Number{
return (this._time);
}
private function update():void{
this.setPosition(this.getPosition(this._time));
}
public function start():void{
this.rewind();
this.startEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_START, this._time, this._position));
}
public function prevFrame():void{
if (!this.useSeconds){
this.time = (this._time - 1);
};
}
}
}//package fl.transitions
Section 74
//TweenEvent (fl.transitions.TweenEvent)
package fl.transitions {
import flash.events.*;
public class TweenEvent extends Event {
public var time:Number;// = NAN
public var position:Number;// = NAN
public static const MOTION_START:String = "motionStart";
public static const MOTION_STOP:String = "motionStop";
public static const MOTION_LOOP:String = "motionLoop";
public static const MOTION_CHANGE:String = "motionChange";
public static const MOTION_FINISH:String = "motionFinish";
public static const MOTION_RESUME:String = "motionResume";
public function TweenEvent(_arg1:String, _arg2:Number, _arg3:Number, _arg4:Boolean=false, _arg5:Boolean=false){
time = NaN;
position = NaN;
super(_arg1, _arg4, _arg5);
this.time = _arg2;
this.position = _arg3;
}
override public function clone():Event{
return (new TweenEvent(this.type, this.time, this.position, this.bubbles, this.cancelable));
}
}
}//package fl.transitions
Section 75
//CancelElementStateCommand (game.controller.CancelElementStateCommand)
package game.controller {
import game.model.*;
import org.puremvc.as3.interfaces.*;
import game.model.Elements.*;
import org.puremvc.as3.patterns.command.*;
public class CancelElementStateCommand extends SimpleCommand implements ICommand {
override public function execute(_arg1:INotification):void{
var _local2:LayerElementProxy;
var _local3:int;
var _local4:UndoProxy;
_local2 = (_arg1.getBody() as LayerElementProxy);
if (_local2 != null){
_local3 = _local2.state;
switch (_local3){
case LayerElementProxy.STATE_MOVE_EAST:
case LayerElementProxy.STATE_MOVE_NORTH:
case LayerElementProxy.STATE_MOVE_SOUTH:
case LayerElementProxy.STATE_MOVE_WEST:
if (((!((_local2.x == _local2.moveToX))) || (!((_local2.y == _local2.moveToY))))){
_local4 = (facade.retrieveProxy(UndoProxy.NAME) as UndoProxy);
if (_local4 != null){
_local4.removeHistory(_local2.state, _local2);
};
};
break;
};
};
}
}
}//package game.controller
Section 76
//ChangeGameSpeedCommand (game.controller.ChangeGameSpeedCommand)
package game.controller {
import org.puremvc.as3.interfaces.*;
import org.puremvc.as3.patterns.command.*;
import main.model.*;
public class ChangeGameSpeedCommand extends SimpleCommand implements ICommand {
override public function execute(_arg1:INotification):void{
var _local2:TimerProxy;
var _local3:Number;
_local2 = (facade.retrieveProxy(TimerProxy.NAME) as TimerProxy);
if (_local2 != null){
_local3 = (_arg1.getBody() as Number);
_local2.speedRelevant = _local3;
};
}
}
}//package game.controller
Section 77
//ChangeGameStateCommand (game.controller.ChangeGameStateCommand)
package game.controller {
import game.model.*;
import org.puremvc.as3.interfaces.*;
import org.puremvc.as3.patterns.command.*;
import main.model.*;
public class ChangeGameStateCommand extends SimpleCommand implements ICommand {
override public function execute(_arg1:INotification):void{
var _local2:GameProxy;
var _local3:TimerProxy;
var _local4:int;
_local2 = (facade.retrieveProxy(GameProxy.NAME) as GameProxy);
_local3 = (facade.retrieveProxy(TimerProxy.NAME) as TimerProxy);
if (((!((_local3 == null))) && (!((_local2 == null))))){
_local4 = _local2.gameState;
switch (_local4){
case GameProxy.GAME_STATE_ENEMY_TURN:
case GameProxy.GAME_STATE_HERO_TURN:
_local3.reduceDoubleSpeed();
break;
case GameProxy.GAME_STATE_UNDO_TURN:
_local3.setDoubleSpeed();
break;
};
};
}
}
}//package game.controller
Section 78
//ElementChangePosCommand (game.controller.ElementChangePosCommand)
package game.controller {
import game.model.*;
import org.puremvc.as3.interfaces.*;
import game.model.Elements.*;
import game.view.*;
import org.puremvc.as3.patterns.command.*;
public class ElementChangePosCommand extends SimpleCommand implements ICommand {
override public function execute(_arg1:INotification):void{
var _local2:LevelsProxy;
var _local3:LevelProxy;
var _local4:LayerListProxy;
var _local5:LayerListProxy;
var _local6:CharactersProxy;
var _local7:LayerElementProxy;
var _local8:SwimLayerProxy;
var _local9:InfoLayerProxy;
var _local10:int;
var _local11:int;
_local7 = (_arg1.getBody() as LayerElementProxy);
if (_local7 != null){
_local10 = _local7.x;
_local11 = _local7.y;
_local4 = _local7.parent;
if (_local4 != null){
_local3 = _local4.parent;
if (_local3 != null){
_local6 = (_local3.getLayerByID(LevelProxy.LAYER_ID_CHARACTERS) as CharactersProxy);
switch (_local7.type){
case Sprites.SPR_ID_TRAP_SHARP_BLUE:
case Sprites.SPR_ID_TRAP_SHARP_GREEN:
case Sprites.SPR_ID_TRAP_SHARP_RED:
case Sprites.SPR_ID_TRAP_KEY_BLUE:
case Sprites.SPR_ID_TRAP_KEY_GREEN:
case Sprites.SPR_ID_TRAP_KEY_RED:
_local5 = (_local3.getLayerByID(LevelProxy.LAYER_ID_OBJECTS) as LayerListProxy);
if (_local5 != null){
_local7.putElementsOn(_local5.getElementsAt(_local10, _local11));
};
if (_local6 != null){
_local7.putElementsOn(_local6.getElementsAt(_local10, _local11));
};
break;
case Sprites.SPR_ID_INFO_0:
case Sprites.SPR_ID_INFO_1:
case Sprites.SPR_ID_INFO_2:
case Sprites.SPR_ID_INFO_3:
case Sprites.SPR_ID_INFO_4:
case Sprites.SPR_ID_INFO_5:
case Sprites.SPR_ID_INFO_6:
case Sprites.SPR_ID_INFO_7:
case Sprites.SPR_ID_INFO_8:
case Sprites.SPR_ID_INFO_9:
case Sprites.SPR_ID_INFO_10:
if (_local6 != null){
_local7.putElementsOn([_local6.getElementAt(_local10, _local11, Sprites.SPR_ID_CHARACTER_HERO)]);
};
default:
_local4 = (_local3.getLayerByID(LevelProxy.LAYER_ID_GROUND_TRAPS) as TrapsProxy);
if (_local4 != null){
_local4.listenElementMoveOn(_local7, false);
_local4.listenElementTrapOn(_local7);
};
if (_local6 != null){
_local6.listenElementMoveOn(_local7, false);
_local6.listenElementTrapOn(_local7);
};
break;
};
_local9 = (_local3.getLayerByID(LevelProxy.LAYER_ID_INFO) as InfoLayerProxy);
if (_local9 != null){
_local9.listenElementMoveOn(_local7, false);
_local9.listenElementTrapOn(_local7);
};
_local8 = (_local3.getLayerByID(LevelProxy.LAYER_ID_SWIM) as SwimLayerProxy);
if (_local8 != null){
_local8.listenElementMoveOn(_local7, false);
_local8.listenElementTrapOn(_local7);
};
};
};
};
}
}
}//package game.controller
Section 79
//ElementChangeStateCommand (game.controller.ElementChangeStateCommand)
package game.controller {
import game.model.*;
import org.puremvc.as3.interfaces.*;
import game.model.Elements.*;
import game.model.Elements.Character.*;
import org.puremvc.as3.patterns.command.*;
public class ElementChangeStateCommand extends SimpleCommand implements ICommand {
override public function execute(_arg1:INotification):void{
var _local2:LevelsProxy;
var _local3:LevelProxy;
var _local4:LayerListProxy;
var _local5:LayerElementProxy;
var _local6:UndoProxy;
var _local7:TrapsProxy;
var _local8:int;
_local5 = (_arg1.getBody() as LayerElementProxy);
if (_local5 != null){
_local4 = _local5.parent;
if (_local4 != null){
_local4.listenElementChangeState(_local5);
_local3 = _local4.parent;
if (_local3 != null){
_local8 = _local5.state;
switch (_local8){
case LayerElementProxy_Character.STATE_DEAD:
_local7 = (_local3.getLayerByID(LevelProxy.LAYER_ID_GROUND_TRAPS) as TrapsProxy);
if (_local7 != null){
_local7.listenElementMoveOn(_local5, true);
};
break;
case LayerElementProxy.STATE_BORN:
_local7 = (_local3.getLayerByID(LevelProxy.LAYER_ID_GROUND_TRAPS) as TrapsProxy);
if (_local7 != null){
_local7.listenElementTrapOn(_local5);
};
break;
};
};
};
_local6 = (facade.retrieveProxy(UndoProxy.NAME) as UndoProxy);
if (_local6 != null){
if (_local6.active){
_local6.addHistory(_local5.state, _local5, _local5.targetElement);
};
};
};
}
}
}//package game.controller
Section 80
//ElementCrossMarginCommand (game.controller.ElementCrossMarginCommand)
package game.controller {
import org.puremvc.as3.interfaces.*;
import game.model.Elements.*;
import game.view.*;
import org.puremvc.as3.patterns.command.*;
public class ElementCrossMarginCommand extends SimpleCommand implements ICommand {
override public function execute(_arg1:INotification):void{
var _local2:ElementMediator;
var _local3:LayerElementProxy;
_local2 = (_arg1.getBody() as ElementMediator);
if (_local2 != null){
_local3 = _local2.proxy;
if (_local3 != null){
_local3.listenElementCrossMargin();
};
};
}
}
}//package game.controller
Section 81
//ElementFinishMovingCommand (game.controller.ElementFinishMovingCommand)
package game.controller {
import org.puremvc.as3.interfaces.*;
import game.model.Elements.*;
import org.puremvc.as3.patterns.command.*;
public class ElementFinishMovingCommand extends SimpleCommand implements ICommand {
override public function execute(_arg1:INotification):void{
var _local2:LayerElementProxy;
_local2 = (_arg1.getBody() as LayerElementProxy);
if (_local2 != null){
_local2.onFinishMoving();
};
}
}
}//package game.controller
Section 82
//ElementPutOnElementCommand (game.controller.ElementPutOnElementCommand)
package game.controller {
import game.model.*;
import org.puremvc.as3.interfaces.*;
import game.model.Elements.*;
import org.puremvc.as3.patterns.command.*;
public class ElementPutOnElementCommand extends SimpleCommand implements ICommand {
override public function execute(_arg1:INotification):void{
var _local2:LevelsProxy;
var _local3:LevelProxy;
var _local4:LayerListProxy;
var _local5:LayerElementProxy;
var _local6:ElementPutOnElementStruct;
_local6 = (_arg1.getBody() as ElementPutOnElementStruct);
if (_local6 != null){
_local5 = _local6.m_pElementUnder;
if (_local5 != null){
_local4 = _local5.parent;
if (_local4 != null){
_local4.listenElementPutOnElementCommand(_local5, _local6.m_pElementPut, _local6.m_bPut);
};
};
};
}
}
}//package game.controller
Section 83
//ElementPutOnElementStruct (game.controller.ElementPutOnElementStruct)
package game.controller {
import game.model.Elements.*;
public class ElementPutOnElementStruct {
public var m_pElementPut:LayerElementProxy;
public var m_bPut:Boolean;
public var m_pElementUnder:LayerElementProxy;
public function ElementPutOnElementStruct(_arg1:LayerElementProxy, _arg2:LayerElementProxy, _arg3:Boolean=true){
m_pElementUnder = _arg1;
m_pElementPut = _arg2;
m_bPut = _arg3;
}
}
}//package game.controller
Section 84
//ElementRemovedCommand (game.controller.ElementRemovedCommand)
package game.controller {
import game.model.*;
import org.puremvc.as3.interfaces.*;
import game.model.Elements.*;
import org.puremvc.as3.patterns.command.*;
public class ElementRemovedCommand extends SimpleCommand implements ICommand {
override public function execute(_arg1:INotification):void{
var _local2:LevelProxy;
var _local3:LayerListProxy;
var _local4:TrapsProxy;
var _local5:InfoLayerProxy;
var _local6:LayerElementProxy;
_local6 = (_arg1.getBody() as LayerElementProxy);
if (_local6 != null){
_local3 = _local6.parent;
if (_local3 != null){
_local2 = _local3.parent;
if (_local2 != null){
_local4 = (_local2.getLayerByID(LevelProxy.LAYER_ID_GROUND_TRAPS) as TrapsProxy);
if (_local4 != null){
_local4.listenElementMoveOn(_local6, true);
};
_local5 = (_local2.getLayerByID(LevelProxy.LAYER_ID_INFO) as InfoLayerProxy);
if (_local5 != null){
_local5.listenElementMoveOn(_local6, true);
};
};
};
};
}
}
}//package game.controller
Section 85
//FinishElementStateCommand (game.controller.FinishElementStateCommand)
package game.controller {
import game.model.*;
import org.puremvc.as3.interfaces.*;
import game.model.Elements.*;
import org.puremvc.as3.patterns.command.*;
public class FinishElementStateCommand extends SimpleCommand implements ICommand {
override public function execute(_arg1:INotification):void{
var _local2:LayerElementProxy;
var _local3:GameProxy;
var _local4:int;
_local2 = (_arg1.getBody() as LayerElementProxy);
if (_local2 != null){
_local2.onFinishedState();
};
_local3 = (facade.retrieveProxy(GameProxy.NAME) as GameProxy);
if (_local3 != null){
_local4 = _local3.gameState;
if (_local4 == GameProxy.GAME_STATE_UNDO_TURN){
_local3.undoNextMove();
return;
};
};
}
}
}//package game.controller
Section 86
//FinishMoveCommand (game.controller.FinishMoveCommand)
package game.controller {
import game.model.*;
import org.puremvc.as3.interfaces.*;
import game.model.Elements.Character.*;
import org.puremvc.as3.patterns.command.*;
public class FinishMoveCommand extends SimpleCommand implements ICommand {
override public function execute(_arg1:INotification):void{
var _local2:LayerElementProxy_Character;
var _local3:CharactersProxy;
_local2 = (_arg1.getBody() as LayerElementProxy_Character);
if (_local2 != null){
_local3 = (_local2.parent as CharactersProxy);
if (_local3 != null){
_local3.onMovesDone(_local2);
};
};
}
}
}//package game.controller
Section 87
//GameHadQuitCommand (game.controller.GameHadQuitCommand)
package game.controller {
import game.model.*;
import org.puremvc.as3.interfaces.*;
import shared_levels.model.*;
import main.*;
import editor.model.*;
import main.controller.*;
import org.puremvc.as3.patterns.command.*;
import main.model.*;
public class GameHadQuitCommand extends SimpleCommand implements ICommand {
override public function execute(_arg1:INotification):void{
var _local2:GameProxy;
var _local3:IProxy;
var _local4:LevelProxy;
var _local5:LevelsProxy;
trace("X");
trace("GameHadQuitCommand public function execute( note:INotification ) : void");
_local2 = (facade.retrieveProxy(GameProxy.NAME) as GameProxy);
if (_local2 != null){
_local3 = _local2.runInContext;
_local4 = _local2.selectLevel;
trace(("pLevel=" + _local4));
trace(("pContext=" + _local3));
if (_local4 != null){
_local5 = _local4.parent;
trace(("pLevels=" + _local5));
if (_local3 != null){
trace(("pContext=" + _local3));
trace(("pContext.getProxyName()=" + _local3.getProxyName()));
switch (_local3.getProxyName()){
case MenuProxy.NAME:
sendNotification(ApplicationFacade.CHANGE_PAGE, new PageCommandStruct(PagesProxy.PAGE_MENU, _local5));
return;
case EditorProxy.NAME:
sendNotification(ApplicationFacade.CHANGE_PAGE, new PageCommandStruct(PagesProxy.PAGE_EDITOR, _local5));
return;
case SharedLevelsProxy.NAME:
sendNotification(ApplicationFacade.CHANGE_PAGE, new PageCommandStruct(PagesProxy.PAGE_SHARED_LEVELS, _local5));
return;
};
};
};
sendNotification(ApplicationFacade.CHANGE_PAGE, new PageCommandStruct(PagesProxy.PAGE_GAMEOVER));
};
}
}
}//package game.controller
Section 88
//GameViewHideCommand (game.controller.GameViewHideCommand)
package game.controller {
import game.model.*;
import org.puremvc.as3.interfaces.*;
import org.puremvc.as3.patterns.command.*;
public class GameViewHideCommand extends SimpleCommand implements ICommand {
override public function execute(_arg1:INotification):void{
var _local2:GameProxy;
trace("X");
trace("GameViewHideCommand public function execute( note:INotification ) : void");
_local2 = (facade.retrieveProxy(GameProxy.NAME) as GameProxy);
if (_local2 != null){
_local2.listenViewHide();
};
}
}
}//package game.controller
Section 89
//HalfWayElementStateCommand (game.controller.HalfWayElementStateCommand)
package game.controller {
import org.puremvc.as3.interfaces.*;
import game.model.Elements.*;
import org.puremvc.as3.patterns.command.*;
public class HalfWayElementStateCommand extends SimpleCommand implements ICommand {
override public function execute(_arg1:INotification):void{
var _local2:LayerElementProxy;
_local2 = (_arg1.getBody() as LayerElementProxy);
if (_local2 != null){
_local2.onHalfWayState();
};
}
}
}//package game.controller
Section 90
//HeroFinishAllLevelsCommand (game.controller.HeroFinishAllLevelsCommand)
package game.controller {
import game.model.*;
import org.puremvc.as3.interfaces.*;
import main.*;
import main.controller.*;
import org.puremvc.as3.patterns.command.*;
import main.model.*;
public class HeroFinishAllLevelsCommand extends SimpleCommand implements ICommand {
override public function execute(_arg1:INotification):void{
var _local2:GameProxy;
_local2 = (_arg1.getBody() as GameProxy);
sendNotification(ApplicationFacade.CHANGE_PAGE, new PageCommandStruct(PagesProxy.PAGE_FINAL, _local2.levels, null, _local2.runInContext));
}
}
}//package game.controller
Section 91
//HeroStartLevelCommand (game.controller.HeroStartLevelCommand)
package game.controller {
import game.model.*;
import org.puremvc.as3.interfaces.*;
import org.puremvc.as3.patterns.command.*;
public class HeroStartLevelCommand extends SimpleCommand implements ICommand {
override public function execute(_arg1:INotification):void{
var _local2:LevelProxy;
var _local3:PlayerProxy;
_local2 = (_arg1.getBody() as LevelProxy);
_local3 = (facade.retrieveProxy(PlayerProxy.NAME) as PlayerProxy);
if (_local3 == null){
_local3 = new PlayerProxy();
facade.registerProxy(_local3);
};
_local3.listenStartPlayLevel(_local2);
}
}
}//package game.controller
Section 92
//HeroStartLevelsCommand (game.controller.HeroStartLevelsCommand)
package game.controller {
import game.model.*;
import org.puremvc.as3.interfaces.*;
import org.puremvc.as3.patterns.command.*;
public class HeroStartLevelsCommand extends SimpleCommand implements ICommand {
override public function execute(_arg1:INotification):void{
var _local2:LevelsProxy;
var _local3:PlayerProxy;
trace("*");
trace("HeroStartLevelsCommand public function execute( note:INotification ) : void");
_local2 = (_arg1.getBody() as LevelsProxy);
_local3 = (facade.retrieveProxy(PlayerProxy.NAME) as PlayerProxy);
if (_local3 == null){
_local3 = new PlayerProxy();
facade.registerProxy(_local3);
};
_local3.listenStartPlayLevels(_local2);
}
}
}//package game.controller
Section 93
//HeroTrapOnExitCommand (game.controller.HeroTrapOnExitCommand)
package game.controller {
import game.model.*;
import org.puremvc.as3.interfaces.*;
import shared_levels.model.*;
import main.*;
import main.controller.*;
import org.puremvc.as3.patterns.command.*;
import main.model.*;
public class HeroTrapOnExitCommand extends SimpleCommand implements ICommand {
override public function execute(_arg1:INotification):void{
var _local2:GameProxy;
var _local3:LevelProxy;
var _local4:PlayerProxy;
var _local5:String;
var _local6:SharedObjectProxy;
var _local7:int;
var _local8:LevelsProxy;
trace("*");
trace("HeroTrapOnExit public function execute( note:INotification ) : void");
_local2 = (facade.retrieveProxy(GameProxy.NAME) as GameProxy);
if (_local2 != null){
_local3 = _local2.selectLevel;
_local4 = (facade.retrieveProxy(PlayerProxy.NAME) as PlayerProxy);
if (_local4 == null){
_local4 = new PlayerProxy();
facade.registerProxy(_local4);
};
trace("!");
trace(("pGame.turnsPass=" + _local2.turnsPass));
trace("!");
trace("pGame.gameState = GameProxy.GAME_STATE_VIEW;");
_local2.gameState = GameProxy.GAME_STATE_VIEW;
trace(("pPlayer.playSingleLevel=" + _local4.playSingleLevel));
trace(("pPlayer.isPlaySharedLevel()=" + _local4.isPlaySharedLevel()));
trace(("pPlayer.uidSharedLevel=" + _local4.uidSharedLevel));
_local5 = _local3.uid;
trace(("strUID=" + _local5));
_local6 = (facade.retrieveProxy(SharedObjectProxy.NAME) as SharedObjectProxy);
trace(("pSO=" + _local6));
_local7 = SharedLevelProxy.PLAY_STATE_UNDEF;
if (((!((_local6 == null))) && (!((_local5 == null))))){
_local7 = _local6.getLevelState(_local5);
};
trace(("nState=" + _local7));
trace(("pPlayer.playSingleLevel=" + _local4.playSingleLevel));
trace(("pPlayer.isPlaySharedLevel()=" + _local4.isPlaySharedLevel()));
if (_local4.playSingleLevel){
if (((!(_local4.isPlaySharedLevel())) || ((_local7 == SharedLevelProxy.PLAY_STATE_PLAYED_AND_WIN)))){
sendNotification(ApplicationFacade.GAME_HAD_QUIT);
} else {
sendNotification(ApplicationFacade.WIN_SHARED_LEVEL, _local4.uidSharedLevel);
};
} else {
if (_local3 != null){
_local8 = _local3.parent;
if (_local8 != null){
_local8.listenHeroWin(_local3);
};
_local4.listenFinishLevel(_local2.levelN, _local2.timeNeedToWin, _local2.turnsNeedToWin, _local2.timePass, _local2.turnsPass);
trace(("pLevels.lockedLevels=" + _local8.lockedLevels));
trace(("pLevel=" + _local3));
trace(("pLevel.id=" + _local3.id));
trace(("pLevels.getItem(pLevels.length-1)=" + _local8.getItem((_local8.length - 1))));
trace(("pLevels.getItem(pLevels.length-1).id=" + _local8.getItem((_local8.length - 1)).id));
if ((((_local8.lockedLevels > 0)) || (!((_local3 == _local8.getItem((_local8.length - 1))))))){
sendNotification(ApplicationFacade.CHANGE_PAGE, new PageCommandStruct(PagesProxy.PAGE_MAP, _local8, _local3, _local2.runInContext));
} else {
sendNotification(ApplicationFacade.HERO_FINISH_ALL_LEVELS, _local2);
};
};
};
trace(("pSO=" + _local6));
if (((!((_local6 == null))) && (!((_local5 == null))))){
trace(("nState=" + _local7));
switch (_local7){
case SharedLevelProxy.PLAY_STATE_PLAYED_AND_WIN:
break;
default:
_local6.setLevelState(_local5, SharedLevelProxy.PLAY_STATE_PLAYED_AND_WIN);
break;
};
};
};
}
}
}//package game.controller
Section 94
//HeroUnderAttackCommand (game.controller.HeroUnderAttackCommand)
package game.controller {
import game.model.*;
import org.puremvc.as3.interfaces.*;
import org.puremvc.as3.patterns.command.*;
public class HeroUnderAttackCommand extends SimpleCommand implements ICommand {
override public function execute(_arg1:INotification):void{
var _local2:GameProxy;
trace("HeroUnderAttackCommand public function execute( note:INotification ) : void");
_local2 = (facade.retrieveProxy(GameProxy.NAME) as GameProxy);
if (_local2 != null){
_local2.listenHeroAttacked();
};
}
}
}//package game.controller
Section 95
//KeyActionCommand (game.controller.KeyActionCommand)
package game.controller {
import game.model.*;
import org.puremvc.as3.interfaces.*;
import org.puremvc.as3.patterns.command.*;
public class KeyActionCommand extends SimpleCommand implements ICommand {
override public function execute(_arg1:INotification):void{
var _local2:KeyActionStruct;
var _local3:GameProxy;
var _local4:KeysProxy;
_local2 = (_arg1.getBody() as KeyActionStruct);
_local3 = (facade.retrieveProxy(GameProxy.NAME) as GameProxy);
_local4 = (facade.retrieveProxy(KeysProxy.NAME) as KeysProxy);
if (_local2 != null){
if (_local2.m_pTarget == _local3){
switch (_local2.m_nKeyType){
case KeyActionStruct.ON_PAUSE:
_local3.pause = !(_local3.pause);
break;
case KeyActionStruct.ON_LEFT:
_local3.heroAction(GameProxy.HERO_ACTION_MOVE_WEST);
if (_local4 != null){
_local4.keyLeft = true;
};
break;
case KeyActionStruct.ON_LEFT_OFF:
if (_local4 != null){
_local4.keyLeft = false;
};
break;
case KeyActionStruct.ON_RIGHT:
_local3.heroAction(GameProxy.HERO_ACTION_MOVE_EAST);
if (_local4 != null){
_local4.keyRight = true;
};
break;
case KeyActionStruct.ON_RIGHT_OFF:
if (_local4 != null){
_local4.keyRight = false;
};
break;
case KeyActionStruct.ON_UP:
_local3.heroAction(GameProxy.HERO_ACTION_MOVE_NORTH);
if (_local4 != null){
_local4.keyUp = true;
};
break;
case KeyActionStruct.ON_UP_OFF:
if (_local4 != null){
_local4.keyUp = false;
};
break;
case KeyActionStruct.ON_DOWN:
_local3.heroAction(GameProxy.HERO_ACTION_MOVE_SOUTH);
if (_local4 != null){
_local4.keyDown = true;
};
break;
case KeyActionStruct.ON_DOWN_OFF:
if (_local4 != null){
_local4.keyDown = false;
};
break;
case KeyActionStruct.ON_WAIT:
_local3.heroAction(GameProxy.HERO_ACTION_WAIT);
break;
};
};
};
}
}
}//package game.controller
Section 96
//KeyActionStruct (game.controller.KeyActionStruct)
package game.controller {
import org.puremvc.as3.interfaces.*;
public class KeyActionStruct {
public var m_nKeyType:int;
public var m_pTarget:IProxy;
public static const ON_PAUSE:int = (1 << 9);
public static const ON_LEFT:int = (1 << 0);
public static const ON_DOWN:int = (1 << 3);
public static const ON_UP_OFF:int = (1 << 6);
public static const ON_RIGHT_OFF:int = (1 << 5);
public static const ON_WAIT:int = (1 << 8);
public static const ON_DOWN_OFF:int = (1 << 7);
public static const ON_LEFT_OFF:int = (1 << 4);
public static const ON_UP:int = (1 << 2);
public static const ON_RIGHT:int = (1 << 1);
public function KeyActionStruct(_arg1:int, _arg2:IProxy){
m_nKeyType = _arg1;
m_pTarget = _arg2;
}
}
}//package game.controller
Section 97
//MouseActionCommand (game.controller.MouseActionCommand)
package game.controller {
import game.model.*;
import org.puremvc.as3.interfaces.*;
import game.model.Elements.*;
import org.puremvc.as3.patterns.command.*;
public class MouseActionCommand extends SimpleCommand implements ICommand {
override public function execute(_arg1:INotification):void{
var _local2:int;
var _local3:GameProxy;
_local2 = (_arg1.getBody() as int);
_local3 = (facade.retrieveProxy(GameProxy.NAME) as GameProxy);
if (_local3 != null){
switch (_local2){
case LayerElementProxy.STATE_MOVE_WEST:
case LayerElementProxy.STATE_SWIM_WEST:
_local3.heroAction(GameProxy.HERO_ACTION_MOVE_WEST);
break;
case LayerElementProxy.STATE_MOVE_EAST:
case LayerElementProxy.STATE_SWIM_EAST:
_local3.heroAction(GameProxy.HERO_ACTION_MOVE_EAST);
break;
case LayerElementProxy.STATE_MOVE_NORTH:
case LayerElementProxy.STATE_SWIM_NORTH:
_local3.heroAction(GameProxy.HERO_ACTION_MOVE_NORTH);
break;
case LayerElementProxy.STATE_MOVE_SOUTH:
case LayerElementProxy.STATE_SWIM_SOUTH:
_local3.heroAction(GameProxy.HERO_ACTION_MOVE_SOUTH);
break;
case LayerElementProxy.STATE_WAIT:
_local3.heroAction(GameProxy.HERO_ACTION_WAIT);
break;
};
};
}
}
}//package game.controller
Section 98
//NextMoveCommand (game.controller.NextMoveCommand)
package game.controller {
import game.model.*;
import org.puremvc.as3.interfaces.*;
import game.model.Elements.Character.*;
import org.puremvc.as3.patterns.command.*;
public class NextMoveCommand extends SimpleCommand implements ICommand {
override public function execute(_arg1:INotification):void{
var _local2:LayerElementProxy_Character;
var _local3:GameProxy;
var _local4:int;
var _local5:CharactersProxy;
_local2 = (_arg1.getBody() as LayerElementProxy_Character);
_local3 = (facade.retrieveProxy(GameProxy.NAME) as GameProxy);
if (_local3 != null){
_local4 = _local3.gameState;
if (_local4 == GameProxy.GAME_STATE_UNDO_TURN){
return;
};
};
if (_local2 != null){
_local5 = (_local2.parent as CharactersProxy);
if (_local5 != null){
_local5.onMoveDone(_local2);
};
};
}
}
}//package game.controller
Section 99
//NextTurnCommand (game.controller.NextTurnCommand)
package game.controller {
import game.model.*;
import org.puremvc.as3.interfaces.*;
import org.puremvc.as3.patterns.command.*;
public class NextTurnCommand extends SimpleCommand implements ICommand {
override public function execute(_arg1:INotification):void{
var _local2:GameProxy;
_local2 = (facade.retrieveProxy(GameProxy.NAME) as GameProxy);
if (_local2 != null){
switch (_local2.gameState){
case GameProxy.GAME_STATE_ENEMY_TURN:
_local2.gameState = GameProxy.GAME_STATE_HERO_TURN;
break;
case GameProxy.GAME_STATE_HERO_TURN:
_local2.gameState = GameProxy.GAME_STATE_ENEMY_TURN;
break;
case GameProxy.GAME_STATE_UNDO_TURN:
_local2.gameState = GameProxy.GAME_STATE_HERO_TURN;
break;
};
};
}
}
}//package game.controller
Section 100
//OpenUrlCommand (game.controller.OpenUrlCommand)
package game.controller {
import org.puremvc.as3.interfaces.*;
import classes.*;
import org.puremvc.as3.patterns.command.*;
public class OpenUrlCommand extends SimpleCommand implements ICommand {
override public function execute(_arg1:INotification):void{
var _local2:String;
trace("X");
trace("OpenUrlCommand override public function execute( note:INotification ) : void");
_local2 = (_arg1.getBody() as String);
trace(("strUrlID=" + _local2));
if (_local2 != null){
Global.getURLByID(_local2);
};
}
}
}//package game.controller
Section 101
//PauseGameCommand (game.controller.PauseGameCommand)
package game.controller {
import game.model.*;
import org.puremvc.as3.interfaces.*;
import org.puremvc.as3.patterns.command.*;
import main.model.*;
public class PauseGameCommand extends SimpleCommand implements ICommand {
override public function execute(_arg1:INotification):void{
var _local2:Boolean;
var _local3:GameProxy;
var _local4:MusicProxy;
var _local5:SoundProxy;
_local2 = (_arg1.getBody() as Boolean);
_local3 = (facade.retrieveProxy(GameProxy.NAME) as GameProxy);
if (_local3 != null){
_local3.pause = _local2;
_local4 = (facade.retrieveProxy(MusicProxy.NAME) as MusicProxy);
_local5 = (facade.retrieveProxy(SoundProxy.NAME) as SoundProxy);
if (_local4 != null){
_local4.mode = (_local2) ? MusicProxy.MUSIC_MODE_PAUSE : MusicProxy.MUSIC_MODE_GAME;
};
if (_local5 != null){
_local5.mode = (_local2) ? SoundProxy.SOUND_MODE_PAUSE : SoundProxy.SOUND_MODE_GAME;
};
};
}
}
}//package game.controller
Section 102
//PlayLevelCommand (game.controller.PlayLevelCommand)
package game.controller {
import game.model.*;
import org.puremvc.as3.interfaces.*;
import main.*;
import editor.model.*;
import main.controller.*;
import org.puremvc.as3.patterns.command.*;
import main.model.*;
public class PlayLevelCommand extends SimpleCommand implements ICommand {
override public function execute(_arg1:INotification):void{
var _local2:LevelProxy;
var _local3:EditorProxy;
var _local4:LevelsProxy;
trace("PlayLevelCommand public function execute( note:INotification ) : void");
_local2 = (_arg1.getBody() as LevelProxy);
_local3 = (facade.retrieveProxy(EditorProxy.NAME) as EditorProxy);
trace(("pEdit=" + _local3));
trace(("pLevel.canSolve=" + _local2.canSolve));
if (_local2.canSolve){
sendNotification(ApplicationFacade.HERO_START_LEVEL, _local2);
sendNotification(ApplicationFacade.CHANGE_PAGE, new PageCommandStruct(PagesProxy.PAGE_GAME, null, _local2, _local3));
} else {
_local4 = _local2.parent;
if (_local4 != null){
_local4.select = _local2;
};
sendNotification(ApplicationFacade.CANT_SOLVE_EDIT_LEVEL, _local2);
};
}
}
}//package game.controller
Section 103
//PlayLevelsCommand (game.controller.PlayLevelsCommand)
package game.controller {
import game.model.*;
import org.puremvc.as3.interfaces.*;
import main.*;
import editor.model.*;
import main.controller.*;
import org.puremvc.as3.patterns.command.*;
import main.model.*;
public class PlayLevelsCommand extends SimpleCommand implements ICommand {
override public function execute(_arg1:INotification):void{
var _local2:LevelsProxy;
var _local3:LevelProxy;
var _local4:int;
var _local5:EditorProxy;
trace("*");
trace("PlayLevelsCommand public function execute( note:INotification ) : void");
_local2 = (_arg1.getBody() as LevelsProxy);
if (_local2 != null){
_local4 = _local2.length;
while (--_local4 >= 0) {
_local3 = _local2.getItem(_local4);
if (_local3 != null){
if (!_local3.canSolve){
sendNotification(ApplicationFacade.CANT_SOLVE_EDIT_LEVEL, _local3);
return;
};
};
};
if (_local3 != null){
_local3.playState = LevelProxy.PLAY_STATE_CAN_PLAY;
_local2.select = _local3;
_local5 = (facade.retrieveProxy(EditorProxy.NAME) as EditorProxy);
sendNotification(ApplicationFacade.HERO_START_LEVELS, _local2);
sendNotification(ApplicationFacade.CHANGE_PAGE, new PageCommandStruct(PagesProxy.PAGE_MAP, _local2, null, _local5));
};
};
}
}
}//package game.controller
Section 104
//PlaySharedLevelCommand (game.controller.PlaySharedLevelCommand)
package game.controller {
import game.model.*;
import org.puremvc.as3.interfaces.*;
import com.*;
import shared_levels.model.*;
import main.*;
import main.controller.*;
import classes.*;
import org.puremvc.as3.patterns.command.*;
import main.model.*;
public class PlaySharedLevelCommand extends SimpleCommand implements ICommand {
override public function execute(_arg1:INotification):void{
var _local2:SharedLevelProxy;
var _local3:SharedLevelsProxy;
var _local4:SharedObjectProxy;
var _local5:LevelsProxy;
var _local6:int;
trace("X");
trace("PlayLevelCommand public function execute( note:INotification ) : void");
_local2 = (_arg1.getBody() as SharedLevelProxy);
if (_local2 == null){
return;
};
trace(("pSharedLevel.url=" + _local2.url));
trace(("pSharedLevel.safeUrl=" + _local2.safeUrl));
trace(("Global.isRunFromGamezHero() = " + Global.isRunFromGamezHero()));
trace(("pSharedLevels = " + _local3));
trace(("Global_Settings.DEBUG = " + Global_Settings.DEBUG));
_local3 = (facade.retrieveProxy(SharedLevelsProxy.NAME) as SharedLevelsProxy);
if (((((Global.isRunFromGamezHero()) || (Global_Settings.DEBUG))) && (!((_local3 == null))))){
trace("local run");
_local5 = _local3.renderLevels(_local2);
if (_local5 != null){
sendNotification(ApplicationFacade.HERO_START_LEVEL, _local5.select);
sendNotification(ApplicationFacade.CHANGE_PAGE, new PageCommandStruct(PagesProxy.PAGE_GAME, _local5, _local5.select, _local3));
};
} else {
trace("from site");
CommonFunc.getURL(_local2.safeUrl, "_blank");
};
_local4 = (facade.retrieveProxy(SharedObjectProxy.NAME) as SharedObjectProxy);
if (_local4 != null){
_local6 = _local4.getLevelState(_local2.id);
switch (_local6){
case SharedLevelProxy.PLAY_STATE_PLAYED_AND_WIN:
break;
case SharedLevelProxy.PLAY_STATE_PLAYED_AND_NOT_WIN:
break;
default:
_local4.setLevelState(_local2.id, SharedLevelProxy.PLAY_STATE_PLAYED_AND_NOT_WIN);
break;
};
};
}
}
}//package game.controller
Section 105
//QuitTheGameCommand (game.controller.QuitTheGameCommand)
package game.controller {
import game.model.*;
import org.puremvc.as3.interfaces.*;
import org.puremvc.as3.patterns.command.*;
public class QuitTheGameCommand extends SimpleCommand implements ICommand {
override public function execute(_arg1:INotification):void{
var _local2:GameProxy;
var _local3:PlayerProxy;
trace("QuitTheGameCommand public function execute( note:INotification ) : void");
_local2 = (facade.retrieveProxy(GameProxy.NAME) as GameProxy);
if (_local2 != null){
_local2.quit();
};
_local3 = (facade.retrieveProxy(PlayerProxy.NAME) as PlayerProxy);
if (_local3 != null){
};
}
}
}//package game.controller
Section 106
//SubmitScoreCommand (game.controller.SubmitScoreCommand)
package game.controller {
import game.model.*;
import org.puremvc.as3.interfaces.*;
import org.puremvc.as3.patterns.command.*;
public class SubmitScoreCommand extends SimpleCommand implements ICommand {
override public function execute(_arg1:INotification):void{
var _local2:GameProxy;
_local2 = (facade.retrieveProxy(GameProxy.NAME) as GameProxy);
if (_local2 != null){
_local2.quit();
};
}
}
}//package game.controller
Section 107
//TryAgainCommand (game.controller.TryAgainCommand)
package game.controller {
import game.model.*;
import org.puremvc.as3.interfaces.*;
import org.puremvc.as3.patterns.command.*;
public class TryAgainCommand extends SimpleCommand implements ICommand {
override public function execute(_arg1:INotification):void{
var _local2:GameProxy;
var _local3:int;
_local2 = (facade.retrieveProxy(GameProxy.NAME) as GameProxy);
if (_local2 != null){
_local3 = _local2.gameState;
if ((((((_local3 == GameProxy.GAME_STATE_HERO_TURN)) && (_local2.heroIsWaiting))) || ((_local3 == GameProxy.GAME_STATE_VIEW)))){
_local2.restart(false, true);
};
};
}
}
}//package game.controller
Section 108
//UndoMoveCommand (game.controller.UndoMoveCommand)
package game.controller {
import game.model.*;
import org.puremvc.as3.interfaces.*;
import org.puremvc.as3.patterns.command.*;
public class UndoMoveCommand extends SimpleCommand implements ICommand {
override public function execute(_arg1:INotification):void{
var _local2:GameProxy;
_local2 = (facade.retrieveProxy(GameProxy.NAME) as GameProxy);
if (_local2 != null){
_local2.undoMove();
};
}
}
}//package game.controller
Section 109
//LayerElementProxy_Character (game.model.Elements.Character.LayerElementProxy_Character)
package game.model.Elements.Character {
import game.model.*;
import game.model.Elements.*;
import main.*;
import game.view.*;
public class LayerElementProxy_Character extends LayerElementProxy {
private var m_nActionsLeftOnTurn:int;
private var m_nActionOnTurn:int;
private var m_nAutoMove:int;// = 2
protected var m_nStartActionPoints:int;// = 2
private var m_bCancelMoving:Boolean;
private var m_nActionsPerTurn:int;
private var m_nActionPoints:int;
public static const STATE_FIGHT_WITH_MADAM:int = 103;
public static const AUTOMOVE_PREFER_VERTICAL:int = 3;
public static const AUTOMOVE_RANDOM:int = 1;
public static const NAME:String = "LayerElementProxy_Character";
public static const AUTOMOVE_UNDEF:int = -1;
public static const STATE_FIGHT_WITH_KNIGHT:int = 102;
public static const STATE_FIGHT_WITH_GHOST:int = 100;
public static const AUTOMOVE_PREFER_HORIZONTAL:int = 2;
public static const AUTOMOVE_NONE:int = 0;
public static const STATE_DEAD:int = 200;
public static const STATE_FIGHT_WITH_HERO:int = 101;
public function LayerElementProxy_Character(_arg1:int=-1, _arg2:LayerListProxy=null){
m_nAutoMove = AUTOMOVE_PREFER_HORIZONTAL;
m_nStartActionPoints = 2;
super(_arg1, _arg2);
mass = 1;
}
public function get automove():int{
return (m_nAutoMove);
}
public function onMakeOneStep():void{
if (m_nActionPoints > 0){
m_nActionPoints--;
sendNotification(ApplicationFacade.ON_ONE_MOVE_DONE, this);
};
}
public function set automove(_arg1:int):void{
m_nAutoMove = _arg1;
}
public function isCanMove():Boolean{
var _local1:CharactersProxy;
var _local2:int;
var _local3:int;
_local1 = (parent as CharactersProxy);
if (_local1 != null){
if (state != STATE_DEAD){
_local2 = x;
_local3 = y;
if (_local1.isCanMoveThere(this, (_local2 + 1), _local3, STATE_MOVE_EAST) == STATE_MOVE_EAST){
return (true);
};
if (_local1.isCanMoveThere(this, (_local2 - 1), _local3, STATE_MOVE_WEST) == STATE_MOVE_WEST){
return (true);
};
if (_local1.isCanMoveThere(this, _local2, (_local3 - 1), STATE_MOVE_NORTH) == STATE_MOVE_NORTH){
return (true);
};
if (_local1.isCanMoveThere(this, _local2, (_local3 + 1), STATE_MOVE_SOUTH) == STATE_MOVE_SOUTH){
return (true);
};
};
};
return (false);
}
public function isCanOperateWithCharacter(_arg1:LayerElementProxy_Character):Boolean{
return (false);
}
public function startMove():void{
if (state != STATE_DEAD){
m_nActionPoints = m_nStartActionPoints;
};
}
private function kill(_arg1:LayerElementProxy_Character):void{
var _local2:int;
if (_arg1 != null){
_local2 = _arg1.type;
switch (_local2){
case Sprites.SPR_ID_CHARACTER_GHOST:
onCancelState();
state = STATE_FIGHT_WITH_GHOST;
break;
case Sprites.SPR_ID_CHARACTER_HERO:
onCancelState();
state = STATE_FIGHT_WITH_HERO;
break;
case Sprites.SPR_ID_CHARACTER_KNIGHT:
onCancelState();
state = STATE_FIGHT_WITH_KNIGHT;
break;
case Sprites.SPR_ID_CHARACTER_MADAM:
onCancelState();
state = STATE_FIGHT_WITH_MADAM;
break;
};
};
}
public function set actionPoints(_arg1:int):void{
m_nActionPoints = _arg1;
}
override public function onFinishedState():void{
var _local1:int;
_local1 = state;
super.onFinishedState();
switch (_local1){
case STATE_SWIM_EAST:
if (state != STATE_SWIM_EAST){
onMakeOneStep();
};
break;
case STATE_SWIM_WEST:
if (state != STATE_SWIM_WEST){
onMakeOneStep();
};
break;
case STATE_SWIM_NORTH:
if (state != STATE_SWIM_NORTH){
onMakeOneStep();
};
break;
case STATE_SWIM_SOUTH:
if (state != STATE_SWIM_SOUTH){
onMakeOneStep();
};
break;
case STATE_MOVE_WEST:
onMakeOneStep();
break;
case STATE_MOVE_EAST:
onMakeOneStep();
break;
case STATE_MOVE_NORTH:
onMakeOneStep();
break;
case STATE_MOVE_SOUTH:
onMakeOneStep();
break;
case STATE_FIGHT_WITH_GHOST:
case STATE_FIGHT_WITH_HERO:
case STATE_FIGHT_WITH_KNIGHT:
case STATE_FIGHT_WITH_MADAM:
state = STATE_LOOK_SOUTH;
if (m_bCancelMoving){
m_bCancelMoving = false;
onMakeOneStep();
};
break;
};
}
public function get actionPoints():int{
return (m_nActionPoints);
}
private function killedBy(_arg1:LayerElementProxy_Character):void{
if (_arg1 != null){
onCancelState();
state = STATE_DEAD;
onMakeAllStep();
};
}
public function listenTrapOnCharacter(_arg1:LayerElementProxy_Character):void{
var _local2:int;
var _local3:int;
var _local4:Boolean;
if (_arg1 != null){
if (((!((_arg1.state == STATE_DEAD))) && (!((state == STATE_DEAD))))){
_local2 = type;
_local3 = _arg1.type;
_local4 = false;
switch (_local2){
case Sprites.SPR_ID_CHARACTER_GHOST:
switch (_local3){
case Sprites.SPR_ID_CHARACTER_HERO:
_local4 = true;
break;
case Sprites.SPR_ID_CHARACTER_GHOST:
break;
case Sprites.SPR_ID_CHARACTER_KNIGHT:
_local4 = true;
break;
case Sprites.SPR_ID_CHARACTER_MADAM:
_local4 = false;
break;
};
break;
case Sprites.SPR_ID_CHARACTER_KNIGHT:
switch (_local3){
case Sprites.SPR_ID_CHARACTER_HERO:
_local4 = true;
break;
case Sprites.SPR_ID_CHARACTER_GHOST:
_local4 = false;
break;
case Sprites.SPR_ID_CHARACTER_KNIGHT:
break;
case Sprites.SPR_ID_CHARACTER_MADAM:
_local4 = false;
break;
};
break;
case Sprites.SPR_ID_CHARACTER_MADAM:
switch (_local3){
case Sprites.SPR_ID_CHARACTER_HERO:
_local4 = true;
break;
case Sprites.SPR_ID_CHARACTER_GHOST:
_local4 = true;
break;
case Sprites.SPR_ID_CHARACTER_KNIGHT:
_local4 = false;
break;
case Sprites.SPR_ID_CHARACTER_MADAM:
break;
};
break;
};
if (_local4){
_arg1.killedBy(this);
kill(_arg1);
} else {
_arg1.kill(this);
killedBy(_arg1);
};
};
};
}
protected function onCancelState():void{
var _local1:int;
_local1 = state;
if ((((((((_local1 == STATE_MOVE_EAST)) || ((_local1 == STATE_MOVE_NORTH)))) || ((_local1 == STATE_MOVE_SOUTH)))) || ((_local1 == STATE_MOVE_WEST)))){
m_bCancelMoving = true;
} else {
if (((((((!((_local1 == STATE_FIGHT_WITH_GHOST))) && (!((_local1 == STATE_FIGHT_WITH_HERO))))) && (!((_local1 == STATE_FIGHT_WITH_KNIGHT))))) && (!((_local1 == STATE_FIGHT_WITH_MADAM))))){
m_bCancelMoving = false;
};
};
sendNotification(ApplicationFacade.CANCEL_ELEMENT_STATE, this);
}
public function onMakeAllStep():void{
m_nActionPoints = 0;
sendNotification(ApplicationFacade.ON_ONE_MOVES_DONE, this);
}
override public function onPushButDontFollow(_arg1:LayerElementProxy):void{
super.onPushButDontFollow(_arg1);
onMakeOneStep();
}
}
}//package game.model.Elements.Character
Section 110
//LayerElementProxy_Character_Ghost (game.model.Elements.Character.LayerElementProxy_Character_Ghost)
package game.model.Elements.Character {
import game.model.*;
import game.view.*;
public class LayerElementProxy_Character_Ghost extends LayerElementProxy_Character {
public function LayerElementProxy_Character_Ghost(_arg1:int=-1, _arg2:LayerListProxy=null){
super(_arg1, _arg2);
automove = AUTOMOVE_PREFER_HORIZONTAL;
m_nStartActionPoints = 2;
motionPower = 0;
canRideIfThereHero = true;
}
override public function isCanOperateWithCharacter(_arg1:LayerElementProxy_Character):Boolean{
var _local2:int;
if (_arg1 != null){
if (_arg1.state != STATE_DEAD){
_local2 = _arg1.type;
return ((((((((_local2 == Sprites.SPR_ID_CHARACTER_GHOST)) || ((_local2 == Sprites.SPR_ID_CHARACTER_KNIGHT)))) || ((_local2 == Sprites.SPR_ID_CHARACTER_MADAM)))) || ((_local2 == Sprites.SPR_ID_CHARACTER_HERO))));
};
return (true);
};
return (false);
}
}
}//package game.model.Elements.Character
Section 111
//LayerElementProxy_Character_Hero (game.model.Elements.Character.LayerElementProxy_Character_Hero)
package game.model.Elements.Character {
import game.model.*;
public class LayerElementProxy_Character_Hero extends LayerElementProxy_Character {
public static const NAME:String = "LayerElementProxy_Character_Hero";
public function LayerElementProxy_Character_Hero(_arg1:int=-1, _arg2:LayerListProxy=null){
super(_arg1, _arg2);
automove = AUTOMOVE_NONE;
m_nStartActionPoints = 1;
motionPower = 1;
canRide = true;
}
override public function isCanOperateWithCharacter(_arg1:LayerElementProxy_Character):Boolean{
if (_arg1 != null){
if (_arg1.state == STATE_DEAD){
return (true);
};
};
return (false);
}
}
}//package game.model.Elements.Character
Section 112
//LayerElementProxy_Character_Knight (game.model.Elements.Character.LayerElementProxy_Character_Knight)
package game.model.Elements.Character {
import game.model.*;
import game.view.*;
public class LayerElementProxy_Character_Knight extends LayerElementProxy_Character {
public static const NAME:String = "LayerElementProxy_Character_Knight";
public function LayerElementProxy_Character_Knight(_arg1:int=-1, _arg2:LayerListProxy=null){
super(_arg1, _arg2);
automove = AUTOMOVE_PREFER_HORIZONTAL;
m_nStartActionPoints = 1;
motionPower = 0;
canRideIfThereHero = true;
}
override public function isCanOperateWithCharacter(_arg1:LayerElementProxy_Character):Boolean{
var _local2:int;
if (_arg1 != null){
if (_arg1.state != STATE_DEAD){
_local2 = _arg1.type;
return ((((((_local2 == Sprites.SPR_ID_CHARACTER_GHOST)) || ((_local2 == Sprites.SPR_ID_CHARACTER_KNIGHT)))) || ((_local2 == Sprites.SPR_ID_CHARACTER_HERO))));
};
return (true);
};
return (false);
}
}
}//package game.model.Elements.Character
Section 113
//LayerElementProxy_Character_Madam (game.model.Elements.Character.LayerElementProxy_Character_Madam)
package game.model.Elements.Character {
import game.model.*;
import game.view.*;
public class LayerElementProxy_Character_Madam extends LayerElementProxy_Character {
public static const NAME:String = "LayerElementProxy_Character_Madam";
public function LayerElementProxy_Character_Madam(_arg1:int=-1, _arg2:LayerListProxy=null){
super(_arg1, _arg2);
automove = AUTOMOVE_PREFER_VERTICAL;
m_nStartActionPoints = 2;
motionPower = 0;
canRideIfThereHero = true;
}
override public function isCanOperateWithCharacter(_arg1:LayerElementProxy_Character):Boolean{
var _local2:int;
if (_arg1 != null){
if (_arg1.state != STATE_DEAD){
_local2 = _arg1.type;
return ((((((_local2 == Sprites.SPR_ID_CHARACTER_GHOST)) || ((_local2 == Sprites.SPR_ID_CHARACTER_MADAM)))) || ((_local2 == Sprites.SPR_ID_CHARACTER_HERO))));
};
return (true);
};
return (false);
}
}
}//package game.model.Elements.Character
Section 114
//LayerElementProxy_Movable (game.model.Elements.Movable.LayerElementProxy_Movable)
package game.model.Elements.Movable {
import game.model.*;
import game.model.Elements.*;
public class LayerElementProxy_Movable extends LayerElementProxy {
private var m_bMovable:Boolean;
public static const NAME:String = "LayerElementProxy_Movable";
public function LayerElementProxy_Movable(_arg1:int=-1, _arg2:LayerListProxy=null){
super(_arg1, _arg2);
mass = 1;
movable = false;
}
public function set movable(_arg1:Boolean):void{
m_bMovable = _arg1;
}
override protected function onChangePos(_arg1:int, _arg2:int):void{
super.onChangePos(_arg1, _arg2);
}
public function get movable():Boolean{
return (m_bMovable);
}
}
}//package game.model.Elements.Movable
Section 115
//LayerElementProxy_Movable_Box (game.model.Elements.Movable.LayerElementProxy_Movable_Box)
package game.model.Elements.Movable {
import game.model.*;
public class LayerElementProxy_Movable_Box extends LayerElementProxy_Movable {
public function LayerElementProxy_Movable_Box(_arg1:int=-1, _arg2:LayerListProxy=null){
super(_arg1, _arg2);
movable = true;
mass = 1;
}
}
}//package game.model.Elements.Movable
Section 116
//LayerElementProxy_Movable_Candlestick (game.model.Elements.Movable.LayerElementProxy_Movable_Candlestick)
package game.model.Elements.Movable {
import game.model.*;
public class LayerElementProxy_Movable_Candlestick extends LayerElementProxy_Movable {
public function LayerElementProxy_Movable_Candlestick(_arg1:int=-1, _arg2:LayerListProxy=null){
super(_arg1, _arg2);
movable = true;
mass = 1;
}
}
}//package game.model.Elements.Movable
Section 117
//LayerElementProxy_Movable_Fire (game.model.Elements.Movable.LayerElementProxy_Movable_Fire)
package game.model.Elements.Movable {
import game.model.*;
public class LayerElementProxy_Movable_Fire extends LayerElementProxy_Movable {
public function LayerElementProxy_Movable_Fire(_arg1:int=-1, _arg2:LayerListProxy=null){
super(_arg1, _arg2);
movable = false;
mass = 100;
}
}
}//package game.model.Elements.Movable
Section 118
//LayerElementProxy_Movable_Vase (game.model.Elements.Movable.LayerElementProxy_Movable_Vase)
package game.model.Elements.Movable {
import game.model.*;
public class LayerElementProxy_Movable_Vase extends LayerElementProxy_Movable {
public function LayerElementProxy_Movable_Vase(_arg1:int=-1, _arg2:LayerListProxy=null){
super(_arg1, _arg2);
movable = true;
mass = 1;
}
}
}//package game.model.Elements.Movable
Section 119
//LayerElementProxy (game.model.Elements.LayerElementProxy)
package game.model.Elements {
import game.model.*;
import org.puremvc.as3.interfaces.*;
import com.*;
import main.*;
import game.view.*;
import game.controller.*;
import org.puremvc.as3.patterns.proxy.*;
public class LayerElementProxy extends Proxy implements IProxy {
var m_nX_Old:int;// = -1
private var m_bCanRideIfThereHero:Boolean;// = false
private var m_nMass:int;
private var m_nMotionPower:int;
var m_nID:int;
private var m_pParent:LayerListProxy;
var m_nType:int;
private var m_nCreateNow:int;// = 0
var m_nY_Old:int;// = -1
private var m_nLastFinishedState:int;
private var m_bWaterProof:Boolean;// = false
protected var m_pPushTargetElement:LayerElementProxy;
private var m_bCanRide:Boolean;// = false
var m_nX:int;
var m_nY:int;
private var m_nState:int;// = 13
private var m_arElementsOn:Array;
protected var m_pPushSourceElement:LayerElementProxy;
var m_nMoveToX:int;
var m_nMoveToY:int;
public static const STATE_LOOK_WEST:int = 10;
public static const STATE_WAIT:int = 30;
public static const STATE_MOVE_NORTH:int = 16;
public static const STATE_SWIM_EAST:int = 27;
public static const NAME:String = "LayerElementProxy";
public static const STATE_PUSH_NORTH:int = 20;
public static const STATE_MOVE_WEST:int = 14;
public static const STATE_LOOK_EAST_WAIT_FOR_PUSH:int = 23;
public static const XML_ELEMET_TYPE:String = "type";
public static const STATE_LOOK_NORTH_WAIT_FOR_PUSH:int = 24;
public static const STATE_LOOK_SOUTH:int = 13;
public static const XML_ELEMET_X:String = "x";
public static const STATE_UNDO_PUSH_WEST:int = 36;
public static const ELEMENT_TYPE_UNDEF:int = -1;
public static const STATE_UNDO_MOVE_EAST:int = 33;
public static const XML_ELEMET_Y:String = "y";
public static const STATE_UNDO_SWIM_SOUTH:int = 43;
public static const STATE_PUSH_EAST:int = 19;
public static const STATE_UNDO_PUSH_SOUTH:int = 39;
public static const STATE_SWIM_WEST:int = 26;
public static const STATE_UNDO_MOVE_SOUTH:int = 35;
public static const STATE_LOOK_WEST_WAIT_FOR_PUSH:int = 22;
public static const XML_ELEMET_STATE:String = "state";
public static const STATE_SWIM_SOUTH:int = 29;
public static const STATE_UNDO_SWIM_EAST:int = 41;
public static const STATE_MOVE_SOUTH:int = 17;
public static const STATE_LOOK_EAST:int = 11;
public static const STATE_UNDO_MOVE_WEST:int = 32;
public static const STATE_LOOK_NORTH:int = 12;
public static const STATE_PUSH_SOUTH:int = 21;
public static const STATE_BORN:int = 201;
public static const STATE_UNDO_SWIM_NORTH:int = 42;
public static const STATE_MOVE_EAST:int = 15;
public static const STATE_UNDEF:int = -1;
public static const XML_ELEMET_ID:String = "id";
public static const XML_NAME:String = "element";
public static const STATE_UNDO_MOVE_NORTH:int = 34;
public static const STATE_LOOK_SOUTH_WAIT_FOR_PUSH:int = 25;
public static const STATE_PUSH_WEST:int = 18;
public static const STATE_UNDO_PUSH_NORTH:int = 38;
public static const STATE_UNDO_PUSH_EAST:int = 37;
public static const STATE_UNDO_SWIM_WEST:int = 40;
public static const STATE_SWIM_NORTH:int = 28;
public function LayerElementProxy(_arg1:int=-1, _arg2:LayerListProxy=null){
m_nX_Old = CommonFunc.INT_UNDEF;
m_nY_Old = CommonFunc.INT_UNDEF;
m_bCanRide = false;
m_bCanRideIfThereHero = false;
m_nState = STATE_LOOK_SOUTH;
m_bWaterProof = false;
m_arElementsOn = new Array();
m_nCreateNow = 0;
inCreate();
m_nType = _arg1;
m_pParent = _arg2;
super(((NAME + "_") + m_nID), Number(m_nID));
mass = 0;
outCreate();
}
protected function onElementRemove(_arg1:LayerElementProxy):void{
var _local2:ElementPutOnElementStruct;
_local2 = new ElementPutOnElementStruct(this, _arg1, false);
sendNotification(ApplicationFacade.ELEMENT_PUT_ON_ELEMENT, _local2);
}
public function get canRideIfThereHero():Boolean{
return (m_bCanRideIfThereHero);
}
public function get oldX():int{
return (m_nX_Old);
}
public function get oldY():int{
return (m_nY_Old);
}
public function set state(_arg1:int):void{
var _local2:int;
if (parent != null){
_local2 = parent.isCanChangeState(_arg1, this);
if (_local2 != LayerElementProxy.STATE_UNDEF){
m_nState = _local2;
onChangeState(_local2);
};
};
}
public function get targetElement():LayerElementProxy{
return (m_pPushTargetElement);
}
public function isUndo(_arg1:int=-1):Boolean{
if (_arg1 == STATE_UNDEF){
_arg1 = m_nState;
};
if ((((((((((((((((((((((((_arg1 == STATE_UNDO_MOVE_EAST)) || ((_arg1 == STATE_UNDO_MOVE_NORTH)))) || ((_arg1 == STATE_UNDO_MOVE_SOUTH)))) || ((_arg1 == STATE_UNDO_MOVE_WEST)))) || ((_arg1 == STATE_UNDO_PUSH_EAST)))) || ((_arg1 == STATE_UNDO_PUSH_NORTH)))) || ((_arg1 == STATE_UNDO_PUSH_SOUTH)))) || ((_arg1 == STATE_UNDO_PUSH_WEST)))) || ((_arg1 == STATE_UNDO_SWIM_EAST)))) || ((_arg1 == STATE_UNDO_SWIM_NORTH)))) || ((_arg1 == STATE_UNDO_SWIM_SOUTH)))) || ((_arg1 == STATE_UNDO_SWIM_WEST)))){
return (true);
};
return (false);
}
private function startMoveTo(_arg1:int, _arg2:int):void{
m_nMoveToX = _arg1;
m_nMoveToY = _arg2;
}
public function get isCreateNow():Boolean{
if (parent != null){
if (parent.isCreateNow){
return (true);
};
};
return ((m_nCreateNow > 0));
}
public function onFinishMoving():void{
}
public function get type():int{
return (m_nType);
}
public function get lastFinishedState():int{
return (m_nLastFinishedState);
}
public function parseXMLParams(_arg1:XML):Boolean{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
if (_arg1 != null){
_local2 = _arg1.@[XML_ELEMET_ID];
_local3 = _arg1.@[XML_ELEMET_X];
_local4 = _arg1.@[XML_ELEMET_Y];
_local5 = _arg1.@[XML_ELEMET_STATE];
m_nID = _local2;
setPos(_local3, _local4);
state = _local5;
return (true);
};
return (false);
}
public function set pushTargetElement(_arg1:LayerElementProxy):void{
m_pPushTargetElement = _arg1;
m_pPushTargetElement.pushSourceElement = this;
}
protected function onChangePos(_arg1:int, _arg2:int):void{
if (m_pParent != null){
if (!m_pParent.isLock()){
sendNotification(ApplicationFacade.ELEMENT_CHANGE_POS, this);
};
};
}
protected function onChangeState(_arg1:int):void{
switch (_arg1){
case STATE_MOVE_WEST:
startMoveTo((x - 1), y);
break;
case STATE_MOVE_EAST:
startMoveTo((x + 1), y);
break;
case STATE_MOVE_NORTH:
startMoveTo(x, (y - 1));
break;
case STATE_MOVE_SOUTH:
startMoveTo(x, (y + 1));
break;
case STATE_SWIM_WEST:
startMoveTo((x - 1), y);
break;
case STATE_SWIM_EAST:
startMoveTo((x + 1), y);
break;
case STATE_SWIM_NORTH:
startMoveTo(x, (y - 1));
break;
case STATE_SWIM_SOUTH:
startMoveTo(x, (y + 1));
break;
case STATE_UNDO_MOVE_WEST:
case STATE_UNDO_SWIM_WEST:
startMoveTo((x + 1), y);
break;
case STATE_UNDO_MOVE_EAST:
case STATE_UNDO_SWIM_EAST:
startMoveTo((x - 1), y);
break;
case STATE_UNDO_MOVE_NORTH:
case STATE_UNDO_SWIM_NORTH:
startMoveTo(x, (y + 1));
break;
case STATE_UNDO_MOVE_SOUTH:
case STATE_UNDO_SWIM_SOUTH:
startMoveTo(x, (y - 1));
break;
};
if (m_pParent != null){
if (!m_pParent.isLock()){
sendNotification(ApplicationFacade.ELEMENT_CHANGE_STATE, this);
};
};
}
public function get waterProof():Boolean{
return (m_bWaterProof);
}
public function set type(_arg1:int):void{
m_nType = _arg1;
}
public function get y():int{
return (m_nY);
}
public function get x():int{
return (m_nX);
}
public function inCreate():void{
m_nCreateNow++;
}
public function get state():int{
return (m_nState);
}
public function setPos(_arg1:int, _arg2:int):void{
if (((!((m_nX == _arg1))) || (!((m_nY == _arg2))))){
m_nX_Old = m_nX;
m_nY_Old = m_nY;
m_nX = _arg1;
m_nY = _arg2;
onChangePos(_arg1, _arg2);
if (parent != null){
parent.onChangePos(this);
};
};
}
public function listenElementCrossMargin():void{
switch (state){
case STATE_MOVE_WEST:
case STATE_SWIM_WEST:
setPos((x - 1), (y + 0));
break;
case STATE_MOVE_EAST:
case STATE_SWIM_EAST:
setPos((x + 1), (y + 0));
break;
case STATE_MOVE_NORTH:
case STATE_SWIM_NORTH:
setPos((x + 0), (y - 1));
break;
case STATE_MOVE_SOUTH:
case STATE_SWIM_SOUTH:
setPos((x + 0), (y + 1));
break;
case STATE_UNDO_MOVE_WEST:
case STATE_UNDO_SWIM_WEST:
setPos((x + 1), (y + 0));
break;
case STATE_UNDO_MOVE_EAST:
case STATE_UNDO_SWIM_EAST:
setPos((x - 1), (y + 0));
break;
case STATE_UNDO_MOVE_NORTH:
case STATE_UNDO_SWIM_NORTH:
setPos((x + 0), (y + 1));
break;
case STATE_UNDO_MOVE_SOUTH:
case STATE_UNDO_SWIM_SOUTH:
setPos((x + 0), (y - 1));
break;
};
}
public function get toXML():XML{
var _local1:XML;
inCreate();
_local1 = new XML((("<" + XML_NAME) + "/>"));
_local1.@[XML_ELEMET_TYPE] = type;
_local1.@[XML_ELEMET_ID] = m_nID;
_local1.@[XML_ELEMET_X] = x;
_local1.@[XML_ELEMET_Y] = y;
_local1.@[XML_ELEMET_STATE] = state;
outCreate();
return (_local1);
}
public function onFinishedState():void{
var _local1:LayerElementProxy_Raft;
m_nLastFinishedState = state;
switch (m_nLastFinishedState){
case STATE_SWIM_WEST:
state = STATE_LOOK_WEST;
state = STATE_SWIM_WEST;
break;
case STATE_SWIM_EAST:
state = STATE_LOOK_EAST;
state = STATE_SWIM_EAST;
break;
case STATE_SWIM_NORTH:
state = STATE_LOOK_NORTH;
state = STATE_SWIM_NORTH;
break;
case STATE_SWIM_SOUTH:
state = STATE_LOOK_SOUTH;
state = STATE_SWIM_SOUTH;
break;
case STATE_MOVE_WEST:
state = STATE_LOOK_WEST;
if (m_pPushSourceElement != null){
m_pPushSourceElement.state = STATE_MOVE_WEST;
if (m_pPushSourceElement.state != STATE_MOVE_WEST){
m_pPushSourceElement.onPushButDontFollow(this);
};
m_pPushSourceElement = null;
};
break;
case STATE_MOVE_EAST:
state = STATE_LOOK_EAST;
if (m_pPushSourceElement != null){
m_pPushSourceElement.state = STATE_MOVE_EAST;
if (m_pPushSourceElement.state != STATE_MOVE_EAST){
m_pPushSourceElement.onPushButDontFollow(this);
};
m_pPushSourceElement = null;
};
break;
case STATE_MOVE_NORTH:
state = STATE_LOOK_NORTH;
if (m_pPushSourceElement != null){
m_pPushSourceElement.state = STATE_MOVE_NORTH;
if (m_pPushSourceElement.state != STATE_MOVE_NORTH){
m_pPushSourceElement.onPushButDontFollow(this);
};
m_pPushSourceElement = null;
};
break;
case STATE_MOVE_SOUTH:
state = STATE_LOOK_SOUTH;
if (m_pPushSourceElement != null){
m_pPushSourceElement.state = STATE_MOVE_SOUTH;
if (m_pPushSourceElement.state != STATE_MOVE_SOUTH){
m_pPushSourceElement.onPushButDontFollow(this);
};
m_pPushSourceElement = null;
};
break;
case STATE_PUSH_WEST:
state = STATE_LOOK_WEST_WAIT_FOR_PUSH;
break;
case STATE_PUSH_EAST:
state = STATE_LOOK_EAST_WAIT_FOR_PUSH;
break;
case STATE_PUSH_NORTH:
state = STATE_LOOK_NORTH_WAIT_FOR_PUSH;
break;
case STATE_PUSH_SOUTH:
state = STATE_LOOK_SOUTH_WAIT_FOR_PUSH;
break;
case STATE_UNDO_PUSH_WEST:
case STATE_UNDO_MOVE_WEST:
case STATE_UNDO_SWIM_WEST:
state = STATE_LOOK_WEST;
break;
case STATE_UNDO_PUSH_EAST:
case STATE_UNDO_MOVE_EAST:
case STATE_UNDO_SWIM_EAST:
state = STATE_LOOK_EAST;
break;
case STATE_UNDO_PUSH_NORTH:
case STATE_UNDO_MOVE_NORTH:
case STATE_UNDO_SWIM_NORTH:
state = STATE_LOOK_NORTH;
break;
case STATE_UNDO_PUSH_SOUTH:
case STATE_UNDO_MOVE_SOUTH:
case STATE_UNDO_SWIM_SOUTH:
state = STATE_LOOK_SOUTH;
break;
};
}
public function get countElementsOn():int{
if (m_arElementsOn != null){
return (m_arElementsOn.length);
};
return (0);
}
public function get moveToX():int{
return (m_nMoveToX);
}
public function get moveToY():int{
return (m_nMoveToY);
}
public function onHalfWayState():void{
switch (state){
case STATE_PUSH_WEST:
if (m_pPushTargetElement != null){
m_pPushTargetElement.state = STATE_MOVE_WEST;
};
break;
case STATE_PUSH_EAST:
if (m_pPushTargetElement != null){
m_pPushTargetElement.state = STATE_MOVE_EAST;
};
break;
case STATE_PUSH_NORTH:
if (m_pPushTargetElement != null){
m_pPushTargetElement.state = STATE_MOVE_NORTH;
};
break;
case STATE_PUSH_SOUTH:
if (m_pPushTargetElement != null){
m_pPushTargetElement.state = STATE_MOVE_SOUTH;
};
break;
case STATE_UNDO_PUSH_WEST:
case STATE_UNDO_PUSH_WEST:
case STATE_UNDO_PUSH_NORTH:
case STATE_UNDO_PUSH_SOUTH:
break;
};
}
public function get parent():LayerListProxy{
return (m_pParent);
}
public function putElementOn(_arg1:LayerElementProxy):void{
trace("X");
trace("LayerElementProxy_Key public function putElementOn(pLElement:LayerElementProxy):void");
trace(("this = " + this));
trace(("pLElement=" + _arg1));
if (_arg1 != null){
if (_arg1.mass > 0){
if (m_arElementsOn.indexOf(_arg1) < 0){
m_arElementsOn.push(_arg1);
onElementPut(_arg1);
};
};
};
}
public function set canRideIfThereHero(_arg1:Boolean):void{
m_bCanRideIfThereHero = _arg1;
}
public function putElementsOn(_arg1:Array):void{
var _local2:LayerElementProxy;
if (_arg1 != null){
for each (_local2 in _arg1) {
putElementOn(_local2);
};
};
}
protected function onElementPut(_arg1:LayerElementProxy):void{
var _local2:ElementPutOnElementStruct;
_local2 = new ElementPutOnElementStruct(this, _arg1, true);
sendNotification(ApplicationFacade.ELEMENT_PUT_ON_ELEMENT, _local2);
}
public function set pushSourceElement(_arg1:LayerElementProxy):void{
m_pPushSourceElement = _arg1;
}
public function set canRide(_arg1:Boolean):void{
m_bCanRide = _arg1;
}
public function set waterProof(_arg1:Boolean):void{
m_bWaterProof = _arg1;
}
public function set motionPower(_arg1:int){
m_nMotionPower = _arg1;
}
private function setStateForElementsOn(_arg1:int):void{
var _local2:int;
var _local3:LayerElementProxy;
_local2 = m_arElementsOn.length;
while (--_local2 >= 0) {
_local3 = m_arElementsOn[_local2];
if (_local3 != null){
_local3.state = _arg1;
};
};
}
public function getRaftUnder():LayerElementProxy_Raft{
var _local1:LayerListProxy;
var _local2:SwimLayerProxy;
var _local3:LayerElementProxy_Raft;
_local1 = parent;
if (_local1 != null){
_local2 = _local1.swimItems;
if (_local2 != null){
_local3 = (_local2.getElementAt(x, y, Sprites.SPR_ID_RAFT) as LayerElementProxy_Raft);
return (_local3);
};
};
return (null);
}
public function removeElementOn(_arg1:LayerElementProxy):void{
var _local2:int;
trace("X");
trace("LayerElementProxy_Key public function removeElementOn(pLElement:LayerElementProxy):void");
trace(("this = " + this));
trace(("pLElement=" + _arg1));
_local2 = m_arElementsOn.indexOf(_arg1);
if (_local2 >= 0){
m_arElementsOn.splice(_local2, 1);
onElementRemove(_arg1);
};
}
public function set mass(_arg1:int):void{
m_nMass = _arg1;
}
public function outCreate():void{
m_nCreateNow--;
}
public function get motionPower():int{
return (m_nMotionPower);
}
public function get mass():int{
return (m_nMass);
}
public function get canRide():Boolean{
return (m_bCanRide);
}
public function onPushButDontFollow(_arg1:LayerElementProxy):void{
}
public function isBusyNowForState(_arg1:int=-1):Boolean{
var _local2:int;
if (((isMoveState(_arg1)) || ((_arg1 == STATE_UNDEF)))){
_local2 = state;
if (((isMoveState(_local2)) || (isPushState(_local2)))){
return (true);
};
};
return (false);
}
public static function isPushState(_arg1:int):Boolean{
return ((((((((((((((((((((((((_arg1 == STATE_PUSH_WEST)) || ((_arg1 == STATE_PUSH_EAST)))) || ((_arg1 == STATE_PUSH_NORTH)))) || ((_arg1 == STATE_PUSH_SOUTH)))) || ((_arg1 == STATE_UNDO_PUSH_WEST)))) || ((_arg1 == STATE_UNDO_PUSH_EAST)))) || ((_arg1 == STATE_UNDO_PUSH_NORTH)))) || ((_arg1 == STATE_UNDO_PUSH_SOUTH)))) || ((_arg1 == STATE_LOOK_WEST_WAIT_FOR_PUSH)))) || ((_arg1 == STATE_LOOK_EAST_WAIT_FOR_PUSH)))) || ((_arg1 == STATE_LOOK_NORTH_WAIT_FOR_PUSH)))) || ((_arg1 == STATE_LOOK_SOUTH_WAIT_FOR_PUSH))));
}
public static function isMoveState(_arg1:int):Boolean{
return ((((((((((((((((((((((((_arg1 == STATE_MOVE_WEST)) || ((_arg1 == STATE_MOVE_EAST)))) || ((_arg1 == STATE_MOVE_NORTH)))) || ((_arg1 == STATE_MOVE_SOUTH)))) || ((_arg1 == STATE_SWIM_WEST)))) || ((_arg1 == STATE_SWIM_EAST)))) || ((_arg1 == STATE_SWIM_NORTH)))) || ((_arg1 == STATE_SWIM_SOUTH)))) || ((_arg1 == STATE_UNDO_MOVE_WEST)))) || ((_arg1 == STATE_UNDO_MOVE_EAST)))) || ((_arg1 == STATE_UNDO_MOVE_NORTH)))) || ((_arg1 == STATE_UNDO_MOVE_SOUTH))));
}
public static function parseXML(_arg1:XML, _arg2:LayerListProxy):LayerElementProxy{
var _local3:LayerElementProxy;
var _local4:int;
if (_arg1 != null){
_local4 = _arg1.@[XML_ELEMET_TYPE];
switch (_local4){
default:
_local3 = new LayerElementProxy(_local4, _arg2);
break;
};
_local3.inCreate();
if (_local3 != null){
if (_local3.parseXMLParams(_arg1)){
_local3.outCreate();
return (_local3);
};
};
};
return (null);
}
}
}//package game.model.Elements
Section 120
//LayerElementProxy_Info (game.model.Elements.LayerElementProxy_Info)
package game.model.Elements {
import game.model.*;
import game.view.*;
public class LayerElementProxy_Info extends LayerElementProxy {
public static const STATE_INFO_ON:int = 1;
public static const NAME:String = "LayerElementProxy_Info";
public static const STATE_INFO_OFF:int = 0;
public function LayerElementProxy_Info(_arg1:int=-1, _arg2:LayerListProxy=null){
trace("X");
trace("CREATE public function LayerElementProxy_Info(nType:int = ELEMENT_TYPE_UNDEF, pParent:LayerListProxy=null)");
super(_arg1, _arg2);
inCreate();
state = STATE_INFO_OFF;
outCreate();
trace(("state=" + state));
}
public function get helpID():int{
return ((type - Sprites.SPR_ID_INFO));
}
}
}//package game.model.Elements
Section 121
//LayerElementProxy_Key (game.model.Elements.LayerElementProxy_Key)
package game.model.Elements {
import game.model.*;
public class LayerElementProxy_Key extends LayerElementProxy {
public static const STATE_KEY_OFF:int = 0;
public static const NAME:String = "LayerElementProxy_Key";
public static const STATE_KEY_ON:int = 1;
public function LayerElementProxy_Key(_arg1:int=-1, _arg2:LayerListProxy=null){
super(_arg1, _arg2);
inCreate();
state = STATE_KEY_OFF;
outCreate();
}
override protected function onChangePos(_arg1:int, _arg2:int):void{
super.onChangePos(_arg1, _arg2);
}
}
}//package game.model.Elements
Section 122
//LayerElementProxy_Raft (game.model.Elements.LayerElementProxy_Raft)
package game.model.Elements {
import game.model.*;
public class LayerElementProxy_Raft extends LayerElementProxy {
public static const NAME:String = "LayerElementProxy_Info";
public function LayerElementProxy_Raft(_arg1:int=-1, _arg2:LayerListProxy=null){
super(_arg1, _arg2);
}
}
}//package game.model.Elements
Section 123
//LayerElementProxy_Trap (game.model.Elements.LayerElementProxy_Trap)
package game.model.Elements {
import game.model.*;
public class LayerElementProxy_Trap extends LayerElementProxy {
public static const STATE_TRAP_ON:int = 1;
public static const STATE_TRAP_OFF:int = 0;
public static const NAME:String = "LayerElementProxy_Trap";
public function LayerElementProxy_Trap(_arg1:int=-1, _arg2:LayerListProxy=null){
trace("X");
trace("CREATE public function LayerElementProxy_Trap(nType:int = ELEMENT_TYPE_UNDEF, pParent:LayerListProxy=null)");
super(_arg1, _arg2);
inCreate();
state = STATE_TRAP_ON;
outCreate();
}
override public function set state(_arg1:int):void{
if (state != _arg1){
if (((!((_arg1 == STATE_TRAP_ON))) || ((countElementsOn <= 0)))){
super.state = _arg1;
};
};
}
override protected function onChangePos(_arg1:int, _arg2:int):void{
super.onChangePos(_arg1, _arg2);
}
}
}//package game.model.Elements
Section 124
//CharactersProxy (game.model.CharactersProxy)
package game.model {
import game.model.Elements.*;
import main.*;
import game.view.*;
import game.model.Elements.Character.*;
import game.model.Elements.Movable.*;
public class CharactersProxy extends LayerListProxy {
private var m_pObjects:LayerListProxy;
private var m_pHero:LayerElementProxy_Character_Hero;
private var m_pLabyrinth:LabyrinthProxy;
private var m_nAutoMove:int;
private var m_pWater:WaterProxy;
public static const NAME:String = "CharactersProxy";
public function CharactersProxy(_arg1:int=-1, _arg2:LevelProxy=null){
super(_arg1, _arg2);
type = LayerProxy.LAYER_TYPE_CHARACTERS;
}
override protected function listenRectoreState():void{
var _local1:LayerElementProxy_Character;
for each (_local1 in m_arMatrix) {
if (_local1 != null){
if (_local1.type == Sprites.SPR_ID_CHARACTER_HERO){
m_pHero = (_local1 as LayerElementProxy_Character_Hero);
break;
};
};
};
}
public function isAnyInUndoMove():Boolean{
var _local1:LayerElementProxy_Character;
for each (_local1 in m_arMatrix) {
if (_local1 != null){
if (_local1.isUndo()){
return (true);
};
};
};
return (false);
}
private function autoMovePreforeHorizontal(_arg1:LayerElementProxy_Character):Boolean{
if (tryMoveHorizontalForHero(_arg1)){
return (true);
};
if (tryMoveVerticalForHero(_arg1)){
return (true);
};
return (false);
}
private function autoMovePreforeVertical(_arg1:LayerElementProxy_Character):Boolean{
if (tryMoveVerticalForHero(_arg1)){
return (true);
};
if (tryMoveHorizontalForHero(_arg1)){
return (true);
};
return (false);
}
private function autoMoveRandom(_arg1:LayerElementProxy_Character):Boolean{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:*;
var _local6:*;
_local4 = 100;
do {
_local5 = _arg1.x;
_local6 = _arg1.y;
_local3 = (Math.random() * 4);
switch (_local3){
case 0:
_local2 = LayerElementProxy.STATE_MOVE_WEST;
_local5++;
break;
case 1:
_local2 = LayerElementProxy.STATE_MOVE_EAST;
_local5--;
break;
case 2:
_local2 = LayerElementProxy.STATE_MOVE_NORTH;
_local6--;
break;
case 3:
_local2 = LayerElementProxy.STATE_MOVE_SOUTH;
_local6++;
break;
};
--_local4;
if (_local4 < 0){
return (false);
};
} while (isCanMoveThere(_arg1, _local5, _local6, _local2));
_arg1.state = _local2;
return (true);
}
public function enemyTurn():void{
var _local1:int;
var _local2:LayerElementProxy_Character;
var _local3:Array;
var _local4:int;
_local3 = new Array();
m_nAutoMove = 0;
for each (_local2 in m_arMatrix) {
if (_local2 != null){
if (_local2.isCanMove()){
_local1 = _local2.automove;
if (((!((_local1 == LayerElementProxy_Character.AUTOMOVE_NONE))) && (!((_local1 == LayerElementProxy_Character.AUTOMOVE_UNDEF))))){
_local2.startMove();
m_nAutoMove++;
_local3.push(_local2);
} else {
_local2.actionPoints = 0;
};
};
};
};
if (m_nAutoMove > 0){
_local4 = _local3.length;
while (--_local4 >= 0) {
_local2 = _local3[_local4];
if (((!((_local2 == null))) && ((_local2.type == Sprites.SPR_ID_CHARACTER_MADAM)))){
autoMove(_local2);
_local3.splice(_local4, 1);
};
};
_local4 = _local3.length;
while (--_local4 >= 0) {
_local2 = _local3[_local4];
if (_local2 != null){
autoMove(_local2);
};
};
} else {
if (length >= 0){
sendNotification(ApplicationFacade.ON_ALL_MOVES_DONE);
};
};
}
override public function onRemove():void{
m_pWater = null;
m_pObjects = null;
m_pLabyrinth = null;
m_pHero = null;
}
override protected function isCanOperateWithCharacter(_arg1:LayerElementProxy, _arg2:LayerElementProxy_Character):Boolean{
var _local3:LayerElementProxy_Character;
_local3 = (_arg1 as LayerElementProxy_Character);
if (((!((_local3 == null))) && (!((_arg2 == null))))){
return (_local3.isCanOperateWithCharacter(_arg2));
};
return (false);
}
private function tryMoveVerticalForHero(_arg1:LayerElementProxy_Character):Boolean{
var _local2:int;
var _local3:int;
var _local4:int;
if (((!((m_pHero == null))) && (!((_arg1 == null))))){
_local2 = _arg1.x;
_local3 = _arg1.y;
_local4 = m_pHero.y;
if (_local4 != _local3){
if (_local4 > _local3){
if (isCanMoveThere(_arg1, _local2, (_local3 + 1), LayerElementProxy.STATE_MOVE_SOUTH) == LayerElementProxy.STATE_MOVE_SOUTH){
_arg1.state = LayerElementProxy.STATE_MOVE_SOUTH;
return (true);
};
} else {
if (isCanMoveThere(_arg1, _local2, (_local3 - 1), LayerElementProxy.STATE_MOVE_NORTH) == LayerElementProxy.STATE_MOVE_NORTH){
_arg1.state = LayerElementProxy.STATE_MOVE_NORTH;
return (true);
};
};
};
};
return (false);
}
private function decAutoMoveElements():void{
var _local1:Boolean;
var _local2:LayerElementProxy_Character;
m_nAutoMove--;
_local1 = true;
for each (_local2 in m_arMatrix) {
if (((((!((_local2 == null))) && ((_local2.actionPoints > 0)))) && (!((_local2 == hero))))){
_local1 = false;
break;
};
};
if (_local1){
sendNotification(ApplicationFacade.ON_ALL_MOVES_DONE);
};
}
public function onMovesDone(_arg1:LayerElementProxy_Character):void{
var _local2:Boolean;
var _local3:int;
if (_arg1 == m_pHero){
_local2 = true;
_local3 = isExitNear(m_pHero);
if (_local3 != LayerElementProxy.STATE_UNDEF){
switch (_local3){
case LayerElementProxy.STATE_MOVE_EAST:
case LayerElementProxy.STATE_MOVE_NORTH:
case LayerElementProxy.STATE_MOVE_SOUTH:
case LayerElementProxy.STATE_MOVE_WEST:
m_pHero.actionPoints++;
m_pHero.state = _local3;
_local2 = false;
break;
case LayerElementProxy.STATE_WAIT:
sendNotification(ApplicationFacade.HERO_TRAP_ON_EXIT, parent);
_local2 = false;
break;
};
};
if (_local2){
sendNotification(ApplicationFacade.ON_ALL_MOVES_DONE);
};
} else {
decAutoMoveElements();
};
}
override protected function createElement(_arg1:int):LayerElementProxy{
switch (_arg1){
case Sprites.SPR_ID_CHARACTER_GHOST:
return (new LayerElementProxy_Character_Ghost(_arg1, this));
case Sprites.SPR_ID_CHARACTER_MADAM:
return (new LayerElementProxy_Character_Madam(_arg1, this));
case Sprites.SPR_ID_CHARACTER_KNIGHT:
return (new LayerElementProxy_Character_Knight(_arg1, this));
case Sprites.SPR_ID_CHARACTER_HERO:
return (new LayerElementProxy_Character_Hero(_arg1, this));
default:
return (new LayerElementProxy(_arg1, this));
};
}
override public function onChangePos(_arg1:LayerElementProxy):void{
if (_arg1 != null){
switch (_arg1.type){
case Sprites.SPR_ID_CHARACTER_HERO:
if (m_pHero != null){
if (m_pHero != _arg1){
eraseElement(m_pHero);
m_pHero = (_arg1 as LayerElementProxy_Character_Hero);
};
} else {
m_pHero = (_arg1 as LayerElementProxy_Character_Hero);
};
break;
};
};
super.onChangePos(_arg1);
}
public function autoMove(_arg1:LayerElementProxy_Character):Boolean{
var _local2:Boolean;
_local2 = false;
if (_arg1 != null){
if (_arg1.actionPoints > 0){
switch (_arg1.automove){
case LayerElementProxy_Character.AUTOMOVE_RANDOM:
_local2 = autoMoveRandom(_arg1);
break;
case LayerElementProxy_Character.AUTOMOVE_PREFER_HORIZONTAL:
_local2 = autoMovePreforeHorizontal(_arg1);
break;
case LayerElementProxy_Character.AUTOMOVE_PREFER_VERTICAL:
_local2 = autoMovePreforeVertical(_arg1);
break;
default:
return (false);
};
if (!_local2){
_arg1.onMakeOneStep();
};
return (true);
};
};
return (false);
}
override public function isCanMoveThere(_arg1:LayerElementProxy, _arg2:int, _arg3:int, _arg4:int):int{
var _local5:LayerListProxy;
var _local6:LayerElementProxy;
var _local7:LayerElementProxy_Movable;
var _local8:int;
var _local9:int;
var _local10:int;
var _local11:uint;
if (isCanMoveThere_FromLabyrinth(_arg1, _arg2, _arg3)){
_local5 = objectsProxy;
if (_local5 != null){
_local6 = _local5.getElementAt(_arg2, _arg3);
if (_local6 != null){
_local7 = (_local5.getElementAt(_arg2, _arg3) as LayerElementProxy_Movable);
if (_local6 != null){
if (_local6.mass <= _arg1.motionPower){
_local8 = _arg2;
_local9 = _arg3;
if (_arg2 > _arg1.x){
_local10 = LayerElementProxy.STATE_MOVE_EAST;
_local11 = LayerElementProxy.STATE_PUSH_EAST;
} else {
if (_arg2 < _arg1.x){
_local10 = LayerElementProxy.STATE_MOVE_WEST;
_local11 = LayerElementProxy.STATE_PUSH_WEST;
} else {
if (_arg3 > _arg1.y){
_local10 = LayerElementProxy.STATE_MOVE_SOUTH;
_local11 = LayerElementProxy.STATE_PUSH_SOUTH;
} else {
if (_arg3 < _arg1.y){
_local10 = LayerElementProxy.STATE_MOVE_NORTH;
_local11 = LayerElementProxy.STATE_PUSH_NORTH;
};
};
};
};
switch (_local10){
case LayerElementProxy.STATE_MOVE_WEST:
_local8 = (_arg2 - 1);
break;
case LayerElementProxy.STATE_MOVE_EAST:
_local8 = (_arg2 + 1);
break;
case LayerElementProxy.STATE_MOVE_NORTH:
_local9 = (_arg3 - 1);
break;
case LayerElementProxy.STATE_MOVE_SOUTH:
_local9 = (_arg3 + 1);
break;
};
if (_local5.isCanMoveThere(_local6, _local8, _local9, _local10) == _local10){
_arg1.pushTargetElement = _local6;
return (_local11);
};
};
return (LayerElementProxy.STATE_UNDEF);
};
};
};
};
return (super.isCanMoveThere(_arg1, _arg2, _arg3, _arg4));
}
override public function listenElementTrapOn(_arg1:LayerElementProxy):void{
var _local2:LayerElementProxy_Character;
var _local3:int;
var _local4:int;
var _local5:LayerElementProxy_Character;
if (inGame){
_local2 = (_arg1 as LayerElementProxy_Character);
if (_local2 != null){
_local3 = _local2.x;
_local4 = _local2.y;
_local5 = (getElementAtNotLikeAndNotDead(_local3, _local4, _arg1) as LayerElementProxy_Character);
if (_local5 != null){
if (_local5 == m_pHero){
sendNotification(ApplicationFacade.HERO_UNDER_ATTACK, _local2);
_local2.listenTrapOnCharacter(_local5);
} else {
_local2.listenTrapOnCharacter(_local5);
};
};
};
};
}
override protected function isThereWaterAndCantRide(_arg1:LayerElementProxy, _arg2:int, _arg3:int):Boolean{
var _local4:WaterProxy;
if (super.isThereWaterAndCantRide(_arg1, _arg2, _arg3)){
_local4 = waterProxy;
if (((!((_local4 == null))) && (_local4.isThereXY(_arg2, _arg3)))){
if (_arg1.canRideIfThereHero){
if ((((((hero == null)) || (!((hero.x == _arg2))))) || (!((hero.y == _arg3))))){
return (true);
};
} else {
return (true);
};
};
};
return (false);
}
public function heroTurn():void{
m_pHero.startMove();
}
private function isExitNear(_arg1:LayerElementProxy):int{
var _local2:LabyrinthProxy;
var _local3:int;
var _local4:int;
if (_arg1 != null){
_local2 = labyrinthProxy;
if (_local2 != null){
_local3 = _arg1.x;
_local4 = _arg1.y;
if (_local2.isThereExit(_local3, _local4, LabyrinthProxy.DIRECTION_UNDEF)){
return (LayerElementProxy.STATE_WAIT);
};
if (_local2.isThereExit((_local3 + 1), _local4, LabyrinthProxy.DIRECTION_R)){
return (LayerElementProxy.STATE_MOVE_EAST);
};
if (_local2.isThereExit((_local3 - 1), _local4, LabyrinthProxy.DIRECTION_L)){
return (LayerElementProxy.STATE_MOVE_WEST);
};
if (_local2.isThereExit(_local3, (_local4 - 1), LabyrinthProxy.DIRECTION_T)){
return (LayerElementProxy.STATE_MOVE_NORTH);
};
if (_local2.isThereExit(_local3, (_local4 + 1), LabyrinthProxy.DIRECTION_B)){
return (LayerElementProxy.STATE_MOVE_SOUTH);
};
};
};
return (LayerElementProxy.STATE_UNDEF);
}
override public function isCanBeThere(_arg1:LayerElementProxy, _arg2:int, _arg3:int):Boolean{
var _local4:WaterProxy;
var _local5:LayerListProxy;
var _local6:LabyrinthProxy;
var _local7:CharactersProxy;
if (!super.isCanBeThere(_arg1, _arg2, _arg3)){
return (false);
};
if (_arg1 != null){
_local4 = waterProxy;
_local5 = objectsProxy;
_local6 = labyrinthProxy;
_local7 = characters;
if (isThereWaterAndCantRide(_arg1, _arg2, _arg3)){
return (false);
};
if (((!((_local5 == null))) && (_local5.isThereXY(_arg2, _arg3)))){
return (false);
};
if (((!((_local6 == null))) && (_local6.isWallAt(_arg2, _arg3)))){
return (false);
};
};
return (true);
}
public function listenHeroFinishMoving():void{
}
private function tryMoveHorizontalForHero(_arg1:LayerElementProxy_Character):Boolean{
var _local2:int;
var _local3:int;
var _local4:int;
if (((!((m_pHero == null))) && (!((_arg1 == null))))){
_local2 = _arg1.x;
_local3 = _arg1.y;
_local4 = m_pHero.x;
if (_local4 != _local2){
if (_local4 > _local2){
if (isCanMoveThere(_arg1, (_local2 + 1), _local3, LayerElementProxy.STATE_MOVE_EAST) == LayerElementProxy.STATE_MOVE_EAST){
_arg1.state = LayerElementProxy.STATE_MOVE_EAST;
return (true);
};
} else {
if (isCanMoveThere(_arg1, (_local2 - 1), _local3, LayerElementProxy.STATE_MOVE_WEST) == LayerElementProxy.STATE_MOVE_WEST){
_arg1.state = LayerElementProxy.STATE_MOVE_WEST;
return (true);
};
};
};
};
return (false);
}
public function onMoveDone(_arg1:LayerElementProxy_Character):void{
if (_arg1 != null){
if (_arg1.actionPoints <= 0){
sendNotification(ApplicationFacade.ON_ONE_MOVES_DONE, _arg1);
} else {
autoMove(_arg1);
};
};
}
public function get hero():LayerElementProxy_Character_Hero{
return (m_pHero);
}
}
}//package game.model
Section 125
//DefCompanyLevelsSettings (game.model.DefCompanyLevelsSettings)
package game.model {
public class DefCompanyLevelsSettings {
public static const SOLID_LEVELS:String = "";
public static const STRUCTED_LEVELS:Array = [new DefCompanyLevelsStruct("1 help arrow key", "eNrtWF1vmzAUfd+vQPyBEMyHkZJKBllTpUgV7dveIsVKoqVT1bG2+ffFt7HBNiS2Q7VOGg/BF/tcn3t8wJDFgb2wQ7DfLMN5GLzuN82ubaEw2LH9dtdA++ZbECwO6yN7hnFRGDTHJwaADXvigGgMGjyum+f92zIk5JaQmlRw3mrnmpSE0FM/1WLRD+PPXO/F3fWPfN08lXmddnnHY/Ws81Hmp9p12uet8u90KLVzjy8d0qvS6q7M+QbrLbV8Kr7WcIqedBnONCcg4QQknTC3cML/4x8/TCckwgmxdEI86oS7O3pbgVWgRWv+ANEzpiJjIjMimTHOu4y8Lb31EJWrV9qQB1yuavriHyflz5r+IT9oudp+v/eOp+ZDiAefFqXz4Xmc+fA89nzqafi0XV58BmwL/Wp8mY8YrM6v5vHkM8DPis8ZPZz46Hqc6tw68RleD+j30kfMJ/i58vmYT8w/Frvqo/MRsdN6DfJx9fOE+pyJvfzjdX992vPnLz0P/Y7P2i++yP5l7O5zsbuncndPrntfmMvPklymTN1S8oxtTnZgj+xXc8pWRO2g02dP+4aRhcERfn836wa+gWYjsLgPwwDLLWBJH5YDLNVhixnUrSsgRcVSgew6UTPztS6fQNM0Qv0qY6iS0xdlohF5NGDiC8x8gdgXyO1pjUzNIjMbXNbHpYBLDNyweXJzpfEkK41NTsimFgVXAA474xJPHF+mIxToCvTEIU9h8qsERZbmwMIcmTRHMYE5sguP1rOcCsGp6P57iCYglav3bTFyF13CYduFGcSl4yK0Df6P3c07TPdzew==", 40, (60 * 1000), 1), new DefCompanyLevelsStruct("2 help ricar", "eNrtWN1KwzAYvfcpQl9g/f8BJ6QlyGAwqnfeDRa24RTR6tzbm2Rr0iRNl3ZFUcxNk7TnfOf7crK0u97hD7wD29XU8Ryw366qDekFDtjg7XpTsf7NFQDXu+UBv7LnXAdUhxfMACv8QgGuCQqeltXr9nPqQDiDsIQFu66VawlzCNHpPlLG9X32fMd8Yyzmj3wiTqHPI8FrHstXVY8UHynzqKlb1i/qkCvXhl7UVq9CybvQ47Xmmyt8Mr5UcFI90dSZKE4IaicE3AmehRP+2y9vuhPC2gk+d4JvdMJigWYFswrroZL+gKiMUc0YcsaAM/qJYKR97q17N5/vUQXv03xeoo/h4zB/LNE7fED5fH17N3j81/VAaIxXGvUQlKqH8rTHI7dMeiiPUY+FjTv0mOKJdsF6KTyD16uRv62eug0di3in+a740n35eXO8br98v572dk6Pef90+LnXfm/496L93k/PWPtLrI8Nzw/t9//zYiw92unu1ad7xE/38LL3BY9/liScMupHSRkJJ97hJ/xcndgyl7CcPnvIG0bsgAOZdMBbtaywEDJhSlRNPM2Ua4ovSzPWX7SSEbKMXK+ZZcSyDHiWhGxig0vscaFe1UTDtZc10WuQjlKDVM8ls8kl1WvXH5cyXNQbFxpw7bVL69rFvHbZCLWLZR8EtjWI3aCJywz+ac8lq3PJxOenO0IyiZyMb7swCo5qsQVKVaA/Gwe2QueBvgS0D9iCGxDvCPSHAjsWmnToH1M3Xw9eMMA=", 20, (68 * 1000), 1), new DefCompanyLevelsStruct("3 help prividenie", "eNrtWF1rgzAUfd+vEP9A/TbCWogSxqAw3N72VmiwZd0onfvov5+mTWxujI1WNjbmi7nqOTn33hO/rjf0nW6s9XJqu7b1sV6Wq2rk29aKrotVycazK8u63iz2dMeuc2yr3G8pAyzptgY4Oqj1vCh368+pjfEtxjnO2L4A+xynGJPjeQJifp5d33H8JG6OH/iaeTL1OGl49bG8h3qk+Qk4Tk51y/qbOqRgf6KXtNUrA3ln6nyt+aaAT8bnACfVk0ztCXCCz53gCye4Bk743375pjoh4E7whBM8rRPu7shtxqzCRiSvbyCQMeSMgWD0BaMXN4z1WHjrwUnnH6TEDyid5+R9eBykTzl5w48knRc394Pjv64HY+18uVZPhYJ6ap72+apTOj01j1aPgY1/pR5+cfv8B54fqo8E/t76SP2R5pfrIdWnc301PAXIq4B6OtdXj351rq9x+8U3XXy+Xzw+4jRx//XVEbfqaZmv4/4Hr9fyn9Gj6Af5Sn5puf/pzv/R54XydHf50z0UT/fgsvcFV3yWxIIy7EdZM1acdEOf6Ut5ZEucyOafPdUbRhXsGfFruShpI2TClEBNIk0kNEWXpRmpL1rxCFmGcpYByzISWVZkExMcMscFalWRCc5VdQa9cWggLmQ4vzcu1uDabROrPUaj9Bh1ObkjF6Tm0h8XDsQl5p6ScP5A3EFnPLAusWGPEe9xJHqcjNDjSPZdZFqDyPFUnKlfE55L0vwGcEZIJpaTcZko73wyEHchEPUHanCifNWg/u02+wIeiWYN", 20, (60 * 1000), 1), new DefCompanyLevelsStruct("4 help madam", "eNrtWF1rwjAUfd+vKP0DpvYbVEi7bAiCdL7tTTCoTIe4Tue/XxtN0iT9ssbBxvKS3KT33HNurknrYIMPeGOsF0PTMo3jepGuspFtGiu8Xq5SMh49GMZgMz/hPXkOmEZ62mHisMC73AFUuRrbebpffw1NCMcQJjAm/VLqExhBiC7rSLLpOnm+Zr5g8/kzHo8Tq/OI41bbYi/zEeIjaR4VeYv8eR4iqS/wRWX5iiXdsRqvVG8k4Yn+ieQn5BMNzZ5UCTatBJtVgtWiEv7bL29qJTi0EvqsEvqVlTCdonFMSoWMUJIfIDKiSxEdhmgzxL7PEfMxq60ZiCZHlMJZEE0SdOhuO9Fbgj7hK4omSyqb2s8v4nrBpo3auvl0bTIfCDvwyXEUPvX5KLV/hA9VLtuF1opP/lyz3YqPvH90ncSv58P10/iXfVXi1/Ph+yHyqeLXno8YT8Rp4PP0qOSjtN3E52y34lObn5Lz4I77pat+7lLPWn5ff+380XM+a72/rs1PwdbER7ndLXq7u+x2d257X7DYZ4nPIN3rIHPEDBNv8Ba/pxe0EGR4l8+e7A0jNI0TAf5I5ynmRHqEicyJyQwYJ+82mZ76ouVrUOkCu6jSJSodpjIDq5Hpq5wCLZyCIiebcLIVTk1+YUc/v6NfQPzClrkLaO48lrtQQ+48YKmcvGYtHnDUnHsttYRUS8g/B4EGMb4oxiKkrGYxst+tjuB6zypHlsBskP8BM/oGwP/fMw==", 25, (80 * 1000), 1), new DefCompanyLevelsStruct("5 help kto kogo", "eNrtWNlq4zAUfe9XGP9AbMsrNAXZiKEQKJ6+9S0QkYSmQ8i4S/5+LKXaZVt2DKUzoxfpSj7nnrtgxbk94Dd88PabpR/63vt+0+zaFfC9Hd5vdw1d39143u1hfcYn+lzge835iClgg48EEHRBvZd1c9p/LH0I7yGsYUXnrTbXsIQQfZ4jzWbn9PmefckW+xc+4acy95Hg7bbVWdej+EfaPpJ1q/pFHkptlvQiW74qLe7K9GeNt9T4VHyt4ZR8oqW/0DoBsE4AvBNCh074P775MDshZp0Q8U6IOjvh4QHdV7RV6ArV5AWiMyaMMeaMgDNGmWAka95bj0G5ekcNfMzLVY3epttx+VyjV/iEytX2x8/J9j+sp55HT9tuI/RAyPj7O5ieMz3UVvUQHjf/0jnhmaiHDlc9chyyHmpP0yNs5n+qHsEzT34u/t3z41ifQT3MVvtF2FI/O+hR8qPYX6NH9zd03qWH+VPqZTl3r1ePbdVjib/nfaM/b9bHTY/xvMY/dvzl94Vxu4fsdk/47R5f93sh5J8lGadMxlESxpYTH/AL/tV8shVB4bPPng9KeaYufjfrBgshC6pE18TDzLmm9LowU/OHVjZDlEkQylHGNErAo2zJFi643B0HZFxKcbGBs6c1M3OQz5KD3Ky0UywKLrsKl0zEZaNxl5wXjjnPWc5TnvNihpynQSxrCjs0DeJGAC2NnrnglIYFFEfcDgMjGViMAAJLiGC0xy6cvc4Fq3MhPumDGQqdqXmPLmkIhqPRgATijIzMUicTcT3vpnZB/kO7+wMa61fa", 26, (60 * 1000), 1), new DefCompanyLevelsStruct("6 help key", "eNrtWFtr2zAUft+vMP4D8d0KNAXZiFEIFK9vewtEJKHpKJ3XLv9+lhJJ1pFky6nLWJledPN3zvcdneiSmyN9pcfgsF2FcRi8HbbtvmulYbCnh92+5e3bL0Fwc9yc6Av/LgqD9vRMOWBLnxkgckGDp037cvi9CjG+w7jBNa93oG5whTG5zBPQF/P8+4HxXl+Nn+0pP7U5TpRdd1+vIR/NPwHjpM9b56/iUIG6x5fY4lUD3bXpz6q3AvZ0fANwWjzJKlyATEhFJqQyE2KPTPhf/vFiZkImMiGRmZA4M+H+ntzVPFV4izRsA4EWc2ExkxZTaTEplUXWlrn1EFXrN9LiB1StG/J6fT+rHhvyC38n1Xr39dvV/c/OB2Onv8bJp0NBPsyO3V835eLD7Dj5MJzyp4p93h2fnn9gZ5CfEY+zP+4f8uH+e3wG1+vsz+qfx8ODz6Tf+gAf8clYfLT+x/Lxzd+/wscanwl8eP7YC8+fMT6aP4cdn/1nrvh87P7zOM/+M9Af23/Gitf+8ynOC+N0j8XpnsvTPZt2X2AGO5P0SJ/oj/ZiDUWdlcsbpbsOFGFw4i5+tpuWP1gWDlhswkoJE5eTBecPlcjnUCml5DNIWUbI5ISgFAcnGV4kORXvu44V5gWvnEFlrkc+5ypTpTJ1rBjAlQ6cPTylqQXNogWZnHIfLciMwXRcBjPEE4euxLHEv4po4sDZFwuJxSrkYi1nWKwiSsyfl0fiFbatAnlqWQotS/VejmYQU+qkYk4qGRcDce8EMi1TkS6gDGDXYP9Q3f4BDKotnA==", 34, (60 * 1000), 1), new DefCompanyLevelsStruct("7 help voda", "eNrtWNtu2jAYvt9TRHkBHHKwI0ElJ1hTJ6BLudsdExag0q7qsjL29EsMdohjB8fkAlXNBT5+//Gz84fRjr7TnbNdjV3PdfbbVb4per7rbOh2vclZ/+6L44x2ywN9Y/uA6+SHV8oAK/paAoAO6jwv87ft37GL8T3GGU5Zu5baDCcYk9M6kcZ8ne1vmT8bV/NHeZWetDlPKrn6cb2V7anpJ9I8Obe7bn8Vh0Rqz+wlqnilkt9pU5/S30SSV8dnEq4WTzJ2BxITfM4EXzDBM2DCLT6TBZ4h/G8/+Y7nM/WW2RM+ZJNvx1a9pVovWrUevv6zbJXPnBzx818Y3GawmkwIOBOGgglDLRMeHsh9yqjCeiQrL5BSYCGS7ugzfcm5tKDYdLpzCuqErnNgv7/zZU6ZsIE5DnXGIYYLLHHd9QUafaMBi7QU85DHPBAx90XMh7CKedkXp28Bkume5HiBkmlG3u3HQfKUkT/4B0mm66+P1uO+7eGPqX55P5eHsYU9pZyGPVr9mdY+hT16/cVmq3wZHHSjfJnIacuXhT2t+epgT2u+rrOnr/h85uszX7eVr2vvw37u5w/2/mpUVB5/u4fi7R50q6gaEsWHGxQiwx6KtBj450WMz4qYSBQxoK2G8YSbSNgU9WCTB4CisoouV2QyEGmAaneiZhkMe/AmBIpy1r/sjISDGpzaF9j0BfXiC2qyxciXGi62xHmmJb2MuxIIbYHlqbXy0RoIDQmCOEEiQZC4B4JE9esEmoYvqpPd13wrqn2JuS9x9U8G6MEZqLqGDFgLLU88NDvxl3DIEndiXnecNdCY6hqNQE+QolP+N3r3H2DHy+Y=", 27, (60 * 1000), 2), new DefCompanyLevelsStruct("8 bahus level 8x8 madam", "eNrtWFtvgjAYfd+vIPwBuV8SNSmmWUxMDPNtbyY2SqaLcczLvx982kJbWMplLrvwIC3tOd/5vh4oONySI9lqyWqkm7p2SlbpJmvZurYhyXqTQnv8oGnD7fJCDjDP0LX0sicAWJF9DjDqoNpumR6S80hHaIpQjCZwXgvnGEUI4ds4Zv3spzQO80vzOJ6Im1fMv/IVcSbydVzw1vf5s6iHi4+F67isu05/XV14/XIekTBP1CPmGwl8PD4WcFw98UgfCE6wqRNs5gRTwQn/xw8/ZCc41AkWc4JV64T5HE8nYBVo4Th/gIiMLmV0GKPNGC2/YMzbzFsLI5qdcIoWQTSL8bF934leYvyOnnE0Wz8+te7fUU/cj55seRvoQagiHueV6nFRTz5PiifwVI3X61GwsZIeFZ7v01OM31eP6BfQx+mh/Ro/Sf68xgN9EK+6r+pnMb6oT9XPrM5MD+0383OxXlQPv35/188Nnoef6mnwfP5SPdWH6vgv3b+k3d2ku7vLdnen2/uCyT5LfEbpdqRkKgNG6XWj9OT3JL8ZY06YUZIt2ZHXlFbRyFK9fZudIe8LhHhLlykBsoEKzlfHOWWcBzhXwg0HkLlQA1+uQdBLDYKyJgc02Sq5cDgbcEFjXNgSF9TorK5dQGvnsdqFPdTO49fTVq2dZ5iyDwLFXEKaS1h8PRo9JOPzovK7WM3V1UC/ObATzmqJc9om6LQMmC9Wu4gVSGaRrJH/IzX+AB3qJRk=", 14, (80 * 1000), 2), new DefCompanyLevelsStruct("9 bahus level 8x8 prividenie", "eNrtWFtvgjAYfd+vIPwBQe6JmhTSLCYmhu1tbyY2SoaLcczLvx90ttAbFnAPM+Ol/ajncL7TEy5OcnREuZGtp6ZtGqdsXWzLmWMaW5RttgWez54MY5KvLuiAf2eZRnHZIwxYo30FsFRQY7cqDtl5agIwByAFCR433JiCGAB4XYdcTdbx71vON+r6/A9ffZ1EPA9rXnXNjqKemOljoxj5vmofYm5s6IUyvxKu70S8nrTfmONj8SmHY/uamiMuCQ5JgkOTYGsk4f/444eYBJckYUyTMFYmYbmE8wRHBc9gWt1AeEaPMLqU0aGM46BmrOY0W69WvDjBAryG8SKFx/61G7+n8Au8wXixeX7pXT+6HgCU10uVekoUr6fikV+vXFLpqXiUeiSxxetsfVsPCyF6mPUeenDd0EPq4f7008P7c0sPvx+8Pqk/rXmWXF+i73aeNffnZp5V9z7iR4f8tOrpsF+k7rFf6v1p2a+u+VHtV6c8t9StejrcD39Vj/zQXX/Q54XwdLfJ092jT3d32PuCTT9LAkrpDaSkKkNK6Q+j9MX3pKAbY0VYUqIc7dBHQVy0yh9dv83OuO8Lfl36LFYFwmQjBc5r4kKM83VwQRPnYpyng3NEnYGAm4ywY5x3gehdeBfvQtGDSKcXBhfpe87gHH3PJbhI07uQeOdT76I7eOezuQt0PfCtsdiLo9lLRHqJ6q9O6w7NBGwztm4zPG4gMOwOVOCofeWk+pdn9g1ulP4U", 27, (80 * 1000), 2), new DefCompanyLevelsStruct("10 bahus level 8x8 ricari", "eNrtWFtvgjAYfd+vIPwBQS6tiZoU0iwmJob5tjcTGyXTxTjm5d+PVinSUiyXPczJS1vKOT3f9520wHBDDmRjxMuRaZvGMV4m67TnmMaaxKt1wvrjF8MYbhZnsmfPWaaRnHeEAZZkRwGWCmpsF8k+Po1MhCYIRShk7UpoIxQghK/zWBhn8+z5ivs34/z+hS9fJ5Tv45xXPS62op58fSTgi60YV56HQGhv9OKyfIVC3KG8Xmm8gcBXxEcCrpBPPDJ7ghOczAkOd4Kt4YTn9ccv2Qlu5oQ+d0Jf6YTZDE9CZhXWwxHdQERGL2N0OaPDGfsgZ6R97q25FUyPOEFzGEwjfGg+doOPCH+jdxxMV69vjcePrgch5XqRUk+KEvVQnvL16I6q0EN5lHo0bKylR4fn/+kprU8BfKd+kl+K693ySPOVfm6np/t6Pf1cLz8V40o9NfbDX9VTfunOP+h5IZ3udna6e/x0d9u9L9j8swRwSq8lJVcJOaXfjtKX35NAPUZKmFKSDdmSzyTLopU+dP02O7FUntnr0leySAgj6+ngoD7Ok9eDtXFQgRv2WMaE3AE5d7CT3EE5FqATC5RjAZqxwCwWn8cy6CAWv1hPX7cuvuXIOKc2zmM4tzYONMRdauXVxkEFrrxWg6xWg/wr1+qgWKBYLJuJosz3oikFgoY4tyGuXx/XEug2BYKmwJJicIukHfrnbPwDG0BQeg==", 13, (80 * 1000), 2), new DefCompanyLevelsStruct("11 bahus level 9x9 madam i prividenie", "eNrtWE1vozAQve+vQPyBmPAtJZWGwiGrBNbbS/cYbRCJklbdLC3N/voFE8yHTbBpDq2UucQj/N6Mn8cwzuwQv8UHZbeZq5qqZLtNus1Huqps412yTcn47puizA7rU3wk85CqpKeXmAA28UsBQH1Q5WmdHnfvcxUgAEjAA1gAYLi/+V/On6uTTiXoVSXotBK04UoIF/Av83/AyuH/his4Yf8Z+izaF89/Qvird4qW+RgiVMw78p5bif8doiwf9fH4jxBW8QoezpTVHuwmH8fq+A2+dpxzfP9Pk6+93vM6wt+Aeldc8ojplvTqP8X8dVRmEzywlWBUlTCllTDtrYQoChb3pFTIKMDFC6QgzCnjQ/wUP6cVm5FPOr9z3gniRGL9TddpTMgm4jhHGucQnKZJA/WxQA0RJBoZkcXNJmSTOttlVttl0O3S6XZN7Xq7inH9Cr+ZlD2gId9bZkE6zGNc9okFrwL5lPEeHG+Ju37wVuYnkE9t3jJpxS99bn59RuK186l9GZ5XOb0u5FPrw/GlrKuPbP109Wj4ZL/E6kcovxH6NHnwpzhv/PqW5jG8PR61X916GZcPW78ext3zdTE//nmu/RHnfYQeQvXDraebSRjTjGnV192kX3dDrhljGOmdz6aU5gcpaZYOpbQ+RmmxTah9hSbURK1OyyadlivYadlsTs5VcnLYnAQa3A7OIDhdGqePxLk92g3hLIKzBDV3Ks0tqrl7Bc2tdh2UOQm0+BYyWM1dEdyUvYyIauBWGrj11RxdQQS7LYJWXq3M4dXwgZY8cGzAIfnyQfFX2N1/8SgPnA==", 31, (120 * 1000), 2), new DefCompanyLevelsStruct("12 Bahus level 9x9 gamezhero.com", "eNrtWFtrwjAYfd+vKP0D9n4BFVIpQ3BI59veBIOW1U1cpvbfr41L2qS39KKMYZ7ykZ6T833fqWkcR/AEIyncTGRVls7hBu2SmS5LOxhudwjPp0+SNI7WMTzi5xRZQvEBYsAGHlKAUgWV9mt0DC8TGQAfgC3wAJgDEIDZI75X7A/FN5FHnBN04gSdOkEVcELDePkEj/GnR9EJBnGCRp2gVTphufTnM2wVPPOD9AeEZzQJo0EZdcqo2RljOqfeWine4uwjsHK8ReCfuseG9x743+DN9xbb59fO8dB6ug5eT2eem+lh820bZ3qS+jM75eLc+spgY7LO8OfyLd0fr6e4/Po1LtVTEwvpKdn/+lydntv0C/uzLn+nJGb8w/anKv9sf75eVXr4epXr4fub8AVnJt/6fhX7164+fP+K9bn1+97QH2E9Yn4W0tPk53vrKa1PWz093q//c34VTneVnO4mPd2Nft8LKr2W2JTS7ElJVTqU0upHaRW/k+x2jClhQgkjuIcfiFRRSR76vZtdMCLGxF9ojSAmuwoZYSWcJruoyemXpUMYLcroDpClpWj5LJ2KLEtwTHUMjNNEcEYeZ2KcK4JjdKbOjDFcqB0uKZ6bXaqUAapnK3qxCnpzNhzOEq06h9MwzuqIc1rj3IqiN+FUVXxDxlY6xqWtarmjXdEJao9kkv5JM/0BKGzZ9Q==", 26, (120 * 1000), 2), new DefCompanyLevelsStruct("13 Bahus level 9x9 ricar i prividenie", "eNrdWF1vgjAUfd+vIPwBESgfiZoURxYzk4X5tjcTGyXTxTim498Pqq3QFrgoi8Y+cZVz7/Hc03JxsCZ7stbixVDv69ohXiSr7MrStRWJl6uEXo+eNG2wnqdkR+8zdC1Jt4QCFmSbA4wqqLaZJ7v4d6hjHGK8xAHGE4wjPL5xHNwZn2Mc3RmfcjzUe4ITLOYEizuhD3DC46x0Cb3z+fU2DP+lruwEmznB5E4wK53w9hZOxtQq9CqM8gMkT5ilJGuyIV8Jy2ZnN53OnMw6rq6lGS4LvpN5Qmi2HgTYp0C3Pe4IRBJw0KO/XVABMRVsroLFVTDdswr5Nd8PMyOYHsIEz7xgGoX7y2M7+IzCH/wRBtPly/vFcdd8MM7yM+vQWFyF7wuxyCf//Jg/zyPHtD6vc45lPoVViGe2glrpe5HP6fMiPxqr+Yj3i3zO9dV6iEvZL1b/hIuEPBK/pn7VLFGv2n6x+qVY1A+qDzSu6pdYvymG8WnWq60+an/X+hm0qvaXuh/S7+iIj+j39v1S+729f2D7q3q/l+Oa/R4davqhXIDzp7S/r9hfzecN4Px5nOeXNOP02dMd8ae73W7GkTLyVymXp0RXpuQsPZ7SuS6lI892bgezHTJKo5ZFJy2veURDhiXPhCYEZ5ZGO4MCbQgQFYHoOIRCcK48g4LqOQqiHnAGdeVueZ10yyuScsCTuAC0LgUi6Agv4E7ymUD5PCafw+XzO5DPKZvdrnitUOBUpvUhQEsu6ANF8JkI/vm93mh9iGS58/+WRn+kZAFi", 47, (120 * 1000), 2), new DefCompanyLevelsStruct("14 Bahus level 9x9 2 prividenis i bloki", "eNrtWNFugjAUfd9XEH5AoAVqokuKIwuZy8L2tjcTGzTqZhxz8+8HVSqlJbaV+UQfoFd7DufeXtpbRmuyJ2trOR/brm39LOf5ougB21qQZbbIaf/+zrJG69mB7Og4x7byw5ZQwJxsS4DTBrU2s3y3/B3bGMcYZ3iCcYJxWt6pHdF7ZacnO2P32u9JfVwNz/Ed+UXe2nOTBi+nI+J4z/zRGZfU9fE48T5pHyfxJxV0yP3h/E4a8Wr+nojxzAQdTb8nknkY24NGJoAqEwDLBFchE7prh6y4PH8Wl4cn3tZoUvzRVm9yPLVv7c//NzETYJUJHssErzUTXl7iZEJThfbitFxASsKCkqzJhnzkFRssBp3WnF9KeaDXr3yWE0o2UMEFFBdo4xDFQcPn6euEhjpd5yoHkaFQETca0JRoJIdfJQdkyQFYcnjhOTnKPlsm3pxo+hPn+A1F0zTem9swWqXxN36Po2n2+Cqz0wv/U/vy84o3Q0OPaWvqMebp9fR6ej29nl7Pv+q5wf616mb/UrKF0s+tdnef7e5Qr/QTGNkJM2SU/pWUTCVilMF1lIFY8oYdlLy+w1VaPq203MsVWgMXquNAHTc0xAF1nMeVrq4psAUnL0FDcbJQJ5OFxPOJki9ILKf1ccgQdzovqAYPVcELWPCGHQQv4Cc0UHVGivNVcJJDWhkKpSAMqyAMz986nA6iEPLvka96Igtl760+7rhOABWcJ+rUx4XqOqG4vuj7B9R1QjGeoD05ik755fT+D6UAtps=", 85, (120 * 1000), 2), new DefCompanyLevelsStruct("18 bahus level 8x8 voda", "eNrdWFtvmzAYfd+vQPyBcL9ISSUDVpUul7FOmta3SLGSKOlWJayU/fphExuwDeWSvpSH+HrOd/xxMCbTE3pFJ+Wwnam6qqSHbbLPa6aq7NFht09I/e6LokxPmwydyTxNVZLsBRHAFr1ggNYEVZ43yfnwNlMBmAMQg5CUO66MQQAAvI5Drk3HyfyW/kq77C/4yvGQ66+Mt7brJa+nFh9y/bCqu66/zEPAlWGpF8ryFXLrDsV40vUGHF8dH3O4Wj7hTJ1wTjCpE0zmBL2DEz7oWqYgS3H5p96/moN/afQNrJbASeXQLI4ewPKIy59gfcl7oq/1GWyclPouOovxj1WeB7D61RbnWvIz+PG8JHpa4mA9HIt27ddAdPmATItOsKgTDOYEo9EJ6zWch8QqpAZjvIFgwpwSndAz+p1QNiufdN1z3kiUjPxekk2CCNmkC84mOLs3ziE4rzfOHYXrvz5zFM7vjfNHrc8VcNMJcRLnKZt6ymKeMpmnDLf0FK6z3eVRCxYpTMCjFyxi+Dq8bQXHGP4FTzBY7O6/D25/dj3ixeLFjXryWbwejJPHy4ea9GAeQU/T+iVSh+oReNry0xK/SY/kfpV6qvFSPL7E7R/gnXzJ9EjvX3GVervpYTg2TtslTx89zfl6z8+V9Uvjt+up+UWqp/BLXz18PNLmeProoX4Zmx/q31v7Z5Cf256nIc9Xj/1n0H4o2X867cfS5+1Tvy+EE6NO3+42e7tb/U6MAiP7MHUZpT2Skqn0GKVzg3OtrmmSg22HgxgPLE5iTscTlSOe0t1xCXJFRm8co0cZHcbo3yDjTreEy/PmU01++Z2r3UCUWxeld3WBFGf0xxVAvJRBEe2hEY3mvOcV/IfU3X+xjDEr", 42, (120 * 1000), 2), new DefCompanyLevelsStruct("_15 Hyzhak level 11x11 4 Island and zombie", "eNrtWM2OmzAQvvcpEC8Q80+kZKVh4ZCqCaWrPaS3VEEkavZHCS1ln772GBsCpAuFS1XmEHuY+cafxyMYZ3GKf8Yn5bhfqpqqZMd9eqAzQ1UO8TE5pDi/+6Aoi9Muj8/oR1QlzV9jBOzjVwYgt6DK0y49H38tVYAAIAIPYMXGe9QTNlZ0tFdGYU+kf93ulfZVqUdV/x7rZW14tOOP5N/KJ6rGq6/v1dZr5UcVofu1/Xg39tOuJ+/Yo875qupLdVarBENUgiErQXu/EtbfwQb/CxvzyP/IRgL+BUIi9Zwmk4ufwiZgz58LvcRVxGb6Zgt2xnWniIP6ZgVvmf+1wG1h7QJhz7n+yPzfIrp+RRAfbvk6YVax+A+wLlwpXk/4Olw3i5GAU3iX+/HPXIcrsRk+TLgf5U/j47ok8T8znsh7A/y5yAvNh1iX4iLJT+QlvPB8XPGmEr4w+zfkDTwfVuKHzF/YtYzxeKny3hX+yEfnz5uVYIpK0GUl6DcrIQyD1T2WCs6CiL1AWEAaMj7FT/FzKqKZ1Kl459DScVQlx8CXdJfGGGzWBadpCLT6AwkCnd5AE3EM3hNoI3Den+lf4nTENXkuZni4tWO2xDGb8pgNecy6Ux4zm5ev/kkm+Y/lgXifsiAdHsf0oij4MQIf+jMCn0kmmeSflUYTp4mvuyW/7ma/Jq4RUd4VHRnSGhhSsnRlSHuEVlMj5KoxMrAxMjo2Rnaz/3WG7dNpRnSHRXRFRFtGnI+QOJu0NKIdenSb6M1G1O2Y77nYy7y8eZIRNuNck7I6t/E1YHFxGIDUeiPnPYBGE0h649zuOL2J0/5w6aAT9rfU3W/QCOqd", 17, (120 * 1000), 2), new DefCompanyLevelsStruct("19 bahus level 8x8 prividenie i ricar", "eNrtWMluwjAUvPcrovwA2RcJKjnIqpCQKre33pCwAJVWiKYLf9/kUTtecLETemhVX2zHmXnzJg87Ybylb3TrbZYTP/S9982yXjej2PfWdLNa1zC+vvK88XZxoHu4L/C9+rCjAFjSXQsITFDvaVHvNx8TH6EZQgRNoV8pPUEVQvhrHStztg73s+tYvy7Moe9IhDhCXMzX5ftwF2clrze9oI/FJQqPhK9OxTnySD5gnWfW+aH7NVXynupx9XyF9dN4ouAkP/HEHymVELNKiHklhBaV8N9+edMrIWGVEPFKiIyVcHuLZ1MoFRhh0m4gKmPKGBPOGHPGKO8Y2zGvrfugmr/jGt0X1Zzgt/7zpHok+BU94Gq+urnrPf/rehDi/MRaT4NS9bQ8R/5maKun5THqkSv2InrEeL31HOOpzVVPNzfEt9EDcxbfTU+Xv6rH0i/teZj2Gjn++XrucGI8mFvoMdUPNNUv2+cl+mrwz7WeVX+YPlc9Ig/hPEP0yH6d1+Ow/3yrx2E//FE9p5vt+h89L7TTPWSne8pP92TY+0LIP0tyTpkOpOQqC06ZDaPM9Pek3I2xJWwo6ZY+0eeauRg0qX59m32AlQd4XXqpFzUFspEBF4q4FHC5DS4WcaUBNx5B5ooHue5BcREPCj2X1CaXQvcuccZlgCssPSiYBxn3oLyAB5n8PGPQVJ7PJQsiEVfY42Ldg8TSg5J5UHZfj8EFTMhlE0LbH8NJXOmOGwiM+wKjnilG5ufVDNq/h64/ARP1C/8=", 24, (80 * 1000), 2), new DefCompanyLevelsStruct("21 bahus level 8x8 dama", "eNrtWFtvgjAYfd+vIPwBQZBLoiYFu8XFxTDf9mZio0ZdjGNe9utHqy20tFrQLIsbL72e853v42DB9hJt0dKYTzqmbRq7+SSdZT3HNGZoPp2lpN99MIz2cnxAG7LPMo30sEYEMEFrDLBUUGM1TjfzfccEoA9AAmLSToU2AREA8LQOhTFdJ/vPzBfG+fyRL48Tl+dhzqse862oh4sPhXlY1M3rz+sQCW1BL5TVKxbyjsvxpPlGAh+PTwQcV0/YMRuCExzqBIc5wdZwgs7VGyqXXtxTu1BuOSR8K+F/5ltZnMWdxrGUW74SrZtTdoJLndBkTmgqnTAcwn5MrEJ6MME/ICJjizK6jNFhjE0/Z8R95q2RFQ12MAWjIBokcFt/7EaLBH6CNxgNpk+vtcf3rgeAGnoylKgH81TWg3mUejRsrKVHh+fv6cnvB918jJdfNH5Bj8rPjz0ONxV4jvELes76+To9//75aT23et5/y++P/NJdv9PzonS62/R0b7HT3b3ufcFmnyU+o2xdSclUBozSu47SK78n+dUYMWFGiZZohd5TWkUr2376NtuTUh7I69JHOk4RIWvo4LyauECBazdI5kIN/HINgpvUIChqahJNnk4uEhy+9RWBbl1gUBeILS9Hygsf0MJ7rPDhDQrvWXZRVUhEBZez8Sy3jHM1cwlpLmH+6WndIBmfT8bRfSKkuLAyLqwZr1UT5196crMO/oOo+w1M+wjN", 10, (80 * 1000), 2), new DefCompanyLevelsStruct("_16 Hyzhak level Labyrinth and 3 zombie", "eNrtWF1rgzAUfd+vEP9A/YwK7SAWGYXC6Mpe9lZoaMvaUTb30X8/E2ea5ssk9WVjefJizrnHe08SdbxHH2jv7dYTP/S9z9263jZXse9t0W6zrcn17Y3njferE3ol8wLfq09HRABrdMSAQAX1Dqv6dfc18SGsINzAEsIZhAs4HSieDsz3H6vjiT/inBB3ToipE0IDJ/yPXz5EJySdEyLqhEjphPv7ajYlViFX1QJvIDxj2jEmlDGmjFF2ZsTX1FvLoJx/VjVc5uV8UX24x0n5vKje4VNVzjd3D87x0HrE0eTTxu3g9eB5LD+J8TydHvY+1cPkY/QtE4kIZr5UD+HH81h9bXzWw9zX6CH5pfpUelV6+HrJ9fXpkfZHWi9NfXT96IuV/unrl7w+6nxMv6T1k+vh85/7p7qv90+fHnc/M/7S9Euan/cz73dNv/h6SPX1+VnqX/l99f6j2l8c9h/N+rLtlzS/pH+PM7P11bfebdcXr8doff2d80s43cPudE/p6Z5c974Q0s+SjFKmV1JSlTmlBNdRAvE9KbNjxIQNJdqjA3qpuyoGTfV+vs2+SJYTwb3VqxoRspECB1hcRHCRCS5lcbk5LmNxCcFl1jjca1NgLD5gao0Djri2MIU17ucBjRJGF0CCAwJuPCIe5NyYiW7MB3FjLmoycuMFLnbEFY648DqhqaNQe1zr4tBeaO4KbBdqbmirvLMVoLYqBrAVCEKx6nH/s4DLJWK86XC41DEfUOST167oalecf6kE1mdOw41/691+A/XucJc=", 80, (120 * 1000), 2), new DefCompanyLevelsStruct("20 bahus level 8x8 prividenie", "eNrtWN1qgzAYvd9TiC9Q/6PQFqKEUSgMN3azu0JDW9aOsbl2ffuZuERNTBtjGVtZbkzUc77zfTma6HiL93hrbZYT27Wtw2ZZrMueb1trvFmtC9qf3ljWeLs44jd6n2NbxfEVU8ASvxKAo4Jau0Xxtvmc2BDOIMxhRo8r4ZjDFEL0fR0JY3ad3n/ifGNcn6/46jiZfB7VvLpjUU8rPhLOo6butv66DqlwbOhFXfXKhLwzOV5nvqnA18bnAq5VTzSxR4ITfOYEnzvB1XDCf/vjTXZCwJzgcSd4Sifc3aFZRq1CeygnLxCRMWSMAWf0OaMHakbS5956cNL5ARXwIU7nOdqbj4P0OUcf8Aml89XtvfH42vVAaKCnRIl6CE9vPYRHqUfPyY+zc3pUyCo+bYP0VPErHvP6DNVTj/X01PG743XqOennjvhi6+FnFl/0yzk9cn1Y/if0nPOPql5Gfm7PT389qnGTR0cPG59oP/q8/5b3T3fTvX6l64W0urtsdQ/56h4M2y+4/LMEcMpwICVXGXPKaBhlJO+TQD9GQlhS4i3e4ZeCVdEpb/r+Niu3QYltHel26b1YFJiSjRS4oImLKS7WwYEmLqK4SAcXNXE+xQEdXCs/oJ9fCxca4nwFbjyiMyvMMZDnOL7IHMeyplAnl1ieq6Q3LjTEVZ4ij1JPIHmgzZCBKdAz1kqBXn+cCtjtrJg5K+LOSi7grKjr7aEx05Hjyc4KNHNJWC5J/e/AuUAyoJ2MqxB1FjcQCPoDFThevrJD/tVNvwBErHI4", 24, (80 * 1000), 2), new DefCompanyLevelsStruct("_17 Hyzhak level with many boxes", "eNrtmt9q2zAUxu/3FMYvEP21ZEgKdsiFYaOYsQcIRCSBdJTW3Zq3XyxiRbHiLf7Uiw6si0iR9ft0JB0dySHzg/llDsl+s0hpmvzeb5rdqcTTZGf2211jyw9fkmR+WB/Ni21H0qQ5PhsLbMxzC5AhNHlaNy/790VaFHVRFsWqzYvtOa+Lpa3atnnlnnv51fOOu25X+c+93HLlQH33vby0G2rvcXXvee3XX+n065e9oS3D9lU4tLD+2o7at6Of32xX9nJvHqpb8+C3X6SznifwzhO48wR6hydM6T9PoSeIzhOY8wQ26AmPj6tqaV3FllZ1G0D6irJTFE6RO0WmLopt+XP71qopvuvyax2t81b8+PaJ7JnSlKY0pSlN6e8pON1pd7pLd7qLuPsCda8lyknKSElnpXaSWZxkFt6TVJyiChV1nKLuFDOnmI9TbAVPkuZgnszPplMjp0bn98d328vRfr4268ZYsdkAx3yOW44G3HxmR9AbS96NJb+8oZAPGIwi3DeKWqPIvwfT4wTIKZDTIJeDXDvXGIjOKGVxIEVBhoIcBQUKShTMUFChoEbBHPVVysDdAYAaBRUKZigoUVCgIEdBhoIUBUkkSEAwBzkFchnISZATIMfRhQBdBnVudBvCAQOMUGhk4yAnwbgmwfmU4PopsD8Nrp9G4z0BBwifogoFc/D0RTkK3001GCwy8EDjICfQpRDozDC0Rw4uYobevNA3L4qeFDl6m0F3MGCpAtdCgWuRgTMjwf44GPMFuO1l3CUP5dCL8139iZBDLzOoZ4+3U9xvJwsdVIzmcrC/czTUo0F1/05i4QJmozkB9nc+J+6LTTdJYFJZLElhkoAxkYzuEfUcMjRE97PqqdD+U+jhD1DsYM4=", 40, (120 * 1000), 2), new DefCompanyLevelsStruct("22 bahus level 9x9 voda i dama", "eNrtWNtugkAQfe9XEH5A5LomYrLoprHx0tW3vpm4QaM2xlIv/frCWhaYhYLUNm3qvsxe5syeuQCj7TXbs7WynLtqU1UOy3mwCGeGqizY0l8EfN65U5T2enZiO66nqUpw2jIOmLNtBNCKoMpmFuyWR1fFuI8xxV0ufSAp9jAmH+cErONzrg/3u8l+Si/RP9vzJf3UPknsFq+zEvLJ3E/APknzzvL3AX8/zbufxEOOF/S7K98X7mPJXw/Yy+Jpeg3jSVy1ASrBiCvBEJXQrFAJPzxGffx26D3iITrL0VBSOdHeAx6uUhJqwPNQwgHPQ1njngmwQ/HvG3IlmHEl6KIS9MJKGI9Jv8tLhc8IjV4gkcHQJFuzDXsOYmtmqPTxzjnyW06uaqnKSzALGDfWqIKzOM65GOdwnFkTZ9fEoYtxrQKe7QbPEMiVFefKFLkyRK50J8lVNBdP7VTzBgcS4CnyBpTs669Nb0XJK34i3sC/n9Re/ws+madO3EdLzmU+QO98Xzj99LyMT9moyqfczo3Pjc+Nzx/mc/tefBcfqRNrxl93S3zdzcs6Mcmi+MHnCJPWF00KlkiYtK/QLzY1LacxqtCIQaBRAMzvqGy5+3Wu4I2l5XSxRrkzAOcU4PJ9cWRf0FV8QWlOOuekV/Elg4tqsRbQrIlDBbj84KE4eLYIXusKwbOzCUVVfbE1Uw561aJuxb60kh/32sWPfWg7+oOp8w4/2RTX", 42, (120 * 1000), 2), new DefCompanyLevelsStruct("23 Hyzhak level 11x11 key voda and 2 privideniya", "eNrtWFtvmzAYfd+vQPyBmjuRkkofF01sSTPaTbu8RQ0iUdMtylhp8utnG3CKbQIkqOpD/eIb53znO/4UTMab5CnZKOvlRNVUJV8vsxUeGaqyStbpKqPj6w+KMt4s9smOPodUJdtvEwpYJlsCQE1Q5XGR7dbPExUgBEjBp30MHkBU9nTul/vFOn0uKudNuIjDSXv5/hHn13SkHH8qxJPEjzh+qT5fjB9xeYUNc4lPYu/VdIh8vL+8Pz6Xj0RfNFGvuEowqkowWCVoHSpBbAcIvsDMhUMeTEHagi3MHsCG4BPM7+WP3HwDRPsQdAi+wonmxJjnRhrnMxvieA6cbvtYsjj/A4c02JGhneI4uKG0yA/leB3vazmJ/xOsNPhB88qDW6IH54f7FHSiD6/v42BR9t85nRnJE6/HMM+L+QzBKzWxEsyqEnRWCXpjJcznYeTTUqGjMCY/IDyjVTGajNFgjLpzZCRjVlt3yJvmYQZ3rjeNw6fz56b3EIf/4FfoTdOPt7J5zObYkWofoP58ezwMqeaEp9wnPDI9J9uJfV6P2OrxGnla9RR+tDVRj9yPVh5BT7f4bXqO53Gpnoq/Op9z/an4Cz01vy7Sc4E/g5zXea29njvyvOt51/MG9bzC+6vTfCA9wttdq97uFnu7m/3uC4QQUyab5DH5nZVsLsIPld8oz/TCsKch/maLLGG3DAnMfAmzKMxgMK0bzOGi9YIZvMjxFXWL9419fDnMOOuyi5bGzsJllPYAZ6Gh+mGMaJ7u0R7jVKK2eKF0BhBlIeOlJp1qsgVNbbiiQrTeOLMhntwDR/TAHcQDV8zF6pKLK3pn9MaZDTi5B27lgc08GA3ggS37oeiQi410Eaf3xo161cGo8mB0/MxGA5jgyJIx25PhcE7bgeIB+ZPp+j88/wNo", 47, (180 * 1000), 2), new DefCompanyLevelsStruct("27 bahus level 9x9 prividenie v labirinte 1", "eNrtWF1vgjAUfd+vIPwB+W5J1KQYspi4GGb2sjcTGyXDxbhO5d8PGluR0rWAezCzD6Y3cM49vfdAi8MMH3BmpKuRaZvGMV2RTTFzTWOD0/WG0Pn4yTCG2TLHe3qfZRok32EKWOFdCbBkUGO7JPv0NDIRihFaowihKUIJmjziu4tH5qDmBJc5weVOsDWc8Bh3PkQneMwJDneCI3XCfB5PJ9QqdBYn5QukzugzRo8zupzRARfGcs69tbCi2TEmaAGjWRIfusde9JHE3+g9jmbr59fO8b/QI7NJcV0cKj2X+5Lil8bFdRpX8tfjup6FV8nXEGvpqeeXxUyvSg+tRyV/pT5X+nT1XNXjzNOmPvX8vfSw/M2xzD9vL/V8qqGnR/STyNPGP931VPohfU7U/dIazF+/6NHj6fi8d6iP2A9VrNLTrE/Lz4/94q/0CLu7zXZ3n+/uXr/zgs0/SwCn9HtScpWQUwb9KAPxnATaMZaEBSXO8BZ/ElZFq7j9/G12ogelnKb4IkuCKdlAB+d3xIGOuFAf54g6fR2cV8WVHslpE9RAUAV6FAcE3HBAW1trMhCbDG/SZCg2GeqsBYpF91vjIMW5rXGBJF9z7SCrXcBrF96gdoFli5qAei3BtfEciX+a1xKytYSXz2Or9fuj4C7/ohn/APbW4qk=", 58, (240 * 1000), 2), new DefCompanyLevelsStruct("24 Hyzhak level 11x11 voda i 1 prividenie", "eNrNWN1umzAYvd9TIF4g/EOkUMkQNKXKFrH2YtpdpFgkSjpVLWvHnn7GgDEYxzZzqvnG/mqf4+/n2DhdXeAbvBinQ2y6pvF+OpTH2LTR8AhPxbHE47tPhrG67Cv4gtdZplFWzxBNmcYBPtcAiwc1nvbly+l3bAKQAZCDBIANAEXdYzvFdk7spLVTbBe0Pfh72q+nenZ9wu7bzzeToLXxIoq3B3c4igwPKTtt+SlnxnbnN8U72qfhyRneZDJY3j5s3+y7ofM0kUeqLsWoDk0fm4uREtxOCS5Rgi2hBPX2p7g+HxTre7B7vbJi/R18OQMHrB+5S9B8lSMe1PNaN1/l3H3uCY9on698b612PgT/ZWOV4HVKcIgSHK4Sdrtsk2Kp4FGW1xdITYgo4QU+wZ9lx+ahRe2dg6QTmEYVm5FpvJb7EmKyhQwuxLhQGefPxDV+2jNxHoNbLXCmRzn3u5x7JOf9Fe6Efc7rMTl9D1ayfc9K8BAl2zx7m297yTnPfoEfWbItPn+bsnPBPLbF+yHBKfgzt439mc1zM39m5GfSH149ah5OvSb80VWvwf6iJqUfGZ6P04+sPyL9yOZHrB+F/HyInvX4oyU/SvW6cr6UMnPlfCnycM+Xqj83PF/6z/vNvl9nPd8vKZt5Udnd190nX3dP7UXFMJIfbiGh9P+RkngZEcpAw7vPtqyJh1ggflCNgZHSiypgX7Ghhmh8y6V98jg+iXBqsYRsLJGWWCK2MLZMLAOcOxMXzsQtZ+J8+VpN+Clbq6irVUBqtdRQq2B4FhrdLcWxBJbD6q6+PaSCWbLCsy0N0YTDaBzslS+OZoSrfZkEkmjQoP6f2N1fsSI2mA==", 17, (180 * 1000), 2), new DefCompanyLevelsStruct("25 bahus level 9x9 prividenie v labirinte 2", "eNrtWF1vgjAUfd+vIPwBQT5N1KSQbjExMcy3vZnYIJkuxjE//v2grgVuCxZ0Jsvsg21p77nn3nug4HBN9mStJcuRburaIVmmq2xk6dqKJPEqpePxk6YN14sT2dF9hq6lpy2hBkuyzQ2MOlNts0h3yXGkIzRBKEIh7WPQRyhACP+sYzBn63Q/vB4W10v7iv1nvFjYX7qOC9z6ebWHfCr+MbiOy7zPPRLyEIC+xBfL8gXjDkV/0ngDgFe1j4BdJZ94pPeAEiymBIsrwVRQwqP98SYqwWZK6HMl9GuVMJvhSUilQkc4yh8gENFhiDZHtDhi3ysQ8zHX1twIpgecorkfTCO87z63g/cIf6E3HEzjl9fO83/Bp5V2Gvhkq2xe1+ZGgdPEZ243syjWL/HJfiAfKV+F/GRzaT4q66r5Yf4Yvw58YIP8FPjIcWr43UE/sD5lO85HQT+N/tvqp6LfUn1a1Avqmc6l9crac9hwv0vup7r83bFeYn0k+ep0f7Xg8zgvfouPcLqb7HR3+OluX/e+YPLPEo9DOldCcpY+h3Svg3TF9ySvHWIOmEGSNdmQj5Rl0cg2/XybHemL0om6+EwXKaFgvRo7q2znqdtV/A06+nPU7TwxPqe13Zmnr2JnizxFf8MerSyosSfW2L9Jjf0yJ1c9Fl/Mgd3azquxk+fAZzlweQ4GN8iBW9WdTTlZl2Nxjb4Yi6UYy4DFMii+co3Wj4EMO/+nZfwNIR7Uzg==", 44, (240 * 1000), 2), new DefCompanyLevelsStruct("26 Hyzhak level 11x11 prividenie i zamok", "eNrtWMuOmzAU3fcrED8QA8YYaTKSQ1CVNu2Ipt10FymIRMlUoykzaf6+YMD4hWIcpu2i3tgX+1yfe31sDHen/DU/OYfd3PVc53zYlfuqFbjOPj8U+5K27985zt1pe8mf6TjgOuXlKaeAXf5UA8AQ1Hncls+HX3OXkJSQgixondX1SrJpf9I+T4Txgr3qx3V+MskeGq/aSQui45vJZFwqkcx4vt2jRNsv1IKR9DiuLngQF1cfb+P/TJbtOG0em+d9rY9byAcXx4rnxffP3ZmkhKBTQsCU4BkoQS2XglwvnyBBZ/ERKJZfBTtbfmtay49t/YF8vuYXkIj8LyOKqgTYKcFnSvAHlfDwkK4SKhXaSrP6AKkdVi7zU/6Y/yg7b7Aa1J45lXSw61wo7me5LXPqbGaCCyjOH43zKQ6OxqGB+e5mNGNS7sIud5DlLmC586M+d3Wb7aINWKzPaUk2eLHO0ld7Gy6OWfpCvqeLdfH+S21nkn00sVX/lVBu4GNbZD7Wfv4YH00+/iE+yvwtv+t8Kn10Ta5/A8V+Iz7Mj6Qvrn8UH20ZwUeYnyuj8iPng/fzYrFeej5/Tz/T8Hnr/Fjp+Vb9TK3nW/fXJPvdTj9v8P46TvP+srKVm5HXvd1D9naHE9yMMBBuHJDeOCJ24wADFxUMIA8LJZhnBvOAMU5zf0MyS/21yGPfmRHLXDguc8pasMXAzCW6zSVSL77RBMsbAl9dJ4OLaAgCzUIZAT11wtgEF6k4ZIJDGqJoNFFo+kkg4ZAlDlvi2gDHA/0BnH7TRKoc8SRyxDyniHIKTWLBatKhYSy4iwWxWOIJYkFA820YXY8FiVsSjvrGi7tY4v5PCZggmEg8mBt14uvBRNpzIh4NxJa42JJog6vp2kVogYxNxa7FQRMcNDqzmbKqRv3T9v43eWDdcQ==", 45, (180 * 1000), 2), new DefCompanyLevelsStruct("28 bahus level 9x9 dama v labirinte 1", "eNrtWNuK2zAQfe9XGP9A7PgOyYIcRAkEFjf0pW+BCCc0W5aturv5+9rySrJGsi05odBSP8Qaa87o6MxIsrO6kFdy8c7HtR/63tv5SE9NK/K9EznXJ8raD588b3U5XMkL8wt8j16fCQMcyXMLCIag3tOBvpzf1z5CW4QqtGH3GtwrVCKEP/oxsHk/84fPN/J5z0/6d/Fqzb/3HMu4w7Z6h3yU8TF4jvu8Vf414F/3eW+lHrpecN4bfTzjfEsQT8VXAKfoidf+AlRCxCshEpUQWlTC/+svv/RKiHklLEUlLAcr4fERbzesVFgLV+0GAiMmPGIsIkYi4jKTEdu2qK19UO7eMEX7vNxV+HW+HZffK/wLfcPlrv78Zbb9p/l8vRMfhBz4KLVhYY/ykX5V86v0Q3uEzz42lG3Tr9sjfNh4rR8VfDocFSGU/ik+fDwDNcnXjc9Qvlz5KOPP0GfKnuID8wPzZ68PnH+Pj9Geqh+DHj17dH3x+fN6NubHlc94PUt/Vz68ngfWmw0fJV/Q365++Poy7k8jfIz7jSE/kN/c/VjTy+V8GNHrHz2/tNM95Kd7Ik73+Lb3hVB8lmQiZHJjSMEyFyHT20Km+ntS5haxDdiEJBfyRH5QrmLQuH98m72zF6UrG+InPVDCgi1scOlMXGGPS/q4mOFSZ1zOcImGWy2Y0kDzTNc8v4vmeZ/TknGKbOai4BKGy51x6UxcMaDdFK7LVbvKHIFdsjJnXDuUUVFzlnOe5VRkubhDltMg1FdWMT2ZNIh1EdxxXZZjSw0KrkEhv8eDO4iQqSK0+6Jd7ZmBNkUEkcFsZDggvZCwabT/gT38BqhQQ4c=", 63, (240 * 1000), 2), new DefCompanyLevelsStruct("29 bahus level 9x9 sudoku voda vazi 3key", "eNrtWNtuozAQfd+vQPxAzM2AlFQaCqrSJmHd7mq1fYsURKKku1XCliZfv7YBJwHTAI36hB8YT+HMnI5P7IHhJnqLNspqMVI1VUlXi2RJZ4aqLKNVvEz4/Oabogw383205c8hVUn2rxEHLKJXBkB1UOVlnmxX7yMVIACIwQMYAxC47X2JTxrf97rHD+r9j/EjdVBSglEowRBK0C4rYTaGQ+p/h6kjsz8g3AEi/j2EKQD4CUzXgOHc1+LMUv+BXuBA6GWKhL9n+OLv0uE/ZnjhT2G6O7F0hCiPawJOJSHCv3CI/W2e7xezKKb8T6yWUh6z3ywutXBq8/yZZcyZtXNrpVn+PSmsv8vzbFlean/mvO9ZvXCc/b883iwGnfgkqxcdswB08J+zvJU6PECrwZ+vKsEslKALJei1SgjDYHzLpcJnAWEbCAtIQ0ab6CX6kxTRTPpQvue8c8SeX3fJPIl4sEFznNse1zWhw3Fma5zZEWd15GlwnN4a53bE2Rxnd12IKnA44BosqdEq1GgKNRpCjbp9VCObi33pCXmTNEjgyfEmJHjr7pvemgT/4DnwJvHdo8wnF+5z/3I++lNswad+UD4f3C3z6Tqa87kQp+fT8+n59Hx6PlI+X3B+ra9zfjXyK72mVpzuljjdzSv0mg6yTlsOzDsO49hx1HQqDsJVmN4AZlZhWgOYrO9DAodqcYYkXROcXu3fqjh5G6aJLwW2WCmr3UpV1l4sviNC4issvoaQpFHFlxvVMtBq1aji6muT/bkC2dWIzuciOkVELCK6V6g4Pq8brnlFk9fNLTi5xw8P6Aqk7HO5u+U9oE4FJZzREYebqs5Gktc4uyMO1xedTtjnwZv/kUx18w==", 200, (300 * 1000), 2), new DefCompanyLevelsStruct("33 Hyzhak level 11x11 hogdenie po mukam", "eNrVWF1vmzAUfd+vQPyBmm+QmkqXgKZIaTLap+4tUhCJlmxVw5qmv37YwSaAAdshm+aXC8Hn3nPvPTYO97v0Pd1p2/VEN3XtuF3nm4luWLq2SbfZJifXD1807X63OqVvZB7Stfz0mhaPdG2dvmIA6oJq+1X+tv2Y6AAxQAZTgBlAgi29JzYkNsF2Vtq4bbOGpX6SBp7GyXjPKb7GoxmP4sPKJgN8qrjnH7n++HySyzjx5bxpbz2GLXTUrZlHvS+1/rA6TPS7hhIsqgSLKcEQUEI5Hm0YGqdkaEa0gCsGyqI5tp8QfYPFI7hHjv9l+eMSAUqiFzyvdxTzTkm0h8UMPo+F38cDj/cTLH4BgugA/99oK8GmSjCZEjq3E225jGdTIhVyFSd4A8EOC5fpLt2nP3PqzS4mlXvOB5HZieAO+SpPibMzkTvCpMHJoZxsxslinEyv4oSvmTqfUTg/xjk8++E8id/V7+3wRxL/hu9xOM++Pinf34SPQs+5fHjzyucAND7egxT5FM+xn4zEV+Nz9lPyIfz4fKm/3nHxfIhPv5+K71V8JPo1POr9ad5fy6fwl2RSfDryull9mvmPwEeCX2+/RPs3Ch+63vr5NNfz3+ZTrR8JfY+iH7H6dK33q+rTs1/e9H3x799frROHQd/uDnu723InjpZH9sfGYy6dK10ylj5z6Y5wLjIQqh2McJwTcS10MnLbpzVvBFYOsjik2se1IaAnjqtVIVDEOeI48xLnE5wpgvMucTbBBdI4VxFnEpwngnNrDTzXBUkDLQmgpX7A99oy9keRsd/usiOSSw2H0+fKg5+MT5NxWTLBCMm4yG4vLQHJunWpn3G+CM7gFMGWDlgCHcHqBbR6QfUlAo1QPo+3U7jD2TRwlqiGuPEsEZzZjucp4gJpnCGOs9o7k2FIAy0JIIepJ92JUo+eNNMSKLIZerw1pwB0VYGOYvtd1TYGiroxugKy3aG4wB+2H/4AOlEqRw==", 54, (240 * 1000), 2), new DefCompanyLevelsStruct("34 bahus level 11x11 krest i ploti ", "eNrNWMFuozAQve9XIH4gGAgQKalkgrXKKmnWbU+9RQoiUdLdKmVL069fMGCMbcAQtFsueBi/8cybBwbm5/A9PGvH/UIHupYc9/EhHVm6dgiP0SEm47tvmjY/767hhcwzdC2+voYEsA9fM4DRBNVedvHl+LHQIVxBGEGfnDFcFvaysNPrKDujyijnVU7BLvClnZ7JMD9jNj6DQ9n1El/PB7PrMPlFBZTYqPDXbCYOYuMxqaEGf5n3iotPrtfqo3lUOMTmTeur+bFoF3Uzwfg6/Frded4LfcIpwSqVYFElAAUlfNFj+xt+RsGlzQ+S4Ae8j6CRMPM2CfxMgp9w40ETp/7NCV5xPi+//kanujh4KPwYbpPGpdwM3+LP1z11lnTFXTOC+wFMiUqwSyWYVAlmoxK2W7RaEqmQEcLZA4SPOC0j2jSiRSOabhUxG1NtPRr+OkExfPT8NUbvw23bP2H0Bz4jfx19f5DZuMNP7O71Ujp75CMe6Xqtdn7w+cjiCPnI4nTmo3Yo5dNqq+YzjJ+x+lXpQYEUJf2085HHuUU/t/Ur9W+y9Z/+cb/kek5oPsP1o8YXn88TXb85Dmb6Vc2X56Oqny5+Sv029pnzt/LTwhefb2u/pM8bXu//QT9f8vkz2v51Gmf/UrKF3R2Uu/uU7u52v/eFLGAaMjyHL+GvuIjmGWm84hvlgwS/kheRt3gXkw+WSQPMZmGuMgywMGAQnEdxRiPOZHGmHDafELp44ujXl0uZm972pgVoMzwa0hmhGcDg+AGkUKfi1WogiEc6BJiV3hc5eMmimSJS3hZHfP91R6BwWk/KIjnZ3dVwuFkDTl6LK9bijVKLJ96bQKUWT7w5gWItXlmLQ2uZjVCLU+fXVdanU7/17aFArwfQFqVg9cZZDTg57bOS9ln1Y8AYgXdXxrsCCa7sqQD640CX+NJB9j/t7i+Wn0R7", 100, (350 * 1000), 2), new DefCompanyLevelsStruct("35 Hyzhak level 11x11 labirint", "eNrtWNuO2jAQfe9XRPkBcr9IsJJDowqJ1SpFfeENCSugstVqmy7L3zf2xo6v2A7sQ6XmgWTwnJnjmWM7MD/BN3jyjvuFH/re+bjvDv1T7HsHeGwPHX5++OJ589PuAl+xX+B73eUFYsAeviBAoIN6z7vu9fi+8AGoAWhAxd1bdF8heznYy8FW+In43u8MvgLwyOI+7u0QrxnGz+x4LeR7HOIweVrBj+RpVDyYeXA4Md+K9avGeSq+b1X1Eeuku6/Yeok4NU+ODzd/lsfCnwlKiIkSYqqE0EIJ/69//JKVkBAlRFQJkVYJT0/1aomlgp/qBm0gYsSURExoxJhGjPIxInqm2toE1fpcd2BTVOumfptuJ9XPpv4DtnW1br99p/YPwd4abF18AKbxsb02Sf/B+Cv5oO9ZPsSZy8/YjL/IZ8zXz19HyooPn2+8eD6Er8xHzG/i8zEu8hH7w9WH46Ppp7ZfdvyUfHT9UtZniKOpD+6XiY+DfnR6ctIPk3+0xXFTfcR86vwm/cjrh7ft9WNaTyY9q+cv9ktcfyb96Ptnt76U/bqyH1jtP+L6tlrvV9bXlXHTelfW59q44/5sWu+fdX5t73R+OdrS6R6S0z2lp3ty2/tCSH+W5DRkemNIyrKgIbPbQmbye1LuFhEF7EPCE3yGvzpSxaB3Gn6bveOQF5zid7frIA420+AiFldgXGqDy1lcjHGoXGZgxgIzB2DKAksHYCJTTWxwoYzLJNx8hpsrtDmX21zcpc0FywlJ3roKhaLuzrhoIg5RnAQs7dtVyEpGBZo2w6klLZ1xKcYVlsIqiLAyKqzyDsLKeLGnGrErcJFCkKkNMJ5UPCFhrJGVunglKV45/l0ROO/nfWz0l9nDX06BQ5E=", 85, (350 * 1000), 2), new DefCompanyLevelsStruct("30 bahus level 9x9 pol vodi pol labirinta", "eNrtWNuOmzAQfe9XIH4g3CFSspIhVpUqJGXTp75FCiLRZtttlm6a/foag43xBQhBrVTVL/bYPmeOZwZwMjulb+lJO+7nuqlrl+M+P6CRrWuH9Jgdcjx++KBps9Pump7xPkPX8utLigH79KUAGCqo9rzLz8dfcx2AJQAJiACAdZ8VPZ4PcU/srLLV8027MQ8rm/BDzu+SXQ+r+ZDTEyn8RNw5mriaLxL5JfoTVseS44OiX7GX627sY/wDVh8T34TTKdUH5/qEqwSbVIJNK8HsUQn/clv8ALEjzBrZ4jOIA/B+Qf36CVyTxZkubr6D92zxCcR4vu7XWbkf4axEsi7vX5XSNnh9XemMqR6mR36SHocUK8EhlWDRSrCUlbDZwGWESwWPYFK8QApCRJme0uf0W07YHLSpeueg0nF17TrXp7r2mu/yFJNN+uAsjAtuxpmGAjib4KNzQXBJEBwaBJsGwfLrIBRj+jhsjXB1gTnYBuEqgW/DbSd8SuBP8BWGq+zjY7tNMols0sj62HpUbet02U096OXV4K/t4hx5jWPXGbvWw5yfb1K95X61ntI/Pj/rj9qKdS4++Py8zcenJV+36uHjKY1PSzzEfLbrEfxVeko/bXok/gfUc10fNY+8fm/IV1NPwupprLc+X4w/qf9+esT4lPFoxKc1XyKPqO9S7I8L+wugdq/nvat16+nJ81/PX9HzR79fLfZIeoQrjkm+7i79uju3XXEERvpLyqeU7p2UVGVAKb0RLmKmYTRvRvhi5HffqHigMxRoDQXaCqD8DueJF1n/vpT4ImNwH2NAGD3KOB0hxx6X4jLHbnfEPcNigT7GmX1wjlhTds9ETUkQpvVvT2OEKPiyQi+Yu07jy8puANAdCvSHAqdDgaYyOjRnaFD8wfTwG6yGDp4=", 83, (240 * 1000), 2), new DefCompanyLevelsStruct("36 Hyzhak level 11x11 Sudaku Voda Kluchi", "eNrtWNtu2kAQfe9XWP4Bdn23BJEGbFVUcSihacQjEpZBhRKBG0q+vnvxru+JbXhJ5XnZHe+cuezO2LMe7sLXcKds1yMVq8p5u443ZKaryibcRpuYze++KMpwt7qERyaHVCW+vIQMsA5fKADVQZX9Kj5u/45UAB8ggjHAFGAOk/+U9ykzZkydvFhnY6U+gefjNIWk+vysnor1ScHOJJ1W+vtOPJIfqYNCJugiE3SZCfjjTAh+AQLvBDMEaO59o7x5hoS8mPKXOVkXxOWeIEMXiuPyAQSnzArhHwI6Mr2CrMibZfW9kU1L7OwhMKj8TykfHBK5A7fzcCD+Up7KZ0yRdXzmduzkEU78egPvh+SDBMf00viQjFP4k8aT15/ay8cjiNkXxOM50imKvO98X7xH+tw6Z+NZghll9p3F5T3DbCnjIfwqGZcQOKAlcWgcV84EQ2SCJjNBq82E2cyfTliqsJk/py8QqpCoDHfhPvwdC20GEUreOSR1TFW5MFuneBWHTNmgOc5qjXMYDqPWQIw7WrQYrr1B1HFnuJ/U3ZZAvSsQc1e19kCNAfWuh9HBV37+TsddLZ/icMAqplA7pqgdQ9aOLmtHs9PaofP0e9pTTz319JnIj2HhjO/n/iss0DV6/sCTP76Pvj7CwrjOH9KDX+9PTz1xKnXGWHzdTfl1N27QGTtIy3YcRqE3QjWNioOsLMwttqm1MLMMsxvAjIrWz22A08u9pt0guFwXZhfbPvReF4blbw1bHpTZ7qBKRy/P3pEqretUWuV7ln2DbDKRXdExuw0bWLvslHNdmI7QaEmN7g3CtKoSpMGFwsoXm9tqd1wRi5v+JEE3CMbOF4nT9OZYwPFgcBNc5a2qvUW9Zvs+whk1nsptJxP6M/PuH5NJexg=", 140, (400 * 1000), 2), new DefCompanyLevelsStruct("31 bahus level 11x11 voda pechki", "eNrtWNuOmzAQfe9XIH4g3A1SstKQoCpVLmX3rW+Jgki02Tba0M2mX19sgsE2COygfejWL2OHOcfHnrEZMj4mb8lRO+wmuqlrl8Mu2+c9W9f2ySHdZ6T/8EXTxsfNNXklfoauZddTQgC75IQBRhtUe9lkr4f3iQ4wB4ghJDbFNsJ2SizzO/GbMs8rG978WRwZ1/AVf82f4WdxcV0PPyZ4IBYEvbwOXt+0kZf34/dD1M/rrfnN6/xTcX9q87fx8fscC/uN/Sf6iMsEu8wEm2aC2SMTAIx09h2WPvy5NNlz7jH7BstnuMastS6FRZikNq75bQoLpFVjFk/GpM0eb+Mti8+frwoPWJfjX4IeG2ZrWM3Bipv11vi2Lc8rW/BvW/WuIlbH6kz5S798Paf6fFbK6jBgtoRV+3ry52fobmImOGUmWDQTrNZMWK+j+ZSkCulFMb5AMGFOmRyTl+RnVrI5udPtznknaXad6J6unbNNlhCyUR+cQ3CmNC4gOEca5xfzGdJAlwCRNM40W1Y4HpEYcdFyy2g5NFo2jZaFqmjhPj23T0a4uEQZPPnhIo7e1MdO+BxHv+FHFC7Sr4/K46H1qDZej9jy+frwdOrJ199LURinH6JnqP3pXM8Hx6snz6fVw+dPGR9cJWXD5HPN/67zJaXnf/58Bj3/2PtLqMXM8u3u0re7I1eLCYz0kw9RSvdOSqrSp5TeABWjaRhMZYRaSsbmwsgTy1g0gCiX1WT1LUc5nKOI8xRxviIOp4tENYrETfcH2XRf/HbotRhfLMnlcUgRFyjiWj8BOoFSwfLLYHk0WMEAwfLuObVBqSmo/oYwBhCFmo6t1b3BHK7YYFcRhxRxfb4+OWBxRHxpnKM6YXExBdI4X1Ho7WKSn9BUjWHv04yaDoCtGAqn/eDkHfyH78Nf7LH72Q==", 18, (300 * 1000), 2), new DefCompanyLevelsStruct("38 Bahus level 11x11 3 Plota Voda Sredniy", "eNrtWFtvgjAYfd+vIPwBy0UKiS75mGRxERkze9jezGzUzC27sDH261eKLQhTofLgFvvSNv3O6enHsRd7K/JJVspy1lc1VYmXs2hBW4aqLMhyvohY+/xMUXqraULeWBxSlSh5IQwwIy8pAG2DKk/T6G351VcBPIA5uABDgBAuTv0/1++rnZITDO4EQzhBq+GEmmU8hO94cA2+DSj+PSQJB1fgP2Y1K4MJjP1CRGGc1lY8eM36hZDCOK3vYFzkywoKN3lyvk09OB8PIZhnfP57Uc9rPh5n+oIiSap/zR88iPjNvHhifh1ofmg82pJCpieId+fZR9CwVJ1gcifowgn6VicEgTe8YFZhLS9MN5AyY5czmoLREIw6zhnTtvDWBLmj2ItgYruj0PuU75vuY+h9wL3njuaXN9L9tvXIlrKejcLnq8OzSw9f/xHpuW1JD0ALeo7te7WlpwnPSc9Jz0nPXj3/7PyqnO4aP9274nQ3D7svaOJZggVl90BKodIWlFYzypSRcpIVeSLPEX83IUSj1k8pemtxVCVh96X3aBoRxtapBUzXnDB8U6TBgHYF2Ouw5ZcSYVVvd/iw1OIqo30Yo80ZLcHotPCtrFLGNZa4NPG1MudwVU7+QkItyMLIqH5OvN8HJZy+xQb1cFZjnCmJy7LelcRhSZwjmZdf3LEPiBnQkMRpjXF23S2nhHMk5+O/mzpArSoUN8Y5+zY42kj/+Tr/AUoUKyQ=", 230, (360 * 1000), 2), new DefCompanyLevelsStruct("_39 Hyzhak level 11x11 2 zombi", "eNrtWFtrwjAYfd+vKP0D9hLbCiqkpQxBkE724ptgUJkO2bqL/35t1qS5ton1ZbC8NGlyTo7nO23U6Ql9opNz3M1c33W+jrvyUPVC1zmg4/5Q4v78wXGmp+0VveF1nuuU1wvCgB261ABPB3XO2/Lt+D1zIVxAuIdZc00hzJtxdS3qsfL+7/qCvc+sK+hVvJ8160VeZrwQ+BeCnlw1z/O0+2QcL6eP058q+Vr9/OcVde2ldRmnw0qn0l/xyvo4c0dCEkKShJAmwTdIwn/7401OAiBJCGgSAm0SVqt8keGo4F5e1C8QkXFMGAFlDCljELeMdZ9ma+2ly6+8hOskXRb55+1jkL4U+Qd8ztPl/vGJjjeWY8IH4X30kLYGpFftR7od87KeZp3XrisojzBP9OBxnx6mdczr/eH3k/WI+tV6lK1jvtMfhR5uTPzrq1efPgt/xP1s68XqviU/bT51+VHMG+W5Lz8GeRb1ET1cfgz86fPrpnr1PW9m/vQ//zp/mPp1jPvqNfT5Eusj7y8+7wZ6Ovc39Uf3/hHraVovdX3M/Rl2XmzudH4N1COd7j453cf0dAfDvi/49GdJTCnHAympyoRSRsMoI/l7UmzHWBNWlOiEzui1JC56FUvz2+wbI654r/dyWyJMNtLgIhaXYJxvjQPmOF6nhdCQBU4wLrTGAXNcIO8XW+OAOS6W96sjbQkEFkDAAiMLoM8CA03tpyOceiH/sZz/5C75TxS5Mvs0PNLDyLE1MLgRp1Wq9i8h/kXUv8kd/Iv4mprbF/F5DzEwsMY1tkeGLkyIC5P2fwfP+sVccdf/fc1/AHQTMCU=", 63, (160 * 1000), 2), new DefCompanyLevelsStruct("32 bahus level 11x11 labirint in i yan", "eNrtWFtrgzAYfd+vCP6Ber9AW4hFRqEwXN/2VmiwMjtKl/Xy76fZjDYmGqNsrCwPJWlzTo7fOTHaaYZOKAPpdqYZGjinW7zLe5YGdihNdpj05w8ATLPNFR3JPF0D+HpABLBFhwKgi6Bgv8HH9DLTIIwgTGAI4RLCGC5+eBz+8vr3MJ5pEyYJVpkEiybBkEjCf/vjrZkEu0yCSZNgCpPw9BQtFyQqpBfFxQ2EZXRKRpsyWpTR9CrGok+ztdbD1TnCcO2Hqzg6qY/t8DWOPuBLFK6Sx2fl8dh61FsYJzU9+XgkPfn13q7DjPmNrQ/RU3xfX4/hbeipz2f0rG1hHbh6xXryD4l6NPTz9HT5dzO/XU9VD76+Lj3seqPo4fgn/J3Jc+WXyJ9+frF56dQrrE9Lfm70S+Sntl5fPeI81+on5RebXzY/PerT1br0tO1n6Tz3vg9y9Yj3d8v+H0UPPz93dn41TnejPN0derrbw54XDPpa4lFKZyAlVelTSncYpdt8TvL6MRaEOSXK0B694bKKej7p+93s8iX8SoDveIMRYZvIAANFnKeIcxRxliJOVJfphFjEmOU1zfKH2e+XjC5lDEaw3+VepUR5XN2sA13ZsnJxliLOUcR5kjYGZdGD6i1V7+1jzl38UzL/BDXxvjo=", 98, (300 * 1000), 2), new DefCompanyLevelsStruct("_40 Hyzhak level rivers and madam", "eNrtWMuOmzAU3fcrED8QA+YRKRnJBCpR5VE6msXMLmoQiZK00wwzNP362iY22IYWCIuonbvx85z78LVzyeSQvCUHbbeZ6oau5btNtsU9S9e2yS7dZrR/90HTJof1OTnRfUDXsvNzQgGb5JkAQBNUO66z0+7nVEcoRChGPkIRQimaXcZFS8eR1NL5Yn+J81VcZVy2fsP8rOQLSz5Bn7Cvfj5V9Pi1dgv8UXW+wh81r6eK3bNaXtkvIV6V+AnxiSQ7owY9XN9UH0mZYLFMsHgmGH/PhMUeOSj4QloXBVndGCAsK4DOMaJC28oYxMFL0Qs+NbQZYoL5ipawBj/4uCKMl8rya6G/4DmJvGw/00/2P1b4SQtr9lcGq+/FmPidcz1xdd3ICzz286Gcv2xe5MiM8fpScgLjmLiXdVfagnmZPzQOdi6uOynBpehXHnxGyz3x8xEtPATy4IiWEZl/wjg1EyDLBJNngtmYCatVGM1oqtBeGJMHhBBiyuSQHJNvGWODeNPlzcGp4+jamRK/ZOssoWSjNjiL4mBn3JjijM44WOCAApyMaMik4NkseJAHz+LBM90yeKRfPqjv8l/JPfDneZhdzwP9fRy+3ow9/5748zh8w/EZgOrjDJ/XDdlz64Lz8d7D/l7N84qeQn+eDnA/rrWH3deHxTD3dZD4vEuTKKWRwX7dbf7rDgcojTwAqyWHSUsOr6w4GioVDwiVCqlRBBxoxFlVnCtXOM04R63gqpVRI85U3XNaqLMF9yjMbaFNgNmtYY5q5LirtqLKtPvBnH4wxbf6ytTg3/ouT167W/Iq14HfB49TOgPcBwOAmtodtizBHfX7xR3AKFtMkCIdjRYfFLZ4aKAJWO+Nq3rjXXdqHmN0OON4gPg40mvU9jvNER+/yyvW9rDHzJlx+bcFGMAbt+6NbOGNhLPl96ATrrs+KD8kLXFmTzuN9jiz5pRBd6BxHdDoDuyrsKc+sycO9rTT7olz2+Ng3UH0tfQPDyfukH/A734D2lMNnQ==", 91, (240 * 1000), 2), new DefCompanyLevelsStruct("37 Bahus level 11x11 Sudaku 2 Ricari", "eNrtmd1u2jAUx+/3FFFeADsftiOVSqbkohO0i7jYNRoRoNGp67LS8PSLPeIWEtP4D5M6KecCbDm/w/myfSKuNvlzvvHWi6FPfW+7XhSrahT63ipfL1eFHl9/8ryrzbzMn/RzxPeK8jHXwCJ/VACxod7DvHhavwx9KVMpl3Ik5a2Umbz5uPPUvp79D/b/s/nQHxxVQlhXQmgqgXaoBCl3cvxFToXcbceT1vlSnpTdcvz59BPV+vS7ZFvr+k+1Xmbjr1YVd9/UutZjk3q9zE7boZ+zSb1+Z/eG7H+H2/0t1Poueyduan26VXGu433wXW5lF2lWQlRXQmAqIbBWwv19enujS0WP0kwdIEphpTLf5A/5j6LWFlUP7c+cF/1ZDn3he7+KeZFrZYMuXKQ5Sp1BgYI00CR3BhPNEWcuALm9oWEDvBro7B7lOa7zHJk8hybPAX/Nsxq/3fEWGU1URc5I9ZEWZu4uo4k6MWbRKMvS32aO6MnSZ2PPTKD29NJLL7300suHlUYXR+vbPTa3e+TWxTU0mpdFblTGZ6o0Vgqjkl2g16SEHHZGXZvNBmgj21sq1myd+QXciQ+Niv92su97c8RxC9fuC2/6Is7Ltqg1MqMxuUB0GGnpnmmH9pmRsPlmETtzwsK1hzWpg5C8vmeTC0SBHxoVdK0R3hYEd06AHCUgGGoucOZikOMgl4AcRTl6VmAiMDARmEDmzLGu27TVPwb6x8DEM3RHcHALcjCgHDwq3LkA5MKul3hr4gWYeAEmXqCJT8DEJ2DiEzDxCZj4BDwKu9zorRUDgDEKchRMUJC6RKelKabUHcTJADbWoaFpM9b9FwXIRSCH2knAwBC44gjYYQRnceiNH4KbOATP0wDkGBgXuMOAwRgFI9DFyP5uVQ3Un97XfwCQehTe", 145, (400 * 1000), 2), new DefCompanyLevelsStruct("_41 Hyzhak level rivers, madam and ghost", "eNrtWF1vmzAUfd+vQPyBGDBfUlLppkFTpjaM5qFS36IFkahJ2zWsLPv1MyY2xDatIdGmSrkv2Njn3OPr6w8YbtK3dGOslyPTMo1ivcxXpOSYxipdZ6uclq++GMZws9inr7QfMo18/5JSwDJ9KQGoDWpsF/nr+vfIBIgAMhgDTAESuL7UP119ZA6ETHBYJjg8EyyNTADwk8k3iAtSmuRw+wj7ZLIDZjGqnuS9V1RF0p6UT5RNvsNt3ZW8v4e4rJd8P8DLqmdtk7uSxzrw2TB5oPWs0SWm/p8gfuY6qL6GWQWpzzKwDzqYvgq/O/gt4MgoX1VkfpmR/nO4DRp8xC8ZN/G/hdkU/hRVf1egpOOZPVfxiLNq/KJVPLu6PyjseHyK9p/N+AsmZwJmmWDzTLBbMyGOo+k1TRVaipJyAykJCWW6SbfpU87YMOl02HNI6gSmsR+ZoWns8kWeUrKBDg5TXNAZZ1kUaHUGehTndMY5FIcl3HBAQy0E3WVBxzzoDg+67ddBL8t8+c3R+KaIcpgH45skeutfx+PHJPpF0mF8k329I3WWHqxetT9E77czvvJ9xV/3U/tvaed6+pmsRzTRfwvPP9OjyXPR80n1wIk2TjKq5zSWc+mp43PRc9HzP/SI50V/HtX5deJ5Kl2pLHa6u/x0x2e4UgUIK644Hr9yoJabSoAUN5zGVawVhmWYhTTcYfkGp4VzFDgNmV4T5moH5QgW9osl1oY58m3Y1YDZTZgveGsPiSt7w129hT0nPBTySxNWOtL158r+pGCqL94W/wXi87Xpdlub0mrnyz3glN4ZlruFVLmm8WUiAm0xbd79NPHk70H/DKNxkS8vU1tTky9rCk6btIAxepwxPMMoPdWU2R9PmXe89LDux6un2qNDHZyjOEpczekIWfDC+ucROkP0/OMoOLpR8I9H47fk+0e4wwZk9wV2V2qdCNSSait2WdQX2ENrlZR+Z4+O7q8fwZ/dFhuezKRQ/jq/+gtJejao", 48, (120 * 1000), 2), new DefCompanyLevelsStruct("_42 Hyzhak last ", "eNrtWNtuozAQfd+vQPxAMBhwpKSSQWgVKVJF87ZvkWKRqOmq6rJN8/cNJna52GTs0KpVy0s8eM6Z8XDsgcz27Jntnd1m7iLXOew25fY0Clxny3bFtuTjm1+OM9uvj+yJ+3muUx4fGQds2GMF8HRQ52FdPu1e5i6lGaUFTShdUJrTVGNT/pt37nNb+Lfs9OyXdHBtv8F5pX/NW2jwhcw3VcZpzVvw62y9f9qfX3Tigeo/ZM/dSUcJgVBCIJWAAEr4ub741VcCFkrwpRJ8rRJub7NFyqXCR1leHSBdxlAwYskYSEY/fmOsxlJbKy9ZHrKSrkiyzLNnexsn93n2n/7JkmXx+05l5xfmuX05XnXiwfOxvZT5GDEM1MeQR1ufEfIZqz7yfsfu4TT+ynwG8lthWD41z1A+6vzeqz4in/7za+hbnU9+0Olj0Jb380KXj4g/aH9MfT6vftT1MdcP7Hld3u8A+xudPx/Qv+7H6V8gu9fdkejuoezu+Lr3BSQ/S2JJGV5JKbMkkjK6jjLqvyfFZowV4YmS7dkD+1uKKnonp/O32Qtf95Hj/pXrknGyiQYXNHExHOc3cVNLXGCZJ4LjWnVB1kCOC2wDWgORbaowYNgEYg6MILioiSMa3GzCZd/ZAHF/A5BRNgBp5uTDnzPp18AcRyxx1aFlBax3HDbG1TuOWMYjlvEwUBxEiCOS4piOII6ovUOiuube5cVE7WOnBvoQnOKYA+Fwv+jm8c6qCowD+nCcom/4xrjwugUiywUioBynQo7Tt7+3vBH0GFs2lxjYXORqToPq392bV5Xp4nc=", 15, (120 * 1000))];
public static const USE_SOLID_LEVELS:Boolean = false;
}
}//package game.model
Section 126
//DefCompanyLevelsStruct (game.model.DefCompanyLevelsStruct)
package game.model {
public class DefCompanyLevelsStruct {
public var m_nNeedTurns:int;
public var m_nHowMatchLevelsWillOpenWhenWalkThrough:int;
public var m_strName:String;
public var m_strStruct:String;
public var m_nNeedTime:int;
public function DefCompanyLevelsStruct(_arg1:String, _arg2:String, _arg3:int, _arg4:int, _arg5:int=1){
m_strName = _arg1;
m_strStruct = _arg2;
m_nNeedTurns = _arg3;
m_nNeedTime = _arg4;
m_nHowMatchLevelsWillOpenWhenWalkThrough = _arg5;
}
}
}//package game.model
Section 127
//GameProxy (game.model.GameProxy)
package game.model {
import flash.utils.*;
import org.puremvc.as3.interfaces.*;
import com.*;
import game.model.Elements.*;
import main.*;
import game.view.*;
import game.model.Elements.Character.*;
import org.puremvc.as3.patterns.proxy.*;
public class GameProxy extends Proxy implements IProxy {
private var m_pLevel:LevelProxy;
private var m_nTurnsPass:int;
private var m_pLevels:LevelsProxy;
private var m_nStartTurnTime:int;
private var m_pKeys:KeysProxy;
private var m_pHero:LayerElementProxy_Character_Hero;
private var m_nTimePass:int;
private var m_pRunInContext:IProxy;
private var m_bPause:Boolean;
private var m_bHeroTurn:Boolean;
private var m_pUndo:UndoProxy;
private var m_nState:int;// = -1
public static const HERO_ACTION_MOVE_WEST:int = 1;
public static const HERO_ACTION_MOVE_SOUTH:int = 4;
public static const GAME_STATE_UNDO_TURN:int = 4;
public static const HERO_ACTION_MOVE_EAST:int = 2;
public static const NAME:String = "GameProxy";
public static const GAME_STATE_ENEMY_TURN:int = 1;
public static const GAME_STATE_UNDEF:int = -1;
public static const GAME_STATE_VIEW:int = 5;
public static const HERO_ACTION_WAIT:int = 5;
public static const HERO_ACTION_MOVE_NORTH:int = 3;
public static const GAME_STATE_HERO_TURN:int = 0;
private static var m_nTime_EnemyTurn_Start:int = -1;
public function GameProxy(_arg1:LevelsProxy, _arg2:IProxy=null){
m_nState = GAME_STATE_UNDEF;
super(NAME, Number(0));
levels = _arg1;
m_pUndo = (facade.retrieveProxy(UndoProxy.NAME) as UndoProxy);
if (m_pUndo == null){
m_pUndo = new UndoProxy();
facade.registerProxy(m_pUndo);
};
m_pUndo.reset();
m_pRunInContext = _arg2;
m_nTurnsPass = 0;
m_nTimePass = 0;
m_pKeys = new KeysProxy();
facade.registerProxy(m_pKeys);
}
public function undoNextMove():void{
undoTurn();
}
public function set runInContext(_arg1:IProxy):void{
m_pRunInContext = _arg1;
}
private function undoTurn():void{
var _local1:LevelsProxy;
var _local2:CharactersProxy;
m_pUndo.active = false;
_local1 = m_pLevels;
if (_local1 != null){
_local1.inGame = false;
};
if (!undoElementAction()){
_local2 = characters;
if (_local2 != null){
if (!_local2.isAnyInUndoMove()){
sendNotification(ApplicationFacade.ON_ALL_MOVES_DONE);
};
};
};
}
public function get timePass():int{
return (m_nTimePass);
}
public function listenStartHeroTurn():void{
m_nStartTurnTime = getTimer();
}
public function heroTurn():void{
var _local1:LevelsProxy;
var _local2:CharactersProxy;
var _local3:int;
if (m_nTime_EnemyTurn_Start != CommonFunc.INT_UNDEF){
_local3 = (getTimer() - m_nTime_EnemyTurn_Start);
};
m_nTime_EnemyTurn_Start = getTimer();
m_pUndo.active = true;
_local1 = m_pLevels;
if (_local1 != null){
_local1.inGame = true;
};
_local2 = characters;
if (_local2 != null){
if (_local2.length <= 0){
return;
};
};
if (m_pHero != null){
m_pHero.startMove();
m_pUndo.addHistory_EndTurn();
if (m_pHero.actionPoints > 0){
m_nTurnsPass++;
return;
};
};
sendNotification(ApplicationFacade.ON_ALL_MOVES_DONE);
}
private function checkKeys():void{
if (m_pKeys.keyLeft){
heroAction(HERO_ACTION_MOVE_WEST);
} else {
if (m_pKeys.keyRight){
heroAction(HERO_ACTION_MOVE_EAST);
} else {
if (m_pKeys.keyUp){
heroAction(HERO_ACTION_MOVE_NORTH);
} else {
if (m_pKeys.keyDown){
heroAction(HERO_ACTION_MOVE_SOUTH);
};
};
};
};
}
public function get timeNeedToWin():Number{
var _local1:LevelProxy;
_local1 = selectLevel;
if (_local1 != null){
return (_local1.timeNeedToWin);
};
return (CommonFunc.INT_UNDEF);
}
public function enemyTurn():void{
var _local1:LevelsProxy;
var _local2:CharactersProxy;
m_pUndo.active = true;
_local1 = m_pLevels;
if (_local1 != null){
_local1.inGame = true;
};
_local2 = characters;
if (_local2 != null){
_local2.enemyTurn();
};
}
public function listenStopHeroTurn():void{
var _local1:int;
if (m_nStartTurnTime != CommonFunc.INT_UNDEF){
_local1 = getTimer();
m_nTimePass = (m_nTimePass + (_local1 - m_nStartTurnTime));
m_nStartTurnTime = CommonFunc.INT_UNDEF;
};
}
public function restart(_arg1:Boolean=false, _arg2:Boolean=false):void{
var _local3:LevelProxy;
_local3 = selectLevel;
if (_local3 != null){
_local3.restoreStates(_arg1, _arg2);
};
if (m_pLevel != null){
m_pHero = m_pLevel.hero;
};
m_pUndo.reset();
m_nTurnsPass = 0;
gameState = GAME_STATE_UNDEF;
gameState = GAME_STATE_HERO_TURN;
}
public function get gameState():int{
return (m_nState);
}
override public function onRemove():void{
super.onRemove();
facade.removeProxy(m_pKeys.getProxyName());
}
public function get turnsPass():int{
return (m_nTurnsPass);
}
public function heroAction(_arg1:int):void{
var _local2:LayerElementProxy_Raft;
var _local3:int;
_local3 = gameState;
if (_local3 == GAME_STATE_HERO_TURN){
switch (_arg1){
case HERO_ACTION_MOVE_WEST:
if (!m_pHero.isBusyNowForState(LayerElementProxy.STATE_MOVE_WEST)){
m_pHero.state = LayerElementProxy.STATE_MOVE_WEST;
if (m_pHero.state == LayerElementProxy.STATE_LOOK_WEST){
_local2 = m_pHero.getRaftUnder();
if (_local2 != null){
_local2.state = LayerElementProxy.STATE_SWIM_WEST;
if (_local2.state == LayerElementProxy.STATE_SWIM_WEST){
m_pHero.state = LayerElementProxy.STATE_SWIM_WEST;
};
};
};
};
break;
case HERO_ACTION_MOVE_NORTH:
if (!m_pHero.isBusyNowForState(LayerElementProxy.STATE_MOVE_NORTH)){
m_pHero.state = LayerElementProxy.STATE_MOVE_NORTH;
if (m_pHero.state == LayerElementProxy.STATE_LOOK_NORTH){
_local2 = m_pHero.getRaftUnder();
if (_local2 != null){
_local2.state = LayerElementProxy.STATE_SWIM_NORTH;
if (_local2.state == LayerElementProxy.STATE_SWIM_NORTH){
m_pHero.state = LayerElementProxy.STATE_SWIM_NORTH;
};
};
};
};
break;
case HERO_ACTION_MOVE_SOUTH:
if (!m_pHero.isBusyNowForState(LayerElementProxy.STATE_MOVE_SOUTH)){
m_pHero.state = LayerElementProxy.STATE_MOVE_SOUTH;
if (m_pHero.state == LayerElementProxy.STATE_LOOK_SOUTH){
_local2 = m_pHero.getRaftUnder();
if (_local2 != null){
_local2.state = LayerElementProxy.STATE_SWIM_SOUTH;
if (_local2.state == LayerElementProxy.STATE_SWIM_SOUTH){
m_pHero.state = LayerElementProxy.STATE_SWIM_SOUTH;
};
};
};
};
break;
case HERO_ACTION_MOVE_EAST:
if (!m_pHero.isBusyNowForState(LayerElementProxy.STATE_MOVE_EAST)){
m_pHero.state = LayerElementProxy.STATE_MOVE_EAST;
if (m_pHero.state == LayerElementProxy.STATE_LOOK_EAST){
_local2 = m_pHero.getRaftUnder();
if (_local2 != null){
_local2.state = LayerElementProxy.STATE_SWIM_EAST;
if (_local2.state == LayerElementProxy.STATE_SWIM_EAST){
m_pHero.state = LayerElementProxy.STATE_SWIM_EAST;
};
};
};
};
break;
case HERO_ACTION_WAIT:
if (gameState == GAME_STATE_HERO_TURN){
if (!m_pHero.isBusyNowForState()){
sendNotification(ApplicationFacade.ON_ALL_MOVES_DONE);
};
};
break;
};
};
}
public function get levelN():int{
var _local1:LevelProxy;
_local1 = selectLevel;
if (((!((_local1 == null))) && (!((m_pLevels == null))))){
return (m_pLevels.getItemN(_local1));
};
return (CommonFunc.INT_UNDEF);
}
public function quit():void{
gameState = GAME_STATE_VIEW;
sendNotification(ApplicationFacade.GAME_HAD_QUIT);
}
public function undoMove():void{
var _local1:int;
_local1 = gameState;
if ((((((_local1 == GAME_STATE_HERO_TURN)) && (heroIsWaiting))) || ((_local1 == GAME_STATE_VIEW)))){
gameState = GAME_STATE_UNDO_TURN;
};
}
private function undoElementAction():Boolean{
var _local1:UndoElementProxy;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
if (m_pUndo.undoTurnFinished){
return (false);
};
do {
_local1 = m_pUndo.getLastHistory();
if (_local1 == null){
break;
};
_local2 = _local1.m_nState;
_local3 = _local1.m_pSourceElement;
_local4 = _local1.m_pTargetElement;
_local5 = m_pUndo.getUndoStateByState(_local2);
if (_local5 != CommonFunc.INT_UNDEF){
_local3.state = _local5;
if (_local5 == LayerElementProxy.STATE_BORN){
undoNextMove();
};
if (_local3.type == Sprites.SPR_ID_RAFT){
switch (_local5){
case LayerElementProxy.STATE_UNDO_SWIM_EAST:
case LayerElementProxy.STATE_UNDO_SWIM_NORTH:
case LayerElementProxy.STATE_UNDO_SWIM_SOUTH:
case LayerElementProxy.STATE_UNDO_SWIM_WEST:
undoNextMove();
break;
};
};
return (true);
};
} while (true);
if (m_pUndo.undoTurnFinished){
return (false);
};
return (true);
}
public function set levels(_arg1:LevelsProxy):void{
m_pLevels = _arg1;
m_pLevel = null;
if (_arg1 != null){
m_pLevel = m_pLevels.select;
m_pHero = null;
if (m_pLevel != null){
m_pHero = m_pLevel.hero;
};
};
}
public function start():void{
pause = false;
gameState = GAME_STATE_HERO_TURN;
}
public function get selectLevel():LevelProxy{
if (m_pLevels != null){
return (m_pLevels.select);
};
return (null);
}
public function get heroIsWaiting():Boolean{
var _local1:int;
if (m_pHero != null){
_local1 = m_pHero.state;
switch (_local1){
case LayerElementProxy.STATE_LOOK_EAST:
case LayerElementProxy.STATE_LOOK_NORTH:
case LayerElementProxy.STATE_LOOK_SOUTH:
case LayerElementProxy.STATE_LOOK_WEST:
return (true);
};
};
return (false);
}
public function get characters():CharactersProxy{
var _local1:LevelProxy;
_local1 = selectLevel;
if (_local1 != null){
return ((_local1.getLayerByID(LevelProxy.LAYER_ID_CHARACTERS) as CharactersProxy));
};
return (null);
}
public function set pause(_arg1:Boolean):void{
if (m_bPause != _arg1){
m_bPause = _arg1;
facade.sendNotification(ApplicationFacade.ON_GAME_PAUSE, m_bPause);
if (_arg1){
listenStopHeroTurn();
} else {
listenStartHeroTurn();
};
};
}
public function listenViewHide():void{
var _local1:LevelProxy;
_local1 = selectLevel;
if (_local1 != null){
_local1.listenFinishPlay();
};
}
public function get levels():LevelsProxy{
return (m_pLevels);
}
public function get userEdition():Boolean{
if (m_pLevels == null){
return (false);
};
return (m_pLevels.userEdition);
}
public function get turnsNeedToWin():int{
var _local1:LevelProxy;
_local1 = selectLevel;
if (_local1 != null){
return (_local1.turnsNeedToWin);
};
return (CommonFunc.INT_UNDEF);
}
public function get pause():Boolean{
return (m_bPause);
}
public function listenHeroAttacked():void{
if (m_pUndo != null){
m_pUndo.addHistory_EndTurn();
};
gameState = GAME_STATE_VIEW;
}
public function runOneTurn():void{
}
public function listenHeroFinishAllLevels():void{
}
public function set gameState(_arg1:int):void{
if (m_nState != _arg1){
m_nState = _arg1;
if (m_nState != GAME_STATE_HERO_TURN){
listenStopHeroTurn();
};
switch (m_nState){
case GAME_STATE_ENEMY_TURN:
enemyTurn();
break;
case GAME_STATE_HERO_TURN:
listenStartHeroTurn();
heroTurn();
checkKeys();
break;
case GAME_STATE_UNDO_TURN:
m_pUndo.startUndoTurn();
undoTurn();
break;
};
sendNotification(ApplicationFacade.CHANGE_GAME_STATE);
};
}
public function get runInContext():IProxy{
return (m_pRunInContext);
}
}
}//package game.model
Section 128
//InfoLayerProxy (game.model.InfoLayerProxy)
package game.model {
import com.*;
import game.model.Elements.*;
import main.*;
import game.view.*;
public class InfoLayerProxy extends LayerListProxy {
public static const NAME:String = "CharactersProxy";
public function InfoLayerProxy(_arg1:int=-1, _arg2:LevelProxy=null){
super(_arg1, _arg2);
type = LayerProxy.LAYER_TYPE_INFO;
}
override public function listenElementMoveOn(_arg1:LayerElementProxy, _arg2:Boolean=true):void{
var _local3:int;
var _local4:int;
var _local5:LayerElementProxy;
if (_arg2){
_local3 = _arg1.x;
_local4 = _arg1.y;
} else {
_local3 = _arg1.oldX;
_local4 = _arg1.oldY;
};
if (((!((_local3 == CommonFunc.INT_UNDEF))) && (!((_local4 == CommonFunc.INT_UNDEF))))){
_local5 = getElementAt(_local3, _local4);
if (_local5 != null){
if (_arg1.type == Sprites.SPR_ID_CHARACTER_HERO){
_local5.removeElementOn(_arg1);
};
};
};
super.listenElementMoveOn(_arg1);
}
override public function listenElementPutOnElementCommand(_arg1:LayerElementProxy, _arg2:LayerElementProxy, _arg3:Boolean):void{
if (_arg1 != null){
switch (_arg2.type){
case Sprites.SPR_ID_CHARACTER_HERO:
_arg1.state = (_arg3) ? LayerElementProxy_Info.STATE_INFO_ON : LayerElementProxy_Info.STATE_INFO_OFF;
break;
};
};
}
override public function listenElementChangeState(_arg1:LayerElementProxy):void{
var _local2:int;
var _local3:LayerElementProxy_Info;
var _local4:int;
var _local5:int;
super.listenElementChangeState(_arg1);
if (_arg1 != null){
_local2 = _arg1.type;
switch (_local2){
case Sprites.SPR_ID_INFO:
case Sprites.SPR_ID_INFO_0:
case Sprites.SPR_ID_INFO_1:
case Sprites.SPR_ID_INFO_2:
case Sprites.SPR_ID_INFO_3:
case Sprites.SPR_ID_INFO_4:
case Sprites.SPR_ID_INFO_5:
case Sprites.SPR_ID_INFO_6:
case Sprites.SPR_ID_INFO_7:
case Sprites.SPR_ID_INFO_8:
case Sprites.SPR_ID_INFO_9:
case Sprites.SPR_ID_INFO_10:
_local3 = (_arg1 as LayerElementProxy_Info);
if (_local3 != null){
_local4 = _arg1.state;
_local5 = _local3.helpID;
if (_local4 == LayerElementProxy_Info.STATE_INFO_ON){
facade.sendNotification(ApplicationFacade.SHOW_INFO_HELP, _local5);
} else {
facade.sendNotification(ApplicationFacade.HIDE_INFO_HELP, _local5);
};
};
break;
};
};
}
override protected function createElement(_arg1:int):LayerElementProxy{
switch (_arg1){
case Sprites.SPR_ID_INFO_0:
case Sprites.SPR_ID_INFO_1:
case Sprites.SPR_ID_INFO_2:
case Sprites.SPR_ID_INFO_3:
case Sprites.SPR_ID_INFO_4:
case Sprites.SPR_ID_INFO_5:
case Sprites.SPR_ID_INFO_6:
case Sprites.SPR_ID_INFO_7:
case Sprites.SPR_ID_INFO_8:
case Sprites.SPR_ID_INFO_9:
case Sprites.SPR_ID_INFO_10:
return (new LayerElementProxy_Info(_arg1, this));
default:
return (new LayerElementProxy(_arg1, this));
};
}
public function get activeHelp():int{
var _local1:LayerElementProxy_Info;
for each (_local1 in m_arMatrix) {
if (_local1 != null){
if (_local1.state == LayerElementProxy_Info.STATE_INFO_ON){
return (_local1.helpID);
};
};
};
return (CommonFunc.INT_UNDEF);
}
override public function listenElementTrapOn(_arg1:LayerElementProxy):void{
var _local2:int;
var _local3:int;
var _local4:LayerElementProxy;
if (_arg1 != null){
_local2 = _arg1.x;
_local3 = _arg1.y;
_local4 = getElementAt(_local2, _local3);
if (_local4 != null){
if (_arg1.type == Sprites.SPR_ID_CHARACTER_HERO){
_local4.putElementOn(_arg1);
};
};
};
super.listenElementTrapOn(_arg1);
}
}
}//package game.model
Section 129
//KeysProxy (game.model.KeysProxy)
package game.model {
import org.puremvc.as3.interfaces.*;
import org.puremvc.as3.patterns.proxy.*;
public class KeysProxy extends Proxy implements IProxy {
private var m_bUp:Boolean;
private var m_bDown:Boolean;
private var m_bRight:Boolean;
private var m_bLeft:Boolean;
public static const NAME:String = "KeysProxy";
public function KeysProxy(){
super(NAME, Number(0));
}
public function set keyDown(_arg1:Boolean):void{
m_bDown = _arg1;
}
public function get keyLeft():Boolean{
return (m_bLeft);
}
public function set keyRight(_arg1:Boolean):void{
m_bRight = _arg1;
}
public function set keyUp(_arg1:Boolean):void{
m_bUp = _arg1;
}
public function set keyLeft(_arg1:Boolean):void{
m_bLeft = _arg1;
}
public function get keyDown():Boolean{
return (m_bDown);
}
public function get keyUp():Boolean{
return (m_bUp);
}
public function get keyRight():Boolean{
return (m_bRight);
}
}
}//package game.model
Section 130
//LabyrinthProxy (game.model.LabyrinthProxy)
package game.model {
import com.*;
import game.view.*;
public class LabyrinthProxy extends LayerMatrixProxy {
private const CHANGE_BOTTOM_LINE:uint = 4;
private const CHANGE_MIDDLE_LINE:uint = 2;
private const CHANGE_TOP_LINE:uint = 1;
private var m_nRealWidth:int;
private var m_nRealHeight:int;
public static const DIRECTION_RT:int = (CommonFunc.INT_UNDEF + 3);
public static const NAME:String = "LabyrinthProxy";
public static const DIRECTION_UNDEF:int = -1;
public static const DIRECTION_L:int = (CommonFunc.INT_UNDEF + 8);
public static const DIRECTION_LT:int = (CommonFunc.INT_UNDEF + 1);
public static const DIRECTION_B:int = (CommonFunc.INT_UNDEF + 6);
public static const DIRECTION_R:int = (CommonFunc.INT_UNDEF + 4);
public static const DIRECTION_T:int = (CommonFunc.INT_UNDEF + 2);
public static const DIRECTION_RB:int = (CommonFunc.INT_UNDEF + 5);
public static const DIRECTION_LB:int = (CommonFunc.INT_UNDEF + 7);
public function LabyrinthProxy(_arg1:int=-1, _arg2:LevelProxy=null){
super(_arg1, _arg2);
type = LayerProxy.LAYER_TYPE_LABYRINTH;
}
override public function get topCenter():IntPoint{
var _local1:int;
_local1 = (m_nWidth >> 1);
if ((_local1 & (1 == 0))){
_local1++;
};
return (new IntPoint(_local1, 0));
}
public function setItem(_arg1:int, _arg2:int, _arg3:int):void{
var _local4:int;
var _local5:int;
_local4 = ((_arg1 << 1) + 1);
_local5 = ((_arg2 << 1) + 1);
setValue_(_local4, _local5, _arg3);
}
private function isBlockAt(_arg1:int, _arg2:int):Boolean{
var _local3:int;
_local3 = getValueXY(_arg1, _arg2);
return ((_local3 == Sprites.SPR_ID_LABYRINTH_BLOCK));
}
override public function init(_arg1:int, _arg2:int, _arg3:int):Boolean{
m_nRealWidth = (_arg2 >> 1);
m_nRealHeight = (_arg3 >> 1);
if (!super.init(_arg1, _arg2, _arg3)){
return (false);
};
return (true);
}
public function isThereExit(_arg1:int, _arg2:int, _arg3:int):Boolean{
var _local4:int;
var _local5:int;
var _local6:int;
_local4 = ((_arg1 << 1) + 1);
_local5 = ((_arg2 << 1) + 1);
_local6 = getValue(new IntPoint(_local4, _local5));
switch (_local6){
case Sprites.SPR_ID_LABYRINTH_STAIRWAY_RIGHT:
case Sprites.SPR_ID_LABYRINTH_STAIRWAY_LEFT:
case Sprites.SPR_ID_LABYRINTH_STAIRWAY_UP:
switch (_arg3){
case DIRECTION_L:
return (!(isWallAt_((_local4 + 1), _local5)));
case DIRECTION_R:
return (!(isWallAt_((_local4 - 1), _local5)));
case DIRECTION_T:
return (!(isWallAt_(_local4, (_local5 + 1))));
case DIRECTION_B:
return (!(isWallAt_(_local4, (_local5 - 1))));
};
return (true);
};
return (false);
}
private function isWall(_arg1:int):Boolean{
return ((((((((((_arg1 == Sprites.SPR_ID_LABYRINTH)) || ((_arg1 == (Sprites.SPR_ID_LABYRINTH + 1))))) || ((_arg1 == (Sprites.SPR_ID_LABYRINTH + 2))))) || ((_arg1 == Sprites.SPR_ID_LABYRINTH_WALL_H_FENCE)))) || ((_arg1 == Sprites.SPR_ID_LABYRINTH_BLOCK))));
}
override public function setValue(_arg1:IntPoint, _arg2:int):Boolean{
var _local3:uint;
if (_arg1 == null){
return (false);
};
if ((((_arg1.m_iX < 0)) || ((_arg1.m_iX >= width)))){
return (false);
};
if ((((_arg1.m_iY < 0)) || ((_arg1.m_iY >= height)))){
return (false);
};
_local3 = 0;
if (_arg2 == CommonFunc.INT_UNDEF){
_local3 = setWall_Local(_arg1.m_iX, _arg1.m_iY, _arg2, true, true);
} else {
_local3 = setWall_Local(_arg1.m_iX, _arg1.m_iY, _arg2, true, false);
};
if ((_local3 & CHANGE_TOP_LINE)){
sendChangeDataNotification(new IntPoint(_arg1.m_iX, (_arg1.m_iY - 1)));
};
if ((_local3 & CHANGE_MIDDLE_LINE)){
sendChangeDataNotification(_arg1);
};
if ((_local3 & CHANGE_BOTTOM_LINE)){
sendChangeDataNotification(new IntPoint(_arg1.m_iX, (_arg1.m_iY + 1)));
};
return (true);
}
public function isCanMoveTo(_arg1:int, _arg2:int, _arg3:int):Boolean{
var _local4:int;
var _local5:int;
_local4 = ((_arg1 << 1) + 1);
_local5 = ((_arg2 << 1) + 1);
switch (_arg3){
case DIRECTION_T:
_local5--;
break;
case DIRECTION_R:
_local4++;
break;
case DIRECTION_B:
_local5++;
break;
case DIRECTION_L:
_local4--;
break;
default:
return (false);
};
return (!(isWallAt_(_local4, _local5)));
}
private function isNeighbour(_arg1:int, _arg2:int):Boolean{
if (isWallAt_((_arg1 - 1), (_arg2 - 1))){
return (true);
};
if (isWallAt_((_arg1 - 0), (_arg2 - 1))){
return (true);
};
if (isWallAt_((_arg1 + 1), (_arg2 - 1))){
return (true);
};
if (isWallAt_((_arg1 - 1), (_arg2 - 0))){
return (true);
};
if (isWallAt_((_arg1 + 1), (_arg2 - 0))){
return (true);
};
if (isWallAt_((_arg1 - 1), (_arg2 + 1))){
return (true);
};
if (isWallAt_((_arg1 - 0), (_arg2 + 1))){
return (true);
};
if (isWallAt_((_arg1 + 1), (_arg2 + 1))){
return (true);
};
return (false);
}
private function setWall_Local(_arg1:int, _arg2:int, _arg3:int, _arg4:Boolean=true, _arg5:Boolean=true):uint{
var _local6:uint;
var _local7:int;
var _local8:Boolean;
var _local9:int;
_local6 = 0;
_local7 = getValue_(_arg1, _arg2);
if (_arg4){
_local8 = ((_arg1 & 1) == 0);
if (((((isWall(_arg3)) || ((_arg3 == -1)))) || (((isWall(_local7)) && ((_arg3 == Sprites.SPR_ID_NULL)))))){
if (!_arg5){
setValue_(_arg1, _arg2, _arg3);
_local6 = (_local6 | CHANGE_MIDDLE_LINE);
};
if (_local8){
if (_arg3 != 0){
_local9 = Sprites.SPR_ID_LABYRINTH_COLUMN;
} else {
_local9 = 0;
};
if (_arg2 > 0){
if (((!(isNeighbour(_arg1, (_arg2 - 1)))) || (!((_local9 == 0))))){
setValue_(_arg1, (_arg2 - 1), _local9);
_local6 = (_local6 | CHANGE_MIDDLE_LINE);
};
};
if (_arg2 < (height - 1)){
if (((!(isNeighbour(_arg1, (_arg2 + 1)))) || (!((_local9 == 0))))){
setValue_(_arg1, (_arg2 + 1), _local9);
_local6 = (_local6 | CHANGE_BOTTOM_LINE);
};
};
if (_arg5){
setValue_(_arg1, _arg2, Sprites.SPR_ID_LABYRINTH_WALL_V);
_local6 = (_local6 | CHANGE_MIDDLE_LINE);
};
if (_arg1 > 0){
if (isDeadEnd((_arg1 - 1), _arg2)){
if (_arg3 != Sprites.SPR_ID_NULL){
setValue_((_arg1 - 1), _arg2, Sprites.SPR_ID_LABYRINTH_BLOCK);
_local6 = (_local6 | CHANGE_MIDDLE_LINE);
};
} else {
if ((((_arg3 == Sprites.SPR_ID_NULL)) && (isBlockAt((_arg1 - 1), _arg2)))){
setValue_((_arg1 - 1), _arg2, Sprites.SPR_ID_NULL);
_local6 = (_local6 | CHANGE_MIDDLE_LINE);
};
};
};
if (_arg1 < (width - 1)){
if (isDeadEnd((_arg1 + 1), _arg2)){
if (_arg3 != Sprites.SPR_ID_NULL){
setValue_((_arg1 + 1), _arg2, Sprites.SPR_ID_LABYRINTH_BLOCK);
_local6 = (_local6 | CHANGE_MIDDLE_LINE);
};
} else {
if ((((_arg3 == Sprites.SPR_ID_NULL)) && (isBlockAt((_arg1 + 1), _arg2)))){
setValue_((_arg1 + 1), _arg2, Sprites.SPR_ID_NULL);
_local6 = (_local6 | CHANGE_MIDDLE_LINE);
};
};
};
} else {
if (_arg3 != 0){
_local9 = Sprites.SPR_ID_LABYRINTH_COLUMN;
} else {
_local9 = 0;
};
if (_arg1 > 0){
if (((!(isNeighbour((_arg1 - 1), _arg2))) || (!((_local9 == 0))))){
setValue_((_arg1 - 1), _arg2, _local9);
_local6 = (_local6 | CHANGE_MIDDLE_LINE);
};
};
if (_arg1 < (width - 1)){
if (((!(isNeighbour((_arg1 + 1), _arg2))) || (!((_local9 == 0))))){
setValue_((_arg1 + 1), _arg2, _local9);
_local6 = (_local6 | CHANGE_MIDDLE_LINE);
};
};
if (_arg5){
setValue_(_arg1, _arg2, Sprites.SPR_ID_LABYRINTH_WALL_H);
_local6 = (_local6 | CHANGE_MIDDLE_LINE);
};
if (_arg2 > 0){
if (isDeadEnd(_arg1, (_arg2 - 1))){
if (_arg3 != Sprites.SPR_ID_NULL){
setValue_(_arg1, (_arg2 - 1), Sprites.SPR_ID_LABYRINTH_BLOCK);
_local6 = (_local6 | CHANGE_TOP_LINE);
};
} else {
if ((((_arg3 == Sprites.SPR_ID_NULL)) && (isBlockAt(_arg1, (_arg2 - 1))))){
setValue_(_arg1, (_arg2 - 1), Sprites.SPR_ID_NULL);
_local6 = (_local6 | CHANGE_TOP_LINE);
};
};
};
if (_arg2 < (height - 1)){
if (isDeadEnd(_arg1, (_arg2 + 1))){
if (_arg3 != Sprites.SPR_ID_NULL){
setValue_(_arg1, (_arg2 + 1), Sprites.SPR_ID_LABYRINTH_BLOCK);
_local6 = (_local6 | CHANGE_MIDDLE_LINE);
};
} else {
if ((((_arg3 == Sprites.SPR_ID_NULL)) && (isBlockAt(_arg1, (_arg2 + 1))))){
setValue_(_arg1, (_arg2 + 1), Sprites.SPR_ID_NULL);
_local6 = (_local6 | CHANGE_MIDDLE_LINE);
};
};
};
};
} else {
if (!isWall(_local7)){
setValue_(_arg1, _arg2, _arg3);
_local6 = (_local6 | CHANGE_MIDDLE_LINE);
};
};
};
return (_local6);
}
public function initReal(_arg1:int, _arg2:int, _arg3:int):Boolean{
return (init(_arg1, ((_arg2 << 1) + 1), ((_arg3 << 1) + 1)));
}
private function makeRandLabyrinth_Local():void{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:Boolean;
var _local5:Boolean;
_local2 = height;
while (--_local2 >= 0) {
_local5 = ((_local2 & 1) == 0);
_local1 = width;
while (--_local1 >= 0) {
_local4 = ((_local1 & 1) == 0);
if (_local4){
if (_local5){
if (Math.random() > 0.85){
_local3 = Sprites.SPR_ID_LABYRINTH;
} else {
_local3 = 0;
};
} else {
if (Math.random() > 0.85){
_local3 = (Sprites.SPR_ID_LABYRINTH + 1);
} else {
_local3 = 0;
};
};
} else {
if (_local5){
if (Math.random() > 0.85){
_local3 = (Sprites.SPR_ID_LABYRINTH + 2);
} else {
_local3 = 0;
};
} else {
if (Math.random() > 0.85){
_local3 = Sprites.SPR_ID_LABYRINTH_ITEM;
} else {
_local3 = 0;
};
};
};
setValue_(_local1, _local2, _local3);
};
};
}
public function makeRandLabyrinth():void{
var _local1:int;
var _local2:int;
var _local3:int;
setWallTo(1, 1, DIRECTION_L);
setWallTo(1, 1, DIRECTION_T);
return;
}
public function get canSolve():Boolean{
if (((((isHereType(Sprites.SPR_ID_LABYRINTH_STAIRWAY_RIGHT)) || (isHereType(Sprites.SPR_ID_LABYRINTH_STAIRWAY_LEFT)))) || (isHereType(Sprites.SPR_ID_LABYRINTH_STAIRWAY_UP)))){
return (true);
};
return (false);
}
private function isWallAt_(_arg1:int, _arg2:int):Boolean{
var _local3:int;
_local3 = getValueXY(_arg1, _arg2);
return (isWall(_local3));
}
private function isDeadEnd(_arg1:int, _arg2:int):Boolean{
if (!isWallAt_((_arg1 - 0), (_arg2 - 1))){
return (false);
};
if (!isWallAt_((_arg1 - 1), (_arg2 - 0))){
return (false);
};
if (!isWallAt_((_arg1 + 1), (_arg2 - 0))){
return (false);
};
if (!isWallAt_((_arg1 - 0), (_arg2 + 1))){
return (false);
};
return (true);
}
public function setWallTo(_arg1:int, _arg2:int, _arg3:int):void{
var _local4:int;
var _local5:int;
switch (_arg3){
case DIRECTION_LT:
_local4 = (_arg1 << 1);
_local5 = (_arg2 << 1);
setWall_Local(_local4, _local5, Sprites.SPR_ID_LABYRINTH, false);
break;
case DIRECTION_T:
_local4 = ((_arg1 << 1) + 1);
_local5 = (_arg2 << 1);
setWall_Local(_local4, _local5, (Sprites.SPR_ID_LABYRINTH + 2), true);
break;
case DIRECTION_RT:
_local4 = ((_arg1 << 1) + 2);
_local5 = (_arg2 << 1);
setWall_Local(_local4, _local5, Sprites.SPR_ID_LABYRINTH, false);
break;
case DIRECTION_R:
_local4 = ((_arg1 << 1) + 2);
_local5 = ((_arg2 << 1) + 1);
setWall_Local(_local4, _local5, (Sprites.SPR_ID_LABYRINTH + 1), true);
break;
case DIRECTION_RB:
_local4 = ((_arg1 << 1) + 2);
_local5 = ((_arg2 << 1) + 2);
setWall_Local(_local4, _local5, Sprites.SPR_ID_LABYRINTH, false);
break;
case DIRECTION_B:
_local4 = ((_arg1 << 1) + 1);
_local5 = ((_arg2 << 1) + 2);
setWall_Local(_local4, _local5, (Sprites.SPR_ID_LABYRINTH + 2), true);
break;
case DIRECTION_LB:
_local4 = (_arg1 << 1);
_local5 = ((_arg2 << 1) + 2);
setWall_Local(_local4, _local5, Sprites.SPR_ID_LABYRINTH, false);
break;
case DIRECTION_L:
_local4 = (_arg1 << 1);
_local5 = ((_arg2 << 1) + 1);
setWall_Local(_local4, _local5, (Sprites.SPR_ID_LABYRINTH + 1), true);
break;
};
}
public function isWallAt(_arg1:int, _arg2:int):Boolean{
return (isWallAt_(((_arg1 << 1) + 1), ((_arg2 << 1) + 1)));
}
override public function isCompatibleType(_arg1:int):Boolean{
return ((((_arg1 == LayerProxy.LAYER_TYPE_LABYRINTH)) || (super.isCompatibleType(_arg1))));
}
}
}//package game.model
Section 131
//LayerChangeEvent (game.model.LayerChangeEvent)
package game.model {
import com.*;
import game.model.Elements.*;
public class LayerChangeEvent {
public var m_point:IntPoint;// = null
public var m_bCreate:Boolean;
public var m_bUnlock:Boolean;// = false
public var m_nType:int;
public var m_pLayer:LayerProxy;
public var m_pElement:LayerElementProxy;
public function LayerChangeEvent(_arg1:LayerProxy=null, _arg2:IntPoint=null, _arg3:int=-1, _arg4:LayerElementProxy=null, _arg5:Boolean=true){
m_point = null;
m_bUnlock = false;
super();
m_pLayer = _arg1;
m_point = _arg2;
m_nType = _arg3;
m_pElement = _arg4;
m_bCreate = _arg5;
}
}
}//package game.model
Section 132
//LayerListProxy (game.model.LayerListProxy)
package game.model {
import com.*;
import game.model.Elements.*;
import game.view.*;
import game.model.Elements.Character.*;
import game.model.Elements.Movable.*;
public class LayerListProxy extends LayerProxy {
private var m_pObjects:LayerListProxy;
private var m_pCharacters:CharactersProxy;
private var m_pLabyrinth:LabyrinthProxy;
private var m_pTraps:TrapsProxy;
private var m_bOnlyOneElementInCell:Boolean;// = true
private var m_pWater:WaterProxy;
private var m_pSwimItems:SwimLayerProxy;
private var m_bOnlyOneElementInCell_EqType:Boolean;// = false
protected var m_arMatrix:Array;
public static const XML_ELEMET_ONLY_ONE_ELEMENT_IN_CELL_EQ:String = "OOEICEQ";
public static const XML_ELEMET_ONLY_ONE_ELEMENT_IN_CELL:String = "OOEIC";
public static const NAME:String = "LayerListProxy";
public static const DATA_SIZE:int = 2;
public function LayerListProxy(_arg1:int=-1, _arg2:LevelProxy=null){
m_bOnlyOneElementInCell = true;
m_bOnlyOneElementInCell_EqType = false;
super(_arg1, _arg2);
type = LayerProxy.LAYER_TYPE_LIST;
m_arMatrix = new Array();
}
protected function findElement(_arg1:LayerElementProxy):int{
var _local2:int;
_local2 = m_arMatrix.length;
while (--_local2 >= 0) {
if (m_arMatrix[_local2] == _arg1){
return (_local2);
};
};
return (CommonFunc.INT_UNDEF);
}
override public function getValueByID(_arg1:int):int{
var _local2:LayerElementProxy;
_local2 = getElement(_arg1);
if (_local2 == null){
return (CommonFunc.INT_UNDEF);
};
return (_local2.type);
}
public function get swimItems():SwimLayerProxy{
var _local1:LevelProxy;
if (m_pSwimItems == null){
_local1 = parent;
if (_local1 != null){
m_pSwimItems = (_local1.getLayerByID(LevelProxy.LAYER_ID_SWIM) as SwimLayerProxy);
};
};
return (m_pSwimItems);
}
protected function listenRectoreState():void{
}
public function isCanSwimThere(_arg1:LayerElementProxy, _arg2:int, _arg3:int, _arg4:int):int{
var _local5:LabyrinthProxy;
var _local6:WaterProxy;
var _local7:SwimLayerProxy;
var _local8:LayerListProxy;
var _local9:int;
var _local10:int;
var _local11:int;
var _local12:LayerElementProxy;
_local5 = labyrinthProxy;
if (_local5 != null){
_local9 = LabyrinthProxy.DIRECTION_UNDEF;
_local10 = _arg2;
_local11 = _arg3;
if (_arg1.x != _arg2){
if (_arg1.x > _arg2){
_local9 = LabyrinthProxy.DIRECTION_L;
_local10++;
} else {
_local9 = LabyrinthProxy.DIRECTION_R;
_local10--;
};
} else {
if (_arg1.y > _arg3){
_local9 = LabyrinthProxy.DIRECTION_T;
_local11++;
} else {
_local9 = LabyrinthProxy.DIRECTION_B;
_local11--;
};
};
if (!_local5.isCanMoveTo(_local10, _local11, _local9)){
return (LayerElementProxy.STATE_UNDEF);
};
};
_local6 = waterProxy;
if (((!((_local6 == null))) && (!(_local6.isThereXY(_arg2, _arg3))))){
return (LayerElementProxy.STATE_UNDEF);
};
_local7 = swimItems;
if (((!((_local7 == null))) && (_local7.isThereXY(_arg2, _arg3)))){
return (LayerElementProxy.STATE_UNDEF);
};
_local8 = objectsProxy;
if (_local8 != null){
if (_local8.isThereXY(_arg2, _arg3)){
_local12 = _local8.getElementAt(_arg2, _arg3);
if (_local12 != null){
};
return (LayerElementProxy.STATE_UNDEF);
};
};
if (((!((_arg1.type == Sprites.SPR_ID_RAFT))) || (isCanBeThere(_arg1, _arg2, _arg3)))){
return (_arg4);
};
return (LayerElementProxy.STATE_UNDEF);
}
protected function parseXMLChild(_arg1:XML):LayerElementProxy{
var _local2:LayerElementProxy;
var _local3:int;
if (_arg1 != null){
_local3 = _arg1.@[LayerElementProxy.XML_ELEMET_TYPE];
switch (_local3){
default:
_local2 = createElement(_local3);
_local2.inCreate();
break;
};
if (_local2 != null){
if (_local2.parseXMLParams(_arg1)){
_local2.outCreate();
return (_local2);
};
_local2.outCreate();
};
};
return (null);
}
public function listenElementMoveOn(_arg1:LayerElementProxy, _arg2:Boolean=true):void{
}
public function getElementAtNotLikeAndNotDead(_arg1:int, _arg2:int, _arg3:LayerElementProxy):LayerElementProxy{
var _local4:LayerElementProxy;
for each (_local4 in m_arMatrix) {
if (((((((((!((_local4 == null))) && (!((_local4 == _arg3))))) && ((_local4.x == _arg1)))) && ((_local4.y == _arg2)))) && (!((_local4.state == LayerElementProxy_Character.STATE_DEAD))))){
return (_local4);
};
};
return (null);
}
public function getElementAtNotLike(_arg1:int, _arg2:int, _arg3:LayerElementProxy):LayerElementProxy{
var _local4:LayerElementProxy;
for each (_local4 in m_arMatrix) {
if (((((!((_local4 == null))) && ((_local4.x == _arg1)))) && ((_local4.y == _arg2)))){
return (_local4);
};
};
return (null);
}
override public function setValue(_arg1:IntPoint, _arg2:int):Boolean{
var _local3:int;
var _local4:int;
var _local5:LayerElementProxy;
if (_arg1 != null){
_local3 = _arg1.m_iX;
_local4 = _arg1.m_iY;
if (_arg2 != Sprites.SPR_ID_NULL){
_local5 = createElement(_arg2);
if (isCanBeThere(_local5, _local3, _local4)){
_local5.setPos(_local3, _local4);
_local5.type = _arg2;
setElement(_local5);
return (true);
};
} else {
replaceElementsAt(_local3, _local4, null);
return (true);
};
};
return (false);
}
override public function parseXMLParams(_arg1:XML, _arg2:LevelProxy):Boolean{
if (((((!((_arg1 == null))) && (!((_arg2 == null))))) && (super.parseXMLParams(_arg1, _arg2)))){
m_bOnlyOneElementInCell = (_arg1.@[XML_ELEMET_ONLY_ONE_ELEMENT_IN_CELL] == 1);
m_bOnlyOneElementInCell_EqType = (_arg1.@[XML_ELEMET_ONLY_ONE_ELEMENT_IN_CELL_EQ] == 1);
parseSubElement(_arg1);
return (true);
};
return (false);
}
override public function setElement(_arg1:LayerElementProxy):void{
if (_arg1 != null){
replaceElementsAt(_arg1.x, _arg1.y, _arg1);
pushElement(_arg1);
};
super.setElement(_arg1);
}
public function restoreStates(_arg1:Boolean, _arg2:Boolean=false):Boolean{
if (m_xmlStorage != null){
clear();
if (parseSubElement(m_xmlStorage, _arg2)){
if (_arg1){
m_xmlStorage = null;
};
listenRectoreState();
return (true);
};
};
return (false);
}
protected function get trapsProxy():TrapsProxy{
var _local1:LevelProxy;
if (m_pTraps == null){
_local1 = parent;
if (_local1 != null){
m_pTraps = (_local1.getLayerByID(LevelProxy.LAYER_ID_GROUND_TRAPS) as TrapsProxy);
};
};
return (m_pTraps);
}
protected function isCanOperateWithCharacter(_arg1:LayerElementProxy, _arg2:LayerElementProxy_Character):Boolean{
if (((!((_arg1 == null))) && (!((_arg2 == null))))){
return (true);
};
return (false);
}
public function listenElementChangeState(_arg1:LayerElementProxy):void{
}
override public function clear():void{
var _local1:LayerElementProxy;
lock();
for each (_local1 in m_arMatrix) {
if (((!((_local1 == null))) && (_local1))){
eraseElement(_local1);
};
};
m_arMatrix = new Array();
unlock();
}
public function listenElementPutOnElementCommand(_arg1:LayerElementProxy, _arg2:LayerElementProxy, _arg3:Boolean):void{
}
private function replaceElementsAt(_arg1:int, _arg2:int, _arg3:LayerElementProxy):void{
forEachElementAtAnd(_arg1, _arg2, forEachElement_SetValue, _arg3);
}
protected function createElement(_arg1:int):LayerElementProxy{
switch (_arg1){
case Sprites.SPR_ID_ITEM_CANDLESTICK:
return (new LayerElementProxy_Movable_Candlestick(_arg1, this));
case Sprites.SPR_ID_ITEM_VASE:
return (new LayerElementProxy_Movable_Vase(_arg1, this));
case Sprites.SPR_ID_ITEM_BOX:
return (new LayerElementProxy_Movable_Box(_arg1, this));
case Sprites.SPR_ID_ITEM_FIRE:
return (new LayerElementProxy_Movable_Fire(_arg1, this));
default:
return (new LayerElementProxy(_arg1, this));
};
}
public function onChangePos(_arg1:LayerElementProxy):void{
}
protected function get characters():CharactersProxy{
var _local1:LevelProxy;
if (m_pCharacters == null){
_local1 = parent;
if (_local1 != null){
m_pCharacters = (_local1.getLayerByID(LevelProxy.LAYER_ID_CHARACTERS) as CharactersProxy);
};
};
return (m_pCharacters);
}
public function isCanMoveThere(_arg1:LayerElementProxy, _arg2:int, _arg3:int, _arg4:int):int{
var _local5:TrapsProxy;
var _local6:LayerListProxy;
var _local7:CharactersProxy;
var _local8:LayerElementProxy_Trap;
var _local9:LayerElementProxy;
var _local10:LayerElementProxy_Character;
_local5 = trapsProxy;
if (_local5 != null){
_local8 = _local5.getTrapThere(_arg2, _arg3);
if (_local8 != null){
if (_local8.state == LayerElementProxy_Trap.STATE_TRAP_ON){
return (LayerElementProxy.STATE_UNDEF);
};
};
};
if (!isCanMoveThere_FromLabyrinth(_arg1, _arg2, _arg3)){
return (LayerElementProxy.STATE_UNDEF);
};
if (isThereWaterAndCantRide(_arg1, _arg2, _arg3)){
return (LayerElementProxy.STATE_UNDEF);
};
_local6 = objectsProxy;
if (_local6 != null){
if (_local6.isThereXY(_arg2, _arg3)){
_local9 = _local6.getElementAt(_arg2, _arg3);
if (_local9 != null){
};
return (LayerElementProxy.STATE_UNDEF);
};
};
_local7 = characters;
if (_local7 != null){
_local10 = (_local7.getElementAtNotDead(_arg2, _arg3) as LayerElementProxy_Character);
if (_local10 == null){
_local10 = (_local7.getElementThatWillBeAtNotDead(_arg2, _arg3) as LayerElementProxy_Character);
};
if (_local10 != null){
if (!isCanOperateWithCharacter(_arg1, _local10)){
return (LayerElementProxy.STATE_UNDEF);
};
};
};
if (isCanBeThere(_arg1, _arg2, _arg3)){
return (_arg4);
};
return (LayerElementProxy.STATE_UNDEF);
}
override public function eraseElement(_arg1:LayerElementProxy):void{
if (_arg1 != null){
removeElement(_arg1);
};
super.eraseElement(_arg1);
}
public function getElementThatWillBeAt(_arg1:int, _arg2:int):LayerElementProxy{
var _local3:LayerElementProxy;
for each (_local3 in m_arMatrix) {
if (((((!((_local3 == null))) && ((_local3.moveToX == _arg1)))) && ((_local3.moveToY == _arg2)))){
return (_local3);
};
};
return (null);
}
public function getElementsAt(_arg1:int, _arg2:int):Array{
var _local3:Array;
var _local4:LayerElementProxy;
_local3 = new Array();
for each (_local4 in m_arMatrix) {
if (((((!((_local4 == null))) && ((_local4.x == _arg1)))) && ((_local4.y == _arg2)))){
_local3.push(_local4);
};
};
return (_local3);
}
protected function pushElement(_arg1:LayerElementProxy):void{
m_arMatrix.push(_arg1);
}
public function listenElementTrapOn(_arg1:LayerElementProxy):void{
}
private function forEachElementAtAnd(_arg1:int, _arg2:int, _arg3:Function, _arg4:LayerElementProxy):void{
var _local5:LayerElementProxy;
if (_arg3 == null){
return;
};
for each (_local5 in m_arMatrix) {
if (((((!((_local5 == null))) && ((_local5.x == _arg1)))) && ((_local5.y == _arg2)))){
_arg3(_arg4, _local5);
};
};
}
protected function isThereWaterAndCantRide(_arg1:LayerElementProxy, _arg2:int, _arg3:int):Boolean{
var _local4:WaterProxy;
var _local5:SwimLayerProxy;
_local4 = waterProxy;
if (((!((_local4 == null))) && (_local4.isThereXY(_arg2, _arg3)))){
if (_arg1.canRide){
_local5 = swimItems;
if ((((_local5 == null)) || (!(_local5.isThereXY(_arg2, _arg3))))){
return (true);
};
} else {
return (true);
};
};
return (false);
}
protected function get waterProxy():WaterProxy{
var _local1:LevelProxy;
if (m_pWater == null){
_local1 = parent;
if (_local1 != null){
m_pWater = (_local1.getLayerByID(LevelProxy.LAYER_ID_WATER) as WaterProxy);
};
};
return (m_pWater);
}
public function isCanChangeState(_arg1:int, _arg2:LayerElementProxy):int{
var _local3:int;
var _local4:int;
var _local5:int;
if (_arg2 != null){
_local3 = _arg2.x;
_local4 = _arg2.y;
switch (_arg1){
case LayerElementProxy.STATE_SWIM_WEST:
_local3--;
_local5 = isCanSwimThere(_arg2, _local3, _local4, _arg1);
if (_local5 == CommonFunc.INT_UNDEF){
return (LayerElementProxy.STATE_LOOK_WEST);
};
return (_local5);
case LayerElementProxy.STATE_SWIM_EAST:
_local3++;
_local5 = isCanSwimThere(_arg2, _local3, _local4, _arg1);
if (_local5 == CommonFunc.INT_UNDEF){
return (LayerElementProxy.STATE_LOOK_EAST);
};
return (_local5);
case LayerElementProxy.STATE_SWIM_NORTH:
_local4--;
_local5 = isCanSwimThere(_arg2, _local3, _local4, _arg1);
if (_local5 == CommonFunc.INT_UNDEF){
return (LayerElementProxy.STATE_LOOK_NORTH);
};
return (_local5);
case LayerElementProxy.STATE_SWIM_SOUTH:
_local4++;
_local5 = isCanSwimThere(_arg2, _local3, _local4, _arg1);
if (_local5 == CommonFunc.INT_UNDEF){
return (LayerElementProxy.STATE_LOOK_SOUTH);
};
return (_local5);
case LayerElementProxy.STATE_MOVE_WEST:
_local3--;
_local5 = isCanMoveThere(_arg2, _local3, _local4, _arg1);
if (_local5 == CommonFunc.INT_UNDEF){
return (LayerElementProxy.STATE_LOOK_WEST);
};
return (_local5);
case LayerElementProxy.STATE_MOVE_NORTH:
_local4--;
_local5 = isCanMoveThere(_arg2, _local3, _local4, _arg1);
if (_local5 == CommonFunc.INT_UNDEF){
return (LayerElementProxy.STATE_LOOK_NORTH);
};
return (_local5);
case LayerElementProxy.STATE_MOVE_SOUTH:
_local4++;
_local5 = isCanMoveThere(_arg2, _local3, _local4, _arg1);
if (_local5 == CommonFunc.INT_UNDEF){
return (LayerElementProxy.STATE_LOOK_SOUTH);
};
return (_local5);
case LayerElementProxy.STATE_MOVE_EAST:
_local3++;
_local5 = isCanMoveThere(_arg2, _local3, _local4, _arg1);
if (_local5 == CommonFunc.INT_UNDEF){
return (LayerElementProxy.STATE_LOOK_EAST);
};
return (_local5);
default:
return (_arg1);
};
};
return (LayerElementProxy.STATE_UNDEF);
}
override public function get toXML():XML{
var _local1:XML;
var _local2:LayerElementProxy;
_local1 = super.toXML;
_local1.@[XML_ELEMET_ONLY_ONE_ELEMENT_IN_CELL] = (m_bOnlyOneElementInCell) ? 1 : 0;
_local1.@[XML_ELEMET_ONLY_ONE_ELEMENT_IN_CELL_EQ] = (m_bOnlyOneElementInCell_EqType) ? 1 : 0;
for each (_local2 in m_arMatrix) {
if (_local2 != null){
_local1.appendChild(_local2.toXML);
};
};
return (_local1);
}
public function getElementAt(_arg1:int, _arg2:int, _arg3:int=0):LayerElementProxy{
var _local4:LayerElementProxy;
for each (_local4 in m_arMatrix) {
if (((((((!((_local4 == null))) && ((_local4.x == _arg1)))) && ((_local4.y == _arg2)))) && ((((_arg3 == Sprites.SPR_ID_NULL)) || ((_arg3 == _local4.type)))))){
return (_local4);
};
};
return (null);
}
public function listenElementCrossMargin(_arg1:LayerElementProxy):void{
}
private function parseSubElement(_arg1:XML, _arg2:Boolean=false):Boolean{
var _local3:LayerElementProxy;
var _local4:XML;
var _local5:XMLList;
var _local6:int;
var _local7:int;
var _local8:int;
_local5 = _arg1.child(LayerElementProxy.XML_NAME);
_local6 = _local5.length();
_local7 = 0;
while (_local7 < _local6) {
_local4 = _local5[_local7];
_local3 = parseXMLChild(_local4);
if (_local3 != null){
pushElement(_local3);
if (_arg2){
_local8 = _local3.state;
_local3.state = LayerElementProxy.STATE_BORN;
_local3.state = _local8;
};
};
_local7++;
};
return (true);
}
override public function randomize(_arg1:int, _arg2:int):void{
var _local3:LayerElementProxy;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
super.randomize(_arg1, _arg2);
_local7 = (_arg2 - _arg1);
_local8 = 10;
while (--_local8 >= 0) {
_local4 = (Math.random() * width);
_local5 = (Math.random() * height);
_local6 = (_arg1 + (_local7 * Math.random()));
_local3 = new LayerElementProxy();
_local3.setPos(_local4, _local5);
_local3.type = _local6;
pushElement(_local3);
};
}
protected function get objectsProxy():LayerListProxy{
var _local1:LevelProxy;
if (m_pObjects == null){
_local1 = parent;
if (_local1 != null){
m_pObjects = (_local1.getLayerByID(LevelProxy.LAYER_ID_OBJECTS) as LayerListProxy);
};
};
return (m_pObjects);
}
override public function getValue(_arg1:IntPoint):int{
var _local2:LayerElementProxy;
_local2 = getElementAt(_arg1.m_iX, _arg1.m_iY);
if (_local2 != null){
return (_local2.type);
};
return (Sprites.SPR_ID_NULL);
}
protected function forEachElement_SetValue(_arg1:LayerElementProxy, _arg2:LayerElementProxy):void{
if (m_bOnlyOneElementInCell){
if (((((!(m_bOnlyOneElementInCell_EqType)) || ((_arg1 == null)))) || ((_arg1.type == _arg2.type)))){
eraseElement(_arg2);
};
};
}
public function isCanBeThere(_arg1:LayerElementProxy, _arg2:int, _arg3:int):Boolean{
if ((((((((_arg2 >= 0)) && ((_arg2 < width)))) && ((_arg3 >= 0)))) && ((_arg3 < height)))){
return (true);
};
return (false);
}
protected function isCanMoveThere_FromLabyrinth(_arg1:LayerElementProxy, _arg2:int, _arg3:int):Boolean{
var _local4:LabyrinthProxy;
var _local5:int;
var _local6:int;
var _local7:int;
_local4 = labyrinthProxy;
if (_local4 != null){
_local5 = LabyrinthProxy.DIRECTION_UNDEF;
_local6 = _arg2;
_local7 = _arg3;
if (_arg1.x != _arg2){
if (_arg1.x > _arg2){
_local5 = LabyrinthProxy.DIRECTION_L;
_local6++;
} else {
_local5 = LabyrinthProxy.DIRECTION_R;
_local6--;
};
} else {
if (_arg1.y > _arg3){
_local5 = LabyrinthProxy.DIRECTION_T;
_local7++;
} else {
_local5 = LabyrinthProxy.DIRECTION_B;
_local7--;
};
};
if (!_local4.isCanMoveTo(_local6, _local7, _local5)){
return (false);
};
};
return (true);
}
public function getElementThatWillBeAtNotDead(_arg1:int, _arg2:int):LayerElementProxy{
var _local3:LayerElementProxy;
for each (_local3 in m_arMatrix) {
if (((((((!((_local3 == null))) && ((_local3.moveToX == _arg1)))) && ((_local3.moveToY == _arg2)))) && (!((_local3.state == LayerElementProxy_Character.STATE_DEAD))))){
return (_local3);
};
};
return (null);
}
public function getElement(_arg1:int):LayerElementProxy{
return (m_arMatrix[_arg1]);
}
protected function removeElement(_arg1:LayerElementProxy):void{
var _local2:int;
_local2 = findElement(_arg1);
if (_local2 >= 0){
m_arMatrix.splice(_local2, 1);
};
}
override public function isThereXY(_arg1:int, _arg2:int):Boolean{
return (!((getElementAt(_arg1, _arg2) == null)));
}
public function saveStates():Boolean{
m_xmlStorage = this.toXML;
return (!((m_xmlStorage == null)));
}
override public function get length():int{
return (m_arMatrix.length);
}
protected function get labyrinthProxy():LabyrinthProxy{
var _local1:LevelProxy;
if (m_pLabyrinth == null){
_local1 = parent;
if (_local1 != null){
m_pLabyrinth = (_local1.getLayerByID(LevelProxy.LAYER_ID_LABYRINTH) as LabyrinthProxy);
};
};
return (m_pLabyrinth);
}
override public function isCompatibleType(_arg1:int):Boolean{
return ((((_arg1 == LayerProxy.LAYER_TYPE_LIST)) || (super.isCompatibleType(_arg1))));
}
public function getElementAtNotDead(_arg1:int, _arg2:int):LayerElementProxy{
var _local3:LayerElementProxy;
for each (_local3 in m_arMatrix) {
if (((((((!((_local3 == null))) && ((_local3.x == _arg1)))) && ((_local3.y == _arg2)))) && (!((_local3.state == LayerElementProxy_Character.STATE_DEAD))))){
return (_local3);
};
};
return (null);
}
}
}//package game.model
Section 133
//LayerMatrixProxy (game.model.LayerMatrixProxy)
package game.model {
import flash.utils.*;
import com.*;
import main.*;
import game.view.*;
public class LayerMatrixProxy extends LayerProxy {
private var m_arMatrix:ByteArray;
public static const FILL_STYLE_SOLID:int = 0;
public static const NAME:String = "LayerMatrixProxy";
public static const FILL_STYLE_RANDOM:int = 2;
public static const DATA_SIZE:int = 2;
public static const XML_ELEMET_MATRIX:String = "matrix";
public static const FILL_STYLE_DIAGONAL:int = 1;
public function LayerMatrixProxy(_arg1:int=-1, _arg2:LevelProxy=null){
m_arMatrix = new ByteArray();
super(_arg1, _arg2);
type = LayerProxy.LAYER_TYPE_MATRIX;
}
public function fill(_arg1:int, _arg2:int=0, _arg3:int=-1):Boolean{
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:Boolean;
switch (_arg2){
case FILL_STYLE_SOLID:
lock();
_local4 = _arg1;
_local5 = height;
while (--_local5 >= 0) {
_local6 = width;
while (--_local6 >= 0) {
setValue_(_local6, _local5, _arg1);
};
};
unlock();
break;
case FILL_STYLE_DIAGONAL:
lock();
_local5 = height;
while (--_local5 >= 0) {
_local8 = ((_local5 & 1) == 1);
_local6 = width;
while (--_local6 >= 0) {
if (_local8){
_local4 = _arg1;
_local8 = false;
} else {
_local4 = _arg3;
_local8 = true;
};
setValue_(_local6, _local5, _local4);
};
};
unlock();
break;
case FILL_STYLE_RANDOM:
lock();
_local7 = ((_arg3 - _arg1) + 1);
_local5 = height;
while (--_local5 >= 0) {
_local6 = width;
while (--_local6 >= 0) {
_local4 = (_arg1 + (_local7 * Math.random()));
setValue_(_local6, _local5, _local4);
};
};
unlock();
break;
default:
return (false);
};
return (true);
}
override public function getValue_(_arg1:int, _arg2:int):int{
m_arMatrix.position = (DATA_SIZE * ((m_nWidth * _arg2) + _arg1));
return (m_arMatrix.readShort());
}
override public function getDepth(_arg1:int):int{
return (CommonFunc.INT_UNDEF);
}
override public function setValue_(_arg1:int, _arg2:int, _arg3:int):void{
m_arMatrix.position = (DATA_SIZE * ((m_nWidth * _arg2) + _arg1));
m_arMatrix.writeShort(_arg3);
}
override public function getValueByID(_arg1:int):int{
m_arMatrix.position = (DATA_SIZE * _arg1);
return (m_arMatrix.readShort());
}
override public function init(_arg1:int, _arg2:int, _arg3:int):Boolean{
return (super.init(_arg1, _arg2, _arg3));
}
override public function get toXML():XML{
var _local1:XML;
var _local2:String;
_local1 = super.toXML;
if (CommonFunc.USE_BASE64){
_local2 = CommonFunc.byteArrayToBase64(m_arMatrix);
} else {
_local2 = CommonFunc.byteArrayToString(m_arMatrix);
};
if (_local2 != null){
_local1.@[XML_ELEMET_MATRIX] = _local2;
};
return (_local1);
}
public function isHereType(_arg1:int):Boolean{
var _local2:int;
var _local3:int;
_local2 = (m_arMatrix.length / 2);
m_arMatrix.position = 0;
while (--_local2 >= 0) {
_local3 = m_arMatrix.readShort();
if (_local3 == _arg1){
return (true);
};
};
return (false);
}
override public function resize(_arg1:int, _arg2:int):Boolean{
super.resize(_arg1, _arg2);
m_arMatrix.length = ((DATA_SIZE * m_nWidth) * m_nHeight);
return (true);
}
override public function setValue(_arg1:IntPoint, _arg2:int):Boolean{
if (_arg1 == null){
return (false);
};
if ((((_arg1.m_iX < 0)) || ((_arg1.m_iX > width)))){
return (false);
};
if ((((_arg1.m_iY < 0)) || ((_arg1.m_iY > height)))){
return (false);
};
setValue_(_arg1.m_iX, _arg1.m_iY, _arg2);
sendChangeDataNotification(_arg1, _arg2);
return (true);
}
override public function randomize(_arg1:int, _arg2:int):void{
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
super.randomize(_arg1, _arg2);
_local4 = m_nHeight;
_local6 = ((_arg2 - _arg1) + 1);
while (--_local4 >= 0) {
_local3 = m_nWidth;
while (--_local3 >= 0) {
_local5 = (_arg1 + (_local6 * Math.random()));
setValue_(_local3, _local4, _local5);
};
};
}
override public function getValue(_arg1:IntPoint):int{
var _local2:int;
if (_arg1 == null){
_local2 = super.getValue(_arg1);
} else {
if ((((_arg1.m_iX < 0)) || ((_arg1.m_iX >= width)))){
_local2 = super.getValue(_arg1);
} else {
if ((((_arg1.m_iY < 0)) || ((_arg1.m_iY >= height)))){
_local2 = super.getValue(_arg1);
} else {
_local2 = getValue_(_arg1.m_iX, _arg1.m_iY);
};
};
};
return (_local2);
}
override public function parseXMLParams(_arg1:XML, _arg2:LevelProxy):Boolean{
var _local3:String;
if (((((!((_arg1 == null))) && (!((_arg2 == null))))) && (super.parseXMLParams(_arg1, _arg2)))){
_local3 = _arg1.@[XML_ELEMET_MATRIX];
if (CommonFunc.USE_BASE64){
m_arMatrix = CommonFunc.base64ToByteArray(_local3);
} else {
m_arMatrix = CommonFunc.stringToByteArray(_local3);
};
return (true);
};
return (false);
}
public function sendChangeDataNotification_(_arg1:int=-1, _arg2:int=-1, _arg3:int=-1):void{
var _local4:LayerChangeEvent;
if (!isLock()){
_local4 = new LayerChangeEvent(this, new IntPoint(_arg1, _arg2));
sendNotification(ApplicationFacade.UPDATE_LAYER_DATA, _local4);
};
}
override public function isThere(_arg1:IntPoint):Boolean{
var _local2:int;
_local2 = getValue(_arg1);
if (_local2 != Sprites.SPR_ID_NULL){
return (true);
};
return (false);
}
override public function isThereXY(_arg1:int, _arg2:int):Boolean{
var _local3:int;
_local3 = getValue(new IntPoint(((_arg1 << 1) + 1), ((_arg2 << 1) + 1)));
if (_local3 != Sprites.SPR_ID_NULL){
return (true);
};
return (false);
}
override public function clear():void{
var _local1:int;
lock();
_local1 = (m_arMatrix.length / DATA_SIZE);
m_arMatrix.position = 0;
while (--_local1 >= 0) {
m_arMatrix.writeShort(Sprites.SPR_ID_NULL);
};
unlock();
}
override public function get length():int{
return ((width * height));
}
private function convertIDtoX(_arg1:int):int{
return ((_arg1 & m_nWidth));
}
private function convertIDtoY(_arg1:int):int{
return ((_arg1 / m_nWidth));
}
override public function isCompatibleType(_arg1:int):Boolean{
return ((((_arg1 == LayerProxy.LAYER_TYPE_MATRIX)) || (super.isCompatibleType(_arg1))));
}
public function getValueXY(_arg1:int, _arg2:int):int{
var _local3:int;
if ((((_arg1 < 0)) || ((_arg1 >= width)))){
_local3 = CommonFunc.INT_UNDEF;
} else {
if ((((_arg2 < 0)) || ((_arg2 >= height)))){
_local3 = CommonFunc.INT_UNDEF;
} else {
_local3 = getValue_(_arg1, _arg2);
};
};
return (_local3);
}
}
}//package game.model
Section 134
//LayerProxy (game.model.LayerProxy)
package game.model {
import org.puremvc.as3.interfaces.*;
import com.*;
import game.model.Elements.*;
import main.*;
import org.puremvc.as3.patterns.proxy.*;
public class LayerProxy extends Proxy implements IProxy {
protected var m_nWidth:int;// = 0
private var m_nLayerDepth:int;// = -1
private var m_nID:int;// = -1
protected var m_nHeight:int;// = 0
private var m_nLock:int;// = 0
private var m_pParent:LevelProxy;
private var m_nType:int;// = -1
protected var m_xmlStorage:XML;
private var m_nCreateNow:int;// = 0
public static const XML_ELEMET_HEIGHT:String = "height";
public static const LAYER_TYPE_CHARACTERS:int = (CommonFunc.INT_UNDEF + 7);
public static const XML_ELEMET_WIDTH:String = "width";
public static const NAME:String = "LayerProxy";
public static const LAYER_TYPE_INFO:int = (CommonFunc.INT_UNDEF + 8);
public static const XML_NAME:String = "layer";
public static const LAYER_TYPE_WATER:int = (CommonFunc.INT_UNDEF + 4);
public static const LAYER_TYPE_TRAPS:int = (CommonFunc.INT_UNDEF + 6);
public static const LAYER_TYPE_MATRIX:int = (CommonFunc.INT_UNDEF + 2);
public static const XML_ELEMET_DEPTH:String = "depth";
public static const XML_ELEMET_TYPE:String = "type";
public static const LAYER_TYPE_SWIM:int = (CommonFunc.INT_UNDEF + 9);
public static const LAYER_TYPE_LABYRINTH:int = (CommonFunc.INT_UNDEF + 5);
public static const XML_ELEMET_ID:String = "id";
public static const LAYER_TYPE_LIST:int = (CommonFunc.INT_UNDEF + 3);
public static const LAYER_TYPE_DOUBLE_DENSITY:int = (CommonFunc.INT_UNDEF + 1);
public static const LAYER_TYPE_UNDEF:int = -1;
public static const LAYER_TYPE_OBJECTS:int = (CommonFunc.INT_UNDEF + 10);
public function LayerProxy(_arg1:int=-1, _arg2:LevelProxy=null){
m_nID = CommonFunc.INT_UNDEF;
m_nType = LAYER_TYPE_UNDEF;
m_nLayerDepth = CommonFunc.INT_UNDEF;
m_nLock = 0;
m_nWidth = 0;
m_nHeight = 0;
m_nCreateNow = 0;
m_nID = _arg1;
m_pParent = _arg2;
super(((NAME + "_") + m_nID), Number(m_nID));
}
public function getValue_(_arg1:int, _arg2:int):int{
return (CommonFunc.INT_UNDEF);
}
public function eraseElement(_arg1:LayerElementProxy):void{
sendChangeDataNotification(null, CommonFunc.INT_UNDEF, _arg1, false);
if (!isLock()){
sendNotification(ApplicationFacade.ELEMENT_REMOVED, _arg1);
};
}
public function inCreate():void{
m_nCreateNow++;
}
public function getValueByID(_arg1:int):int{
return (CommonFunc.INT_UNDEF);
}
public function setValue_(_arg1:int, _arg2:int, _arg3:int):void{
}
public function get topCenter():IntPoint{
var _local1:int;
_local1 = (m_nWidth >> 1);
return (new IntPoint(_local1, 0));
}
public function setDepthPosition_ToStart():void{
}
public function init(_arg1:int, _arg2:int, _arg3:int):Boolean{
m_nID = _arg1;
resize(_arg2, _arg3);
return (true);
}
public function get id():int{
return (m_nID);
}
public function get toXML():XML{
var _local1:XML;
_local1 = new XML((("<" + XML_NAME) + "/>"));
_local1.@[XML_ELEMET_ID] = id;
_local1.@[XML_ELEMET_TYPE] = type;
_local1.@[XML_ELEMET_DEPTH] = layerDepth;
_local1.@[XML_ELEMET_WIDTH] = width;
_local1.@[XML_ELEMET_HEIGHT] = height;
return (_local1);
}
public function getDepth(_arg1:int):int{
return (CommonFunc.INT_UNDEF);
}
public function get height():int{
return (m_nHeight);
}
public function lock():void{
m_nLock++;
}
public function sendChangeDataNotification(_arg1:IntPoint=null, _arg2:int=-1, _arg3:LayerElementProxy=null, _arg4:Boolean=true):void{
var _local5:LayerChangeEvent;
if (!isLock()){
_local5 = new LayerChangeEvent(this, _arg1, _arg2, _arg3, _arg4);
sendNotification(ApplicationFacade.UPDATE_LAYER_DATA, _local5);
};
}
public function get isCreateNow():Boolean{
return ((m_nCreateNow > 0));
}
public function get parent():LevelProxy{
return (m_pParent);
}
public function setValue(_arg1:IntPoint, _arg2:int):Boolean{
return (true);
}
public function randomize(_arg1:int, _arg2:int):void{
}
public function get type():int{
return (m_nType);
}
public function get inGame():Boolean{
if (parent != null){
return (parent.inGame);
};
return (false);
}
public function setElement(_arg1:LayerElementProxy):void{
sendChangeDataNotification(null, CommonFunc.INT_UNDEF, _arg1, true);
}
public function getValue(_arg1:IntPoint):int{
return (CommonFunc.INT_UNDEF);
}
public function unlock():void{
var _local1:LayerChangeEvent;
if (--m_nLock == 0){
_local1 = new LayerChangeEvent(this);
_local1.m_bUnlock = true;
sendNotification(ApplicationFacade.UPDATE_LAYER_DATA, _local1);
};
}
public function resize(_arg1:int, _arg2:int):Boolean{
m_nWidth = _arg1;
m_nHeight = _arg2;
return (true);
}
public function get width():int{
return (m_nWidth);
}
public function nextDepthPosition():Boolean{
return (true);
}
public function isThere(_arg1:IntPoint):Boolean{
return (false);
}
public function isThereXY(_arg1:int, _arg2:int):Boolean{
return (false);
}
public function getCDP_Depth():int{
return (0);
}
public function parseXMLParams(_arg1:XML, _arg2:LevelProxy):Boolean{
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
if (((!((_arg1 == null))) && (!((_arg2 == null))))){
_local3 = _arg1.@[XML_ELEMET_DEPTH];
_local4 = _arg1.@[XML_ELEMET_WIDTH];
_local5 = _arg1.@[XML_ELEMET_HEIGHT];
_local6 = _arg1.@[XML_ELEMET_ID];
layerDepth = _local3;
init(_local6, _local4, _local5);
return (true);
};
return (false);
}
public function set layerDepth(_arg1:int):void{
m_nLayerDepth = _arg1;
}
public function clear():void{
}
public function get length():int{
return (0);
}
public function eraseValue(_arg1:IntPoint):void{
}
public function getDepthByPos(_arg1:int, _arg2:int):int{
return (CommonFunc.INT_UNDEF);
}
public function outCreate():void{
m_nCreateNow--;
}
public function set type(_arg1:int):void{
m_nType = _arg1;
}
public function isLock():Boolean{
return ((m_nLock > 0));
}
public function isCompatibleType(_arg1:int):Boolean{
return ((m_nType == LAYER_TYPE_UNDEF));
}
public function get layerDepth():int{
return (m_nLayerDepth);
}
public static function parseXML(_arg1:XML, _arg2:LevelProxy):LayerProxy{
var _local3:LayerProxy;
var _local4:int;
var _local5:int;
if (_arg1 != null){
_local4 = _arg1.@[XML_ELEMET_TYPE];
_local5 = _arg1.@[XML_ELEMET_ID];
switch (_local4){
case LAYER_TYPE_MATRIX:
_local3 = new LayerMatrixProxy(_local5, _arg2);
break;
case LAYER_TYPE_DOUBLE_DENSITY:
break;
case LAYER_TYPE_LIST:
_local3 = new LayerListProxy(_local5, _arg2);
break;
case LAYER_TYPE_LABYRINTH:
_local3 = new LabyrinthProxy(_local5, _arg2);
break;
case LAYER_TYPE_WATER:
_local3 = new WaterProxy(_local5, _arg2);
break;
case LAYER_TYPE_OBJECTS:
_local3 = new ObjectsLayerProxy(_local5, _arg2);
break;
case LAYER_TYPE_CHARACTERS:
_local3 = new CharactersProxy(_local5, _arg2);
break;
case LAYER_TYPE_TRAPS:
_local3 = new TrapsProxy(_local5, _arg2);
break;
case LAYER_TYPE_INFO:
_local3 = new InfoLayerProxy(_local5, _arg2);
break;
case LAYER_TYPE_SWIM:
_local3 = new SwimLayerProxy(_local5, _arg2);
break;
};
_local3.inCreate();
if (_local3 != null){
if (_local3.parseXMLParams(_arg1, _arg2)){
_local3.outCreate();
return (_local3);
};
};
};
return (null);
}
}
}//package game.model
Section 135
//LevelProxy (game.model.LevelProxy)
package game.model {
import flash.utils.*;
import org.puremvc.as3.interfaces.*;
import com.*;
import main.*;
import game.view.*;
import game.model.Elements.Character.*;
import org.puremvc.as3.patterns.proxy.*;
public class LevelProxy extends Proxy implements IProxy {
private var m_nPlayState:int;
private var m_nWidth:int;
private var m_layerObjects:LayerListProxy;
private var m_nRate:Number;
private var m_layerLabyrinth_Items:LayerListProxy;
private var m_bActive:Boolean;
private var m_layerWater_Animation:LayerListProxy;
private var m_pInfoItems:InfoLayerProxy;
private var m_layerWater:LayerMatrixProxy;
private var m_nHeight:int;
private var m_layerLabyrinth_Animation:LayerListProxy;
private var m_layerGround:LayerMatrixProxy;
private var m_nLock:int;
private var m_nTimeNeedToWin:int;// = 60000
public var m_arLayers:Array;
private var m_pParent:LevelsProxy;
private var m_strUID:String;
private var m_iID:uint;
private var m_layerLabyrinth:LabyrinthProxy;
private var m_strName:String;
private var m_nLoadState:int;
private var m_pSwimItems:SwimLayerProxy;
private var m_layerGround_Traps:LayerListProxy;
private var m_nTurnsNeedToWin:int;// = 20
private var m_layerCharacters:CharactersProxy;
private var m_strUIDSharedLevel:String;
private var m_layerGrass:LayerMatrixProxy;
private var m_nHowMatchLevelsOpenWhenWalkThrough:int;// = 1
public static const INIT_STYLE_NULL:int = 0;
public static const LAYER_ID_CHARACTERS:int = 8;
public static const NAME:String = "LevelProxy";
public static const PLAY_STATE_PLAYED:int = (PLAY_STATE_LOCK + 1);
public static const LEVEL_WIDTH:int = 13;
public static const LAYER_ID_GROUND:int = 0;
public static const LAYER_ID_OBJECTS:int = 9;
public static const LAYER_ID_WATER:int = 3;
public static const PLAY_STATE_WIN:int = (PLAY_STATE_CAN_PLAY + 1);
public static const LAYER_ID_GROUND_TRAPS:int = 1;
public static const LAYER_ID_SWIM:int = 11;
public static const LAYER_ID_LABYRINTH_ITEMS:int = 6;
public static const PLAY_STATE_LOCK:int = (PLAY_STATE_UNDEF + 1);
public static const INIT_STYLE_RANDOM:int = 2;
public static const LAYER_ID_GRASS:int = 2;
public static const LAYER_ID_INFO:int = 10;
public static const LAYER_ID_WATER_ANIMATION:int = 4;
public static const LAYER_ID_LABYRINTH:int = 5;
public static const INIT_STYLE_EMPTY:int = 1;
public static const XML_NAME:String = "level";
public static const INIT_STYLE_UNDEF:int = -1;
public static const PLAY_STATE_UNDEF:int = -1;
public static const LEVEL_HEIGHT:int = 13;
public static const PLAY_STATE_CAN_PLAY:int = (PLAY_STATE_PLAYED + 1);
public static const LAYER_ID_LABYRINTH_ANIMATION:int = 7;
public static const INIT_STYLE_SPECIAL:int = 3;
private static var s_timeLast:int;
public function LevelProxy(_arg1:int=-1, _arg2:LevelsProxy=null){
m_arLayers = new Array();
m_nHowMatchLevelsOpenWhenWalkThrough = 1;
m_nTimeNeedToWin = (1000 * 60);
m_nTurnsNeedToWin = 20;
m_iID = _arg1;
m_pParent = _arg2;
super(((NAME + "_") + m_iID), Number(m_iID));
}
public function get active():Boolean{
return (m_bActive);
}
public function set active(_arg1:Boolean):void{
m_bActive = _arg1;
}
public function init(_arg1:int=13, _arg2:int=13, _arg3:int=1):Boolean{
width = _arg1;
height = _arg2;
clearLayers();
if (_arg3 != INIT_STYLE_NULL){
m_layerGround = new LayerMatrixProxy(LAYER_ID_GROUND, this);
m_layerGround.init(LAYER_ID_GROUND, _arg1, _arg2);
m_layerGround.layerDepth = 0;
addLayer(m_layerGround);
m_layerWater = new WaterProxy(LAYER_ID_WATER, this);
m_layerWater.init(LAYER_ID_WATER, _arg1, _arg2);
m_layerWater.layerDepth = 1;
addLayer(m_layerWater);
m_layerWater_Animation = new LayerListProxy(LAYER_ID_WATER_ANIMATION, this);
m_layerWater_Animation.init(LAYER_ID_WATER_ANIMATION, _arg1, _arg2);
m_layerWater_Animation.layerDepth = 2;
addLayer(m_layerWater_Animation);
m_layerLabyrinth = new LabyrinthProxy(LAYER_ID_LABYRINTH, this);
m_layerLabyrinth.initReal(LAYER_ID_LABYRINTH, _arg1, _arg2);
m_layerLabyrinth.layerDepth = 3;
addLayer(m_layerLabyrinth);
m_layerGround_Traps = new TrapsProxy(LAYER_ID_GROUND_TRAPS, this);
m_layerGround_Traps.init(LAYER_ID_GROUND_TRAPS, _arg1, _arg2);
m_layerGround_Traps.layerDepth = 4;
addLayer(m_layerGround_Traps);
m_pInfoItems = new InfoLayerProxy(LAYER_ID_INFO, this);
m_pInfoItems.init(LAYER_ID_INFO, _arg1, _arg2);
m_pInfoItems.layerDepth = 5;
addLayer(m_pInfoItems);
m_pSwimItems = new SwimLayerProxy(LAYER_ID_SWIM, this);
m_pSwimItems.init(LAYER_ID_SWIM, _arg1, _arg2);
m_pSwimItems.layerDepth = 6;
addLayer(m_pSwimItems);
m_layerLabyrinth_Items = new LayerListProxy(LAYER_ID_LABYRINTH_ITEMS, this);
m_layerLabyrinth_Items.init(LAYER_ID_LABYRINTH_ITEMS, _arg1, _arg2);
m_layerLabyrinth_Items.layerDepth = 7;
addLayer(m_layerLabyrinth_Items);
m_layerLabyrinth_Animation = new LayerListProxy(LAYER_ID_LABYRINTH_ANIMATION, this);
m_layerLabyrinth_Animation.init(LAYER_ID_LABYRINTH_ANIMATION, _arg1, _arg2);
m_layerLabyrinth_Animation.layerDepth = 8;
addLayer(m_layerLabyrinth_Animation);
m_layerCharacters = new CharactersProxy(LAYER_ID_CHARACTERS, this);
m_layerCharacters.init(LAYER_ID_CHARACTERS, _arg1, _arg2);
m_layerCharacters.layerDepth = 9;
addLayer(m_layerCharacters);
m_layerObjects = new ObjectsLayerProxy(LAYER_ID_OBJECTS, this);
m_layerObjects.init(LAYER_ID_OBJECTS, _arg1, _arg2);
m_layerObjects.layerDepth = 10;
addLayer(m_layerObjects);
switch (_arg3){
case INIT_STYLE_RANDOM:
m_layerGround.randomize(Sprites.SPR_ID_FLOORS, (Sprites.SPR_ID_FLOORS + 1));
m_layerObjects.randomize(Sprites.SPR_ID_ITEMS, Sprites.SPR_ID_ITEMS);
m_layerLabyrinth.makeRandLabyrinth();
break;
};
};
return (true);
}
public function get id():uint{
return (m_iID);
}
public function get timeNeedToWin():Number{
return (m_nTimeNeedToWin);
}
public function useTemplate_FillFloor_Ground_Rand():Boolean{
if (m_layerGround != null){
m_layerGround.fill(Sprites.SPR_ID_FLOOR_GROUND_LIGHT, LayerMatrixProxy.FILL_STYLE_RANDOM, Sprites.SPR_ID_FLOOR_GROUND_DARK);
};
return (false);
}
public function lock():void{
m_nLock++;
}
public function get height():int{
return (m_nHeight);
}
public function setValue(_arg1:int, _arg2:IntPoint, _arg3:int):void{
var _local4:LayerProxy;
if (_arg2 != null){
};
_local4 = getLayerByID(_arg1);
if (_local4 != null){
_local4.setValue(_arg2, _arg3);
};
}
public function restoreStates(_arg1:Boolean=true, _arg2:Boolean=false):Boolean{
if (m_layerCharacters != null){
m_layerCharacters.restoreStates(_arg1, _arg2);
};
if (m_layerObjects != null){
m_layerObjects.restoreStates(_arg1, _arg2);
};
if (m_layerGround_Traps != null){
m_layerGround_Traps.restoreStates(_arg1, _arg2);
};
if (m_pInfoItems != null){
m_pInfoItems.restoreStates(_arg1, _arg2);
};
if (m_pSwimItems != null){
m_pSwimItems.restoreStates(_arg1, _arg2);
};
return (true);
}
public function get toXMLStringCompressed():String{
var _local1:String;
var _local2:String;
_local1 = toXMLString;
trace("start compress");
trace(("time=" + (getTimer() - s_timeLast)));
s_timeLast = getTimer();
_local2 = CommonFunc.compressString(_local1);
trace("stop compress");
trace(("time=" + (getTimer() - s_timeLast)));
s_timeLast = getTimer();
return (_local2);
}
public function addLayer(_arg1:LayerProxy):void{
if (((!((_arg1 == null))) && ((m_arLayers.indexOf(_arg1) < 0)))){
m_arLayers.push(_arg1);
switch (_arg1.id){
case LAYER_ID_GROUND:
m_layerGround = (_arg1 as LayerMatrixProxy);
break;
case LAYER_ID_GROUND_TRAPS:
m_layerGround_Traps = (_arg1 as LayerListProxy);
break;
case LAYER_ID_WATER:
m_layerWater = (_arg1 as LayerMatrixProxy);
break;
case LAYER_ID_WATER_ANIMATION:
m_layerWater_Animation = (_arg1 as LayerListProxy);
break;
case LAYER_ID_LABYRINTH:
m_layerLabyrinth = (_arg1 as LabyrinthProxy);
break;
case LAYER_ID_LABYRINTH_ITEMS:
m_layerLabyrinth_Items = (_arg1 as LayerListProxy);
break;
case LAYER_ID_LABYRINTH_ANIMATION:
m_layerLabyrinth_Animation = (_arg1 as LayerListProxy);
break;
case LAYER_ID_CHARACTERS:
m_layerCharacters = (_arg1 as CharactersProxy);
break;
case LAYER_ID_OBJECTS:
m_layerObjects = (_arg1 as ObjectsLayerProxy);
break;
case LAYER_ID_INFO:
m_pInfoItems = (_arg1 as InfoLayerProxy);
break;
case LAYER_ID_SWIM:
m_pSwimItems = (_arg1 as SwimLayerProxy);
break;
};
};
}
public function set timeNeedToWin(_arg1:Number):void{
m_nTimeNeedToWin = _arg1;
}
public function get levelName():String{
return (m_strName);
}
public function unlock():void{
var _local1:LayerChangeEvent;
if (--m_nLock == 0){
_local1 = new LayerChangeEvent();
_local1.m_bUnlock = true;
sendNotification(ApplicationFacade.UPDATE_LAYER_DATA, _local1);
};
}
public function set id(_arg1:uint):void{
m_iID = _arg1;
}
public function set height(_arg1:int):void{
m_nHeight = _arg1;
}
public function get canSolve():Boolean{
var _local1:LayerElementProxy_Character_Hero;
_local1 = hero;
if (_local1 != null){
if (m_layerLabyrinth != null){
if (m_layerLabyrinth.canSolve){
return (true);
};
};
};
return (false);
}
public function get uid():String{
return (m_strUID);
}
public function getGrassValue(_arg1:int, _arg2:int):int{
return (m_layerGrass.getValue_(_arg1, _arg2));
}
public function useTemplate_FillFloor_TileLight():Boolean{
if (m_layerGround != null){
m_layerGround.fill(Sprites.SPR_ID_FLOOR_TILE_LIGHT);
return (true);
};
return (false);
}
public function set parent(_arg1:LevelsProxy):void{
m_pParent = _arg1;
}
public function set uidSharedLevel(_arg1:String):void{
m_strUIDSharedLevel = _arg1;
}
public function isThere(_arg1:int, _arg2:IntPoint):Boolean{
var _local3:LayerProxy;
_local3 = getLayerByID(_arg1);
if (_local3 != null){
return (_local3.isThere(_arg2));
};
return (false);
}
public function eraseValue(_arg1:int, _arg2:IntPoint, _arg3:int):void{
}
public function set levelName(_arg1:String):void{
m_strName = _arg1;
}
public function get turnsNeedToWin():int{
return (m_nTurnsNeedToWin);
}
public function set howMatchLevelsOpenWhenWalkThrough(_arg1:int):void{
m_nHowMatchLevelsOpenWhenWalkThrough = _arg1;
}
public function set playState(_arg1:int):void{
m_nPlayState = _arg1;
}
public function useTemplate_WallBox():Boolean{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:IntPoint;
if (m_layerLabyrinth != null){
_local1 = m_layerLabyrinth.width;
_local2 = m_layerLabyrinth.height;
m_layerLabyrinth.lock();
_local4 = new IntPoint(_local1, 0);
while ((_local4.m_iX = (_local4.m_iX - 2)) >= 0) {
m_layerLabyrinth.setValue(_local4, CommonFunc.INT_UNDEF);
_local4.m_iY++;
_local4.m_iX--;
m_layerLabyrinth.setValue(_local4, CommonFunc.INT_UNDEF);
_local4.m_iY++;
_local4.m_iX++;
m_layerLabyrinth.setValue(_local4, CommonFunc.INT_UNDEF);
_local4.m_iY = (_local4.m_iY - 2);
};
_local4.m_iX = (_local1 - 1);
_local4.m_iY = 1;
m_layerLabyrinth.setValue(_local4, CommonFunc.INT_UNDEF);
_local4 = new IntPoint(_local1, (_local2 - 3));
while ((_local4.m_iX = (_local4.m_iX - 2)) >= 0) {
m_layerLabyrinth.setValue(_local4, CommonFunc.INT_UNDEF);
_local4.m_iY++;
_local4.m_iX--;
m_layerLabyrinth.setValue(_local4, CommonFunc.INT_UNDEF);
_local4.m_iY++;
_local4.m_iX++;
m_layerLabyrinth.setValue(_local4, CommonFunc.INT_UNDEF);
_local4.m_iY = (_local4.m_iY - 2);
};
_local4.m_iX = (_local1 - 1);
_local4.m_iY = (_local2 - 2);
m_layerLabyrinth.setValue(_local4, CommonFunc.INT_UNDEF);
_local4 = new IntPoint(0, (_local2 - 2));
while ((_local4.m_iY = (_local4.m_iY - 2)) >= 3) {
m_layerLabyrinth.setValue(_local4, CommonFunc.INT_UNDEF);
_local4.m_iX++;
_local4.m_iY--;
m_layerLabyrinth.setValue(_local4, CommonFunc.INT_UNDEF);
_local4.m_iX++;
_local4.m_iY++;
m_layerLabyrinth.setValue(_local4, CommonFunc.INT_UNDEF);
_local4.m_iX = (_local4.m_iX - 2);
};
_local4 = new IntPoint((_local1 - 3), (_local2 - 2));
while ((_local4.m_iY = (_local4.m_iY - 2)) >= 3) {
m_layerLabyrinth.setValue(_local4, CommonFunc.INT_UNDEF);
_local4.m_iX++;
_local4.m_iY--;
m_layerLabyrinth.setValue(_local4, CommonFunc.INT_UNDEF);
_local4.m_iX++;
_local4.m_iY++;
m_layerLabyrinth.setValue(_local4, CommonFunc.INT_UNDEF);
_local4.m_iX = (_local4.m_iX - 2);
};
m_layerLabyrinth.unlock();
return (true);
};
return (false);
}
public function isLock():Boolean{
return ((m_nLock > 0));
}
public function set width(_arg1:int):void{
m_nWidth = _arg1;
}
public function listenFinishPlay():void{
restoreStates();
}
public function useTemplate_TopCenterExit():Boolean{
var _local1:IntPoint;
if (m_layerLabyrinth != null){
m_layerLabyrinth.lock();
_local1 = m_layerLabyrinth.topCenter;
m_layerLabyrinth.setValue(_local1, CommonFunc.INT_UNDEF);
_local1.m_iY++;
_local1.m_iX--;
m_layerLabyrinth.setValue(_local1, CommonFunc.INT_UNDEF);
_local1.m_iX = (_local1.m_iX + 2);
m_layerLabyrinth.setValue(_local1, CommonFunc.INT_UNDEF);
_local1.m_iY++;
_local1.m_iX--;
m_layerLabyrinth.setValue(_local1, Sprites.SPR_ID_NULL);
_local1.m_iY--;
m_layerLabyrinth.setValue(_local1, Sprites.SPR_ID_LABYRINTH_STAIRWAY_UP);
m_layerLabyrinth.unlock();
return (true);
};
return (false);
}
public function useTemplate_Empty():Boolean{
var _local1:LayerProxy;
var _local2:int;
_local2 = m_arLayers.length;
while (--_local2 >= 0) {
_local1 = m_arLayers[_local2];
if (_local1 != null){
_local1.clear();
};
};
return (true);
}
public function useTemplate_FillFloor_TileDark():Boolean{
if (m_layerGround != null){
m_layerGround.fill(Sprites.SPR_ID_FLOOR_TILE_DARK);
return (true);
};
return (false);
}
public function get toXML():XML{
var _local1:XML;
var _local2:LayerProxy;
var _local3:int;
var _local4:int;
_local1 = new XML((((("<" + XML_NAME) + "></") + XML_NAME) + ">"));
_local1.@["id"] = this.m_iID;
_local1.@["width"] = m_nWidth;
_local1.@["height"] = m_nHeight;
_local3 = m_arLayers.length;
while (_local4 < _local3) {
_local2 = m_arLayers[_local4];
if (_local2 != null){
_local1.appendChild(_local2.toXML);
};
_local4++;
};
return (_local1);
}
public function set uid(_arg1:String):void{
m_strUID = _arg1;
}
public function get uidSharedLevel():String{
return (m_strUIDSharedLevel);
}
public function get howMatchLevelsOpenWhenWalkThrough():int{
return (m_nHowMatchLevelsOpenWhenWalkThrough);
}
public function listenStartPlay():void{
restoreStates();
saveStates();
}
public function get inGame():Boolean{
if (parent != null){
return (parent.inGame);
};
return (false);
}
public function get parent():LevelsProxy{
return (m_pParent);
}
public function getValue(_arg1:int, _arg2:IntPoint):int{
var _local3:LayerProxy;
_local3 = getLayerByID(_arg1);
if (_local3 != null){
return (_local3.getValue(_arg2));
};
return (CommonFunc.INT_UNDEF);
}
public function get playState():int{
return (m_nPlayState);
}
public function set rate(_arg1:Number):void{
m_nRate = _arg1;
}
public function getLayerTypeByID(_arg1:int):int{
var _local2:LayerProxy;
_local2 = getLayerByID(_arg1);
if (_local2 != null){
return (_local2.type);
};
return (CommonFunc.INT_UNDEF);
}
public function get width():int{
return (m_nWidth);
}
public function get toXMLString():String{
return (toXML.toXMLString());
}
public function useTemplate_FillFloor_Ground():Boolean{
if (m_layerGround != null){
m_layerGround.fill(Sprites.SPR_ID_FLOOR_GROUND_DARK, LayerMatrixProxy.FILL_STYLE_DIAGONAL, Sprites.SPR_ID_FLOOR_GROUND_LIGHT);
};
return (false);
}
public function saveStates():Boolean{
if (m_layerCharacters != null){
m_layerCharacters.saveStates();
};
if (m_layerObjects != null){
m_layerObjects.saveStates();
};
if (m_layerGround_Traps != null){
m_layerGround_Traps.saveStates();
};
if (m_pInfoItems != null){
m_pInfoItems.saveStates();
};
if (m_pSwimItems != null){
m_pSwimItems.saveStates();
};
return (true);
}
public function get rate():Number{
return (m_nRate);
}
public function getLabyrinthValue(_arg1:int, _arg2:int):int{
return (m_layerLabyrinth.getValue_(_arg1, _arg2));
}
public function set turnsNeedToWin(_arg1:int):void{
m_nTurnsNeedToWin = _arg1;
}
public function getLayerByID(_arg1:int):LayerProxy{
var _local2:LayerProxy;
for each (_local2 in m_arLayers) {
if (((!((_local2 == null))) && ((_local2.id == _arg1)))){
return (_local2);
};
};
return (null);
}
public function clearLayers():void{
m_arLayers = new Array();
}
public function getGroundValue(_arg1:int, _arg2:int):int{
return (m_layerGround.getValue_(_arg1, _arg2));
}
public function get hero():LayerElementProxy_Character_Hero{
if (m_layerCharacters != null){
return (m_layerCharacters.hero);
};
return (null);
}
public function select(_arg1:int):void{
}
public static function parseXMLString(_arg1:String, _arg2:LevelsProxy):LevelProxy{
var _local3:XML;
if (_arg1 != null){
_local3 = new XML(_arg1);
return (parseXML(_local3, _arg2));
};
return (null);
}
public static function parseXML(_arg1:XML, _arg2:LevelsProxy=null):LevelProxy{
var _local3:LevelProxy;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:LayerProxy;
var _local8:XML;
var _local9:XMLList;
var _local10:int;
var _local11:int;
if (_arg1 != null){
_local4 = _arg1.@["id"];
_local5 = _arg1.@["width"];
_local6 = _arg1.@["height"];
_local3 = new LevelProxy(_local4, _arg2);
_local3.width = _local5;
_local3.height = _local6;
_local9 = _arg1.child(LayerProxy.XML_NAME);
_local10 = _local9.length();
_local11 = 0;
while (_local11 < _local10) {
_local8 = _local9[_local11];
_local7 = LayerProxy.parseXML(_local8, _local3);
if (_local7 != null){
_local7.inCreate();
_local3.addLayer(_local7);
};
_local11++;
};
for each (_local7 in _local3.m_arLayers) {
if (_local7 != null){
_local7.outCreate();
};
};
return (_local3);
};
return (null);
}
public static function parseXMLStringCompressed(_arg1:String, _arg2:LevelsProxy):LevelProxy{
if (_arg1 != null){
_arg1 = CommonFunc.uncompressString(_arg1);
return (parseXMLString(_arg1, _arg2));
};
return (null);
}
}
}//package game.model
Section 136
//LevelScoreProxy (game.model.LevelScoreProxy)
package game.model {
public class LevelScoreProxy {
public var m_nTurnsPassForLevel:int;
public var m_nScoreForLevel:int;
public var m_nTimePassForLevel:int;
public var m_strGrade:String;
public function LevelScoreProxy(_arg1:int, _arg2:int, _arg3:int, _arg4:String){
m_nScoreForLevel = _arg1;
m_nTimePassForLevel = _arg2;
m_nTurnsPassForLevel = _arg3;
m_strGrade = _arg4;
}
}
}//package game.model
Section 137
//LevelsProxy (game.model.LevelsProxy)
package game.model {
import flash.utils.*;
import org.puremvc.as3.interfaces.*;
import com.*;
import main.*;
import classes.*;
import org.puremvc.as3.patterns.proxy.*;
public class LevelsProxy extends Proxy implements IProxy {
private var m_bCreateNow:Boolean;
var m_arLevels:Array;
private var m_bUserEdition:Boolean;
private var m_bInGame:Boolean;// = false
var m_pSelectItem:LevelProxy;
public static const NAME_USER_EDITION:String = "LevelsProxy_UserEdition";
public static const NAME:String = "LevelsProxy";
public static const XML_NAME:String = "levels";
public static const m_nMaxLevels:int = 32;
public static const LEVELS_COUNT:int = 1;
private static var s_timeLast:int;
private static var m_uniqID:uint = 0;
public function LevelsProxy(_arg1:Boolean=false){
var _local2:String;
m_arLevels = new Array();
m_bInGame = false;
m_bUserEdition = _arg1;
if (_arg1){
_local2 = NAME_USER_EDITION;
} else {
_local2 = NAME;
};
super(_local2, Number(0));
m_bInGame = false;
}
private function restorePlayStates():Boolean{
var _local1:LevelProxy;
var _local2:Array;
var _local3:int;
var _local4:int;
var _local5:Boolean;
var _local6:int;
_local2 = (Global._game_stored_data.data.m_arLevelsPlayStates as Array);
if (_local2 != null){
_local3 = _local2.length;
_local4 = length;
if (_local4 == _local3){
_local6 = _local4;
while (--_local6 >= 0) {
_local1 = getItem(_local6);
if (_local1 != null){
if (_local2[_local6]){
_local1.playState = LevelProxy.PLAY_STATE_CAN_PLAY;
} else {
_local1.playState = LevelProxy.PLAY_STATE_LOCK;
};
};
};
return (true);
};
};
return (false);
}
public function getItem(_arg1:int):LevelProxy{
return (m_arLevels[_arg1]);
}
public function getItemPos(_arg1:LevelProxy):int{
var _local2:int;
if (_arg1 != null){
_local2 = m_arLevels.length;
while (--_local2 >= 0) {
if (m_arLevels[_local2] == _arg1){
return (_local2);
};
};
};
return (CommonFunc.INT_UNDEF);
}
public function get toXML():XML{
var _local1:XML;
var _local2:LevelProxy;
var _local3:int;
var _local4:int;
s_timeLast = getTimer();
_local1 = new XML((("<" + XML_NAME) + "/>"));
_local3 = m_arLevels.length;
_local4 = 0;
while (_local4 < _local3) {
s_timeLast = getTimer();
_local2 = m_arLevels[_local4];
if (_local2 != null){
_local1.appendChild(_local2.toXML);
};
_local4++;
};
return (_local1);
}
public function insertItemBefore(_arg1:LevelProxy):Boolean{
var _local2:LevelProxy;
var _local3:int;
var _local4:int;
if ((((m_arLevels.length < m_nMaxLevels)) || ((m_nMaxLevels == CommonFunc.INT_UNDEF)))){
_local2 = new LevelProxy(genUniqID(), this);
_local2.init();
initSpectial(_local2);
_local3 = -1;
if (_arg1 != null){
_local3 = getItemPos(_arg1);
};
_local4 = (m_arLevels.length - 1);
if ((((_local3 > _local4)) || ((_local3 == CommonFunc.INT_UNDEF)))){
m_arLevels.push(_local2);
} else {
m_arLevels.splice(_local3, 0, _local2);
};
sendNotification(ApplicationFacade.LEVEL_ADD, _local2);
return (true);
};
return (false);
}
public function get lockedLevels():int{
var _local1:int;
var _local2:LevelProxy;
_local1 = 0;
for each (_local2 in m_arLevels) {
if (_local2 != null){
if (_local2.playState == LevelProxy.PLAY_STATE_LOCK){
_local1++;
};
};
};
return (_local1);
}
public function get toXMLStringCompressed():String{
var _local1:String;
var _local2:String;
_local1 = toXMLString;
s_timeLast = getTimer();
_local2 = CommonFunc.compressString(_local1);
s_timeLast = getTimer();
return (_local2);
}
public function get inGame():Boolean{
return (m_bInGame);
}
public function listenHeroWin(_arg1:LevelProxy):void{
var _local2:int;
var _local3:int;
var _local4:LevelProxy;
var _local5:int;
if (_arg1 != null){
_arg1.playState = LevelProxy.PLAY_STATE_WIN;
_local2 = m_arLevels.indexOf(_arg1);
if (_local2 >= 0){
_local3 = (_arg1.howMatchLevelsOpenWhenWalkThrough + ++_local2);
while (_local2 <= _local3) {
_local4 = getItem(_local2);
if (_local4 != null){
_local5 = _local4.playState;
if (((!((_local5 == LevelProxy.PLAY_STATE_CAN_PLAY))) && (!((_local5 == LevelProxy.PLAY_STATE_WIN))))){
_local4.playState = LevelProxy.PLAY_STATE_CAN_PLAY;
};
};
};
};
savePlayStates();
};
}
public function removeItem(_arg1:LevelProxy):Boolean{
var _local2:int;
_local2 = getItemPos(_arg1);
if (_local2 != CommonFunc.INT_UNDEF){
m_arLevels.splice(_local2, 1);
sendNotification(ApplicationFacade.LEVEL_REMOVE, _arg1);
return (true);
};
return (false);
}
private function savePlayStates():Boolean{
var _local1:int;
var _local2:Array;
var _local3:LevelProxy;
var _local4:int;
_local1 = length;
_local2 = new Array(_local1);
while (--_local1 >= 0) {
_local3 = getItem(_local1);
if (_local3 != null){
_local4 = _local3.playState;
switch (_local4){
case LevelProxy.PLAY_STATE_CAN_PLAY:
case LevelProxy.PLAY_STATE_WIN:
_local2[_local1] = true;
break;
default:
_local2[_local1] = false;
break;
};
};
};
Global._game_stored_data.data.m_arLevelsPlayStates = _local2;
return (true);
}
private function initSpectial(_arg1:LevelProxy):void{
if (_arg1 != null){
_arg1.useTemplate_WallBox();
_arg1.useTemplate_FillFloor_Ground_Rand();
_arg1.useTemplate_TopCenterExit();
};
}
private function genUniqID():uint{
m_uniqID++;
return (m_uniqID);
}
public function pushItem(_arg1:LevelProxy):void{
if (m_arLevels.indexOf(_arg1) < 0){
m_arLevels.push(_arg1);
if (_arg1 != null){
_arg1.parent = this;
};
};
}
public function createOff():void{
m_bCreateNow = false;
}
public function initDef(_arg1:Boolean):void{
var _local2:LevelProxy;
var _local3:int;
var _local4:int;
_local3 = LEVELS_COUNT;
_local4 = 0;
while (_local4 < _local3) {
_local2 = new LevelProxy(genUniqID(), this);
_local2.init(LevelProxy.LEVEL_WIDTH, LevelProxy.LEVEL_HEIGHT, LevelProxy.INIT_STYLE_EMPTY);
if (_arg1){
initSpectial(_local2);
};
m_arLevels.push(_local2);
_local4++;
};
select = getItem(0);
}
public function get notWinLevels():int{
var _local1:int;
var _local2:LevelProxy;
_local1 = 0;
for each (_local2 in m_arLevels) {
if (_local2 != null){
if (_local2.playState != LevelProxy.PLAY_STATE_WIN){
_local1++;
};
};
};
return (_local1);
}
public function getItemByID(_arg1:int):LevelProxy{
var _local2:LevelProxy;
for each (_local2 in m_arLevels) {
if (((!((_local2 == null))) && ((_local2.id == _arg1)))){
return (_local2);
};
};
return (null);
}
public function get toXMLString():String{
return (toXML.toXMLString());
}
public function get selectedElement():LevelProxy{
return (m_pSelectItem);
}
public function getItemN(_arg1:LevelProxy):int{
return (m_arLevels.indexOf(_arg1));
}
public function get length():int{
return (m_arLevels.length);
}
public function addItem(_arg1:LevelProxy=null):Boolean{
if (_arg1 == null){
_arg1 = new LevelProxy(genUniqID(), this);
};
m_arLevels.push(_arg1);
sendNotification(ApplicationFacade.LEVEL_ADD, _arg1);
return (true);
}
public function set inGame(_arg1:Boolean):void{
m_bInGame = _arg1;
}
public function get userEdition():Boolean{
return (m_bUserEdition);
}
public function setInText(_arg1:String):Boolean{
var _local2:XML;
_local2 = new XML(_arg1);
return (true);
}
public function set select(_arg1:LevelProxy):void{
if (m_pSelectItem != null){
sendNotification(ApplicationFacade.LEVEL_UNSELECTED, m_pSelectItem);
};
if (_arg1 != null){
};
m_pSelectItem = _arg1;
sendNotification(ApplicationFacade.LEVEL_SELECTED, _arg1);
}
private function setDefPlayStates():Boolean{
var _local1:LevelProxy;
_local1 = select;
setPlayStateForAll(LevelProxy.PLAY_STATE_LOCK);
if (_local1 != null){
_local1.playState = LevelProxy.PLAY_STATE_CAN_PLAY;
};
return (true);
}
public function setPlayStateForAll(_arg1:int):void{
var _local2:LevelProxy;
for each (_local2 in m_arLevels) {
if (_local2 != null){
_local2.playState = _arg1;
};
};
}
public function createOn():void{
m_bCreateNow = true;
}
public function get select():LevelProxy{
return (m_pSelectItem);
}
public static function parseXML(_arg1:XML, _arg2:LevelsProxy):LevelsProxy{
var _local3:LevelsProxy;
var _local4:XML;
var _local5:XMLList;
var _local6:int;
var _local7:LevelProxy;
var _local8:int;
if (_arg1 != null){
if (_arg2.getProxyName() == LevelsProxy.NAME){
_local3 = new (LevelsProxy);
} else {
_local3 = new LevelsProxy(true);
};
_local3.createOn();
_local5 = _arg1.child(LevelProxy.XML_NAME);
_local6 = _local5.length();
_local8 = 0;
while (_local8 < _local6) {
_local4 = _local5[_local8];
_local7 = LevelProxy.parseXML(_local4, _local3);
if (_local7 != null){
_local3.pushItem(_local7);
};
_local8++;
};
_local3.createOff();
return (_local3);
};
return (null);
}
public static function getDefCompanyLevels():LevelsProxy{
var _local1:LevelProxy;
var _local2:LevelsProxy;
var _local3:int;
var _local4:DefCompanyLevelsStruct;
if (DefCompanyLevelsSettings.USE_SOLID_LEVELS){
_local2 = parseXMLStringCompressed(DefCompanyLevelsSettings.SOLID_LEVELS, new LevelsProxy(false));
} else {
_local2 = new (LevelsProxy);
_local3 = 1;
for each (_local4 in DefCompanyLevelsSettings.STRUCTED_LEVELS) {
if (_local4 != null){
_local1 = LevelProxy.parseXMLStringCompressed(_local4.m_strStruct, _local2);
if (_local1 != null){
var _temp1 = _local3;
_local3 = (_local3 + 1);
_local1.id = _temp1;
_local1.levelName = _local4.m_strName;
_local1.timeNeedToWin = _local4.m_nNeedTime;
_local1.turnsNeedToWin = _local4.m_nNeedTurns;
_local1.howMatchLevelsOpenWhenWalkThrough = _local4.m_nHowMatchLevelsWillOpenWhenWalkThrough;
_local2.addItem(_local1);
};
};
};
};
_local1 = _local2.getItem(0);
_local2.select = _local1;
if (!_local2.restorePlayStates()){
_local2.setDefPlayStates();
};
return (_local2);
}
public static function parseXMLString(_arg1:String, _arg2:LevelsProxy):LevelsProxy{
var _local3:XML;
if (_arg1 != null){
_local3 = new XML(_arg1);
return (parseXML(_local3, _arg2));
};
return (null);
}
public static function parseXMLStringCompressed(_arg1:String, _arg2:LevelsProxy):LevelsProxy{
if (_arg1 != null){
_arg1 = CommonFunc.uncompressString(_arg1);
return (parseXMLString(_arg1, _arg2));
};
return (null);
}
}
}//package game.model
Section 138
//ObjectsLayerProxy (game.model.ObjectsLayerProxy)
package game.model {
import game.model.Elements.*;
public class ObjectsLayerProxy extends LayerListProxy {
public static const NAME:String = "ObjectsLayerProxy";
public function ObjectsLayerProxy(_arg1:int=-1, _arg2:LevelProxy=null){
super(_arg1, _arg2);
type = LayerProxy.LAYER_TYPE_OBJECTS;
}
override public function isCanBeThere(_arg1:LayerElementProxy, _arg2:int, _arg3:int):Boolean{
var _local4:CharactersProxy;
if (!super.isCanBeThere(_arg1, _arg2, _arg3)){
return (false);
};
if (_arg1 != null){
_local4 = characters;
if (((!((_local4 == null))) && (_local4.isThereXY(_arg2, _arg3)))){
return (false);
};
};
return (true);
}
}
}//package game.model
Section 139
//PlayerProxy (game.model.PlayerProxy)
package game.model {
import org.puremvc.as3.interfaces.*;
import com.*;
import org.puremvc.as3.patterns.proxy.*;
public class PlayerProxy extends Proxy implements IProxy {
private var m_nTimePassForLevel:int;
private var m_bPlaySingleLevel:Boolean;
private var m_arLevelsScore:Array;
private var m_nScoreForLevel:int;
private var m_arLevelsPass:Array;
private var m_nTurnsPassForLevel:int;
private var m_strUIDSharedLevel:String;
public static const NAME:String = "PlayerProxy";
public function PlayerProxy(){
m_arLevelsScore = new Array();
m_arLevelsPass = new Array();
super(NAME, Number(0));
}
private function calcGrade(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):String{
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:int;
_local5 = (((2 * _arg1) / _arg3) - 1);
_local6 = (((2 * _arg2) / _arg4) - 1);
if (_local5 < 0){
_local5 = 0;
} else {
if (_local5 > 1){
_local5 = 1;
};
};
if (_local6 < 0){
_local6 = 0;
} else {
if (_local6 > 1){
_local6 = 1;
};
};
_local7 = (_local5 + _local6);
if (_local7 < 0){
_local7 = 0;
} else {
if (_local7 > 1){
_local7 = 1;
};
};
_local8 = (_local7 * 100);
if (_local8 > 90){
return ("A");
};
if (_local8 > 65){
return ("B");
};
if (_local8 > 35){
return ("C");
};
if (_local8 > 10){
return ("D");
};
return ("E");
}
public function getTimePassForLevels():int{
var _local1:int;
var _local2:int;
var _local3:LevelScoreProxy;
_local1 = 0;
_local2 = m_arLevelsScore.length;
while (--_local2 >= 0) {
_local3 = m_arLevelsScore[_local2];
if (_local3 != null){
_local1 = (_local1 + _local3.m_nTimePassForLevel);
};
};
return (_local1);
}
public function getTurnsPassForLevels():int{
var _local1:int;
var _local2:int;
var _local3:LevelScoreProxy;
_local1 = 0;
_local2 = m_arLevelsScore.length;
while (--_local2 >= 0) {
_local3 = m_arLevelsScore[_local2];
if (_local3 != null){
_local1 = (_local1 + _local3.m_nTurnsPassForLevel);
};
};
return (_local1);
}
public function listenStartPlayLevel(_arg1:LevelProxy):void{
m_nScoreForLevel = 0;
m_nTimePassForLevel = 0;
m_nTurnsPassForLevel = 0;
m_arLevelsScore = new Array();
m_bPlaySingleLevel = true;
uidSharedLevel = _arg1.uidSharedLevel;
}
public function getScoreForLevels():int{
var _local1:int;
var _local2:int;
var _local3:LevelScoreProxy;
_local1 = 0;
_local2 = m_arLevelsScore.length;
while (--_local2 >= 0) {
_local3 = m_arLevelsScore[_local2];
if (_local3 != null){
_local1 = (_local1 + _local3.m_nScoreForLevel);
};
};
return (_local1);
}
public function isLevelPass(_arg1:int):Boolean{
if (m_arLevelsPass != null){
if ((((_arg1 >= 0)) && ((_arg1 < m_arLevelsPass.length)))){
return (m_arLevelsPass[_arg1]);
};
};
return (false);
}
public function get uidSharedLevel():String{
return (m_strUIDSharedLevel);
}
public function getScoreForLevel(_arg1:int=-1):int{
var _local2:LevelScoreProxy;
if (_arg1 == CommonFunc.INT_UNDEF){
return (m_nScoreForLevel);
};
if ((((_arg1 >= 0)) && ((_arg1 < m_arLevelsScore.length)))){
_local2 = m_arLevelsScore[_arg1];
if (_local2 != null){
return (_local2.m_nScoreForLevel);
};
};
return (0);
}
public function isPlaySharedLevel():Boolean{
return (!((m_strUIDSharedLevel == null)));
}
public function get playSingleLevel():Boolean{
return (m_bPlaySingleLevel);
}
public function getTimePassForLevel(_arg1:int=-1):int{
var _local2:LevelScoreProxy;
if (_arg1 == CommonFunc.INT_UNDEF){
return (m_nTimePassForLevel);
};
if ((((_arg1 >= 0)) && ((_arg1 < m_arLevelsScore.length)))){
_local2 = m_arLevelsScore[_arg1];
if (_local2 != null){
return (_local2.m_nTimePassForLevel);
};
};
return (0);
}
public function listenQuitGame():void{
}
public function set uidSharedLevel(_arg1:String):void{
m_strUIDSharedLevel = _arg1;
}
public function listenFinishLevel(_arg1:int, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number):void{
var _local6:Number;
var _local7:String;
var _local8:LevelScoreProxy;
trace("X");
trace("PlayerProxy public function listenFinishLevel(nLevel:int, nTimeToWin:Number, nTurnsToWin:Number, nTime:Number, nTurns:Number):void");
trace(("nLevel=" + _arg1));
trace(("nTimeToWin=" + _arg2));
trace(("nTurnsToWin=" + _arg3));
trace(("nTime=" + _arg4));
trace(("nTurns=" + _arg5));
_local6 = ((_arg2 / _arg4) + (_arg3 / _arg5));
m_nScoreForLevel = (100 * _local6);
m_nTimePassForLevel = _arg4;
m_nTurnsPassForLevel = _arg5;
_local7 = calcGrade(_arg2, _arg3, _arg4, _arg5);
_local8 = new LevelScoreProxy(m_nScoreForLevel, m_nTimePassForLevel, m_nTurnsPassForLevel, _local7);
if (((((!((m_arLevelsScore == null))) && ((_arg1 >= 0)))) && ((_arg1 < m_arLevelsScore.length)))){
m_arLevelsScore[_arg1] = _local8;
};
}
public function getTurnsPassForLevel(_arg1:int=-1):int{
var _local2:LevelScoreProxy;
if (_arg1 == CommonFunc.INT_UNDEF){
return (m_nTurnsPassForLevel);
};
if ((((_arg1 >= 0)) && ((_arg1 < m_arLevelsScore.length)))){
_local2 = m_arLevelsScore[_arg1];
if (_local2 != null){
return (_local2.m_nTurnsPassForLevel);
};
};
return (0);
}
public function getGradeForLevel(_arg1:int=-1):String{
var _local2:LevelScoreProxy;
if (_arg1 == CommonFunc.INT_UNDEF){
return ("");
};
if ((((_arg1 >= 0)) && ((_arg1 < m_arLevelsScore.length)))){
_local2 = m_arLevelsScore[_arg1];
if (_local2 != null){
return (_local2.m_strGrade);
};
};
return ("");
}
public function listenStartPlayLevels(_arg1:LevelsProxy):void{
var _local2:int;
m_nScoreForLevel = 0;
m_nTimePassForLevel = 0;
m_nTurnsPassForLevel = 0;
m_bPlaySingleLevel = false;
if (_arg1 != null){
_local2 = _arg1.length;
m_arLevelsScore = new Array(_local2);
} else {
m_arLevelsScore = new Array();
};
}
}
}//package game.model
Section 140
//SwimLayerProxy (game.model.SwimLayerProxy)
package game.model {
import com.*;
import game.model.Elements.*;
import game.view.*;
public class SwimLayerProxy extends LayerListProxy {
public static const NAME:String = "SwimLayerProxy";
public function SwimLayerProxy(_arg1:int=-1, _arg2:LevelProxy=null){
super(_arg1, _arg2);
type = LayerProxy.LAYER_TYPE_SWIM;
}
override public function listenElementMoveOn(_arg1:LayerElementProxy, _arg2:Boolean=true):void{
var _local3:int;
var _local4:int;
var _local5:LayerElementProxy;
if (_arg2){
_local3 = _arg1.x;
_local4 = _arg1.y;
} else {
_local3 = _arg1.oldX;
_local4 = _arg1.oldY;
};
if (((!((_local3 == CommonFunc.INT_UNDEF))) && (!((_local4 == CommonFunc.INT_UNDEF))))){
_local5 = getElementAt(_local3, _local4);
if (_local5 != null){
switch (_local5.type){
case Sprites.SPR_ID_RAFT:
if (_arg1.mass > 0){
_local5.removeElementOn(_arg1);
};
break;
};
};
};
super.listenElementMoveOn(_arg1);
}
override protected function createElement(_arg1:int):LayerElementProxy{
switch (_arg1){
case Sprites.SPR_ID_RAFT:
return (new LayerElementProxy_Raft(_arg1, this));
default:
return (super.createElement(_arg1));
};
}
override public function listenElementTrapOn(_arg1:LayerElementProxy):void{
var _local2:int;
var _local3:int;
var _local4:LayerElementProxy;
if (_arg1 != null){
_local2 = _arg1.x;
_local3 = _arg1.y;
_local4 = getElementAt(_local2, _local3);
if (_local4 != null){
switch (_local4.type){
case Sprites.SPR_ID_RAFT:
if (_arg1.mass > 0){
_local4.putElementOn(_arg1);
};
break;
};
};
};
super.listenElementTrapOn(_arg1);
}
}
}//package game.model
Section 141
//TrapsProxy (game.model.TrapsProxy)
package game.model {
import com.*;
import game.model.Elements.*;
import game.view.*;
public class TrapsProxy extends LayerListProxy {
public static const NAME:String = "TrapsProxy";
public function TrapsProxy(_arg1:int=-1, _arg2:LevelProxy=null){
super(_arg1, _arg2);
type = LayerProxy.LAYER_TYPE_TRAPS;
}
override public function listenElementMoveOn(_arg1:LayerElementProxy, _arg2:Boolean=true):void{
var _local3:int;
var _local4:int;
var _local5:LayerElementProxy;
var _local6:LayerElementProxy_Key;
if (_arg2){
_local3 = _arg1.x;
_local4 = _arg1.y;
} else {
_local3 = _arg1.oldX;
_local4 = _arg1.oldY;
};
if (((!((_local3 == CommonFunc.INT_UNDEF))) && (!((_local4 == CommonFunc.INT_UNDEF))))){
_local5 = getElementAt(_local3, _local4);
if (_local5 != null){
switch (_local5.type){
case Sprites.SPR_ID_TRAP_KEY_BLUE:
case Sprites.SPR_ID_TRAP_KEY_GREEN:
case Sprites.SPR_ID_TRAP_KEY_RED:
case Sprites.SPR_ID_TRAP_SHARP_BLUE:
case Sprites.SPR_ID_TRAP_SHARP_GREEN:
case Sprites.SPR_ID_TRAP_SHARP_RED:
if (_arg1.mass > 0){
_local5.removeElementOn(_arg1);
};
break;
};
};
};
super.listenElementMoveOn(_arg1);
}
private function changeStateElementsByType(_arg1:int, _arg2:int):int{
var _local3:int;
var _local4:LayerElementProxy;
_local3 = 0;
for each (_local4 in m_arMatrix) {
if (((!((_local4 == null))) && ((_local4.type == _arg1)))){
_local4.state = _arg2;
_local3++;
};
};
return (_local3);
}
override public function listenElementPutOnElementCommand(_arg1:LayerElementProxy, _arg2:LayerElementProxy, _arg3:Boolean):void{
super.listenElementPutOnElementCommand(_arg1, _arg2, _arg3);
if (((!((_arg2 == null))) && (!((_arg1 == null))))){
switch (_arg1.type){
case Sprites.SPR_ID_TRAP_SHARP_BLUE:
if (_arg3){
_arg1.state = LayerElementProxy_Trap.STATE_TRAP_OFF;
} else {
setOnIfAllKeyOff(Sprites.SPR_ID_TRAP_KEY_BLUE, _arg1);
};
break;
case Sprites.SPR_ID_TRAP_SHARP_GREEN:
if (_arg3){
_arg1.state = LayerElementProxy_Trap.STATE_TRAP_OFF;
} else {
setOnIfAllKeyOff(Sprites.SPR_ID_TRAP_KEY_GREEN, _arg1);
};
break;
case Sprites.SPR_ID_TRAP_SHARP_RED:
if (_arg3){
_arg1.state = LayerElementProxy_Trap.STATE_TRAP_OFF;
} else {
setOnIfAllKeyOff(Sprites.SPR_ID_TRAP_KEY_RED, _arg1);
};
break;
default:
if (_arg3){
_arg1.state = LayerElementProxy_Key.STATE_KEY_ON;
} else {
if (_arg1.countElementsOn <= 0){
_arg1.state = LayerElementProxy_Key.STATE_KEY_OFF;
};
};
break;
};
};
}
private function checkKeyType(_arg1:int, _arg2:int):void{
if (!isElementByTypeInState(_arg1, LayerElementProxy_Key.STATE_KEY_ON)){
changeStateElementsByType(_arg2, LayerElementProxy_Trap.STATE_TRAP_ON);
};
}
override public function listenElementChangeState(_arg1:LayerElementProxy):void{
if (_arg1 != null){
switch (_arg1.type){
case Sprites.SPR_ID_TRAP_KEY_BLUE:
switch (_arg1.state){
case LayerElementProxy_Key.STATE_KEY_ON:
changeStateElementsByType(Sprites.SPR_ID_TRAP_SHARP_BLUE, LayerElementProxy_Trap.STATE_TRAP_OFF);
break;
case LayerElementProxy_Key.STATE_KEY_OFF:
if (!isElementByTypeInState(Sprites.SPR_ID_TRAP_KEY_BLUE, LayerElementProxy_Key.STATE_KEY_ON)){
changeStateElementsByType(Sprites.SPR_ID_TRAP_SHARP_BLUE, LayerElementProxy_Trap.STATE_TRAP_ON);
};
break;
};
break;
case Sprites.SPR_ID_TRAP_KEY_GREEN:
switch (_arg1.state){
case LayerElementProxy_Key.STATE_KEY_ON:
changeStateElementsByType(Sprites.SPR_ID_TRAP_SHARP_GREEN, LayerElementProxy_Trap.STATE_TRAP_OFF);
break;
case LayerElementProxy_Key.STATE_KEY_OFF:
if (!isElementByTypeInState(Sprites.SPR_ID_TRAP_KEY_GREEN, LayerElementProxy_Key.STATE_KEY_ON)){
changeStateElementsByType(Sprites.SPR_ID_TRAP_SHARP_GREEN, LayerElementProxy_Trap.STATE_TRAP_ON);
};
break;
};
break;
case Sprites.SPR_ID_TRAP_KEY_RED:
switch (_arg1.state){
case LayerElementProxy_Key.STATE_KEY_ON:
changeStateElementsByType(Sprites.SPR_ID_TRAP_SHARP_RED, LayerElementProxy_Trap.STATE_TRAP_OFF);
break;
case LayerElementProxy_Key.STATE_KEY_OFF:
if (!isElementByTypeInState(Sprites.SPR_ID_TRAP_KEY_RED, LayerElementProxy_Key.STATE_KEY_ON)){
changeStateElementsByType(Sprites.SPR_ID_TRAP_SHARP_RED, LayerElementProxy_Trap.STATE_TRAP_ON);
};
break;
};
break;
};
};
}
private function setOnIfAllKeyOff(_arg1:int, _arg2:LayerElementProxy):void{
if (_arg2 != null){
if (_arg2.countElementsOn <= 0){
if (!isElementByTypeInState(_arg1, LayerElementProxy_Key.STATE_KEY_ON)){
_arg2.state = LayerElementProxy_Trap.STATE_TRAP_ON;
};
};
};
}
override protected function createElement(_arg1:int):LayerElementProxy{
var _local2:LayerElementProxy;
switch (_arg1){
case Sprites.SPR_ID_TRAP_KEY_GREEN:
case Sprites.SPR_ID_TRAP_KEY_RED:
case Sprites.SPR_ID_TRAP_KEY_BLUE:
_local2 = new LayerElementProxy_Key(_arg1, this);
break;
case Sprites.SPR_ID_TRAP_SHARP_GREEN:
_local2 = new LayerElementProxy_Trap(_arg1, this);
_local2.inCreate();
if (isElementByTypeInState(Sprites.SPR_ID_TRAP_KEY_GREEN, LayerElementProxy_Key.STATE_KEY_ON)){
_local2.state = LayerElementProxy_Trap.STATE_TRAP_OFF;
};
_local2.outCreate();
break;
case Sprites.SPR_ID_TRAP_SHARP_RED:
_local2 = new LayerElementProxy_Trap(_arg1, this);
_local2.inCreate();
if (isElementByTypeInState(Sprites.SPR_ID_TRAP_KEY_RED, LayerElementProxy_Key.STATE_KEY_ON)){
_local2.state = LayerElementProxy_Trap.STATE_TRAP_OFF;
};
_local2.outCreate();
break;
case Sprites.SPR_ID_TRAP_SHARP_BLUE:
_local2 = new LayerElementProxy_Trap(_arg1, this);
_local2.inCreate();
if (isElementByTypeInState(Sprites.SPR_ID_TRAP_KEY_BLUE, LayerElementProxy_Key.STATE_KEY_ON)){
_local2.state = LayerElementProxy_Trap.STATE_TRAP_OFF;
};
_local2.outCreate();
break;
default:
_local2 = super.createElement(_arg1);
break;
};
return (_local2);
}
override public function eraseElement(_arg1:LayerElementProxy):void{
var _local2:int;
super.eraseElement(_arg1);
if (_arg1 != null){
_local2 = _arg1.type;
switch (_local2){
case Sprites.SPR_ID_TRAP_KEY_BLUE:
checkKeyType(_arg1.type, Sprites.SPR_ID_TRAP_SHARP_BLUE);
break;
case Sprites.SPR_ID_TRAP_KEY_GREEN:
checkKeyType(_arg1.type, Sprites.SPR_ID_TRAP_SHARP_GREEN);
break;
case Sprites.SPR_ID_TRAP_KEY_RED:
checkKeyType(_arg1.type, Sprites.SPR_ID_TRAP_SHARP_RED);
break;
};
};
}
override public function listenElementTrapOn(_arg1:LayerElementProxy):void{
var _local2:int;
var _local3:int;
var _local4:LayerElementProxy_Key;
var _local5:LayerElementProxy;
if (_arg1 != null){
_local2 = _arg1.x;
_local3 = _arg1.y;
_local5 = getElementAt(_local2, _local3);
if (_local5 != null){
switch (_local5.type){
case Sprites.SPR_ID_TRAP_KEY_BLUE:
case Sprites.SPR_ID_TRAP_KEY_GREEN:
case Sprites.SPR_ID_TRAP_KEY_RED:
case Sprites.SPR_ID_TRAP_SHARP_BLUE:
case Sprites.SPR_ID_TRAP_SHARP_GREEN:
case Sprites.SPR_ID_TRAP_SHARP_RED:
if (_arg1.mass > 0){
_local5.putElementOn(_arg1);
};
break;
};
};
};
super.listenElementTrapOn(_arg1);
}
public function getTrapThere(_arg1:int, _arg2:int):LayerElementProxy_Trap{
var _local3:LayerElementProxy;
var _local4:int;
for each (_local3 in m_arMatrix) {
if (_local3 != null){
_local4 = _local3.type;
if ((((((_local3.x == _arg1)) && ((_local3.y == _arg2)))) && ((((((_local4 == Sprites.SPR_ID_TRAP_SHARP_BLUE)) || ((_local4 == Sprites.SPR_ID_TRAP_SHARP_GREEN)))) || ((_local4 == Sprites.SPR_ID_TRAP_SHARP_RED)))))){
return ((_local3 as LayerElementProxy_Trap));
};
};
};
return (null);
}
private function isElementByTypeInState(_arg1:int, _arg2:int):Boolean{
var _local3:LayerElementProxy;
for each (_local3 in m_arMatrix) {
if (((((!((_local3 == null))) && ((_local3.type == _arg1)))) && ((_local3.state == _arg2)))){
return (true);
};
};
return (false);
}
}
}//package game.model
Section 142
//UndoElementProxy (game.model.UndoElementProxy)
package game.model {
import org.puremvc.as3.interfaces.*;
import game.model.Elements.*;
import org.puremvc.as3.patterns.proxy.*;
public class UndoElementProxy extends Proxy implements IProxy {
public var m_bEndTurn:Boolean;
public var m_nState:int;
public var m_pSourceElement:LayerElementProxy;
public var m_pTargetElement:LayerElementProxy;
public static const NAME:String = "UndoElementProxy";
public function UndoElementProxy(_arg1:int, _arg2:int, _arg3:LayerElementProxy, _arg4:LayerElementProxy, _arg5:Boolean=false){
super(((NAME + "_") + _arg1), 0);
m_nState = _arg2;
m_pSourceElement = _arg3;
m_pTargetElement = _arg4;
m_bEndTurn = _arg5;
}
}
}//package game.model
Section 143
//UndoProxy (game.model.UndoProxy)
package game.model {
import org.puremvc.as3.interfaces.*;
import com.*;
import game.model.Elements.*;
import main.*;
import game.model.Elements.Character.*;
import org.puremvc.as3.patterns.proxy.*;
public class UndoProxy extends Proxy implements IProxy {
private var m_arHistory:Array;
private var m_bUndoTurnFinished:Boolean;
private var m_arUndoStates:Array;
private var m_pElements:LayerListProxy;
private var m_bActive:Boolean;
public static const NAME:String = "UndoProxy";
public function UndoProxy(){
m_arHistory = new Array();
m_arUndoStates = [[LayerElementProxy.STATE_MOVE_WEST, LayerElementProxy.STATE_UNDO_MOVE_WEST], [LayerElementProxy.STATE_MOVE_EAST, LayerElementProxy.STATE_UNDO_MOVE_EAST], [LayerElementProxy.STATE_MOVE_NORTH, LayerElementProxy.STATE_UNDO_MOVE_NORTH], [LayerElementProxy.STATE_MOVE_SOUTH, LayerElementProxy.STATE_UNDO_MOVE_SOUTH], [LayerElementProxy.STATE_PUSH_WEST, LayerElementProxy.STATE_UNDO_PUSH_WEST], [LayerElementProxy.STATE_PUSH_EAST, LayerElementProxy.STATE_UNDO_PUSH_EAST], [LayerElementProxy.STATE_PUSH_NORTH, LayerElementProxy.STATE_UNDO_PUSH_NORTH], [LayerElementProxy.STATE_PUSH_SOUTH, LayerElementProxy.STATE_UNDO_PUSH_SOUTH], [LayerElementProxy.STATE_SWIM_EAST, LayerElementProxy.STATE_UNDO_SWIM_EAST], [LayerElementProxy.STATE_SWIM_WEST, LayerElementProxy.STATE_UNDO_SWIM_WEST], [LayerElementProxy.STATE_SWIM_NORTH, LayerElementProxy.STATE_UNDO_SWIM_NORTH], [LayerElementProxy.STATE_SWIM_SOUTH, LayerElementProxy.STATE_UNDO_SWIM_SOUTH], [LayerElementProxy_Character.STATE_DEAD, LayerElementProxy.STATE_BORN]];
super(NAME, m_arHistory);
}
public function getUndoStateByState(_arg1:int):int{
var _local2:Array;
for each (_local2 in m_arUndoStates) {
if (_local2 != null){
if (_local2[0] == _arg1){
return (_local2[1]);
};
};
};
return (CommonFunc.INT_UNDEF);
}
public function addHistory(_arg1:int, _arg2:LayerElementProxy, _arg3:LayerElementProxy, _arg4:Boolean=false):Boolean{
var _local5:int;
var _local6:UndoElementProxy;
_local5 = m_arHistory.length;
_local6 = new UndoElementProxy(_local5, _arg1, _arg2, _arg3, _arg4);
m_arHistory.push(_local6);
return (true);
}
public function set active(_arg1:Boolean):void{
if (m_bActive != _arg1){
m_bActive = _arg1;
sendNotification(ApplicationFacade.UNDO_CHANGE_ACTIVE, m_bActive);
};
}
public function get active():Boolean{
return (m_bActive);
}
public function get count():int{
return (m_arHistory.length);
}
public function addHistory_EndTurn():void{
addHistory(-1, null, null, true);
}
public function reset():void{
m_arHistory = new Array();
}
public function startUndoTurn():void{
var _local1:int;
var _local2:UndoElementProxy;
_local1 = m_arHistory.length;
while (--_local1 >= 0) {
_local2 = m_arHistory[_local1];
if (_local2 != null){
if (_local2.m_bEndTurn){
m_arHistory.splice(_local1, 1);
break;
};
};
};
m_bUndoTurnFinished = false;
}
public function getLastHistory():UndoElementProxy{
var _local1:int;
var _local2:int;
var _local3:UndoElementProxy;
var _local4:LayerElementProxy;
_local1 = m_arHistory.length;
_local2 = 0;
if (_local1 <= 0){
m_bUndoTurnFinished = true;
return (null);
};
while (--_local1 >= 0) {
_local3 = m_arHistory[_local1];
if (_local3 != null){
if (!_local3.m_bEndTurn){
_local4 = _local3.m_pSourceElement;
if (_local4 != null){
if (_local4.isUndo()){
_local2++;
} else {
m_arHistory.splice(_local1, 1);
return (_local3);
};
};
} else {
if (_local2 == 0){
m_arHistory.splice(_local1, 1);
m_bUndoTurnFinished = true;
};
return (null);
};
};
};
return (null);
}
public function get undoTurnFinished():Boolean{
return (m_bUndoTurnFinished);
}
public function removeHistory(_arg1:int, _arg2:LayerElementProxy, _arg3:LayerElementProxy=null):Boolean{
var _local4:int;
var _local5:UndoElementProxy;
_local4 = m_arHistory.length;
while (--_local4 >= 0) {
_local5 = m_arHistory[_local4];
if (_local5 != null){
if ((((((_local5.m_nState == _arg1)) && ((_local5.m_pSourceElement == _arg2)))) && ((_local5.m_pTargetElement == _arg3)))){
m_arHistory.splice(_local4, 1);
return (true);
};
};
};
return (false);
}
}
}//package game.model
Section 144
//WaterProxy (game.model.WaterProxy)
package game.model {
import com.*;
import main.*;
import game.view.*;
public class WaterProxy extends LayerMatrixProxy {
public static const NEIGHBOUR_TR:uint = (1 << 2);
public static const NEIGHBOUR_BR:uint = (1 << 7);
public static const NEIGHBOUR_L:uint = (1 << 3);
public static const NAME:String = "WaterProxy";
public static const NEIGHBOUR_BL:uint = (1 << 5);
public static const NEIGHBOUR_B:uint = (1 << 6);
public static const NEIGHBOUR_R:uint = (1 << 4);
public static const NEIGHBOUR_T:uint = (1 << 1);
public static const NEIGHBOUR_TL:uint = (1 << 0);
public function WaterProxy(_arg1:int=-1, _arg2:LevelProxy=null){
super(_arg1, _arg2);
type = LayerProxy.LAYER_TYPE_WATER;
}
override public function setValue(_arg1:IntPoint, _arg2:int):Boolean{
setWaterElement(_arg1, _arg2, true);
sendChangeDataNotification(_arg1, _arg2);
return (true);
}
private function isWater(_arg1:int, _arg2:int):Boolean{
var _local3:int;
_local3 = getValue_(_arg1, _arg2);
if ((((((((((((((((((((((((((((((((((((_local3 == Sprites.SPR_ID_WATER)) || ((_local3 == Sprites.SPR_ID_WATER_FILL_B)))) || ((_local3 == Sprites.SPR_ID_WATER_FILL_B_L)))) || ((_local3 == Sprites.SPR_ID_WATER_FILL_B_R)))) || ((_local3 == Sprites.SPR_ID_WATER_FILL_L)))) || ((_local3 == Sprites.SPR_ID_WATER_FILL_L_R)))) || ((_local3 == Sprites.SPR_ID_WATER_FILL_R)))) || ((_local3 == Sprites.SPR_ID_WATER_FILL_T)))) || ((_local3 == Sprites.SPR_ID_WATER_FILL_T_L)))) || ((_local3 == Sprites.SPR_ID_WATER_FILL_T_R)))) || ((_local3 == Sprites.SPR_ID_WATER_FILL_TL_L)))) || ((_local3 == Sprites.SPR_ID_WATER_FILL_TL_L_B)))) || ((_local3 == Sprites.SPR_ID_WATER_FILL_TL_L_R_B)))) || ((_local3 == Sprites.SPR_ID_WATER_FILL_TL_TR_L_R_B)))) || ((_local3 == Sprites.SPR_ID_WATER_FILL_TR_L_R_B)))) || ((_local3 == Sprites.SPR_ID_WATER_FILL_TR_R)))) || ((_local3 == Sprites.SPR_ID_WATER_FILL_TR_R_B)))) || ((_local3 == Sprites.SPR_ID_WATER_LAKE)))){
return (true);
};
return (false);
}
private function bindValue(_arg1:int, _arg2:int):void{
var _local3:Boolean;
var _local4:uint;
var _local5:int;
var _local6:IntPoint;
_local3 = isWater(_arg1, _arg2);
_local4 = getNeighbour(_arg1, _arg2);
_local5 = getElementByNeighbour(_local4, _local3);
setValue_(_arg1, _arg2, _local5);
_local6 = new IntPoint(_arg1, _arg2);
sendChangeDataNotification(_local6, _local5);
}
override public function isThere(_arg1:IntPoint):Boolean{
return (isWater(_arg1.m_iX, _arg1.m_iY));
}
override public function isThereXY(_arg1:int, _arg2:int):Boolean{
return (isWater(_arg1, _arg2));
}
private function getElementByNeighbour(_arg1:uint, _arg2:Boolean):int{
var _local3:uint;
if (_arg2){
if ((((_arg1 & NEIGHBOUR_T)) && ((((((_arg1 & NEIGHBOUR_L)) && ((_arg1 & NEIGHBOUR_R)))) || ((_arg1 & NEIGHBOUR_B)))))){
return (Sprites.SPR_ID_WATER);
};
if ((((_arg1 & NEIGHBOUR_T)) && ((_arg1 & NEIGHBOUR_L)))){
return (Sprites.SPR_ID_WATER_FILL_T_L);
};
if ((((_arg1 & NEIGHBOUR_T)) && ((_arg1 & NEIGHBOUR_R)))){
return (Sprites.SPR_ID_WATER_FILL_T_R);
};
_local3 = (((NEIGHBOUR_TL | NEIGHBOUR_TR) | NEIGHBOUR_L) | NEIGHBOUR_R);
if ((_arg1 & _local3) == _local3){
return (Sprites.SPR_ID_WATER_FILL_TL_TR_L_R_B);
};
_local3 = ((NEIGHBOUR_TL | NEIGHBOUR_L) | NEIGHBOUR_R);
if ((_arg1 & _local3) == _local3){
return (Sprites.SPR_ID_WATER_FILL_TL_L_R_B);
};
_local3 = ((NEIGHBOUR_TR | NEIGHBOUR_L) | NEIGHBOUR_R);
if ((_arg1 & _local3) == _local3){
return (Sprites.SPR_ID_WATER_FILL_TR_L_R_B);
};
if ((((((_arg1 & NEIGHBOUR_TL)) && ((_arg1 & NEIGHBOUR_L)))) && ((_arg1 & NEIGHBOUR_B)))){
return (Sprites.SPR_ID_WATER_FILL_TL_L_B);
};
if ((((((_arg1 & NEIGHBOUR_TR)) && ((_arg1 & NEIGHBOUR_R)))) && ((_arg1 & NEIGHBOUR_B)))){
return (Sprites.SPR_ID_WATER_FILL_TR_R_B);
};
_local3 = (NEIGHBOUR_TL | NEIGHBOUR_L);
if ((_arg1 & _local3) == _local3){
return (Sprites.SPR_ID_WATER_FILL_TL_L);
};
_local3 = (NEIGHBOUR_TR | NEIGHBOUR_R);
if ((_arg1 & _local3) == _local3){
return (Sprites.SPR_ID_WATER_FILL_TR_R);
};
_local3 = (NEIGHBOUR_L | NEIGHBOUR_R);
if ((_arg1 & _local3) == _local3){
return (Sprites.SPR_ID_WATER_FILL_L_R);
};
_local3 = (NEIGHBOUR_B | NEIGHBOUR_L);
if ((_arg1 & _local3) == _local3){
return (Sprites.SPR_ID_WATER_FILL_B_L);
};
_local3 = (NEIGHBOUR_B | NEIGHBOUR_R);
if ((_arg1 & _local3) == _local3){
return (Sprites.SPR_ID_WATER_FILL_B_R);
};
if ((_arg1 & NEIGHBOUR_T)){
return (Sprites.SPR_ID_WATER_FILL_T);
};
if ((_arg1 & NEIGHBOUR_B)){
return (Sprites.SPR_ID_WATER_FILL_B);
};
if ((_arg1 & NEIGHBOUR_L)){
return (Sprites.SPR_ID_WATER_FILL_L);
};
if ((_arg1 & NEIGHBOUR_R)){
return (Sprites.SPR_ID_WATER_FILL_R);
};
return (Sprites.SPR_ID_WATER_LAKE);
//unresolved jump
};
_local3 = (((((((NEIGHBOUR_TL | NEIGHBOUR_T) | NEIGHBOUR_TR) | NEIGHBOUR_L) | NEIGHBOUR_R) | NEIGHBOUR_BL) | NEIGHBOUR_B) | NEIGHBOUR_BR);
if ((_arg1 & _local3) == _local3){
return (Sprites.SPR_ID_WATER_EMPTY_TL_T_TR_L_R_BL_B_BR);
};
_local3 = ((((((NEIGHBOUR_T | NEIGHBOUR_TR) | NEIGHBOUR_L) | NEIGHBOUR_R) | NEIGHBOUR_BL) | NEIGHBOUR_B) | NEIGHBOUR_BR);
if ((_arg1 & _local3) == _local3){
return (Sprites.SPR_ID_WATER_EMPTY_T_TR_L_R_BL_B_BR);
};
_local3 = ((((((NEIGHBOUR_TL | NEIGHBOUR_T) | NEIGHBOUR_L) | NEIGHBOUR_R) | NEIGHBOUR_BL) | NEIGHBOUR_B) | NEIGHBOUR_BR);
if ((_arg1 & _local3) == _local3){
return (Sprites.SPR_ID_WATER_EMPTY_TL_T_L_R_BL_B_BR);
};
_local3 = ((((((NEIGHBOUR_TL | NEIGHBOUR_T) | NEIGHBOUR_TR) | NEIGHBOUR_L) | NEIGHBOUR_R) | NEIGHBOUR_B) | NEIGHBOUR_BR);
if ((_arg1 & _local3) == _local3){
return (Sprites.SPR_ID_WATER_EMPTY_TL_T_TR_L_R_B_BR);
};
_local3 = ((((((NEIGHBOUR_TL | NEIGHBOUR_T) | NEIGHBOUR_TR) | NEIGHBOUR_L) | NEIGHBOUR_R) | NEIGHBOUR_BL) | NEIGHBOUR_B);
if ((_arg1 & _local3) == _local3){
return (Sprites.SPR_ID_WATER_EMPTY_TL_T_TR_L_R_BL_B);
};
_local3 = (((((NEIGHBOUR_T | NEIGHBOUR_TR) | NEIGHBOUR_L) | NEIGHBOUR_R) | NEIGHBOUR_BL) | NEIGHBOUR_B);
if ((_arg1 & _local3) == _local3){
return (Sprites.SPR_ID_WATER_EMPTY_T_TR_L_R_BL_B);
};
_local3 = (((((NEIGHBOUR_TL | NEIGHBOUR_T) | NEIGHBOUR_L) | NEIGHBOUR_R) | NEIGHBOUR_B) | NEIGHBOUR_BR);
if ((_arg1 & _local3) == _local3){
return (Sprites.SPR_ID_WATER_EMPTY_TL_T_L_R_B_BR);
};
_local3 = ((((NEIGHBOUR_L | NEIGHBOUR_R) | NEIGHBOUR_BL) | NEIGHBOUR_B) | NEIGHBOUR_BR);
if ((_arg1 & _local3) == _local3){
return (Sprites.SPR_ID_WATER_EMPTY_L_R_BL_B_BR);
};
_local3 = ((((NEIGHBOUR_TL | NEIGHBOUR_T) | NEIGHBOUR_L) | NEIGHBOUR_BL) | NEIGHBOUR_B);
if ((_arg1 & _local3) == _local3){
return (Sprites.SPR_ID_WATER_EMPTY_TL_T_L_BL_B);
};
_local3 = ((((NEIGHBOUR_TL | NEIGHBOUR_T) | NEIGHBOUR_TR) | NEIGHBOUR_L) | NEIGHBOUR_R);
if ((_arg1 & _local3) == _local3){
return (Sprites.SPR_ID_WATER_EMPTY_TL_T_TR_L_R);
};
_local3 = ((((NEIGHBOUR_T | NEIGHBOUR_TR) | NEIGHBOUR_R) | NEIGHBOUR_B) | NEIGHBOUR_BR);
if ((_arg1 & _local3) == _local3){
return (Sprites.SPR_ID_WATER_EMPTY_T_TR_R_B_BR);
};
_local3 = ((NEIGHBOUR_R | NEIGHBOUR_B) | NEIGHBOUR_BR);
if ((_arg1 & _local3) == _local3){
return (Sprites.SPR_ID_WATER_EMPTY_R_B_BR);
};
_local3 = ((NEIGHBOUR_L | NEIGHBOUR_BL) | NEIGHBOUR_B);
if ((_arg1 & _local3) == _local3){
return (Sprites.SPR_ID_WATER_EMPTY_L_BL_B);
};
_local3 = ((NEIGHBOUR_TL | NEIGHBOUR_T) | NEIGHBOUR_L);
if ((_arg1 & _local3) == _local3){
return (Sprites.SPR_ID_WATER_EMPTY_TL_T_L);
};
_local3 = ((NEIGHBOUR_T | NEIGHBOUR_TR) | NEIGHBOUR_R);
if ((_arg1 & _local3) == _local3){
return (Sprites.SPR_ID_WATER_EMPTY_T_TR_R);
};
_local3 = ((NEIGHBOUR_R | NEIGHBOUR_B) | NEIGHBOUR_BR);
if ((_arg1 & _local3) == _local3){
return (Sprites.SPR_ID_WATER_EMPTY_R_B_BR);
};
_local3 = ((NEIGHBOUR_L | NEIGHBOUR_BL) | NEIGHBOUR_B);
if ((_arg1 & _local3) == _local3){
return (Sprites.SPR_ID_WATER_EMPTY_L_BL_B);
};
_local3 = ((NEIGHBOUR_TL | NEIGHBOUR_T) | NEIGHBOUR_L);
if ((_arg1 & _local3) == _local3){
return (Sprites.SPR_ID_WATER_EMPTY_TL_T_L);
};
_local3 = ((NEIGHBOUR_T | NEIGHBOUR_TR) | NEIGHBOUR_R);
if ((_arg1 & _local3) == _local3){
return (Sprites.SPR_ID_WATER_EMPTY_T_TR_R);
};
return (Sprites.SPR_ID_NULL);
}
private function getNeighbour(_arg1:int, _arg2:int):uint{
var _local3:uint;
var _local4:Boolean;
var _local5:Boolean;
var _local6:Boolean;
var _local7:Boolean;
_local3 = 0;
_local4 = (_arg2 > 0);
_local5 = (_arg2 < (height - 1));
_local6 = (_arg1 > 0);
_local7 = (_arg1 < (width - 1));
if (_local4){
if (_local6){
if (isWater((_arg1 - 1), (_arg2 - 1))){
_local3 = (_local3 | NEIGHBOUR_TL);
};
} else {
if (Global_Settings.WATER_OUTSIDE_MAP){
_local3 = (_local3 | NEIGHBOUR_TL);
};
};
if (isWater((_arg1 + 0), (_arg2 - 1))){
_local3 = (_local3 | NEIGHBOUR_T);
};
if (_local7){
if (isWater((_arg1 + 1), (_arg2 - 1))){
_local3 = (_local3 | NEIGHBOUR_TR);
};
} else {
if (Global_Settings.WATER_OUTSIDE_MAP){
_local3 = (_local3 | NEIGHBOUR_TR);
};
};
} else {
if (Global_Settings.WATER_OUTSIDE_MAP){
_local3 = (_local3 | ((NEIGHBOUR_TL | NEIGHBOUR_T) | NEIGHBOUR_TR));
};
};
if (_local6){
if (isWater((_arg1 - 1), (_arg2 + 0))){
_local3 = (_local3 | NEIGHBOUR_L);
};
} else {
if (Global_Settings.WATER_OUTSIDE_MAP){
_local3 = (_local3 | NEIGHBOUR_L);
};
};
if (_local7){
if (isWater((_arg1 + 1), (_arg2 + 0))){
_local3 = (_local3 | NEIGHBOUR_R);
};
} else {
if (Global_Settings.WATER_OUTSIDE_MAP){
_local3 = (_local3 | NEIGHBOUR_R);
};
};
if (_local5){
if (_local6){
if (isWater((_arg1 - 1), (_arg2 + 1))){
_local3 = (_local3 | NEIGHBOUR_BL);
};
} else {
if (Global_Settings.WATER_OUTSIDE_MAP){
_local3 = (_local3 | NEIGHBOUR_BL);
};
};
if (isWater((_arg1 - 0), (_arg2 + 1))){
_local3 = (_local3 | NEIGHBOUR_B);
};
if (_local7){
if (isWater((_arg1 + 1), (_arg2 + 1))){
_local3 = (_local3 | NEIGHBOUR_BR);
};
} else {
if (Global_Settings.WATER_OUTSIDE_MAP){
_local3 = (_local3 | NEIGHBOUR_BR);
};
};
} else {
if (Global_Settings.WATER_OUTSIDE_MAP){
_local3 = (_local3 | ((NEIGHBOUR_BL | NEIGHBOUR_B) | NEIGHBOUR_BR));
};
};
return (_local3);
}
public function setWaterElement(_arg1:IntPoint, _arg2:int, _arg3:Boolean=true):Boolean{
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:Boolean;
var _local9:uint;
var _local10:Boolean;
var _local11:Boolean;
var _local12:Boolean;
var _local13:Boolean;
var _local14:uint;
var _local15:int;
var _local16:int;
var _local17:int;
var _local18:Boolean;
if (_arg3){
_local6 = _arg1.m_iX;
_local7 = _arg1.m_iY;
if ((((((((_local6 >= 0)) && ((_local7 >= 0)))) && ((_local6 < width)))) && ((_local7 < height)))){
if (_arg2 == CommonFunc.INT_UNDEF){
_local8 = true;
} else {
_local8 = false;
};
_local9 = getNeighbour(_local6, _local7);
_local4 = getElementByNeighbour(_local9, _local8);
_local5 = getValue_(_local6, _local7);
if (_local5 != _local4){
setValue_(_local6, _local7, _local4);
_local10 = (_local7 > 0);
_local11 = (_local7 < (height - 1));
_local12 = (_local6 > 0);
_local13 = (_local6 < (width - 1));
_local15 = _local6;
_local16 = _local7;
if (_local10){
_local16--;
if (_local12){
_local15--;
bindValue(_local15, _local16);
_local15 = _local6;
};
bindValue(_local15, _local16);
if (_local13){
_local15++;
bindValue(_local15, _local16);
_local15 = _local6;
};
_local16 = _local7;
};
if (_local12){
_local15--;
bindValue(_local15, _local16);
_local15 = _local6;
};
if (_local13){
_local15++;
bindValue(_local15, _local16);
_local15 = _local6;
};
if (_local11){
_local16++;
if (_local12){
_local15--;
bindValue(_local15, _local16);
_local15 = _local6;
};
bindValue(_local15, _local16);
if (_local13){
_local15++;
bindValue(_local15, _local16);
};
};
};
};
} else {
super.setValue(_arg1, _arg2);
};
return (true);
}
override public function isCompatibleType(_arg1:int):Boolean{
return ((((_arg1 == LayerProxy.LAYER_TYPE_WATER)) || (super.isCompatibleType(_arg1))));
}
}
}//package game.model
Section 145
//SBContinueMediator (game.view.components.Buttons.SBContinueMediator)
package game.view.components.Buttons {
import flash.events.*;
import main.*;
public class SBContinueMediator extends SimpleBtnMediator {
public function SBContinueMediator(_arg1:Object){
trace("X");
trace("CONSTRUCT public function SBContinueMediator(viewComponent:Object ) ");
super(_arg1);
trace(("Language_Settings.getInstance().getText(Language_Settings.PLAY_GAME_BTN_HINT)=" + Language_Settings.getInstance().getText(Language_Settings.PLAY_GAME_BTN_HINT)));
ui.alert = Language_Settings.getInstance().getText(Language_Settings.PLAY_GAME_BTN_HINT);
}
override protected function listenOnClick(_arg1:Event):void{
trace("X");
trace("SBContinueMediator override protected function listenOnClick(event:Event):void");
sendNotification(ApplicationFacade.GAME_PAUSE, false);
super.listenOnClick(_arg1);
}
}
}//package game.view.components.Buttons
Section 146
//SBLogoMediator (game.view.components.Buttons.SBLogoMediator)
package game.view.components.Buttons {
import flash.events.*;
import main.*;
import classes.*;
public class SBLogoMediator extends SimpleBtnMediator {
public function SBLogoMediator(_arg1:Object){
super(_arg1);
ui.alert = Language_Settings.getInstance().getText(Language_Settings.GAMEZ_HERO_BTN_HINT);
}
override protected function listenOnClick(_arg1:Event):void{
Global.getURL(Global._urls[Global_Settings.URL_ID_ZORRO_LOGO_PAUSE]);
super.listenOnClick(_arg1);
}
}
}//package game.view.components.Buttons
Section 147
//SBMenuMediator (game.view.components.Buttons.SBMenuMediator)
package game.view.components.Buttons {
import flash.events.*;
import game.model.*;
import main.*;
import main.controller.*;
import main.model.*;
public class SBMenuMediator extends SimpleBtnMediator {
public var m_pLevels:LevelsProxy;
public function SBMenuMediator(_arg1:Object){
super(_arg1);
trace(("Language_Settings.getInstance().getText(Language_Settings.EXIT_GAME_BTN_HINT)=" + Language_Settings.getInstance().getText(Language_Settings.EXIT_GAME_BTN_HINT)));
ui.alert = Language_Settings.getInstance().getText(Language_Settings.EXIT_GAME_BTN_HINT);
trace(("ui.alert=" + ui.alert));
}
override protected function listenOnClick(_arg1:Event):void{
var _local2:GameProxy;
trace("X");
trace("SBMenuMediator override protected function listenOnClick(event:Event):void");
_local2 = (facade.retrieveProxy(GameProxy.NAME) as GameProxy);
trace(("pGame=" + _local2));
trace(("m_pLevels=" + m_pLevels));
if (((((!((m_pLevels == null))) && (!(m_pLevels.userEdition)))) && (!((_local2 == null))))){
trace(("m_pLevels.userEdition=" + m_pLevels.userEdition));
sendNotification(ApplicationFacade.CHANGE_PAGE, new PageCommandStruct(PagesProxy.PAGE_MAP, m_pLevels, null, _local2.runInContext));
} else {
sendNotification(ApplicationFacade.QUIT_THE_GAME);
};
super.listenOnClick(_arg1);
}
}
}//package game.view.components.Buttons
Section 148
//SBMusicMediator (game.view.components.Buttons.SBMusicMediator)
package game.view.components.Buttons {
import flash.events.*;
import org.puremvc.as3.interfaces.*;
import main.*;
import main.model.*;
public class SBMusicMediator extends SimpleBtnMediator {
private var m_pMusic:MusicProxy;
public function SBMusicMediator(_arg1:Object){
trace("X");
trace("CONSTRUCT public function SBMusicMediator(viewComponent:Object ) ");
super(_arg1);
ui.alert = Language_Settings.getInstance().getText(Language_Settings.MUSIC_GAME_BTN_HINT);
m_pMusic = (facade.retrieveProxy(MusicProxy.NAME) as MusicProxy);
trace(("m_pMusic.mute=" + m_pMusic.mute));
mute = m_pMusic.mute;
}
override public function handleNotification(_arg1:INotification):void{
switch (_arg1.getName()){
case ApplicationFacade.SET_MUSIC_MUTE:
onChangeMute((_arg1.getBody() as Boolean));
break;
};
super.handleNotification(_arg1);
}
override public function listNotificationInterests():Array{
return ([ApplicationFacade.SET_MUSIC_MUTE]);
}
override protected function listenOnClick(_arg1:Event):void{
var _local2:Boolean;
trace("X");
trace("SBMusicMediator override protected function listenOnClick(event:Event):void");
_local2 = false;
if (m_pMusic != null){
_local2 = !(m_pMusic.mute);
};
trace(("m_pMusic.mute=" + m_pMusic.mute));
sendNotification(ApplicationFacade.SET_MUSIC_MUTE, _local2);
super.listenOnClick(_arg1);
}
protected function onChangeMute(_arg1:Boolean):void{
trace("X");
trace("SBMusicMediator protected function onChangeMute(bValue:Boolean):void");
trace(("bValue=" + _arg1));
mute = _arg1;
trace(("ui.state=" + ui.state));
}
private function set mute(_arg1:Boolean):void{
ui.state = (_arg1) ? UI_SimpleBtn_Music.SET_OFF : UI_SimpleBtn_Music.SET_ON;
}
}
}//package game.view.components.Buttons
Section 149
//SBSoundMediator (game.view.components.Buttons.SBSoundMediator)
package game.view.components.Buttons {
import flash.events.*;
import org.puremvc.as3.interfaces.*;
import main.*;
import main.model.*;
public class SBSoundMediator extends SimpleBtnMediator {
private var m_pSound:SoundProxy;
public function SBSoundMediator(_arg1:Object){
super(_arg1);
ui.alert = Language_Settings.getInstance().getText(Language_Settings.SOUND_GAME_BTN_HINT);
m_pSound = (facade.retrieveProxy(SoundProxy.NAME) as SoundProxy);
mute = m_pSound.mute;
}
override public function handleNotification(_arg1:INotification):void{
switch (_arg1.getName()){
case ApplicationFacade.SET_SOUND_MUTE:
onChangeMute((_arg1.getBody() as Boolean));
break;
};
super.handleNotification(_arg1);
}
override public function listNotificationInterests():Array{
return ([ApplicationFacade.SET_SOUND_MUTE]);
}
override protected function listenOnClick(_arg1:Event):void{
var _local2:Boolean;
super.listenOnClick(_arg1);
_local2 = false;
if (m_pSound != null){
_local2 = !(m_pSound.mute);
};
sendNotification(ApplicationFacade.SET_SOUND_MUTE, _local2);
super.listenOnClick(_arg1);
}
protected function onChangeMute(_arg1:Boolean):void{
mute = _arg1;
}
private function set mute(_arg1:Boolean):void{
ui.state = (_arg1) ? UI_SimpleBtn_Sound.SET_OFF : UI_SimpleBtn_Sound.SET_ON;
}
}
}//package game.view.components.Buttons
Section 150
//SBSpeedMediator (game.view.components.Buttons.SBSpeedMediator)
package game.view.components.Buttons {
import flash.events.*;
import main.*;
import main.model.*;
public class SBSpeedMediator extends SimpleBtnMediator {
private var m_pTimer:TimerProxy;
public function SBSpeedMediator(_arg1:Object){
super(_arg1);
m_pTimer = (facade.retrieveProxy(TimerProxy.NAME) as TimerProxy);
}
override protected function listenOnClick(_arg1:Event):void{
trace("X");
trace("SBSpeedMediator override protected function listenOnClick(event:Event):void");
trace(("m_pTimer=" + m_pTimer));
if (m_pTimer != null){
trace(("m_pTimer.speedRelevant=" + m_pTimer.speedRelevant));
if (m_pTimer.speedRelevant >= 1){
sendNotification(ApplicationFacade.SET_GAME_SPEED, 0);
} else {
sendNotification(ApplicationFacade.SET_GAME_SPEED, 1);
};
};
super.listenOnClick(_arg1);
}
}
}//package game.view.components.Buttons
Section 151
//SimpleBtnMediator (game.view.components.Buttons.SimpleBtnMediator)
package game.view.components.Buttons {
import flash.events.*;
import org.puremvc.as3.interfaces.*;
import org.puremvc.as3.patterns.mediator.*;
public class SimpleBtnMediator extends Mediator implements IMediator {
public function SimpleBtnMediator(_arg1:Object){
var _local2:UI_SimpleBtn;
trace("X");
trace("CONSTRUCTOR public function SimpleBtnMediator(viewComponent:Object ) ");
trace(("this=" + this));
_local2 = (_arg1 as UI_SimpleBtn);
trace(("uiBtn=" + _local2));
trace(("uiBtn.getName()=" + _local2.getName()));
super(_local2.getName(), _arg1);
_local2.addEventListener(UI_SimpleBtn.ON_CLICK, listenOnClick, false, 0, true);
}
protected function listenOnClick(_arg1:Event):void{
}
public function get ui():UI_SimpleBtn{
return ((viewComponent as UI_SimpleBtn));
}
}
}//package game.view.components.Buttons
Section 152
//SoundControlMediator (game.view.components.Buttons.SoundControlMediator)
package game.view.components.Buttons {
import flash.events.*;
import org.puremvc.as3.interfaces.*;
import main.*;
import com.Denis.*;
import org.puremvc.as3.patterns.mediator.*;
import main.model.*;
public class SoundControlMediator extends Mediator implements IMediator {
private var m_pSound:SoundProxy;
private var m_pMusic:MusicProxy;
private var m_bMusic:Boolean;
public static const NAME:String = "SoundControlMediator";
public function SoundControlMediator(_arg1:Object, _arg2:Boolean){
var _local3:String;
trace("X");
trace("CONSTRUCT SoundControlMediator public function SoundControlMediator(viewComponent:Object, bMusic:Boolean )");
_local3 = NAME;
if (_arg2){
_local3 = (_local3 + "_music");
} else {
_local3 = (_local3 + "_sound");
};
m_bMusic = _arg2;
super(_local3, _arg1);
ui.addEventListener(BtnSoundControl.CHANGE, listenOnChangeValue, false, 0, true);
if (_arg2){
m_pMusic = (facade.retrieveProxy(MusicProxy.NAME) as MusicProxy);
} else {
m_pSound = (facade.retrieveProxy(SoundProxy.NAME) as SoundProxy);
};
updateVolume();
}
private function onSetSoundValue(_arg1:Number):void{
trace("X");
trace("SoundControlMediator private function onSetSoundValue(nValue:int):void");
trace(("nValue = " + _arg1));
updateVolume();
}
private function updateVolume():void{
trace("X");
trace("SoundControlMediator private function updateVolume():void");
if (m_bMusic){
trace("MUSIC");
if (m_pMusic != null){
trace(("m_pMusic.volume=" + m_pMusic.volume));
ui.volue = m_pMusic.volume;
trace(("ui.volue=" + ui.volue));
};
} else {
trace("SOUND");
if (m_pSound != null){
trace(("m_pSound.volume=" + m_pSound.volume));
ui.volue = m_pSound.volume;
trace(("ui.volue=" + ui.volue));
};
};
}
override public function listNotificationInterests():Array{
return ([ApplicationFacade.SET_SOUND_VALUME, ApplicationFacade.SET_MUSIC_VALUME]);
}
public function get ui():BtnSoundControl{
return ((viewComponent as BtnSoundControl));
}
private function onSetMusicValue(_arg1:Number):void{
trace("X");
trace("SoundControlMediator private function onSetMusicValue(nValue:int):void");
trace(("nValue = " + _arg1));
updateVolume();
}
override public function handleNotification(_arg1:INotification):void{
switch (_arg1.getName()){
case ApplicationFacade.SET_SOUND_VALUME:
onSetSoundValue((_arg1.getBody() as Number));
break;
case ApplicationFacade.SET_MUSIC_VALUME:
onSetMusicValue((_arg1.getBody() as Number));
break;
};
super.handleNotification(_arg1);
}
private function listenOnChangeValue(_arg1:Event):void{
trace("X");
trace("SoundControlMediator private function listenOnChangeValue(event:Event):void");
trace(("ui.volue=" + ui.volue));
if (m_bMusic){
trace("MUSIC");
sendNotification(ApplicationFacade.SET_MUSIC_VALUME, ui.volue);
} else {
trace("SOUND");
sendNotification(ApplicationFacade.SET_SOUND_VALUME, ui.volue);
};
}
}
}//package game.view.components.Buttons
Section 153
//SpeedControlMediator (game.view.components.Buttons.SpeedControlMediator)
package game.view.components.Buttons {
import flash.events.*;
import org.puremvc.as3.interfaces.*;
import main.*;
import com.Denis.*;
import org.puremvc.as3.patterns.mediator.*;
import main.model.*;
public class SpeedControlMediator extends Mediator implements IMediator {
private var m_pTimer:TimerProxy;
public static const DOUBLE_MIN:Number = 1;
public static const DOUBLE_MAX:Number = 2;
public static const NAME:String = "SpeedControlMediator";
public function SpeedControlMediator(_arg1:Object){
super(NAME, _arg1);
m_pTimer = (facade.retrieveProxy(TimerProxy.NAME) as TimerProxy);
trace(("ui=" + ui));
trace(("m_pTimer=" + m_pTimer));
if (((!((ui == null))) && (!((m_pTimer == null))))){
ui.volue = m_pTimer.speedRelevant;
ui.addEventListener(BtnSoundControl.CHANGE, listenOnChangeValue, false, 0, true);
};
}
override public function listNotificationInterests():Array{
return ([ApplicationFacade.SET_GAME_SPEED]);
}
public function get ui():BtnSoundControl{
return ((viewComponent as BtnSoundControl));
}
private function onSetGameSpeed(_arg1:Number):void{
trace("X");
trace("SpeedControlMediator private function onSetGameSpeed(nValue:Number):void");
trace(("nValue=" + _arg1));
ui.volue = _arg1;
}
override public function handleNotification(_arg1:INotification):void{
switch (_arg1.getName()){
case ApplicationFacade.SET_GAME_SPEED:
onSetGameSpeed((_arg1.getBody() as Number));
break;
};
super.handleNotification(_arg1);
}
private function listenOnChangeValue(_arg1:Event):void{
trace("X");
trace("SpeedControlMediator private function listenOnChangeValue(event:Event):void");
trace(("ui.volue=" + ui.volue));
sendNotification(ApplicationFacade.SET_GAME_SPEED, ui.volue);
}
}
}//package game.view.components.Buttons
Section 154
//UI_SimpleBtn (game.view.components.Buttons.UI_SimpleBtn)
package game.view.components.Buttons {
import flash.display.*;
import flash.events.*;
import com.*;
import classes.*;
public class UI_SimpleBtn extends MovieClip {
private var m_strAlert:String;
private var m_nState:int;// = -1
private static const BLICK_NAME:String = "blick2";
public static const ON_CLICK:String = "onClick";
public static const NAME:String = "UI_SimpleBtn";
public function UI_SimpleBtn(){
m_nState = CommonFunc.INT_UNDEF;
super();
buttonMode = true;
mouseDisable();
addEventListener(MouseEvent.ROLL_OUT, listenMouseOut, false, 0, true);
addEventListener(MouseEvent.ROLL_OVER, listenMouseOver, false, 0, true);
addEventListener(MouseEvent.MOUSE_UP, listenMouseUp, false, 0, true);
}
public function getName():String{
return (NAME);
}
private function get blick():MovieClip{
return ((getChildByName(BLICK_NAME) as MovieClip));
}
protected function listenMouseOver(_arg1:MouseEvent):void{
var _local2:MovieClip;
var _local3:MovieClip;
if (_arg1.target != null){
_local2 = (_arg1.target as MovieClip);
while (_local2 != null) {
_local2 = (_local2.parent as MovieClip);
};
};
if (_arg1.target == this){
_local3 = blick;
if (_local3 != null){
_local3.gotoAndPlay(1);
};
Global.sound_interface.playSound(null, "s_over", 0, 0);
};
}
public function set state(_arg1:int):void{
if (m_nState != _arg1){
onChangeState(_arg1);
m_nState = _arg1;
};
}
protected function listenMouseOut(_arg1:MouseEvent):void{
var _local2:MovieClip;
if (_arg1.target == this){
_local2 = blick;
if (((!((_local2 == null))) && ((_arg1.target == this)))){
_local2.gotoAndStop(1);
};
};
}
public function get alert():String{
return (m_strAlert);
}
protected function onChangeState(_arg1:int):void{
}
protected function mouseDisableMC(_arg1:String):void{
var _local2:MovieClip;
if (_arg1 != null){
_local2 = (getChildByName(_arg1) as MovieClip);
if (_local2 != null){
_local2.mouseEnabled = false;
};
};
}
protected function listenMouseUp(_arg1:MouseEvent):void{
dispatchEvent(new Event(ON_CLICK));
Global.sound_interface.playSound(null, "s_click", 0, 0);
}
protected function mouseDisable():void{
var _local1:MovieClip;
mouseDisableMC("icon_mc");
_local1 = blick;
if (_local1 != null){
_local1.mouseEnabled = false;
};
}
public function get state():int{
return (m_nState);
}
public function set alert(_arg1:String):void{
m_strAlert = _arg1;
}
}
}//package game.view.components.Buttons
Section 155
//UI_SimpleBtn_Continue (game.view.components.Buttons.UI_SimpleBtn_Continue)
package game.view.components.Buttons {
import flash.display.*;
import flash.events.*;
public class UI_SimpleBtn_Continue extends UI_SimpleBtn {
public var blick2:MovieClip;
public static const NAME:String = "UI_SimpleBtn_Continue";
override protected function listenMouseUp(_arg1:MouseEvent):void{
super.listenMouseUp(_arg1);
}
}
}//package game.view.components.Buttons
Section 156
//UI_SimpleBtn_Logo (game.view.components.Buttons.UI_SimpleBtn_Logo)
package game.view.components.Buttons {
import flash.display.*;
import flash.events.*;
import classes.*;
public class UI_SimpleBtn_Logo extends UI_SimpleBtn {
public var blick2:MovieClip;
public var blick:MovieClip;
public static const NAME:String = "UI_SimpleBtn_Logo";
private static const LOGO_NAME:String = "blick";
override protected function listenMouseOver(_arg1:MouseEvent):void{
var _local2:MovieClip;
super.listenMouseOver(_arg1);
_local2 = (getChildByName(LOGO_NAME) as MovieClip);
if (_local2 != null){
_local2.gotoAndPlay(1);
};
}
override protected function listenMouseOut(_arg1:MouseEvent):void{
var _local2:MovieClip;
super.listenMouseOut(_arg1);
_local2 = (getChildByName(LOGO_NAME) as MovieClip);
if (_local2 != null){
_local2.gotoAndStop(1);
};
}
override protected function listenMouseUp(_arg1:MouseEvent):void{
super.listenMouseUp(_arg1);
Global.getURL(Global._urls["zorro_logo"]);
}
override protected function mouseDisable():void{
super.mouseDisable();
mouseDisableMC(LOGO_NAME);
}
}
}//package game.view.components.Buttons
Section 157
//UI_SimpleBtn_Menu (game.view.components.Buttons.UI_SimpleBtn_Menu)
package game.view.components.Buttons {
import flash.display.*;
public class UI_SimpleBtn_Menu extends UI_SimpleBtn {
public var blick2:MovieClip;
public static const NAME:String = "UI_SimpleBtn_Menu";
}
}//package game.view.components.Buttons
Section 158
//UI_SimpleBtn_Music (game.view.components.Buttons.UI_SimpleBtn_Music)
package game.view.components.Buttons {
import flash.display.*;
public class UI_SimpleBtn_Music extends UI_SimpleBtn {
public var blick2:MovieClip;
public static const SET_OFF:int = 0;
public static const NAME:String = "UI_SimpleBtn_Music";
public static const SET_ON:int = 1;
public function UI_SimpleBtn_Music(){
addFrameScript(0, frame1);
}
override protected function onChangeState(_arg1:int):void{
trace("X");
trace("UI_SimpleBtn_Music override protected function onChangeState(nValue:int):void");
switch (_arg1){
case SET_OFF:
trace("gotoAndStop(\"off\");");
gotoAndStop("off");
break;
case SET_ON:
trace("gotoAndStop(\"on\");");
gotoAndStop("on");
break;
};
}
function frame1(){
stop();
}
}
}//package game.view.components.Buttons
Section 159
//UI_SimpleBtn_Pause (game.view.components.Buttons.UI_SimpleBtn_Pause)
package game.view.components.Buttons {
import flash.display.*;
public class UI_SimpleBtn_Pause extends UI_SimpleBtn {
public var blick2:MovieClip;
public static const NAME:String = "UI_SimpleBtn_Pause";
}
}//package game.view.components.Buttons
Section 160
//UI_SimpleBtn_Restart (game.view.components.Buttons.UI_SimpleBtn_Restart)
package game.view.components.Buttons {
import flash.display.*;
public class UI_SimpleBtn_Restart extends UI_SimpleBtn {
public var blick2:MovieClip;
public static const NAME:String = "UI_SimpleBtn_Restart";
}
}//package game.view.components.Buttons
Section 161
//UI_SimpleBtn_Sound (game.view.components.Buttons.UI_SimpleBtn_Sound)
package game.view.components.Buttons {
import flash.display.*;
public class UI_SimpleBtn_Sound extends UI_SimpleBtn {
public var blick2:MovieClip;
public static const SET_OFF:int = 0;
public static const NAME:String = "UI_SimpleBtn_Sound";
public static const SET_ON:int = 1;
public function UI_SimpleBtn_Sound(){
addFrameScript(0, frame1);
}
override protected function onChangeState(_arg1:int):void{
switch (_arg1){
case SET_OFF:
gotoAndStop("off");
break;
case SET_ON:
gotoAndStop("on");
break;
};
}
function frame1(){
stop();
}
}
}//package game.view.components.Buttons
Section 162
//UI_SimpleBtn_Speed (game.view.components.Buttons.UI_SimpleBtn_Speed)
package game.view.components.Buttons {
import flash.display.*;
public class UI_SimpleBtn_Speed extends UI_SimpleBtn {
public var blick2:MovieClip;
public static const SET_OFF:int = 0;
public static const NAME:String = "UI_SimpleBtn_Sound";
public static const SET_ON:int = 1;
public function UI_SimpleBtn_Speed(){
addFrameScript(0, frame1);
}
override protected function onChangeState(_arg1:int):void{
switch (_arg1){
case SET_OFF:
gotoAndStop("off");
break;
case SET_ON:
gotoAndStop("on");
break;
};
}
function frame1(){
stop();
}
}
}//package game.view.components.Buttons
Section 163
//UI_SimpleBtn_Undo (game.view.components.Buttons.UI_SimpleBtn_Undo)
package game.view.components.Buttons {
import flash.display.*;
public class UI_SimpleBtn_Undo extends UI_SimpleBtn {
public var blick2:MovieClip;
public static const NAME:String = "UI_SimpleBtn_Undo";
}
}//package game.view.components.Buttons
Section 164
//UI_Character (game.view.components.Elements.Character.UI_Character)
package game.view.components.Elements.Character {
import flash.display.*;
import flash.events.*;
import com.*;
import game.model.Elements.*;
import main.*;
import game.model.Elements.Character.*;
import game.view.components.Elements.*;
public class UI_Character extends UI_Element_With_Trigger {
private var m_mcBody:MovieClip;
public static const ARROW_SWIM_NORTH:int = 11;
public static const ARROW_WEST:int = 2;
public static const ARROW_WAIT:int = 0;
public static const ARROW_SWIM_SOUTH:int = 12;
public static const ARROW_NORTH:int = 3;
public static const ARROWS:Array = ["arrow_wait_mc", "arrow_east_mc", "arrow_west_mc", "arrow_north_mc", "arrow_south_mc", "arrow_push_east_mc", "arrow_push_west_mc", "arrow_push_north_mc", "arrow_push_south_mc", "arrow_east_mc", "arrow_west_mc", "arrow_north_mc", "arrow_south_mc"];
public static const ARROW_EAST:int = 1;
public static const ARROW_PUSH_NORTH:int = 7;
public static const ARROW_SOUTH:int = 4;
public static const ARROW_PUSH_SOUTH:int = 8;
public static const ARROW_PUSH_WEST:int = 6;
public static const ARROW_SWIM_WEST:int = 10;
public static const ARROW_UNDEF:int = -1;
public static const ARROW_PUSH_EAST:int = 5;
public static const ARROW_SWIM_EAST:int = 9;
public function UI_Character(_arg1:Boolean=false, _arg2:int=-1){
super(_arg1, _arg2);
addEventListener(Event.REMOVED, listenRemove, false, 0, true);
addEventListener(Event.ADDED, listenAdded, false, 0, true);
arrow = ARROW_UNDEF;
}
public function set arrow(_arg1:int):void{
var _local2:MovieClip;
var _local3:int;
_local3 = ARROWS.length;
while (--_local3 >= 0) {
_local2 = (getChildByName(ARROWS[_local3]) as MovieClip);
if (_local2 != null){
_local2.visible = false;
};
};
if ((((_arg1 >= 0)) && ((ARROWS.length > _arg1)))){
_local2 = (getChildByName(ARROWS[_arg1]) as MovieClip);
if (_local2 != null){
_local2.visible = true;
};
};
}
private function listenRemove(_arg1:Event):void{
if (_arg1.target == this){
};
}
override public function startAnimation():void{
state = LayerElementProxy.STATE_LOOK_SOUTH;
}
protected function getLabelByState(_arg1:int):String{
switch (_arg1){
case LayerElementProxy.STATE_LOOK_SOUTH:
return ("look_south");
case LayerElementProxy.STATE_LOOK_NORTH:
return ("look_north");
case LayerElementProxy.STATE_LOOK_WEST:
return ("look_west");
case LayerElementProxy.STATE_LOOK_EAST:
return ("look_east");
};
return (null);
}
override protected function onChangeState(_arg1:int):void{
var _local2:Boolean;
super.onChangeState(_arg1);
if (state != _arg1){
reverseAnimation = false;
_local2 = false;
switch (_arg1){
case LayerElementProxy.STATE_LOOK_NORTH:
case LayerElementProxy.STATE_LOOK_NORTH_WAIT_FOR_PUSH:
gotoAndStop("look_north");
_local2 = true;
break;
case LayerElementProxy.STATE_LOOK_EAST:
case LayerElementProxy.STATE_LOOK_EAST_WAIT_FOR_PUSH:
gotoAndStop("look_east");
_local2 = true;
break;
case LayerElementProxy.STATE_LOOK_WEST:
case LayerElementProxy.STATE_LOOK_WEST_WAIT_FOR_PUSH:
gotoAndStop("look_west");
_local2 = true;
break;
case LayerElementProxy.STATE_LOOK_SOUTH:
case LayerElementProxy.STATE_LOOK_SOUTH_WAIT_FOR_PUSH:
gotoAndStop("look_south");
_local2 = true;
break;
case LayerElementProxy.STATE_MOVE_NORTH:
gotoAndStop("move_north");
arrow = ARROW_UNDEF;
_local2 = true;
break;
case LayerElementProxy.STATE_UNDO_MOVE_NORTH:
if (!Global_Settings.SWIFT_UNDO){
gotoAndStop("move_north");
_local2 = true;
arrow = ARROW_UNDEF;
reverseAnimation = true;
};
break;
case LayerElementProxy.STATE_MOVE_EAST:
gotoAndStop("move_east");
arrow = ARROW_UNDEF;
_local2 = true;
break;
case LayerElementProxy.STATE_UNDO_MOVE_EAST:
if (!Global_Settings.SWIFT_UNDO){
gotoAndStop("move_east");
arrow = ARROW_UNDEF;
_local2 = true;
reverseAnimation = true;
};
break;
case LayerElementProxy.STATE_MOVE_WEST:
gotoAndStop("move_west");
arrow = ARROW_UNDEF;
_local2 = true;
break;
case LayerElementProxy.STATE_UNDO_MOVE_WEST:
if (!Global_Settings.SWIFT_UNDO){
gotoAndStop("move_west");
arrow = ARROW_UNDEF;
_local2 = true;
reverseAnimation = true;
};
break;
case LayerElementProxy.STATE_MOVE_SOUTH:
gotoAndStop("move_south");
arrow = ARROW_UNDEF;
_local2 = true;
break;
case LayerElementProxy.STATE_UNDO_MOVE_SOUTH:
if (!Global_Settings.SWIFT_UNDO){
gotoAndStop("move_south");
arrow = ARROW_UNDEF;
_local2 = true;
reverseAnimation = true;
};
break;
case LayerElementProxy_Character.STATE_FIGHT_WITH_GHOST:
gotoAndStop("fight_ghost");
_local2 = true;
break;
case LayerElementProxy_Character.STATE_FIGHT_WITH_HERO:
gotoAndStop("fight_hero");
_local2 = true;
break;
case LayerElementProxy_Character.STATE_FIGHT_WITH_KNIGHT:
gotoAndStop("fight_knight");
_local2 = true;
break;
case LayerElementProxy_Character.STATE_FIGHT_WITH_MADAM:
gotoAndStop("fight_madam");
_local2 = true;
break;
};
removeEventListener(Event.ENTER_FRAME, listenEnterFrame, false);
if (_arg1 != CommonFunc.INT_UNDEF){
removeAnimatedBody();
if (_local2){
canHaveBody = true;
addEventListener(Event.ENTER_FRAME, listenEnterFrame, false, 0, true);
};
};
};
}
private function listenAdded(_arg1:Event):void{
if (_arg1.target == this){
};
}
override public function freezeAnimation():void{
state = LayerElementProxy.STATE_LOOK_SOUTH;
}
protected function listenEnterFrame(_arg1:Event):void{
var _local2:MovieClip;
if (m_mcAnimatedBody == null){
switch (state){
case LayerElementProxy.STATE_LOOK_NORTH:
case LayerElementProxy.STATE_LOOK_NORTH_WAIT_FOR_PUSH:
_local2 = (getChildByName("look_north_mc") as MovieClip);
gotoRandomFrame(_local2);
break;
case LayerElementProxy.STATE_LOOK_EAST:
case LayerElementProxy.STATE_LOOK_EAST_WAIT_FOR_PUSH:
_local2 = (getChildByName("look_east_mc") as MovieClip);
gotoRandomFrame(_local2);
break;
case LayerElementProxy.STATE_LOOK_WEST:
case LayerElementProxy.STATE_LOOK_WEST_WAIT_FOR_PUSH:
_local2 = (getChildByName("look_west_mc") as MovieClip);
gotoRandomFrame(_local2);
break;
case LayerElementProxy.STATE_LOOK_SOUTH:
case LayerElementProxy.STATE_LOOK_SOUTH_WAIT_FOR_PUSH:
_local2 = (getChildByName("look_south_mc") as MovieClip);
gotoRandomFrame(_local2);
break;
case LayerElementProxy.STATE_MOVE_NORTH:
_local2 = (getChildByName("move_north_mc") as MovieClip);
break;
case LayerElementProxy.STATE_UNDO_MOVE_NORTH:
_local2 = (getChildByName("move_north_mc") as MovieClip);
break;
case LayerElementProxy.STATE_MOVE_EAST:
_local2 = (getChildByName("move_east_mc") as MovieClip);
break;
case LayerElementProxy.STATE_UNDO_MOVE_EAST:
_local2 = (getChildByName("move_east_mc") as MovieClip);
break;
case LayerElementProxy.STATE_MOVE_WEST:
_local2 = (getChildByName("move_west_mc") as MovieClip);
break;
case LayerElementProxy.STATE_UNDO_MOVE_WEST:
_local2 = (getChildByName("move_west_mc") as MovieClip);
break;
case LayerElementProxy.STATE_MOVE_SOUTH:
_local2 = (getChildByName("move_south_mc") as MovieClip);
break;
case LayerElementProxy.STATE_UNDO_MOVE_SOUTH:
_local2 = (getChildByName("move_south_mc") as MovieClip);
break;
case LayerElementProxy_Character.STATE_FIGHT_WITH_GHOST:
_local2 = (getChildByName("fight_ghost_mc") as MovieClip);
break;
case LayerElementProxy_Character.STATE_FIGHT_WITH_HERO:
_local2 = (getChildByName("fight_hero_mc") as MovieClip);
break;
case LayerElementProxy_Character.STATE_FIGHT_WITH_KNIGHT:
_local2 = (getChildByName("fight_knight_mc") as MovieClip);
break;
case LayerElementProxy_Character.STATE_FIGHT_WITH_MADAM:
_local2 = (getChildByName("fight_madam_mc") as MovieClip);
break;
};
if (addAnimatedBody(_local2)){
removeEventListener(Event.ENTER_FRAME, listenEnterFrame, false);
};
};
}
}
}//package game.view.components.Elements.Character
Section 165
//UI_Character_Ghost (game.view.components.Elements.Character.UI_Character_Ghost)
package game.view.components.Elements.Character {
import flash.display.*;
public class UI_Character_Ghost extends UI_Character {
public var fight_knight_mc:MovieClip;
public var look_east_mc:MovieClip;
public var fight_madam_mc:MovieClip;
public var look_west_mc:MovieClip;
public var look_north_mc:MovieClip;
public var move_east_mc:MovieClip;
public var fight_ghost_mc:MovieClip;
public var fight_hero_mc:MovieClip;
public var move_west_mc:MovieClip;
public var move_north_mc:MovieClip;
public var look_south_mc:MovieClip;
public var move_south_mc:MovieClip;
public function UI_Character_Ghost(_arg1:Boolean=false, _arg2:int=-1){
super(_arg1, _arg2);
}
}
}//package game.view.components.Elements.Character
Section 166
//UI_Character_Hero (game.view.components.Elements.Character.UI_Character_Hero)
package game.view.components.Elements.Character {
import flash.display.*;
import flash.utils.*;
import flash.events.*;
import game.model.Elements.*;
import main.*;
public class UI_Character_Hero extends UI_Character {
public var push_west_mc:MovieClip;
public var arrow_wait_mc:MovieClip;
private var m_nBoredTime:Number;
public var arrow_push_west_mc:MovieClip;
public var look_west_mc:MovieClip;
public var fight_madam_mc:MovieClip;
public var arrow_north_mc:MovieClip;
public var fight_ghost_mc:MovieClip;
public var look_north_mc:MovieClip;
public var move_east_mc:MovieClip;
public var push_north_mc:MovieClip;
public var wait_nose_mc:MovieClip;
public var arrow_south_mc:MovieClip;
public var fight_hero_mc:MovieClip;
public var push_south_mc:MovieClip;
public var arrow_push_north_mc:MovieClip;
public var look_south_mc:MovieClip;
public var arrow_east_mc:MovieClip;
public var push_east_mc:MovieClip;
public var arrow_push_south_mc:MovieClip;
public var fight_knight_mc:MovieClip;
public var wait_bear_mc:MovieClip;
public var arrow_push_east_mc:MovieClip;
public var look_east_mc:MovieClip;
public var wait_chupa_mc:MovieClip;
public var move_north_mc:MovieClip;
public var move_west_mc:MovieClip;
public var arrow_west_mc:MovieClip;
public var move_south_mc:MovieClip;
public function UI_Character_Hero(_arg1:Boolean=false, _arg2:int=-1){
super(_arg1, _arg2);
}
protected function isBored():Boolean{
if (m_nBoredTime < getTimer()){
return (true);
};
return (false);
}
override protected function onFinishAnimation():void{
var _local1:Number;
var _local2:String;
super.onFinishAnimation();
switch (state){
case LayerElementProxy.STATE_LOOK_SOUTH:
case LayerElementProxy.STATE_LOOK_NORTH:
case LayerElementProxy.STATE_LOOK_WEST:
case LayerElementProxy.STATE_LOOK_EAST:
_local1 = ((Math.random() + Global_Settings.BORED_PROBABILITY) - 1);
if (((isBored()) && ((_local1 > 0)))){
_local1 = (_local1 / Global_Settings.BORED_PROBABILITY);
if (_local1 < (1 / 3)){
gotoAndStop("wait_bear");
} else {
if (_local1 < (2 / 3)){
gotoAndStop("wait_chupa");
} else {
gotoAndStop("wait_nose");
};
};
removeAnimatedBody();
removeEventListener(Event.ENTER_FRAME, listenEnterFrame, false);
addEventListener(Event.ENTER_FRAME, listenEnterFrame, false, 0, true);
} else {
_local2 = getLabelByState(state);
if (_local2 != null){
if (currentLabel != _local2){
gotoAndStop(_local2);
removeAnimatedBody();
removeEventListener(Event.ENTER_FRAME, listenEnterFrame, false);
addEventListener(Event.ENTER_FRAME, listenEnterFrame, false, 0, true);
};
};
};
break;
default:
break;
};
}
override protected function removeAnimatedBody():void{
startBored();
super.removeAnimatedBody();
}
override protected function listenEnterFrame(_arg1:Event):void{
var _local2:MovieClip;
super.listenEnterFrame(_arg1);
if (m_mcAnimatedBody == null){
switch (state){
case LayerElementProxy.STATE_UNDO_PUSH_EAST:
case LayerElementProxy.STATE_PUSH_EAST:
_local2 = (getChildByName("push_east_mc") as MovieClip);
break;
case LayerElementProxy.STATE_PUSH_WEST:
case LayerElementProxy.STATE_UNDO_PUSH_WEST:
_local2 = (getChildByName("push_west_mc") as MovieClip);
break;
case LayerElementProxy.STATE_PUSH_NORTH:
case LayerElementProxy.STATE_UNDO_PUSH_NORTH:
_local2 = (getChildByName("push_north_mc") as MovieClip);
break;
case LayerElementProxy.STATE_PUSH_SOUTH:
case LayerElementProxy.STATE_UNDO_PUSH_SOUTH:
_local2 = (getChildByName("push_south_mc") as MovieClip);
break;
case LayerElementProxy.STATE_LOOK_SOUTH:
case LayerElementProxy.STATE_LOOK_WEST:
case LayerElementProxy.STATE_LOOK_EAST:
case LayerElementProxy.STATE_LOOK_NORTH:
_local2 = (getChildByName("wait_bear_mc") as MovieClip);
if (_local2 == null){
_local2 = (getChildByName("wait_chupa_mc") as MovieClip);
if (_local2 == null){
_local2 = (getChildByName("wait_nose_mc") as MovieClip);
};
};
break;
};
if (addAnimatedBody(_local2)){
removeEventListener(Event.ENTER_FRAME, listenEnterFrame, false);
};
};
}
override protected function onChangeState(_arg1:int):void{
var _local2:Boolean;
if (state != _arg1){
_local2 = false;
switch (_arg1){
case LayerElementProxy.STATE_PUSH_EAST:
gotoAndStop("push_east");
_local2 = true;
reverseAnimation = false;
break;
case LayerElementProxy.STATE_PUSH_WEST:
gotoAndStop("push_west");
_local2 = true;
reverseAnimation = false;
break;
case LayerElementProxy.STATE_PUSH_NORTH:
gotoAndStop("push_north");
_local2 = true;
reverseAnimation = false;
break;
case LayerElementProxy.STATE_PUSH_SOUTH:
gotoAndStop("push_south");
_local2 = true;
reverseAnimation = false;
break;
case LayerElementProxy.STATE_UNDO_PUSH_EAST:
if (!Global_Settings.SWIFT_UNDO){
gotoAndStop("push_east");
_local2 = true;
reverseAnimation = true;
};
break;
case LayerElementProxy.STATE_UNDO_PUSH_WEST:
if (!Global_Settings.SWIFT_UNDO){
gotoAndStop("push_west");
_local2 = true;
reverseAnimation = true;
};
break;
case LayerElementProxy.STATE_UNDO_PUSH_NORTH:
if (!Global_Settings.SWIFT_UNDO){
gotoAndStop("push_north");
_local2 = true;
reverseAnimation = true;
};
break;
case LayerElementProxy.STATE_UNDO_PUSH_SOUTH:
if (!Global_Settings.SWIFT_UNDO){
gotoAndStop("push_south");
_local2 = true;
reverseAnimation = true;
};
break;
default:
super.onChangeState(_arg1);
return;
};
removeAnimatedBody();
removeEventListener(Event.ENTER_FRAME, listenEnterFrame, false);
if (_arg1 != LayerElementProxy.STATE_UNDEF){
if (_local2){
canHaveBody = true;
addEventListener(Event.ENTER_FRAME, listenEnterFrame, false, 0, true);
};
};
};
}
protected function startBored():void{
m_nBoredTime = (Global_Settings.BORED_TIME + getTimer());
}
}
}//package game.view.components.Elements.Character
Section 167
//UI_Character_Knight (game.view.components.Elements.Character.UI_Character_Knight)
package game.view.components.Elements.Character {
import flash.display.*;
public class UI_Character_Knight extends UI_Character {
public var fight_knight_mc:MovieClip;
public var look_east_mc:MovieClip;
public var fight_madam_mc:MovieClip;
public var look_west_mc:MovieClip;
public var look_north_mc:MovieClip;
public var move_east_mc:MovieClip;
public var fight_ghost_mc:MovieClip;
public var fight_hero_mc:MovieClip;
public var move_west_mc:MovieClip;
public var move_north_mc:MovieClip;
public var look_south_mc:MovieClip;
public var move_south_mc:MovieClip;
public function UI_Character_Knight(_arg1:Boolean=false, _arg2:int=-1){
super(_arg1, _arg2);
}
}
}//package game.view.components.Elements.Character
Section 168
//UI_Character_Madam (game.view.components.Elements.Character.UI_Character_Madam)
package game.view.components.Elements.Character {
import flash.display.*;
public class UI_Character_Madam extends UI_Character {
public var fight_knight_mc:MovieClip;
public var look_east_mc:MovieClip;
public var fight_madam_mc:MovieClip;
public var look_west_mc:MovieClip;
public var look_north_mc:MovieClip;
public var move_east_mc:MovieClip;
public var fight_ghost_mc:MovieClip;
public var fight_hero_mc:MovieClip;
public var move_west_mc:MovieClip;
public var move_north_mc:MovieClip;
public var look_south_mc:MovieClip;
public var move_south_mc:MovieClip;
public function UI_Character_Madam(_arg1:Boolean=false, _arg2:int=-1){
super(_arg1, _arg2);
}
}
}//package game.view.components.Elements.Character
Section 169
//UI_Element (game.view.components.Elements.UI_Element)
package game.view.components.Elements {
import flash.display.*;
public class UI_Element extends MovieClip {
protected var m_nMovedToX:int;
protected var m_nMovedToY:int;
protected function gotoRandomFrame(_arg1:MovieClip):void{
var _local2:int;
if (_arg1 != null){
_local2 = _arg1.totalFrames;
if (_local2 > 1){
_local2 = (1 + int((_local2 * Math.random())));
_arg1.gotoAndStop(_local2);
};
};
}
protected function isCurLabel(_arg1:String):Boolean{
var _local2:int;
var _local3:FrameLabel;
_local2 = currentFrame;
for each (_local3 in currentLabels) {
if ((((_local3.frame == _local2)) && ((_local3.name == _arg1)))){
return (true);
};
};
return (false);
}
}
}//package game.view.components.Elements
Section 170
//UI_Element_With_Animation (game.view.components.Elements.UI_Element_With_Animation)
package game.view.components.Elements {
import flash.display.*;
import flash.events.*;
public class UI_Element_With_Animation extends UI_Element {
private var m_nAnimationLength_Half:int;
private var m_nTimeForMoveByTicks:int;// = 10
protected var m_mcAnimatedBody:MovieClip;
protected var m_bRepeat:Boolean;// = true
private var m_nAnimationLength:int;
private var m_bReverseAnimation:Boolean;// = false
public static const ON_TIMER_UPDATE_REMOVE:String = "onTimerUpdateRemove";
public static const ON_HALFWAY_ANIMATION:String = "onHalfWayAnimation";
public static const ON_TIMER_UPDATE_ADD:String = "onTimerUpdateAdd";
private static const STEP_LABEL:String = "step";
public static const ON_STEP:String = "onStep";
public static const ON_FINISH_ANIMATION:String = "onFinishAnimation";
public function UI_Element_With_Animation(_arg1:Boolean=false){
m_nTimeForMoveByTicks = 10;
m_bReverseAnimation = false;
m_bRepeat = true;
super();
stop();
if (_arg1){
freezeAnimation();
} else {
startAnimation();
};
}
public function isCanNoticeFinishState():Boolean{
return (((!((m_mcAnimatedBody == null))) && ((m_nAnimationLength > 1))));
}
protected function addAnimatedBody(_arg1:MovieClip):Boolean{
var _local2:Array;
var _local3:FrameLabel;
m_mcAnimatedBody = _arg1;
if (m_mcAnimatedBody != null){
m_mcAnimatedBody.stop();
m_nAnimationLength = m_mcAnimatedBody.totalFrames;
m_nAnimationLength_Half = -1;
_local2 = m_mcAnimatedBody.currentLabels;
for each (_local3 in _local2) {
if (_local3.name == "halfway"){
m_nAnimationLength_Half = _local3.frame;
break;
};
};
if (m_nAnimationLength_Half == -1){
m_nAnimationLength_Half = (m_nAnimationLength >> 1);
};
if (m_bReverseAnimation){
m_mcAnimatedBody.gotoAndStop(m_nAnimationLength);
};
dispatchEvent(new Event(ON_TIMER_UPDATE_ADD));
return (true);
};
return (false);
}
public function set repeat(_arg1:Boolean):void{
m_bRepeat = _arg1;
}
private function allChildPrevFrame(_arg1:MovieClip):void{
var _local2:int;
var _local3:MovieClip;
var _local4:int;
var _local5:int;
if (_arg1 != null){
_local2 = _arg1.numChildren;
while (--_local2 >= 0) {
_local3 = (_arg1.getChildAt(_local2) as MovieClip);
if (_local3 != null){
_local4 = _local3.totalFrames;
_local5 = _local3.currentFrame;
if (_local4 > 1){
if (_local5 <= 1){
_local3.gotoAndStop(_local4);
} else {
_local3.prevFrame();
};
};
allChildPrevFrame(_local3);
};
};
};
}
public function get animationlength():int{
return (m_nAnimationLength);
}
public function startAnimation():void{
}
protected function onFinishAnimation():void{
dispatchEvent(new Event(ON_FINISH_ANIMATION));
}
public function set reverseAnimation(_arg1:Boolean):void{
m_bReverseAnimation = _arg1;
}
protected function removeAnimatedBody():void{
m_mcAnimatedBody = null;
dispatchEvent(new Event(ON_TIMER_UPDATE_REMOVE));
}
private function allChildNextFrame(_arg1:MovieClip):void{
var _local2:int;
var _local3:MovieClip;
var _local4:int;
var _local5:int;
if (_arg1 != null){
_local2 = _arg1.numChildren;
while (--_local2 >= 0) {
_local3 = (_arg1.getChildAt(_local2) as MovieClip);
if (_local3 != null){
_local4 = _local3.totalFrames;
_local5 = _local3.currentFrame;
if (_local4 > 1){
if (_local4 == _local5){
_local3.gotoAndStop(1);
} else {
_local3.nextFrame();
};
};
allChildNextFrame(_local3);
};
};
};
}
public function get animationlengthHalf():int{
return (m_nAnimationLength_Half);
}
public function listenTimer():void{
var _local1:int;
if (isCanNoticeFinishState()){
_local1 = m_mcAnimatedBody.currentFrame;
if (m_bReverseAnimation){
if (_local1 == 1){
if (m_bRepeat){
m_mcAnimatedBody.gotoAndStop(m_nAnimationLength);
};
onFinishAnimation();
} else {
m_mcAnimatedBody.prevFrame();
};
allChildPrevFrame(m_mcAnimatedBody);
} else {
if (_local1 == m_nAnimationLength){
if (m_bRepeat){
m_mcAnimatedBody.gotoAndStop(1);
};
onFinishAnimation();
} else {
m_mcAnimatedBody.nextFrame();
};
allChildNextFrame(m_mcAnimatedBody);
};
if (_local1 == m_nAnimationLength_Half){
dispatchEvent(new Event(ON_HALFWAY_ANIMATION));
};
} else {
if (m_nAnimationLength == 1){
onFinishAnimation();
};
};
}
public function freezeAnimation():void{
}
}
}//package game.view.components.Elements
Section 171
//UI_Element_With_Trigger (game.view.components.Elements.UI_Element_With_Trigger)
package game.view.components.Elements {
public class UI_Element_With_Trigger extends UI_Element_With_Animation {
private var m_nState:int;
private var m_bCanHaveBody:Boolean;
public static const ON_FINISH_STATE:String = "onFinishState";
public static const STATE_UNDEF:int = -1;
public static const ON_HALFWAY_STATE:String = "onHalfWayState";
public function UI_Element_With_Trigger(_arg1:Boolean=false, _arg2:int=-1){
state = _arg2;
super(_arg1);
}
public function get canHaveBody():Boolean{
return (m_bCanHaveBody);
}
public function set state(_arg1:int):void{
if (m_nState != _arg1){
onChangeState(_arg1);
m_nState = _arg1;
};
}
public function set canHaveBody(_arg1:Boolean):void{
m_bCanHaveBody = _arg1;
}
protected function onChangeState(_arg1:int):void{
canHaveBody = false;
}
public function get state():int{
return (m_nState);
}
}
}//package game.view.components.Elements
Section 172
//UI_Item_Candlestick (game.view.components.Elements.UI_Item_Candlestick)
package game.view.components.Elements {
import flash.display.*;
public class UI_Item_Candlestick extends UI_Element_With_Animation {
public var candlestick_mc:MovieClip;
public function UI_Item_Candlestick(_arg1:Boolean=false){
super(_arg1);
}
override public function startAnimation():void{
var _local1:int;
var _local2:MovieClip;
var _local3:int;
var _local4:MovieClip;
_local2 = (getChildByName("candlestick_mc") as MovieClip);
if (_local2 != null){
_local3 = 5;
while (--_local3 >= 0) {
_local4 = (_local2.getChildByName(("flame_mc_" + _local3)) as MovieClip);
if (_local4 != null){
_local1 = (1 + (Math.random() * _local4.totalFrames));
_local4.gotoAndPlay(_local1);
};
};
};
}
override public function freezeAnimation():void{
var _local1:int;
var _local2:MovieClip;
var _local3:int;
var _local4:MovieClip;
_local2 = (getChildByName("candlestick_mc") as MovieClip);
if (_local2 != null){
_local3 = 5;
while (--_local3 >= 0) {
_local4 = (_local2.getChildByName(("flame_mc_" + _local3)) as MovieClip);
if (_local4 != null){
_local4.gotoAndStop("freez");
};
};
};
}
}
}//package game.view.components.Elements
Section 173
//UI_Item_Fire (game.view.components.Elements.UI_Item_Fire)
package game.view.components.Elements {
import flash.display.*;
public class UI_Item_Fire extends UI_Element_With_Animation {
public var flame_mc:MovieClip;
public function UI_Item_Fire(_arg1:Boolean=false){
super(_arg1);
}
override public function startAnimation():void{
var _local1:int;
var _local2:MovieClip;
_local1 = (1 + (Math.random() * totalFrames));
gotoAndPlay(_local1);
_local2 = (getChildByName("flame_mc") as MovieClip);
if (_local2 != null){
_local1 = (1 + (Math.random() * _local2.totalFrames));
_local2.gotoAndPlay(_local1);
};
}
override public function freezeAnimation():void{
var _local1:MovieClip;
gotoAndStop("freez");
_local1 = (getChildByName("flame_mc") as MovieClip);
if (_local1 != null){
_local1.gotoAndPlay("freez");
};
}
}
}//package game.view.components.Elements
Section 174
//UI_Item_Info (game.view.components.Elements.UI_Item_Info)
package game.view.components.Elements {
import flash.events.*;
import game.model.Elements.*;
public class UI_Item_Info extends UI_Element_With_Trigger {
private var m_nAnimatedElements:int;// = 0
public function UI_Item_Info(_arg1:Boolean=false, _arg2:int=-1){
m_nAnimatedElements = 0;
super(_arg1, _arg2);
repeat = false;
}
private function startWatchNextFrame():void{
addEventListener(Event.ENTER_FRAME, listenEnterFrame, false, 0, true);
}
override public function startAnimation():void{
state = LayerElementProxy_Info.STATE_INFO_ON;
}
override protected function onChangeState(_arg1:int):void{
super.onChangeState(_arg1);
switch (_arg1){
case LayerElementProxy_Info.STATE_INFO_OFF:
gotoAndStop("off");
startWatchNextFrame();
break;
case LayerElementProxy_Info.STATE_INFO_ON:
gotoAndStop("on");
startWatchNextFrame();
break;
};
m_nAnimatedElements = 1;
}
override public function freezeAnimation():void{
gotoAndStop("off");
}
private function listenEnterFrame(_arg1:Event):void{
if (m_nAnimatedElements > 0){
m_nAnimatedElements = 0;
if (state == LayerElementProxy_Key.STATE_KEY_ON){
if (!isCurLabel("on")){
m_nAnimatedElements = 1;
nextFrame();
};
} else {
if (state == LayerElementProxy_Key.STATE_KEY_OFF){
if (!isCurLabel("off")){
m_nAnimatedElements = 1;
prevFrame();
};
};
};
};
}
private function stopWatchNextFrame():void{
removeEventListener(Event.ENTER_FRAME, listenEnterFrame, false);
}
}
}//package game.view.components.Elements
Section 175
//UI_Item_Key (game.view.components.Elements.UI_Item_Key)
package game.view.components.Elements {
import flash.events.*;
import game.model.Elements.*;
public class UI_Item_Key extends UI_Element_With_Trigger {
var m_nAnimatedElements:int;// = 0
public function UI_Item_Key(_arg1:Boolean=false, _arg2:int=-1){
m_nAnimatedElements = 0;
super(_arg1, _arg2);
addEventListener(Event.ENTER_FRAME, listenEnterFrame, false, 0, true);
}
override public function startAnimation():void{
state = LayerElementProxy_Key.STATE_KEY_OFF;
}
override protected function onChangeState(_arg1:int):void{
super.onChangeState(_arg1);
m_nAnimatedElements = 1;
}
override public function freezeAnimation():void{
gotoAndStop("freez");
}
private function listenEnterFrame(_arg1:Event):void{
if (m_nAnimatedElements > 0){
m_nAnimatedElements = 0;
if (state == LayerElementProxy_Key.STATE_KEY_ON){
if (!isCurLabel("on")){
m_nAnimatedElements = 1;
nextFrame();
};
} else {
if (state == LayerElementProxy_Key.STATE_KEY_OFF){
if (!isCurLabel("off")){
m_nAnimatedElements = 1;
prevFrame();
};
};
};
};
}
}
}//package game.view.components.Elements
Section 176
//UI_Item_Key_Blue (game.view.components.Elements.UI_Item_Key_Blue)
package game.view.components.Elements {
public class UI_Item_Key_Blue extends UI_Item_Key {
public function UI_Item_Key_Blue(_arg1:Boolean=false, _arg2:int=-1){
super(_arg1, _arg2);
}
}
}//package game.view.components.Elements
Section 177
//UI_Item_Key_Green (game.view.components.Elements.UI_Item_Key_Green)
package game.view.components.Elements {
public class UI_Item_Key_Green extends UI_Item_Key {
public function UI_Item_Key_Green(_arg1:Boolean=false, _arg2:int=-1){
super(_arg1, _arg2);
}
}
}//package game.view.components.Elements
Section 178
//UI_Item_Key_Red (game.view.components.Elements.UI_Item_Key_Red)
package game.view.components.Elements {
public class UI_Item_Key_Red extends UI_Item_Key {
public function UI_Item_Key_Red(_arg1:Boolean=false, _arg2:int=-1){
super(_arg1, _arg2);
}
}
}//package game.view.components.Elements
Section 179
//UI_Labyrinth_Item_Torch (game.view.components.Elements.UI_Labyrinth_Item_Torch)
package game.view.components.Elements {
import flash.display.*;
public class UI_Labyrinth_Item_Torch extends UI_Element_With_Animation {
public var tourch_mc:MovieClip;
override public function startAnimation():void{
var _local1:int;
var _local2:MovieClip;
var _local3:MovieClip;
_local3 = (getChildByName("tourch_mc") as MovieClip);
if (_local3 != null){
_local1 = (1 + (Math.random() * _local3.totalFrames));
_local3.gotoAndPlay(_local1);
};
}
override public function freezeAnimation():void{
var _local1:MovieClip;
var _local2:MovieClip;
_local2 = (getChildByName("tourch_mc") as MovieClip);
if (_local2 != null){
_local2.gotoAndStop("freez");
};
}
}
}//package game.view.components.Elements
Section 180
//UI_Raft (game.view.components.Elements.UI_Raft)
package game.view.components.Elements {
import flash.display.*;
public class UI_Raft extends MovieClip {
}
}//package game.view.components.Elements
Section 181
//UI_Trap_Sharp (game.view.components.Elements.UI_Trap_Sharp)
package game.view.components.Elements {
import flash.display.*;
import flash.events.*;
public class UI_Trap_Sharp extends UI_Element_With_Trigger {
private var m_nAnimatedElements:int;// = 1
public static const STATE_SHARP_ON:int = 1;
public static const STATE_SHARP_OFF:int = 0;
public function UI_Trap_Sharp(_arg1:Boolean=false, _arg2:int=-1){
m_nAnimatedElements = 1;
super(_arg1, _arg2);
addEventListener(Event.ENTER_FRAME, listenEnterFrame, false, 0, true);
}
override public function startAnimation():void{
stopAllSharps();
state = STATE_SHARP_ON;
}
override protected function onChangeState(_arg1:int):void{
super.onChangeState(_arg1);
m_nAnimatedElements = 1;
}
override public function freezeAnimation():void{
var _local1:int;
var _local2:MovieClip;
_local1 = 9;
while (--_local1 >= 0) {
_local2 = (getChildByName(("sharp_mc_" + _local1)) as MovieClip);
if (_local2 != null){
_local2.gotoAndStop("freez");
};
};
}
private function listenEnterFrame(_arg1:Event):void{
var _local2:int;
var _local3:MovieClip;
_local2 = 9;
if (m_nAnimatedElements > 0){
m_nAnimatedElements = 0;
if (state == STATE_SHARP_ON){
while (--_local2 >= 0) {
_local3 = (getChildByName(("sharp_mc_" + _local2)) as MovieClip);
if (_local3 != null){
if (currentLabel != "on"){
m_nAnimatedElements++;
_local3.nextFrame();
} else {
_local3.stop();
};
};
};
} else {
if (state == STATE_SHARP_OFF){
while (--_local2 >= 0) {
_local3 = (getChildByName(("sharp_mc_" + _local2)) as MovieClip);
if (_local3 != null){
if (currentLabel != "off"){
m_nAnimatedElements++;
_local3.prevFrame();
} else {
_local3.stop();
};
};
};
};
};
};
}
private function stopAllSharps():void{
var _local1:int;
var _local2:MovieClip;
_local1 = 9;
while (--_local1 >= 0) {
_local2 = (getChildByName(("sharp_mc_" + _local1)) as MovieClip);
if (_local2 != null){
_local2.stop();
};
};
}
}
}//package game.view.components.Elements
Section 182
//UI_Trap_Sharp_Blue (game.view.components.Elements.UI_Trap_Sharp_Blue)
package game.view.components.Elements {
import flash.display.*;
public class UI_Trap_Sharp_Blue extends UI_Trap_Sharp {
public var sharp_mc_4:MovieClip;
public var sharp_mc_5:MovieClip;
public var sharp_mc_8:MovieClip;
public var sharp_mc_2:MovieClip;
public var sharp_mc_6:MovieClip;
public var sharp_mc_7:MovieClip;
public var sharp_mc_0:MovieClip;
public var sharp_mc_1:MovieClip;
public var sharp_mc_3:MovieClip;
public function UI_Trap_Sharp_Blue(_arg1:Boolean=false, _arg2:int=-1){
super(_arg1, _arg2);
}
}
}//package game.view.components.Elements
Section 183
//UI_Trap_Sharp_Green (game.view.components.Elements.UI_Trap_Sharp_Green)
package game.view.components.Elements {
import flash.display.*;
public class UI_Trap_Sharp_Green extends UI_Trap_Sharp {
public var sharp_mc_4:MovieClip;
public var sharp_mc_5:MovieClip;
public var sharp_mc_8:MovieClip;
public var sharp_mc_2:MovieClip;
public var sharp_mc_6:MovieClip;
public var sharp_mc_7:MovieClip;
public var sharp_mc_0:MovieClip;
public var sharp_mc_1:MovieClip;
public var sharp_mc_3:MovieClip;
public function UI_Trap_Sharp_Green(_arg1:Boolean=false, _arg2:int=-1){
super(_arg1, _arg2);
}
}
}//package game.view.components.Elements
Section 184
//UI_Trap_Sharp_Red (game.view.components.Elements.UI_Trap_Sharp_Red)
package game.view.components.Elements {
import flash.display.*;
public class UI_Trap_Sharp_Red extends UI_Trap_Sharp {
public var sharp_mc_4:MovieClip;
public var sharp_mc_5:MovieClip;
public var sharp_mc_8:MovieClip;
public var sharp_mc_2:MovieClip;
public var sharp_mc_6:MovieClip;
public var sharp_mc_7:MovieClip;
public var sharp_mc_0:MovieClip;
public var sharp_mc_1:MovieClip;
public var sharp_mc_3:MovieClip;
public function UI_Trap_Sharp_Red(_arg1:Boolean=false, _arg2:int=-1){
super(_arg1, _arg2);
}
}
}//package game.view.components.Elements
Section 185
//UI_Water_Bubbles (game.view.components.Elements.UI_Water_Bubbles)
package game.view.components.Elements {
import flash.display.*;
public class UI_Water_Bubbles extends UI_Element_With_Animation {
public var bubble_1:MovieClip;
public var bubble_2:MovieClip;
public var bubble_6:MovieClip;
public var bubble_7:MovieClip;
public var bubble_4:MovieClip;
public var bubble_0:MovieClip;
public var bubble_3:MovieClip;
public var bubble_5:MovieClip;
public function UI_Water_Bubbles(_arg1:Boolean=false){
super(_arg1);
}
override public function startAnimation():void{
var _local1:MovieClip;
var _local2:int;
var _local3:int;
_local2 = numChildren;
while (--_local2 >= 0) {
_local1 = (getChildByName(("bubble_" + _local2)) as MovieClip);
if (_local1 != null){
_local3 = (1 + (_local1.totalFrames * Math.random()));
_local1.gotoAndPlay(_local3);
};
};
}
override public function freezeAnimation():void{
var _local1:MovieClip;
var _local2:int;
var _local3:int;
_local2 = numChildren;
while (--_local2 >= 0) {
_local1 = (getChildAt(_local2) as MovieClip);
if (_local1 != null){
_local1.gotoAndStop("freez");
};
};
}
}
}//package game.view.components.Elements
Section 186
//UI_Game (game.view.components.UI_Game)
package game.view.components {
import flash.display.*;
import flash.events.*;
import main.view.components.*;
import com.Denis.*;
import game.view.components.Buttons.*;
public class UI_Game extends UI_Page {
public var blick2:MovieClip;
public var exitGameBtn:UI_SimpleBtn_Menu;
public var hero_attacked_mc:UI_HeroAttacked;
public var speedControl:BtnSoundControl;
public var level_mc:UI_Level;
public var soundControl:BtnSoundControl;
public var musicControl:BtnSoundControl;
public var undo_btn:UI_SimpleBtn_Undo;
public var musicGameBtn:UI_SimpleBtn_Music;
public var level_rate_mc:UI_Rate_Level;
public var gamezheroBtn:UI_SimpleBtn_Logo;
public var restart_btn:UI_SimpleBtn_Restart;
public var pause_btn:UI_SimpleBtn_Pause;
public var help_info_window_mc:UI_InfoHelp;
public var speedGameBtn:UI_SimpleBtn_Speed;
public var soundGameBtn:UI_SimpleBtn_Sound;
private static const UNDO_BTN:String = "undo_btn";
public static const SPEED_CTL:String = "speedControl";
public static const ON_UNDO:String = "onUndo";
public static const ON_RESTART:String = "onRestart";
public static const NAME:String = "PageGame";
private static const RESTART_BTN:String = "restart_btn";
public static const LEVEL_RATE_NAME:String = "level_rate_mc";
public static const ON_DEACTIVATE:String = "onDeactivate";
private static const PAUSE_BTN:String = "pause_btn";
public static const SPEED_BTN:String = "speedGameBtn";
public static const ON_PAUSE:String = "onPause";
public function UI_Game(){
addBtn((getChildByName(RESTART_BTN) as InteractiveObject), PageEvent.COM_TYPE_DISPATCH_EVENT, new Event(ON_RESTART), (getChildByName("restart_title_mc") as MovieClip));
addBtn((getChildByName(PAUSE_BTN) as InteractiveObject), PageEvent.COM_TYPE_DISPATCH_EVENT, new Event(ON_PAUSE), (getChildByName("pause_title_mc") as MovieClip));
addBtn((getChildByName(UNDO_BTN) as InteractiveObject), PageEvent.COM_TYPE_DISPATCH_EVENT, new Event(ON_UNDO), (getChildByName("undo_title_mc") as MovieClip));
trace(("stage=" + stage));
addEventListener(Event.ADDED_TO_STAGE, listenOnAddToStage);
}
private function listenOnAddToStage(_arg1:Event):void{
trace("X");
trace("UI_Game private function listenOnAddToStage(event:Event):void");
trace(("event.target=" + _arg1.target));
trace(("this = " + this));
if (_arg1.target == this){
stage.addEventListener(Event.DEACTIVATE, listenOnDeactivate, false, 0, true);
};
removeEventListener(Event.ADDED_TO_STAGE, listenOnAddToStage);
}
private function listenOnDeactivate(_arg1:Event):void{
dispatchEvent(new Event(ON_DEACTIVATE));
}
}
}//package game.view.components
Section 187
//UI_HeroAttacked (game.view.components.UI_HeroAttacked)
package game.view.components {
import flash.display.*;
import flash.events.*;
import main.*;
import main.view.components.*;
public class UI_HeroAttacked extends UI_Window {
public var undo_text:undoText;
public var submit_score_mc:SimpleButton;
public var tryAgain_text:TryAgainText;
public var bg_mc:MovieClip;
public var undo_mc:SimpleButton;
public var try_again_mc:SimpleButton;
public var submitScore_text:submitScoreText;
public static const ON_UNDO:String = "onUndo";
public static const ON_SUBMIT_SCORE:String = "onSubmitScore";
public static const ON_TRY_AGAIN:String = "onTryAgain";
public function UI_HeroAttacked(){
var _local1:DisplayObject;
var _local2:InteractiveObject;
super();
visible = false;
disappearOnHide = true;
setShowRect(((Global_Settings.stageWidth - viewWidth) >> 1), ((Global_Settings.stageHeight - viewHeight) >> 1), width, height);
setHideRect((Global_Settings.stageWidth >> 1), (Global_Settings.stageHeight >> 1), 1, 1);
_local1 = (getChildByName("undo_mc") as DisplayObject);
if (_local1 != null){
_local1.addEventListener(MouseEvent.MOUSE_UP, listenOnUndo, false, 0, true);
};
_local1 = (getChildByName("try_again_mc") as DisplayObject);
if (_local1 != null){
_local1.addEventListener(MouseEvent.MOUSE_UP, listenOnTryAgain, false, 0, true);
};
_local2 = (getChildByName("submitScore_text") as InteractiveObject);
if (_local2 != null){
_local2.mouseEnabled = false;
};
_local2 = (getChildByName("undo_text") as InteractiveObject);
if (_local2 != null){
_local2.mouseEnabled = false;
};
_local2 = (getChildByName("tryAgain_text") as InteractiveObject);
if (_local2 != null){
_local2.mouseEnabled = false;
};
}
private function get viewHeight():int{
var _local1:MovieClip;
_local1 = (getChildByName("bg_mc") as MovieClip);
if (_local1 != null){
return (_local1.height);
};
return (height);
}
private function get viewWidth():int{
var _local1:MovieClip;
_local1 = (getChildByName("bg_mc") as MovieClip);
if (_local1 != null){
return (_local1.width);
};
return (width);
}
private function listenOnUndo(_arg1:MouseEvent):void{
dispatchEvent(new Event(ON_UNDO));
}
private function listenOnSubmitScore(_arg1:MouseEvent):void{
dispatchEvent(new Event(ON_SUBMIT_SCORE));
}
public function set activeSubmitBtn(_arg1:Boolean):void{
var _local2:InteractiveObject;
var _local3:InteractiveObject;
_local2 = (getChildByName("submit_score_mc") as InteractiveObject);
_local3 = (getChildByName("submitScore_text") as InteractiveObject);
if (_local2 != null){
_local2.removeEventListener(MouseEvent.MOUSE_UP, listenOnSubmitScore, false);
if (_arg1){
_local2.addEventListener(MouseEvent.MOUSE_UP, listenOnSubmitScore, false, 0, true);
_local2.alpha = 1;
_local2.mouseEnabled = true;
} else {
_local2.alpha = 0.5;
_local2.mouseEnabled = false;
};
};
if (_local3 != null){
if (_arg1){
_local3.alpha = 1;
} else {
_local3.alpha = 0.5;
};
};
}
private function listenOnTryAgain(_arg1:MouseEvent):void{
dispatchEvent(new Event(ON_TRY_AGAIN));
}
}
}//package game.view.components
Section 188
//UI_InfoHelp (game.view.components.UI_InfoHelp)
package game.view.components {
import flash.display.*;
import main.*;
import main.view.components.*;
public class UI_InfoHelp extends UI_Window {
public var show_btn:MovieClip;
public var items_mc:UI_InfoHelp_Items;
public var bg_mc:MovieClip;
public function UI_InfoHelp(){
var _local1:MovieClip;
super();
_local1 = (getChildByName("bg_mc") as MovieClip);
setShowRect(((Global_Settings.stageWidth - _local1.width) >> 1), ((Global_Settings.stageHeight - _local1.height) >> 1), width, height);
setHideRect((Global_Settings.stageWidth >> 1), (Global_Settings.stageHeight >> 1), 1, 1);
disappearOnHide = true;
hideOnClick = true;
buttonMode = true;
useHandCursor = true;
show = false;
}
private function set item(_arg1:int):void{
var _local2:UI_InfoHelp_Items;
_local2 = (getChildByName("items_mc") as UI_InfoHelp_Items);
if (_local2 != null){
_local2.item = _arg1;
};
}
public function showItem(_arg1:int, _arg2:Boolean):void{
item = _arg1;
show = _arg2;
}
}
}//package game.view.components
Section 189
//UI_InfoHelp_Items (game.view.components.UI_InfoHelp_Items)
package game.view.components {
import flash.display.*;
public class UI_InfoHelp_Items extends MovieClip {
public function UI_InfoHelp_Items(){
stop();
}
public function set item(_arg1:int):void{
gotoAndStop((_arg1 + 2));
}
}
}//package game.view.components
Section 190
//UI_Keys (game.view.components.UI_Keys)
package game.view.components {
import flash.display.*;
import flash.events.*;
import flash.ui.*;
public class UI_Keys extends EventDispatcher {
private var m_ioTarget:InteractiveObject;
public static const ON_SPACE_DOWN:String = "spaceDown";
public static const ON_PAUSE_UP:String = "onPauseUp";
public static const ON_PAUSE_DOWN:String = "onPauseDown";
public static const ON_UNDO:String = "onUndo";
public static const ON_RIGHT_UP:String = "onRightUp";
public static const ON_UP_UP:String = "onTopUp";
public static const ON_RIGHT_DOWN:String = "onRightDown";
public static const ON_RESTART:String = "onRestart";
public static const ON_UP_DOWN:String = "onTopDown";
public static const ON_LEFT_UP:String = "onLeftUp";
public static const ON_SPACE_UP:String = "spaceUp";
public static const ON_DOWN_UP:String = "onDownUp";
public static const ON_LEFT_DOWN:String = "onLeftDown";
public static const ON_DOWN_DOWN:String = "onDownDown";
public function UI_Keys(_arg1:InteractiveObject){
m_ioTarget = _arg1;
if (m_ioTarget != null){
m_ioTarget.addEventListener(KeyboardEvent.KEY_DOWN, listenKeyDown, false, 0, true);
m_ioTarget.addEventListener(KeyboardEvent.KEY_UP, listenKeyUp, false, 0, true);
m_ioTarget.stage.focus = m_ioTarget;
};
}
private function listenKeyUp(_arg1:KeyboardEvent):void{
switch (_arg1.keyCode){
case Keyboard.UP:
dispatchEvent(new Event(ON_UP_UP));
break;
case Keyboard.DOWN:
dispatchEvent(new Event(ON_DOWN_UP));
break;
case Keyboard.LEFT:
dispatchEvent(new Event(ON_LEFT_UP));
break;
case Keyboard.RIGHT:
dispatchEvent(new Event(ON_RIGHT_UP));
break;
case Keyboard.SPACE:
dispatchEvent(new Event(ON_SPACE_UP));
break;
case Keyboard.ESCAPE:
case 80:
dispatchEvent(new Event(ON_PAUSE_UP));
break;
};
}
private function listenKeyDown(_arg1:KeyboardEvent):void{
switch (_arg1.keyCode){
case Keyboard.UP:
dispatchEvent(new Event(ON_UP_DOWN));
break;
case Keyboard.DOWN:
dispatchEvent(new Event(ON_DOWN_DOWN));
break;
case Keyboard.LEFT:
dispatchEvent(new Event(ON_LEFT_DOWN));
break;
case Keyboard.RIGHT:
dispatchEvent(new Event(ON_RIGHT_DOWN));
break;
case Keyboard.SPACE:
dispatchEvent(new Event(ON_SPACE_DOWN));
break;
case Keyboard.ESCAPE:
case 80:
dispatchEvent(new Event(ON_PAUSE_DOWN));
break;
case 82:
dispatchEvent(new Event(ON_RESTART));
break;
case 90:
if (_arg1.ctrlKey){
dispatchEvent(new Event(ON_UNDO));
};
break;
};
}
}
}//package game.view.components
Section 191
//UI_Level (game.view.components.UI_Level)
package game.view.components {
import flash.display.*;
import main.*;
public class UI_Level extends Sprite {
public static const NAME:String = "Level";
public function putObject(_arg1:int, _arg2:int, _arg3:int, _arg4:DisplayObject):void{
if (_arg4 == null){
return;
};
_arg4.x = (_arg2 * Global_Settings.CELL_WIDTH);
_arg4.y = (_arg3 * Global_Settings.CELL_HEIGHT);
addChild(_arg4);
}
public function clear():void{
}
}
}//package game.view.components
Section 192
//UI_Pause (game.view.components.UI_Pause)
package game.view.components {
import flash.display.*;
import flash.utils.*;
import flash.events.*;
import main.*;
import com.Denis.*;
import game.view.components.Buttons.*;
import flash.text.*;
import classes.*;
public class UI_Pause extends MovieClip {
public var exitGameBtn:UI_SimpleBtn_Menu;
public var musicGameBtn:UI_SimpleBtn_Music;
private var m_bShow:Boolean;// = false
public var playGameBtn:UI_SimpleBtn_Continue;
public var bg:MovieClip;
public var soundControl:BtnSoundControl;
private var m_dicAlerts:Dictionary;
public var txt:TextField;
public var soundGameBtn:UI_SimpleBtn_Sound;
public var musicControl:BtnSoundControl;
public var gamezheroBtn:UI_SimpleBtn_Logo;
private var m_strCURRENT_QUALITY:String;
public static const ON_CHANGE_SOUND:String = "onChangeSound";
public static const ON_HIDEN:String = "onHiden";
public static const ON_EXIT_GAME:String = "onEditGame";
public static const ON_CHANGE_MUSIC:String = "onChangeMusic";
public static const ON_SHOWED:String = "onShowed";
public static const ON_PLAY_GAME:String = "onPlayGame";
public function UI_Pause(_arg1:MovieClip){
var _local2:UI_SimpleBtn;
m_bShow = false;
super();
if (_arg1 != null){
_arg1.addChild(this);
};
m_dicAlerts = new Dictionary();
stop();
if (stage != null){
m_strCURRENT_QUALITY = stage.quality;
stage.quality = "BEST";
};
Global.music_game.setMusicVolume(0);
show = true;
addEventListener(Event.REMOVED_FROM_STAGE, listenRemove, false, 0, false);
}
public function set show(_arg1:Boolean):void{
setShow(_arg1);
}
public function get show():Boolean{
return (m_bShow);
}
private function listenRemove(_arg1:Event):void{
if (_arg1.target == this){
removeEventListener(Event.ENTER_FRAME, listenEnterFrame, false);
};
}
private function diactivateAllButtons():void{
}
private function iniSoundAndMusic():void{
if (Global._game_stored_data.data.soundVolumeFlag == 1){
Global.sound_game.setSoundVolume(Global._sound_volume_game);
} else {
Global.sound_game.setSoundVolume(0);
};
if (Global._game_stored_data.data.musicVolumeFlag == 1){
Global.music_game.setMusicVolume(Global._music_volume_game);
} else {
Global.music_game.setMusicVolume(0);
};
}
private function mouseOverFunc(_arg1:MouseEvent):void{
var _local2:MovieClip;
var _local3:TextField;
var _local4:UI_SimpleBtn;
var _local5:String;
Global.sound_interface.playSound(null, "s_over", 0, 0);
_local2 = this[_arg1.target.name];
if (_local2.blick2 != null){
_local2.blick2.play();
};
_local3 = (getChildByName("txt") as TextField);
_local4 = (_local2 as UI_SimpleBtn);
if (_local3 != null){
if (((!((_local4 == null))) && (!((_local5 == null))))){
_local5 = _local4.alert;
txt.text = _local5;
} else {
txt.text = "";
};
};
}
public function addBtn(_arg1:UI_SimpleBtn, _arg2:Function, _arg3:int):Boolean{
if (_arg1 == null){
return (false);
};
_arg1.visible = true;
_arg1.addEventListener(MouseEvent.MOUSE_DOWN, _arg2);
_arg1.addEventListener(MouseEvent.ROLL_OVER, mouseOverFunc);
_arg1.addEventListener(MouseEvent.ROLL_OUT, mouseOutFunc);
_arg1.alert = Language_Settings.getInstance().getText(_arg3);
_arg1.buttonMode = true;
_arg1.useHandCursor = true;
return (true);
}
public function setShow(_arg1:Boolean):void{
if (m_bShow != _arg1){
m_bShow = _arg1;
if (_arg1){
gotoAndPlay("show");
} else {
gotoAndPlay("hide");
};
if (!hasEventListener(Event.ENTER_FRAME)){
addEventListener(Event.ENTER_FRAME, listenEnterFrame, false, 0, true);
};
};
}
public function hideBtn(_arg1:MovieClip):void{
if (_arg1 != null){
_arg1.visible = false;
};
}
private function listenEnterFrame(_arg1:Event):void{
if (m_bShow){
if (currentLabel == "hide"){
dispatchEvent(new Event(ON_SHOWED));
removeEventListener(Event.ENTER_FRAME, listenEnterFrame, false);
stop();
};
} else {
if (currentLabel == "show"){
dispatchEvent(new Event(ON_HIDEN));
removeEventListener(Event.ENTER_FRAME, listenEnterFrame, false);
stop();
};
};
}
private function mouseOutFunc(_arg1:MouseEvent):void{
txt.text = "";
}
}
}//package game.view.components
Section 193
//UI_Rate_Level (game.view.components.UI_Rate_Level)
package game.view.components {
import flash.display.*;
import main.view.components.*;
import shared_levels.view.components.*;
public class UI_Rate_Level extends UI_Window {
private var m_bShow:Boolean;
public var rate_mc:UI_Rate_2;
public var bg_mc:MovieClip;
private static const RATE_NAME:String = "rate_mc";
public function UI_Rate_Level(){
disappearOnHide = true;
setShowRect(x, y, width, height);
setHideRect(300, 300, 0, 0);
setShow(false, false);
active = true;
}
public function set active(_arg1:Boolean):void{
var _local2:UI_Rate;
_local2 = (getChildByName(RATE_NAME) as UI_Rate);
if (_local2 != null){
_local2.active = _arg1;
};
}
public function set rate(_arg1:Number):void{
var _local2:UI_Rate;
trace("X");
trace("UI_Rate_Level public function set rate(nValue:Number):void");
_local2 = (getChildByName(RATE_NAME) as UI_Rate);
trace(("uiRate=" + _local2));
trace(("nValue=" + _arg1));
if (_local2 != null){
_local2.value = _arg1;
};
}
}
}//package game.view.components
Section 194
//UI_Undo (game.view.components.UI_Undo)
package game.view.components {
import flash.display.*;
import flash.events.*;
public class UI_Undo extends MovieClip {
public static const ON_CLICK:String = "onClick";
public function UI_Undo(){
mouseEnabled = true;
buttonMode = true;
addEventListener(MouseEvent.MOUSE_UP, listenOnClick, false, 0, true);
}
private function listenOnClick(_arg1:MouseEvent):void{
dispatchEvent(new Event(ON_CLICK));
}
}
}//package game.view.components
Section 195
//ElementMediator (game.view.ElementMediator)
package game.view {
import flash.display.*;
import game.model.*;
import org.puremvc.as3.interfaces.*;
import com.*;
import game.model.Elements.*;
import org.puremvc.as3.patterns.mediator.*;
public class ElementMediator extends Mediator implements IMediator {
protected var m_proxyLayer:LayerProxy;
private var m_nIDElement:int;
protected var m_mLayer:LayerMediator;
public static const ELEMENT_MEDIATOR_FIXLINE:int = 3;
public static const ELEMENT_MEDIATOR_COMPLEX:int = 1;
public static const NAME:String = "ElementMediator";
public static const ELEMENT_MEDIATOR_FIX:int = 2;
public static const ELEMENT_MEDIATOR_SIMPLE:int = 4;
public static const ELEMENT_MEDIATOR_DEF:int = 0;
public function ElementMediator(_arg1:LayerProxy, _arg2:Object){
m_proxyLayer = _arg1;
if (_arg1 != null){
super(((NAME + "_") + _arg1.getProxyName()), _arg2);
};
}
public function get proxyLayer():LayerProxy{
return (m_proxyLayer);
}
public function get ui():DisplayObject{
return ((viewComponent as DisplayObject));
}
public function erase(_arg1:IntPoint, _arg2:int, _arg3:LayerElementProxy):void{
}
public function get elementDepth():int{
return (m_proxyLayer.layerDepth);
}
public function get layerType():int{
if (m_proxyLayer != null){
return (m_proxyLayer.type);
};
return (CommonFunc.INT_UNDEF);
}
public function insertAfter(_arg1:DisplayObjectContainer, _arg2:ElementMediator):Boolean{
var _local3:DisplayObject;
var _local4:int;
var _local5:DisplayObject;
_local3 = ui;
if (((((!((_local3 == null))) && (!((_arg2 == null))))) && (!((_arg1 == null))))){
_local5 = _arg2.ui;
if (_local5 != null){
_local4 = _arg1.getChildIndex(_local5);
_arg1.addChildAt(_local3, (_local4 + 1));
return (true);
};
};
return (false);
}
public function get displayIndex():int{
var _local1:DisplayObject;
var _local2:DisplayObjectContainer;
_local1 = ui;
if (_local1 != null){
_local2 = _local1.parent;
if (_local2 != null){
return (_local2.getChildIndex(_local1));
};
};
return (-1);
}
public function get parent():LayerMediator{
return (m_mLayer);
}
public function get type():int{
return (CommonFunc.INT_UNDEF);
}
public function get id():int{
return (CommonFunc.INT_UNDEF);
}
public function listenTimer():void{
}
public function setElement(_arg1:LayerProxy, _arg2:int):void{
}
public function eraseAll():Boolean{
return (true);
}
public function update(_arg1:IntPoint, _arg2:int, _arg3:LayerElementProxy):void{
}
public function get mediatorType():int{
return (ELEMENT_MEDIATOR_DEF);
}
public function snapToGrid():void{
}
public function set parent(_arg1:LayerMediator):void{
m_mLayer = _arg1;
}
public function set parentDOC(_arg1:DisplayObjectContainer):void{
var _local2:DisplayObject;
if (_arg1 == null){
return;
};
_local2 = ui;
if (_local2 != null){
_arg1.addChild(_local2);
};
}
public function onChangeState(_arg1:LayerElementProxy):void{
}
public function clear():void{
var _local1:DisplayObject;
var _local2:DisplayObjectContainer;
_local1 = ui;
if (_local1 != null){
_local2 = _local1.parent;
if (_local2 != null){
_local2.removeChild(_local1);
};
};
}
public function getLayerDepth():int{
return (m_proxyLayer.layerDepth);
}
public function get proxy():LayerElementProxy{
return (null);
}
public function insertLast(_arg1:DisplayObjectContainer):Boolean{
var _local2:DisplayObject;
_local2 = ui;
if (_local2 != null){
if (_arg1 != null){
_arg1.addChild(_local2);
return (true);
};
};
return (false);
}
public function insertFirst(_arg1:DisplayObjectContainer):Boolean{
var _local2:DisplayObject;
_local2 = ui;
if (_local2 != null){
if (_arg1 != null){
_arg1.addChildAt(_local2, 1);
return (true);
};
};
return (false);
}
public function get x():int{
return (CommonFunc.INT_UNDEF);
}
public function get y():int{
return (CommonFunc.INT_UNDEF);
}
}
}//package game.view
Section 196
//ElementMediator_Complex (game.view.ElementMediator_Complex)
package game.view {
import flash.display.*;
import flash.events.*;
import game.model.*;
import com.*;
import game.model.Elements.*;
import main.*;
import game.view.components.Elements.*;
import game.view.components.Elements.Character.*;
public class ElementMediator_Complex extends ElementMediator {
protected var m_nMoveToY:int;
protected var m_nMoveTime:Number;
protected var m_bCanCrossMargin:Boolean;
private var m_nY:int;
private var m_nX:int;
protected var m_nMoveFromX:int;
protected var m_bCrossMargin:Boolean;
protected var m_nMoveTimeStep:Number;
protected var m_nMoveToX:int;
protected var m_nMoveFromY:int;
private var m_pElement:LayerElementProxy;
public static const NAME:String = "ElementMediator_Complex";
public function ElementMediator_Complex(_arg1:LayerProxy, _arg2:LayerElementProxy){
m_pElement = _arg2;
super(_arg1, null);
genElement(_arg1, _arg2);
}
private function setMoveParamsByState(_arg1:int, _arg2:Number):void{
if (_arg2 != 0){
_arg2 = (1 / _arg2);
};
switch (_arg1){
case LayerElementProxy.STATE_MOVE_EAST:
case LayerElementProxy.STATE_SWIM_EAST:
setMoveParams(((Global_Settings.CELL_WIDTH * (x + 1)) - ui.x), 0, _arg2);
break;
case LayerElementProxy.STATE_MOVE_WEST:
case LayerElementProxy.STATE_SWIM_WEST:
setMoveParams(((Global_Settings.CELL_WIDTH * (x - 1)) - ui.x), 0, _arg2);
break;
case LayerElementProxy.STATE_MOVE_NORTH:
case LayerElementProxy.STATE_SWIM_NORTH:
setMoveParams(0, ((Global_Settings.CELL_HEIGHT * (y - 1)) - ui.y), _arg2);
break;
case LayerElementProxy.STATE_MOVE_SOUTH:
case LayerElementProxy.STATE_SWIM_SOUTH:
setMoveParams(0, ((Global_Settings.CELL_HEIGHT * (y + 1)) - ui.y), _arg2);
break;
case LayerElementProxy.STATE_UNDO_MOVE_EAST:
case LayerElementProxy.STATE_UNDO_SWIM_EAST:
setMoveParams(((Global_Settings.CELL_WIDTH * (x - 1)) - ui.x), 0, _arg2);
break;
case LayerElementProxy.STATE_UNDO_MOVE_WEST:
case LayerElementProxy.STATE_UNDO_SWIM_WEST:
setMoveParams(((Global_Settings.CELL_WIDTH * (x + 1)) - ui.x), 0, _arg2);
break;
case LayerElementProxy.STATE_UNDO_MOVE_NORTH:
case LayerElementProxy.STATE_UNDO_SWIM_NORTH:
setMoveParams(0, ((Global_Settings.CELL_HEIGHT * (y + 1)) - ui.y), _arg2);
break;
case LayerElementProxy.STATE_UNDO_MOVE_SOUTH:
case LayerElementProxy.STATE_UNDO_SWIM_SOUTH:
setMoveParams(0, ((Global_Settings.CELL_HEIGHT * (y - 1)) - ui.y), _arg2);
break;
default:
setMoveParams(0, 0, 0);
break;
};
}
private function listenTimerUpdateRemove(_arg1:Event):void{
var _local2:LayerMediator_List;
_local2 = (parent as LayerMediator_List);
if (_local2 != null){
_local2.removeFromAnimated(this);
};
}
private function genElement(_arg1:LayerProxy, _arg2:LayerElementProxy):MovieClip{
var _local3:MovieClip;
var _local4:UI_Element_With_Trigger;
if (((!((_arg2 == null))) && (!((_arg1 == null))))){
_local3 = Sprites.getItem(_arg2.type, true);
m_nX = _arg2.x;
if ((((_arg1.type == LayerProxy.LAYER_TYPE_DOUBLE_DENSITY)) || ((_arg1.type == LayerProxy.LAYER_TYPE_LABYRINTH)))){
m_nY = (_arg2.y >> 1);
_local3.x = ((_arg2.x >> 1) * Global_Settings.CELL_WIDTH);
_local3.y = (m_nY * Global_Settings.CELL_HEIGHT);
} else {
m_nY = _arg2.y;
_local3.x = (_arg2.x * Global_Settings.CELL_WIDTH);
_local3.y = (_arg2.y * Global_Settings.CELL_HEIGHT);
};
setViewComponent(_local3);
_local4 = (_local3 as UI_Element_With_Trigger);
if (_local4 != null){
_local4.state = _arg2.state;
};
_local3.addEventListener(UI_Element_With_Animation.ON_HALFWAY_ANIMATION, listenStateHalfWay, false, 0, true);
_local3.addEventListener(UI_Element_With_Animation.ON_FINISH_ANIMATION, listenStateFinished, false, 0, true);
_local3.addEventListener(UI_Element_With_Animation.ON_STEP, listenStep, false, 0, true);
_local3.addEventListener(UI_Element_With_Animation.ON_TIMER_UPDATE_ADD, listenTimerUpdateAdd, false, 0, true);
_local3.addEventListener(UI_Element_With_Animation.ON_TIMER_UPDATE_REMOVE, listenTimerUpdateRemove, false, 0, true);
return (_local3);
};
return (null);
}
public function get state():int{
var _local1:UI_Element_With_Trigger;
if (ui != null){
_local1 = (ui as UI_Element_With_Trigger);
if (_local1 != null){
return (_local1.state);
};
};
return (CommonFunc.INT_UNDEF);
}
public function set arrow(_arg1:int):void{
var _local2:UI_Character;
_local2 = (ui as UI_Character);
if (_local2 != null){
_local2.arrow = _arg1;
};
}
public function isRaftUnder():Boolean{
if (proxy != null){
if (proxy.getRaftUnder() != null){
return (true);
};
};
return (false);
}
override public function eraseAll():Boolean{
var _local1:DisplayObjectContainer;
if (ui != null){
_local1 = ui.parent;
if (_local1 != null){
_local1.removeChild(ui);
setViewComponent(null);
};
};
return (super.eraseAll());
}
private function listenStateFinished(_arg1:Event):void{
sendNotification(ApplicationFacade.ELEMENT_FINISH_STATE, proxy);
}
override public function erase(_arg1:IntPoint, _arg2:int, _arg3:LayerElementProxy):void{
var _local4:DisplayObjectContainer;
if (ui != null){
_local4 = ui.parent;
if (_local4 != null){
_local4.removeChild(ui);
setViewComponent(null);
};
};
super.erase(_arg1, _arg2, _arg3);
}
public function swiftMove():Boolean{
m_bCrossMargin = true;
m_nMoveTime = 1;
ui.x = m_nMoveToX;
ui.y = m_nMoveToY;
sendNotification(ApplicationFacade.ELEMENT_CROSS_MARGIN, this);
sendNotification(ApplicationFacade.ELEMENT_FINISH_MOVING, this);
sendNotification(ApplicationFacade.ELEMENT_FINISH_STATE, proxy);
return (true);
}
private function listenStep(_arg1:Event):void{
sendNotification(ApplicationFacade.CHARACTER_STEP, proxy);
}
override public function listenTimer():void{
var _local1:UI_Element_With_Animation;
_local1 = (ui as UI_Element_With_Animation);
if (_local1 != null){
_local1.listenTimer();
};
}
private function setMoveParams(_arg1:int, _arg2:int, _arg3:Number):void{
m_bCanCrossMargin = true;
m_bCrossMargin = false;
m_nMoveTimeStep = _arg3;
m_nMoveTime = 0;
m_nMoveFromX = ui.x;
m_nMoveFromY = ui.y;
m_nMoveToX = (ui.x + _arg1);
m_nMoveToY = (ui.y + _arg2);
}
override public function get type():int{
if (m_pElement == null){
return (CommonFunc.INT_UNDEF);
};
return (m_pElement.type);
}
private function listenOnNeedTimerAnimation(_arg1:Event):void{
}
override public function update(_arg1:IntPoint, _arg2:int, _arg3:LayerElementProxy):void{
genElement(m_proxyLayer, _arg3);
}
override public function snapToGrid():void{
var _local1:DisplayObject;
_local1 = ui;
if (((!((m_proxyLayer == null))) && (!((_local1 == null))))){
if ((((m_proxyLayer.type == LayerProxy.LAYER_TYPE_DOUBLE_DENSITY)) || ((m_proxyLayer.type == LayerProxy.LAYER_TYPE_LABYRINTH)))){
_local1.x = ((m_pElement.x >> 1) * Global_Settings.CELL_WIDTH);
_local1.y = ((m_pElement.y >> 1) * Global_Settings.CELL_HEIGHT);
} else {
_local1.x = (m_pElement.x * Global_Settings.CELL_WIDTH);
_local1.y = (m_pElement.y * Global_Settings.CELL_HEIGHT);
};
};
}
override public function get mediatorType():int{
return (ElementMediator.ELEMENT_MEDIATOR_COMPLEX);
}
public function set state(_arg1:int):void{
var _local2:UI_Element_With_Trigger;
if (ui != null){
_local2 = (ui as UI_Element_With_Trigger);
if (_local2 != null){
_local2.state = _arg1;
if (_local2.canHaveBody){
setMoveParams(0, 0, 0);
return;
};
};
setMoveParamsByState(_arg1, 10);
};
}
private function listenStateHalfWay(_arg1:Event):void{
sendNotification(ApplicationFacade.ELEMENT_HALF_WAY_STATE, proxy);
}
private function listenTimerUpdateAdd(_arg1:Event):void{
var _local2:LayerMediator_List;
var _local3:UI_Element_With_Animation;
var _local4:int;
var _local5:int;
_local2 = (parent as LayerMediator_List);
if (_local2 != null){
_local2.addToAnimated(this);
_local3 = (ui as UI_Element_With_Animation);
_local4 = proxy.state;
if (_local3 != null){
_local5 = _local3.animationlength;
if (_local5 > 0){
setMoveParamsByState(_local4, (_local5 - 1));
};
};
};
}
override public function onChangeState(_arg1:LayerElementProxy):void{
state = _arg1.state;
}
override public function get proxy():LayerElementProxy{
return (m_pElement);
}
public function move():Boolean{
var _local1:Boolean;
var _local2:UI_Element_With_Animation;
_local1 = false;
m_nMoveTime = (m_nMoveTime + m_nMoveTimeStep);
if (ui != null){
ui.x = (m_nMoveFromX + (m_nMoveTime * (m_nMoveToX - m_nMoveFromX)));
ui.y = (m_nMoveFromY + (m_nMoveTime * (m_nMoveToY - m_nMoveFromY)));
};
if (((((m_bCanCrossMargin) && (!(m_bCrossMargin)))) && ((m_nMoveTime > 0.5)))){
m_bCrossMargin = true;
sendNotification(ApplicationFacade.ELEMENT_CROSS_MARGIN, this);
};
if (m_nMoveTime >= 1){
if (ui != null){
ui.x = m_nMoveToX;
ui.y = m_nMoveToY;
};
sendNotification(ApplicationFacade.ELEMENT_FINISH_MOVING, this);
_local2 = (ui as UI_Element_With_Animation);
if (_local2 != null){
if (!_local2.isCanNoticeFinishState()){
sendNotification(ApplicationFacade.ELEMENT_FINISH_STATE, proxy);
};
} else {
sendNotification(ApplicationFacade.ELEMENT_FINISH_STATE, proxy);
};
};
return (_local1);
}
override public function get x():int{
if (proxy != null){
return (proxy.x);
};
return (super.x);
}
override public function get y():int{
if (proxy != null){
return (proxy.y);
};
return (super.y);
}
}
}//package game.view
Section 197
//ElementMediator_Fix (game.view.ElementMediator_Fix)
package game.view {
import flash.display.*;
import game.model.*;
import com.*;
import game.model.Elements.*;
import main.*;
import flash.geom.*;
public class ElementMediator_Fix extends ElementMediator {
public static const NAME:String = "ElementMediator_Fix";
public function ElementMediator_Fix(_arg1:LayerProxy){
var _local2:Number;
var _local3:Number;
var _local4:Bitmap;
_local2 = (_arg1.width * Global_Settings.CELL_WIDTH);
_local3 = (_arg1.height * Global_Settings.CELL_HEIGHT);
_local4 = new Bitmap();
_local4.bitmapData = new BitmapData(_local2, _local3, true, 0);
super(_arg1, _local4);
ui.x = 0;
ui.y = 0;
genElement();
}
private function genElement():Boolean{
if (m_proxyLayer != null){
if (m_proxyLayer.isCompatibleType(LayerProxy.LAYER_TYPE_LIST)){
return (genElementList());
};
return (genElementMatrix());
//unresolved jump
};
return (false);
}
override public function eraseAll():Boolean{
(ui as Bitmap).bitmapData = null;
return (super.eraseAll());
}
override public function erase(_arg1:IntPoint, _arg2:int, _arg3:LayerElementProxy):void{
super.erase(_arg1, _arg2, _arg3);
genElement();
}
override public function update(_arg1:IntPoint, _arg2:int, _arg3:LayerElementProxy):void{
super.update(_arg1, _arg2, _arg3);
genElement();
}
override public function get mediatorType():int{
return (ElementMediator.ELEMENT_MEDIATOR_FIX);
}
private function genElementList():Boolean{
var _local1:Matrix;
var _local2:Sprite;
var _local3:int;
var _local4:int;
var _local5:BitmapData;
var _local6:LayerListProxy;
var _local7:Number;
var _local8:Number;
var _local9:int;
var _local10:int;
var _local11:int;
var _local12:LayerElementProxy;
var _local13:int;
trace("private function genElementList():Boolean");
_local1 = new Matrix();
_local3 = m_proxyLayer.width;
_local4 = m_proxyLayer.height;
_local6 = (m_proxyLayer as LayerListProxy);
if (_local6 == null){
return (false);
};
_local7 = (m_proxyLayer.width * Global_Settings.CELL_WIDTH);
_local8 = (m_proxyLayer.height * Global_Settings.CELL_HEIGHT);
_local5 = ((ui as Bitmap).bitmapData = new BitmapData(_local7, _local8, true, 0));
if (_local5 != null){
_local5.lock();
_local13 = _local6.length;
while (--_local13 >= 0) {
_local12 = _local6.getElement(_local13);
_local2 = Sprites.getItem(_local12.type);
if (_local2 != null){
_local1.tx = (_local12.x * Global_Settings.CELL_WIDTH);
_local1.ty = (_local12.y * Global_Settings.CELL_HEIGHT);
_local5.draw(_local2, _local1);
};
};
_local5.unlock();
} else {
return (false);
};
return (true);
}
private function genElementMatrix():Boolean{
var _local1:Matrix;
var _local2:Sprite;
var _local3:int;
var _local4:int;
var _local5:BitmapData;
var _local6:Number;
var _local7:Number;
var _local8:int;
var _local9:int;
var _local10:int;
_local1 = new Matrix();
_local3 = m_proxyLayer.width;
_local4 = m_proxyLayer.height;
_local6 = (m_proxyLayer.width * Global_Settings.CELL_WIDTH);
_local7 = (m_proxyLayer.height * Global_Settings.CELL_HEIGHT);
_local5 = ((ui as Bitmap).bitmapData = new BitmapData(_local6, _local7, true, 0));
if (_local5 != null){
_local5.lock();
_local8 = _local3;
while (--_local8 >= 0) {
_local9 = _local4;
while (--_local9 >= 0) {
_local10 = m_proxyLayer.getValue_(_local9, _local8);
_local2 = Sprites.getItem(_local10);
if (_local2 != null){
_local1.tx = (_local9 * Global_Settings.CELL_WIDTH);
_local1.ty = (_local8 * Global_Settings.CELL_HEIGHT);
_local5.draw(_local2, _local1);
};
};
};
_local5.unlock();
} else {
return (false);
};
return (true);
}
}
}//package game.view
Section 198
//ElementMediator_FixLine (game.view.ElementMediator_FixLine)
package game.view {
import flash.display.*;
import game.model.*;
import com.*;
import game.model.Elements.*;
import main.*;
import flash.geom.*;
public class ElementMediator_FixLine extends ElementMediator {
var m_nMaxLow:int;// = 100
var m_nY:int;
var m_nMaxHeight:int;// = 100
public static const NAME:String = "ElementMediator_FixLine";
public function ElementMediator_FixLine(_arg1:LayerProxy, _arg2:int, _arg3:Boolean){
var _local4:Bitmap;
var _local5:Number;
var _local6:Number;
m_nMaxHeight = 100;
m_nMaxLow = 100;
_local4 = new Bitmap();
if (_arg3){
_local5 = (((_arg1.width + 1) * Global_Settings.CELL_WIDTH) >> 1);
} else {
_local5 = ((_arg1.width + 1) * Global_Settings.CELL_WIDTH);
};
_local6 = (m_nMaxHeight + m_nMaxLow);
_local4.bitmapData = new BitmapData(_local5, _local6, true, 0);
super(_arg1, _local4);
if (_arg3){
genElement_Double(_arg2);
} else {
genElement(_arg2);
};
ui.y = ((_arg2 * Global_Settings.CELL_HEIGHT) - m_nMaxHeight);
}
private function genElement_Double(_arg1:int):Boolean{
var _local2:Matrix;
var _local3:Sprite;
var _local4:int;
var _local5:int;
var _local6:BitmapData;
var _local7:Number;
var _local8:Number;
var _local9:int;
var _local10:int;
var _local11:int;
m_nY = _arg1;
_local2 = new Matrix();
_local2.ty = m_nMaxHeight;
if (m_proxyLayer != null){
_local4 = m_proxyLayer.width;
_local5 = m_proxyLayer.height;
_local7 = ((m_proxyLayer.width * Global_Settings.CELL_WIDTH) >> 1);
_local8 = (m_nMaxHeight + m_nMaxLow);
_local6 = ((ui as Bitmap).bitmapData = new BitmapData(_local7, _local8, true, 0));
if (_local6 != null){
_local6.lock();
_arg1 = (_arg1 << 1);
_local9 = 0;
_local11 = 0;
while (_local9 < _local4) {
_local2.tx = (_local11 * Global_Settings.CELL_WIDTH);
_local10 = m_proxyLayer.getValue_(_local9, _arg1);
_local3 = Sprites.getItem(_local10);
if (_local3 != null){
_local6.draw(_local3, _local2);
};
_arg1++;
if (_arg1 < _local5){
_local10 = m_proxyLayer.getValue_(_local9, _arg1);
_local3 = Sprites.getItem(_local10);
if (_local3 != null){
_local6.draw(_local3, _local2);
};
};
_local9++;
_arg1--;
if (_local9 >= _local4){
break;
};
_local10 = m_proxyLayer.getValue_(_local9, _arg1);
_local3 = Sprites.getItem(_local10);
if (_local3 != null){
_local6.draw(_local3, _local2);
};
_arg1++;
if (_arg1 < _local5){
_local10 = m_proxyLayer.getValue_(_local9, _arg1);
_local3 = Sprites.getItem(_local10);
if (_local3 != null){
_local6.draw(_local3, _local2);
};
};
_local9++;
_arg1--;
_local11++;
};
_local6.unlock();
};
};
return (true);
}
override public function eraseAll():Boolean{
(ui as Bitmap).bitmapData = null;
return (super.eraseAll());
}
private function genElement(_arg1:int):Boolean{
var _local2:Matrix;
var _local3:Sprite;
var _local4:int;
var _local5:int;
var _local6:BitmapData;
var _local7:Number;
var _local8:Number;
var _local9:int;
var _local10:int;
m_nY = _arg1;
_local2 = new Matrix();
_local2.ty = m_nMaxHeight;
if (m_proxyLayer != null){
_local4 = m_proxyLayer.width;
_local5 = m_proxyLayer.height;
_local7 = 600;
_local7 = (m_proxyLayer.width * Global_Settings.CELL_WIDTH);
_local8 = (m_nMaxHeight + m_nMaxLow);
_local6 = ((ui as Bitmap).bitmapData = new BitmapData(_local7, _local8, true, 0));
if (_local6 != null){
_local6.lock();
_local9 = _local5;
while (--_local9 >= 0) {
_local10 = m_proxyLayer.getValue_(_local9, _arg1);
_local3 = Sprites.getItem(_local10);
if (_local3 != null){
_local2.tx = (_local9 * Global_Settings.CELL_WIDTH);
_local6.draw(_local3, _local2);
};
};
_local6.unlock();
} else {
return (false);
};
} else {
return (false);
};
return (true);
}
override public function update(_arg1:IntPoint, _arg2:int, _arg3:LayerElementProxy):void{
var _local4:int;
super.update(_arg1, _arg2, _arg3);
_local4 = _arg1.m_iY;
switch (layerType){
case LayerProxy.LAYER_TYPE_LABYRINTH:
case LayerProxy.LAYER_TYPE_DOUBLE_DENSITY:
genElement_Double((_local4 >> 1));
break;
default:
genElement(_local4);
break;
};
}
override public function get mediatorType():int{
return (ElementMediator.ELEMENT_MEDIATOR_FIXLINE);
}
override public function get y():int{
return (m_nY);
}
}
}//package game.view
Section 199
//ElementMediator_Simple (game.view.ElementMediator_Simple)
package game.view {
import flash.display.*;
import game.model.*;
import com.*;
import game.model.Elements.*;
import main.*;
public class ElementMediator_Simple extends ElementMediator {
private var m_nY:int;
private var m_nX:int;
public static const NAME:String = "ElementMediator_Simple";
public function ElementMediator_Simple(_arg1:LayerProxy, _arg2:int, _arg3:int){
var _local4:MovieClip;
trace("COSTRUCT public function ElementMediator_Simple(layer:LayerProxy, nX:int, nY:int)");
trace(("layer=" + _arg1));
_local4 = genElement(_arg1, _arg2, _arg3);
trace(("sprite=" + _local4));
super(_arg1, _local4);
}
private function genElement(_arg1:LayerProxy, _arg2:int, _arg3:int):MovieClip{
var _local4:MovieClip;
var _local5:int;
trace("private function genElement(layer:LayerProxy, nX:int, nY:int):MovieClip");
if (_arg1 != null){
_local5 = _arg1.getValue_(_arg2, _arg3);
trace(("nValue = " + _local5));
_local4 = Sprites.getItem(_local5, true);
trace(("sprite = " + _local4));
m_nX = _arg2;
m_nY = _arg3;
if (_local4 != null){
if ((((_arg1.type == LayerProxy.LAYER_TYPE_DOUBLE_DENSITY)) && ((_arg1.type == LayerProxy.LAYER_TYPE_LABYRINTH)))){
_local4.x = ((_arg2 >> 1) * Global_Settings.CELL_WIDTH);
_local4.y = ((_arg3 >> 1) * Global_Settings.CELL_HEIGHT);
} else {
_local4.x = (_arg2 * Global_Settings.CELL_WIDTH);
_local4.y = (_arg3 * Global_Settings.CELL_HEIGHT);
};
};
return (_local4);
};
return (null);
}
override public function eraseAll():Boolean{
var _local1:DisplayObjectContainer;
if (ui != null){
_local1 = ui.parent;
if (_local1 != null){
_local1.removeChild(ui);
setViewComponent(null);
};
};
return (super.eraseAll());
}
override public function update(_arg1:IntPoint, _arg2:int, _arg3:LayerElementProxy):void{
var _local4:MovieClip;
var _local5:MovieClip;
var _local6:DisplayObjectContainer;
trace("ElementMediator_Simple override public function update(point:IntPoint, nID:int):void");
_local4 = (getViewComponent() as MovieClip);
trace(("spritePred = " + _local4));
_local5 = genElement(m_proxyLayer, _arg1.m_iX, _arg1.m_iY);
trace(("sprite = " + _local5));
setViewComponent(_local5);
if (_local4 != null){
_local6 = (_local4.parent as DisplayObjectContainer);
trace(("parentUI = " + _local6));
if (_local6 != null){
trace(("before parentUI.numChildren = " + _local6.numChildren));
_local6.removeChild(_local4);
trace(("after parentUI.numChildren = " + _local6.numChildren));
_local4.visible = false;
if (_local5 != null){
_local6.addChild(_local5);
trace(("parentUI.numChildren = " + _local6.numChildren));
};
};
};
}
override public function get mediatorType():int{
return (ElementMediator.ELEMENT_MEDIATOR_SIMPLE);
}
override public function get x():int{
return (m_nX);
}
override public function get y():int{
return (m_nY);
}
}
}//package game.view
Section 200
//GameMediator (game.view.GameMediator)
package game.view {
import flash.display.*;
import flash.events.*;
import game.model.*;
import org.puremvc.as3.interfaces.*;
import main.*;
import editor.view.*;
import main.view.*;
import game.view.components.*;
import game.view.components.Buttons.*;
public class GameMediator extends PageMediator {
private var m_mBtnSpeed:SBSpeedMediator;
private var m_mSoundControl:SoundControlMediator;
private var m_mLevelMouseCatcher:LevelMouseCatcherMediator;
private var m_mUndo:UndoMediator;
private var m_mLevel:LevelMediator;
private var m_mPause:PauseMediator;
private var m_mKeys:KeysMediator;
private var m_pGame:GameProxy;
private var m_mLevelRate:RateLevelMediator;
private var m_mHeroAttacked:HeroAttackedMediator;
private var m_mBtnQuit:SBMenuMediator;
private var m_mBtnSound:SBSoundMediator;
private var m_mInfoHelp:InfoHelpMediator;
private var m_mMusicControl:SoundControlMediator;
private var m_mBtnMusic:SBMusicMediator;
private var m_mSpeedControl:SpeedControlMediator;
public static const NAME:String = "GamePageMediator";
public function GameMediator(_arg1:Object){
var _local2:LevelProxy;
var _local3:MovieClip;
var _local4:UI_HeroAttacked;
var _local5:InfoLayerProxy;
var _local6:UI_InfoHelp;
var _local7:UI_Rate_Level;
trace("X");
trace("CONSTRUCTOR public function GameMediator(viewComponent:Object ) {");
super(_arg1);
m_pGame = (facade.retrieveProxy(GameProxy.NAME) as GameProxy);
trace(("m_pGame=" + m_pGame));
_local2 = m_pGame.selectLevel;
trace(("pLevel=" + _local2));
showLevel(_local2);
m_mLevelMouseCatcher = new LevelMouseCatcherMediator((m_mLevel.ui as DisplayObject));
facade.registerMediator(m_mLevelMouseCatcher);
m_mLevelMouseCatcher.layerType = LayerProxy.LAYER_TYPE_MATRIX;
m_mPause = new PauseMediator(ui);
facade.registerMediator(m_mPause);
m_mPause.show = false;
m_mKeys = new KeysMediator(ui, m_pGame);
facade.registerMediator(m_mKeys);
m_mBtnMusic = new SBMusicMediator(ui.getChildByName("musicGameBtn"));
facade.registerMediator(m_mBtnMusic);
m_mBtnSound = new SBSoundMediator(ui.getChildByName("soundGameBtn"));
facade.registerMediator(m_mBtnSound);
m_mBtnQuit = new SBMenuMediator(ui.getChildByName("exitGameBtn"));
facade.registerMediator(m_mBtnQuit);
if (_local2 != null){
m_mBtnQuit.m_pLevels = _local2.parent;
};
m_mMusicControl = new SoundControlMediator(ui.getChildByName("musicControl"), true);
facade.registerMediator(m_mMusicControl);
m_mSoundControl = new SoundControlMediator(ui.getChildByName("soundControl"), false);
facade.registerMediator(m_mSoundControl);
m_mBtnSpeed = new SBSpeedMediator(ui.getChildByName(UI_Game.SPEED_BTN));
facade.registerMediator(m_mBtnSpeed);
trace(("UI_Game.SPEED_CTL = " + UI_Game.SPEED_CTL));
trace(("ui.getChildByName(UI_Game.SPEED_CTL) = " + ui.getChildByName(UI_Game.SPEED_CTL)));
m_mSpeedControl = new SpeedControlMediator(ui.getChildByName(UI_Game.SPEED_CTL));
facade.registerMediator(m_mSpeedControl);
_local3 = (ui.getChildByName("undo_mc") as MovieClip);
if (_local3 == null){
_local3 = new UI_Undo();
ui.addChild(_local3);
};
m_mUndo = new UndoMediator(_local3);
facade.registerMediator(m_mUndo);
_local4 = (ui.getChildByName("hero_attacked_mc") as UI_HeroAttacked);
if (_local4 == null){
_local4 = new UI_HeroAttacked();
ui.addChild(_local4);
};
m_mHeroAttacked = new HeroAttackedMediator(_local4);
m_mHeroAttacked.show = false;
_local4.activeSubmitBtn = !(m_pGame.userEdition);
facade.registerMediator(m_mHeroAttacked);
ui.addEventListener(UI_Game.ON_PAUSE, listenOnPause, false, 0, true);
ui.addEventListener(UI_Game.ON_RESTART, listenOnRestart, false, 0, true);
ui.addEventListener(UI_Game.ON_UNDO, listenOnUndo, false, 0, true);
ui.addEventListener(UI_Game.ON_DEACTIVATE, listenOnDeactivate, false, 0, true);
if (_local2 != null){
_local5 = (_local2.getLayerByID(LevelProxy.LAYER_ID_INFO) as InfoLayerProxy);
};
_local6 = (ui.getChildByName("help_info_window_mc") as UI_InfoHelp);
if (_local6 == null){
_local6 = new UI_InfoHelp();
ui.addChild(_local6);
};
m_mInfoHelp = new InfoHelpMediator(_local6, _local5);
facade.registerMediator(m_mInfoHelp);
_local7 = (ui.getChildByName(UI_Game.LEVEL_RATE_NAME) as UI_Rate_Level);
if (_local7 == null){
_local7 = new UI_Rate_Level();
ui.addChild(_local7);
};
m_mLevelRate = new RateLevelMediator(_local7, _local2);
facade.registerMediator(m_mLevelRate);
}
private function showPause(_arg1:Boolean):void{
m_mPause.show = _arg1;
}
private function listenOnUndo(_arg1:Event):void{
sendNotification(ApplicationFacade.UNDO_MOVE);
}
private function showLevel(_arg1:LevelProxy):Boolean{
var _local2:UI_Level;
if (_arg1 != null){
if (m_mLevel != null){
if (m_mLevel.proxy == _arg1){
return (true);
};
if (((!((m_mLevel.ui == null))) && ((m_mLevel.ui.parent == ui)))){
ui.removeChild(m_mLevel.ui);
};
m_mLevel.clear();
facade.removeMediator(m_mLevel.getMediatorName());
};
_local2 = (ui.getChildByName("level_mc") as UI_Level);
if (_local2 == null){
_local2 = new UI_Level();
ui.addChildAt(_local2, 1);
};
m_mLevel = new LevelMediator(_local2, _arg1);
facade.registerMediator(m_mLevel);
if (((!((m_mLevelMouseCatcher == null))) && (!((m_mLevel == null))))){
m_mLevelMouseCatcher.target = m_mLevel.ui;
};
return (true);
};
return (false);
}
private function listenOnPause(_arg1:Event):void{
sendNotification(ApplicationFacade.GAME_PAUSE, !(m_pGame.pause));
}
private function listenOnDeactivate(_arg1:Event):void{
if (!m_pGame.pause){
sendNotification(ApplicationFacade.GAME_PAUSE, true);
};
}
protected function get ui():UI_Game{
return ((viewComponent as UI_Game));
}
private function listenOnRestart(_arg1:Event):void{
sendNotification(ApplicationFacade.TRY_AGAIN);
}
override public function handleNotification(_arg1:INotification):void{
switch (_arg1.getName()){
case ApplicationFacade.ON_GAME_PAUSE:
onPause((_arg1.getBody() as Boolean));
break;
};
}
override public function onRemove():void{
super.onRemove();
if (m_mLevelMouseCatcher != null){
facade.removeMediator(m_mLevelMouseCatcher.getMediatorName());
};
if (m_mLevel != null){
facade.removeMediator(m_mLevel.getMediatorName());
};
if (m_mPause != null){
facade.removeMediator(m_mPause.getMediatorName());
};
if (m_mKeys != null){
facade.removeMediator(m_mKeys.getMediatorName());
};
if (m_mUndo != null){
facade.removeMediator(m_mUndo.getMediatorName());
};
if (m_mHeroAttacked != null){
facade.removeMediator(m_mHeroAttacked.getMediatorName());
};
if (m_mBtnMusic != null){
facade.removeMediator(m_mBtnMusic.getMediatorName());
};
if (m_mBtnSound != null){
facade.removeMediator(m_mBtnSound.getMediatorName());
};
if (m_mBtnQuit != null){
facade.removeMediator(m_mBtnQuit.getMediatorName());
};
if (m_mMusicControl != null){
facade.removeMediator(m_mMusicControl.getMediatorName());
};
if (m_mSoundControl != null){
facade.removeMediator(m_mSoundControl.getMediatorName());
};
if (m_mBtnSpeed != null){
facade.removeMediator(m_mBtnSpeed.getMediatorName());
};
if (m_mSpeedControl != null){
facade.removeMediator(m_mSpeedControl.getMediatorName());
};
if (m_mInfoHelp != null){
facade.removeMediator(m_mInfoHelp.getMediatorName());
};
if (m_mLevelRate != null){
facade.removeMediator(m_mLevelRate.getMediatorName());
};
sendNotification(ApplicationFacade.GAME_VIEW_HIDE);
}
private function onPause(_arg1:Boolean):void{
showPause(_arg1);
}
override public function listNotificationInterests():Array{
var _local1:Array;
_local1 = super.listNotificationInterests();
_local1.push(ApplicationFacade.GAME_PAUSE);
return (_local1);
}
}
}//package game.view
Section 201
//HeroAttackedMediator (game.view.HeroAttackedMediator)
package game.view {
import flash.events.*;
import org.puremvc.as3.interfaces.*;
import main.*;
import game.view.components.*;
import org.puremvc.as3.patterns.mediator.*;
public class HeroAttackedMediator extends Mediator implements IMediator {
public static const NAME:String = "HeroAttackedMediator";
public function HeroAttackedMediator(_arg1:Object){
super(HeroAttackedMediator.NAME, _arg1);
if (ui != null){
ui.addEventListener(UI_HeroAttacked.ON_TRY_AGAIN, listenTryAgain, false, 0, true);
ui.addEventListener(UI_HeroAttacked.ON_UNDO, listenUndo, false, 0, true);
ui.addEventListener(UI_HeroAttacked.ON_SUBMIT_SCORE, listenSubmitScore, false, 0, true);
};
}
public function set show(_arg1:Boolean):void{
ui.show = _arg1;
}
private function listenTryAgain(_arg1:Event):void{
sendNotification(ApplicationFacade.TRY_AGAIN);
show = false;
}
private function onHeroUnderAttack():void{
show = true;
}
private function listenUndo(_arg1:Event):void{
sendNotification(ApplicationFacade.UNDO_MOVE);
show = false;
}
override public function listNotificationInterests():Array{
return ([ApplicationFacade.HERO_UNDER_ATTACK, ApplicationFacade.UNDO_MOVE, ApplicationFacade.TRY_AGAIN]);
}
public function get ui():UI_HeroAttacked{
return ((viewComponent as UI_HeroAttacked));
}
override public function handleNotification(_arg1:INotification):void{
switch (_arg1.getName()){
case ApplicationFacade.HERO_UNDER_ATTACK:
onHeroUnderAttack();
break;
case ApplicationFacade.UNDO_MOVE:
show = false;
break;
case ApplicationFacade.TRY_AGAIN:
show = false;
break;
};
}
private function listenSubmitScore(_arg1:Event):void{
sendNotification(ApplicationFacade.SUBMIT_SCORE);
show = false;
}
public function get show():Boolean{
return (ui.show);
}
}
}//package game.view
Section 202
//InfoHelpMediator (game.view.InfoHelpMediator)
package game.view {
import game.model.*;
import org.puremvc.as3.interfaces.*;
import com.*;
import main.*;
import game.view.components.*;
import org.puremvc.as3.patterns.mediator.*;
public class InfoHelpMediator extends Mediator implements IMediator {
private var m_pInfoLayer:InfoLayerProxy;
public static const NAME:String = "InfoHelpMediator";
public function InfoHelpMediator(_arg1:Object, _arg2:InfoLayerProxy){
var _local3:int;
m_pInfoLayer = _arg2;
super(UndoMediator.NAME, _arg1);
if (m_pInfoLayer != null){
_local3 = m_pInfoLayer.activeHelp;
};
showHelp(_local3, !((_local3 == CommonFunc.INT_UNDEF)));
}
override public function listNotificationInterests():Array{
var _local1:Array;
_local1 = super.listNotificationInterests();
_local1.push(ApplicationFacade.SHOW_INFO_HELP);
_local1.push(ApplicationFacade.HIDE_INFO_HELP);
return (_local1);
}
public function get ui():UI_InfoHelp{
return ((viewComponent as UI_InfoHelp));
}
private function showHelp(_arg1:int, _arg2:Boolean=true):void{
ui.showItem(_arg1, _arg2);
}
override public function handleNotification(_arg1:INotification):void{
var _local2:int;
var _local3:int;
switch (_arg1.getName()){
case ApplicationFacade.SHOW_INFO_HELP:
_local3 = (_arg1.getBody() as int);
showHelp(_local3, true);
break;
case ApplicationFacade.HIDE_INFO_HELP:
_local3 = (_arg1.getBody() as int);
showHelp(_local3, false);
break;
};
}
}
}//package game.view
Section 203
//KeysMediator (game.view.KeysMediator)
package game.view {
import flash.display.*;
import flash.events.*;
import org.puremvc.as3.interfaces.*;
import main.*;
import game.view.components.*;
import game.controller.*;
import org.puremvc.as3.patterns.mediator.*;
public class KeysMediator extends Mediator implements IMediator {
private var m_pTarget:IProxy;
public static const NAME:String = "KeysMediator";
public function KeysMediator(_arg1:InteractiveObject, _arg2:IProxy){
var _local3:UI_Keys;
m_pTarget = _arg2;
_local3 = new UI_Keys(_arg1.stage);
_local3.addEventListener(UI_Keys.ON_PAUSE_DOWN, listenOnPauseDown, false, 0, true);
_local3.addEventListener(UI_Keys.ON_LEFT_DOWN, listenOnLeftDown, false, 0, true);
_local3.addEventListener(UI_Keys.ON_LEFT_UP, listenOnLeftUp, false, 0, true);
_local3.addEventListener(UI_Keys.ON_RIGHT_DOWN, listenOnRightDown, false, 0, true);
_local3.addEventListener(UI_Keys.ON_RIGHT_UP, listenOnRightUp, false, 0, true);
_local3.addEventListener(UI_Keys.ON_UP_DOWN, listenOnUpDown, false, 0, true);
_local3.addEventListener(UI_Keys.ON_UP_UP, listenOnUpUp, false, 0, true);
_local3.addEventListener(UI_Keys.ON_DOWN_DOWN, listenOnDownDown, false, 0, true);
_local3.addEventListener(UI_Keys.ON_DOWN_UP, listenOnDownUp, false, 0, true);
_local3.addEventListener(UI_Keys.ON_SPACE_DOWN, listenOnSpaceDown, false, 0, true);
_local3.addEventListener(UI_Keys.ON_RESTART, listenOnRestart, false, 0, true);
_local3.addEventListener(UI_Keys.ON_UNDO, listenOnUndo, false, 0, true);
super(NAME, _local3);
}
private function listenOnRightUp(_arg1:Event):void{
facade.sendNotification(ApplicationFacade.KEY_ACTION, new KeyActionStruct(KeyActionStruct.ON_RIGHT_OFF, m_pTarget));
}
private function listenOnSpaceDown(_arg1:Event):void{
facade.sendNotification(ApplicationFacade.KEY_ACTION, new KeyActionStruct(KeyActionStruct.ON_WAIT, m_pTarget));
}
private function listenOnUpDown(_arg1:Event):void{
facade.sendNotification(ApplicationFacade.KEY_ACTION, new KeyActionStruct(KeyActionStruct.ON_UP, m_pTarget));
}
private function listenOnDownDown(_arg1:Event):void{
facade.sendNotification(ApplicationFacade.KEY_ACTION, new KeyActionStruct(KeyActionStruct.ON_DOWN, m_pTarget));
}
private function listenOnPauseDown(_arg1:Event):void{
facade.sendNotification(ApplicationFacade.KEY_ACTION, new KeyActionStruct(KeyActionStruct.ON_PAUSE, m_pTarget));
}
private function listenOnDownUp(_arg1:Event):void{
facade.sendNotification(ApplicationFacade.KEY_ACTION, new KeyActionStruct(KeyActionStruct.ON_DOWN_OFF, m_pTarget));
}
private function listenOnUndo(_arg1:Event):void{
sendNotification(ApplicationFacade.UNDO_MOVE);
}
private function listenOnLeftUp(_arg1:Event):void{
facade.sendNotification(ApplicationFacade.KEY_ACTION, new KeyActionStruct(KeyActionStruct.ON_LEFT_OFF, m_pTarget));
}
private function listenOnLeftDown(_arg1:Event):void{
facade.sendNotification(ApplicationFacade.KEY_ACTION, new KeyActionStruct(KeyActionStruct.ON_LEFT, m_pTarget));
}
private function listenOnUpUp(_arg1:Event):void{
facade.sendNotification(ApplicationFacade.KEY_ACTION, new KeyActionStruct(KeyActionStruct.ON_UP_OFF, m_pTarget));
}
private function listenOnRightDown(_arg1:Event):void{
facade.sendNotification(ApplicationFacade.KEY_ACTION, new KeyActionStruct(KeyActionStruct.ON_RIGHT, m_pTarget));
}
private function listenOnRestart(_arg1:Event):void{
sendNotification(ApplicationFacade.TRY_AGAIN);
}
}
}//package game.view
Section 204
//LayerMediator (game.view.LayerMediator)
package game.view {
import game.model.*;
import org.puremvc.as3.interfaces.*;
import com.*;
import game.model.Elements.*;
import main.*;
import org.puremvc.as3.patterns.mediator.*;
public class LayerMediator extends Mediator implements IMediator {
protected var m_arElemente:Array;
private var m_nDynType:int;// = -1
protected var m_pLayer:LayerProxy;
public static const NAME:String = "LayerMediator";
public function LayerMediator(_arg1:LayerProxy){
m_nDynType = CommonFunc.INT_UNDEF;
m_arElemente = new Array();
super(((NAME + "_") + _arg1.getProxyName()), null);
m_pLayer = _arg1;
}
public function get dynType():int{
return (m_nDynType);
}
override public function onRemove():void{
var _local1:ElementMediator;
m_arElemente = new Array();
for each (_local1 in m_arElemente) {
if (_local1 != null){
_local1.clear();
};
};
m_pLayer = null;
}
protected function onChangeState(_arg1:LayerElementProxy):void{
var _local2:ElementMediator;
if (_arg1 != null){
for each (_local2 in m_arElemente) {
if (_local2 != null){
if (_local2.proxy == _arg1){
_local2.onChangeState(_arg1);
};
};
};
};
}
public function removeElement(_arg1:ElementMediator):void{
var _local2:int;
_local2 = getElementN(_arg1);
if (_local2 >= 0){
m_arElemente.splice(_local2, 1);
};
}
protected function getElement(_arg1:IntPoint, _arg2:int, _arg3:LayerElementProxy):ElementMediator{
return (null);
}
public function getElementN(_arg1:ElementMediator):int{
return (m_arElemente.indexOf(_arg1));
}
public function get type():int{
if (m_pLayer == null){
return (CommonFunc.INT_UNDEF);
};
return (m_pLayer.type);
}
public function get elementCount():int{
return (m_arElemente.length);
}
override public function listNotificationInterests():Array{
return ([ApplicationFacade.ELEMENT_CHANGE_STATE]);
}
public function get id():int{
if (m_pLayer == null){
return (CommonFunc.INT_UNDEF);
};
return (m_pLayer.id);
}
public function addElement(_arg1:ElementMediator):void{
if (_arg1 != null){
_arg1.parent = this;
m_arElemente.push(_arg1);
};
}
public function updateElement(_arg1:IntPoint, _arg2:int, _arg3:LayerElementProxy, _arg4:Boolean):ElementMediator{
var _local5:ElementMediator;
_local5 = getElement(_arg1, _arg2, _arg3);
if (_local5 != null){
if (_arg4){
_local5.update(_arg1, _arg2, _arg3);
} else {
_local5.erase(_arg1, _arg2, _arg3);
};
};
return (_local5);
}
public function set dynType(_arg1:int):void{
m_nDynType = _arg1;
}
override public function handleNotification(_arg1:INotification):void{
switch (_arg1.getName()){
case ApplicationFacade.ELEMENT_CHANGE_STATE:
onChangeState((_arg1.getBody() as LayerElementProxy));
break;
};
super.handleNotification(_arg1);
}
public function eraseElements():Boolean{
var _local1:int;
var _local2:ElementMediator;
_local1 = m_arElemente.length;
while (--_local1 >= 0) {
_local2 = m_arElemente[_local1];
if (_local2 != null){
_local2.eraseAll();
};
};
m_arElemente = new Array();
return (true);
}
public function getElementByN(_arg1:int):ElementMediator{
return (m_arElemente[_arg1]);
}
public function get proxy():LayerProxy{
return (m_pLayer);
}
}
}//package game.view
Section 205
//LayerMediator_Fix (game.view.LayerMediator_Fix)
package game.view {
import game.model.*;
import com.*;
import game.model.Elements.*;
public class LayerMediator_Fix extends LayerMediator {
public static const NAME:String = "LayerMediator_Fix";
public function LayerMediator_Fix(_arg1:LayerProxy){
super(_arg1);
}
override protected function getElement(_arg1:IntPoint, _arg2:int, _arg3:LayerElementProxy):ElementMediator{
if (m_arElemente.length > 0){
return (m_arElemente[0]);
};
return (super.getElement(_arg1, _arg2, _arg3));
}
}
}//package game.view
Section 206
//LayerMediator_FixedLine (game.view.LayerMediator_FixedLine)
package game.view {
import game.model.*;
import com.*;
import game.model.Elements.*;
public class LayerMediator_FixedLine extends LayerMediator {
public static const NAME:String = "LayerMediator_FixedLine";
public function LayerMediator_FixedLine(_arg1:LayerProxy){
super(_arg1);
}
override protected function getElement(_arg1:IntPoint, _arg2:int, _arg3:LayerElementProxy):ElementMediator{
return (super.getElement(_arg1, _arg2, _arg3));
}
}
}//package game.view
Section 207
//LayerMediator_FixedLine_Doubled (game.view.LayerMediator_FixedLine_Doubled)
package game.view {
import game.model.*;
import com.*;
import game.model.Elements.*;
public class LayerMediator_FixedLine_Doubled extends LayerMediator {
public static const NAME:String = "LayerMediator_FixedLine_Doubled";
public function LayerMediator_FixedLine_Doubled(_arg1:LayerProxy){
super(_arg1);
}
override protected function getElement(_arg1:IntPoint, _arg2:int, _arg3:LayerElementProxy):ElementMediator{
if (_arg1 != null){
return (getElementByY(_arg1.m_iY));
};
return (super.getElement(_arg1, _arg2, _arg3));
}
private function getElementByY(_arg1:int):ElementMediator{
_arg1 = (_arg1 >> 1);
if (_arg1 < m_arElemente.length){
return (m_arElemente[_arg1]);
};
return (null);
}
}
}//package game.view
Section 208
//LayerMediator_List (game.view.LayerMediator_List)
package game.view {
import game.model.*;
import org.puremvc.as3.interfaces.*;
import com.*;
import game.model.Elements.*;
import main.*;
public class LayerMediator_List extends LayerMediator {
private var m_arAnimated:Array;
private var m_bAnimateOnTimer:Boolean;
private var m_arMoved:Array;
public static const NAME:String = "LayerMediator_List";
public function LayerMediator_List(_arg1:LayerProxy){
m_arMoved = new Array();
m_arAnimated = new Array();
super(_arg1);
}
private function removeFromMoved(_arg1:ElementMediator):Boolean{
var _local2:int;
_local2 = m_arMoved.indexOf(_arg1);
if (_local2 >= 0){
_arg1.snapToGrid();
m_arMoved.splice(_local2, 1);
return (true);
};
return (false);
}
public function removeFromAnimated(_arg1:ElementMediator):void{
var _local2:int;
_local2 = m_arAnimated.indexOf(_arg1);
if (_local2 >= 0){
m_arAnimated.splice(_local2, 1);
};
}
private function addToMoved(_arg1:ElementMediator):void{
if (((!((_arg1 == null))) && ((m_arMoved.indexOf(_arg1) < 0)))){
m_arMoved.push(_arg1);
};
}
override public function handleNotification(_arg1:INotification):void{
super.handleNotification(_arg1);
switch (_arg1.getName()){
case ApplicationFacade.ON_TIMER:
onTimer();
break;
};
}
private function onTimer():void{
var _local1:ElementMediator_Complex;
for each (_local1 in m_arAnimated) {
_local1.listenTimer();
};
for each (_local1 in m_arMoved) {
_local1.move();
};
}
public function addToAnimated(_arg1:ElementMediator):void{
m_arAnimated.push(_arg1);
}
private function getElementByProxy(_arg1:LayerElementProxy):ElementMediator{
var _local2:ElementMediator;
for each (_local2 in m_arElemente) {
if (((!((_local2 == null))) && ((_local2.proxy == _arg1)))){
return (_local2);
};
};
return (null);
}
override protected function getElement(_arg1:IntPoint, _arg2:int, _arg3:LayerElementProxy):ElementMediator{
var _local4:int;
var _local5:int;
if (_arg1 != null){
_local4 = _arg1.m_iX;
_local5 = _arg1.m_iY;
if (((((!((_local4 == CommonFunc.INT_UNDEF))) && (!((_local5 == CommonFunc.INT_UNDEF))))) && (!((_local5 == CommonFunc.INT_UNDEF))))){
return (getElementByPos(_local4, _local5, _arg2));
};
return (getElementByProxy(_arg3));
//unresolved jump
};
return (getElementByProxy(_arg3));
}
private function getElementByPos(_arg1:int, _arg2:int, _arg3:int):ElementMediator{
var _local4:ElementMediator;
for each (_local4 in m_arElemente) {
if (((((((!((_local4 == null))) && ((_local4.x == _arg1)))) && ((_local4.y == _arg2)))) && ((((_arg3 == Sprites.SPR_ID_NULL)) || ((_local4.type == _arg3)))))){
return (_local4);
};
};
return (null);
}
override protected function onChangeState(_arg1:LayerElementProxy):void{
var _local2:ElementMediator;
var _local3:ElementMediator_Complex;
var _local4:int;
super.onChangeState(_arg1);
if (_arg1 != null){
if (_arg1.parent == m_pLayer){
_local2 = getElementByProxy(_arg1);
if (_local2 != null){
_local4 = _arg1.state;
switch (_local4){
case LayerElementProxy.STATE_MOVE_WEST:
case LayerElementProxy.STATE_SWIM_WEST:
addToMoved(_local2);
break;
case LayerElementProxy.STATE_MOVE_EAST:
case LayerElementProxy.STATE_SWIM_EAST:
addToMoved(_local2);
break;
case LayerElementProxy.STATE_MOVE_NORTH:
case LayerElementProxy.STATE_SWIM_NORTH:
addToMoved(_local2);
break;
case LayerElementProxy.STATE_MOVE_SOUTH:
case LayerElementProxy.STATE_SWIM_SOUTH:
addToMoved(_local2);
break;
case LayerElementProxy.STATE_UNDO_MOVE_EAST:
case LayerElementProxy.STATE_UNDO_MOVE_WEST:
case LayerElementProxy.STATE_UNDO_MOVE_NORTH:
case LayerElementProxy.STATE_UNDO_MOVE_SOUTH:
case LayerElementProxy.STATE_UNDO_SWIM_EAST:
case LayerElementProxy.STATE_UNDO_SWIM_WEST:
case LayerElementProxy.STATE_UNDO_SWIM_NORTH:
case LayerElementProxy.STATE_UNDO_SWIM_SOUTH:
if (Global_Settings.SWIFT_UNDO){
_local3 = (_local2 as ElementMediator_Complex);
if (_local3 != null){
_local3.swiftMove();
};
} else {
addToMoved(_local2);
};
break;
default:
if (m_arMoved.indexOf(_local2) >= 0){
removeFromMoved(_local2);
};
break;
};
};
};
};
}
override public function listNotificationInterests():Array{
var _local1:Array;
_local1 = super.listNotificationInterests();
_local1.push(ApplicationFacade.ON_TIMER);
return (_local1);
}
}
}//package game.view
Section 209
//LayerMediator_Matrix (game.view.LayerMediator_Matrix)
package game.view {
import game.model.*;
import com.*;
import game.model.Elements.*;
public class LayerMediator_Matrix extends LayerMediator {
public static const NAME:String = "LayerMediator_Matrix";
public function LayerMediator_Matrix(_arg1:LayerProxy){
super(_arg1);
m_arElemente = new Array((_arg1.width * _arg1.height));
}
override protected function getElement(_arg1:IntPoint, _arg2:int, _arg3:LayerElementProxy):ElementMediator{
if (_arg1 != null){
return (m_arElemente[getPos(_arg1.m_iX, _arg1.m_iY)]);
};
return (super.getElement(_arg1, _arg2, _arg3));
}
private function getPos(_arg1:int, _arg2:int):int{
return ((_arg1 + (_arg2 * m_pLayer.width)));
}
override public function addElement(_arg1:ElementMediator):void{
if (_arg1 != null){
m_arElemente[getPos(_arg1.x, _arg1.y)] = _arg1;
};
}
}
}//package game.view
Section 210
//LevelMediator (game.view.LevelMediator)
package game.view {
import flash.utils.*;
import game.model.*;
import org.puremvc.as3.interfaces.*;
import com.*;
import game.model.Elements.*;
import main.*;
import editor.model.*;
import game.model.Elements.Character.*;
import game.view.components.*;
import org.puremvc.as3.patterns.mediator.*;
import game.view.components.Elements.Character.*;
public class LevelMediator extends Mediator implements IMediator {
private const WIDTH_WHO_DEEPER_BY_TYPE:int = 5;
private var m_nMatrixYIndex_Insert:int;
private var m_nLayerDepth_MatrixFix_Index:int;
private var m_arLayerDepth_MatrixY_Index:ByteArray;
private var m_arWhoDeeperByType:Array;
private var m_arMLayers:Array;
private var m_arElements:Array;
private var m_arMatrixY_Insert:Array;
private var m_arMatrixXYIndex_Insert:ByteArray;
var m_nMatrixHeight:int;
private var m_nXForInsert:int;
private var m_hero:ElementMediator_Complex;
private var m_nYForInsert:int;
private var m_arLayerDepth_MatrixXY_Index:ByteArray;
private var m_proxyLevel:LevelProxy;
var m_nMatrixWidth:int;
private var m_arMatrixXY:Array;
private var m_arMatrixFixed:Array;
private var m_arMatrixY:Array;
private var m_nMatrixFixedIndex_Insert:int;
public static const LAYER_DYN_TYPE_FIXED_LINE:int = (CommonFunc.INT_UNDEF + 2);
public static const LAYER_DYN_TYPE_FIXED:int = (CommonFunc.INT_UNDEF + 1);
public static const LAYER_DYN_TYPE_UNDEF:int = -1;
public static const NAME:String = "LevelMediator";
public static const LAYER_DYN_TYPE_DYNAMIC:int = (CommonFunc.INT_UNDEF + 3);
public function LevelMediator(_arg1:Object, _arg2:LevelProxy){
m_arMatrixFixed = new Array();
m_arMatrixY = new Array();
m_arMatrixXY = new Array();
m_arMLayers = new Array();
m_arWhoDeeperByType = new Array();
m_arElements = new Array();
super(((NAME + "_") + _arg2.getProxyName()), _arg1);
m_proxyLevel = _arg2;
init();
}
protected function onOverPos(_arg1:EventSelectPos):void{
var _local2:int;
var _local3:LayerElementProxy_Character_Hero;
var _local4:LayerListProxy;
if (((((inGame) && (!((m_hero == null))))) && (!((_arg1 == null))))){
_local2 = posTodir(_arg1.m_point, false);
_local3 = (m_hero.proxy as LayerElementProxy_Character_Hero);
if (_local3 != null){
_local4 = _local3.parent;
_local2 = _local4.isCanChangeState(_local2, _local3);
if (m_hero.isRaftUnder()){
switch (_local2){
case LayerElementProxy.STATE_LOOK_WEST:
case LayerElementProxy.STATE_LOOK_EAST:
case LayerElementProxy.STATE_LOOK_NORTH:
case LayerElementProxy.STATE_LOOK_SOUTH:
case LayerElementProxy.STATE_UNDEF:
_local2 = posTodir(_arg1.m_point, true);
_local2 = _local4.isCanChangeState(_local2, _local3);
break;
};
};
switch (_local2){
case LayerElementProxy.STATE_WAIT:
m_hero.arrow = UI_Character.ARROW_WAIT;
break;
case LayerElementProxy.STATE_MOVE_WEST:
m_hero.arrow = UI_Character.ARROW_WEST;
break;
case LayerElementProxy.STATE_MOVE_EAST:
m_hero.arrow = UI_Character.ARROW_EAST;
break;
case LayerElementProxy.STATE_MOVE_NORTH:
m_hero.arrow = UI_Character.ARROW_NORTH;
break;
case LayerElementProxy.STATE_MOVE_SOUTH:
m_hero.arrow = UI_Character.ARROW_SOUTH;
break;
case LayerElementProxy.STATE_PUSH_EAST:
m_hero.arrow = UI_Character.ARROW_PUSH_EAST;
break;
case LayerElementProxy.STATE_PUSH_WEST:
m_hero.arrow = UI_Character.ARROW_PUSH_WEST;
break;
case LayerElementProxy.STATE_PUSH_NORTH:
m_hero.arrow = UI_Character.ARROW_PUSH_NORTH;
break;
case LayerElementProxy.STATE_PUSH_SOUTH:
m_hero.arrow = UI_Character.ARROW_PUSH_SOUTH;
break;
case LayerElementProxy.STATE_SWIM_EAST:
m_hero.arrow = UI_Character.ARROW_SWIM_EAST;
break;
case LayerElementProxy.STATE_SWIM_NORTH:
m_hero.arrow = UI_Character.ARROW_SWIM_NORTH;
break;
case LayerElementProxy.STATE_SWIM_SOUTH:
m_hero.arrow = UI_Character.ARROW_SWIM_SOUTH;
break;
case LayerElementProxy.STATE_SWIM_WEST:
m_hero.arrow = UI_Character.ARROW_SWIM_WEST;
break;
default:
m_hero.arrow = UI_Character.ARROW_UNDEF;
break;
};
};
};
}
private function insertElement(_arg1:ElementMediator):Boolean{
var _local2:int;
var _local3:int;
var _local4:ElementMediator;
var _local5:LayerElementProxy;
if (((!((_arg1 == null))) && (!((m_arElements == null))))){
if (_arg1.ui.parent == ui){
};
_local2 = m_arElements.length;
_local3 = _local2;
while (--_local3 >= 0) {
_local4 = m_arElements[_local3];
if (_local4 != null){
};
};
_local3 = _local2;
while (--_local3 >= 0) {
_local4 = m_arElements[_local3];
if (_local4 != null){
_local5 = _local4.proxy;
if (_local5 != null){
};
};
if (((!((_local4 == null))) && ((compareElements(_local4, _arg1) < 0)))){
break;
};
};
if (_local3 == (_local2 - 1)){
m_arElements.push(_arg1);
} else {
m_arElements.splice((_local3 + 1), 0, _arg1);
};
listenOnAddElement(_arg1);
if (((!((_local4 == null))) && ((_local3 > 0)))){
_arg1.insertAfter(ui, _local4);
} else {
_arg1.insertFirst(ui);
};
return (true);
};
return (false);
}
private function getDepthMatrixFixIndex():int{
return (m_nLayerDepth_MatrixFix_Index);
}
private function setDepthMatrixXYIndex_Coords(_arg1:int, _arg2:int, _arg3:int):void{
m_arLayerDepth_MatrixXY_Index.position = ((_arg1 + (_arg2 * m_nMatrixWidth)) << 1);
m_arLayerDepth_MatrixXY_Index.writeShort(_arg3);
}
public function init():Boolean{
if (m_proxyLevel == null){
return (false);
};
initMatrix();
putLayer(LAYER_DYN_TYPE_FIXED, m_proxyLevel.getLayerByID(LevelProxy.LAYER_ID_GROUND));
putLayer(LAYER_DYN_TYPE_DYNAMIC, m_proxyLevel.getLayerByID(LevelProxy.LAYER_ID_GROUND_TRAPS));
putLayer(LAYER_DYN_TYPE_FIXED, m_proxyLevel.getLayerByID(LevelProxy.LAYER_ID_WATER));
putLayer(LAYER_DYN_TYPE_DYNAMIC, m_proxyLevel.getLayerByID(LevelProxy.LAYER_ID_WATER_ANIMATION));
putLayer(LAYER_DYN_TYPE_FIXED_LINE, m_proxyLevel.getLayerByID(LevelProxy.LAYER_ID_LABYRINTH));
putLayer(LAYER_DYN_TYPE_DYNAMIC, m_proxyLevel.getLayerByID(LevelProxy.LAYER_ID_LABYRINTH_ITEMS));
putLayer(LAYER_DYN_TYPE_DYNAMIC, m_proxyLevel.getLayerByID(LevelProxy.LAYER_ID_LABYRINTH_ANIMATION));
putLayer(LAYER_DYN_TYPE_DYNAMIC, m_proxyLevel.getLayerByID(LevelProxy.LAYER_ID_OBJECTS));
putLayer(LAYER_DYN_TYPE_DYNAMIC, m_proxyLevel.getLayerByID(LevelProxy.LAYER_ID_CHARACTERS));
putLayer(LAYER_DYN_TYPE_DYNAMIC, m_proxyLevel.getLayerByID(LevelProxy.LAYER_ID_INFO));
putLayer(LAYER_DYN_TYPE_DYNAMIC, m_proxyLevel.getLayerByID(LevelProxy.LAYER_ID_SWIM));
sortDepth();
return (true);
}
private function getElementsInMatrixXY(_arg1:int, _arg2:int):Array{
var _local3:int;
_local3 = (_arg1 + (_arg2 * m_nMatrixWidth));
return (m_arMatrixXY[_local3]);
}
private function setDepthMatrixYIndex(_arg1:int, _arg2:int):void{
m_arLayerDepth_MatrixY_Index.position = (_arg1 << 1);
m_arLayerDepth_MatrixY_Index.writeShort(_arg2);
}
private function getNextElementForMetrixXY(_arg1:int, _arg2:int):ElementMediator{
var _local3:int;
var _local4:int;
var _local5:Array;
_local3 = (_arg1 + (_arg2 * m_nMatrixWidth));
_local4 = getDepthMatrixXYIndex(_local3);
if (_local4 <= 0){
if (_local4 == 0){
setDepthMatrixXYIndex(_local3, -1);
};
return (null);
//unresolved jump
};
_local4--;
setDepthMatrixXYIndex(_local3, _local4);
_local5 = m_arMatrixXY[_local3];
return (_local5[_local4]);
}
private function getMLayerByProxy(_arg1:LayerProxy):LayerMediator{
var _local2:LayerMediator;
for each (_local2 in m_arMLayers) {
if (((!((_local2 == null))) && ((_local2.proxy == _arg1)))){
return (_local2);
};
};
return (null);
}
private function initElements():void{
m_arElements = new Array();
}
private function addElement(_arg1:ElementMediator):Boolean{
if (((!((_arg1 == null))) && ((m_arElements.indexOf(_arg1) < 0)))){
m_arElements.push(_arg1);
listenOnAddElement(_arg1);
return (true);
};
return (false);
}
private function posTodir(_arg1:IntPoint, _arg2:Boolean):int{
var _local3:int;
var _local4:int;
if (((!((_arg1 == null))) && (!((m_hero == null))))){
_local3 = (_arg1.m_iX - m_hero.x);
_local4 = (_arg1.m_iY - m_hero.y);
switch (_local3){
case -1:
if (_local4 == 0){
if (_arg2){
return (LayerElementProxy.STATE_SWIM_WEST);
};
return (LayerElementProxy.STATE_MOVE_WEST);
};
break;
case 0:
switch (_local4){
case -1:
if (_arg2){
return (LayerElementProxy.STATE_SWIM_NORTH);
};
return (LayerElementProxy.STATE_MOVE_NORTH);
case 0:
return (LayerElementProxy.STATE_WAIT);
case 1:
if (_arg2){
return (LayerElementProxy.STATE_SWIM_SOUTH);
};
return (LayerElementProxy.STATE_MOVE_SOUTH);
};
break;
case 1:
if (_local4 == 0){
if (_arg2){
return (LayerElementProxy.STATE_SWIM_EAST);
};
return (LayerElementProxy.STATE_MOVE_EAST);
};
break;
};
};
return (LayerElementProxy.STATE_UNDEF);
}
override public function handleNotification(_arg1:INotification):void{
if (_arg1 == null){
return;
};
switch (_arg1.getName()){
case ApplicationFacade.ELEMENT_CHANGE_STATE:
onElementChangeState((_arg1.getBody() as LayerElementProxy));
break;
case ApplicationFacade.UPDATE_LAYER_DATA:
onChangeLayerData((_arg1.getBody() as LayerChangeEvent));
break;
case ApplicationFacade.ELEMENT_CROSS_MARGIN:
onComplexElementCrossMagin((_arg1.getBody() as ElementMediator_Complex));
break;
case ApplicationFacade.OVER_POS:
onOverPos((_arg1.getBody() as EventSelectPos));
break;
case ApplicationFacade.SELECT_POS:
onSelectPos((_arg1.getBody() as EventSelectPos));
break;
};
}
override public function onRemove():void{
super.onRemove();
clear();
}
public function clear():void{
var _local1:ElementMediator;
clearLayers();
for each (_local1 in m_arElements) {
if (_local1 == null){
ui.removeChild(_local1.ui);
};
};
m_arElements = new Array();
}
private function addElementToMatrix(_arg1:ElementMediator):void{
if (m_arMatrixFixed == null){
m_arMatrixFixed = new Array();
};
m_arMatrixFixed.push(_arg1);
}
private function getCurElementForMetrixY(_arg1:int):ElementMediator{
var _local2:int;
var _local3:Array;
_local2 = getDepthMatrixYIndex(_arg1);
if (_local2 < 0){
return (null);
};
_local3 = m_arMatrixY[_arg1];
if (_local3 == null){
return (null);
};
return (_local3[_local2]);
}
private function getCurElementForMatrixXY_Insert():ElementMediator_Complex{
return (null);
}
private function getDepthMatrixXYIndex(_arg1:int):int{
m_arLayerDepth_MatrixXY_Index.position = (_arg1 << 1);
return (m_arLayerDepth_MatrixXY_Index.readShort());
}
protected function onElementChangeState(_arg1:LayerElementProxy):void{
var _local2:ElementMediator;
if (_arg1 != null){
switch (_arg1.state){
case LayerElementProxy_Character.STATE_DEAD:
_local2 = getElementByProxy(_arg1);
if (_local2 != null){
eraseElement(_local2);
};
break;
case LayerElementProxy.STATE_BORN:
bornElement((_arg1 as LayerElementProxy));
break;
case LayerElementProxy_Character.STATE_FIGHT_WITH_GHOST:
case LayerElementProxy_Character.STATE_FIGHT_WITH_HERO:
case LayerElementProxy_Character.STATE_FIGHT_WITH_KNIGHT:
case LayerElementProxy_Character.STATE_FIGHT_WITH_MADAM:
_local2 = getElementByProxy(_arg1);
if (_local2 != null){
_local2.snapToGrid();
};
break;
};
};
}
public function get proxy():LevelProxy{
return (m_proxyLevel);
}
private function setDepthMatrixXYIndex(_arg1:int, _arg2:int):void{
m_arLayerDepth_MatrixXY_Index.position = (_arg1 << 1);
m_arLayerDepth_MatrixXY_Index.writeShort(_arg2);
}
protected function listenOnRemoveElement(_arg1:ElementMediator):void{
if (_arg1 == m_hero){
m_hero = null;
};
}
private function bornElement(_arg1:LayerElementProxy):Boolean{
var _local2:LayerProxy;
var _local3:ElementMediator_Complex;
var _local4:LayerMediator;
if (_arg1 != null){
_local2 = _arg1.parent;
_local4 = getMLayerByProxy(_local2);
if (_local4 != null){
_local3 = new ElementMediator_Complex(_local2, _arg1);
if (((!((_local3 == null))) && (!((_local3.ui == null))))){
_local4.addElement(_local3);
insertElement(_local3);
};
return (true);
};
};
return (false);
}
public function getLayerType(_arg1:LayerProxy):int{
var _local2:LayerMediator;
_local2 = getMLayerByProxy(_arg1);
if (_local2 != null){
return (_local2.type);
};
return (CommonFunc.INT_UNDEF);
}
private function getCurElementForMetrixXY(_arg1:int, _arg2:int):ElementMediator{
var _local3:int;
var _local4:int;
var _local5:Array;
_local3 = (_arg1 + (_arg2 * m_nMatrixWidth));
_local4 = getDepthMatrixXYIndex(_local3);
if (_local4 < 0){
return (null);
};
_local5 = m_arMatrixXY[_local3];
if (_local5 == null){
return (null);
};
return (_local5[_local4]);
}
private function setDepthMatrixFixIndex(_arg1:int):void{
m_nLayerDepth_MatrixFix_Index = _arg1;
}
private function putLayer(_arg1:int, _arg2:LayerProxy):Boolean{
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:ElementMediator;
var _local9:LayerMediator;
var _local10:LayerListProxy;
var _local11:int;
var _local12:LayerElementProxy;
var _local13:int;
var _local14:int;
if (_arg2 == null){
return (false);
};
_local3 = _arg2.type;
_local9 = null;
switch (_arg1){
case LAYER_DYN_TYPE_FIXED:
_local9 = new LayerMediator_Fix(_arg2);
_local8 = new ElementMediator_Fix(_arg2);
_local9.addElement(_local8);
addElement(_local8);
break;
case LAYER_DYN_TYPE_FIXED_LINE:
switch (_arg2.type){
case LayerProxy.LAYER_TYPE_LABYRINTH:
case LayerProxy.LAYER_TYPE_DOUBLE_DENSITY:
_local9 = new LayerMediator_FixedLine_Doubled(_arg2);
_local7 = ((_arg2.height >> 1) + 1);
_local5 = 0;
while (_local5 < _local7) {
_local8 = new ElementMediator_FixLine(_arg2, _local5, true);
_local9.addElement(_local8);
addElement(_local8);
_local5++;
};
break;
default:
_local9 = new LayerMediator_FixedLine(_arg2);
_local5 = 0;
while (_local5 < _local7) {
_local8 = new ElementMediator_FixLine(_arg2, _local5, false);
_local9.addElement(_local8);
addElement(_local8);
_local5++;
};
break;
};
break;
case LAYER_DYN_TYPE_DYNAMIC:
if (_arg2.isCompatibleType(LayerProxy.LAYER_TYPE_LIST)){
_local9 = new LayerMediator_List(_arg2);
_local10 = (_arg2 as LayerListProxy);
if (_local10 != null){
_local11 = _local10.length;
while (--_local11 >= 0) {
_local12 = _local10.getElement(_local11);
if (_local12 != null){
_local8 = new ElementMediator_Complex(_arg2, _local12);
if (_local8.ui != null){
_local9.addElement(_local8);
addElement(_local8);
};
};
};
};
} else {
_local6 = _arg2.width;
_local7 = _arg2.height;
if ((((_arg2.type == LayerProxy.LAYER_TYPE_DOUBLE_DENSITY)) || ((_arg2.type == LayerProxy.LAYER_TYPE_LABYRINTH)))){
_local5 = (_local7 - 1);
_local13 = (_local7 >> 1);
while (--_local13 >= 0) {
_local4 = (_local6 - 1);
_local14 = (_local6 >> 1);
while (--_local14 >= 0) {
_local8 = new ElementMediator_Simple(_arg2, _local4, _local5);
if (_local8.ui != null){
addElement(_local8);
};
_local5--;
_local8 = new ElementMediator_Simple(_arg2, _local4, _local5);
if (_local8.ui != null){
addElement(_local8);
};
_local4--;
_local5++;
_local8 = new ElementMediator_Simple(_arg2, _local4, _local5);
if (_local8.ui != null){
addElement(_local8);
};
_local5--;
_local8 = new ElementMediator_Simple(_arg2, _local4, _local5);
if (_local8.ui != null){
addElement(_local8);
};
_local5++;
_local4--;
};
_local5 = (_local5 - 2);
};
} else {
_local9 = new LayerMediator_Matrix(_arg2);
_local5 = 0;
while (_local5 < _local7) {
_local4 = 0;
while (_local4 < _local6) {
_local8 = new ElementMediator_Simple(_arg2, _local4, _local5);
if (((!((_local8 == null))) && (!((_local8.ui == null))))){
_local9.addElement(_local8);
addElement(_local8);
};
_local4++;
};
_local5++;
};
};
};
break;
};
if (_local9 != null){
_local9.dynType = _arg1;
facade.registerMediator(_local9);
m_arMLayers.push(_local9);
};
return (true);
}
private function eraseElement(_arg1:ElementMediator):Boolean{
var _local2:LayerMediator;
if (_arg1 != null){
_local2 = _arg1.parent;
if (_local2 != null){
_local2.removeElement(_arg1);
};
removeElement(_arg1);
_arg1.clear();
return (true);
};
return (false);
}
public function sortDepth_Old():void{
var _local1:ElementMediator;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:ElementMediator;
var _local8:ElementMediator;
var _local9:ElementMediator;
var _local10:int;
var _local11:int;
var _local12:int;
var _local13:Boolean;
var _local14:Boolean;
var _local15:Boolean;
var _local16:int;
var _local17:int;
var _local18:int;
var _local19:Boolean;
var _local20:Boolean;
var _local21:Boolean;
_local2 = 0;
_local3 = 0;
_local4 = 0;
_local5 = 0;
_local6 = 0;
_local10 = (m_arMatrixFixed.length - 1);
_local11 = (m_arMatrixY.length - 1);
_local12 = (m_arMatrixXY.length - 1);
initCurrentDepth();
_local16 = 0;
_local17 = 0;
_local18 = 0;
_local19 = false;
_local20 = false;
_local21 = false;
_local7 = getCurElementForMatrixFix();
do {
if (_local7 != null){
_local4 = _local7.elementDepth;
} else {
_local4 = CommonFunc.INT_UNDEF;
};
_local18 = 0;
_local19 = false;
_local21 = false;
while (_local18 < m_nMatrixHeight) {
_local8 = getCurElementForMetrixY(_local18);
do {
if (_local8 != null){
_local5 = _local8.elementDepth;
} else {
_local5 = CommonFunc.INT_UNDEF;
};
_local17 = 0;
_local20 = false;
while (_local17 < m_nMatrixWidth) {
_local9 = getCurElementForMetrixXY(_local17, _local18);
while (_local9 != null) {
_local6 = _local9.elementDepth;
if (_local6 != CommonFunc.INT_UNDEF){
if (((!((_local5 == CommonFunc.INT_UNDEF))) && ((_local6 > _local5)))){
_local20 = true;
break;
};
if (((!((_local4 == CommonFunc.INT_UNDEF))) && ((_local6 > _local4)))){
_local21 = true;
break;
};
};
putElement(_local9);
_local9 = getNextElementForMetrixXY(_local17, _local18);
};
_local17++;
};
if (_local8 != null){
if (((!((_local4 == CommonFunc.INT_UNDEF))) && ((_local5 > _local4)))){
_local19 = true;
break;
};
putElement(_local8);
_local8 = getNextElementForMetrixY(_local18);
} else {
_local5 = CommonFunc.INT_UNDEF;
};
} while (((_local20) || (!((_local8 == null)))));
_local18++;
};
putElement(_local7);
_local7 = getNextElementForMatrixFix();
} while (((((_local21) || (_local19))) || (!((_local7 == null)))));
}
private function getCurElementForMatrixFix():ElementMediator{
if (m_nLayerDepth_MatrixFix_Index < 0){
return (null);
};
return (m_arMatrixFixed[m_nLayerDepth_MatrixFix_Index]);
}
protected function onSelectPos(_arg1:EventSelectPos):void{
var _local2:int;
var _local3:LayerElementProxy_Character_Hero;
var _local4:LayerListProxy;
if (((inGame) && (!((m_hero == null))))){
_local2 = posTodir(_arg1.m_point, false);
_local3 = (m_hero.proxy as LayerElementProxy_Character_Hero);
if (_local3 != null){
_local4 = _local3.parent;
switch (_local2){
case LayerElementProxy.STATE_WAIT:
case LayerElementProxy.STATE_MOVE_WEST:
case LayerElementProxy.STATE_MOVE_EAST:
case LayerElementProxy.STATE_MOVE_NORTH:
case LayerElementProxy.STATE_MOVE_SOUTH:
case LayerElementProxy.STATE_SWIM_EAST:
case LayerElementProxy.STATE_SWIM_NORTH:
case LayerElementProxy.STATE_SWIM_SOUTH:
case LayerElementProxy.STATE_SWIM_WEST:
sendNotification(ApplicationFacade.MOUSE_ACTION, _local2);
break;
};
};
};
}
private function addElementToMatrixXY(_arg1:int, _arg2:int, _arg3:ElementMediator):void{
var _local4:Array;
var _local5:int;
_local5 = (_arg1 + (_arg2 * m_nMatrixWidth));
_local4 = m_arMatrixXY[_local5];
if (_local4 == null){
_local4 = new Array();
m_arMatrixXY[_local5] = _local4;
};
_local4.push(_arg3);
}
private function getDepthMatrixXYIndex_Coords(_arg1:int, _arg2:int):int{
m_arLayerDepth_MatrixXY_Index.position = ((_arg1 + (_arg2 * m_nMatrixWidth)) << 1);
return (m_arLayerDepth_MatrixXY_Index.readShort());
}
public function get ui():UI_Level{
return ((viewComponent as UI_Level));
}
private function getDepthMatrixYIndex(_arg1:int):int{
m_arLayerDepth_MatrixY_Index.position = (_arg1 << 1);
return (m_arLayerDepth_MatrixY_Index.readShort());
}
private function onComplexElementCrossMagin(_arg1:ElementMediator_Complex):void{
if (_arg1 != null){
if (((!((_arg1.ui == null))) && (!((ui == null))))){
if (_arg1.ui.parent == ui){
removeElement(_arg1);
ui.removeChild(_arg1.ui);
insertElement(_arg1);
};
};
};
}
private function getLengthForSubArr(_arg1:Array, _arg2:int):int{
var _local3:Array;
if (_arg1 == null){
return (0);
};
_local3 = _arg1[_arg2];
if (_local3 == null){
return (0);
};
_local3.sortOn(["elementDepth"], (Array.DESCENDING | Array.NUMERIC));
return (_local3.length);
}
public function getElementByProxy(_arg1:LayerElementProxy):ElementMediator{
var _local2:ElementMediator;
for each (_local2 in m_arElements) {
if (_local2 != null){
if (_local2.proxy == _arg1){
return (_local2);
};
};
};
return (null);
}
protected function get inGame():Boolean{
if (m_proxyLevel != null){
return (m_proxyLevel.inGame);
};
return (false);
}
private function getNextElementForMatrixFix():ElementMediator{
var _local1:ElementMediator;
if (m_nLayerDepth_MatrixFix_Index <= 0){
m_nLayerDepth_MatrixFix_Index = CommonFunc.INT_UNDEF;
return (null);
};
m_nLayerDepth_MatrixFix_Index--;
_local1 = m_arMatrixFixed[m_nLayerDepth_MatrixFix_Index];
return (_local1);
}
protected function listenOnAddElement(_arg1:ElementMediator):void{
var _local2:LayerElementProxy_Character_Hero;
if (_arg1 != null){
_local2 = (_arg1.proxy as LayerElementProxy_Character_Hero);
if (_local2 != null){
m_hero = (_arg1 as ElementMediator_Complex);
};
};
}
public function sortDepth():void{
var _local1:ElementMediator;
var _local2:int;
var _local3:int;
m_arElements.sort(compareElements);
_local2 = m_arElements.length;
_local3 = 0;
while (_local3 < _local2) {
_local1 = m_arElements[_local3];
putElement(_local1);
_local3++;
};
}
public function width():int{
if (m_proxyLevel != null){
return (m_proxyLevel.width);
};
return (CommonFunc.INT_UNDEF);
}
private function initCurrentDepthForY(_arg1:int):void{
var _local2:Array;
var _local3:int;
var _local4:int;
var _local5:Array;
m_nYForInsert = _arg1;
_local2 = m_arMatrixY[_arg1];
m_nMatrixFixedIndex_Insert = (m_arMatrixFixed.length - 1);
m_arMatrixY_Insert = _local2[m_nYForInsert];
m_nMatrixYIndex_Insert = (m_arMatrixY_Insert.length - 1);
m_arMatrixXYIndex_Insert = new ByteArray();
_local3 = m_nMatrixWidth;
if (_local3 > 0){
m_arMatrixXYIndex_Insert.length = (_local3 << 1);
};
m_arMatrixXYIndex_Insert.position = ((_local3 - 1) << 1);
_local4 = _local3;
while (--_local4 >= 0) {
m_arMatrixXYIndex_Insert.position = (m_arMatrixXYIndex_Insert.position - 2);
_local5 = getElementsInMatrixXY(_local4, _arg1);
if (_local5 != null){
m_arMatrixXYIndex_Insert.writeShort((_local5.length - 1));
} else {
m_arMatrixXYIndex_Insert.writeShort(-1);
};
};
}
private function getCurElementForMatrixFix_Insert():ElementMediator_Fix{
if (m_nMatrixFixedIndex_Insert < 0){
return (null);
};
return (m_arMatrixFixed[m_nMatrixFixedIndex_Insert]);
}
private function getNextElementForMetrixY(_arg1:int):ElementMediator{
var _local2:int;
var _local3:Array;
_local2 = getDepthMatrixYIndex(_arg1);
if (_local2 <= 0){
if (_local2 == 0){
setDepthMatrixYIndex(_arg1, CommonFunc.INT_UNDEF);
};
return (null);
//unresolved jump
};
_local2--;
setDepthMatrixYIndex(_arg1, _local2);
_local3 = m_arMatrixY[_arg1];
return (_local3[_local2]);
}
private function removeElement(_arg1:ElementMediator):Boolean{
var _local2:int;
_local2 = m_arElements.indexOf(_arg1);
if (_local2 >= 0){
m_arElements.splice(_local2, 1);
listenOnRemoveElement(_arg1);
return (true);
};
return (false);
}
override public function listNotificationInterests():Array{
var _local1:Array;
_local1 = super.listNotificationInterests();
_local1.push(ApplicationFacade.ELEMENT_CHANGE_STATE);
_local1.push(ApplicationFacade.UPDATE_LAYER_DATA);
_local1.push(ApplicationFacade.ELEMENT_CROSS_MARGIN);
_local1.push(ApplicationFacade.OVER_POS);
_local1.push(ApplicationFacade.SELECT_POS);
return (_local1);
}
private function addElementToMatrixY(_arg1:int, _arg2:ElementMediator):void{
var _local3:Array;
_local3 = m_arMatrixY[_arg1];
if (_local3 == null){
_local3 = new Array();
m_arMatrixY[_arg1] = _local3;
};
_local3.push(_arg2);
}
private function putElement(_arg1:ElementMediator):Boolean{
if (_arg1 == null){
return (false);
};
_arg1.parentDOC = ui;
return (true);
}
private function initMatrix():void{
m_nMatrixWidth = m_proxyLevel.width;
m_nMatrixHeight = m_proxyLevel.height;
m_arMatrixFixed = new Array();
m_arMatrixY = new Array(m_nMatrixHeight);
m_arMatrixXY = new Array((m_nMatrixWidth * m_nMatrixHeight));
m_arWhoDeeperByType = new Array((WIDTH_WHO_DEEPER_BY_TYPE * WIDTH_WHO_DEEPER_BY_TYPE));
m_arWhoDeeperByType[(ElementMediator.ELEMENT_MEDIATOR_FIX + (WIDTH_WHO_DEEPER_BY_TYPE * ElementMediator.ELEMENT_MEDIATOR_FIX))] = 0;
m_arWhoDeeperByType[(ElementMediator.ELEMENT_MEDIATOR_FIX + (WIDTH_WHO_DEEPER_BY_TYPE * ElementMediator.ELEMENT_MEDIATOR_FIXLINE))] = -1;
m_arWhoDeeperByType[(ElementMediator.ELEMENT_MEDIATOR_FIX + (WIDTH_WHO_DEEPER_BY_TYPE * ElementMediator.ELEMENT_MEDIATOR_COMPLEX))] = -1;
m_arWhoDeeperByType[(ElementMediator.ELEMENT_MEDIATOR_FIX + (WIDTH_WHO_DEEPER_BY_TYPE * ElementMediator.ELEMENT_MEDIATOR_SIMPLE))] = -1;
m_arWhoDeeperByType[(ElementMediator.ELEMENT_MEDIATOR_FIXLINE + (WIDTH_WHO_DEEPER_BY_TYPE * ElementMediator.ELEMENT_MEDIATOR_FIX))] = 1;
m_arWhoDeeperByType[(ElementMediator.ELEMENT_MEDIATOR_FIXLINE + (WIDTH_WHO_DEEPER_BY_TYPE * ElementMediator.ELEMENT_MEDIATOR_FIXLINE))] = 0;
m_arWhoDeeperByType[(ElementMediator.ELEMENT_MEDIATOR_FIXLINE + (WIDTH_WHO_DEEPER_BY_TYPE * ElementMediator.ELEMENT_MEDIATOR_COMPLEX))] = -1;
m_arWhoDeeperByType[(ElementMediator.ELEMENT_MEDIATOR_FIXLINE + (WIDTH_WHO_DEEPER_BY_TYPE * ElementMediator.ELEMENT_MEDIATOR_SIMPLE))] = -1;
m_arWhoDeeperByType[(ElementMediator.ELEMENT_MEDIATOR_COMPLEX + (WIDTH_WHO_DEEPER_BY_TYPE * ElementMediator.ELEMENT_MEDIATOR_FIX))] = 1;
m_arWhoDeeperByType[(ElementMediator.ELEMENT_MEDIATOR_COMPLEX + (WIDTH_WHO_DEEPER_BY_TYPE * ElementMediator.ELEMENT_MEDIATOR_FIXLINE))] = 1;
m_arWhoDeeperByType[(ElementMediator.ELEMENT_MEDIATOR_COMPLEX + (WIDTH_WHO_DEEPER_BY_TYPE * ElementMediator.ELEMENT_MEDIATOR_COMPLEX))] = 0;
m_arWhoDeeperByType[(ElementMediator.ELEMENT_MEDIATOR_COMPLEX + (WIDTH_WHO_DEEPER_BY_TYPE * ElementMediator.ELEMENT_MEDIATOR_SIMPLE))] = 0;
m_arWhoDeeperByType[(ElementMediator.ELEMENT_MEDIATOR_SIMPLE + (WIDTH_WHO_DEEPER_BY_TYPE * ElementMediator.ELEMENT_MEDIATOR_FIX))] = 1;
m_arWhoDeeperByType[(ElementMediator.ELEMENT_MEDIATOR_SIMPLE + (WIDTH_WHO_DEEPER_BY_TYPE * ElementMediator.ELEMENT_MEDIATOR_FIXLINE))] = 1;
m_arWhoDeeperByType[(ElementMediator.ELEMENT_MEDIATOR_SIMPLE + (WIDTH_WHO_DEEPER_BY_TYPE * ElementMediator.ELEMENT_MEDIATOR_COMPLEX))] = 0;
m_arWhoDeeperByType[(ElementMediator.ELEMENT_MEDIATOR_SIMPLE + (WIDTH_WHO_DEEPER_BY_TYPE * ElementMediator.ELEMENT_MEDIATOR_SIMPLE))] = 0;
}
private function onChangeLayerData(_arg1:LayerChangeEvent):void{
var _local2:LayerProxy;
var _local3:LayerMediator;
var _local4:int;
var _local5:IntPoint;
var _local6:LayerElementProxy;
var _local7:ElementMediator;
var _local8:Boolean;
var _local9:Boolean;
var _local10:int;
var _local11:int;
var _local12:ElementMediator;
if (_arg1 != null){
_local2 = (_arg1.m_pLayer as LayerProxy);
_local3 = getMLayerByProxy(_local2);
if (_local3 != null){
_local4 = _arg1.m_nType;
_local5 = _arg1.m_point;
_local6 = _arg1.m_pElement;
_local7 = null;
_local8 = _arg1.m_bCreate;
_local9 = _arg1.m_bUnlock;
if (_local5 != null){
};
if (_local9){
updateElements(_local3);
} else {
if (_local8){
_local7 = _local3.updateElement(_local5, _local4, _local6, true);
if (_local7 == null){
switch (_local3.dynType){
case LAYER_DYN_TYPE_FIXED:
break;
case LAYER_DYN_TYPE_FIXED_LINE:
break;
case LAYER_DYN_TYPE_DYNAMIC:
if (_local6 != null){
_local10 = _local6.x;
_local11 = _local6.y;
_local12 = new ElementMediator_Complex(_local2, _local6);
if (((!((_local12 == null))) && (!((_local12.ui == null))))){
_local3.addElement(_local12);
insertElement(_local12);
};
} else {
if (((!((_local5 == null))) && (!((_local2 == null))))){
_local10 = _local5.m_iX;
_local11 = _local5.m_iY;
_local12 = new ElementMediator_Simple(_local2, _local10, _local11);
if (((!((_local12 == null))) && (!((_local12.ui == null))))){
_local3.addElement(_local12);
insertElement(_local12);
};
};
};
break;
};
};
} else {
_local7 = _local3.updateElement(_local5, _local4, _local6, false);
if (((!((_local7 == null))) && ((_local7.ui == null)))){
removeElement(_local7);
};
};
};
};
};
}
private function clearLayers():void{
var _local1:LayerMediator;
for each (_local1 in m_arMLayers) {
if (_local1 != null){
facade.removeMediator(_local1.getMediatorName());
};
};
}
private function getCurElementForMatrixY_Insert():ElementMediator_FixLine{
if (m_nMatrixYIndex_Insert < 0){
return (null);
};
return (m_arMatrixY_Insert[m_nMatrixYIndex_Insert]);
}
private function updateElements(_arg1:LayerMediator):Boolean{
var _local2:ElementMediator;
var _local3:int;
var _local4:int;
var _local5:LayerProxy;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:int;
if (_arg1 != null){
_local3 = _arg1.elementCount;
while (--_local3 >= 0) {
_local2 = _arg1.getElementByN(_local3);
if (_local2 != null){
removeElement(_local2);
};
};
_arg1.eraseElements();
_local4 = _arg1.dynType;
_local5 = _arg1.proxy;
if (_local5 != null){
_local6 = _local5.type;
switch (_local4){
case LAYER_DYN_TYPE_FIXED:
_local2 = new ElementMediator_Fix(_local5);
_arg1.addElement(_local2);
insertElement(_local2);
break;
case LAYER_DYN_TYPE_FIXED_LINE:
switch (_local6){
case LayerProxy.LAYER_TYPE_LABYRINTH:
case LayerProxy.LAYER_TYPE_DOUBLE_DENSITY:
_local10 = ((_local5.height >> 1) + 1);
_local8 = 0;
while (_local8 < _local10) {
_local2 = new ElementMediator_FixLine(_local5, _local8, true);
_arg1.addElement(_local2);
insertElement(_local2);
_local8++;
};
break;
default:
_local8 = 0;
while (_local8 < _local10) {
_local2 = new ElementMediator_FixLine(_local5, _local8, false);
_arg1.addElement(_local2);
insertElement(_local2);
_local8++;
};
break;
};
break;
};
};
};
return (false);
}
private function initCurrentDepth():void{
var _local1:ElementMediator;
var _local2:int;
var _local3:int;
m_arMatrixFixed.sortOn(["elementDepth"], (Array.DESCENDING | Array.NUMERIC));
m_nLayerDepth_MatrixFix_Index = (m_arMatrixFixed.length - 1);
m_arLayerDepth_MatrixY_Index = new ByteArray();
m_arLayerDepth_MatrixXY_Index = new ByteArray();
_local3 = m_arMatrixY.length;
m_arLayerDepth_MatrixY_Index.length = (_local3 << 1);
while (--_local3 >= 0) {
_local2 = getLengthForSubArr(m_arMatrixY, _local3);
setDepthMatrixYIndex(_local3, (_local2 - 1));
};
_local3 = m_arMatrixXY.length;
m_arLayerDepth_MatrixXY_Index.length = (_local3 << 1);
while (--_local3 >= 0) {
_local2 = getLengthForSubArr(m_arMatrixXY, _local3);
setDepthMatrixXYIndex(_local3, (_local2 - 1));
};
}
private function compareElements(_arg1:ElementMediator, _arg2:ElementMediator):Number{
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
if ((((_arg1 == null)) && ((_arg2 == null)))){
return (0);
};
if (_arg1 == null){
return (-1);
};
if (_arg2 == null){
return (1);
};
_local3 = _arg1.mediatorType;
_local4 = _arg2.mediatorType;
_local5 = _arg1.elementDepth;
_local6 = _arg2.elementDepth;
if (_local5 == _local6){
};
_local7 = _arg1.y;
_local8 = _arg2.y;
if ((((((_local3 == ElementMediator.ELEMENT_MEDIATOR_FIX)) || ((_local4 == ElementMediator.ELEMENT_MEDIATOR_FIX)))) || ((_local7 == _local8)))){
if (_local5 > _local6){
return (1);
};
if (_local5 < _local6){
return (-1);
};
return (m_arWhoDeeperByType[(_local3 + (WIDTH_WHO_DEEPER_BY_TYPE * _local4))]);
};
if (_local7 > _local8){
return (1);
};
return (-1);
}
}
}//package game.view
Section 211
//PauseMediator (game.view.PauseMediator)
package game.view {
import flash.display.*;
import flash.events.*;
import game.model.*;
import org.puremvc.as3.interfaces.*;
import main.*;
import game.view.components.*;
import game.view.components.Buttons.*;
import flash.text.*;
import org.puremvc.as3.patterns.mediator.*;
public class PauseMediator extends Mediator implements IMediator {
private var m_mBtnContinue:SBContinueMediator;
private var m_mSoundControl:SoundControlMediator;
private var m_mBtnLogo:SBLogoMediator;
private var m_pGame:GameProxy;
private var m_mMusicControl:SoundControlMediator;
private var m_mBtnQuit:SBMenuMediator;
private var m_mBtnSound:SBSoundMediator;
private var m_mBtnMusic:SBMusicMediator;
private var m_mcParent:MovieClip;
public static const NAME:String = "PauseMediator";
public function PauseMediator(_arg1:MovieClip, _arg2:Boolean=false){
m_mcParent = _arg1;
super(NAME, null);
m_pGame = (facade.retrieveProxy(GameProxy.NAME) as GameProxy);
}
private function listenShowed(_arg1:Event):void{
var _local2:UI_Pause;
if (m_mcParent != null){
_local2 = ui;
if (_local2 != null){
_local2.removeEventListener(UI_Pause.ON_SHOWED, listenShowed, false);
};
};
}
private function listenChangeMusic(_arg1:Event):void{
}
private function listenExitGame(_arg1:Event):void{
sendNotification(ApplicationFacade.QUIT_THE_GAME);
}
public function get ui():UI_Pause{
return ((viewComponent as UI_Pause));
}
private function set textMsg(_arg1:String):void{
var _local2:TextField;
_local2 = (ui.getChildByName("txt") as TextField);
if (((!((_local2 == null))) && (!((_arg1 == null))))){
_local2.text = _arg1;
};
}
private function listenPlayGame(_arg1:Event):void{
sendNotification(ApplicationFacade.GAME_PAUSE, false);
}
private function listenOnMouseOver(_arg1:MouseEvent):void{
var _local2:UI_SimpleBtn;
var _local3:String;
_local2 = (_arg1.currentTarget as UI_SimpleBtn);
if (_local2 != null){
_local3 = _local2.alert;
if (_local3 != null){
textMsg = _local3;
} else {
textMsg = "";
};
};
}
private function listenHiden(_arg1:Event):void{
var _local2:UI_Pause;
if (m_mcParent != null){
_local2 = ui;
if (_local2 != null){
_local2.removeEventListener(UI_Pause.ON_HIDEN, listenHiden, false);
m_mcParent.removeChild(_local2);
setViewComponent(null);
};
};
}
public function set show(_arg1:Boolean):void{
var _local2:UI_Pause;
var _local3:MovieClip;
if (m_mcParent != null){
_local2 = ui;
if (_arg1){
if (_local2 != null){
_local3 = (_local2.parent as MovieClip);
if (_local3 != null){
_local3.removeChild(_local2);
};
};
_local2 = new UI_Pause(m_mcParent);
setViewComponent(_local2);
_local2.addEventListener(UI_Pause.ON_SHOWED, listenShowed, false, 0, true);
_local2.addEventListener(UI_Pause.ON_PLAY_GAME, listenPlayGame, false, 0, true);
_local2.addEventListener(UI_Pause.ON_EXIT_GAME, listenExitGame, false, 0, true);
_local2.addEventListener(UI_Pause.ON_CHANGE_SOUND, listenChangeSound, false, 0, true);
_local2.addEventListener(UI_Pause.ON_CHANGE_MUSIC, listenChangeMusic, false, 0, true);
m_mBtnLogo = new SBLogoMediator(ui.getChildByName("gamezheroBtn"));
facade.registerMediator(m_mBtnLogo);
m_mBtnLogo.ui.addEventListener(MouseEvent.MOUSE_OVER, listenOnMouseOver, false, 0, true);
m_mBtnMusic = new SBMusicMediator(ui.getChildByName("musicGameBtn"));
facade.registerMediator(m_mBtnMusic);
m_mBtnMusic.ui.addEventListener(MouseEvent.MOUSE_OVER, listenOnMouseOver, false, 0, true);
m_mBtnSound = new SBSoundMediator(ui.getChildByName("soundGameBtn"));
facade.registerMediator(m_mBtnSound);
m_mBtnSound.ui.addEventListener(MouseEvent.MOUSE_OVER, listenOnMouseOver, false, 0, true);
m_mBtnQuit = new SBMenuMediator(ui.getChildByName("exitGameBtn"));
facade.registerMediator(m_mBtnQuit);
m_mBtnQuit.ui.addEventListener(MouseEvent.MOUSE_OVER, listenOnMouseOver, false, 0, true);
if (m_pGame != null){
m_mBtnQuit.m_pLevels = m_pGame.levels;
};
m_mBtnContinue = new SBContinueMediator(ui.getChildByName("playGameBtn"));
facade.registerMediator(m_mBtnContinue);
m_mBtnContinue.ui.addEventListener(MouseEvent.MOUSE_OVER, listenOnMouseOver, false, 0, true);
m_mMusicControl = new SoundControlMediator(ui.getChildByName("musicControl"), true);
facade.registerMediator(m_mMusicControl);
m_mMusicControl.ui.addEventListener(MouseEvent.MOUSE_OVER, listenOnMouseOver, false, 0, true);
m_mSoundControl = new SoundControlMediator(ui.getChildByName("soundControl"), false);
facade.registerMediator(m_mSoundControl);
m_mSoundControl.ui.addEventListener(MouseEvent.MOUSE_OVER, listenOnMouseOver, false, 0, true);
} else {
if (_local2 != null){
_local2.show = false;
_local2.addEventListener(UI_Pause.ON_HIDEN, listenHiden, false, 0, true);
if (m_mBtnMusic != null){
facade.removeMediator(m_mBtnMusic.getMediatorName());
};
if (m_mBtnSound != null){
facade.removeMediator(m_mBtnSound.getMediatorName());
};
if (m_mBtnQuit != null){
facade.removeMediator(m_mBtnQuit.getMediatorName());
};
if (m_mBtnContinue != null){
facade.removeMediator(m_mBtnContinue.getMediatorName());
};
if (m_mMusicControl != null){
facade.removeMediator(m_mMusicControl.getMediatorName());
};
if (m_mSoundControl != null){
facade.removeMediator(m_mSoundControl.getMediatorName());
};
};
};
};
}
public function get show():Boolean{
return (!((ui == null)));
}
private function listenChangeSound(_arg1:Event):void{
}
}
}//package game.view
Section 212
//RateLevelMediator (game.view.RateLevelMediator)
package game.view {
import flash.events.*;
import game.model.*;
import org.puremvc.as3.interfaces.*;
import com.*;
import shared_levels.model.*;
import main.*;
import shared_levels.view.components.*;
import game.view.components.*;
import org.puremvc.as3.patterns.mediator.*;
public class RateLevelMediator extends Mediator implements IMediator {
private var m_pLevel:LevelProxy;
public static const NAME:String = "RateLevelMediator";
public function RateLevelMediator(_arg1:Object, _arg2:LevelProxy){
var _local3:Number;
trace("X");
trace("CONSTRUCT public function RateLevelMediator(viewComponent:Object, pLevel:LevelProxy)");
super(NAME, _arg1);
m_pLevel = _arg2;
trace(("pLevel=" + _arg2));
trace(("pLevel.rate=" + _arg2.rate));
if (_arg2 != null){
ui.rate = _arg2.rate;
} else {
ui.rate = CommonFunc.INT_UNDEF;
};
ui.addEventListener(UI_Rate.ON_RATE_0, listenOnRate0, false, 0, true);
ui.addEventListener(UI_Rate.ON_RATE_1, listenOnRate1, false, 0, true);
ui.addEventListener(UI_Rate.ON_RATE_2, listenOnRate2, false, 0, true);
ui.addEventListener(UI_Rate.ON_RATE_3, listenOnRate3, false, 0, true);
ui.addEventListener(UI_Rate.ON_RATE_4, listenOnRate4, false, 0, true);
ui.addEventListener(UI_Rate.ON_RATE_5, listenOnRate5, false, 0, true);
}
private function set rate(_arg1:Number):void{
trace("X");
trace("RateLevelMediator private function set rate(nValue:Number):void");
trace(("levelUID=" + levelUID));
trace(("nValue=" + _arg1));
facade.sendNotification(ApplicationFacade.SL_POST_LEVEL_RATE, new SharedLevelProxy(null, levelUID, _arg1, null, null, null));
}
private function onReceiveRate(_arg1:SharedLevelProxy):void{
trace("X");
trace("RateLevelMediator private function onReceiveRate(pSL:SharedLevelProxy):void");
trace(("pSL=" + _arg1));
if (_arg1 != null){
trace(("pSL.rate = " + _arg1.rate));
trace(("pSL.id = " + _arg1.id));
ui.rate = _arg1.rate;
show = false;
sendNotification(ApplicationFacade.GAME_HAD_QUIT);
};
}
private function set show(_arg1:Boolean):void{
ui.show = _arg1;
}
override public function listNotificationInterests():Array{
var _local1:Array;
_local1 = super.listNotificationInterests();
_local1.push(ApplicationFacade.WIN_SHARED_LEVEL);
_local1.push(ApplicationFacade.SL_REQUEST_SET_LEVEL_RATE);
_local1.push(ApplicationFacade.SL_RECEIVE_SET_LEVEL_RATE);
return (_local1);
}
public function get ui():UI_Rate_Level{
return ((viewComponent as UI_Rate_Level));
}
private function listenOnRate0(_arg1:Event):void{
rate = 0;
}
private function get levelUID():String{
if (m_pLevel != null){
return (m_pLevel.uid);
};
return (null);
}
private function listenOnRate3(_arg1:Event):void{
rate = 3;
}
private function listenOnRate4(_arg1:Event):void{
rate = 4;
}
private function listenOnRate5(_arg1:Event):void{
rate = 5;
}
private function listenOnRate1(_arg1:Event):void{
rate = 1;
}
override public function handleNotification(_arg1:INotification):void{
var _local2:int;
var _local3:int;
switch (_arg1.getName()){
case ApplicationFacade.SL_RECEIVE_SET_LEVEL_RATE:
onReceiveRate((_arg1.getBody() as SharedLevelProxy));
break;
case ApplicationFacade.SL_REQUEST_SET_LEVEL_RATE:
break;
case ApplicationFacade.WIN_SHARED_LEVEL:
show = true;
break;
};
}
private function listenOnRate2(_arg1:Event):void{
rate = 2;
}
}
}//package game.view
Section 213
//Sprites (game.view.Sprites)
package game.view {
import flash.display.*;
import game.view.components.Elements.*;
import game.view.components.Elements.Character.*;
public class Sprites {
public static const SPR_ID_WATER_FILL_TL_L_B:int = (SPR_ID_WATER + 13);
public static const SPR_ID_TRAPS:int = (SPR_ID_ITEMS + 100);
public static const ICON_ID_TRAP_KEY_BLUE:int = (ICON_ID_TRAPS + 0);
public static const ICON_ID_FLOOR_GROUND_LIGHT:int = (ICON_ID_FLOORS + 0);
public static const ICON_ID_LABYRINTH_ITEM:int = (ICON_ID_LABYRINTH + 100);
public static const SPR_ID_LABYRINTH_STAIRWAY_UP:int = (SPR_ID_LABYRINTH + 20);
public static const ICON_ID_CHARACTER_GHOST:int = (ICON_ID_CHARACTERS + 1);
public static const SPR_ID_LABYRINTH_STAIRWAY_RIGHT:int = (SPR_ID_LABYRINTH + 21);
public static const SPR_ID_LABYRINTH_ITEM_ENSIGN_TOWER:int = (SPR_ID_LABYRINTH_ITEM + 2);
public static const SPR_ID_WATER_FILL_L_R:int = (SPR_ID_WATER + 6);
public static const SPR_ID_WATER_FILL_T_L:int = (SPR_ID_WATER + 7);
public static const SPR_ID_ITEM_FIRE:int = (SPR_ID_ITEMS + 0);
public static const ICON_ID_RAFT:int = (ICON_ID_WATER_ITEMS + 0);
public static const SPR_ID_FLOOR_GROUND_LIGHT:int = (SPR_ID_FLOORS + 0);
public static const SPR_ID_WATER_FILL_T_R:int = (SPR_ID_WATER + 8);
public static const ICON_ID_LABYRINTH_ITEM_TORCH:int = (ICON_ID_LABYRINTH_ITEM + 7);
public static const SPR_ID_ITEM_VASE:int = (SPR_ID_ITEMS + 1);
public static const ICON_ID_ITEM_CANDLESTICK:int = (ICON_ID_ITEMS + 3);
public static const ICON_ID_FLOOR_TILE_LIGHT:int = (ICON_ID_FLOORS + 2);
public static const SPR_ID_LABYRINTH_ITEM:int = (SPR_ID_LABYRINTH_BLOCK + 100);
public static const SPR_ID_WATER:int = (SPR_ID_GRASS + 100);
public static const SPR_ID_WATER_EMPTY_TL_T_L_BL_B:int = (SPR_ID_WATER + 30);
public static const ICON_ID_INFO_2:int = (ICON_ID_INFO + 2);
public static const ICON_ID_INFO_3:int = (ICON_ID_INFO + 3);
public static const ICON_ID_INFO_4:int = (ICON_ID_INFO + 4);
public static const ICON_ID_INFO_5:int = (ICON_ID_INFO + 5);
public static const ICON_ID_FLOOR_TILE_DARK:int = (ICON_ID_FLOORS + 3);
public static const ICON_ID_LABYRINTH_ITEM_ENSIGN_00:int = (ICON_ID_LABYRINTH_ITEM + 0);
public static const ICON_ID_TRAP_KEY_RED:int = (ICON_ID_TRAPS + 1);
public static const SPR_ID_WATER_LAKE:int = (SPR_ID_WATER + 1);
public static const ICON_ID_INFO_6:int = (ICON_ID_INFO + 6);
public static const ICON_ID_INFO_7:int = (ICON_ID_INFO + 7);
public static const ICON_ID_INFO_8:int = (ICON_ID_INFO + 8);
public static const ICON_ID_INFO_0:int = (ICON_ID_INFO + 0);
public static const SPR_ID_INFO_0:int = (SPR_ID_INFO + 0);
public static const SPR_ID_INFO_2:int = (SPR_ID_INFO + 2);
public static const SPR_ID_WATER_EMPTY_T_TR_R_B_BR:int = (SPR_ID_WATER + 32);
public static const SPR_ID_INFO_4:int = (SPR_ID_INFO + 4);
public static const SPR_ID_INFO_6:int = (SPR_ID_INFO + 6);
public static const SPR_ID_INFO_7:int = (SPR_ID_INFO + 7);
public static const SPR_ID_INFO_9:int = (SPR_ID_INFO + 9);
public static const SPR_ID_INFO_3:int = (SPR_ID_INFO + 3);
public static const ICON_ID_ITEM_BOX:int = (ICON_ID_ITEMS + 2);
public static const SPR_ID_INFO_5:int = (SPR_ID_INFO + 5);
private static const SPRITES:Array = [[0, null], [SPR_ID_FLOOR_GROUND_LIGHT, Floor_00], [SPR_ID_FLOOR_GROUND_DARK, Floor_01], [SPR_ID_FLOOR_TILE_LIGHT, Tile_Light], [SPR_ID_FLOOR_TILE_DARK, Tile_Dark], [SPR_ID_GRASS, Grass_00], [SPR_ID_LABYRINTH_COLUMN, Wall_00], [SPR_ID_LABYRINTH_WALL_V, Wall_01], [SPR_ID_LABYRINTH_WALL_H, Wall_02], [SPR_ID_LABYRINTH_WALL_H_FENCE, Wall_Fence], [SPR_ID_LABYRINTH_STAIRWAY_UP, Stairway_Up], [SPR_ID_LABYRINTH_STAIRWAY_RIGHT, Stairway_Right], [SPR_ID_LABYRINTH_STAIRWAY_LEFT, Stairway_Left], [SPR_ID_LABYRINTH_BLOCK, Wall_Block_00], [SPR_ID_LABYRINTH_ITEM_ENSIGN_00, Wall_Items_Ensign_00], [SPR_ID_LABYRINTH_ITEM_ENSIGN_BOW, Wall_Items_Ensign_Bow], [SPR_ID_LABYRINTH_ITEM_ENSIGN_TOWER, Wall_Items_Ensign_Tower], [SPR_ID_LABYRINTH_ITEM_HORNS, Wall_Items_Horns], [SPR_ID_LABYRINTH_ITEM_SHIELD_RED, Wall_Items_Shield_Red], [SPR_ID_LABYRINTH_ITEM_SHIELD_GREEN, Wall_Items_Shield_Green], [SPR_ID_LABYRINTH_ITEM_SHIELD_BLACK_N_WHITE, Wall_Items_Shield_BlackAndWhite], [SPR_ID_LABYRINTH_ITEM_TORCH, UI_Labyrinth_Item_Torch], [SPR_ID_WATER, Water_Fill], [SPR_ID_WATER_LAKE, Water_Lake], [SPR_ID_WATER_FILL_L, Water_Fill_L], [SPR_ID_WATER_FILL_R, Water_Fill_R], [SPR_ID_WATER_FILL_T, Water_Fill_T], [SPR_ID_WATER_FILL_B, Water_Fill_B], [SPR_ID_WATER_FILL_L_R, Water_Fill_L_R], [SPR_ID_WATER_FILL_T_R, Water_Fill_T_R], [SPR_ID_WATER_FILL_T_L, Water_Fill_T_L], [SPR_ID_WATER_FILL_B_R, Water_Fill_B_R], [SPR_ID_WATER_FILL_B_L, Water_Fill_B_L], [SPR_ID_WATER_FILL_TL_L, Water_Fill_TL_L], [SPR_ID_WATER_FILL_TR_R, Water_Fill_TR_R], [SPR_ID_WATER_FILL_TL_L_B, Water_Fill_TL_L_B], [SPR_ID_WATER_FILL_TR_R_B, Water_Fill_TR_R_B], [SPR_ID_WATER_FILL_TL_L_R_B, Water_Fill_TL_L_R_B], [SPR_ID_WATER_FILL_TR_L_R_B, Water_Fill_TR_L_R_B], [SPR_ID_WATER_FILL_TL_TR_L_R_B, Water_Fill_TL_TR_L_R_B], [SPR_ID_WATER_EMPTY_TL_T_TR_L_R_BL_B_BR, Water_Empty_TL_T_TR_L_R_BL_B_BR], [SPR_ID_WATER_EMPTY_TL_T_L_R_BL_B_BR, Water_Empty_TL_T_L_R_BL_B_BR], [SPR_ID_WATER_EMPTY_T_TR_L_R_BL_B_BR, Water_Empty_T_TR_L_R_BL_B_BR], [SPR_ID_WATER_EMPTY_TL_T_TR_L_R_B_BR, Water_Empty_TL_T_TR_L_R_B_BR], [SPR_ID_WATER_EMPTY_TL_T_TR_L_R_BL_B, Water_Empty_TL_T_TR_L_R_BL_B], [SPR_ID_WATER_EMPTY_L_R_BL_B_BR, Water_Empty_L_R_BL_B_BR], [SPR_ID_WATER_EMPTY_TL_T_L_BL_B, Water_Empty_TL_T_L_BL_B], [SPR_ID_WATER_EMPTY_TL_T_TR_L_R, Water_Empty_TL_T_TR_L_R], [SPR_ID_WATER_EMPTY_T_TR_R_B_BR, Water_Empty_T_TR_R_B_BR], [SPR_ID_WATER_EMPTY_R_B_BR, Water_Empty_R_B_BR], [SPR_ID_WATER_EMPTY_L_BL_B, Water_Empty_L_BL_B], [SPR_ID_WATER_EMPTY_TL_T_L, Water_Empty_TL_T_L], [SPR_ID_WATER_EMPTY_T_TR_R, Water_Empty_T_TR_R], [SPR_ID_WATER_EMPTY_T_TR_L_R_BL_B, Water_Empty_T_TR_L_R_BL_B], [SPR_ID_WATER_EMPTY_TL_T_L_R_B_BR, Water_Empty_TL_T_L_R_B_BR], [SPR_ID_WATER_BUBBLES, UI_Water_Bubbles], [SPR_ID_WATER_BUBBLE, Water_Bubble], [SPR_ID_CHARACTER_HERO, UI_Character_Hero], [SPR_ID_CHARACTER_GHOST, UI_Character_Ghost], [SPR_ID_CHARACTER_KNIGHT, UI_Character_Knight], [SPR_ID_CHARACTER_MADAM, UI_Character_Madam], [SPR_ID_ITEM_FIRE, UI_Item_Fire], [SPR_ID_ITEM_VASE, Item_Vase], [SPR_ID_ITEM_BOX, Item_Box], [SPR_ID_ITEM_CANDLESTICK, UI_Item_Candlestick], [SPR_ID_TRAP_KEY_BLUE, UI_Item_Key_Blue], [SPR_ID_TRAP_KEY_RED, UI_Item_Key_Red], [SPR_ID_TRAP_KEY_GREEN, UI_Item_Key_Green], [SPR_ID_TRAP_SHARP_BLUE, UI_Trap_Sharp_Blue], [SPR_ID_TRAP_SHARP_RED, UI_Trap_Sharp_Red], [SPR_ID_TRAP_SHARP_GREEN, UI_Trap_Sharp_Green], [SPR_ID_INFO_0, UI_Item_Info], [SPR_ID_INFO_1, UI_Item_Info], [SPR_ID_INFO_2, UI_Item_Info], [SPR_ID_INFO_3, UI_Item_Info], [SPR_ID_INFO_4, UI_Item_Info], [SPR_ID_INFO_5, UI_Item_Info], [SPR_ID_INFO_6, UI_Item_Info], [SPR_ID_INFO_7, UI_Item_Info], [SPR_ID_INFO_8, UI_Item_Info], [SPR_ID_INFO_9, UI_Item_Info], [SPR_ID_INFO_10, UI_Item_Info], [SPR_ID_RAFT, UI_Raft], [ICON_ID_FLOOR_GROUND_LIGHT, Icon_Floor_Ground_Light], [ICON_ID_FLOOR_GROUND_DARK, Icon_Floor_Ground_Dark], [ICON_ID_FLOOR_TILE_LIGHT, Icon_Floor_Tile_Light], [ICON_ID_FLOOR_TILE_DARK, Icon_Floor_Tile_Dark], [ICON_ID_WATER, Icon_Water], [ICON_ID_BUBBLE, Icon_Bubble], [ICON_ID_LABYRINTH, Icon_Labyrinth], [ICON_ID_LABYRINTH_WALL_H_FENCE, Icon_Labyrinth_Fence], [ICON_ID_LABYRINTH_STAIRWAY_UP, Icon_Stairway_Up], [ICON_ID_LABYRINTH_STAIRWAY_RIGHT, Icon_Stairway_Right], [ICON_ID_LABYRINTH_STAIRWAY_LEFT, Icon_Stairway_Left], [ICON_ID_LABYRINTH_ITEM_ENSIGN_00, Icon_Labyrinth_Item_Ensign_Swords], [ICON_ID_LABYRINTH_ITEM_ENSIGN_BOW, Icon_Labyrinth_Item_Ensign_Bow], [ICON_ID_LABYRINTH_ITEM_ENSIGN_TOWER, Icon_Labyrinth_Item_Ensign_Tower], [ICON_ID_LABYRINTH_ITEM_HORNS, Icon_Labyrinth_Item_Horns], [ICON_ID_LABYRINTH_ITEM_SHIELD_RED, Icon_Labyrinth_Item_Shield_Red], [ICON_ID_LABYRINTH_ITEM_SHIELD_GREEN, Icon_Labyrinth_Item_Shield_Green], [ICON_ID_LABYRINTH_ITEM_SHIELD_BLACK_N_WHITE, Icon_Labyrinth_Item_Shield_Black_n_White], [ICON_ID_LABYRINTH_ITEM_TORCH, Icon_Labyrinth_Item_Torch], [ICON_ID_CHARACTER_HERO, Icon_Character_Hero], [ICON_ID_CHARACTER_GHOST, Icon_Character_Ghost], [ICON_ID_CHARACTER_KNIGHT, Icon_Character_Knight], [ICON_ID_CHARACTER_MADAM, Icon_Character_Madam], [ICON_ID_ITEM_FIRE, Icon_Item_Fire], [ICON_ID_ITEM_VASE, Icon_Item_Vase], [ICON_ID_ITEM_BOX, Icon_Item_Box], [ICON_ID_ITEM_CANDLESTICK, Icon_Item_Candlestick], [ICON_ID_TRAP_KEY_BLUE, Icon_Trap_Key_Blue], [ICON_ID_TRAP_KEY_RED, Icon_Trap_Key_Red], [ICON_ID_TRAP_KEY_GREEN, Icon_Trap_Key_Green], [ICON_ID_TRAP_SHARP_BLUE, Icon_Trap_Sharp_Blue], [ICON_ID_TRAP_SHARP_RED, Icon_Trap_Sharp_Red], [ICON_ID_TRAP_SHARP_GREEN, Icon_Trap_Sharp_Green], [ICON_ID_RAFT, Icon_Raft], [ICON_ID_INFO_0, Icon_Info_0], [ICON_ID_INFO_1, Icon_Info_1], [ICON_ID_INFO_2, Icon_Info_2], [ICON_ID_INFO_3, Icon_Info_3], [ICON_ID_INFO_4, Icon_Info_4], [ICON_ID_INFO_5, Icon_Info_5], [ICON_ID_INFO_6, Icon_Info_6], [ICON_ID_INFO_7, Icon_Info_7], [ICON_ID_INFO_8, Icon_Info_8], [ICON_ID_INFO_9, Icon_Info_9], [ICON_ID_INFO_10, Icon_Info_10]];
public static const SPR_ID_INFO_8:int = (SPR_ID_INFO + 8);
public static const SPR_ID_INFO_1:int = (SPR_ID_INFO + 1);
public static const SPR_ID_CHARACTER_MADAM:int = (SPR_ID_CHARACTERS + 3);
public static const ICON_ID_CHARACTER_KNIGHT:int = (ICON_ID_CHARACTERS + 2);
public static const ICON_ID_LABYRINTH_STAIRWAY_LEFT:int = (ICON_ID_LABYRINTH + 4);
public static const SPR_ID_TRAP_KEY_BLUE:int = (SPR_ID_TRAPS + 0);
public static const ICON_ID_INFO_1:int = (ICON_ID_INFO + 1);
public static const SPR_ID_WATER_EMPTY_TL_T_TR_L_R:int = (SPR_ID_WATER + 31);
public static const ICON_ID_INFO_9:int = (ICON_ID_INFO + 9);
public static const ICON_ID_ITEMS:int = (ICON_ID_CHARACTERS + 100);
public static const ICON_ID_TRAP_SHARP_BLUE:int = (ICON_ID_TRAPS + 3);
public static const SPR_ID_WATER_FILL_TR_R:int = (SPR_ID_WATER + 12);
public static const ICON_ID_LABYRINTH:int = (ICON_ID_WATER + 100);
public static const SPR_ID_LABYRINTH_BLOCK:int = (SPR_ID_LABYRINTH + 100);
public static const SPR_ID_WATER_FILL_B_L:int = (SPR_ID_WATER + 10);
public static const SPR_ID_WATER_FILL_B_R:int = (SPR_ID_WATER + 9);
public static const SPR_ID_LABYRINTH_ITEM_HORNS:int = (SPR_ID_LABYRINTH_ITEM + 3);
public static const SPR_ID_INFO:int = (SPR_ID_TRAPS + 100);
public static const SPR_ID_DEF:int = -1;
public static const SPR_ID_WATER_EMPTY_TL_T_TR_R_B_BR:int = (SPR_ID_WATER + 25);
public static const ICON_ID_LABYRINTH_ITEM_ENSIGN_BOW:int = (ICON_ID_LABYRINTH_ITEM + 1);
public static const SPR_ID_WATER_FILL_B:int = (SPR_ID_WATER + 5);
public static const ICON_ID_LABYRINTH_ITEM_ENSIGN_TOWER:int = (ICON_ID_LABYRINTH_ITEM + 2);
public static const SPR_ID_WATER_BUBBLE:int = (SPR_ID_WATER + 41);
public static const SPR_ID_WATER_FILL_L:int = (SPR_ID_WATER + 2);
public static const ICON_ID_CHARACTERS:int = (ICON_ID_LABYRINTH_ITEM + 100);
public static const SPR_ID_WATER_FILL_R:int = (SPR_ID_WATER + 3);
public static const SPR_ID_WATER_FILL_T:int = (SPR_ID_WATER + 4);
public static const SPR_ID_WATER_FILL_TR_L_R_B:int = (SPR_ID_WATER + 16);
public static const SPR_ID_GRASS:int = (SPR_ID_FLOORS + 100);
public static const ICON_ID_CHARACTER_HERO:int = (ICON_ID_CHARACTERS + 0);
public static const ICON_ID_LABYRINTH_WALL_H_FENCE:int = (ICON_ID_LABYRINTH + 1);
public static const SPR_ID_CHARACTERS:int = (SPR_ID_LABYRINTH_ITEM + 100);
public static const SPR_ID_LABYRINTH:int = (SPR_ID_WATER + 100);
public static const SPR_ID_ITEMS:int = (SPR_ID_CHARACTERS + 100);
public static const SPR_ID_CHARACTER_HERO:int = (SPR_ID_CHARACTERS + 0);
public static const SPR_ID_WATER_EMPTY_T_TR_L_BL_B_BR:int = (SPR_ID_WATER + 24);
public static const SPR_ID_WATER_EMPTY_TL_T_L:int = (SPR_ID_WATER + 35);
public static const SPR_ID_LABYRINTH_ITEM_SHIELD_BLACK_N_WHITE:int = (SPR_ID_LABYRINTH_ITEM + 6);
public static const SPR_ID_LABYRINTH_WALL_H_FENCE:int = (SPR_ID_LABYRINTH + 3);
public static const ICON_ID_LABYRINTH_STAIRWAY_RIGHT:int = (ICON_ID_LABYRINTH + 3);
public static const ICON_ID_CHARACTER_MADAM:int = (ICON_ID_CHARACTERS + 3);
public static const SPR_ID_WATER_FILL_TL_TR_L_R_B:int = (SPR_ID_WATER + 17);
public static const SPR_ID_TRAP_SHARP_GREEN:int = (SPR_ID_TRAPS + 5);
public static const SPR_ID_WATER_ITEMS:int = (SPR_ID_INFO + 100);
public static const SPR_ID_WATER_EMPTY_TL_T_TR_L_BL_B:int = (SPR_ID_WATER + 26);
public static const SPR_ID_INFO_10:int = (SPR_ID_INFO + 10);
public static const SPR_ID_LABYRINTH_ITEM_ENSIGN_BOW:int = (SPR_ID_LABYRINTH_ITEM + 1);
public static const SPR_ID_RAFT:int = (SPR_ID_WATER_ITEMS + 0);
public static const ICON_ID_FLOOR_GROUND_DARK:int = (ICON_ID_FLOORS + 1);
public static const SPR_ID_WATER_EMPTY_T_TR_L_R_BL_B_BR:int = (SPR_ID_WATER + 20);
public static const SPR_ID_WATER_EMPTY_TL_T_L_R_BL_B_BR:int = (SPR_ID_WATER + 19);
public static const SPR_ID_WATER_BUBBLES:int = (SPR_ID_WATER + 40);
public static const ICON_ID_TRAP_SHARP_RED:int = (ICON_ID_TRAPS + 4);
public static const SPR_ID_LABYRINTH_ITEM_TORCH:int = (SPR_ID_LABYRINTH_ITEM + 7);
public static const ICON_ID_FLOORS:int = (SPR_ID_WATER_ITEMS + 1000);
public static const SPR_ID_WATER_EMPTY_R_B_BR:int = (SPR_ID_WATER + 33);
public static const SPR_ID_WATER_EMPTY_T_TR_L_R_BL_B:int = (SPR_ID_WATER + 27);
public static const SPR_ID_WATER_EMPTY_TL_T_TR_L_R_B_BR:int = (SPR_ID_WATER + 21);
public static const SPR_ID_ITEM_CANDLESTICK:int = (SPR_ID_ITEMS + 3);
public static const SPR_ID_FLOOR_TILE_LIGHT:int = (SPR_ID_FLOORS + 2);
public static const SPR_ID_WATER_FILL_TL_L_R_B:int = (SPR_ID_WATER + 15);
public static const SPR_ID_TRAP_KEY_RED:int = (SPR_ID_TRAPS + 1);
public static const SPR_ID_LABYRINTH_ITEM_SHIELD_GREEN:int = (SPR_ID_LABYRINTH_ITEM + 5);
public static const SPR_ID_FLOORS:int = 1;
public static const SPR_ID_TRAP_SHARP_RED:int = (SPR_ID_TRAPS + 4);
public static const SPR_ID_LABYRINTH_ITEM_ENSIGN_00:int = (SPR_ID_LABYRINTH_ITEM + 0);
public static const SPR_ID_WATER_EMPTY_TL_T_TR_L_R_BL_B:int = (SPR_ID_WATER + 22);
public static const SPR_ID_ITEM_BOX:int = (SPR_ID_ITEMS + 2);
public static const SPR_ID_CHARACTER_KNIGHT:int = (SPR_ID_CHARACTERS + 2);
public static const SPR_ID_WATER_EMPTY_TL_T_TR_L_R_BL_B_BR:int = (SPR_ID_WATER + 18);
public static const SPR_ID_NULL:int = 0;
public static const ICON_ID_LABYRINTH_ITEM_HORNS:int = (ICON_ID_LABYRINTH_ITEM + 3);
public static const SPR_ID_CHARACTER_GHOST:int = (SPR_ID_CHARACTERS + 1);
public static const ICON_ID_LABYRINTH_ITEM_SHIELD_RED:int = (ICON_ID_LABYRINTH_ITEM + 4);
public static const SPR_ID_WATER_FILL_TR_R_B:int = (SPR_ID_WATER + 14);
public static const ICON_ID_INFO:int = (ICON_ID_TRAPS + 100);
public static const SPR_ID_WATER_EMPTY_L_R_BL_B_BR:int = (SPR_ID_WATER + 29);
public static const ICON_ID_LABYRINTH_ITEM_SHIELD_BLACK_N_WHITE:int = (ICON_ID_LABYRINTH_ITEM + 6);
public static const SPR_ID_FLOOR_TILE_DARK:int = (SPR_ID_FLOORS + 3);
public static const SPR_ID_FLOOR_GROUND_DARK:int = (SPR_ID_FLOORS + 1);
public static const ICON_ID_TRAPS:int = (ICON_ID_ITEMS + 100);
public static const SPR_ID_WATER_EMPTY_TL_T_L_R_B_BR:int = (SPR_ID_WATER + 28);
public static const SPR_ID_LABYRINTH_WALL_H:int = (SPR_ID_LABYRINTH + 2);
public static const ICON_ID_TRAP_KEY_GREEN:int = (ICON_ID_TRAPS + 2);
public static const ICON_ID_INFO_10:int = (ICON_ID_INFO + 10);
public static const ICON_ID_WATER_ITEMS:int = (ICON_ID_INFO + 100);
public static const SPR_ID_LABYRINTH_WALL_V:int = (SPR_ID_LABYRINTH + 1);
public static const ICON_ID_LABYRINTH_STAIRWAY_UP:int = (ICON_ID_LABYRINTH + 2);
public static const SPR_ID_WATER_EMPTY_L_BL_B:int = (SPR_ID_WATER + 34);
public static const ICON_ID_ITEM_FIRE:int = (ICON_ID_ITEMS + 0);
public static const SPR_ID_LABYRINTH_STAIRWAY_LEFT:int = (SPR_ID_LABYRINTH + 22);
public static const SPR_ID_TRAP_SHARP_BLUE:int = (SPR_ID_TRAPS + 3);
public static const SPR_ID_TRAP_KEY_GREEN:int = (SPR_ID_TRAPS + 2);
public static const ICON_ID_ITEM_VASE:int = (ICON_ID_ITEMS + 1);
public static const ICON_ID_WATER:int = (ICON_ID_FLOORS + 100);
public static const ICON_ID_BUBBLE:int = (ICON_ID_WATER + 1);
public static const SPR_ID_LABYRINTH_ITEM_SHIELD_RED:int = (SPR_ID_LABYRINTH_ITEM + 4);
public static const SPR_ID_WATER_EMPTY_TL_L_R_BL_B_BR:int = (SPR_ID_WATER + 23);
public static const SPR_ID_WATER_EMPTY_T_TR_R:int = (SPR_ID_WATER + 36);
public static const SPR_ID_LABYRINTH_COLUMN:int = (SPR_ID_LABYRINTH + 0);
public static const ICON_ID_TRAP_SHARP_GREEN:int = (ICON_ID_TRAPS + 5);
public static const ICON_ID_LABYRINTH_ITEM_SHIELD_GREEN:int = (ICON_ID_LABYRINTH_ITEM + 5);
public static const SPR_ID_WATER_FILL_TL_L:int = (SPR_ID_WATER + 11);
public static function isHero(_arg1:int):Boolean{
return ((_arg1 == Sprites.SPR_ID_CHARACTER_HERO));
}
public static function isEnemy(_arg1:int):Boolean{
return ((((((_arg1 == SPR_ID_CHARACTER_GHOST)) || ((_arg1 == SPR_ID_CHARACTER_KNIGHT)))) || ((_arg1 == SPR_ID_CHARACTER_MADAM))));
}
public static function clearSprites():void{
var _local1:Array;
var _local2:int;
_local2 = SPRITES.length;
while (--_local2 >= 0) {
_local1 = SPRITES[_local2];
if (((!((_local1 == null))) && (!((_local1[3] == null))))){
_local1.length = 2;
};
};
}
public static function getBitmapData(_arg1:int):BitmapData{
return ((getItem(_arg1) as BitmapData));
}
public static function getItem(_arg1:int, _arg2:Boolean=false, _arg3:Boolean=false):MovieClip{
var _local4:Array;
var _local5:Class;
var _local6:int;
var _local7:MovieClip;
var _local8:UI_Element_With_Animation;
_local6 = SPRITES.length;
while (--_local6 >= 0) {
_local4 = SPRITES[_local6];
if (((!((_local4 == null))) && ((_local4[0] == _arg1)))){
if (_arg2){
_local5 = _local4[1];
if (_local5 != null){
_local7 = new (_local5);
if (_arg3){
_local8 = (_local7 as UI_Element_With_Animation);
if (_local8 != null){
_local8.freezeAnimation();
};
};
};
} else {
_local7 = _local4[2];
if (_local7 == null){
_local5 = _local4[1];
if (_local5 != null){
_local7 = new (_local5);
_local4[2] = _local7;
};
};
};
return (_local7);
};
};
return (null);
}
}
}//package game.view
Section 214
//UndoMediator (game.view.UndoMediator)
package game.view {
import flash.events.*;
import org.puremvc.as3.interfaces.*;
import main.*;
import game.view.components.*;
import org.puremvc.as3.patterns.mediator.*;
public class UndoMediator extends Mediator implements IMediator {
public static const NAME:String = "UndoMediator";
public function UndoMediator(_arg1:Object){
super(UndoMediator.NAME, _arg1);
if (ui != null){
ui.addEventListener(UI_Undo.ON_CLICK, listenOnClickUndo, false, 0, true);
};
}
public function get ui():UI_Undo{
return ((viewComponent as UI_Undo));
}
private function listenOnClickUndo(_arg1:Event):void{
sendNotification(ApplicationFacade.UNDO_MOVE);
}
}
}//package game.view
Section 215
//LangCommand (main.controller.LangCommand)
package main.controller {
import org.puremvc.as3.interfaces.*;
import com.*;
import main.*;
import org.puremvc.as3.patterns.command.*;
public class LangCommand extends SimpleCommand implements ICommand {
override public function execute(_arg1:INotification):void{
var _local2:int;
var _local3:String;
trace("LangCommand :: override public function execute( note:INotification ) : void ");
_local2 = (_arg1.getBody() as int);
_local3 = TLang.getLangByCountry(_local2);
Language_Settings.getInstance().setCurrentLang(_local3);
}
}
}//package main.controller
Section 216
//PageCommand (main.controller.PageCommand)
package main.controller {
import game.model.*;
import org.puremvc.as3.interfaces.*;
import shared_levels.model.*;
import main.*;
import editor.model.*;
import classes.*;
import org.puremvc.as3.patterns.command.*;
import main.model.*;
public class PageCommand extends SimpleCommand implements ICommand {
override public function execute(_arg1:INotification):void{
var _local2:PageCommandStruct;
var _local3:int;
var _local4:LevelProxy;
var _local5:LevelsProxy;
var _local6:IProxy;
var _local7:MusicProxy;
var _local8:SoundProxy;
var _local9:MapProxy;
var _local10:SharedLevelsProxy;
var _local11:GameProxy;
var _local12:PlayerProxy;
var _local13:EditorProxy;
_local2 = (_arg1.getBody() as PageCommandStruct);
if (_local2 != null){
_local3 = _local2.m_iPage;
_local4 = _local2.m_pLevel;
_local5 = _local2.m_pLevels;
_local6 = _local2.m_pContext;
_local7 = (facade.retrieveProxy(MusicProxy.NAME) as MusicProxy);
_local8 = (facade.retrieveProxy(SoundProxy.NAME) as SoundProxy);
switch (_local3){
case PagesProxy.PAGE_MAP:
if (_local5 == null){
_local5 = LevelsProxy.getDefCompanyLevels();
facade.registerProxy(_local5);
sendNotification(ApplicationFacade.HERO_START_LEVELS, _local5);
};
_local5.inGame = false;
facade.removeProxy(MapProxy.NAME);
_local9 = new MapProxy(_local5, _local6);
facade.registerProxy(_local9);
break;
case PagesProxy.PAGE_SHARED_LEVELS:
_local10 = (facade.retrieveProxy(SharedLevelsProxy.NAME) as SharedLevelsProxy);
if (_local10 == null){
_local10 = new SharedLevelsProxy();
facade.registerProxy(_local10);
};
if (_local7 != null){
_local7.mode = MusicProxy.MUSIC_MODE_INTERFACE;
};
if (_local8 != null){
_local8.mode = SoundProxy.SOUND_MODE_INTERFACE;
};
break;
case PagesProxy.PAGE_GAME:
if (_local5 == null){
if (_local4 == null){
_local5 = LevelsProxy.getDefCompanyLevels();
facade.registerProxy(_local5);
} else {
_local5 = _local4.parent;
};
};
if (_local5 != null){
_local5.inGame = true;
_local4 = _local5.select;
};
facade.removeProxy(GameProxy.NAME);
if (_local4 != null){
_local4.listenStartPlay();
};
_local11 = new GameProxy(_local5, _local6);
facade.registerProxy(_local11);
_local11.start();
break;
case PagesProxy.PAGE_FINAL:
case PagesProxy.PAGE_GAMEOVER:
_local12 = (facade.retrieveProxy(PlayerProxy.NAME) as PlayerProxy);
if (_local12 != null){
Global.setSckore(_local12.getScoreForLevels());
};
if (_local7 != null){
_local7.mode = MusicProxy.MUSIC_MODE_INTERFACE;
};
if (_local8 != null){
_local8.mode = SoundProxy.SOUND_MODE_INTERFACE;
};
break;
case PagesProxy.PAGE_EDITOR:
if (_local5 == null){
_local5 = (facade.retrieveProxy(LevelsProxy.NAME_USER_EDITION) as LevelsProxy);
if (_local5 == null){
_local5 = new LevelsProxy(true);
_local5.initDef(true);
facade.registerProxy(_local5);
};
};
_local5.setPlayStateForAll(LevelProxy.PLAY_STATE_UNDEF);
_local5.inGame = false;
facade.removeProxy(EditorProxy.NAME);
_local13 = new EditorProxy(_local5);
facade.registerProxy(_local13);
break;
};
};
}
}
}//package main.controller
Section 217
//PageCommandStruct (main.controller.PageCommandStruct)
package main.controller {
import game.model.*;
import org.puremvc.as3.interfaces.*;
public class PageCommandStruct {
public var m_pLevel:LevelProxy;
public var m_pLevels:LevelsProxy;
public var m_pContext:IProxy;
public var m_iPage:int;
public function PageCommandStruct(_arg1:int, _arg2:LevelsProxy=null, _arg3:LevelProxy=null, _arg4:IProxy=null){
m_iPage = _arg1;
m_pLevel = _arg3;
m_pLevels = _arg2;
m_pContext = _arg4;
}
}
}//package main.controller
Section 218
//SetMusicMuteCommand (main.controller.SetMusicMuteCommand)
package main.controller {
import org.puremvc.as3.interfaces.*;
import org.puremvc.as3.patterns.command.*;
import main.model.*;
public class SetMusicMuteCommand extends SimpleCommand implements ICommand {
override public function execute(_arg1:INotification):void{
var _local2:MusicProxy;
_local2 = (facade.retrieveProxy(MusicProxy.NAME) as MusicProxy);
if (_local2 != null){
_local2.mute = (_arg1.getBody() as Boolean);
};
}
}
}//package main.controller
Section 219
//SetMusicValueCommand (main.controller.SetMusicValueCommand)
package main.controller {
import org.puremvc.as3.interfaces.*;
import org.puremvc.as3.patterns.command.*;
import main.model.*;
public class SetMusicValueCommand extends SimpleCommand implements ICommand {
override public function execute(_arg1:INotification):void{
var _local2:MusicProxy;
trace("X");
trace("SetMusicValueCommand override public function execute( note:INotification ) : void");
_local2 = (facade.retrieveProxy(MusicProxy.NAME) as MusicProxy);
trace(("pMusic=" + _local2));
if (_local2 != null){
trace(("note.getBody() as Number=" + (_arg1.getBody() as Number)));
_local2.volume = (_arg1.getBody() as Number);
trace(("pMusic.volume=" + _local2.volume));
};
}
}
}//package main.controller
Section 220
//SetSoundMuteCommand (main.controller.SetSoundMuteCommand)
package main.controller {
import org.puremvc.as3.interfaces.*;
import org.puremvc.as3.patterns.command.*;
import main.model.*;
public class SetSoundMuteCommand extends SimpleCommand implements ICommand {
override public function execute(_arg1:INotification):void{
var _local2:SoundProxy;
_local2 = (facade.retrieveProxy(SoundProxy.NAME) as SoundProxy);
if (_local2 != null){
_local2.mute = (_arg1.getBody() as Boolean);
};
}
}
}//package main.controller
Section 221
//SetSoundValueCommand (main.controller.SetSoundValueCommand)
package main.controller {
import org.puremvc.as3.interfaces.*;
import org.puremvc.as3.patterns.command.*;
import main.model.*;
public class SetSoundValueCommand extends SimpleCommand implements ICommand {
override public function execute(_arg1:INotification):void{
var _local2:SoundProxy;
trace("X");
trace("SetSoundValueCommand override public function execute( note:INotification ) : void");
_local2 = (facade.retrieveProxy(SoundProxy.NAME) as SoundProxy);
trace(("pSound=" + _local2));
if (_local2 != null){
trace(("note.getBody() as Number=" + (_arg1.getBody() as Number)));
_local2.volume = (_arg1.getBody() as Number);
trace(("pSound.volume=" + _local2.volume));
};
}
}
}//package main.controller
Section 222
//StartupCommand (main.controller.StartupCommand)
package main.controller {
import flash.display.*;
import org.puremvc.as3.interfaces.*;
import shared_levels.model.*;
import main.*;
import main.view.*;
import classes.*;
import org.puremvc.as3.patterns.command.*;
import main.model.*;
public class StartupCommand extends SimpleCommand implements ICommand {
override public function execute(_arg1:INotification):void{
var _local2:SharedObjectProxy;
var _local3:MusicProxy;
var _local4:SoundProxy;
var _local5:PagesProxy;
var _local6:TimerProxy;
var _local7:MovieClip;
var _local8:SharedLevelsProxy;
_local2 = new SharedObjectProxy(Global._game_stored_data);
facade.registerProxy(_local2);
_local3 = new MusicProxy();
facade.registerProxy(_local3);
_local4 = new SoundProxy();
facade.registerProxy(_local4);
_local5 = new PagesProxy();
facade.registerProxy(_local5);
_local6 = new TimerProxy();
facade.registerProxy(_local6);
_local7 = (_arg1.getBody() as MovieClip);
facade.registerMediator(new PagesMediator(_local7));
facade.registerMediator(new SoundMediator(null));
trace(("Global._language=" + Global._language));
if (Global._language != null){
trace(("Language_Settings.getInstance().setCurrentLang(Global._language)=" + Language_Settings.getInstance().setCurrentLang(Global._language)));
if (Language_Settings.getInstance().setCurrentLang(Global._language)){
trace("YES!");
_local8 = (facade.retrieveProxy(SharedLevelsProxy.NAME) as SharedLevelsProxy);
if (_local8 != null){
if (_local8.runAfterLoadLevel()){
trace("got level!");
return;
};
};
_local5.startup(PagesProxy.PAGE_INTRO);
};
return;
};
trace("NO!");
_local5.startup(PagesProxy.PAGE_LANGS);
}
}
}//package main.controller
Section 223
//MapProxy (main.model.MapProxy)
package main.model {
import game.model.*;
import org.puremvc.as3.interfaces.*;
import org.puremvc.as3.patterns.proxy.*;
public class MapProxy extends Proxy implements IProxy {
private var m_pLevels:LevelsProxy;
private var m_pContext:IProxy;
public static const NAME:String = "MapProxy";
public function MapProxy(_arg1:LevelsProxy, _arg2:IProxy){
m_pLevels = _arg1;
m_pContext = _arg2;
super(NAME, m_pLevels);
}
public function get context():IProxy{
return (m_pContext);
}
public function get levelsProxy():LevelsProxy{
return (m_pLevels);
}
}
}//package main.model
Section 224
//MenuProxy (main.model.MenuProxy)
package main.model {
import org.puremvc.as3.interfaces.*;
import org.puremvc.as3.patterns.proxy.*;
public class MenuProxy extends Proxy implements IProxy {
public static const NAME:String = "MenuProxy";
public function MenuProxy(){
super(NAME, null);
}
}
}//package main.model
Section 225
//MusicProxy (main.model.MusicProxy)
package main.model {
import org.puremvc.as3.interfaces.*;
import classes.*;
import org.puremvc.as3.patterns.proxy.*;
public class MusicProxy extends Proxy implements IProxy {
private var m_bMute:Boolean;
private var m_nVolume:Number;
private var m_nMode:int;// = -1
public static const MUSIC_MODE_GAME:int = 1;
public static const MUSIC_MODE_INTERFACE:int = 0;
public static const MUSIC_MODE_UNDEF:int = -1;
public static const NAME:String = "MusicProxy";
public static const MUSIC_MODE_PAUSE:int = 2;
public function MusicProxy(){
m_nMode = MUSIC_MODE_UNDEF;
super(NAME, Global.music_game);
m_nVolume = Global.musicValue;
m_bMute = Global.musicMute;
updateToModel();
}
public function set mode(_arg1:int):void{
if (m_nMode != _arg1){
m_nMode = _arg1;
updateToModel();
};
}
public function set volume(_arg1:Number):void{
m_nVolume = _arg1;
Global.musicValue = _arg1;
updateToModel();
}
private function updateToModel():void{
switch (m_nMode){
case MUSIC_MODE_GAME:
Global.music_game.setMusicVolume(m_nVolume);
Global.music_game.mute = m_bMute;
break;
case MUSIC_MODE_INTERFACE:
Global.music_game.stopMusics();
break;
case MUSIC_MODE_PAUSE:
Global.music_game.setMusicVolume(0);
break;
};
}
public function get mute():Boolean{
return (m_bMute);
}
public function set mute(_arg1:Boolean):void{
m_bMute = _arg1;
Global.musicMute = _arg1;
updateToModel();
}
public function get volume():Number{
return (m_nVolume);
}
}
}//package main.model
Section 226
//PagesProxy (main.model.PagesProxy)
package main.model {
import org.puremvc.as3.interfaces.*;
import com.*;
import main.*;
import main.controller.*;
import org.puremvc.as3.patterns.proxy.*;
public class PagesProxy extends Proxy implements IProxy {
public var m_iPage:int;// = -1
public static const NAME:String = "PagesProxy";
public static const PAGE_MAP:int = (CommonFunc.INT_UNDEF + 5);
public static const PAGE_MENU:int = (CommonFunc.INT_UNDEF + 3);
public static const PAGE_SHARED_LEVELS:int = (CommonFunc.INT_UNDEF + 10);
public static const PAGE_INSTR:int = (CommonFunc.INT_UNDEF + 4);
public static const PAGE_EDITOR:int = (CommonFunc.INT_UNDEF + 9);
public static const PAGE_INTRO:int = (CommonFunc.INT_UNDEF + 2);
public static const PAGE_FINAL:int = (CommonFunc.INT_UNDEF + 8);
public static const PAGE_GAME:int = (CommonFunc.INT_UNDEF + 6);
public static const STARTUP_PAGE:int = PAGE_LANGS;
public static const PAGE_LANGS:int = (CommonFunc.INT_UNDEF + 1);
public static const PAGE_GAMEOVER:int = (CommonFunc.INT_UNDEF + 7);
public static const PAGE_UNDEF:int = -1;
public function PagesProxy(){
m_iPage = CommonFunc.INT_UNDEF;
super(NAME, Number(0));
}
public function get page():int{
return (m_iPage);
}
public function set page(_arg1:int):void{
m_iPage = _arg1;
sendNotification(ApplicationFacade.CHANGE_PAGE, new PageCommandStruct(m_iPage));
}
public function startup(_arg1:int):Boolean{
page = _arg1;
return (true);
}
}
}//package main.model
Section 227
//SoundProxy (main.model.SoundProxy)
package main.model {
import org.puremvc.as3.interfaces.*;
import classes.*;
import org.puremvc.as3.patterns.proxy.*;
public class SoundProxy extends Proxy implements IProxy {
private var m_bMute:Boolean;
private var m_nVolume:Number;
private var m_nMode:int;// = -1
public static const SOUND_MODE_UNDEF:int = -1;
public static const SOUND_MODE_PAUSE:int = 2;
public static const NAME:String = "SoundProxy";
public static const SOUND_MODE_INTERFACE:int = 0;
public static const SOUND_MODE_GAME:int = 1;
public function SoundProxy(){
m_nMode = SOUND_MODE_UNDEF;
super(NAME, Global.sound_game);
m_nVolume = Global.soundValue;
m_bMute = Global.soundMute;
updateToModel();
}
public function set mode(_arg1:int):void{
if (m_nMode != _arg1){
m_nMode = _arg1;
updateToModel();
};
}
public function set volume(_arg1:Number):void{
m_nVolume = _arg1;
updateToModel();
Global.soundValue = m_nVolume;
}
private function updateToModel():void{
switch (m_nMode){
case SOUND_MODE_GAME:
Global.sound_game.setSoundVolume(m_nVolume);
Global.sound_game.mute = m_bMute;
break;
case SOUND_MODE_INTERFACE:
Global.sound_game.stopSounds();
break;
case SOUND_MODE_PAUSE:
Global.sound_game.stopSounds();
break;
};
}
public function get mute():Boolean{
return (m_bMute);
}
public function set mute(_arg1:Boolean):void{
m_bMute = _arg1;
Global.soundMute = _arg1;
updateToModel();
}
public function get volume():Number{
return (m_nVolume);
}
}
}//package main.model
Section 228
//TimerProxy (main.model.TimerProxy)
package main.model {
import flash.utils.*;
import flash.events.*;
import org.puremvc.as3.interfaces.*;
import main.*;
import org.puremvc.as3.patterns.proxy.*;
public class TimerProxy extends Proxy implements IProxy {
var m_nDelay:int;
var m_timer:Timer;
var m_nMult:Number;// = 1
public static const NAME:String = "TimerProxy";
public static const MIN_FPS:int = 25;
public static const MAX_FPS:int = 100;
public static const DEF_FPS:int = 70;
public function TimerProxy(){
var _local1:int;
m_nMult = 1;
_local1 = DEF_FPS;
super(NAME, Number(_local1));
fps = _local1;
}
public function get speedRelevant():Number{
return (((fps - MIN_FPS) / (MAX_FPS - MIN_FPS)));
}
public function set delay(_arg1:int):void{
m_nDelay = _arg1;
removeTimer();
m_timer = new Timer(_arg1);
m_timer.addEventListener(TimerEvent.TIMER, listenTimer, false, 0, true);
m_timer.start();
}
public function set speedRelevant(_arg1:Number):void{
fps = ((_arg1 * (MAX_FPS - MIN_FPS)) + MIN_FPS);
}
public function setDoubleSpeed(_arg1:Number=2):void{
trace("&");
trace("TimerProxy public function setDoubleSpeed(nMult:Number = 2):void");
m_nMult = _arg1;
m_timer.stop();
m_timer.delay = (m_nDelay / _arg1);
m_timer.start();
}
public function set fps(_arg1:Number):void{
delay = (1000 / _arg1);
}
private function removeTimer():void{
if (m_timer != null){
m_timer.removeEventListener(TimerEvent.TIMER, listenTimer, false);
m_timer = null;
};
}
public function get fps():Number{
return ((1000 / m_nDelay));
}
public function get doubleSpeed():Number{
return (m_nMult);
}
public function reduceDoubleSpeed():void{
trace("&");
trace("TimerProxy public function reduceDoubleSpeed():void");
m_nMult = 1;
m_timer.stop();
m_timer.delay = m_nDelay;
m_timer.start();
}
private function listenTimer(_arg1:TimerEvent):void{
sendNotification(ApplicationFacade.ON_TIMER);
_arg1.updateAfterEvent();
}
}
}//package main.model
Section 229
//BtnInfo (main.view.components.BtnInfo)
package main.view.components {
import flash.display.*;
public class BtnInfo {
var m_oParam:Object;
var m_iCommand:int;
var m_mcBtn:InteractiveObject;
public function BtnInfo(_arg1:InteractiveObject, _arg2:int, _arg3:Object){
m_mcBtn = _arg1;
m_iCommand = _arg2;
m_oParam = _arg3;
}
}
}//package main.view.components
Section 230
//CheckitEvent (main.view.components.CheckitEvent)
package main.view.components {
import flash.events.*;
import com.*;
public class CheckitEvent extends Event {
public var m_oParam:Object;
public static const CHECKIT_ON_UNDEF:int = -1;
public static const CHECKIT_ON_SELECT:int = (CommonFunc.INT_UNDEF + 1);
public function CheckitEvent(_arg1:String, _arg2:Object=null, _arg3:Boolean=false, _arg4:Boolean=false){
super(_arg1, _arg3, _arg4);
m_oParam = _arg2;
}
override public function toString():String{
return (formatToString("CheckitEvent", "type", "bubbles", "cancelable", "eventPhase"));
}
override public function clone():Event{
return (new CheckitEvent(type, m_oParam, bubbles, cancelable));
}
}
}//package main.view.components
Section 231
//PageEvent (main.view.components.PageEvent)
package main.view.components {
import flash.events.*;
import com.*;
public class PageEvent extends Event {
public var m_oParam:Object;
public var m_iCommandType:int;// = -1
public static const COM_TYPE_OPEN_URL:int = (CommonFunc.INT_UNDEF + 5);
public static const COM_TYPE_UNDEF:int = -1;
public static const COM_TYPE_NEXT_PAGE:int = (CommonFunc.INT_UNDEF + 3);
public static const COM_TYPE_CHANGE_LANG:int = (CommonFunc.INT_UNDEF + 2);
public static const COM_TYPE_CHANGE_PAGE:int = (CommonFunc.INT_UNDEF + 1);
public static const COM_TYPE_ANIMATION_PHASE:int = (CommonFunc.INT_UNDEF + 4);
public static const COM_TYPE_DISPATCH_EVENT:int = (CommonFunc.INT_UNDEF + 6);
public static const COM_TYPE_LAST:int = COM_TYPE_DISPATCH_EVENT;
public function PageEvent(_arg1:String, _arg2:int, _arg3:Object=null, _arg4:Boolean=false, _arg5:Boolean=false){
m_iCommandType = COM_TYPE_UNDEF;
super(_arg1, _arg4, _arg5);
m_iCommandType = _arg2;
m_oParam = _arg3;
}
override public function toString():String{
return (formatToString("PageEvent", "type", "bubbles", "cancelable", "eventPhase"));
}
override public function clone():Event{
return (new PageEvent(type, m_iCommandType, m_oParam, bubbles, cancelable));
}
}
}//package main.view.components
Section 232
//UI_CheckitSimple (main.view.components.UI_CheckitSimple)
package main.view.components {
import flash.display.*;
import flash.events.*;
public class UI_CheckitSimple extends MovieClip {
private var m_bState:Boolean;
public static const ON_SELECT:String = "onSelect";
public function UI_CheckitSimple(){
addEventListener(MouseEvent.CLICK, listenClick);
selected = false;
}
private function listenClick(_arg1:MouseEvent):void{
selected = !(selected);
dispatchEvent(new CheckitEvent(ON_SELECT, selected));
}
public function set selected(_arg1:Boolean):void{
m_bState = _arg1;
if (_arg1){
gotoAndStop("on");
} else {
gotoAndStop("off");
};
}
public function get selected():Boolean{
return (m_bState);
}
}
}//package main.view.components
Section 233
//UI_Final (main.view.components.UI_Final)
package main.view.components {
import flash.display.*;
import main.*;
import main.controller.*;
import main.model.*;
public class UI_Final extends UI_Page {
public var viewTopScoreBtn:SimpleButton;
public var score_mc:UI_SubmitScore;
public var menu_btn:SimpleButton;
public var viewTopScoreText_mc:viewTopScoreText;
public var gamezheroBtn:MovieClip;
public var menu_title_mc:menu_title;
private static const GAMEZHERO_LOGO_NAME:String = "gamezheroBtn";
public static const NAME:String = "PageFinal";
public function UI_Final(){
addBtn((getChildByName("menu_btn") as InteractiveObject), PageEvent.COM_TYPE_CHANGE_PAGE, new PageCommandStruct(PagesProxy.PAGE_MENU), (getChildByName("menu_title_mc") as MovieClip));
addBtn((getChildByName("viewTopScoreBtn") as InteractiveObject), PageEvent.COM_TYPE_OPEN_URL, Global_Settings.URL_ID_VIEW_TOP_SCORE, (getChildByName("viewTopScoreText_mc") as MovieClip));
addBtn((getChildByName(GAMEZHERO_LOGO_NAME) as InteractiveObject), PageEvent.COM_TYPE_OPEN_URL, Global_Settings.URL_ID_ZORRO_LOGO, null, true);
}
override protected function onBtnRollOver(_arg1:Object, _arg2:InteractiveObject):void{
var _local3:MovieClip;
var _local4:MovieClip;
if (((!((_arg2 == null))) && ((_arg2.name == GAMEZHERO_LOGO_NAME)))){
_local4 = (_arg2 as MovieClip);
_local3 = (_local4.getChildByName("blick") as MovieClip);
if (_local3 != null){
_local3.play();
};
_local3 = (_local4.getChildByName("blick2") as MovieClip);
if (_local3 != null){
_local3.play();
};
};
}
}
}//package main.view.components
Section 234
//UI_GameOver (main.view.components.UI_GameOver)
package main.view.components {
import flash.display.*;
import main.*;
import main.controller.*;
import main.model.*;
public class UI_GameOver extends UI_Page {
public var viewTopScoreBtn:SimpleButton;
public var gameOverText:GameOverCongratulation0015;
public var score_mc:UI_SubmitScore;
public var menu_btn:SimpleButton;
public var viewTopScoreText_mc:viewTopScoreText;
public var gamezheroBtn:MovieClip;
public var menu_title_mc:menu_title;
private static const GAMEZHERO_LOGO_NAME:String = "gamezheroBtn";
public static const NAME:String = "PageGameOver";
public function UI_GameOver(){
addBtn((getChildByName("menu_btn") as InteractiveObject), PageEvent.COM_TYPE_CHANGE_PAGE, new PageCommandStruct(PagesProxy.PAGE_MENU), (getChildByName("menu_title_mc") as MovieClip));
addBtn((getChildByName("viewTopScoreBtn") as InteractiveObject), PageEvent.COM_TYPE_OPEN_URL, Global_Settings.URL_ID_VIEW_TOP_SCORE, (getChildByName("viewTopScoreText_mc") as MovieClip));
addBtn((getChildByName(GAMEZHERO_LOGO_NAME) as InteractiveObject), PageEvent.COM_TYPE_OPEN_URL, Global_Settings.URL_ID_ZORRO_LOGO, null, true);
}
override protected function onBtnRollOver(_arg1:Object, _arg2:InteractiveObject):void{
var _local3:MovieClip;
var _local4:MovieClip;
if (((!((_arg2 == null))) && ((_arg2.name == GAMEZHERO_LOGO_NAME)))){
_local4 = (_arg2 as MovieClip);
_local3 = (_local4.getChildByName("blick") as MovieClip);
if (_local3 != null){
_local3.play();
};
_local3 = (_local4.getChildByName("blick2") as MovieClip);
if (_local3 != null){
_local3.play();
};
};
}
}
}//package main.view.components
Section 235
//UI_Gate (main.view.components.UI_Gate)
package main.view.components {
import flash.display.*;
import flash.events.*;
public class UI_Gate extends MovieClip {
private var m_bAction:Boolean;// = false
private var m_bClose:Boolean;
public static const CLOSE:String = "gateClose";
public static const OPEN:String = "gateOpen";
public static const id:String = "Gate";
public static const GNASH:String = "gnash";
public function UI_Gate(){
m_bAction = false;
super();
stop();
}
private function init(_arg1:Boolean=true):void{
if (m_bAction){
clear();
};
m_bClose = _arg1;
if (m_bClose){
gotoAndPlay("close");
} else {
gotoAndPlay("open");
};
addEventListener(Event.ENTER_FRAME, update);
m_bAction = true;
}
public function action(_arg1:Boolean=true):void{
init(_arg1);
}
private function onFinished():void{
clear();
if (m_bClose){
dispatchEvent(new Event(CLOSE));
} else {
dispatchEvent(new Event(OPEN));
};
}
private function clear():void{
removeEventListener(Event.ENTER_FRAME, update);
m_bAction = false;
}
private function update(_arg1:Event):void{
if (m_bClose){
if (currentLabel == "closed"){
onFinished();
};
if (currentLabel == GNASH){
dispatchEvent(new Event(GNASH));
};
} else {
if (currentLabel == "opened"){
onFinished();
};
};
}
}
}//package main.view.components
Section 236
//UI_Instruction (main.view.components.UI_Instruction)
package main.view.components {
import flash.display.*;
import main.controller.*;
import main.model.*;
public class UI_Instruction extends UI_Page {
public var show_this_again_checkit_mc:show_this_again;
public var menu_btn:SimpleButton;
public var play_btn:SimpleButton;
public static const NAME:String = "PageInstruction";
public function UI_Instruction(){
addBtn((getChildByName("menu_btn") as InteractiveObject), PageEvent.COM_TYPE_CHANGE_PAGE, new PageCommandStruct(PagesProxy.PAGE_MENU), (getChildByName("menu_title_mc") as MovieClip));
}
}
}//package main.view.components
Section 237
//UI_Intro (main.view.components.UI_Intro)
package main.view.components {
import flash.display.*;
import flash.events.*;
import com.*;
import main.model.*;
public class UI_Intro extends UI_Page {
public var mult_mc:MovieClip;
var m_bActionRun:Boolean;// = false
var m_bBeginRun:Boolean;// = false
public var skip_title_mc:skipBtnText;
var m_bFinished:Boolean;// = false
public var skip_btn:SimpleButton;
public static const ANIMATION_PHASE_START:int = (CommonFunc.INT_UNDEF + 1);
public static const ANIMATION_PHASE_CRY:int = (CommonFunc.INT_UNDEF + 2);
public static const ANIMATION_PHASE_UNDEF:int = -1;
private static const MAM_CRY_SCENE:String = "mam_cry_scene_mc";
public static const NAME:String = "PageIntro";
private static const MAM_CRY_SCENE_LABEL:String = "start cry";
public static const ANIMATION_PHASE_FINISHED:int = (CommonFunc.INT_UNDEF + 10);
private static const MAM:String = "mam_mc";
public function UI_Intro(){
m_bFinished = false;
m_bBeginRun = false;
m_bActionRun = false;
super();
nextPage = PagesProxy.PAGE_MENU;
addBtn((getChildByName("skip_btn") as InteractiveObject), PageEvent.COM_TYPE_NEXT_PAGE, null, (getChildByName("skip_title_mc") as MovieClip));
addEventListener(Event.ENTER_FRAME, onEnterFrame, false, 0, true);
addEventListener(Event.REMOVED, onRemove);
addEventListener(Event.REMOVED_FROM_STAGE, onRemoveFromStage);
}
override public function set active(_arg1:Boolean):void{
super.active = _arg1;
stop();
}
private function onRemove(_arg1:Event):void{
if (_arg1.target == this){
removeEventListener(Event.ENTER_FRAME, onEnterFrame, false);
removeEventListener(Event.REMOVED, onRemove);
removeEventListener(Event.REMOVED_FROM_STAGE, onRemoveFromStage);
};
}
private function onRemoveFromStage(_arg1:Event):void{
}
private function onEnterFrame(_arg1:Event):void{
var _local2:MovieClip;
var _local3:MovieClip;
var _local4:MovieClip;
_local2 = (getChildByName("mult_mc") as MovieClip);
if (_local2 != null){
if (_local2.currentLabel == "start"){
if (!m_bBeginRun){
m_bBeginRun = true;
dispatchEvent(new PageEvent(COMMAND, PageEvent.COM_TYPE_ANIMATION_PHASE, ANIMATION_PHASE_START));
};
} else {
if (_local2.currentLabel == "finish"){
if (!m_bFinished){
m_bFinished = true;
if (parent != null){
dispatchEvent(new PageEvent(COMMAND, PageEvent.COM_TYPE_ANIMATION_PHASE, ANIMATION_PHASE_FINISHED));
};
};
};
};
_local3 = (_local2.getChildByName(MAM_CRY_SCENE) as MovieClip);
if (_local3 != null){
_local4 = (_local3.getChildByName(MAM) as MovieClip);
if (_local4 != null){
if (_local4.currentLabel == MAM_CRY_SCENE_LABEL){
dispatchEvent(new PageEvent(COMMAND, PageEvent.COM_TYPE_ANIMATION_PHASE, ANIMATION_PHASE_CRY));
};
};
};
};
}
}
}//package main.view.components
Section 238
//UI_Language (main.view.components.UI_Language)
package main.view.components {
import flash.display.*;
import com.*;
import main.*;
import flash.text.*;
import main.model.*;
public class UI_Language extends UI_Page {
public var germanBth:SimpleButton;
public var brazileBth:SimpleButton;
public var frenchBth:SimpleButton;
public var txt:TextField;
public var mexicoBth:SimpleButton;
var m_arBtns:Array;
var m_arLangText:Array;
public var spanishBth:SimpleButton;
public var russianBth:SimpleButton;
public var australiaBth:SimpleButton;
public var englishBth:SimpleButton;
public var polandBth:SimpleButton;
public var ukraineBth:SimpleButton;
public var ItalicBth:SimpleButton;
public var portugeseBth:SimpleButton;
public static const NAME:String = "PageLanguage";
public function UI_Language(){
addFrameScript(0, frame1);
nextPage = PagesProxy.PAGE_INTRO;
stop();
init();
}
private function setHint(_arg1:String):void{
var _local2:TextFormat;
_local2 = txt.getTextFormat();
if (_arg1 != null){
txt.text = _arg1;
txt.setTextFormat(_local2);
};
}
override protected function onBtnRollOver(_arg1:Object, _arg2:InteractiveObject):void{
var _local3:uint;
super.onBtnRollOver(_arg1, _arg2);
_local3 = (_arg1 as uint);
if (_local3 == uint.MAX_VALUE){
return;
};
setHint(Language_Settings.getInstance().getText(_local3));
}
override public function init():void{
m_arBtns = new Array();
addBtn((getChildByName("englishBth") as InteractiveObject), PageEvent.COM_TYPE_CHANGE_LANG, TLang.COUNTRY_USA);
addBtn((getChildByName("germanBth") as InteractiveObject), PageEvent.COM_TYPE_CHANGE_LANG, TLang.COUNTRY_GERMANY);
addBtn((getChildByName("spanishBth") as InteractiveObject), PageEvent.COM_TYPE_CHANGE_LANG, TLang.COUNTRY_SPAIN);
addBtn((getChildByName("frenchBth") as InteractiveObject), PageEvent.COM_TYPE_CHANGE_LANG, TLang.COUNTRY_FRENCH);
addBtn((getChildByName("ItalicBth") as InteractiveObject), PageEvent.COM_TYPE_CHANGE_LANG, TLang.COUNTRY_ITALY);
addBtn((getChildByName("portugeseBth") as InteractiveObject), PageEvent.COM_TYPE_CHANGE_LANG, TLang.COUNTRY_PORTUGAL);
addBtn((getChildByName("australiaBth") as InteractiveObject), PageEvent.COM_TYPE_CHANGE_LANG, TLang.COUNTRY_AUSTRALIA);
addBtn((getChildByName("brazileBth") as InteractiveObject), PageEvent.COM_TYPE_CHANGE_LANG, TLang.COUNTRY_BRAZIL);
addBtn((getChildByName("mexicoBth") as InteractiveObject), PageEvent.COM_TYPE_CHANGE_LANG, TLang.COUNTRY_MEXICO);
addBtn((getChildByName("polandBth") as InteractiveObject), PageEvent.COM_TYPE_CHANGE_LANG, TLang.COUNTRY_POLAND);
addBtn((getChildByName("ukraineBth") as InteractiveObject), PageEvent.COM_TYPE_CHANGE_LANG, TLang.COUNTRY_UKRAINE);
addBtn((getChildByName("russianBth") as InteractiveObject), PageEvent.COM_TYPE_CHANGE_LANG, TLang.COUNTRY_RUSSIA);
}
override protected function onBtnDown(_arg1:Object, _arg2:InteractiveObject):void{
super.onBtnDown(_arg1, _arg2);
}
function frame1(){
}
override protected function onBtnRollOut(_arg1:Object, _arg2:InteractiveObject):void{
super.onBtnRollOut(_arg1, _arg2);
setHint("Select Language");
}
}
}//package main.view.components
Section 239
//UI_LevelsSelector_Simple (main.view.components.UI_LevelsSelector_Simple)
package main.view.components {
import flash.display.*;
import com.*;
import editor.view.components.*;
public class UI_LevelsSelector_Simple extends MovieClip {
private var m_nWidth:int;
private var m_arItems:Array;
private var m_nHeight:int;
public static const MID_V_SPACE:int = 14;
public static const TOP_SPACE:int = 22;
public static const LEFT_SPACE:int = 11;
public static const MID_H_SPACE:int = 8;
public function UI_LevelsSelector_Simple(_arg1:int, _arg2:int){
m_arItems = new Array();
super();
m_nWidth = _arg1;
m_nHeight = _arg2;
}
public function removeAllItem():void{
var _local1:UI_LevelSelector;
for each (_local1 in m_arItems) {
if (_local1 != null){
removeChild(_local1);
};
};
m_arItems = new Array();
}
public function rearrangeView(_arg1:int=0, _arg2:int=-1):void{
var _local3:UI_LevelSelector;
var _local4:UI_LevelSelector;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
if (_arg2 == CommonFunc.INT_UNDEF){
_arg2 = (m_arItems.length - 1);
};
_local5 = _arg1;
_local3 = getItem((_local5 - 1));
if (_local3 != null){
_local6 = _local3.x;
_local7 = _local3.y;
_local8 = _local3.width;
} else {
_local6 = (LEFT_SPACE - MID_H_SPACE);
_local7 = TOP_SPACE;
_local8 = 0;
};
while (_local5 <= _arg2) {
_local4 = m_arItems[_local5];
if (_local4 != null){
_local6 = (_local6 + (_local8 + MID_H_SPACE));
_local8 = _local4.bgWidth;
if ((_local6 + _local8) < m_nWidth){
} else {
_local6 = LEFT_SPACE;
_local9 = _local4.bgHeight;
_local7 = (_local7 + (_local9 + MID_V_SPACE));
};
_local4.x = _local6;
_local4.y = _local7;
};
_local5++;
};
}
public function insertItem(_arg1:int, _arg2:UI_LevelSelector):Boolean{
m_arItems.splice(_arg1, 0, _arg2);
addChild(_arg2);
rearrangeView(_arg1);
return (true);
}
public function getItem(_arg1:int):UI_LevelSelector{
if ((((_arg1 >= 0)) && ((_arg1 < m_arItems.length)))){
return (m_arItems[_arg1]);
};
return (null);
}
public function pushItem(_arg1:UI_LevelSelector):Boolean{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:UI_LevelSelector;
if (_arg1 != null){
_local4 = _arg1.bgWidth;
_local5 = lastItem;
if (_local5 == null){
_local2 = LEFT_SPACE;
_local3 = TOP_SPACE;
} else {
_local2 = ((_local5.x + _local5.bgWidth) + MID_H_SPACE);
if ((_local2 + _local4) > m_nWidth){
_local2 = LEFT_SPACE;
_local3 = ((_local5.y + _local5.bgHeight) + MID_V_SPACE);
} else {
_local3 = _local5.y;
};
};
addChild(_arg1);
_arg1.x = _local2;
_arg1.y = _local3;
m_arItems.push(_arg1);
return (true);
};
return (false);
}
public function removeItem(_arg1:UI_LevelSelector):Boolean{
var _local2:int;
_local2 = m_arItems.indexOf(_arg1);
if (_local2 >= 0){
m_arItems.splice(_local2, 1);
removeChild(_arg1);
rearrangeView(_local2);
return (true);
};
return (false);
}
private function get lastItem():UI_LevelSelector{
var _local1:int;
_local1 = m_arItems.length;
if (_local1 > 0){
return (m_arItems[(_local1 - 1)]);
};
return (null);
}
}
}//package main.view.components
Section 240
//UI_Map (main.view.components.UI_Map)
package main.view.components {
import flash.display.*;
import flash.events.*;
public class UI_Map extends UI_Page {
public var submitScore_text:submitScoreText;
public var playMoreGamesText_mc:playMoreGamesText;
public var menu_btn:SimpleButton;
public var levels_selector_holder_mc:MovieClip;
public var submit_score_mc:SimpleButton;
public var playMoreGamesBtn:SimpleButton;
public var menu_title_mc:menu_title;
public static const ON_PLAY_MORE_GAMES:String = "onPlayMoreGames";
public static const ON_SUBMIT_SCORE:String = "onSubmitScore";
public static const ON_EXIT_MAP:String = "onExitMap";
public static const NAME:String = "PageMap";
public function UI_Map(){
var _local1:InteractiveObject;
super();
addBtn((getChildByName("menu_btn") as InteractiveObject), PageEvent.COM_TYPE_DISPATCH_EVENT, new Event(ON_EXIT_MAP), (getChildByName("menu_title_mc") as MovieClip));
addBtn((getChildByName("playMoreGamesBtn") as InteractiveObject), PageEvent.COM_TYPE_OPEN_URL, "play_more_games", (getChildByName("playMoreGamesText_mc") as MovieClip));
_local1 = (getChildByName("submitScore_text") as InteractiveObject);
if (_local1 != null){
_local1.mouseEnabled = false;
};
}
public function set activeSubmitBtn(_arg1:Boolean):void{
var _local2:InteractiveObject;
var _local3:InteractiveObject;
_local2 = (getChildByName("submit_score_mc") as InteractiveObject);
_local3 = (getChildByName("submitScore_text") as InteractiveObject);
if (_local2 != null){
_local2.removeEventListener(MouseEvent.MOUSE_UP, listenOnSubmitScore, false);
if (_arg1){
_local2.addEventListener(MouseEvent.MOUSE_UP, listenOnSubmitScore, false, 0, true);
_local2.alpha = 1;
_local2.mouseEnabled = true;
} else {
_local2.alpha = 0.5;
_local2.mouseEnabled = false;
};
};
if (_local3 != null){
if (_arg1){
_local3.alpha = 1;
} else {
_local3.alpha = 0.5;
};
};
}
private function listenOnSubmitScore(_arg1:MouseEvent):void{
dispatchEvent(new Event(ON_SUBMIT_SCORE));
}
}
}//package main.view.components
Section 241
//UI_Menu (main.view.components.UI_Menu)
package main.view.components {
import flash.display.*;
import flash.events.*;
import com.*;
import main.*;
import main.controller.*;
import main.model.*;
public class UI_Menu extends UI_Page {
public var putThisGameText_mc:putThisGametext;
public var sharedLevelsText_mc:sharedLevelsText;
public var viewTopScoreBtn:SimpleButton;
public var howToPlayBtn:SimpleButton;
public var playMoreGamesText_mc:playMoreGamesText;
public var sendToFriendsBtn:SimpleButton;
public var playGameBtn:SimpleButton;
public var youtubeBtn:SimpleButton;
public var introBtn:SimpleButton;
public var title:GameNameText;
public var viewTopScoreText_mc:viewTopScoreText;
public var sharedLevelsBtn:SimpleButton;
public var gamezheroBtn:MovieClip;
public var editorBtn:SimpleButton;
public var playMoreGamesBtn:SimpleButton;
public var editorText_mc:editorText;
public var sendToFriendsText_mc:sendToFriendsText;
public var putGameBtn:SimpleButton;
public var introText_mc:introText;
public var playGametext_mc:playGameText;
private static const GAMEZHERO_LOGO_NAME:String = "gamezheroBtn";
public static const BTN_SEND_TO_FRIENDS:int = (CommonFunc.INT_UNDEF + 4);
public static const BTN_HOW_TO_PLAY:int = (CommonFunc.INT_UNDEF + 3);
public static const BTN_INTRO:int = (CommonFunc.INT_UNDEF + 2);
public static const NAME:String = "PageMenu";
public static const BTN_UNDEF:int = -1;
public static const BTN_PLAY_GAME:int = (CommonFunc.INT_UNDEF + 1);
public static const BTN_GAMEZ_HERO:int = (CommonFunc.INT_UNDEF + 6);
public static const BTN_PUT_GAME:int = (CommonFunc.INT_UNDEF + 7);
public static const BTN_PLAY_MORE_GAMES:int = (CommonFunc.INT_UNDEF + 5);
public function UI_Menu(){
addBtn((getChildByName("playGameBtn") as InteractiveObject), PageEvent.COM_TYPE_CHANGE_PAGE, new PageCommandStruct(PagesProxy.PAGE_MAP), (getChildByName("playGametext_mc") as MovieClip));
addBtn((getChildByName("introBtn") as InteractiveObject), PageEvent.COM_TYPE_CHANGE_PAGE, new PageCommandStruct(PagesProxy.PAGE_INTRO), (getChildByName("introText_mc") as MovieClip));
addBtn((getChildByName("editorBtn") as InteractiveObject), PageEvent.COM_TYPE_CHANGE_PAGE, new PageCommandStruct(PagesProxy.PAGE_EDITOR), (getChildByName("editorText_mc") as MovieClip));
addBtn((getChildByName("howToPlayBtn") as InteractiveObject), PageEvent.COM_TYPE_CHANGE_PAGE, new PageCommandStruct(PagesProxy.PAGE_INSTR), (getChildByName("instructionText_mc") as MovieClip));
addBtn((getChildByName("sharedLevelsBtn") as InteractiveObject), PageEvent.COM_TYPE_CHANGE_PAGE, new PageCommandStruct(PagesProxy.PAGE_SHARED_LEVELS), (getChildByName("sharedLevelsText_mc") as MovieClip));
addBtn((getChildByName("viewTopScoreBtn") as InteractiveObject), PageEvent.COM_TYPE_OPEN_URL, Global_Settings.URL_ID_VIEW_TOP_SCORE, (getChildByName("viewTopScoreText_mc") as MovieClip));
addBtn((getChildByName("sendToFriendsBtn") as InteractiveObject), PageEvent.COM_TYPE_OPEN_URL, Global_Settings.URL_ID_SEND_TO_FRIENDS, (getChildByName("sendToFriendsText_mc") as MovieClip));
addBtn((getChildByName("playMoreGamesBtn") as InteractiveObject), PageEvent.COM_TYPE_OPEN_URL, Global_Settings.URL_ID_PLAY_MORE_GAMES, (getChildByName("playMoreGamesText_mc") as MovieClip));
addBtn((getChildByName(GAMEZHERO_LOGO_NAME) as InteractiveObject), PageEvent.COM_TYPE_OPEN_URL, Global_Settings.URL_ID_ZORRO_LOGO);
addBtn((getChildByName("putGameBtn") as InteractiveObject), PageEvent.COM_TYPE_OPEN_URL, Global_Settings.URL_ID_PUT_THIS_GAME, (getChildByName("putThisGameText_mc") as MovieClip));
addBtn((getChildByName("youtubeBtn") as InteractiveObject), PageEvent.COM_TYPE_OPEN_URL, Global_Settings.URL_ID_VIDEO_HELP);
if (gamezheroBtn != null){
gamezheroBtn.buttonMode = true;
gamezheroBtn.useHandCursor = true;
};
addEventListener(Event.ADDED, listenerAdded);
}
override protected function onBtnRollOver(_arg1:Object, _arg2:InteractiveObject):void{
var _local3:MovieClip;
var _local4:MovieClip;
if (((!((_arg2 == null))) && ((_arg2.name == GAMEZHERO_LOGO_NAME)))){
_local4 = (_arg2 as MovieClip);
_local3 = (_local4.getChildByName("blick") as MovieClip);
if (_local3 != null){
_local3.play();
};
_local3 = (_local4.getChildByName("blick2") as MovieClip);
if (_local3 != null){
_local3.play();
};
};
}
private function listenerAdded(_arg1:Event):void{
stage.quality = "BEST";
removeEventListener(Event.ADDED, listenerAdded);
}
}
}//package main.view.components
Section 242
//UI_Page (main.view.components.UI_Page)
package main.view.components {
import flash.display.*;
import flash.events.*;
import classes.*;
import main.model.*;
public class UI_Page extends MovieClip {
var m_arBts:Array;
private var m_iDefPage:int;// = -1
var m_bActive:Boolean;// = true
private static const ICON_BLICK_NAME:String = "blick2";
private static const ICON_NAME:String = "blick";
public static const DEF_PAGE:int = -1;
public static const COMMAND:String = "command";
public static const NAME:String = "Page";
public function UI_Page(){
m_iDefPage = PagesProxy.PAGE_UNDEF;
m_arBts = new Array();
m_bActive = true;
super();
}
public function getName():String{
return (NAME);
}
private function listenRollOver(_arg1:MouseEvent):void{
var _local2:Object;
var _local3:MovieClip;
Global.sound_interface.playSound(null, "s_over", 0, 0);
_local2 = getParamByBtn((_arg1.currentTarget as InteractiveObject));
onBtnRollOver(_local2, (_arg1.target as InteractiveObject));
_local3 = (getChildByName(ICON_BLICK_NAME) as MovieClip);
if (_local3 != null){
_local3.gotoAndPlay(1);
};
_local3 = (getChildByName(ICON_NAME) as MovieClip);
if (_local3 != null){
_local3.gotoAndPlay(1);
};
}
protected function onBtnRollOver(_arg1:Object, _arg2:InteractiveObject):void{
}
public function init():void{
}
public function set active(_arg1:Boolean):void{
var _local2:BtnInfo;
var _local3:InteractiveObject;
m_bActive = _arg1;
for each (_local2 in m_arBts) {
if (_local2 != null){
_local3 = _local2.m_mcBtn;
if (_local3 != null){
_local3.mouseEnabled = _arg1;
};
};
};
}
public function get nextPage():int{
trace(("m_iDefPage=" + m_iDefPage));
trace(("DEF_PAGE=" + DEF_PAGE));
if (m_iDefPage == PagesProxy.PAGE_UNDEF){
return (DEF_PAGE);
};
return (m_iDefPage);
}
public function findBtnInfo(_arg1:InteractiveObject):BtnInfo{
var _local2:BtnInfo;
for each (_local2 in m_arBts) {
if (_local2.m_mcBtn == _arg1){
return (_local2);
};
};
return (null);
}
protected function onBtnDown(_arg1:Object, _arg2:InteractiveObject):void{
}
public function set nextPage(_arg1:int):void{
m_iDefPage = _arg1;
}
private function listenBtnDown(_arg1:MouseEvent):void{
var _local2:BtnInfo;
var _local3:Object;
Global.sound_interface.playSound(null, "s_click", 0, 0);
_local2 = findBtnInfo((_arg1.currentTarget as InteractiveObject));
if (_local2 == null){
return;
};
_local3 = _local2.m_oParam;
onBtnDown(_local3, _local2.m_mcBtn);
dispatchEvent(new PageEvent(COMMAND, _local2.m_iCommand, _local2.m_oParam));
}
public function addBtn(_arg1:InteractiveObject, _arg2:int, _arg3:Object=null, _arg4:InteractiveObject=null, _arg5:Boolean=false):Boolean{
var _local6:BtnInfo;
var _local7:MovieClip;
var _local8:int;
if (_arg1 == null){
return (false);
};
if (_arg5){
_local7 = (_arg1 as MovieClip);
if (_local7 != null){
_local7.buttonMode = true;
_local7.useHandCursor = true;
};
};
_arg1.addEventListener(MouseEvent.MOUSE_DOWN, listenBtnDown);
_arg1.addEventListener(MouseEvent.ROLL_OVER, listenRollOver);
_arg1.addEventListener(MouseEvent.ROLL_OUT, listenRollOut);
if (_arg4 != null){
_arg4.mouseEnabled = false;
};
for each (_local6 in m_arBts) {
if (_local6.m_mcBtn == _arg1){
_local8 = m_arBts.indexOf(_local6);
if (_local8 > 0){
m_arBts.splice(_local8);
};
};
};
m_arBts.push(new BtnInfo(_arg1, _arg2, _arg3));
return (true);
}
public function clearBtns():void{
var _local1:InteractiveObject;
var _local2:BtnInfo;
for each (_local2 in m_arBts) {
_local1 = _local2.m_mcBtn;
if (_local1 == null){
} else {
_local1.removeEventListener(MouseEvent.MOUSE_DOWN, listenBtnDown);
_local1.removeEventListener(MouseEvent.ROLL_OVER, listenRollOver);
_local1.removeEventListener(MouseEvent.ROLL_OUT, listenRollOut);
};
};
m_arBts = new Array();
}
private function listenRollOut(_arg1:MouseEvent):void{
var _local2:Object;
_local2 = getParamByBtn((_arg1.currentTarget as InteractiveObject));
onBtnRollOut(_local2, (_arg1.target as InteractiveObject));
}
protected function onBtnRollOut(_arg1:Object, _arg2:InteractiveObject):void{
}
private function getParamByBtn(_arg1:InteractiveObject):Object{
var _local2:BtnInfo;
if (_arg1 == null){
return (null);
};
_local2 = findBtnInfo(_arg1);
if (_local2 == null){
return (null);
};
return (_local2.m_oParam);
}
public function close():void{
clearBtns();
m_arBts = null;
}
}
}//package main.view.components
Section 243
//UI_Pages (main.view.components.UI_Pages)
package main.view.components {
import flash.display.*;
import flash.events.*;
import shared_levels.view.components.*;
import game.view.components.*;
public class UI_Pages extends MovieClip {
public var game_mc:UI_Game;
public var shared_levels_mc:UI_SharedLevels;
public var intro_mc:UI_Intro;
public var map_mc:UI_Map;
public var menu_mc:UI_Menu;
public var lang_mc:UI_Language;
public var gameover_mc:UI_GameOver;
public var instruction_mc:UI_Instruction;
public var final_mc:UI_Final;
public function UI_Pages(){
stop();
this.addEventListener(Event.ENTER_FRAME, iniMask);
}
public function iniMask(_arg1:Event):void{
var _local2:Sprite;
_local2 = new Sprite();
_local2.graphics.lineStyle(1, 0xFF0000, 100);
_local2.graphics.beginFill(0xFF0000, 100);
_local2.graphics.moveTo(0, 0);
_local2.graphics.lineTo(600, 0);
_local2.graphics.lineTo(600, 600);
_local2.graphics.lineTo(0, 600);
_local2.graphics.moveTo(0, 0);
_local2.visible = false;
parent.addChild(_local2);
this.mask = _local2;
this.removeEventListener(Event.ENTER_FRAME, iniMask);
}
}
}//package main.view.components
Section 244
//UI_Score (main.view.components.UI_Score)
package main.view.components {
import flash.display.*;
import flash.text.*;
public class UI_Score extends MovieClip {
public function set turnsPassForLevels(_arg1:int):void{
setText("turnsPass_levels_txt", _arg1.toString());
}
public function set turnsPassForLevel(_arg1:int):void{
setText("turnsPass_level_txt", _arg1.toString());
}
public function set scoreForLevels(_arg1:int):void{
setText("score_levels_txt", _arg1.toString());
}
public function set timePassForLevels(_arg1:int):void{
setText("timePass_levels_txt", int((_arg1 / 1000)).toString());
}
private function setText(_arg1:String, _arg2:String):Boolean{
var _local3:TextField;
_local3 = (getChildByName(_arg1) as TextField);
if (((!((_local3 == null))) && (!((_arg2 == null))))){
_local3.text = _arg2.toString();
_local3.autoSize = TextFieldAutoSize.LEFT;
return (false);
};
return (false);
}
public function set timePassForLevel(_arg1:int):void{
setText("timePass_level_txt", int((_arg1 / 1000)).toString());
}
public function set scoreForLevel(_arg1:int):void{
setText("score_level_txt", _arg1.toString());
}
}
}//package main.view.components
Section 245
//UI_Simple_Btn (main.view.components.UI_Simple_Btn)
package main.view.components {
import flash.display.*;
import flash.events.*;
public class UI_Simple_Btn extends MovieClip {
public function UI_Simple_Btn(){
stop();
buttonMode = true;
addEventListener(MouseEvent.MOUSE_OVER, listenMouseOver, false, 0, true);
addEventListener(MouseEvent.MOUSE_OUT, listenMouseOut, false, 0, true);
addEventListener(MouseEvent.MOUSE_DOWN, listenMouseDown, false, 0, true);
addEventListener(MouseEvent.MOUSE_UP, listenMouseUp, false, 0, true);
}
private function listenMouseOver(_arg1:MouseEvent):void{
gotoAndStop("over");
}
private function listenMouseOut(_arg1:MouseEvent):void{
gotoAndStop("out");
}
private function listenMouseUp(_arg1:MouseEvent):void{
if (hitTestPoint(mouseX, mouseY)){
gotoAndStop("over");
} else {
gotoAndStop("out");
};
}
public function silence():void{
}
private function listenMouseDown(_arg1:MouseEvent):void{
gotoAndStop("down");
}
}
}//package main.view.components
Section 246
//UI_SubmitScore (main.view.components.UI_SubmitScore)
package main.view.components {
import flash.display.*;
import flash.events.*;
import main.*;
import flash.text.*;
import com.gamezhero.as3.*;
public class UI_SubmitScore extends MovieClip {
public var submitTopScoreText:submitTopScoreHeaderText;
public var infoText:TextField;
public static const CONTINUE_ACTION:String = "continueAction";
public function set score(_arg1:int):void{
var _local2:Number;
var _local3:MovieClip;
var _local4:Number;
var _local5:Number;
var _local6:String;
var _local7:*;
var _local8:SubmitArea;
_local2 = _arg1;
_local3 = (this as MovieClip);
_local4 = 10;
_local5 = 10;
_local6 = Language_Settings.getInstance().getCurrentLang();
_local7 = [104, 116, 116, 112, 58, 47, 47, 102, 105, 108, 101, 115, 46, 103, 97, 109, 101, 122, 104, 101, 114, 111, 46, 99, 111, 109, 47, 111, 110, 108, 105, 110, 101, 47, 103, 104, 111, 115, 116, 99, 97, 115, 116, 108, 101, 47, 115, 99, 111, 114, 101, 47, 115, 99, 111, 114, 101, 46, 115, 119, 102];
_local8 = new SubmitArea(_local3, _local4, _local5, _local2, _local7, _local6);
_local8.addEventListener(SubmitArea.SUBMITED, submitAction);
}
public function submitAction(_arg1:Event=null):void{
dispatchEvent(new Event(CONTINUE_ACTION, true));
}
}
}//package main.view.components
Section 247
//UI_Window (main.view.components.UI_Window)
package main.view.components {
import flash.display.*;
import flash.utils.*;
import flash.events.*;
import com.*;
import fl.transitions.*;
import flash.geom.*;
public class UI_Window extends MovieClip {
private var m_bHideShowOnOpenBtn:Boolean;// = true
private var m_rectHide:Rectangle;
private var m_timer:Timer;
private var m_bHideOnClick:Boolean;// = false
private var m_bDisappearOnHide:Boolean;// = false
private var m_bShow:Boolean;// = true
private var m_tweenShowHeight:Tween;
private var m_bModal:Boolean;// = false
private var m_rectShow:Rectangle;
private var m_bHideOnMouseOut:Boolean;// = false
private var m_bShowAfter:Boolean;// = false
private var m_tweenShowTop:Tween;
private var m_tweenShowWidth:Tween;
private var m_bShowOnMouseOver:Boolean;// = false
private var m_tweenShowLeft:Tween;
private static const WAIT_FOR_HIDE:int = 250;
private static const WAIT_FOR_SHOW:int = 50;
public function UI_Window(){
var _local1:TSimpleCheckit;
m_bHideShowOnOpenBtn = true;
m_bShow = true;
m_bShowAfter = false;
m_rectShow = new Rectangle();
m_rectHide = new Rectangle();
m_bShowOnMouseOver = false;
m_bHideOnMouseOut = false;
m_bHideOnClick = false;
m_bDisappearOnHide = false;
m_bModal = false;
super();
_local1 = (getChildByName("show_btn") as TSimpleCheckit);
if (_local1 != null){
_local1.selected = true;
_local1.addEventListener(TSimpleCheckit.ON_SELECT, listenOpenBtn, false, 0, true);
};
addEventListener(Event.REMOVED, listenRemoveFromStage, false, 0, true);
}
protected function getShowRect():Rectangle{
return (m_rectShow);
}
private function listenOpenBtn(_arg1:Event):void{
if (m_bHideShowOnOpenBtn){
setShow(!(m_bShow));
};
}
public function set show(_arg1:Boolean):void{
setShow(_arg1);
}
public function setShowRect(_arg1:int, _arg2:int, _arg3:int, _arg4:int):void{
m_rectShow = new Rectangle(_arg1, _arg2, _arg3, _arg4);
}
private function removeShowTimer():void{
if (m_timer != null){
m_timer.removeEventListener(TimerEvent.TIMER, listenTimeOver, false);
m_timer = null;
};
}
private function addBlocker():void{
var _local1:Sprite;
var _local2:int;
_local1 = new Sprite();
_local1.name = "spriteBottomLayer";
_local2 = parent.getChildIndex(this);
parent.addChildAt(_local1, _local2);
_local1.graphics.lineStyle(0, 0, 0);
_local1.graphics.beginFill(0, 0);
_local1.graphics.drawRect(0, 0, stage.width, stage.height);
_local1.graphics.endFill();
_local1.addEventListener(MouseEvent.MOUSE_DOWN, listenMouse_Blocker, false, 0, true);
_local1.addEventListener(MouseEvent.MOUSE_MOVE, listenMouse_Blocker, false, 0, true);
_local1.addEventListener(MouseEvent.MOUSE_OUT, listenMouse_Blocker, false, 0, true);
_local1.addEventListener(MouseEvent.MOUSE_OVER, listenMouse_Blocker, false, 0, true);
_local1.addEventListener(MouseEvent.MOUSE_UP, listenMouse_Blocker, false, 0, true);
_local1.addEventListener(MouseEvent.MOUSE_WHEEL, listenMouse_Blocker, false, 0, true);
}
private function listenMouseOver(_arg1:MouseEvent):void{
showAfterTime(true);
}
private function showAfterTime(_arg1:Boolean):void{
m_bShowAfter = _arg1;
removeShowTimer();
m_timer = new Timer((_arg1) ? WAIT_FOR_SHOW : WAIT_FOR_HIDE, 1);
m_timer.addEventListener(TimerEvent.TIMER, listenTimeOver, false, 0, true);
m_timer.start();
}
private function listenMouseOut(_arg1:MouseEvent):void{
showAfterTime(false);
}
private function tweenShow(_arg1:Tween, _arg2:int, _arg3:int, _arg4:String):Tween{
tweenShow_remove(_arg1);
if (_arg2 != _arg3){
_arg1 = new Tween(this, _arg4, CommonFunc.cubicEaseInOut, _arg2, _arg3, 0.4, true);
if (((m_bDisappearOnHide) && (!(m_bShow)))){
_arg1.addEventListener(TweenEvent.MOTION_FINISH, listenTweenFinished, false, 0, true);
};
return (_arg1);
};
return (null);
}
private function listenTweenFinished(_arg1:TweenEvent):void{
visible = false;
}
public function set hideShowOnOpenBtn(_arg1:Boolean):void{
m_bHideShowOnOpenBtn = _arg1;
}
public function setShow(_arg1:Boolean, _arg2:Boolean=true):void{
var _local3:TSimpleCheckit;
if (m_bShow != _arg1){
m_bShow = _arg1;
_local3 = (getChildByName("show_btn") as TSimpleCheckit);
if (_local3 != null){
_local3.selected = _arg1;
};
if (_arg2){
if (_arg1){
if (m_bDisappearOnHide){
visible = true;
};
if (m_rectShow.left != CommonFunc.INT_UNDEF){
m_tweenShowLeft = tweenShow(m_tweenShowLeft, x, m_rectShow.left, "x");
};
if (m_rectShow.top != CommonFunc.INT_UNDEF){
m_tweenShowTop = tweenShow(m_tweenShowTop, y, m_rectShow.top, "y");
};
if (m_rectShow.width != CommonFunc.INT_UNDEF){
m_tweenShowWidth = tweenShow(m_tweenShowWidth, width, m_rectShow.width, "width");
};
if (m_rectShow.height != CommonFunc.INT_UNDEF){
m_tweenShowHeight = tweenShow(m_tweenShowHeight, height, m_rectShow.height, "height");
};
onShow();
} else {
if (m_rectHide.left != CommonFunc.INT_UNDEF){
m_tweenShowLeft = tweenShow(m_tweenShowLeft, x, m_rectHide.left, "x");
};
if (m_rectHide.top != CommonFunc.INT_UNDEF){
m_tweenShowTop = tweenShow(m_tweenShowTop, y, m_rectHide.top, "y");
};
if (m_rectHide.width != CommonFunc.INT_UNDEF){
m_tweenShowWidth = tweenShow(m_tweenShowWidth, width, m_rectHide.width, "width");
};
if (m_rectHide.height != CommonFunc.INT_UNDEF){
m_tweenShowHeight = tweenShow(m_tweenShowHeight, height, m_rectHide.height, "height");
};
onHide();
};
} else {
if (_arg1){
if (m_bDisappearOnHide){
visible = true;
};
if (m_rectShow.left != CommonFunc.INT_UNDEF){
x = m_rectShow.left;
};
if (m_rectShow.top != CommonFunc.INT_UNDEF){
y = m_rectShow.top;
};
if (m_rectShow.width != CommonFunc.INT_UNDEF){
width = m_rectShow.width;
};
if (m_rectShow.height != CommonFunc.INT_UNDEF){
height = m_rectShow.height;
};
} else {
if (m_bDisappearOnHide){
visible = false;
};
x = m_rectHide.left;
y = m_rectHide.top;
width = m_rectHide.width;
height = m_rectHide.height;
};
};
if (m_bModal){
if (_arg1){
addBlocker();
} else {
removeBlocker();
};
};
};
}
protected function onShow():void{
}
public function set modal(_arg1:Boolean):void{
m_bModal = _arg1;
}
private function listenRemoveFromStage(_arg1:Event):void{
removeBlocker();
}
public function set disappearOnHide(_arg1:Boolean):void{
m_bDisappearOnHide = _arg1;
}
public function set hideOnClick(_arg1:Boolean):void{
if (m_bHideOnClick != _arg1){
m_bHideOnClick = _arg1;
if (m_bHideOnClick){
addEventListener(MouseEvent.MOUSE_DOWN, listenOnClickHide, false, 0, true);
} else {
removeEventListener(MouseEvent.MOUSE_DOWN, listenOnClickHide, false);
};
};
}
private function listenOnClickHide(_arg1:MouseEvent):void{
show = false;
}
public function set hideOnMouseOut(_arg1:Boolean):void{
if (_arg1 != m_bHideOnMouseOut){
m_bHideOnMouseOut = _arg1;
if (m_bHideOnMouseOut){
addEventListener(MouseEvent.MOUSE_OUT, listenMouseOut, false, 0, true);
} else {
removeEventListener(MouseEvent.MOUSE_OUT, listenMouseOut, false);
};
};
}
public function set showOnMouseOver(_arg1:Boolean):void{
if (_arg1 != m_bShowOnMouseOver){
m_bShowOnMouseOver = _arg1;
if (m_bShowOnMouseOver){
addEventListener(MouseEvent.MOUSE_OVER, listenMouseOver, false, 0, true);
} else {
removeEventListener(MouseEvent.MOUSE_OVER, listenMouseOver, false);
};
};
}
private function listenMouse_Blocker(_arg1:MouseEvent):void{
_arg1.stopImmediatePropagation();
}
private function tweenShow_remove(_arg1:Tween):void{
if (_arg1 != null){
_arg1.removeEventListener(TweenEvent.MOTION_FINISH, listenTweenFinished, false);
_arg1.stop();
};
}
private function listenTimeOver(_arg1:TimerEvent):void{
setShow(m_bShowAfter);
removeShowTimer();
}
protected function onHide():void{
}
protected function getHideRect():Rectangle{
return (m_rectHide);
}
public function setHideRect(_arg1:int, _arg2:int, _arg3:int, _arg4:int):void{
m_rectHide = new Rectangle(_arg1, _arg2, _arg3, _arg4);
}
private function removeBlocker():void{
var _local1:Sprite;
_local1 = (parent.getChildByName("spriteBottomLayer") as Sprite);
if (_local1 != null){
_local1.removeEventListener(MouseEvent.MOUSE_DOWN, listenMouse_Blocker, false);
_local1.removeEventListener(MouseEvent.MOUSE_MOVE, listenMouse_Blocker, false);
_local1.removeEventListener(MouseEvent.MOUSE_OUT, listenMouse_Blocker, false);
_local1.removeEventListener(MouseEvent.MOUSE_OVER, listenMouse_Blocker, false);
_local1.removeEventListener(MouseEvent.MOUSE_UP, listenMouse_Blocker, false);
_local1.removeEventListener(MouseEvent.MOUSE_WHEEL, listenMouse_Blocker, false);
parent.removeChild(_local1);
};
}
public function get show():Boolean{
return (m_bShow);
}
}
}//package main.view.components
Section 248
//FinalMediator (main.view.FinalMediator)
package main.view {
import game.model.*;
import main.view.components.*;
public class FinalMediator extends PageMediator {
private var m_pPlayer:PlayerProxy;
private var m_mSubmitScore:SubmitScoreMediator;
public static const NAME:String = "FinalMediator";
public function FinalMediator(_arg1:Object){
var _local2:UI_SubmitScore;
trace("*");
trace("CONSTRUCTOR public function FinalMediator(viewComponent:Object )");
super(_arg1);
_local2 = (ui.getChildByName("score_mc") as UI_SubmitScore);
if (_local2 == null){
_local2 = new UI_SubmitScore();
ui.addChild(_local2);
};
m_mSubmitScore = new SubmitScoreMediator(_local2);
facade.registerMediator(m_mSubmitScore);
}
override public function onRemove():void{
super.onRemove();
if (m_mSubmitScore != null){
facade.removeMediator(m_mSubmitScore.getMediatorName());
};
}
public function get ui():UI_Final{
return ((viewComponent as UI_Final));
}
}
}//package main.view
Section 249
//GameOverMediator (main.view.GameOverMediator)
package main.view {
import main.view.components.*;
public class GameOverMediator extends PageMediator {
private var m_mSubmitScore:SubmitScoreMediator;
public function GameOverMediator(_arg1:Object){
var _local2:UI_SubmitScore;
trace("*");
trace("CONSTRUCTOR public function GameOverMediator(viewComponent:Object )");
super(_arg1);
_local2 = (ui.getChildByName("score_mc") as UI_SubmitScore);
if (_local2 == null){
_local2 = new UI_SubmitScore();
ui.addChild(_local2);
};
m_mSubmitScore = new SubmitScoreMediator(_local2);
facade.registerMediator(m_mSubmitScore);
}
override public function onRemove():void{
super.onRemove();
if (m_mSubmitScore != null){
facade.removeMediator(m_mSubmitScore.getMediatorName());
};
}
public function get ui():UI_GameOver{
return ((viewComponent as UI_GameOver));
}
}
}//package main.view
Section 250
//GateMediator (main.view.GateMediator)
package main.view {
import flash.events.*;
import org.puremvc.as3.interfaces.*;
import main.*;
import main.view.components.*;
import org.puremvc.as3.patterns.mediator.*;
public class GateMediator extends Mediator implements IMediator {
public static const NAME:String = "GateMediator";
public function GateMediator(_arg1:Object){
super(NAME, _arg1);
ui.addEventListener(UI_Gate.OPEN, onOpen, false, 0, true);
ui.addEventListener(UI_Gate.CLOSE, onClose, false, 0, true);
ui.addEventListener(UI_Gate.GNASH, onGnash, false, 0, true);
}
private function onOpen(_arg1:Event):void{
trace("private function onOpen(event:Event):void");
sendNotification(ApplicationFacade.GATE_OPEN);
}
private function onGnash(_arg1:Event):void{
sendNotification(ApplicationFacade.GNASH);
}
private function onClose(_arg1:Event):void{
trace("private function onClose(event:Event):void");
sendNotification(ApplicationFacade.GATE_CLOSE);
}
public function get ui():UI_Gate{
return ((viewComponent as UI_Gate));
}
public function useGate(_arg1:Boolean):void{
ui.action(_arg1);
if (_arg1){
sendNotification(ApplicationFacade.GATE_START_CLOSE);
} else {
sendNotification(ApplicationFacade.GATE_START_OPEN);
};
}
}
}//package main.view
Section 251
//IntroMediator (main.view.IntroMediator)
package main.view {
import flash.display.*;
import main.*;
import main.view.components.*;
public class IntroMediator extends PageMediator {
public static const NAME:String = "IntroMediator";
public function IntroMediator(_arg1:Object){
super(_arg1);
}
override public function onRemove():void{
var _local1:UI_Intro;
var _local2:DisplayObjectContainer;
super.onRemove();
_local1 = ui;
if (_local1 != null){
_local2 = ui.parent;
if (_local2 != null){
_local2.removeChild(_local1);
};
};
}
override protected function onCommand(_arg1:int, _arg2:Object):void{
super.onCommand(_arg1, _arg2);
switch (_arg1){
case PageEvent.COM_TYPE_ANIMATION_PHASE:
onAnimationPhase((_arg2 as int));
break;
};
}
protected function onAnimationPhase(_arg1:int):void{
switch (_arg1){
case UI_Intro.ANIMATION_PHASE_START:
break;
case UI_Intro.ANIMATION_PHASE_FINISHED:
gotonextPage();
break;
case UI_Intro.ANIMATION_PHASE_CRY:
sendNotification(ApplicationFacade.INTRO_PLAY_CRY_SCENE);
break;
};
}
public function get ui():UI_Intro{
return ((viewComponent as UI_Intro));
}
}
}//package main.view
Section 252
//LanguageMediator (main.view.LanguageMediator)
package main.view {
import shared_levels.model.*;
import main.*;
import main.view.components.*;
public class LanguageMediator extends PageMediator {
public static const NAME:String = "LanguageMediator";
public function LanguageMediator(_arg1:Object){
super(_arg1);
}
override protected function onCommand(_arg1:int, _arg2:Object):void{
super.onCommand(_arg1, _arg2);
switch (_arg1){
case PageEvent.COM_TYPE_CHANGE_LANG:
onChangeLang((_arg2 as int));
break;
};
}
protected function onChangeLang(_arg1:int):void{
var _local2:SharedLevelsProxy;
trace("X");
trace("LanguageMediator protected function onChangeLang(iLang:int):void");
sendNotification(ApplicationFacade.CHANGE_LANG, _arg1);
trace(("viewPage.nextPage = " + viewPage.nextPage));
_local2 = (facade.retrieveProxy(SharedLevelsProxy.NAME) as SharedLevelsProxy);
if (_local2 != null){
if (_local2.runAfterLoadLevel()){
return;
};
};
gotonextPage();
}
}
}//package main.view
Section 253
//LevelsSelectorSimpleMediator (main.view.LevelsSelectorSimpleMediator)
package main.view {
import game.model.*;
import org.puremvc.as3.interfaces.*;
import main.*;
import editor.view.components.*;
import editor.view.*;
import main.view.components.*;
import org.puremvc.as3.patterns.mediator.*;
public class LevelsSelectorSimpleMediator extends Mediator implements IMediator {
private var m_arLevels:Array;
private var m_pLevels:LevelsProxy;
private var m_mSelectSelectorLevel:LevelSelectorMediator;
public static const NAME:String = "LevelsSelectorSimpleMediator";
public function LevelsSelectorSimpleMediator(_arg1:Object, _arg2:LevelsProxy, _arg3:PlayerProxy){
m_arLevels = new Array();
super(NAME, _arg1);
setLevelsProxy(_arg2, _arg3);
}
private function clear():void{
var _local1:LevelSelectorMediator;
for each (_local1 in m_arLevels) {
if (_local1 != null){
_local1.clear();
facade.removeMediator(_local1.getMediatorName());
};
};
m_arLevels = new Array();
ui.removeAllItem();
}
override public function listNotificationInterests():Array{
return ([ApplicationFacade.LEVEL_SELECTED, ApplicationFacade.LEVEL_UNSELECTED, ApplicationFacade.LEVEL_ADD, ApplicationFacade.LEVEL_REMOVE, ApplicationFacade.LEVELS_LOAD]);
}
public function get ui():UI_LevelsSelector_Simple{
return ((viewComponent as UI_LevelsSelector_Simple));
}
public function set inactive(_arg1:Boolean):void{
var _local2:LevelSelectorMediator;
trace("X");
trace("LevelsSelectorSimpleMediator public function set inactive(bValue:Boolean):void");
trace(("bValue=" + _arg1));
for each (_local2 in m_arLevels) {
trace(("mItem=" + _local2));
if (_local2 != null){
_local2.inactive = _arg1;
};
};
}
private function createLevel(_arg1:LevelProxy, _arg2:String):LevelSelectorMediator{
var _local3:UI_LevelSelector;
var _local4:LevelSelectorMediator;
var _local5:int;
trace("X");
trace("LevelsSelectorSimpleMediator private function createLevel(pLevel:LevelProxy, strGrade:String):LevelSelectorMediator");
trace(("pLevel=" + _arg1));
if (_arg1 != null){
_local3 = new UI_LevelSelector();
_local4 = new LevelSelectorMediator(_local3, _arg1);
facade.registerMediator(_local4);
if (_arg2 != null){
_local4.grade = _arg2;
} else {
_local4.grade = "";
};
trace("X");
trace("LevelsSelectorSimpleMediator private function createLevel(pLevel:LevelProxy, strGrade:String):LevelSelectorMediator");
_local5 = _arg1.id;
trace(("nID=" + _local5));
_local4.itemName = _local5.toString();
_local4.active = _arg1.active;
_local4.playState = _arg1.playState;
return (_local4);
};
return (null);
}
private function onLevelSelected(_arg1:Boolean, _arg2:LevelProxy):void{
var _local3:LevelSelectorMediator;
if (_arg2 != null){
_local3 = getMediatorByProxy(_arg2);
if (_local3 != null){
if (_arg1){
select = _local3;
sendNotification(ApplicationFacade.CLICK_ON_BTN, _local3);
};
};
};
}
override public function handleNotification(_arg1:INotification):void{
switch (_arg1.getName()){
case ApplicationFacade.LEVEL_SELECTED:
onLevelSelected(true, (_arg1.getBody() as LevelProxy));
break;
case ApplicationFacade.LEVEL_UNSELECTED:
onLevelSelected(false, (_arg1.getBody() as LevelProxy));
break;
};
super.handleNotification(_arg1);
}
public function getMediatorByProxy(_arg1:LevelProxy):LevelSelectorMediator{
var _local2:LevelSelectorMediator;
for each (_local2 in m_arLevels) {
if (((!((_local2 == null))) && ((_local2.proxy == _arg1)))){
return (_local2);
};
};
return (null);
}
public function set select(_arg1:LevelSelectorMediator):void{
if (_arg1 != null){
if (m_mSelectSelectorLevel != null){
m_mSelectSelectorLevel.select = false;
};
_arg1.select = true;
m_mSelectSelectorLevel = _arg1;
};
}
public function setLevelsProxy(_arg1:LevelsProxy, _arg2:PlayerProxy):void{
var _local3:int;
var _local4:int;
var _local5:LevelProxy;
var _local6:LevelSelectorMediator;
var _local7:String;
trace("X");
trace("LevelsSelectorSimpleMediator public function set levelsProxy(pValue:LevelsProxy):void");
trace(("m_pLevels=" + m_pLevels));
trace(("pPlayer=" + _arg2));
if (m_pLevels != _arg1){
clear();
m_pLevels = _arg1;
if (m_pLevels != null){
_local3 = m_pLevels.length;
_local4 = 0;
while (_local4 < _local3) {
_local5 = m_pLevels.getItem(_local4);
if (_arg2 != null){
_local7 = _arg2.getGradeForLevel(_local4);
};
trace(("strGrade=" + _local7));
_local6 = createLevel(_local5, _local7);
if (_local6 != null){
ui.pushItem((_local6.ui as UI_LevelSelector));
m_arLevels.push(_local6);
};
_local4++;
};
};
m_mSelectSelectorLevel = getMediatorByProxy(m_pLevels.select);
if (m_mSelectSelectorLevel != null){
select = m_mSelectSelectorLevel;
};
};
}
}
}//package main.view
Section 254
//MapMediator (main.view.MapMediator)
package main.view {
import flash.display.*;
import flash.events.*;
import game.model.*;
import org.puremvc.as3.interfaces.*;
import main.*;
import editor.model.*;
import main.controller.*;
import main.view.components.*;
import main.model.*;
public class MapMediator extends PageMediator {
private var m_mLevelsSelector:LevelsSelectorSimpleMediator;
private var m_pPlayer:PlayerProxy;
private var m_pLevels:LevelsProxy;
private var m_pMap:MapProxy;
private var m_mScore:ScoreMediator;
public static const NAME:String = "MapMediator";
private static const LEVELS_HOLDER_NAME:String = "levels_selector_holder_mc";
public function MapMediator(_arg1:Object){
var _local2:UI_Score;
trace("X");
trace("CONSTRUCTOR public function MapMediator(viewComponent:Object ) ");
super(_arg1);
m_pPlayer = (facade.retrieveProxy(PlayerProxy.NAME) as PlayerProxy);
init();
_local2 = (ui.getChildByName("score_mc") as UI_Score);
if (_local2 == null){
_local2 = new UI_Score();
ui.addChild(_local2);
};
trace(("m_pPlayer=" + m_pPlayer));
m_mScore = new ScoreMediator(_local2, m_pPlayer);
ui.addEventListener(UI_Map.ON_EXIT_MAP, listenOnExitMenu, false, 0, true);
ui.activeSubmitBtn = (m_pPlayer.getScoreForLevels() > 0);
ui.addEventListener(UI_Map.ON_SUBMIT_SCORE, listenSubmitScore, false, 0, true);
}
private function listenSubmitScore(_arg1:Event):void{
sendNotification(ApplicationFacade.SUBMIT_SCORE);
}
private function listenOnExitMenu(_arg1:Event):void{
var _local2:IProxy;
var _local3:String;
_local2 = m_pMap.context;
if (_local2 != null){
_local3 = _local2.getProxyName();
if (_local3 == EditorProxy.NAME){
sendNotification(ApplicationFacade.CHANGE_PAGE, new PageCommandStruct(PagesProxy.PAGE_EDITOR, m_pLevels));
return;
};
};
sendNotification(ApplicationFacade.CHANGE_PAGE, new PageCommandStruct(PagesProxy.PAGE_MENU));
}
override public function onRemove():void{
super.onRemove();
facade.removeMediator(ScoreMediator.NAME);
if (m_mLevelsSelector != null){
facade.removeMediator(m_mLevelsSelector.getMediatorName());
};
}
function init():void{
var _local1:UI_Map;
var _local2:MovieClip;
var _local3:UI_LevelsSelector_Simple;
var _local4:MovieClip;
trace("*");
trace("MapMediator function init():void");
m_pMap = (facade.retrieveProxy(MapProxy.NAME) as MapProxy);
trace(("m_pMap=" + m_pMap));
if (m_pMap != null){
m_pLevels = m_pMap.levelsProxy;
trace(("m_pLevels=" + m_pLevels));
if (m_pLevels != null){
trace(("m_pLevels.length=" + m_pLevels.length));
_local1 = ui;
trace(("uiMap=" + _local1));
if (_local1 != null){
_local2 = (_local1.getChildByName(LEVELS_HOLDER_NAME) as MovieClip);
trace(("uiLevelsHolder=" + _local2));
if (_local2 != null){
_local4 = (_local2.getChildByName("levels_bg_mc") as MovieClip);
if (_local4 != null){
_local3 = new UI_LevelsSelector_Simple(_local4.width, _local4.height);
} else {
_local3 = new UI_LevelsSelector_Simple(_local3.width, _local3.height);
};
m_mLevelsSelector = new LevelsSelectorSimpleMediator(_local3, m_pLevels, m_pPlayer);
_local2.addChild(_local3);
trace(("uiLevelsSelector=" + _local3));
};
};
};
};
}
override public function inactivate(_arg1:Boolean=true):void{
super.inactivate(_arg1);
if (m_mLevelsSelector != null){
m_mLevelsSelector.inactive = _arg1;
};
}
override public function listNotificationInterests():Array{
var _local1:Array;
_local1 = super.listNotificationInterests();
_local1.push(ApplicationFacade.LEVEL_SELECTED);
_local1.push(ApplicationFacade.LEVEL_UNSELECTED);
return (_local1);
}
private function listenSelectLevel(_arg1:LevelProxy):void{
var _local2:int;
if (_arg1 != null){
_local2 = _arg1.playState;
if ((((_local2 == LevelProxy.PLAY_STATE_CAN_PLAY)) || ((_local2 == LevelProxy.PLAY_STATE_WIN)))){
sendNotification(ApplicationFacade.CHANGE_PAGE, new PageCommandStruct(PagesProxy.PAGE_GAME, m_pLevels, _arg1, m_pMap.context));
};
};
}
public function get ui():UI_Map{
return ((viewComponent as UI_Map));
}
override public function handleNotification(_arg1:INotification):void{
switch (_arg1.getName()){
case ApplicationFacade.LEVEL_SELECTED:
listenSelectLevel((_arg1.getBody() as LevelProxy));
break;
case ApplicationFacade.LEVEL_UNSELECTED:
break;
};
super.handleNotification(_arg1);
}
}
}//package main.view
Section 255
//MenuMediator (main.view.MenuMediator)
package main.view {
public class MenuMediator extends PageMediator {
public static const NAME:String = "MenuMediator";
public function MenuMediator(_arg1:Object){
super(_arg1);
}
override protected function onCommand(_arg1:int, _arg2:Object):void{
super.onCommand(_arg1, _arg2);
}
}
}//package main.view
Section 256
//PageMediator (main.view.PageMediator)
package main.view {
import flash.events.*;
import org.puremvc.as3.interfaces.*;
import main.*;
import main.controller.*;
import main.view.components.*;
import org.puremvc.as3.patterns.mediator.*;
import main.model.*;
public class PageMediator extends Mediator implements IMediator {
private var pagesProxy:PagesProxy;
public static const NAME:String = "PageMediator";
public function PageMediator(_arg1:Object){
super((_arg1 as UI_Page).getName(), _arg1);
pagesProxy = (facade.retrieveProxy(PagesProxy.NAME) as PagesProxy);
viewPage.addEventListener(UI_Page.COMMAND, listenCommand);
}
private function listenCommand(_arg1:Event):void{
var _local2:PageEvent;
var _local3:int;
var _local4:Object;
_local2 = (_arg1 as PageEvent);
if (_local2 != null){
_local3 = _local2.m_iCommandType;
_local4 = _local2.m_oParam;
switch (_local3){
case PageEvent.COM_TYPE_NEXT_PAGE:
gotonextPage();
break;
case PageEvent.COM_TYPE_CHANGE_PAGE:
onChangePage((_local4 as PageCommandStruct));
break;
case PageEvent.COM_TYPE_OPEN_URL:
onOpenUrl((_local4 as String));
break;
case PageEvent.COM_TYPE_DISPATCH_EVENT:
viewPage.dispatchEvent((_local4 as Event));
break;
default:
onCommand(_local3, _local4);
break;
};
};
}
protected function gotonextPage():void{
var _local1:int;
_local1 = viewPage.nextPage;
if (_local1 != PagesProxy.PAGE_UNDEF){
onChangePage(new PageCommandStruct(_local1));
};
}
public function inactivate(_arg1:Boolean=true):void{
viewPage.enabled = !(_arg1);
viewPage.active = !(_arg1);
viewPage.clearBtns();
}
override public function listNotificationInterests():Array{
return ([ApplicationFacade.CHANGE_PAGE, ApplicationFacade.GATE_CLOSE]);
}
protected function get viewPage():UI_Page{
return ((viewComponent as UI_Page));
}
protected function onChangePage(_arg1:PageCommandStruct):void{
sendNotification(ApplicationFacade.CHANGE_PAGE, _arg1);
}
protected function onOpenUrl(_arg1:String):void{
sendNotification(ApplicationFacade.OPEN_URL, _arg1);
}
protected function onCommand(_arg1:int, _arg2:Object):void{
}
override public function handleNotification(_arg1:INotification):void{
switch (_arg1.getName()){
case ApplicationFacade.CHANGE_PAGE:
break;
case ApplicationFacade.GATE_CLOSE:
break;
};
}
public function close():void{
viewPage.close();
}
}
}//package main.view
Section 257
//PagesMediator (main.view.PagesMediator)
package main.view {
import flash.display.*;
import flash.events.*;
import org.puremvc.as3.interfaces.*;
import com.*;
import main.*;
import editor.view.components.*;
import editor.view.*;
import game.view.*;
import main.controller.*;
import main.view.components.*;
import shared_levels.view.components.*;
import game.view.components.*;
import org.puremvc.as3.patterns.mediator.*;
import main.model.*;
import shared_levels.view.*;
public class PagesMediator extends Mediator implements IMediator {
private var m_iPage:int;// = -1
private var pagesProxy:PagesProxy;
private var m_mediatorCurPage:PageMediator;
private var m_iNewPage:int;// = -1
private var m_gateMediator:GateMediator;
public static const NAME:String = "PagesMediator";
public function PagesMediator(_arg1:Object){
m_iNewPage = CommonFunc.INT_UNDEF;
m_iPage = CommonFunc.INT_UNDEF;
super(NAME, _arg1);
pagesProxy = (facade.retrieveProxy(PagesProxy.NAME) as PagesProxy);
if (Global_Settings.FPS){
ui.addChild(new FPS());
};
}
private function createPage(_arg1:int):PageMediator{
var _local2:UI_Page;
var _local3:PageMediator;
switch (_arg1){
case PagesProxy.PAGE_LANGS:
_local2 = new UI_Language();
ui.addChildAt(_local2, 1);
_local3 = new LanguageMediator(_local2);
break;
case PagesProxy.PAGE_INTRO:
_local2 = new UI_Intro();
ui.addChildAt(_local2, 1);
_local3 = new IntroMediator(_local2);
break;
case PagesProxy.PAGE_MENU:
_local2 = new UI_Menu();
ui.addChildAt(_local2, 1);
_local3 = new MenuMediator(_local2);
break;
case PagesProxy.PAGE_INSTR:
_local2 = new UI_Instruction();
ui.addChildAt(_local2, 1);
break;
case PagesProxy.PAGE_MAP:
_local2 = new UI_Map();
ui.addChildAt(_local2, 1);
_local3 = new MapMediator(_local2);
break;
case PagesProxy.PAGE_SHARED_LEVELS:
_local2 = new UI_SharedLevels();
ui.addChildAt(_local2, 1);
_local3 = new SharedLevelsMediator(_local2);
break;
case PagesProxy.PAGE_GAME:
_local2 = new UI_Game();
ui.addChildAt(_local2, 1);
_local3 = new GameMediator(_local2);
break;
case PagesProxy.PAGE_GAMEOVER:
_local2 = new UI_GameOver();
ui.addChildAt(_local2, 1);
_local3 = new GameOverMediator(_local2);
break;
case PagesProxy.PAGE_FINAL:
_local2 = new UI_Final();
ui.addChildAt(_local2, 1);
_local3 = new FinalMediator(_local2);
break;
case PagesProxy.PAGE_EDITOR:
_local2 = new UI_Editor();
ui.addChildAt(_local2, 1);
_local3 = new EditorMediator(_local2);
break;
};
if (_local2 == null){
return (null);
};
if (_local3 == null){
_local3 = new PageMediator(_local2);
};
facade.registerMediator(_local3);
return (_local3);
}
private function removePage(_arg1:PageMediator):Boolean{
var _local2:MovieClip;
if (_arg1 == null){
return (false);
};
_arg1.close();
_local2 = (_arg1.getViewComponent() as MovieClip);
ui.removeChild(_local2);
facade.removeMediator(_arg1.getMediatorName());
return (true);
}
private function handleMouseUp(_arg1:MouseEvent):void{
}
override public function listNotificationInterests():Array{
return ([ApplicationFacade.CHANGE_PAGE, ApplicationFacade.GATE_OPEN, ApplicationFacade.GATE_CLOSE]);
}
protected function get ui():MovieClip{
return ((viewComponent as MovieClip));
}
private function useGate(_arg1:Boolean=true):void{
var _local2:UI_Gate;
if (m_gateMediator == null){
_local2 = new UI_Gate();
ui.addChild(_local2);
m_gateMediator = new GateMediator(_local2);
facade.registerMediator(m_gateMediator);
};
m_gateMediator.useGate(_arg1);
}
override public function handleNotification(_arg1:INotification):void{
var _local2:PageCommandStruct;
switch (_arg1.getName()){
case ApplicationFacade.CHANGE_PAGE:
_local2 = (_arg1.getBody() as PageCommandStruct);
if (_local2 != null){
m_iNewPage = _local2.m_iPage;
if (m_mediatorCurPage != null){
m_mediatorCurPage.inactivate(true);
};
useGate(true);
};
break;
case ApplicationFacade.GATE_CLOSE:
removePage(m_mediatorCurPage);
m_mediatorCurPage = createPage(m_iNewPage);
useGate(false);
break;
case ApplicationFacade.GATE_OPEN:
removeGate();
break;
};
}
private function removeGate():Boolean{
var _local1:MovieClip;
if (m_gateMediator == null){
return (false);
};
_local1 = (m_gateMediator.getViewComponent() as MovieClip);
if ((((_local1 == null)) || (!((_local1.parent == ui))))){
return (false);
};
ui.removeChild(_local1);
facade.removeMediator(m_gateMediator.getMediatorName());
_local1 = null;
m_gateMediator = null;
return (true);
}
private function handleMouseWheel(_arg1:MouseEvent):void{
}
}
}//package main.view
Section 258
//ScoreMediator (main.view.ScoreMediator)
package main.view {
import game.model.*;
import org.puremvc.as3.interfaces.*;
import main.view.components.*;
import org.puremvc.as3.patterns.mediator.*;
public class ScoreMediator extends Mediator implements IMediator {
private var m_pPlayer:PlayerProxy;
public static const NAME:String = "ScoreMediator";
public function ScoreMediator(_arg1:Object, _arg2:PlayerProxy){
trace("CONSTRUCT public function ScoreMediator(viewComponent:Object, pPlayer:PlayerProxy) ");
trace(("pPlayer=" + _arg2));
super(NAME, _arg1);
m_pPlayer = _arg2;
if (m_pPlayer != null){
ui.visible = true;
trace(("m_pPlayer.getScoreForLevel()=" + m_pPlayer.getScoreForLevel()));
scoreForLevel = m_pPlayer.getScoreForLevel();
trace(("m_pPlayer.getScoreForLevels()=" + m_pPlayer.getScoreForLevels()));
scoreForLevels = m_pPlayer.getScoreForLevels();
trace(("m_pPlayer.getTimePassForLevel()=" + m_pPlayer.getTimePassForLevel()));
timePassForLevel = m_pPlayer.getTimePassForLevel();
trace(("m_pPlayer.getTimePassForLevels()=" + m_pPlayer.getTimePassForLevels()));
timePassForLevels = m_pPlayer.getTimePassForLevels();
trace(("m_pPlayer.getTurnsPassForLevel()=" + m_pPlayer.getTurnsPassForLevel()));
turnsPassForLevel = m_pPlayer.getTurnsPassForLevel();
trace(("m_pPlayer.getTurnsPassForLevels()=" + m_pPlayer.getTurnsPassForLevels()));
turnsPassForLevels = m_pPlayer.getTurnsPassForLevels();
} else {
ui.visible = false;
};
}
public function set turnsPassForLevel(_arg1:int):void{
ui.turnsPassForLevel = _arg1;
}
public function set scoreForLevels(_arg1:int):void{
ui.scoreForLevels = _arg1;
}
public function set scoreForLevel(_arg1:int):void{
ui.scoreForLevel = _arg1;
}
public function get ui():UI_Score{
return ((viewComponent as UI_Score));
}
public function set turnsPassForLevels(_arg1:int):void{
ui.turnsPassForLevels = _arg1;
}
public function set timePassForLevel(_arg1:int):void{
ui.timePassForLevel = _arg1;
}
public function set timePassForLevels(_arg1:int):void{
ui.timePassForLevels = _arg1;
}
}
}//package main.view
Section 259
//SoundMediator (main.view.SoundMediator)
package main.view {
import flash.display.*;
import org.puremvc.as3.interfaces.*;
import com.*;
import game.model.Elements.*;
import main.*;
import game.view.*;
import game.model.Elements.Character.*;
import main.controller.*;
import classes.*;
import game.controller.*;
import org.puremvc.as3.patterns.mediator.*;
import main.model.*;
public class SoundMediator extends Mediator implements IMediator {
private var m_pSound:SoundProxy;
private var m_pMusic:MusicProxy;
public static const OPEN_GATE:int = (CommonFunc.INT_UNDEF + 21);
public static const HERO_CRY:int = (CommonFunc.INT_UNDEF + 12);
public static const GAME_MUSIC:int = (CommonFunc.INT_UNDEF + 18);
public static const NAME:String = "SoundMediator";
public static const BREATH_KNIGHT:int = (CommonFunc.INT_UNDEF + 10);
public static const STEP_HERO:int = (CommonFunc.INT_UNDEF + 4);
public static const BREATH_GHOST:int = (CommonFunc.INT_UNDEF + 9);
public static const HERO_PUSH_ITEM:int = (CommonFunc.INT_UNDEF + 3);
public static const TRAP_OFF:int = (CommonFunc.INT_UNDEF + 16);
public static const INTRO_MUSIC:int = (CommonFunc.INT_UNDEF + 19);
public static const RAFT_MOVE:int = (CommonFunc.INT_UNDEF + 8);
public static const HERO_STEPON_RAFT:int = (CommonFunc.INT_UNDEF + 13);
public static const MAM_CRY:int = (CommonFunc.INT_UNDEF + 17);
public static const PLAY_CLICK:int = (CommonFunc.INT_UNDEF + 2);
public static const STEP_KNIGHT:int = (CommonFunc.INT_UNDEF + 6);
public static const STEP_MADAM:int = (CommonFunc.INT_UNDEF + 7);
public static const CLOSE_GATE:int = (CommonFunc.INT_UNDEF + 22);
public static const INTERFACE_MUSIC:int = (CommonFunc.INT_UNDEF + 20);
public static const FIGHT:int = (CommonFunc.INT_UNDEF + 14);
public static const TRAP_ON:int = (CommonFunc.INT_UNDEF + 15);
public static const STEP_GHOST:int = (CommonFunc.INT_UNDEF + 5);
public static const BREATH_MADAM:int = (CommonFunc.INT_UNDEF + 11);
public static const PLAY_OVER:int = (CommonFunc.INT_UNDEF + 1);
public function SoundMediator(_arg1:Object){
super(NAME, _arg1);
m_pSound = (facade.retrieveProxy(SoundProxy.NAME) as SoundProxy);
m_pMusic = (facade.retrieveProxy(MusicProxy.NAME) as MusicProxy);
}
private function onElementPutOnElement(_arg1:LayerElementProxy, _arg2:LayerElementProxy):void{
var _local3:int;
var _local4:int;
if (((!((_arg2 == null))) && (!((_arg1 == null))))){
if (!((_arg2.isCreateNow) || (_arg1.isCreateNow))){
_local4 = _arg2.type;
_local3 = _arg1.type;
switch (_local3){
case Sprites.SPR_ID_RAFT:
if (_local4 == Sprites.SPR_ID_CHARACTER_HERO){
playSound(HERO_STEPON_RAFT);
};
break;
};
};
};
}
private function onCloseGate():void{
playSound(CLOSE_GATE);
}
override public function listNotificationInterests():Array{
return ([ApplicationFacade.ROLL_ON_BTN, ApplicationFacade.CLICK_ON_BTN, ApplicationFacade.ELEMENT_CHANGE_STATE, ApplicationFacade.ELEMENT_FINISH_STATE, ApplicationFacade.ELEMENT_HALF_WAY_STATE, ApplicationFacade.ELEMENT_PUT_ON_ELEMENT, ApplicationFacade.CHARACTER_STEP, ApplicationFacade.CHANGE_PAGE, ApplicationFacade.GNASH, ApplicationFacade.GATE_CLOSE, ApplicationFacade.GATE_START_OPEN, ApplicationFacade.INTRO_PLAY_CRY_SCENE]);
}
private function onRollOnBtn(_arg1:InteractiveObject):void{
playSound(PLAY_OVER);
}
private function onClickOnBtn(_arg1:InteractiveObject):void{
playSound(PLAY_CLICK);
}
private function onElementChangeState(_arg1:LayerElementProxy):void{
var _local2:int;
var _local3:int;
if (_arg1 != null){
_local2 = _arg1.type;
_local3 = _arg1.state;
if (!_arg1.isCreateNow){
switch (_local2){
case Sprites.SPR_ID_CHARACTER_HERO:
switch (_local3){
case LayerElementProxy.STATE_PUSH_EAST:
case LayerElementProxy.STATE_PUSH_NORTH:
case LayerElementProxy.STATE_PUSH_SOUTH:
case LayerElementProxy.STATE_PUSH_WEST:
playSound(HERO_PUSH_ITEM);
break;
case LayerElementProxy_Character.STATE_DEAD:
playSound(HERO_CRY);
break;
};
break;
case Sprites.SPR_ID_CHARACTER_GHOST:
switch (_local3){
case LayerElementProxy.STATE_MOVE_EAST:
case LayerElementProxy.STATE_MOVE_NORTH:
case LayerElementProxy.STATE_MOVE_SOUTH:
case LayerElementProxy.STATE_MOVE_WEST:
playSound(BREATH_GHOST);
break;
case LayerElementProxy_Character.STATE_FIGHT_WITH_GHOST:
case LayerElementProxy_Character.STATE_FIGHT_WITH_KNIGHT:
case LayerElementProxy_Character.STATE_FIGHT_WITH_MADAM:
playSound(FIGHT);
break;
};
break;
case Sprites.SPR_ID_CHARACTER_KNIGHT:
switch (_local3){
case LayerElementProxy.STATE_MOVE_EAST:
case LayerElementProxy.STATE_MOVE_NORTH:
case LayerElementProxy.STATE_MOVE_SOUTH:
case LayerElementProxy.STATE_MOVE_WEST:
playSound(BREATH_KNIGHT);
break;
case LayerElementProxy_Character.STATE_FIGHT_WITH_GHOST:
case LayerElementProxy_Character.STATE_FIGHT_WITH_KNIGHT:
case LayerElementProxy_Character.STATE_FIGHT_WITH_MADAM:
playSound(FIGHT);
break;
};
break;
case Sprites.SPR_ID_CHARACTER_MADAM:
switch (_local3){
case LayerElementProxy.STATE_MOVE_EAST:
case LayerElementProxy.STATE_MOVE_NORTH:
case LayerElementProxy.STATE_MOVE_SOUTH:
case LayerElementProxy.STATE_MOVE_WEST:
playSound(BREATH_MADAM);
break;
case LayerElementProxy_Character.STATE_FIGHT_WITH_GHOST:
case LayerElementProxy_Character.STATE_FIGHT_WITH_KNIGHT:
case LayerElementProxy_Character.STATE_FIGHT_WITH_MADAM:
playSound(FIGHT);
break;
};
break;
case Sprites.SPR_ID_ITEM_BOX:
case Sprites.SPR_ID_ITEM_CANDLESTICK:
case Sprites.SPR_ID_ITEM_VASE:
switch (_local3){
case LayerElementProxy.STATE_MOVE_EAST:
case LayerElementProxy.STATE_MOVE_NORTH:
case LayerElementProxy.STATE_MOVE_SOUTH:
case LayerElementProxy.STATE_MOVE_WEST:
break;
};
break;
case Sprites.SPR_ID_RAFT:
switch (_local3){
case LayerElementProxy.STATE_SWIM_EAST:
case LayerElementProxy.STATE_SWIM_NORTH:
case LayerElementProxy.STATE_SWIM_SOUTH:
case LayerElementProxy.STATE_SWIM_WEST:
playSound(RAFT_MOVE);
break;
};
break;
case Sprites.SPR_ID_TRAP_SHARP_BLUE:
case Sprites.SPR_ID_TRAP_SHARP_GREEN:
case Sprites.SPR_ID_TRAP_SHARP_RED:
switch (_local3){
case LayerElementProxy_Trap.STATE_TRAP_OFF:
playSound(TRAP_OFF);
break;
case LayerElementProxy_Trap.STATE_TRAP_ON:
playSound(TRAP_ON);
break;
};
break;
};
};
};
}
private function onChangePage(_arg1:int):void{
var _local2:MusicProxy;
var _local3:SoundProxy;
_local2 = (facade.retrieveProxy(MusicProxy.NAME) as MusicProxy);
_local3 = (facade.retrieveProxy(SoundProxy.NAME) as SoundProxy);
switch (_arg1){
case PagesProxy.PAGE_GAME:
playSound(GAME_MUSIC);
if (_local2 != null){
_local2.mode = MusicProxy.MUSIC_MODE_GAME;
};
if (_local3 != null){
_local3.mode = SoundProxy.SOUND_MODE_GAME;
};
break;
case PagesProxy.PAGE_GAMEOVER:
case PagesProxy.PAGE_INSTR:
case PagesProxy.PAGE_MAP:
case PagesProxy.PAGE_MENU:
case PagesProxy.PAGE_SHARED_LEVELS:
playSound(INTERFACE_MUSIC);
if (_local2 != null){
_local2.mode = MusicProxy.MUSIC_MODE_INTERFACE;
};
if (_local3 != null){
_local3.mode = SoundProxy.SOUND_MODE_INTERFACE;
};
break;
case PagesProxy.PAGE_INTRO:
case PagesProxy.PAGE_FINAL:
playSound(INTRO_MUSIC);
if (_local2 != null){
_local2.mode = MusicProxy.MUSIC_MODE_INTERFACE;
};
if (_local3 != null){
_local3.mode = SoundProxy.SOUND_MODE_INTERFACE;
};
break;
case PagesProxy.PAGE_EDITOR:
case PagesProxy.PAGE_LANGS:
Global.music_game.stopMusics();
Global.music_interface.stopMusics();
if (_local2 != null){
_local2.mode = MusicProxy.MUSIC_MODE_INTERFACE;
};
if (_local3 != null){
_local3.mode = SoundProxy.SOUND_MODE_INTERFACE;
};
break;
};
}
private function onElementFinishState(_arg1:LayerElementProxy):void{
var _local2:int;
var _local3:int;
if (_arg1 != null){
_local2 = _arg1.type;
_local3 = _arg1.lastFinishedState;
switch (_local2){
case Sprites.SPR_ID_CHARACTER_HERO:
switch (_local3){
case LayerElementProxy.STATE_MOVE_EAST:
case LayerElementProxy.STATE_MOVE_NORTH:
case LayerElementProxy.STATE_MOVE_SOUTH:
case LayerElementProxy.STATE_MOVE_WEST:
playSound(STEP_HERO);
break;
};
break;
case Sprites.SPR_ID_CHARACTER_GHOST:
switch (_local3){
case LayerElementProxy.STATE_MOVE_EAST:
case LayerElementProxy.STATE_MOVE_NORTH:
case LayerElementProxy.STATE_MOVE_SOUTH:
case LayerElementProxy.STATE_MOVE_WEST:
playSound(STEP_GHOST);
break;
};
break;
case Sprites.SPR_ID_CHARACTER_KNIGHT:
switch (_local3){
case LayerElementProxy.STATE_MOVE_EAST:
case LayerElementProxy.STATE_MOVE_NORTH:
case LayerElementProxy.STATE_MOVE_SOUTH:
case LayerElementProxy.STATE_MOVE_WEST:
playSound(STEP_KNIGHT);
break;
};
break;
case Sprites.SPR_ID_CHARACTER_MADAM:
switch (_local3){
case LayerElementProxy.STATE_MOVE_EAST:
case LayerElementProxy.STATE_MOVE_NORTH:
case LayerElementProxy.STATE_MOVE_SOUTH:
case LayerElementProxy.STATE_MOVE_WEST:
playSound(STEP_MADAM);
break;
};
break;
};
};
}
private function onOpenGame():void{
playSound(OPEN_GATE);
}
private function onElementHalfWayState(_arg1:LayerElementProxy):void{
var _local2:int;
var _local3:int;
if (_arg1 != null){
_local2 = _arg1.type;
_local3 = _arg1.state;
switch (_local2){
case Sprites.SPR_ID_CHARACTER_HERO:
switch (_local3){
case LayerElementProxy.STATE_MOVE_EAST:
case LayerElementProxy.STATE_MOVE_NORTH:
case LayerElementProxy.STATE_MOVE_SOUTH:
case LayerElementProxy.STATE_MOVE_WEST:
playSound(STEP_HERO);
break;
};
break;
case Sprites.SPR_ID_CHARACTER_GHOST:
switch (_local3){
case LayerElementProxy.STATE_MOVE_EAST:
case LayerElementProxy.STATE_MOVE_NORTH:
case LayerElementProxy.STATE_MOVE_SOUTH:
case LayerElementProxy.STATE_MOVE_WEST:
playSound(STEP_GHOST);
break;
};
break;
case Sprites.SPR_ID_CHARACTER_KNIGHT:
switch (_local3){
case LayerElementProxy.STATE_MOVE_EAST:
case LayerElementProxy.STATE_MOVE_NORTH:
case LayerElementProxy.STATE_MOVE_SOUTH:
case LayerElementProxy.STATE_MOVE_WEST:
playSound(STEP_KNIGHT);
break;
};
break;
case Sprites.SPR_ID_CHARACTER_MADAM:
switch (_local3){
case LayerElementProxy.STATE_MOVE_EAST:
case LayerElementProxy.STATE_MOVE_NORTH:
case LayerElementProxy.STATE_MOVE_SOUTH:
case LayerElementProxy.STATE_MOVE_WEST:
playSound(STEP_MADAM);
break;
};
break;
};
};
}
override public function handleNotification(_arg1:INotification):void{
var _local2:ElementPutOnElementStruct;
var _local3:PageCommandStruct;
switch (_arg1.getName()){
case ApplicationFacade.ROLL_ON_BTN:
onRollOnBtn((_arg1.getBody() as InteractiveObject));
break;
case ApplicationFacade.CLICK_ON_BTN:
onClickOnBtn((_arg1.getBody() as InteractiveObject));
break;
case ApplicationFacade.ELEMENT_CHANGE_STATE:
onElementChangeState((_arg1.getBody() as LayerElementProxy));
break;
case ApplicationFacade.ELEMENT_FINISH_STATE:
onElementFinishState((_arg1.getBody() as LayerElementProxy));
break;
case ApplicationFacade.ELEMENT_HALF_WAY_STATE:
onElementHalfWayState((_arg1.getBody() as LayerElementProxy));
break;
case ApplicationFacade.ELEMENT_PUT_ON_ELEMENT:
_local2 = (_arg1.getBody() as ElementPutOnElementStruct);
if (_local2 != null){
onElementPutOnElement(_local2.m_pElementUnder, _local2.m_pElementPut);
};
break;
case ApplicationFacade.CHARACTER_STEP:
onCharacterStep((_arg1.getBody() as LayerElementProxy_Character));
break;
case ApplicationFacade.CHANGE_PAGE:
_local3 = (_arg1.getBody() as PageCommandStruct);
if (_local3 != null){
onChangePage(_local3.m_iPage);
};
break;
case ApplicationFacade.GNASH:
onCloseGate();
break;
case ApplicationFacade.GATE_START_OPEN:
onOpenGame();
break;
case ApplicationFacade.INTRO_PLAY_CRY_SCENE:
playSound(MAM_CRY);
break;
};
}
private function onCharacterStep(_arg1:LayerElementProxy_Character):void{
var _local2:int;
if (_arg1 != null){
_local2 = _arg1.type;
switch (_local2){
case Sprites.SPR_ID_CHARACTER_GHOST:
playSound(STEP_GHOST);
break;
case Sprites.SPR_ID_CHARACTER_HERO:
playSound(STEP_HERO);
break;
case Sprites.SPR_ID_CHARACTER_KNIGHT:
playSound(STEP_KNIGHT);
break;
case Sprites.SPR_ID_CHARACTER_MADAM:
playSound(STEP_MADAM);
break;
};
};
}
public function playSound(_arg1:int):void{
switch (_arg1){
case PLAY_OVER:
Global.sound_interface.playSound(null, "s_over", 0, 0);
break;
case PLAY_CLICK:
Global.sound_interface.playSound(null, "s_click", 0, 0);
break;
case HERO_PUSH_ITEM:
Global.sound_game.playSound(null, "sound_girl_push_items", 0, 0);
break;
case STEP_HERO:
Global.sound_game.playSound(null, "sound_girl_step", 0, 0);
break;
case STEP_GHOST:
Global.sound_game.playSound(null, "sound_ghost_step", 0, 0);
break;
case STEP_KNIGHT:
Global.sound_game.playSound(null, "sound_knight_step", 0, 0);
break;
case STEP_MADAM:
Global.sound_game.playSound(null, "sound_madam_step", 0, 0);
break;
case RAFT_MOVE:
Global.sound_game.playSound(null, "sound_raft_move", 0, 0);
break;
case BREATH_GHOST:
Global.sound_game.playSound(null, "sound_ghost_breath", 0, 0);
break;
case BREATH_KNIGHT:
Global.sound_game.playSound(null, "sound_knight_breath", 0, 0);
break;
case BREATH_MADAM:
Global.sound_game.playSound(null, "sound_madam_breath", 0, 0);
break;
case HERO_CRY:
Global.sound_game.playSound(null, "sound_girl_cry", 0, 0);
break;
case HERO_STEPON_RAFT:
Global.sound_game.playSound(null, "sound_girl_in_raft", 0, 0);
break;
case FIGHT:
Global.sound_game.playSound(FIGHT, "sound_fight", 0, 0);
break;
case TRAP_ON:
Global.sound_game.playSound(TRAP_ON, "sound_pin_open", 0, 0);
break;
case TRAP_OFF:
Global.sound_game.playSound(TRAP_OFF, "sound_pin_close", 0, 0);
break;
case MAM_CRY:
Global.sound_interface.playSound(MAM_CRY, "sound_mama_cry_intro", 0, 0);
break;
case OPEN_GATE:
Global.sound_interface.playSound(OPEN_GATE, "gate_open", 0, 0);
break;
case CLOSE_GATE:
Global.sound_interface.playSound(CLOSE_GATE, "gate_close", 0, 0);
break;
case GAME_MUSIC:
Global.music_interface.stopMusics();
Global.music_game.playMusic(GAME_MUSIC.toString(), "music_game", Math.random());
break;
case INTRO_MUSIC:
Global.music_game.stopMusics();
Global.music_interface.playMusic(INTRO_MUSIC.toString(), "music_intro");
break;
case INTERFACE_MUSIC:
Global.music_game.stopMusics();
Global.music_interface.playMusic(INTERFACE_MUSIC.toString(), "music_menu");
break;
};
}
}
}//package main.view
Section 260
//SubmitScoreMediator (main.view.SubmitScoreMediator)
package main.view {
import flash.events.*;
import org.puremvc.as3.interfaces.*;
import main.*;
import main.controller.*;
import main.view.components.*;
import classes.*;
import org.puremvc.as3.patterns.mediator.*;
import main.model.*;
public class SubmitScoreMediator extends Mediator implements IMediator {
public static const NAME:String = "SubmitScoreMediatorextends";
public function SubmitScoreMediator(_arg1:Object){
super(NAME, _arg1);
ui.addEventListener(UI_SubmitScore.CONTINUE_ACTION, listenOnSubmit, false, 0, true);
ui.score = Global.getSckore();
}
public function get ui():UI_SubmitScore{
return ((viewComponent as UI_SubmitScore));
}
private function listenOnSubmit(_arg1:Event):void{
sendNotification(ApplicationFacade.CHANGE_PAGE, new PageCommandStruct(PagesProxy.PAGE_MENU));
}
}
}//package main.view
Section 261
//ApplicationFacade (main.ApplicationFacade)
package main {
import org.puremvc.as3.interfaces.*;
import main.controller.*;
import game.controller.*;
import editor.controller.*;
import org.puremvc.as3.patterns.facade.*;
import shared_levels.controller.*;
public class ApplicationFacade extends Facade implements IFacade {
public static const LEVEL_USE_TEMPLATE_FILL_FLOOR_GROUND:String = "levelUseTemplateFullFloorGround";
public static const SL_RECEIVE_ERROR:String = "slReceiveError";
public static const GNASH:String = "gnash";
public static const HERO_FINISH_ALL_LEVELS:String = "heroFinishAllLevels";
public static const ON_ONE_MOVE_DONE:String = "onOneMoveDone";
public static const GATE_START_OPEN:String = "gateStartOpen";
public static const LEVEL_USE_TEMPLATE_FILL_FLOOR_TILE_LIGHT:String = "levelUseTemplateFullFloorTileLight";
public static const GATE_START_CLOSE:String = "gateStartClose";
public static const LEVEL_SELECTING:String = "levelSelecting";
public static const SET_MUSIC_MUTE:String = "setMusicMute";
public static const HERO_START_LEVELS:String = "heroStartLevels";
public static const PLAY_SHARED_LEVEL:String = "playSharedLevel";
public static const SET_SOUND_VALUME:String = "setSoundVolume";
public static const LEVEL_SAVING:String = "levelSaving";
public static const KEY_ACTION:String = "keyAction";
public static const SL_RECEIVE_GET_LEVEL:String = "slReceiveGetLevel";
public static const CHARACTER_STEP:String = "characterStep";
public static const SL_RECEIVE_SET_LEVEL:String = "slReceiveSetLevel";
public static const ELEMENT_FINISH_STATE:String = "finishElementState";
public static const OVER_POS:String = "overPos";
public static const LEVELS_SAVE:String = "levelsSave";
public static const CANCEL_ELEMENT_STATE:String = "cancelElementState";
public static const LEVELS_LOADING:String = "levelsLoading";
public static const CHANGE_SL_SORT:String = "changeSLSort";
public static const UNDO_CHANGE_ACTIVE:String = "undoChangeActive";
public static const UNDO_MOVE:String = "undoMove";
public static const STARTUP:String = "startup";
public static const LEVEL_ASK_REMOVING:String = "levelAskRemoving";
public static const SET_MUSIC_VALUME:String = "setMusicVolume";
public static const LEVELS_ASK_LOADING:String = "levelsAskLoading";
public static const LEVEL_USE_TEMPLATE_WALL_BOX:String = "levelUseTemplateWallBox";
public static const ELEMENT_CHANGE_POS:String = "elementChangePos";
public static const LEVELS_ASK_SAVING:String = "levelsAskSaving";
public static const SELECT_POS:String = "catchPos";
public static const HERO_START_LEVEL:String = "heroStartLevel";
public static const EDITOR_SELECT_POS:String = "editorSelectPos";
public static const GAME_VIEW_HIDE:String = "gameViewHide";
public static const HERO_TRAP_ON_EXIT:String = "heroTrapOnExit";
public static const CLICK_ON_BTN:String = "clickOnBtn";
public static const ELEMENT_SELECTED:String = "elementSelected";
public static const SL_RECEIVE_GET_PAGE_LIST:String = "slReceiveGetPageList";
public static const SL_RECEIVE_SET_LEVEL_RATE:String = "slReceiveSetLevelRate";
public static const SL_POST_LEVEL:String = "slPostLevel";
public static const WIN_SHARED_LEVEL:String = "winSharedLevel";
public static const CHANGE_DOUBLE_INTERPRET:String = "changeDoubleInterpret";
public static const PLAY_EDIT_LEVELS:String = "playLevels";
public static const LEVEL_REMOVING:String = "levelRemoving";
public static const INTRO_PLAY_CRY_SCENE:String = "introPlayCryScene";
public static const ON_TIMER:String = "onTimer";
public static const SL_REQUEST_GET_PAGE_AMOUNT:String = "slRequestGetPageAmount";
public static const LEVEL_USE_TEMPLATE_FILL_FLOOR_TILE_DARK:String = "levelUseTemplateFullFloorTileDark";
public static const PLAY_EDIT_LEVEL:String = "playLevel";
public static const LEVEL_ASK_LOADING:String = "levelAskLoading";
public static const LEVEL_ADDING:String = "levelAdding";
public static const ON_ALL_MOVES_DONE:String = "onAllMovesDone";
public static const LEVEL_LOAD:String = "levelLoad";
public static const CHANGE_HISTORY:String = "changeHistory";
public static const SL_REQUEST_GET_LEVEL:String = "slRequestGetLevel";
public static const CHANGE_ACTIVE_LAYER:String = "changeActiveLayer";
public static const SL_REQUEST_SET_LEVEL:String = "slRequestSetLevel";
public static const ELEMENT_FOCUSED:String = "elementFocused";
public static const ON_ONE_MOVES_DONE:String = "onOneMovesDone";
public static const GOTO_MENU_FROM_EDIT:String = "gotoMenuFromEdit";
public static const QUIT_THE_GAME:String = "quitTheGame";
public static const LEVEL_SELECTED:String = "levelSelected";
public static const CHANGE_LANG:String = "changeLang";
public static const SL_RECEIVE_GET_PAGE_AMOUNT:String = "slReceiveGetPageAmount";
public static const LEVEL_ADD:String = "levelAdd";
public static const UPDATE_LAYER_DATA:String = "updateLevel";
public static const ELEMENT_CROSS_MARGIN:String = "elementCrossMargin";
public static const MOUSE_ACTION:String = "mouseAction";
public static const GATE_OPEN:String = "gateOpen";
public static const LEVEL_LOADING:String = "levelLoading";
public static const GAME_PAUSE:String = "gamePause";
public static const CANT_SOLVE_EDIT_LEVEL:String = "cantSolveEditLevel";
public static const CHANGE_SL_CURRENT_PAGE:String = "changeSLCurrentPage";
public static const SL_REQUEST_GET_PAGE_LIST:String = "slRequestGetPageList";
public static const GAME_HAD_QUIT:String = "gameHadQuit";
public static const ELEMENT_MOVE_TO:String = "elementMoveTo";
public static const ELEMENT_FINISH_MOVING:String = "elementFinishMoving";
public static const LEVEL_ASK_SAVING:String = "levelAskSaving";
public static const GATE_CLOSE:String = "gateClose";
public static const HIDE_INFO_HELP:String = "hideInfoHelp";
public static const ELEMENT_UNSELECTED:String = "elementUnSelected";
public static const SL_REQUEST_SET_LEVEL_RATE:String = "slRequestSetLevelRate";
public static const LEVEL_SAVE:String = "levelSave";
public static const LEVEL_USE_TEMPLATE_FILL_FLOOR_GROUND_RAND:String = "levelUseTemplateFullFloorGroundRand";
public static const SET_SOUND_MUTE:String = "setSoundMute";
public static const SHOW_INFO_HELP:String = "showInfoHelp";
public static const SUBMIT_SCORE:String = "submitScore";
public static const ELEMENT_PUT_ON_ELEMENT:String = "elementPutOnElement";
public static const CHANGE_SL_PER_PAGE_COUNT:String = "changeSLPerPageCount";
public static const TRY_AGAIN:String = "tryAgain";
public static const ELEMENT_SELECTING:String = "elementSelecting";
public static const ELEMENT_CHANGE_STATE:String = "changeElementState";
public static const ON_GAME_PAUSE:String = "gamePause";
public static const LEVELS_LOAD:String = "levelsLoad";
public static const SET_GAME_SPEED:String = "setGameSpeed";
public static const LEVEL_USE_TEMPLATE_EMPTY:String = "levelUseTemplateEmpty";
public static const CHANGE_PAGE:String = "changePage";
public static const LEVEL_REMOVE:String = "levelRemove";
public static const ELEMENT_HALF_WAY_STATE:String = "halfWayElementState";
public static const LEVELS_SAVING:String = "levelsSaving";
public static const CHANGE_GAME_STATE:String = "changeGameState";
public static const HERO_UNDER_ATTACK:String = "heroUnderAttack";
public static const OPEN_URL:String = "openUrl";
public static const ELEMENT_REMOVED:String = "elementRemoved";
public static const CHANGE_MOVEBYX:String = "changeMoveByX";
public static const CHANGE_MOVEBYY:String = "changeMoveByY";
public static const ROLL_ON_BTN:String = "rollOnBtn";
public static const LEVEL_UNSELECTED:String = "levelUnselected";
public static const SL_POST_LEVEL_RATE:String = "slPostLevelRate";
public function startup(_arg1:Object):void{
sendNotification(STARTUP, _arg1);
}
override protected function initializeController():void{
super.initializeController();
registerCommand(STARTUP, StartupCommand);
registerCommand(CHANGE_PAGE, PageCommand);
registerCommand(CHANGE_LANG, LangCommand);
registerCommand(OPEN_URL, OpenUrlCommand);
registerCommand(EDITOR_SELECT_POS, SelectPosCommand);
registerCommand(ELEMENT_SELECTING, SelectingElementCommand);
registerCommand(ELEMENT_CHANGE_POS, ElementChangePosCommand);
registerCommand(ELEMENT_CHANGE_STATE, ElementChangeStateCommand);
registerCommand(ELEMENT_REMOVED, ElementRemovedCommand);
registerCommand(ELEMENT_PUT_ON_ELEMENT, ElementPutOnElementCommand);
registerCommand(GOTO_MENU_FROM_EDIT, GotoMenuCommand);
registerCommand(LEVEL_SELECTING, SelectingLevelCommand);
registerCommand(LEVEL_ADDING, AddingBeforeLevelCommand);
registerCommand(LEVEL_REMOVING, RemovingLevelCommand);
registerCommand(LEVELS_LOADING, LoadingLevelsCommand);
registerCommand(LEVEL_LOADING, LoadingLevelCommand);
registerCommand(LEVEL_USE_TEMPLATE_EMPTY, LevelUseTemplate_Empty);
registerCommand(LEVEL_USE_TEMPLATE_WALL_BOX, LevelUseTemplate_WallBox);
registerCommand(LEVEL_USE_TEMPLATE_FILL_FLOOR_GROUND, LevelUseTemplate_FillFloor_Ground);
registerCommand(LEVEL_USE_TEMPLATE_FILL_FLOOR_GROUND_RAND, LevelUseTemplate_FillFloor_Ground_Rand);
registerCommand(LEVEL_USE_TEMPLATE_FILL_FLOOR_TILE_DARK, LevelUseTemplate_FillFloor_TileDark);
registerCommand(LEVEL_USE_TEMPLATE_FILL_FLOOR_TILE_LIGHT, LevelUseTemplate_FillFloor_TileLight);
registerCommand(PLAY_EDIT_LEVEL, PlayLevelCommand);
registerCommand(PLAY_EDIT_LEVELS, PlayLevelsCommand);
registerCommand(PLAY_SHARED_LEVEL, PlaySharedLevelCommand);
registerCommand(KEY_ACTION, KeyActionCommand);
registerCommand(MOUSE_ACTION, MouseActionCommand);
registerCommand(QUIT_THE_GAME, QuitTheGameCommand);
registerCommand(GAME_HAD_QUIT, GameHadQuitCommand);
registerCommand(GAME_VIEW_HIDE, GameViewHideCommand);
registerCommand(GAME_PAUSE, PauseGameCommand);
registerCommand(SET_SOUND_VALUME, SetSoundValueCommand);
registerCommand(SET_MUSIC_VALUME, SetMusicValueCommand);
registerCommand(SET_SOUND_MUTE, SetSoundMuteCommand);
registerCommand(SET_MUSIC_MUTE, SetMusicMuteCommand);
registerCommand(ELEMENT_HALF_WAY_STATE, HalfWayElementStateCommand);
registerCommand(ELEMENT_CROSS_MARGIN, ElementCrossMarginCommand);
registerCommand(ELEMENT_FINISH_STATE, FinishElementStateCommand);
registerCommand(ELEMENT_FINISH_MOVING, ElementFinishMovingCommand);
registerCommand(ON_ALL_MOVES_DONE, NextTurnCommand);
registerCommand(ON_ONE_MOVES_DONE, FinishMoveCommand);
registerCommand(ON_ONE_MOVE_DONE, NextMoveCommand);
registerCommand(HERO_START_LEVELS, HeroStartLevelsCommand);
registerCommand(HERO_START_LEVEL, HeroStartLevelCommand);
registerCommand(HERO_UNDER_ATTACK, HeroUnderAttackCommand);
registerCommand(HERO_TRAP_ON_EXIT, HeroTrapOnExitCommand);
registerCommand(HERO_FINISH_ALL_LEVELS, HeroFinishAllLevelsCommand);
registerCommand(UNDO_MOVE, UndoMoveCommand);
registerCommand(CANCEL_ELEMENT_STATE, CancelElementStateCommand);
registerCommand(SUBMIT_SCORE, SubmitScoreCommand);
registerCommand(TRY_AGAIN, TryAgainCommand);
registerCommand(CHANGE_GAME_STATE, ChangeGameStateCommand);
registerCommand(SET_GAME_SPEED, ChangeGameSpeedCommand);
registerCommand(CHANGE_SL_PER_PAGE_COUNT, ChangeSLPerPageCountCommand);
registerCommand(CHANGE_SL_CURRENT_PAGE, ChangeSLCurrenPageCommand);
registerCommand(CHANGE_SL_SORT, ChangeSLSortCommand);
registerCommand(SL_POST_LEVEL, SLPostLevelCommand);
registerCommand(SL_POST_LEVEL_RATE, SLPostLevelRateCommand);
registerCommand(SL_RECEIVE_GET_LEVEL, SLReceiveGetLevel);
registerCommand(SL_RECEIVE_ERROR, SLReceiveErrorCommand);
}
public static function getInstance():ApplicationFacade{
if ((instance as ApplicationFacade) == null){
instance = new (ApplicationFacade);
};
return ((instance as ApplicationFacade));
}
}
}//package main
Section 262
//Global_Settings (main.Global_Settings)
package main {
public class Global_Settings {
public static const URL_ID_VIEW_TOP_SCORE:String = "view_top_score";
public static const CELL_WIDTH:int = 50;
public static const GAME_ID:int = 507;
public static const URL_ID_SEND_TO_FRIENDS:String = "send_to_friends";
public static const URL_ID_ZORRO_LOGO_PAUSE:String = "zorro_logo_pause";
public static const nFPS:int = 40;
public static const GOD_MODE:Boolean = true;
public static const CELL_HEIGHT:int = 50;
public static const GAMEZHERO_LEVELS_LINK:String = "http://www.gamezhero.com/chat/gateway.php";
public static const BORED_TIME:Number = 5000;
public static const CELL_WIDTH_HALF:int = 25;
public static const DEBUG:Boolean = false;
public static const SWIFT_UNDO:Boolean = false;
public static const WATER_OUTSIDE_MAP:Boolean = true;
public static const EDITOR_SINGLE_LEVEL:Boolean = false;
public static const URL_ID_ZORRO_LOGO:String = "zorro_logo";
public static const FPS:Boolean = false;
public static const COMPRESS_SAVE_LOAD:Boolean = true;
public static const GAMEZHERO_POST_LEVEL_URL:String = "http://www.gamezhero.com/online-games/puzzle-games/ghostcastle-games.html?level_id=";
public static const GAME_DELAY:Number = 20;
public static const BORED_PROBABILITY:Number = 0.05;
public static const URL_ID_PLAY_MORE_GAMES:String = "play_more_games";
public static const URL_ID_PUT_THIS_GAME:String = "put_this_game";
public static const URL_ID_VIDEO_HELP:String = "videoHelp";
public static const FADE_DURATION:Number = 0.8;
public static const CELL_HEIGHT_HALF:int = 25;
public static function get stageHeight():int{
return (600);
}
public static function get stageWidth():int{
return (600);
}
}
}//package main
Section 263
//Language_Settings (main.Language_Settings)
package main {
import com.*;
public class Language_Settings extends TLang {
public static const EXIT_GAME_BTN_HINT:int = 1002;
public static const SOUND_GAME_BTN_HINT:int = 1003;
public static const GAMEZ_HERO_BTN_HINT:int = 1000;
public static const PLAY_GAME_BTN_HINT:int = 1001;
public static const MUSIC_GAME_BTN_HINT:int = 1004;
override protected function init():void{
super.init();
addTextForAllLang(GAMEZ_HERO_BTN_HINT, "Visit Gamezhero.com");
addText(US, GAMEZ_HERO_BTN_HINT, "Visit Gamezhero.com");
addText(ES, GAMEZ_HERO_BTN_HINT, "GAMEZHERO.COM");
addText(RU, GAMEZ_HERO_BTN_HINT, "Играть на Gamezhero.com");
addText(PT, GAMEZ_HERO_BTN_HINT, "GAMEZHERO.COM");
addText(FR, GAMEZ_HERO_BTN_HINT, "GAMEZHERO.COM");
addText(DE, GAMEZ_HERO_BTN_HINT, "GAMEZHERO.COM");
addText(IT, GAMEZ_HERO_BTN_HINT, "GAMEZHERO.COM");
addText(PL, GAMEZ_HERO_BTN_HINT, "GAMEZHERO.COM");
addText(UA, GAMEZ_HERO_BTN_HINT, "Грати На Gamezhero.com");
addTextForAllLang(PLAY_GAME_BTN_HINT, "Continue Game");
addText(US, PLAY_GAME_BTN_HINT, "Continue Game");
addText(ES, PLAY_GAME_BTN_HINT, "CONTINÚA EL JUEGO");
addText(RU, PLAY_GAME_BTN_HINT, "Продолжить Игру");
addText(PT, PLAY_GAME_BTN_HINT, "CONTINUAR O JOGO");
addText(FR, PLAY_GAME_BTN_HINT, "CONTINUER LE JEU");
addText(DE, PLAY_GAME_BTN_HINT, "WEITERSPIELEN");
addText(IT, PLAY_GAME_BTN_HINT, "CONTINUARE IL GIOCO");
addText(PL, PLAY_GAME_BTN_HINT, "KONTYNUOWAĆ GRĘ");
addText(UA, PLAY_GAME_BTN_HINT, "Продовжити Гру");
addTextForAllLang(EXIT_GAME_BTN_HINT, "Quit Game");
addText(US, EXIT_GAME_BTN_HINT, "Quit Game");
addText(ES, EXIT_GAME_BTN_HINT, "RETIRA DEL JUEGO");
addText(RU, EXIT_GAME_BTN_HINT, "Выйти Из Игры");
addText(PT, EXIT_GAME_BTN_HINT, "SAIR DO JOGO");
addText(FR, EXIT_GAME_BTN_HINT, "QUITTER LE JEU");
addText(DE, EXIT_GAME_BTN_HINT, "SPIEL VERLASSEN");
addText(IT, EXIT_GAME_BTN_HINT, "USCIRE DAL GIOCO");
addText(PL, EXIT_GAME_BTN_HINT, "OPUŚCIĆ GRĘ");
addText(UA, EXIT_GAME_BTN_HINT, "Покинути Гру");
addTextForAllLang(SOUND_GAME_BTN_HINT, "Sound Control");
addText(US, SOUND_GAME_BTN_HINT, "Sound Control");
addText(ES, SOUND_GAME_BTN_HINT, "AJUSTA EL SONIDO");
addText(RU, SOUND_GAME_BTN_HINT, "Управление Звуком");
addText(PT, SOUND_GAME_BTN_HINT, "CONTROLO DO SOM");
addText(FR, SOUND_GAME_BTN_HINT, "GESTION DE SON");
addText(DE, SOUND_GAME_BTN_HINT, "LAUT");
addText(IT, SOUND_GAME_BTN_HINT, "CONTROLLO DEL SUONO");
addText(PL, SOUND_GAME_BTN_HINT, "STEROWANIE DŻWIĘKIEM");
addText(UA, SOUND_GAME_BTN_HINT, "Керування Звуком");
addTextForAllLang(MUSIC_GAME_BTN_HINT, "Music Control");
addText(US, MUSIC_GAME_BTN_HINT, "Music Control");
addText(ES, MUSIC_GAME_BTN_HINT, "AJUSTA LA MÚSICA");
addText(RU, MUSIC_GAME_BTN_HINT, "Управление Музыкой");
addText(PT, MUSIC_GAME_BTN_HINT, "CONTROLO DA MÚSICA");
addText(FR, MUSIC_GAME_BTN_HINT, "GESTION DE MUSIQUE");
addText(DE, MUSIC_GAME_BTN_HINT, "MUSIK");
addText(IT, MUSIC_GAME_BTN_HINT, "CONTROLLO DELLA MUSICA");
addText(PL, MUSIC_GAME_BTN_HINT, "STEROWANIE MUZYKĄ");
addText(UA, MUSIC_GAME_BTN_HINT, "Керування Музикой");
}
public static function getInstance():Language_Settings{
if ((_instance as Language_Settings) == null){
_instance = new (Language_Settings);
};
return ((_instance as Language_Settings));
}
}
}//package main
Section 264
//MainSystem (main.MainSystem)
package main {
import flash.display.*;
import flash.utils.*;
import flash.events.*;
import shared_levels.model.*;
import main.view.components.*;
import classes.*;
import classes.media.*;
import classes.utils.*;
import com.gamezhero.as3.*;
import flash.system.*;
public class MainSystem extends MovieClip {
public var all_mc:UI_Pages;
private var m_bAllInit:Boolean;// = false
private var proLibrary:ClassLoader;
private var m_timerWaitForLevelLoading:Timer;
private var m_bMainInit:Boolean;// = false
private var m_pSharedLevels:SharedLevelsProxy;
private var pro;
private var proFlag:Boolean;// = false
public function MainSystem(){
proFlag = false;
m_bMainInit = false;
m_bAllInit = false;
super();
Security.allowDomain("gamezhero.com", "files.gamezhero.com", "eufiles.gamezhero.com", "*.gamezhero.com", "*", "*.*", "*.*.*");
stage.stageFocusRect = false;
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
this.addEventListener(Event.ENTER_FRAME, listenEnterFrame);
stop();
}
public function listenWaitForLevel(_arg1:TimerEvent):void{
nextStep();
}
private function iniMainStage():void{
var _local1:Object;
var _local2:*;
var _local3:GamePreloader;
var _local4:String;
if (m_bMainInit){
return;
};
m_bMainInit = true;
Global._language = root.loaderInfo.parameters["language"];
Global._language = "ENG";
iniSound();
_local1 = new Object();
_local2 = "ghostcastle";
_local1.game_name = _local2;
_local1.debug = Global_Settings.DEBUG;
_local1.gamezhero_url = Global._urls["preloader"];
_local1.gamezhero_menu = {Free Online Games @ Gamezhero.com:Global._urls["play_more_games_context"], Send To Friends:Global._urls["send_to_friends_context"], Put This Game To Your Blog or Site:Global._urls["put_this_game_context"]};
_local3 = new GamePreloader(this, _local1);
_local3.addEventListener(GamePreloader.finish, nextStep);
loadPro();
_local4 = root.loaderInfo.parameters["level_id"];
Global._levelID = _local4;
Global._context_url = root.loaderInfo.url;
if (_local4 != null){
ApplicationFacade.getInstance();
m_pSharedLevels = new SharedLevelsProxy();
m_pSharedLevels.requestAndRunLevel(_local4);
};
}
public function nextStep(_arg1:Event=null):void{
if (m_pSharedLevels != null){
};
if (m_timerWaitForLevelLoading != null){
m_timerWaitForLevelLoading.stop();
};
if ((((m_pSharedLevels == null)) || (!(m_pSharedLevels.progress)))){
if (pro){
pro.stopPopUp();
};
stage.align = "";
gotoAndStop("all");
} else {
m_timerWaitForLevelLoading = new Timer(1000);
m_timerWaitForLevelLoading.addEventListener(TimerEvent.TIMER, listenWaitForLevel);
m_timerWaitForLevelLoading.start();
};
}
private function loadErrorHandler(_arg1:Event):void{
}
private function iniSound():void{
Global.music_interface = new Music();
Global.music_game = new Music();
Global.sound_interface = new SoundFX();
Global.sound_game = new SoundFX();
Global.music_interface.setMusicVolume(Global._music_volume_interface);
Global.music_game.setMusicVolume(Global._music_volume_game);
Global.sound_interface.setSoundVolume(Global._sound_volume_interface);
Global.sound_game.setSoundVolume(Global._sound_volume_game);
if (isNaN(Global._game_stored_data.data.soundVolumeFlag)){
Global._game_stored_data.data.soundVolumeFlag = 1;
};
if (isNaN(Global._game_stored_data.data.musicVolumeFlag)){
Global._game_stored_data.data.musicVolumeFlag = 1;
};
}
private function initAll():void{
var _local1:MovieClip;
if (m_bAllInit){
return;
};
m_bAllInit = true;
_local1 = (getChildByName("all_mc") as MovieClip);
if (_local1 == null){
_local1 = new UI_Pages();
this.addChild(_local1);
};
if (m_pSharedLevels != null){
ApplicationFacade.getInstance().registerProxy(m_pSharedLevels);
};
ApplicationFacade.getInstance().startup(_local1);
}
public function listenEnterFrame(_arg1:Event):void{
var _local2:MovieClip;
_local2 = (_arg1.target as MovieClip);
switch (_local2.currentLabel){
case "preloader":
iniMainStage();
break;
case "all":
initAll();
_local2.removeEventListener(Event.ENTER_FRAME, listenEnterFrame);
stop();
break;
};
}
private function classLoadedHandler(_arg1:Event):void{
var foo:Number;
var proClass:Class;
var e = _arg1;
foo = Number(root.loaderInfo.parameters["gamezhero_code"]);
try {
proClass = proLibrary.getClass("superPro3");
pro = new proClass(this, 1197710244855, foo, "ghostcastle");
} catch(e:Error) {
};
}
private function loadPro():void{
if (proFlag == false){
proFlag = true;
proLibrary = new ClassLoader();
proLibrary.addEventListener(ClassLoader.LOAD_ERROR, loadErrorHandler);
proLibrary.addEventListener(ClassLoader.CLASS_LOADED, classLoadedHandler);
proLibrary.load(("http://files.gamezhero.com/flash/superPro3.swf?time" + new Date().getTime()));
};
}
}
}//package main
Section 265
//_mult_16 (MummyMaze3_fla._mult_16)
package MummyMaze3_fla {
import flash.display.*;
public dynamic class _mult_16 extends MovieClip {
public var mam_cry_scene_mc:MovieClip;
public var mult_mc:MovieClip;
public var n1:MovieClip;
public var n2:MovieClip;
public var n5:MovieClip;
public var n4:MovieClip;
public var n6:MovieClip;
public var n3:MovieClip;
public function _mult_16(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6);
}
function frame3(){
stop();
}
function frame6(){
stop();
}
function frame1(){
stop();
}
function frame4(){
stop();
}
function frame5(){
stop();
}
function frame2(){
stop();
}
}
}//package MummyMaze3_fla
Section 266
//back00005_288 (MummyMaze3_fla.back00005_288)
package MummyMaze3_fla {
import flash.display.*;
public dynamic class back00005_288 extends MovieClip {
public var flame_mc_4:MovieClip;
public var flame_mc_1:MovieClip;
public var flame_mc_3:MovieClip;
public var flame_mc_0:MovieClip;
public var flame_mc_2:MovieClip;
}
}//package MummyMaze3_fla
Section 267
//blick_211 (MummyMaze3_fla.blick_211)
package MummyMaze3_fla {
import flash.display.*;
public dynamic class blick_211 extends MovieClip {
public function blick_211(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package MummyMaze3_fla
Section 268
//blick_409 (MummyMaze3_fla.blick_409)
package MummyMaze3_fla {
import flash.display.*;
public dynamic class blick_409 extends MovieClip {
public function blick_409(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package MummyMaze3_fla
Section 269
//blick2_193 (MummyMaze3_fla.blick2_193)
package MummyMaze3_fla {
import flash.display.*;
public dynamic class blick2_193 extends MovieClip {
public function blick2_193(){
addFrameScript(0, frame1);
}
function frame1(){
}
}
}//package MummyMaze3_fla
Section 270
//blick5_190 (MummyMaze3_fla.blick5_190)
package MummyMaze3_fla {
import flash.display.*;
public dynamic class blick5_190 extends MovieClip {
public function blick5_190(){
addFrameScript(0, frame1);
}
function frame1(){
}
}
}//package MummyMaze3_fla
Section 271
//blickcopy_314 (MummyMaze3_fla.blickcopy_314)
package MummyMaze3_fla {
import flash.display.*;
public dynamic class blickcopy_314 extends MovieClip {
public function blickcopy_314(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package MummyMaze3_fla
Section 272
//final_img_417 (MummyMaze3_fla.final_img_417)
package MummyMaze3_fla {
import flash.display.*;
public dynamic class final_img_417 extends MovieClip {
public var levels_selector_mc:MovieClip;
}
}//package MummyMaze3_fla
Section 273
//gamezhero_207 (MummyMaze3_fla.gamezhero_207)
package MummyMaze3_fla {
import flash.display.*;
public dynamic class gamezhero_207 extends MovieClip {
public var blick2:MovieClip;
public var blick:MovieClip;
}
}//package MummyMaze3_fla
Section 274
//gameZheroPreloader_855 (MummyMaze3_fla.gameZheroPreloader_855)
package MummyMaze3_fla {
import flash.display.*;
public dynamic class gameZheroPreloader_855 extends MovieClip {
public var pr:MovieClip;
public function gameZheroPreloader_855(){
addFrameScript(139, frame140);
}
function frame140(){
stop();
}
}
}//package MummyMaze3_fla
Section 275
//ghost_look_south_337 (MummyMaze3_fla.ghost_look_south_337)
package MummyMaze3_fla {
import flash.display.*;
public dynamic class ghost_look_south_337 extends MovieClip {
public function ghost_look_south_337(){
addFrameScript(24, frame25);
}
function frame25(){
gotoAndPlay(1);
}
}
}//package MummyMaze3_fla
Section 276
//help1_239 (MummyMaze3_fla.help1_239)
package MummyMaze3_fla {
import flash.display.*;
public dynamic class help1_239 extends MovieClip {
public var arrow_push_south_mc:MovieClip;
public var arrow_push_east_mc:MovieClip;
public var arrow_wait_mc:MovieClip;
public var arrow_push_west_mc:MovieClip;
public var arrow_north_mc:MovieClip;
public var move_east_mc:MovieClip;
public var move_north_mc:MovieClip;
public var arrow_south_mc:MovieClip;
public var move_west_mc:MovieClip;
public var arrow_push_north_mc:MovieClip;
public var arrow_east_mc:MovieClip;
public var move_south_mc:MovieClip;
public var arrow_west_mc:MovieClip;
}
}//package MummyMaze3_fla
Section 277
//help2_273 (MummyMaze3_fla.help2_273)
package MummyMaze3_fla {
import flash.display.*;
public dynamic class help2_273 extends MovieClip {
public var push_west_mc:MovieClip;
public var push_east_mc:MovieClip;
public var push_north_mc:MovieClip;
public var push_south_mc:MovieClip;
}
}//package MummyMaze3_fla
Section 278
//help3_296 (MummyMaze3_fla.help3_296)
package MummyMaze3_fla {
import flash.display.*;
public dynamic class help3_296 extends MovieClip {
public var look_east_mc:MovieClip;
public var look_west_mc:MovieClip;
public var look_north_mc:MovieClip;
public var look_south_mc:MovieClip;
}
}//package MummyMaze3_fla
Section 279
//help4_310 (MummyMaze3_fla.help4_310)
package MummyMaze3_fla {
import flash.display.*;
import game.view.components.Buttons.*;
public dynamic class help4_310 extends MovieClip {
public var exitGameBtn:UI_SimpleBtn_Menu;
public var restart_btn:UI_SimpleBtn_Restart;
public var undo_btn:UI_SimpleBtn_Undo;
public var pause_btn:UI_SimpleBtn_Pause;
}
}//package MummyMaze3_fla
Section 280
//help5_321 (MummyMaze3_fla.help5_321)
package MummyMaze3_fla {
import flash.display.*;
public dynamic class help5_321 extends MovieClip {
public var look_south_mc:MovieClip;
}
}//package MummyMaze3_fla
Section 281
//help6_336 (MummyMaze3_fla.help6_336)
package MummyMaze3_fla {
import flash.display.*;
public dynamic class help6_336 extends MovieClip {
public var look_south_mc:MovieClip;
}
}//package MummyMaze3_fla
Section 282
//help7_346 (MummyMaze3_fla.help7_346)
package MummyMaze3_fla {
import flash.display.*;
public dynamic class help7_346 extends MovieClip {
public var look_south_mc:MovieClip;
}
}//package MummyMaze3_fla
Section 283
//help8Kyes_353 (MummyMaze3_fla.help8Kyes_353)
package MummyMaze3_fla {
import flash.display.*;
public dynamic class help8Kyes_353 extends MovieClip {
public var move_east_mc:MovieClip;
public var move_west_mc:MovieClip;
}
}//package MummyMaze3_fla
Section 284
//help9Whoiswho_375 (MummyMaze3_fla.help9Whoiswho_375)
package MummyMaze3_fla {
import flash.display.*;
public dynamic class help9Whoiswho_375 extends MovieClip {
public var look_south_mc:MovieClip;
}
}//package MummyMaze3_fla
Section 285
//hero0027_663 (MummyMaze3_fla.hero0027_663)
package MummyMaze3_fla {
import flash.display.*;
public dynamic class hero0027_663 extends MovieClip {
public function hero0027_663(){
addFrameScript(3, frame4);
}
function frame4(){
stop();
}
}
}//package MummyMaze3_fla
Section 286
//introcloser_37 (MummyMaze3_fla.introcloser_37)
package MummyMaze3_fla {
import flash.display.*;
public dynamic class introcloser_37 extends MovieClip {
public function introcloser_37(){
addFrameScript(5, frame6);
}
function frame6(){
stop();
}
}
}//package MummyMaze3_fla
Section 287
//lost_img_412 (MummyMaze3_fla.lost_img_412)
package MummyMaze3_fla {
import flash.display.*;
public dynamic class lost_img_412 extends MovieClip {
public var levels_selector_mc:MovieClip;
}
}//package MummyMaze3_fla
Section 288
//mult00014_132 (MummyMaze3_fla.mult00014_132)
package MummyMaze3_fla {
import flash.display.*;
public dynamic class mult00014_132 extends MovieClip {
public function mult00014_132(){
addFrameScript(79, frame80);
}
function frame80(){
(parent as MovieClip).play();
stop();
}
}
}//package MummyMaze3_fla
Section 289
//mult00016_130 (MummyMaze3_fla.mult00016_130)
package MummyMaze3_fla {
import flash.display.*;
public dynamic class mult00016_130 extends MovieClip {
public var mam_mc:MovieClip;
public function mult00016_130(){
addFrameScript(0, frame1, 52, frame53);
}
function frame1(){
stop();
}
function frame53(){
stop();
(parent as MovieClip).play();
}
}
}//package MummyMaze3_fla
Section 290
//mult00018_128 (MummyMaze3_fla.mult00018_128)
package MummyMaze3_fla {
import flash.display.*;
public dynamic class mult00018_128 extends MovieClip {
public function mult00018_128(){
addFrameScript(93, frame94);
}
function frame94(){
(parent.parent as MovieClip).play();
stop();
}
}
}//package MummyMaze3_fla
Section 291
//mult00029_110 (MummyMaze3_fla.mult00029_110)
package MummyMaze3_fla {
import flash.display.*;
public dynamic class mult00029_110 extends MovieClip {
public function mult00029_110(){
addFrameScript(29, frame30);
}
function frame30(){
stop();
}
}
}//package MummyMaze3_fla
Section 292
//mult00035_99 (MummyMaze3_fla.mult00035_99)
package MummyMaze3_fla {
import flash.display.*;
public dynamic class mult00035_99 extends MovieClip {
public function mult00035_99(){
addFrameScript(66, frame67);
}
function frame67(){
(parent as MovieClip).play();
}
}
}//package MummyMaze3_fla
Section 293
//mult00055_45 (MummyMaze3_fla.mult00055_45)
package MummyMaze3_fla {
import flash.display.*;
public dynamic class mult00055_45 extends MovieClip {
public var bfirst:Boolean;
public function mult00055_45(){
addFrameScript(0, frame1);
}
function frame1(){
bfirst = false;
if (!bfirst){
bfirst = true;
gotoAndPlay(int((Math.random() * totalFrames)));
};
}
}
}//package MummyMaze3_fla
Section 294
//mult00061_75 (MummyMaze3_fla.mult00061_75)
package MummyMaze3_fla {
import flash.display.*;
public dynamic class mult00061_75 extends MovieClip {
public function mult00061_75(){
addFrameScript(187, frame188);
}
function frame188(){
(parent.parent as MovieClip).play();
stop();
}
}
}//package MummyMaze3_fla
Section 295
//mult00090_22 (MummyMaze3_fla.mult00090_22)
package MummyMaze3_fla {
import flash.display.*;
public dynamic class mult00090_22 extends MovieClip {
public function mult00090_22(){
addFrameScript(99, frame100);
}
function frame100(){
(parent.parent as MovieClip).play();
stop();
}
}
}//package MummyMaze3_fla
Section 296
//mult00095_17 (MummyMaze3_fla.mult00095_17)
package MummyMaze3_fla {
import flash.display.*;
public dynamic class mult00095_17 extends MovieClip {
public var bus:MovieClip;
}
}//package MummyMaze3_fla
Section 297
//mult00122_113 (MummyMaze3_fla.mult00122_113)
package MummyMaze3_fla {
import flash.display.*;
public dynamic class mult00122_113 extends MovieClip {
public function mult00122_113(){
addFrameScript(16, frame17);
}
function frame17(){
gotoAndPlay(1);
}
}
}//package MummyMaze3_fla
Section 298
//preloaderLine_485 (MummyMaze3_fla.preloaderLine_485)
package MummyMaze3_fla {
import flash.display.*;
public dynamic class preloaderLine_485 extends MovieClip {
public var begun:MovieClip;
}
}//package MummyMaze3_fla
Section 299
//repository_497 (MummyMaze3_fla.repository_497)
package MummyMaze3_fla {
import flash.display.*;
public dynamic class repository_497 extends MovieClip {
public var MusicNSound:MovieClip;
}
}//package MummyMaze3_fla
Section 300
//UI_LevelsSelector_Simple_Holder_218 (MummyMaze3_fla.UI_LevelsSelector_Simple_Holder_218)
package MummyMaze3_fla {
import flash.display.*;
public dynamic class UI_LevelsSelector_Simple_Holder_218 extends MovieClip {
public var levels_bg_mc:MovieClip;
}
}//package MummyMaze3_fla
Section 301
//z_2_209 (MummyMaze3_fla.z_2_209)
package MummyMaze3_fla {
import flash.display.*;
public dynamic class z_2_209 extends MovieClip {
public function z_2_209(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package MummyMaze3_fla
Section 302
//z_2_407 (MummyMaze3_fla.z_2_407)
package MummyMaze3_fla {
import flash.display.*;
public dynamic class z_2_407 extends MovieClip {
public function z_2_407(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package MummyMaze3_fla
Section 303
//Controller (org.puremvc.as3.core.Controller)
package org.puremvc.as3.core {
import org.puremvc.as3.interfaces.*;
import org.puremvc.as3.patterns.observer.*;
public class Controller implements IController {
protected const SINGLETON_MSG:String = "Controller Singleton already constructed!";
protected var commandMap:Array;
protected var view:IView;
protected static var instance:IController;
public function Controller(){
if (instance != null){
throw (Error(SINGLETON_MSG));
};
instance = this;
commandMap = new Array();
initializeController();
}
public function removeCommand(_arg1:String):void{
if (hasCommand(_arg1)){
view.removeObserver(_arg1, this);
commandMap[_arg1] = null;
};
}
protected function initializeController():void{
view = View.getInstance();
}
public function registerCommand(_arg1:String, _arg2:Class):void{
if (commandMap[_arg1] == null){
view.registerObserver(_arg1, new Observer(executeCommand, this));
};
commandMap[_arg1] = _arg2;
}
public function hasCommand(_arg1:String):Boolean{
return (!((commandMap[_arg1] == null)));
}
public function executeCommand(_arg1:INotification):void{
var _local2:Class;
var _local3:ICommand;
_local2 = commandMap[_arg1.getName()];
if (_local2 == null){
return;
};
_local3 = new (_local2);
_local3.execute(_arg1);
}
public static function getInstance():IController{
if (instance == null){
instance = new (Controller);
};
return (instance);
}
}
}//package org.puremvc.as3.core
Section 304
//Model (org.puremvc.as3.core.Model)
package org.puremvc.as3.core {
import org.puremvc.as3.interfaces.*;
public class Model implements IModel {
protected const SINGLETON_MSG:String = "Model Singleton already constructed!";
protected var proxyMap:Array;
protected static var instance:IModel;
public function Model(){
if (instance != null){
throw (Error(SINGLETON_MSG));
};
instance = this;
proxyMap = new Array();
initializeModel();
}
public function removeProxy(_arg1:String):IProxy{
var _local2:IProxy;
_local2 = (proxyMap[_arg1] as IProxy);
if (_local2){
proxyMap[_arg1] = null;
_local2.onRemove();
};
return (_local2);
}
protected function initializeModel():void{
}
public function registerProxy(_arg1:IProxy):void{
proxyMap[_arg1.getProxyName()] = _arg1;
_arg1.onRegister();
}
public function hasProxy(_arg1:String):Boolean{
return (!((proxyMap[_arg1] == null)));
}
public function retrieveProxy(_arg1:String):IProxy{
return (proxyMap[_arg1]);
}
public static function getInstance():IModel{
if (instance == null){
instance = new (Model);
};
return (instance);
}
}
}//package org.puremvc.as3.core
Section 305
//View (org.puremvc.as3.core.View)
package org.puremvc.as3.core {
import org.puremvc.as3.interfaces.*;
import org.puremvc.as3.patterns.observer.*;
public class View implements IView {
protected const SINGLETON_MSG:String = "View Singleton already constructed!";
protected var observerMap:Array;
protected var mediatorMap:Array;
protected static var instance:IView;
public function View(){
if (instance != null){
throw (Error(SINGLETON_MSG));
};
instance = this;
mediatorMap = new Array();
observerMap = new Array();
initializeView();
}
public function registerObserver(_arg1:String, _arg2:IObserver):void{
var _local3:Array;
_local3 = observerMap[_arg1];
if (_local3){
_local3.push(_arg2);
} else {
observerMap[_arg1] = [_arg2];
};
}
public function removeObserver(_arg1:String, _arg2:Object):void{
var _local3:Array;
var _local4:int;
_local3 = (observerMap[_arg1] as Array);
_local4 = 0;
while (_local4 < _local3.length) {
if (Observer(_local3[_local4]).compareNotifyContext(_arg2) == true){
_local3.splice(_local4, 1);
break;
};
_local4++;
};
if (_local3.length == 0){
delete observerMap[_arg1];
};
}
public function hasMediator(_arg1:String):Boolean{
return (!((mediatorMap[_arg1] == null)));
}
public function notifyObservers(_arg1:INotification):void{
var _local2:Array;
var _local3:Number;
var _local4:IObserver;
if (observerMap[_arg1.getName()] != null){
_local2 = (observerMap[_arg1.getName()] as Array);
_local3 = 0;
while (_local3 < _local2.length) {
_local4 = (_local2[_local3] as IObserver);
_local4.notifyObserver(_arg1);
_local3++;
};
};
}
protected function initializeView():void{
}
public function registerMediator(_arg1:IMediator):void{
var _local2:Array;
var _local3:Observer;
var _local4:Number;
mediatorMap[_arg1.getMediatorName()] = _arg1;
_local2 = _arg1.listNotificationInterests();
if (_local2.length > 0){
_local3 = new Observer(_arg1.handleNotification, _arg1);
_local4 = 0;
while (_local4 < _local2.length) {
registerObserver(_local2[_local4], _local3);
_local4++;
};
};
_arg1.onRegister();
}
public function removeMediator(_arg1:String):IMediator{
var _local2:IMediator;
var _local3:Array;
var _local4:Number;
_local2 = (mediatorMap[_arg1] as IMediator);
if (_local2){
_local3 = _local2.listNotificationInterests();
_local4 = 0;
while (_local4 < _local3.length) {
removeObserver(_local3[_local4], _local2);
_local4++;
};
delete mediatorMap[_arg1];
_local2.onRemove();
};
return (_local2);
}
public function retrieveMediator(_arg1:String):IMediator{
return (mediatorMap[_arg1]);
}
public static function getInstance():IView{
if (instance == null){
instance = new (View);
};
return (instance);
}
}
}//package org.puremvc.as3.core
Section 306
//ICommand (org.puremvc.as3.interfaces.ICommand)
package org.puremvc.as3.interfaces {
public interface ICommand {
function execute(_arg1:INotification):void;
}
}//package org.puremvc.as3.interfaces
Section 307
//IController (org.puremvc.as3.interfaces.IController)
package org.puremvc.as3.interfaces {
public interface IController {
function hasCommand(_arg1:String):Boolean;
function executeCommand(_arg1:INotification):void;
function removeCommand(_arg1:String):void;
function registerCommand(_arg1:String, _arg2:Class):void;
}
}//package org.puremvc.as3.interfaces
Section 308
//IFacade (org.puremvc.as3.interfaces.IFacade)
package org.puremvc.as3.interfaces {
public interface IFacade extends INotifier {
function registerCommand(_arg1:String, _arg2:Class):void;
function removeProxy(_arg1:String):IProxy;
function registerProxy(_arg1:IProxy):void;
function hasMediator(_arg1:String):Boolean;
function removeCommand(_arg1:String):void;
function hasCommand(_arg1:String):Boolean;
function retrieveProxy(_arg1:String):IProxy;
function hasProxy(_arg1:String):Boolean;
function registerMediator(_arg1:IMediator):void;
function removeMediator(_arg1:String):IMediator;
function notifyObservers(_arg1:INotification):void;
function retrieveMediator(_arg1:String):IMediator;
}
}//package org.puremvc.as3.interfaces
Section 309
//IMediator (org.puremvc.as3.interfaces.IMediator)
package org.puremvc.as3.interfaces {
public interface IMediator {
function listNotificationInterests():Array;
function getViewComponent():Object;
function handleNotification(_arg1:INotification):void;
function getMediatorName():String;
function setViewComponent(_arg1:Object):void;
function onRegister():void;
function onRemove():void;
}
}//package org.puremvc.as3.interfaces
Section 310
//IModel (org.puremvc.as3.interfaces.IModel)
package org.puremvc.as3.interfaces {
public interface IModel {
function retrieveProxy(_arg1:String):IProxy;
function hasProxy(_arg1:String):Boolean;
function removeProxy(_arg1:String):IProxy;
function registerProxy(_arg1:IProxy):void;
}
}//package org.puremvc.as3.interfaces
Section 311
//INotification (org.puremvc.as3.interfaces.INotification)
package org.puremvc.as3.interfaces {
public interface INotification {
function getType():String;
function getName():String;
function toString():String;
function setBody(_arg1:Object):void;
function setType(_arg1:String):void;
function getBody():Object;
}
}//package org.puremvc.as3.interfaces
Section 312
//INotifier (org.puremvc.as3.interfaces.INotifier)
package org.puremvc.as3.interfaces {
public interface INotifier {
function sendNotification(_arg1:String, _arg2:Object=null, _arg3:String=null):void;
}
}//package org.puremvc.as3.interfaces
Section 313
//IObserver (org.puremvc.as3.interfaces.IObserver)
package org.puremvc.as3.interfaces {
public interface IObserver {
function setNotifyContext(_arg1:Object):void;
function compareNotifyContext(_arg1:Object):Boolean;
function setNotifyMethod(_arg1:Function):void;
function notifyObserver(_arg1:INotification):void;
}
}//package org.puremvc.as3.interfaces
Section 314
//IProxy (org.puremvc.as3.interfaces.IProxy)
package org.puremvc.as3.interfaces {
public interface IProxy {
function getData():Object;
function onRegister():void;
function getProxyName():String;
function onRemove():void;
function setData(_arg1:Object):void;
}
}//package org.puremvc.as3.interfaces
Section 315
//IView (org.puremvc.as3.interfaces.IView)
package org.puremvc.as3.interfaces {
public interface IView {
function removeMediator(_arg1:String):IMediator;
function notifyObservers(_arg1:INotification):void;
function registerMediator(_arg1:IMediator):void;
function registerObserver(_arg1:String, _arg2:IObserver):void;
function removeObserver(_arg1:String, _arg2:Object):void;
function hasMediator(_arg1:String):Boolean;
function retrieveMediator(_arg1:String):IMediator;
}
}//package org.puremvc.as3.interfaces
Section 316
//SimpleCommand (org.puremvc.as3.patterns.command.SimpleCommand)
package org.puremvc.as3.patterns.command {
import org.puremvc.as3.interfaces.*;
import org.puremvc.as3.patterns.observer.*;
public class SimpleCommand extends Notifier implements ICommand, INotifier {
public function execute(_arg1:INotification):void{
}
}
}//package org.puremvc.as3.patterns.command
Section 317
//Facade (org.puremvc.as3.patterns.facade.Facade)
package org.puremvc.as3.patterns.facade {
import org.puremvc.as3.interfaces.*;
import org.puremvc.as3.patterns.observer.*;
import org.puremvc.as3.core.*;
public class Facade implements IFacade {
protected const SINGLETON_MSG:String = "Facade Singleton already constructed!";
protected var controller:IController;
protected var view:IView;
protected var model:IModel;
protected static var instance:IFacade;
public function Facade(){
if (instance != null){
throw (Error(SINGLETON_MSG));
};
instance = this;
initializeFacade();
}
public function removeProxy(_arg1:String):IProxy{
var _local2:IProxy;
if (model != null){
_local2 = model.removeProxy(_arg1);
};
return (_local2);
}
public function registerProxy(_arg1:IProxy):void{
model.registerProxy(_arg1);
}
protected function initializeController():void{
if (controller != null){
return;
};
controller = Controller.getInstance();
}
public function retrieveMediator(_arg1:String):IMediator{
return ((view.retrieveMediator(_arg1) as IMediator));
}
protected function initializeFacade():void{
initializeModel();
initializeController();
initializeView();
}
public function sendNotification(_arg1:String, _arg2:Object=null, _arg3:String=null):void{
notifyObservers(new Notification(_arg1, _arg2, _arg3));
}
public function notifyObservers(_arg1:INotification):void{
if (view != null){
view.notifyObservers(_arg1);
};
}
protected function initializeView():void{
if (view != null){
return;
};
view = View.getInstance();
}
public function removeMediator(_arg1:String):IMediator{
var _local2:IMediator;
if (view != null){
_local2 = view.removeMediator(_arg1);
};
return (_local2);
}
public function hasCommand(_arg1:String):Boolean{
return (controller.hasCommand(_arg1));
}
public function retrieveProxy(_arg1:String):IProxy{
return (model.retrieveProxy(_arg1));
}
public function hasMediator(_arg1:String):Boolean{
return (view.hasMediator(_arg1));
}
public function removeCommand(_arg1:String):void{
controller.removeCommand(_arg1);
}
public function registerCommand(_arg1:String, _arg2:Class):void{
controller.registerCommand(_arg1, _arg2);
}
protected function initializeModel():void{
if (model != null){
return;
};
model = Model.getInstance();
}
public function hasProxy(_arg1:String):Boolean{
return (model.hasProxy(_arg1));
}
public function registerMediator(_arg1:IMediator):void{
if (view != null){
view.registerMediator(_arg1);
};
}
public static function getInstance():IFacade{
if (instance == null){
instance = new (Facade);
};
return (instance);
}
}
}//package org.puremvc.as3.patterns.facade
Section 318
//Mediator (org.puremvc.as3.patterns.mediator.Mediator)
package org.puremvc.as3.patterns.mediator {
import org.puremvc.as3.interfaces.*;
import org.puremvc.as3.patterns.observer.*;
public class Mediator extends Notifier implements IMediator, INotifier {
protected var viewComponent:Object;
protected var mediatorName:String;
public static const NAME:String = "Mediator";
public function Mediator(_arg1:String=null, _arg2:Object=null){
this.mediatorName = ((_arg1)!=null) ? _arg1 : NAME;
this.viewComponent = _arg2;
}
public function onRemove():void{
}
public function getViewComponent():Object{
return (viewComponent);
}
public function getMediatorName():String{
return (mediatorName);
}
public function setViewComponent(_arg1:Object):void{
this.viewComponent = _arg1;
}
public function listNotificationInterests():Array{
return ([]);
}
public function onRegister():void{
}
public function handleNotification(_arg1:INotification):void{
}
}
}//package org.puremvc.as3.patterns.mediator
Section 319
//Notification (org.puremvc.as3.patterns.observer.Notification)
package org.puremvc.as3.patterns.observer {
import org.puremvc.as3.interfaces.*;
public class Notification implements INotification {
private var body:Object;
private var type:String;
private var name:String;
public function Notification(_arg1:String, _arg2:Object=null, _arg3:String=null){
this.name = _arg1;
this.body = _arg2;
this.type = _arg3;
}
public function setBody(_arg1:Object):void{
this.body = _arg1;
}
public function getName():String{
return (name);
}
public function toString():String{
var _local1:String;
_local1 = ("Notification Name: " + getName());
_local1 = (_local1 + ("\nBody:" + ((body)==null) ? "null" : body.toString()));
_local1 = (_local1 + ("\nType:" + ((type)==null) ? "null" : type));
return (_local1);
}
public function getType():String{
return (type);
}
public function setType(_arg1:String):void{
this.type = _arg1;
}
public function getBody():Object{
return (body);
}
}
}//package org.puremvc.as3.patterns.observer
Section 320
//Notifier (org.puremvc.as3.patterns.observer.Notifier)
package org.puremvc.as3.patterns.observer {
import org.puremvc.as3.interfaces.*;
import org.puremvc.as3.patterns.facade.*;
public class Notifier implements INotifier {
protected var facade:IFacade;
public function Notifier(){
facade = Facade.getInstance();
super();
}
public function sendNotification(_arg1:String, _arg2:Object=null, _arg3:String=null):void{
facade.sendNotification(_arg1, _arg2, _arg3);
}
}
}//package org.puremvc.as3.patterns.observer
Section 321
//Observer (org.puremvc.as3.patterns.observer.Observer)
package org.puremvc.as3.patterns.observer {
import org.puremvc.as3.interfaces.*;
public class Observer implements IObserver {
private var notify:Function;
private var context:Object;
public function Observer(_arg1:Function, _arg2:Object){
setNotifyMethod(_arg1);
setNotifyContext(_arg2);
}
private function getNotifyMethod():Function{
return (notify);
}
public function setNotifyContext(_arg1:Object):void{
context = _arg1;
}
public function compareNotifyContext(_arg1:Object):Boolean{
return ((_arg1 === this.context));
}
private function getNotifyContext():Object{
return (context);
}
public function setNotifyMethod(_arg1:Function):void{
notify = _arg1;
}
public function notifyObserver(_arg1:INotification):void{
this.getNotifyMethod().apply(this.getNotifyContext(), [_arg1]);
}
}
}//package org.puremvc.as3.patterns.observer
Section 322
//Proxy (org.puremvc.as3.patterns.proxy.Proxy)
package org.puremvc.as3.patterns.proxy {
import org.puremvc.as3.interfaces.*;
import org.puremvc.as3.patterns.observer.*;
public class Proxy extends Notifier implements IProxy, INotifier {
protected var data:Object;
protected var proxyName:String;
public static var NAME:String = "Proxy";
public function Proxy(_arg1:String=null, _arg2:Object=null){
this.proxyName = ((_arg1)!=null) ? _arg1 : NAME;
if (_arg2 != null){
setData(_arg2);
};
}
public function getData():Object{
return (data);
}
public function getProxyName():String{
return (proxyName);
}
public function setData(_arg1:Object):void{
this.data = _arg1;
}
public function onRegister():void{
}
public function onRemove():void{
}
}
}//package org.puremvc.as3.patterns.proxy
Section 323
//ChangeSLCurrenPageCommand (shared_levels.controller.ChangeSLCurrenPageCommand)
package shared_levels.controller {
import org.puremvc.as3.interfaces.*;
import shared_levels.model.*;
import org.puremvc.as3.patterns.command.*;
public class ChangeSLCurrenPageCommand extends SimpleCommand implements ICommand {
override public function execute(_arg1:INotification):void{
var _local2:int;
var _local3:SharedLevelsProxy;
_local2 = (_arg1.getBody() as int);
_local3 = (facade.retrieveProxy(SharedLevelsProxy.NAME) as SharedLevelsProxy);
if (_local3 != null){
_local3.currentPage = _local2;
};
}
}
}//package shared_levels.controller
Section 324
//ChangeSLPerPageCountCommand (shared_levels.controller.ChangeSLPerPageCountCommand)
package shared_levels.controller {
import org.puremvc.as3.interfaces.*;
import shared_levels.model.*;
import org.puremvc.as3.patterns.command.*;
public class ChangeSLPerPageCountCommand extends SimpleCommand implements ICommand {
override public function execute(_arg1:INotification):void{
var _local2:int;
var _local3:SharedLevelsProxy;
_local2 = (_arg1.getBody() as int);
_local3 = (facade.retrieveProxy(SharedLevelsProxy.NAME) as SharedLevelsProxy);
if (_local3 != null){
_local3.levelsPerPage = _local2;
};
}
}
}//package shared_levels.controller
Section 325
//ChangeSLSortCommand (shared_levels.controller.ChangeSLSortCommand)
package shared_levels.controller {
import org.puremvc.as3.interfaces.*;
import shared_levels.model.*;
import org.puremvc.as3.patterns.command.*;
public class ChangeSLSortCommand extends SimpleCommand implements ICommand {
override public function execute(_arg1:INotification):void{
var _local2:int;
var _local3:SharedLevelsProxy;
_local2 = (_arg1.getBody() as int);
_local3 = (facade.retrieveProxy(SharedLevelsProxy.NAME) as SharedLevelsProxy);
if (_local3 != null){
_local3.sort = (_arg1.getBody() as int);
};
}
}
}//package shared_levels.controller
Section 326
//SLPostLevelCommand (shared_levels.controller.SLPostLevelCommand)
package shared_levels.controller {
import com.gamezhero.as3.remoting.structure.*;
import org.puremvc.as3.interfaces.*;
import shared_levels.model.*;
import org.puremvc.as3.patterns.command.*;
public class SLPostLevelCommand extends SimpleCommand implements ICommand {
override public function execute(_arg1:INotification):void{
var _local2:LevelStructure;
var _local3:SharedLevelsProxy;
var _local4:SharedObjectProxy;
trace("X");
trace("SLPostLevelCommand override public function execute( note:INotification ) : void");
_local2 = (_arg1.getBody() as LevelStructure);
trace(("levelStruct=" + _local2));
_local3 = (facade.retrieveProxy(SharedLevelsProxy.NAME) as SharedLevelsProxy);
if (_local3 == null){
_local3 = new SharedLevelsProxy();
facade.registerProxy(_local3);
};
trace(("pSL=" + _local3));
if (_local3 != null){
_local3.postLevel(SharedLevelsProxy.LEVEL_ID_NEW, _local2);
};
_local4 = (facade.retrieveProxy(SharedObjectProxy.NAME) as SharedObjectProxy);
if (((!((_local4 == null))) && (!((_local2 == null))))){
_local4.setUserName(_local2.level_author);
_local4.setLastEmail(_local2.level_email);
_local4.setLastLevelName(_local2.level_name);
};
}
}
}//package shared_levels.controller
Section 327
//SLPostLevelRateCommand (shared_levels.controller.SLPostLevelRateCommand)
package shared_levels.controller {
import org.puremvc.as3.interfaces.*;
import shared_levels.model.*;
import org.puremvc.as3.patterns.command.*;
public class SLPostLevelRateCommand extends SimpleCommand implements ICommand {
public function SLPostLevelCommand(){
}
override public function execute(_arg1:INotification):void{
var _local2:SharedLevelProxy;
var _local3:SharedLevelsProxy;
_local2 = (_arg1.getBody() as SharedLevelProxy);
_local3 = (facade.retrieveProxy(SharedLevelsProxy.NAME) as SharedLevelsProxy);
if (((!((_local3 == null))) && (!((_local2 == null))))){
_local3.postLevelRate(_local2.id, _local2.rate);
};
}
}
}//package shared_levels.controller
Section 328
//SLReceiveErrorCommand (shared_levels.controller.SLReceiveErrorCommand)
package shared_levels.controller {
import org.puremvc.as3.interfaces.*;
import shared_levels.model.*;
import org.puremvc.as3.patterns.command.*;
public class SLReceiveErrorCommand extends SimpleCommand implements ICommand {
override public function execute(_arg1:INotification):void{
var _local2:SharedLevelProxy;
_local2 = (_arg1.getBody() as SharedLevelProxy);
}
}
}//package shared_levels.controller
Section 329
//SLReceiveGetLevel (shared_levels.controller.SLReceiveGetLevel)
package shared_levels.controller {
import org.puremvc.as3.interfaces.*;
import org.puremvc.as3.patterns.command.*;
public class SLReceiveGetLevel extends SimpleCommand implements ICommand {
override public function execute(_arg1:INotification):void{
trace("X");
trace("SLReceiveGetLevel public function execute( note:INotification ) : void");
}
}
}//package shared_levels.controller
Section 330
//SharedLevelProxy (shared_levels.model.SharedLevelProxy)
package shared_levels.model {
import main.*;
public class SharedLevelProxy {
private var m_strName:String;
private var m_strURL:String;
private var m_strAuthor:String;
private var m_nState:int;
private var m_nRate:Number;
private var m_strLevel:String;
private var m_strDate:String;
private var m_strID:String;
public static const PLAY_STATE_PLAYED_AND_WIN:int = 2;
public static const PLAY_STATE_UNDEF:int = -1;
public static const ERROR_RESULT:String = "-1";
public static const PLAY_STATE_PLAYED_AND_NOT_WIN:int = 1;
public static const PLAY_STATE_NOT_PLAYED:int = 0;
public static const ERROR_RESULT_ALT:String = "-";
public function SharedLevelProxy(_arg1:String, _arg2:String, _arg3:Number, _arg4:String, _arg5:String, _arg6:String=null, _arg7:int=-1, _arg8:String=null){
m_strAuthor = _arg1;
m_strID = _arg2;
m_nRate = _arg3;
m_strName = _arg4;
if (_arg5 != null){
m_strDate = _arg5.substr(0, _arg5.indexOf(" "));
} else {
m_strDate = "-";
};
m_strLevel = _arg6;
m_nState = _arg7;
m_strURL = _arg8;
}
public function set rate(_arg1:Number):void{
m_nRate = _arg1;
}
public function get level():String{
return (m_strLevel);
}
public function set level(_arg1:String):void{
m_strLevel = _arg1;
}
public function get author():String{
return (m_strAuthor);
}
public function get levelDate():String{
return (m_strDate);
}
public function get state():int{
return (m_nState);
}
public function set url(_arg1:String):void{
m_strURL = _arg1;
}
public function get id():String{
return (m_strID);
}
public function get rate():Number{
return (m_nRate);
}
public function isLevelHasError():Boolean{
return ((((((((m_strLevel == ERROR_RESULT)) || ((m_strLevel == null)))) || ((m_strLevel.length == 0)))) || ((m_strLevel == ERROR_RESULT_ALT))));
}
public function set state(_arg1:int):void{
m_nState = _arg1;
}
public function get levelName():String{
return (m_strName);
}
public function get safeUrl():String{
if (m_strURL != null){
return (m_strURL);
};
if (m_strID != null){
return ((Global_Settings.GAMEZHERO_POST_LEVEL_URL + m_strID));
};
return (null);
}
public function get url():String{
return (m_strURL);
}
public function isUrlHaveError():Boolean{
if (m_strURL == null){
return (true);
};
if (m_strURL == ERROR_RESULT){
return (true);
};
return (false);
}
}
}//package shared_levels.model
Section 331
//SharedLevelsPageProxy (shared_levels.model.SharedLevelsPageProxy)
package shared_levels.model {
public class SharedLevelsPageProxy {
private var m_arLevels:Array;
private var m_nPage:int;
public function SharedLevelsPageProxy(_arg1:int){
m_arLevels = new Array();
super();
m_nPage = _arg1;
}
public function getLevelByUID(_arg1:String):SharedLevelProxy{
var _local2:SharedLevelProxy;
for each (_local2 in m_arLevels) {
if (((!((_local2 == null))) && ((_local2.id == _arg1)))){
return (_local2);
};
};
return (null);
}
public function addLevel(_arg1:SharedLevelProxy):Boolean{
m_arLevels.push(_arg1);
return (true);
}
public function get length():int{
return (m_arLevels.length);
}
public function getLevel(_arg1:int):SharedLevelProxy{
return (m_arLevels[_arg1]);
}
}
}//package shared_levels.model
Section 332
//SharedLevelsProxy (shared_levels.model.SharedLevelsProxy)
package shared_levels.model {
import com.gamezhero.as3.remoting.structure.*;
import game.model.*;
import org.puremvc.as3.interfaces.*;
import com.*;
import main.*;
import main.controller.*;
import com.gamezhero.as3.remoting.events.*;
import com.gamezhero.as3.remoting.*;
import org.puremvc.as3.patterns.proxy.*;
import main.model.*;
public class SharedLevelsProxy extends Proxy implements IProxy {
private var m_nPageCount:int;
private var m_arArrayBySort:Array;
private var m_nLevelsPerPage:int;// = 6
private var m_strLevelUID:String;
private var m_remotingLevelGateway:RemotingLevelsGateway;
private var m_nSort:int;// = 3
private var m_nState:uint;// = 0
private var m_strLevel:String;
private var m_nCurrentPage:int;// = 0
private var m_pSL:SharedLevelProxy;
private var m_bRunAfterLoadLevel:Boolean;// = false
private static const PAGE_LIST_VALUE_DATE:String = "level_date";
public static const STATE_REQUEST_SET_LEVEL:uint = (STATE_UNDEF + 7);
private static const PAGE_LIST_VALUE_AUTHOR:String = "level_author";
public static const NAME:String = "SharedLevelsProxy";
public static const STATE_RECEIVE_GET_LEVEL:uint = (STATE_UNDEF + 6);
public static const LEVEL_ID_NEW:String = "-1";
private static const PAGE_LIST_VALUE_NAME:String = "level_name";
public static const STATE_RECEIVE_SET_LEVEL_RATE:uint = (STATE_UNDEF + 10);
public static const STATE_RECEIVE_SET_LEVEL:uint = (STATE_UNDEF + 8);
public static const STATE_UNDEF:uint = 0;
private static const PAGE_LIST_VALUE_RATE:String = "level_rate";
public static const STATE_REQUEST_GET_PAGE_AMOUNT:uint = (STATE_UNDEF + 1);
public static const STATE_REQUEST_SET_LEVEL_RATE:uint = (STATE_UNDEF + 9);
public static const STATE_REQUEST_GET_PAGE_LIST:uint = (STATE_UNDEF + 3);
public static const STATE_RECEIVE_ERROR:uint = (STATE_UNDEF + 11);
private static const PAGE_LIST_VALUE_URL:String = "level_url";
private static const PAGE_LIST_VALUE_ID:String = "level_id";
public static const STATE_RECEIVE_GET_PAGE_AMOUNT:uint = (STATE_UNDEF + 2);
public static const STATE_RECEIVE_GET_PAGE_LIST:uint = (STATE_UNDEF + 4);
public static const STATE_REQUEST_GET_LEVEL:uint = (STATE_UNDEF + 5);
public function SharedLevelsProxy(){
m_nState = STATE_UNDEF;
m_nSort = RemotingLevelsGateway.SORT_BY_RATE_DEC;
m_nLevelsPerPage = 6;
m_nCurrentPage = 0;
m_bRunAfterLoadLevel = false;
m_arArrayBySort = new Array();
try {
m_remotingLevelGateway = new RemotingLevelsGateway(Global_Settings.GAMEZHERO_LEVELS_LINK);
} catch(e:ArgumentError) {
trace(("e=" + e));
};
super(NAME, m_remotingLevelGateway);
if (m_remotingLevelGateway != null){
m_remotingLevelGateway.addEventListener(RemotingLevelsEvent.GET_PAGE_AMOUNT, listenGetPageAmount);
m_remotingLevelGateway.addEventListener(RemotingLevelsEvent.GET_PAGE_LIST, listenGetPageList);
m_remotingLevelGateway.addEventListener(RemotingLevelsEvent.GET_LEVEL, listenGetLevel);
m_remotingLevelGateway.addEventListener(RemotingLevelsEvent.SET_LEVEL, listenSetLevel);
m_remotingLevelGateway.addEventListener(RemotingLevelsEvent.SET_LEVEL_RATE, listenSetlevelRate);
m_remotingLevelGateway.addEventListener(RemotingLevelsEvent.ERROR, listenError);
};
}
public function get lastLevelStruct():SharedLevelProxy{
return (m_pSL);
}
public function getPageBySort(_arg1:int):SharedLevelsSetProxy{
var _local2:SharedLevelsSetProxy;
for each (_local2 in m_arArrayBySort) {
if (((!((_local2 == null))) && ((_local2.sort == _arg1)))){
return (_local2);
};
};
_local2 = new SharedLevelsSetProxy(_arg1, m_nPageCount);
m_arArrayBySort.push(_local2);
return (_local2);
}
public function get level():String{
return (m_strLevel);
}
public function listenError(_arg1:RemotingLevelsEvent=null):void{
var _local2:String;
_local2 = _arg1.value;
trace("errorResult", _local2);
setState(STATE_RECEIVE_ERROR, _local2, _arg1.result);
}
public function get state():uint{
return (m_nState);
}
public function requestPageList(_arg1:int, _arg2:int, _arg3:int=-1):void{
trace("X");
trace("SharedLevelsProxy public function requestPageList(nPage:int, nBlockLength:int, nSort:int = RemotingLevelsGateway.SORT_UNDEF):void");
trace(("nPage=" + _arg1));
trace(("nBlockLength=" + _arg2));
trace(("nSort=" + _arg3));
if (_arg3 == RemotingLevelsGateway.SORT_UNDEF){
_arg3 = m_nSort;
} else {
m_nSort = _arg3;
};
m_remotingLevelGateway.getPageList(Global_Settings.GAME_ID, _arg1, _arg2, _arg3);
setState(STATE_REQUEST_GET_PAGE_LIST, _arg1);
}
public function set level(_arg1:String):void{
m_strLevel = _arg1;
}
public function get sort():int{
return (m_nSort);
}
public function isLevelValid():Boolean{
return (((((!((m_strLevel == null))) && (!((m_strLevel == SharedLevelProxy.ERROR_RESULT))))) && (!((m_strLevel == SharedLevelProxy.ERROR_RESULT_ALT)))));
}
public function renderLevels(_arg1:SharedLevelProxy):LevelsProxy{
var _local2:LevelsProxy;
var _local3:LevelProxy;
_local2 = new LevelsProxy(true);
_local3 = LevelProxy.parseXMLStringCompressed(_arg1.level, _local2);
_local3.uidSharedLevel = _arg1.id;
if (_local3 == null){
return (null);
};
_local3.uid = _arg1.id;
_local3.rate = _arg1.rate;
if (_local3 == null){
return (null);
};
_local2.pushItem(_local3);
_local2.select = _local3;
_local2.inGame = true;
return (_local2);
}
public function runAfterLoadLevel():Boolean{
var pLevels:LevelsProxy;
var pSL:SharedLevelProxy;
var pMenu:MenuProxy;
if (((m_bRunAfterLoadLevel) && (isLevelValid()))){
pLevels = new LevelsProxy(true);
try {
pSL = lastLevelStruct;
pLevels = renderLevels(pSL);
pMenu = new MenuProxy();
facade.registerProxy(pMenu);
sendNotification(ApplicationFacade.HERO_START_LEVEL, pLevels.select);
sendNotification(ApplicationFacade.CHANGE_PAGE, new PageCommandStruct(PagesProxy.PAGE_GAME, pLevels, pLevels.select, pMenu));
return (true);
} catch(e:ArgumentError) {
};
};
return (false);
}
public function get currentPage():int{
return (m_nCurrentPage);
}
public function listenSetLevel(_arg1:RemotingLevelsEvent=null):void{
var _local2:*;
_local2 = _arg1.value;
trace("setLevelResult, levelID:", _local2);
setState(STATE_RECEIVE_SET_LEVEL, _local2, _arg1.result);
}
public function listenGetLevel(_arg1:RemotingLevelsEvent=null):void{
var _local2:*;
var _local3:String;
_local2 = _arg1.value;
trace("getLevelResult levelCode", _local2);
_local3 = (_arg1.result as String);
if (_local3 == null){
_local3 = m_strLevelUID;
};
m_strLevel = _local2;
m_pSL = getLevelByUID(_local3);
if (m_pSL == null){
m_pSL = new SharedLevelProxy(null, _local3, CommonFunc.INT_UNDEF, null, null, m_strLevel);
};
setState(STATE_RECEIVE_GET_LEVEL, _local2, _arg1.result);
}
public function listenGetPageAmount(_arg1:RemotingLevelsEvent=null):void{
var _local2:*;
_local2 = _arg1.value;
trace("getPageAmountResult ", _local2);
setState(STATE_RECEIVE_GET_PAGE_AMOUNT, _local2, _arg1.result);
}
public function set levelsPerPage(_arg1:int):void{
m_nLevelsPerPage = _arg1;
requestPageAmount(m_nLevelsPerPage);
}
public function get progress():Boolean{
return ((((((((((m_nState == STATE_REQUEST_GET_LEVEL)) || ((m_nState == STATE_REQUEST_GET_PAGE_AMOUNT)))) || ((m_nState == STATE_REQUEST_GET_PAGE_LIST)))) || ((m_nState == STATE_REQUEST_SET_LEVEL)))) || ((m_nState == STATE_REQUEST_SET_LEVEL_RATE))));
}
public function requestPageAmount(_arg1:int):void{
trace("X");
trace("SharedLevelsProxy public function requestPageAmount(nBlockLength:int):void");
trace(("nBlockLength=" + _arg1));
m_remotingLevelGateway.getPagesAmount(Global_Settings.GAME_ID, _arg1);
setState(STATE_REQUEST_GET_PAGE_AMOUNT);
}
public function get pageCount():int{
return (m_nPageCount);
}
public function get levelUID():String{
return (m_strLevelUID);
}
public function listenSetlevelRate(_arg1:RemotingLevelsEvent=null):void{
var _local2:*;
_local2 = _arg1.value;
trace("setlevelRateResult, New Rate", _local2);
setState(STATE_RECEIVE_SET_LEVEL_RATE, _local2, _arg1.result);
}
public function set sort(_arg1:int):void{
trace("X");
trace("SharedLevelsProxy public function set sort(nValue:int):void");
trace(("m_nSort=" + m_nSort));
trace(("nValue=" + _arg1));
if (m_nSort != _arg1){
m_nSort = _arg1;
requestPageList(m_nCurrentPage, m_nLevelsPerPage, m_nSort);
};
}
public function requestLevel(_arg1:String):void{
trace("X");
trace("SharedLevelsProxy public function requestLevel(nIdLevel:int):void");
trace(("nIdLevel=" + _arg1));
m_strLevelUID = m_strLevelUID;
m_remotingLevelGateway.getLevel(Global_Settings.GAME_ID, _arg1);
setState(STATE_REQUEST_GET_LEVEL);
}
public function requestAndRunLevel(_arg1:String):void{
m_bRunAfterLoadLevel = true;
requestLevel(_arg1);
}
public function setState(_arg1:int, _arg2:Object=null, _arg3:Object=null):void{
m_nState = _arg1;
switch (_arg1){
case STATE_REQUEST_GET_PAGE_AMOUNT:
sendNotification(ApplicationFacade.SL_REQUEST_GET_PAGE_AMOUNT, _arg2);
break;
case STATE_RECEIVE_GET_PAGE_AMOUNT:
setPageCount((_arg2 as int));
break;
case STATE_REQUEST_GET_PAGE_LIST:
sendNotification(ApplicationFacade.SL_REQUEST_GET_PAGE_LIST, _arg2);
break;
case STATE_RECEIVE_GET_PAGE_LIST:
setPageList((_arg3 as int), (_arg2 as Array));
break;
case STATE_REQUEST_GET_LEVEL:
sendNotification(ApplicationFacade.SL_REQUEST_GET_LEVEL, _arg2);
break;
case STATE_RECEIVE_GET_LEVEL:
sendNotification(ApplicationFacade.SL_RECEIVE_GET_LEVEL, new SharedLevelProxy(null, (_arg3 as String), -1, null, null, (_arg2 as String)));
break;
case STATE_REQUEST_SET_LEVEL:
sendNotification(ApplicationFacade.SL_REQUEST_SET_LEVEL, _arg2);
break;
case STATE_RECEIVE_SET_LEVEL:
sendNotification(ApplicationFacade.SL_RECEIVE_SET_LEVEL, new SharedLevelProxy(null, (_arg3 as String), -1, null, null, null, SharedLevelProxy.PLAY_STATE_UNDEF, (_arg2 as String)));
break;
case STATE_REQUEST_SET_LEVEL_RATE:
sendNotification(ApplicationFacade.SL_REQUEST_SET_LEVEL_RATE, _arg2);
break;
case STATE_RECEIVE_SET_LEVEL_RATE:
trace(("oResult=" + _arg2));
trace(("oResult as Number =" + (_arg2 as Number)));
trace(("new Number(oResult) =" + new Number(_arg2)));
sendNotification(ApplicationFacade.SL_RECEIVE_SET_LEVEL_RATE, new SharedLevelProxy(null, (_arg3 as String), new Number(_arg2), null, null, null));
break;
case STATE_RECEIVE_ERROR:
sendNotification(ApplicationFacade.SL_RECEIVE_ERROR, _arg2);
break;
};
}
public function set currentPage(_arg1:int):void{
if ((((_arg1 >= 0)) && ((_arg1 < m_nPageCount)))){
m_nCurrentPage = _arg1;
requestPageList(m_nCurrentPage, m_nLevelsPerPage, m_nSort);
};
}
public function getLevelByUID(_arg1:String):SharedLevelProxy{
var _local2:SharedLevelsSetProxy;
var _local3:int;
var _local4:SharedLevelsPageProxy;
var _local5:SharedLevelProxy;
for each (_local2 in m_arArrayBySort) {
if (_local2 != null){
_local3 = _local2.pageCount;
while (--_local3 >= 0) {
_local4 = _local2.getPage(_local3);
if (_local4 != null){
_local5 = _local4.getLevelByUID(_arg1);
if (_local5 != null){
return (_local5);
};
};
};
};
};
return (null);
}
public function postLevel(_arg1:String, _arg2:LevelStructure):void{
trace("X");
trace("SharedLevelsProxy public function postLevel(strLevelId:String, level:LevelStructure):void");
trace(("strLevelId=" + _arg1));
trace(("level.level_author=" + _arg2.level_author));
trace(("level.level_email=" + _arg2.level_email));
trace(("level.level_name=" + _arg2.level_name));
trace(("level.level_rate=" + _arg2.level_rate));
trace(("level.level_value=" + _arg2.level_value));
m_remotingLevelGateway.setLevel(Global_Settings.GAME_ID, _arg1, _arg2);
setState(STATE_REQUEST_SET_LEVEL);
}
private function setPageList(_arg1:int, _arg2:Array):void{
var _local3:SharedObjectProxy;
var _local4:SharedLevelsSetProxy;
var _local5:SharedLevelsPageProxy;
var _local6:SharedLevelProxy;
var _local7:Object;
var _local8:String;
var _local9:int;
var _local10:*;
trace("x");
trace("SharedLevelsProxy private function listenGetPageList(nPage:int, arPage:Array):void");
trace(("arPage=" + _arg2));
_local3 = (facade.retrieveProxy(SharedObjectProxy.NAME) as SharedObjectProxy);
if (((!((_arg2 == null))) && (!((_local3 == null))))){
trace(("arPage.length=" + _arg2.length));
_local4 = getPageBySort(m_nSort);
trace(("m_nSort=" + m_nSort));
trace(("pSet=" + _local4));
if (_local4 != null){
_local5 = new SharedLevelsPageProxy(_arg1);
for each (_local7 in _arg2) {
if (_local7 != null){
_local8 = _local7[PAGE_LIST_VALUE_ID];
_local9 = _local3.getLevelState(_local8);
trace(("strUID=" + _local8));
trace(("nState=" + _local9));
_local6 = new SharedLevelProxy(_local7[PAGE_LIST_VALUE_AUTHOR], _local8, _local7[PAGE_LIST_VALUE_RATE], _local7[PAGE_LIST_VALUE_NAME], _local7[PAGE_LIST_VALUE_DATE], null, _local9, _local7[PAGE_LIST_VALUE_URL]);
_local5.addLevel(_local6);
trace(("element=" + _local7));
for (_local10 in _local7) {
trace(((("element." + _local10) + " = ") + _local7[_local10]));
};
};
};
_local4.setPage(_arg1, _local5);
};
sendNotification(ApplicationFacade.SL_RECEIVE_GET_PAGE_LIST, _local5);
};
}
public function postLevelRate(_arg1:String, _arg2:Number):void{
m_remotingLevelGateway.setLevelRate(Global_Settings.GAME_ID, _arg1, _arg2);
setState(STATE_REQUEST_SET_LEVEL_RATE);
}
private function getLevelsBySort(_arg1:int):SharedLevelsSetProxy{
var _local2:SharedLevelsSetProxy;
for each (_local2 in m_arArrayBySort) {
if (((!((_local2 == null))) && ((_local2.sort == _arg1)))){
return (_local2);
};
};
return (null);
}
public function getLevelRateByUID(_arg1:String):Number{
var _local2:SharedLevelProxy;
_local2 = getLevelByUID(_arg1);
if (_local2 != null){
return (_local2.rate);
};
return (CommonFunc.INT_UNDEF);
}
public function listenGetPageList(_arg1:RemotingLevelsEvent=null):void{
var _local2:*;
var _local3:Array;
var _local4:*;
_local2 = _arg1.value;
trace("getPageListResult ARRAY:", _local2);
_local3 = (_local2 as Array);
_local4 = 0;
while (_local4 < _local3.length) {
_local4++;
};
setState(STATE_RECEIVE_GET_PAGE_LIST, _local2, _arg1.result);
}
private function setPageCount(_arg1:int):void{
m_nPageCount = _arg1;
m_arArrayBySort = new Array();
m_arArrayBySort.push(new SharedLevelsSetProxy(RemotingLevelsGateway.SORT_BY_RATE_DEC, m_nPageCount));
m_arArrayBySort.push(new SharedLevelsSetProxy(RemotingLevelsGateway.SORT_BY_DATE_DEC, m_nPageCount));
sendNotification(ApplicationFacade.SL_RECEIVE_GET_PAGE_AMOUNT, m_nPageCount);
}
}
}//package shared_levels.model
Section 333
//SharedLevelsSetProxy (shared_levels.model.SharedLevelsSetProxy)
package shared_levels.model {
public class SharedLevelsSetProxy {
private var m_arPages:Array;
private var m_nSort:int;
public function SharedLevelsSetProxy(_arg1:int, _arg2:int){
m_arPages = new Array();
super();
m_nSort = _arg1;
m_arPages = new Array(_arg2);
}
public function get pageCount():int{
return (m_arPages.length);
}
public function getPage(_arg1):SharedLevelsPageProxy{
if ((((_arg1 < 0)) || ((m_arPages.length <= _arg1)))){
return (null);
};
return (m_arPages[_arg1]);
}
public function setPage(_arg1:int, _arg2:SharedLevelsPageProxy):Boolean{
if ((((_arg1 < 0)) || ((m_arPages.length <= _arg1)))){
return (false);
};
m_arPages[_arg1] = _arg2;
return (true);
}
public function get sort():int{
return (m_nSort);
}
}
}//package shared_levels.model
Section 334
//SharedObjectProxy (shared_levels.model.SharedObjectProxy)
package shared_levels.model {
import org.puremvc.as3.interfaces.*;
import flash.net.*;
import org.puremvc.as3.patterns.proxy.*;
public class SharedObjectProxy extends Proxy implements IProxy {
private var m_soTarget:SharedObject;
private var m_soTargetData:Object;
private static const LEVELS_STATE:String = "levelsState";
private static const LAST_EMAIL:String = "lastEmail";
private static const USER_NAME:String = "userName";
public static const NAME:String = "SharedObjectProxy";
private static const LAST_LEVEL_NAME:String = "lastLevelName";
public function SharedObjectProxy(_arg1:SharedObject){
super(NAME, m_soTarget);
m_soTarget = _arg1;
if (m_soTarget != null){
m_soTargetData = m_soTarget.data;
};
}
public function getUserName():String{
if (m_soTargetData == null){
return (null);
};
return (m_soTargetData[USER_NAME]);
}
private function getLevelsStateSO():Object{
var _local1:SharedObject;
var _local2:Object;
_local1 = m_soTarget;
if (_local1 == null){
return (null);
};
_local2 = _local1.data;
if (_local2 == null){
return (null);
};
return ((_local2[LEVELS_STATE] as Object));
}
public function getLastLevelName():String{
if (m_soTargetData == null){
return (null);
};
return (m_soTargetData[LAST_LEVEL_NAME]);
}
public function setLastEmail(_arg1:String):Boolean{
if (m_soTargetData == null){
return (false);
};
m_soTargetData[LAST_EMAIL] = _arg1;
return (true);
}
public function setLevelState(_arg1:String, _arg2:int):Boolean{
var _local3:Object;
trace("X");
trace("SharedObjectProxy public function setLevelState(strUID:String, nState:int):void");
if (m_soTargetData == null){
return (false);
};
_local3 = m_soTargetData[LEVELS_STATE];
if (_local3 == null){
_local3 = new Object();
};
_local3[_arg1] = _arg2;
m_soTargetData[LEVELS_STATE] = _local3;
return (true);
}
public function setLastLevelName(_arg1:String):Boolean{
if (m_soTargetData == null){
return (false);
};
m_soTargetData[LAST_LEVEL_NAME] = _arg1;
return (true);
}
public function setUserName(_arg1:String):Boolean{
if (m_soTargetData == null){
return (false);
};
m_soTargetData[USER_NAME] = _arg1;
return (true);
}
public function getLevelState(_arg1:String):int{
var _local2:Object;
if (m_soTargetData == null){
return (SharedLevelProxy.PLAY_STATE_UNDEF);
};
_local2 = m_soTargetData[LEVELS_STATE];
if (_local2 == null){
return (SharedLevelProxy.PLAY_STATE_UNDEF);
};
return ((_local2[_arg1] as int));
}
private function setLevelsStateSO(_arg1:Object):Boolean{
var _local2:SharedObject;
var _local3:Object;
trace("X");
trace("SharedObjectProxy private function setLevelsStateSO(dic:Dictionary):Boolean");
_local2 = m_soTarget;
trace(("soSharedLevelsState=" + _local2));
if (_local2 == null){
return (false);
};
_local3 = _local2.data;
trace(("data=" + _local3));
if (_local3 == null){
return (false);
};
_local3[LEVELS_STATE] = _arg1;
trace(("data[LEVELS_STATE]=" + _local3[LEVELS_STATE]));
m_soTarget.flush();
return (true);
}
public function getLastEmail():String{
if (m_soTargetData == null){
return (null);
};
return (m_soTargetData[LAST_EMAIL]);
}
}
}//package shared_levels.model
Section 335
//UI_Last_Page (shared_levels.view.components.UI_Last_Page)
package shared_levels.view.components {
public class UI_Last_Page extends UI_Next_Page {
}
}//package shared_levels.view.components
Section 336
//UI_Levels_Table (shared_levels.view.components.UI_Levels_Table)
package shared_levels.view.components {
import flash.display.*;
import com.*;
public class UI_Levels_Table extends MovieClip {
private var m_arItems:Array;
private var m_uiTableItemPrev:UI_Table_Item;
public var bg_mc:MovieClip;
private static const BG_NAME:String = "bg_mc";
public function UI_Levels_Table(){
m_arItems = new Array();
super();
}
public function set active(_arg1:Boolean):void{
var _local2:UI_Table_Item;
for each (_local2 in m_arItems) {
if (_local2 != null){
_local2.active = _arg1;
};
};
}
public function addItem(_arg1:UI_Table_Item):void{
var _local2:int;
var _local3:int;
_local2 = 0;
if (m_uiTableItemPrev != null){
_local2 = (m_uiTableItemPrev.y + m_uiTableItemPrev.height);
};
addChild(_arg1);
_arg1.y = _local2;
m_arItems.push(_arg1);
m_uiTableItemPrev = _arg1;
_local3 = (_local2 / _arg1.height);
_arg1.itemIndex = _local3;
}
public function clear():void{
m_uiTableItemPrev = null;
m_arItems = new Array();
}
public function calcMaxElementCount():int{
var _local1:UI_Table_Item;
var _local2:int;
var _local3:MovieClip;
_local1 = new UI_Table_Item();
_local2 = _local1.bgHeight;
_local3 = (getChildByName(BG_NAME) as MovieClip);
if (_local3 != null){
return ((_local3.height / _local2));
};
return (CommonFunc.INT_UNDEF);
}
}
}//package shared_levels.view.components
Section 337
//UI_Levels_Tables (shared_levels.view.components.UI_Levels_Tables)
package shared_levels.view.components {
import flash.display.*;
import flash.events.*;
import com.*;
import flash.text.*;
import com.gamezhero.as3.remoting.*;
public class UI_Levels_Tables extends MovieClip {
public var prev_mc:UI_Next_Page;
public var headItem_rate_mc:UI_Table_HeadItem_Rate;
private var m_bActive:Boolean;
public var next_mc:UI_Next_Page;
private var m_nCount:int;// = -1
public var loading_mc:UI_Loading;
public var first_mc:UI_Last_Page;
public var table_mc:UI_Levels_Table;
public var headItem_date_mc:UI_Table_HeadItem_Date;
private var m_nCurrent:int;// = -1
public var page_txt:TextField;
public var last_mc:UI_Last_Page;
public static const ON_PREV_PAGE:String = "onPrevPage";
private static const NEXT_PAGE_NAME:String = "next_mc";
private static const PAGE_STATUS_NAME:String = "page_txt";
public static const ON_REQUEST_RECENT:String = "onRequestRecent";
private static const FIRST_PAGE_NAME:String = "first_mc";
private static const LOADING_NAME:String = "loading_mc";
private static const LAST_PAGE_NAME:String = "last_mc";
public static const ON_REQUEST_BEST:String = "onRequestBest";
private static const HEADITEM_RECENT_NAME:String = "headItem_date_mc";
private static const PREV_PAGE_NAME:String = "prev_mc";
public static const ON_LAST_PAGE:String = "onLastPage";
private static const HEADITEM_BEST_NAME:String = "headItem_rate_mc";
public static const ON_NEXT_PAGE:String = "onNextPage";
public static const TABLE_NAME:String = "table_mc";
public static const ON_FIRST_PAGE:String = "onFirstPage";
public function UI_Levels_Tables(){
var _local1:UI_Table_HeadItem;
var _local2:UI_Next_Page;
var _local3:UI_Last_Page;
var _local4:UI_Next_Page;
var _local5:UI_Last_Page;
m_nCount = CommonFunc.INT_UNDEF;
m_nCurrent = CommonFunc.INT_UNDEF;
super();
active = true;
_local1 = (getChildByName(HEADITEM_BEST_NAME) as UI_Table_HeadItem);
if (_local1 != null){
_local1.addEventListener(UI_Table_HeadItem.ON_CLICK, listenOnBest, false, 0, true);
};
_local1 = (getChildByName(HEADITEM_RECENT_NAME) as UI_Table_HeadItem);
if (_local1 != null){
_local1.addEventListener(UI_Table_HeadItem.ON_CLICK, listenOnRecent, false, 0, true);
};
_local2 = (getChildByName(NEXT_PAGE_NAME) as UI_Next_Page);
_local3 = (getChildByName(LAST_PAGE_NAME) as UI_Last_Page);
_local4 = (getChildByName(PREV_PAGE_NAME) as UI_Next_Page);
_local5 = (getChildByName(FIRST_PAGE_NAME) as UI_Last_Page);
if (_local2 != null){
_local2.addEventListener(UI_Next_Page.ON_CLICK, listenOnNextPage, false, 0, true);
};
if (_local3 != null){
_local3.addEventListener(UI_Next_Page.ON_CLICK, listenOnLastPage, false, 0, true);
};
if (_local4 != null){
_local4.addEventListener(UI_Next_Page.ON_CLICK, listenOnPrevPage, false, 0, true);
};
if (_local5 != null){
_local5.addEventListener(UI_Next_Page.ON_CLICK, listenOnFirstPage, false, 0, true);
};
}
private function listenOnFirstPage(_arg1:Event):void{
dispatchEvent(new Event(ON_FIRST_PAGE));
}
private function listenOnRecent(_arg1:Event):void{
dispatchEvent(new Event(ON_REQUEST_RECENT));
}
public function set active(_arg1:Boolean):void{
var _local2:UI_Table_HeadItem;
var _local3:UI_Next_Page;
var _local4:UI_Last_Page;
var _local5:UI_Next_Page;
var _local6:UI_Last_Page;
var _local7:UI_Levels_Table;
m_bActive = _arg1;
_local2 = (getChildByName(HEADITEM_BEST_NAME) as UI_Table_HeadItem);
if (_local2 != null){
_local2.active = _arg1;
};
_local2 = (getChildByName(HEADITEM_RECENT_NAME) as UI_Table_HeadItem);
if (_local2 != null){
_local2.active = _arg1;
};
_local3 = (getChildByName(NEXT_PAGE_NAME) as UI_Next_Page);
_local4 = (getChildByName(LAST_PAGE_NAME) as UI_Last_Page);
_local5 = (getChildByName(PREV_PAGE_NAME) as UI_Next_Page);
_local6 = (getChildByName(FIRST_PAGE_NAME) as UI_Last_Page);
if (_local3 != null){
_local3.active = ((_arg1) && ((m_nCurrent < (m_nCount - 1))));
};
if (_local4 != null){
_local4.active = ((_arg1) && ((m_nCurrent < (m_nCount - 1))));
};
if (_local5 != null){
_local5.active = ((_arg1) && ((m_nCurrent > 0)));
};
if (_local6 != null){
_local6.active = ((_arg1) && ((m_nCurrent > 0)));
};
_local7 = (getChildByName(TABLE_NAME) as UI_Levels_Table);
if (_local7 != null){
_local7.active = m_bActive;
};
}
public function set cancel(_arg1:Boolean):void{
var _local2:UI_Loading;
_local2 = (getChildByName(LOADING_NAME) as UI_Loading);
if (_local2 != null){
_local2.cancel = _arg1;
};
}
public function set sort(_arg1:int):void{
var _local2:UI_Table_HeadItem;
var _local3:UI_Table_HeadItem;
_local2 = (getChildByName(HEADITEM_BEST_NAME) as UI_Table_HeadItem);
_local3 = (getChildByName(HEADITEM_RECENT_NAME) as UI_Table_HeadItem);
switch (_arg1){
case RemotingLevelsGateway.SORT_BY_DATE_DEC:
_local2.sort = UI_Table_HeadItem.SORT_UNDEF;
_local3.sort = UI_Table_HeadItem.SORT_DEC;
break;
case RemotingLevelsGateway.SORT_BY_RATE_DEC:
_local2.sort = UI_Table_HeadItem.SORT_DEC;
_local3.sort = UI_Table_HeadItem.SORT_UNDEF;
break;
};
}
private function listenOnBest(_arg1:Event):void{
dispatchEvent(new Event(ON_REQUEST_BEST));
}
private function listenOnNextPage(_arg1:Event):void{
dispatchEvent(new Event(ON_NEXT_PAGE));
}
public function set currentPage(_arg1:int):void{
m_nCurrent = _arg1;
updatePageStatus();
}
private function updatePageStatus():void{
var _local1:TextField;
_local1 = (getChildByName(PAGE_STATUS_NAME) as TextField);
if (_local1 != null){
_local1.text = ((((m_nCurrent >= 0)) ? (m_nCurrent + 1).toString() : "-" + "/") + ((m_nCount > 0)) ? m_nCount.toString() : "-");
};
}
public function set loading(_arg1:Boolean):void{
var _local2:UI_Loading;
_local2 = (getChildByName(LOADING_NAME) as UI_Loading);
if (_local2 != null){
_local2.loading = _arg1;
};
}
private function listenOnLastPage(_arg1:Event):void{
dispatchEvent(new Event(ON_LAST_PAGE));
}
public function set lastPage(_arg1:Boolean):void{
var _local2:UI_Next_Page;
var _local3:UI_Last_Page;
_local2 = (getChildByName(NEXT_PAGE_NAME) as UI_Next_Page);
if (_local2 != null){
_local2.active = ((!(_arg1)) && (m_bActive));
};
_local3 = (getChildByName(LAST_PAGE_NAME) as UI_Last_Page);
if (_local3 != null){
_local3.active = ((!(_arg1)) && (m_bActive));
};
}
private function listenOnPrevPage(_arg1:Event):void{
dispatchEvent(new Event(ON_PREV_PAGE));
}
public function set pageCount(_arg1:int):void{
m_nCount = _arg1;
m_nCurrent = -1;
updatePageStatus();
}
public function set firstPage(_arg1:Boolean):void{
var _local2:UI_Next_Page;
var _local3:UI_Last_Page;
_local2 = (getChildByName(PREV_PAGE_NAME) as UI_Next_Page);
if (_local2 != null){
_local2.active = ((!(_arg1)) && (m_bActive));
};
_local3 = (getChildByName(FIRST_PAGE_NAME) as UI_Last_Page);
if (_local3 != null){
_local3.active = ((!(_arg1)) && (m_bActive));
};
}
public function set tryAgain(_arg1:Boolean):void{
var _local2:UI_Loading;
_local2 = (getChildByName(LOADING_NAME) as UI_Loading);
if (_local2 != null){
_local2.tryAgain = _arg1;
};
}
}
}//package shared_levels.view.components
Section 338
//UI_Loading (shared_levels.view.components.UI_Loading)
package shared_levels.view.components {
import flash.display.*;
import flash.events.*;
import main.*;
import fl.transitions.*;
import fl.motion.easing.*;
public class UI_Loading extends MovieClip {
public var cancel_btn:SimpleButton;
public var loaderline_mc:MovieClip;
private var m_tweenAlphaTryAgain:Tween;
public var tryAgain_btn:SimpleButton;
private var m_bTryAgain:Boolean;
private var m_tweenAlphaCancel:Tween;
private var m_bCancel:Boolean;
private var m_tweenAlphaLoading:Tween;
private var m_tweenAlpha:Tween;
public static const ON_CANCEL:String = "onCancel";
public static const ON_TRY_AGAIN:String = "onTryAgain";
private static const LOADER_LINE_NAME:String = "loaderline_mc";
private static const BEGUN_NAME:String = "begun";
private static const TRY_AGAIN_NAME:String = "tryAgain_btn";
private static const CANCEL_NAME:String = "cancel_btn";
public function UI_Loading(){
var _local1:MovieClip;
var _local2:SimpleButton;
var _local3:MovieClip;
stop();
super();
_local1 = (getChildByName(LOADER_LINE_NAME) as MovieClip);
if (_local1 != null){
_local3 = (_local1.getChildByName(BEGUN_NAME) as MovieClip);
if (_local3 != null){
_local3.x = 4;
};
};
tryAgain = false;
cancel = false;
_local2 = (getChildByName(TRY_AGAIN_NAME) as SimpleButton);
if (_local2 != null){
_local2.addEventListener(MouseEvent.CLICK, listenOnTryAgain, false, 0, true);
};
_local2 = (getChildByName(CANCEL_NAME) as SimpleButton);
if (_local2 != null){
_local2.addEventListener(MouseEvent.CLICK, listenOnCancel, false, 0, true);
};
}
public function set show(_arg1:Boolean):void{
if (m_tweenAlpha != null){
m_tweenAlpha.stop();
};
m_tweenAlpha = new Tween(this, "alpha", Elastic.easeInOut, alpha, (_arg1) ? 1 : 0, (_arg1) ? 0.5 : 1, true);
m_tweenAlpha.start();
}
public function set cancel(_arg1:Boolean):void{
var _local2:SimpleButton;
m_bCancel = _arg1;
_local2 = (getChildByName(CANCEL_NAME) as SimpleButton);
if (_local2 != null){
if (m_tweenAlphaCancel != null){
m_tweenAlphaCancel.stop();
};
m_tweenAlphaCancel = new Tween(_local2, "alpha", Elastic.easeInOut, _local2.alpha, (_arg1) ? 1 : 0, Global_Settings.FADE_DURATION, true);
m_tweenAlphaCancel.start();
};
}
private function listenOnCancel(_arg1:MouseEvent):void{
dispatchEvent(new Event(ON_CANCEL, true));
}
public function set loading(_arg1:Boolean):void{
var _local2:MovieClip;
var _local3:MovieClip;
_local2 = (getChildByName(LOADER_LINE_NAME) as MovieClip);
if (_local2 != null){
_local3 = (_local2.getChildByName(BEGUN_NAME) as MovieClip);
if (_local3 != null){
if (m_tweenAlphaLoading != null){
m_tweenAlphaLoading.stop();
};
m_tweenAlphaLoading = new Tween(_local3, "alpha", Elastic.easeInOut, _local3.alpha, (_arg1) ? 1 : 0, Global_Settings.FADE_DURATION, true);
m_tweenAlphaLoading.start();
};
if (_arg1){
show = true;
} else {
if (!((cancel) || (tryAgain))){
show = false;
};
};
};
}
public function get tryAgain():Boolean{
return (m_bTryAgain);
}
private function listenOnTryAgain(_arg1:MouseEvent):void{
trace("X");
trace("UI_Loading private function listenOnTryAgain(event:MouseEvent):void");
dispatchEvent(new Event(ON_TRY_AGAIN, true));
}
public function get cancel():Boolean{
return (m_bCancel);
}
public function set tryAgain(_arg1:Boolean):void{
var _local2:SimpleButton;
m_bTryAgain = _arg1;
_local2 = (getChildByName(TRY_AGAIN_NAME) as SimpleButton);
if (_local2 != null){
_local2.visible = _arg1;
if (m_tweenAlphaTryAgain != null){
m_tweenAlphaTryAgain.stop();
};
m_tweenAlphaTryAgain = new Tween(_local2, "alpha", Elastic.easeInOut, _local2.alpha, (_arg1) ? 1 : 0, Global_Settings.FADE_DURATION, true);
m_tweenAlphaTryAgain.start();
};
}
}
}//package shared_levels.view.components
Section 339
//UI_Next_Page (shared_levels.view.components.UI_Next_Page)
package shared_levels.view.components {
import flash.display.*;
import flash.events.*;
import classes.*;
public class UI_Next_Page extends MovieClip {
private var m_bActive:Boolean;
public static const STATE_INACTIVE:int = 3;
public static const STATE_OUT:int = 0;
public static const ON_CLICK:String = "onClick";
public static const STATE_OVER:int = 1;
public static const STATE_DOWN:int = 2;
public function UI_Next_Page(){
stop();
addEventListener(MouseEvent.MOUSE_UP, listenOnUp, false, 0, true);
addEventListener(MouseEvent.MOUSE_DOWN, listenOnDown, false, 0, true);
addEventListener(MouseEvent.ROLL_OUT, listenOnOut, false, 0, true);
addEventListener(MouseEvent.ROLL_OVER, listenOnOver, false, 0, true);
}
private function listenOnOver(_arg1:MouseEvent):void{
if (m_bActive){
state = STATE_OVER;
Global.sound_interface.playSound(null, "s_over", 0, 0);
};
}
public function set active(_arg1:Boolean):void{
m_bActive = _arg1;
if (m_bActive){
buttonMode = true;
useHandCursor = true;
if (hitTestPoint(mouseX, mouseY)){
state = STATE_OVER;
} else {
state = STATE_OUT;
};
} else {
state = STATE_INACTIVE;
buttonMode = false;
useHandCursor = false;
};
}
public function set state(_arg1:int):void{
switch (_arg1){
case STATE_OUT:
gotoAndStop("out");
break;
case STATE_OVER:
gotoAndStop("over");
break;
case STATE_DOWN:
gotoAndStop("down");
break;
case STATE_INACTIVE:
gotoAndStop("inactive");
break;
};
}
private function listenOnUp(_arg1:MouseEvent):void{
if (m_bActive){
state = STATE_OUT;
};
}
private function listenOnOut(_arg1:MouseEvent):void{
if (m_bActive){
state = STATE_OUT;
};
}
private function listenOnDown(_arg1:MouseEvent):void{
if (m_bActive){
state = STATE_DOWN;
Global.sound_interface.playSound(null, "s_click", 0, 0);
dispatchEvent(new Event(ON_CLICK));
};
}
}
}//package shared_levels.view.components
Section 340
//UI_Rate (shared_levels.view.components.UI_Rate)
package shared_levels.view.components {
import flash.display.*;
import flash.events.*;
import com.*;
import fl.transitions.*;
public class UI_Rate extends MovieClip {
public var star_1_mc:UI_Star;
private var m_bActive:Boolean;
public var star_4_mc:UI_Star;
private var m_tweenX:Tween;
public var rate_line_mc:MovieClip;
public var star_2_mc:UI_Star;
public var star_5_mc:UI_Star;
private var m_arStars:Array;
public var star_3_mc:UI_Star;
private static const STAR_4_NAME:String = "star_4_mc";
private static const STAR_2_NAME:String = "star_2_mc";
private static const ACTIVE_ALPHA:Number = 1;
private static const RATE_LINE_NAME:String = "rate_line_mc";
private static const IN_ACTIVE_ALPHA:Number = 0.5;
private static const STAR_3_NAME:String = "star_3_mc";
private static const STAR_1_NAME:String = "star_1_mc";
private static const STAR_5_NAME:String = "star_5_mc";
public static const ON_RATE_0:String = "onRate0";
public static const ON_RATE_1:String = "onRate1";
public static const ON_RATE_2:String = "onRate2";
public static const ON_RATE_3:String = "onRate3";
public static const ON_RATE_4:String = "onRate4";
public static const ON_RATE_5:String = "onRate5";
public function UI_Rate(){
var _local1:int;
m_arStars = new Array();
super();
_local1 = 1;
var _temp1 = _local1;
_local1 = (_local1 + 1);
setupStar(STAR_1_NAME, _temp1);
var _temp2 = _local1;
_local1 = (_local1 + 1);
setupStar(STAR_2_NAME, _temp2);
var _temp3 = _local1;
_local1 = (_local1 + 1);
setupStar(STAR_3_NAME, _temp3);
var _temp4 = _local1;
_local1 = (_local1 + 1);
setupStar(STAR_4_NAME, _temp4);
var _temp5 = _local1;
_local1 = (_local1 + 1);
setupStar(STAR_5_NAME, _temp5);
active = false;
}
public function set active(_arg1:Boolean):void{
var _local2:UI_Star;
m_bActive = _arg1;
for each (_local2 in m_arStars) {
if (_local2 != null){
_local2.active = _arg1;
};
};
}
private function setupStar(_arg1:String, _arg2:int):Boolean{
var _local3:UI_Star;
_local3 = (getChildByName(_arg1) as UI_Star);
if (_local3 != null){
_local3.starIndex = _arg2;
_local3.addEventListener(MouseEvent.MOUSE_DOWN, listenOnStarClick, false, 0, true);
_local3.addEventListener(MouseEvent.MOUSE_OUT, listenOnStarOut, false, 0, true);
_local3.addEventListener(MouseEvent.MOUSE_OVER, listenOnStarOver, false, 0, true);
m_arStars.push(_local3);
return (true);
};
return (false);
}
private function listenOnStarOver(_arg1:MouseEvent):void{
var _local2:UI_Star;
var _local3:int;
if (m_bActive){
_local2 = (_arg1.target as UI_Star);
if (_local2 != null){
_local3 = (_local2.starIndex - 1);
while (--_local3 >= 0) {
_local2 = m_arStars[_local3];
_local2.onNextStarOver();
};
};
};
}
private function listenOnStarOut(_arg1:MouseEvent):void{
var _local2:UI_Star;
var _local3:int;
if (m_bActive){
_local2 = (_arg1.target as UI_Star);
if (_local2 != null){
_local3 = (_local2.starIndex - 1);
while (--_local3 >= 0) {
_local2 = m_arStars[_local3];
_local2.onNextStarOut();
};
};
};
}
public function set value(_arg1:Number):void{
var _local2:MovieClip;
_local2 = (getChildByName(RATE_LINE_NAME) as MovieClip);
if (_arg1 < 0){
_arg1 = 0;
};
if (_arg1 > 5){
_arg1 = 5;
};
_arg1 = (_arg1 / 5);
if (_local2 != null){
if (m_tweenX != null){
m_tweenX.stop();
};
m_tweenX = new Tween(_local2, "x", CommonFunc.cubicEaseInOut, _local2.x, (((_arg1 - 1) * _local2.width) / 2), 1, true);
m_tweenX.start();
};
}
private function listenOnStarClick(_arg1:MouseEvent):void{
var _local2:UI_Star;
if (m_bActive){
_local2 = (_arg1.target as UI_Star);
if (_local2 != null){
switch (_local2.starIndex){
case 0:
dispatchEvent(new Event(ON_RATE_0, true));
break;
case 1:
dispatchEvent(new Event(ON_RATE_1, true));
break;
case 2:
dispatchEvent(new Event(ON_RATE_2, true));
break;
case 3:
dispatchEvent(new Event(ON_RATE_3, true));
break;
case 4:
dispatchEvent(new Event(ON_RATE_4, true));
break;
case 5:
dispatchEvent(new Event(ON_RATE_5, true));
break;
};
};
};
}
}
}//package shared_levels.view.components
Section 341
//UI_SharedLevels (shared_levels.view.components.UI_SharedLevels)
package shared_levels.view.components {
import flash.display.*;
import flash.events.*;
import main.view.components.*;
public class UI_SharedLevels extends UI_Page {
public var playMoreGamesText_mc:playMoreGamesText;
public var menu_btn:SimpleButton;
public var levels_selector_holder_mc:MovieClip;
public var editorBtn:SimpleButton;
public var playMoreGamesBtn:SimpleButton;
public var editorText_mc:editorText;
public var menu_title_mc:menu_title;
public static const ON_PLAY_MORE_GAMES:String = "onPlayMoreGames";
public static const LEFT_INDENT:int = 8;
public static const ON_EXIT_SHARED_LEVELS:String = "onExitMap";
public static const ON_EDITOR:String = "onEditor";
public static const NAME:String = "UI_SharedLevels";
public static const TOP_INDENT:int = 8;
public function UI_SharedLevels(){
addBtn((getChildByName("menu_btn") as InteractiveObject), PageEvent.COM_TYPE_DISPATCH_EVENT, new Event(ON_EXIT_SHARED_LEVELS), (getChildByName("menu_title_mc") as MovieClip));
addBtn((getChildByName("editorBtn") as InteractiveObject), PageEvent.COM_TYPE_DISPATCH_EVENT, new Event(ON_EDITOR), (getChildByName("editorText_mc") as MovieClip));
addBtn((getChildByName("playMoreGamesBtn") as InteractiveObject), PageEvent.COM_TYPE_OPEN_URL, "play_more_games", (getChildByName("playMoreGamesText_mc") as MovieClip));
}
}
}//package shared_levels.view.components
Section 342
//UI_Star (shared_levels.view.components.UI_Star)
package shared_levels.view.components {
import flash.display.*;
import flash.events.*;
public class UI_Star extends MovieClip {
private var m_nStarIndex:int;
private var m_bActive:Boolean;
private static const STATE_OUT:int = 2;
private static const STATE_OVER:int = 1;
private static const GOTO_OVER:String = "over";
private static const STATE_INATIVE:int = 0;
private static const GOTO_INACTIVE:String = "out";
private static const STATE_DOWN:int = 3;
private static const GOTO_OUT:String = "out";
private static const GOTO_DOWN:String = "down";
public function UI_Star(){
stop();
addEventListener(MouseEvent.MOUSE_DOWN, listenOnStarClick, false, 0, true);
addEventListener(MouseEvent.MOUSE_OUT, listenOnStarOut, false, 0, true);
addEventListener(MouseEvent.MOUSE_OVER, listenOnStarOver, false, 0, true);
}
public function onNextStarOver():void{
state = STATE_OVER;
}
public function set active(_arg1:Boolean):void{
m_bActive = _arg1;
if (!m_bActive){
state = STATE_INATIVE;
};
}
private function set state(_arg1:int):void{
switch (_arg1){
case STATE_INATIVE:
gotoAndStop(GOTO_INACTIVE);
break;
case STATE_OVER:
gotoAndStop(GOTO_OVER);
break;
case STATE_OUT:
gotoAndStop(GOTO_OUT);
break;
case GOTO_DOWN:
gotoAndStop(GOTO_DOWN);
break;
};
}
public function set starIndex(_arg1:int):void{
m_nStarIndex = _arg1;
}
private function listenOnStarOver(_arg1:MouseEvent):void{
if (m_bActive){
state = STATE_OVER;
};
}
public function get starIndex():int{
return (m_nStarIndex);
}
private function listenOnStarOut(_arg1:MouseEvent):void{
if (m_bActive){
state = STATE_OUT;
};
}
public function onNextStarOut():void{
state = STATE_OUT;
}
private function listenOnStarClick(_arg1:MouseEvent):void{
if (m_bActive){
state = STATE_DOWN;
};
}
}
}//package shared_levels.view.components
Section 343
//UI_Table_HeadItem (shared_levels.view.components.UI_Table_HeadItem)
package shared_levels.view.components {
import flash.display.*;
import flash.events.*;
import com.*;
import fl.transitions.*;
import flash.geom.*;
import classes.*;
public class UI_Table_HeadItem extends MovieClip {
private var m_bActive:Boolean;// = true
private var m_tweenAlpha:Tween;
private var m_nSort:int;// = -1
public static const SORT_DEC:int = (SORT_UNDEF + 2);
private static const STATE_SORT_ASC_DOWN:int = 5;
private static const STATE_SORT_DEC_OVER:int = 7;
protected static const BG_NAME:String = "bg_mc";
public static const ON_CLICK:String = "onClick";
public static const SORT_UNDEF:int = -1;
private static const STATE_SORT_OFF_DOWN:int = 2;
protected static const ICON_NAME:String = "sort_mc";
private static const STATE_SORT_DEC_DOWN:int = 8;
private static const STATE_SORT_OFF_OUT:int = 0;
private static const STATE_SORT_ASC_OUT:int = 3;
public static const SORT_ASC:int = (SORT_UNDEF + 1);
private static const STATE_SORT_ASC_OVER:int = 4;
private static const STATE_SORT_OFF_OVER:int = 1;
private static const STATE_SORT_DEC_OUT:int = 6;
public function UI_Table_HeadItem(){
m_nSort = SORT_UNDEF;
m_bActive = true;
super();
useHandCursor = true;
addEventListener(MouseEvent.MOUSE_DOWN, listenOnDown, false, 0, true);
addEventListener(MouseEvent.ROLL_OUT, listenOnOut, false, 0, true);
addEventListener(MouseEvent.ROLL_OVER, listenOnOver, false, 0, true);
addEventListener(MouseEvent.MOUSE_UP, listenOnUp, false, 0, true);
}
private function listenOnOver(_arg1:MouseEvent):void{
if (m_bActive){
switch (m_nSort){
case SORT_ASC:
break;
case SORT_DEC:
break;
default:
state = STATE_SORT_OFF_OVER;
Global.sound_interface.playSound(null, "s_over", 0, 0);
break;
};
};
}
public function set active(_arg1:Boolean):void{
m_bActive = _arg1;
if (m_tweenAlpha != null){
m_tweenAlpha.stop();
};
m_tweenAlpha = new Tween(this, "alpha", CommonFunc.cubicEaseInOut, alpha, (m_bActive) ? 1 : 0.5, 0.5, true);
m_tweenAlpha.start();
if (m_nSort == SORT_UNDEF){
buttonMode = m_bActive;
useHandCursor = m_bActive;
};
}
private function set state(_arg1:int):void{
var _local2:UI_Table_HeadItem_SortIcon;
var _local3:UI_Table_HeadItem_BG;
_local2 = (getChildByName(ICON_NAME) as UI_Table_HeadItem_SortIcon);
_local3 = (getChildByName(BG_NAME) as UI_Table_HeadItem_BG);
switch (_arg1){
case STATE_SORT_OFF_OUT:
if (_local2 != null){
_local2.state = UI_Table_HeadItem_SortIcon.SORT_UNDEF;
};
if (_local3 != null){
_local3.state = UI_Table_HeadItem_BG.STATE_INACTIVE_OUT;
};
break;
case STATE_SORT_OFF_OVER:
if (_local2 != null){
_local2.state = UI_Table_HeadItem_SortIcon.SORT_UNDEF;
};
if (_local3 != null){
_local3.state = UI_Table_HeadItem_BG.STATE_INACTIVE_OVER;
};
break;
case STATE_SORT_OFF_DOWN:
if (_local2 != null){
_local2.state = UI_Table_HeadItem_SortIcon.SORT_UNDEF;
};
if (_local3 != null){
_local3.state = UI_Table_HeadItem_BG.STATE_INACTIVE_DOWN;
};
break;
case STATE_SORT_ASC_OUT:
if (_local2 != null){
_local2.state = UI_Table_HeadItem_SortIcon.SORT_ASC_OUT;
};
if (_local3 != null){
_local3.state = UI_Table_HeadItem_BG.STATE_ACTIVE_OUT;
};
break;
case STATE_SORT_ASC_OVER:
if (_local2 != null){
_local2.state = UI_Table_HeadItem_SortIcon.SORT_ASC_OVER;
};
if (_local3 != null){
_local3.state = UI_Table_HeadItem_BG.STATE_ACTIVE_OVER;
};
break;
case STATE_SORT_ASC_DOWN:
if (_local2 != null){
_local2.state = UI_Table_HeadItem_SortIcon.SORT_ASC_DOWN;
};
if (_local3 != null){
_local3.state = UI_Table_HeadItem_BG.STATE_ACTIVE_DOWN;
};
break;
case STATE_SORT_DEC_OUT:
if (_local2 != null){
_local2.state = UI_Table_HeadItem_SortIcon.SORT_DEC_OUT;
};
if (_local3 != null){
_local3.state = UI_Table_HeadItem_BG.STATE_ACTIVE_OUT;
};
break;
case STATE_SORT_DEC_OVER:
if (_local2 != null){
_local2.state = UI_Table_HeadItem_SortIcon.SORT_DEC_OVER;
};
if (_local3 != null){
_local3.state = UI_Table_HeadItem_BG.STATE_ACTIVE_OVER;
};
break;
case STATE_SORT_DEC_DOWN:
if (_local2 != null){
_local2.state = UI_Table_HeadItem_SortIcon.SORT_DEC_DOWN;
};
if (_local3 != null){
_local3.state = UI_Table_HeadItem_BG.STATE_ACTIVE_DOWN;
};
break;
};
}
public function set sort(_arg1:int):void{
var _local2:Boolean;
if (_arg1 != m_nSort){
m_nSort = _arg1;
_local2 = hitTestPoint(mouseX, mouseY);
switch (m_nSort){
case SORT_UNDEF:
state = (_local2) ? STATE_SORT_OFF_OVER : STATE_SORT_OFF_OUT;
buttonMode = m_bActive;
useHandCursor = m_bActive;
break;
case SORT_ASC:
state = (_local2) ? STATE_SORT_ASC_OVER : STATE_SORT_ASC_OUT;
buttonMode = false;
useHandCursor = false;
break;
case SORT_DEC:
state = (_local2) ? STATE_SORT_DEC_OVER : STATE_SORT_DEC_OUT;
buttonMode = false;
useHandCursor = false;
break;
};
};
}
private function listenOnUp(_arg1:MouseEvent):void{
var _local2:Point;
var _local3:Boolean;
if (m_bActive){
_local2 = localToGlobal(new Point(mouseX, mouseY));
_local3 = hitTestPoint(_local2.x, _local2.y);
switch (m_nSort){
case SORT_ASC:
break;
case SORT_DEC:
break;
default:
state = (_local3) ? STATE_SORT_OFF_OVER : STATE_SORT_OFF_OUT;
break;
};
};
}
private function listenOnOut(_arg1:MouseEvent):void{
if (m_bActive){
switch (m_nSort){
case SORT_ASC:
break;
case SORT_DEC:
break;
default:
state = STATE_SORT_OFF_OUT;
break;
};
};
}
private function listenOnDown(_arg1:MouseEvent):void{
trace("X");
trace("UI_Table_HeadItem private function listenOnDown(event:MouseEvent):void");
trace(("m_bActive=" + m_bActive));
if (m_bActive){
dispatchEvent(new Event(ON_CLICK));
switch (m_nSort){
case SORT_ASC:
break;
case SORT_DEC:
break;
default:
state = STATE_SORT_OFF_DOWN;
Global.sound_interface.playSound(null, "s_click", 0, 0);
break;
};
};
}
}
}//package shared_levels.view.components
Section 344
//UI_Table_HeadItem_BG (shared_levels.view.components.UI_Table_HeadItem_BG)
package shared_levels.view.components {
import flash.display.*;
public class UI_Table_HeadItem_BG extends MovieClip {
public static const STATE_ACTIVE_OUT:int = 3;
public static const STATE_INACTIVE_OUT:int = 0;
public static const STATE_ACTIVE_DOWN:int = 5;
public static const STATE_INACTIVE_DOWN:int = 2;
public static const STATE_INACTIVE_OVER:int = 1;
public static const STATE_ACTIVE_OVER:int = 4;
public function UI_Table_HeadItem_BG(){
stop();
}
public function set state(_arg1:int):void{
switch (_arg1){
case STATE_INACTIVE_OUT:
gotoAndStop("inactive_out");
break;
case STATE_INACTIVE_OVER:
gotoAndStop("inactive_over");
break;
case STATE_INACTIVE_DOWN:
gotoAndStop("inactive_down");
break;
case STATE_ACTIVE_OUT:
gotoAndStop("active_out");
break;
case STATE_ACTIVE_OVER:
gotoAndStop("active_over");
break;
case STATE_ACTIVE_DOWN:
gotoAndStop("active_down");
break;
};
}
}
}//package shared_levels.view.components
Section 345
//UI_Table_HeadItem_Date (shared_levels.view.components.UI_Table_HeadItem_Date)
package shared_levels.view.components {
public class UI_Table_HeadItem_Date extends UI_Table_HeadItem {
public var bg_mc:UI_Table_HeadItem_Date_BG;
}
}//package shared_levels.view.components
Section 346
//UI_Table_HeadItem_Date_BG (shared_levels.view.components.UI_Table_HeadItem_Date_BG)
package shared_levels.view.components {
public class UI_Table_HeadItem_Date_BG extends UI_Table_HeadItem_BG {
}
}//package shared_levels.view.components
Section 347
//UI_Table_HeadItem_Rate (shared_levels.view.components.UI_Table_HeadItem_Rate)
package shared_levels.view.components {
public class UI_Table_HeadItem_Rate extends UI_Table_HeadItem {
public var bg_mc:UI_Table_HeadItem_Rate_BG;
}
}//package shared_levels.view.components
Section 348
//UI_Table_HeadItem_Rate_BG (shared_levels.view.components.UI_Table_HeadItem_Rate_BG)
package shared_levels.view.components {
public class UI_Table_HeadItem_Rate_BG extends UI_Table_HeadItem_BG {
}
}//package shared_levels.view.components
Section 349
//UI_Table_HeadItem_SortIcon (shared_levels.view.components.UI_Table_HeadItem_SortIcon)
package shared_levels.view.components {
import flash.display.*;
public class UI_Table_HeadItem_SortIcon extends MovieClip {
public static const SORT_ASC_OVER:int = 2;
public static const SORT_DEC_DOWN:int = 6;
public static const SORT_UNDEF:int = -1;
public static const SORT_DEC_OUT:int = 4;
public static const SORT_ASC_DOWN:int = 3;
public static const SORT_DEC_OVER:int = 5;
public static const SORT_ASC_OUT:int = 1;
public function UI_Table_HeadItem_SortIcon(){
stop();
}
public function set state(_arg1:int):void{
switch (_arg1){
case SORT_ASC_DOWN:
gotoAndStop("down_over");
break;
case SORT_ASC_OUT:
gotoAndStop("down_out");
break;
case SORT_ASC_OVER:
gotoAndStop("down_over");
break;
case SORT_DEC_DOWN:
gotoAndStop("up_over");
break;
case SORT_DEC_OUT:
gotoAndStop("up_out");
break;
case SORT_DEC_OVER:
gotoAndStop("up_over");
break;
case SORT_UNDEF:
gotoAndStop("hide");
break;
};
}
}
}//package shared_levels.view.components
Section 350
//UI_Table_Item (shared_levels.view.components.UI_Table_Item)
package shared_levels.view.components {
import flash.display.*;
import flash.events.*;
import com.*;
import shared_levels.model.*;
import fl.transitions.*;
import flash.text.*;
import flash.geom.*;
import classes.*;
public class UI_Table_Item extends MovieClip {
private var m_bActive:Boolean;
public var date_txt:TextField;
private var m_tweenX:Tween;
public var rate_mc:UI_Rate;
private var m_nMouseState:int;
private var m_strID:String;
public var name_txt:TextField;
private var m_tweenAlpha:Tween;
public var bg_mc:UI_Table_Item_BG;
public var author_txt:TextField;
private var m_nState:int;
private static const BG_NAME:String = "bg_mc";
public static const MOUSE_STATE_OUT:int = 0;
public static const ON_ITEN_SELECT:String = "onItemSelect";
private static const RATE_NAME:String = "rate_mc";
private static const DATE_TXT_NAME:String = "date_txt";
private static const NAME_TXT_NAME:String = "name_txt";
private static const SPEED_COEF:Number = 6;
public static const MOUSE_STATE_DOWN:int = 2;
private static const AUTHOR_TXT_NAME:String = "author_txt";
public static const MOUSE_STATE_OVER:int = 1;
public function UI_Table_Item(){
var _local1:TextField;
super();
addEventListener(MouseEvent.MOUSE_DOWN, listenOnDown, false, 0, true);
addEventListener(MouseEvent.MOUSE_OUT, listenOnOut, false, 0, true);
addEventListener(MouseEvent.MOUSE_OVER, listenOnOver, false, 0, true);
addEventListener(MouseEvent.MOUSE_UP, listenOnUp, false, 0, true);
buttonMode = true;
useHandCursor = true;
_local1 = (getChildByName(NAME_TXT_NAME) as TextField);
if (_local1 != null){
_local1.mouseEnabled = false;
};
_local1 = (getChildByName(AUTHOR_TXT_NAME) as TextField);
if (_local1 != null){
_local1.mouseEnabled = false;
};
_local1 = (getChildByName(DATE_TXT_NAME) as TextField);
if (_local1 != null){
_local1.mouseEnabled = false;
};
m_bActive = true;
alpha = 0;
}
private function listenOnOver(_arg1:MouseEvent):void{
if (m_bActive){
mouseState = MOUSE_STATE_OVER;
Global.sound_interface.playSound(null, "s_over", 0, 0);
};
}
private function set mouseState(_arg1:int):void{
m_nMouseState = _arg1;
updateView();
}
public function set itemIndex(_arg1:int):void{
if (m_tweenAlpha != null){
m_tweenAlpha.stop();
};
}
private function updateView():void{
var _local1:UI_Table_Item_BG;
_local1 = (getChildByName(BG_NAME) as UI_Table_Item_BG);
switch (m_nMouseState){
case MOUSE_STATE_DOWN:
switch (m_nState){
case SharedLevelProxy.PLAY_STATE_PLAYED_AND_NOT_WIN:
if (_local1 != null){
_local1.state = UI_Table_Item_BG.PLAYED_AND_NOT_WIN_DOWN;
};
break;
case SharedLevelProxy.PLAY_STATE_PLAYED_AND_WIN:
if (_local1 != null){
_local1.state = UI_Table_Item_BG.PLAYED_AND_WIN_DOWN;
};
break;
default:
if (_local1 != null){
_local1.state = UI_Table_Item_BG.NOT_PLAYED_DOWN;
};
break;
};
break;
case MOUSE_STATE_OUT:
switch (m_nState){
case SharedLevelProxy.PLAY_STATE_PLAYED_AND_NOT_WIN:
if (_local1 != null){
_local1.state = UI_Table_Item_BG.PLAYED_AND_NOT_WIN_OUT;
};
break;
case SharedLevelProxy.PLAY_STATE_PLAYED_AND_WIN:
if (_local1 != null){
_local1.state = UI_Table_Item_BG.PLAYED_AND_WIN_OUT;
};
break;
default:
if (_local1 != null){
_local1.state = UI_Table_Item_BG.NOT_PLAYED_OUT;
};
break;
};
break;
case MOUSE_STATE_OVER:
switch (m_nState){
case SharedLevelProxy.PLAY_STATE_PLAYED_AND_NOT_WIN:
if (_local1 != null){
_local1.state = UI_Table_Item_BG.PLAYED_AND_NOT_WIN_OVER;
};
break;
case SharedLevelProxy.PLAY_STATE_PLAYED_AND_WIN:
if (_local1 != null){
_local1.state = UI_Table_Item_BG.PLAYED_AND_WIN_OVER;
};
break;
default:
if (_local1 != null){
_local1.state = UI_Table_Item_BG.NOT_PLAYED_OVER;
};
break;
};
break;
};
}
public function set active(_arg1:Boolean):void{
m_bActive = _arg1;
if (m_tweenAlpha != null){
m_tweenAlpha.stop();
};
m_tweenAlpha = new Tween(this, "alpha", CommonFunc.cubicEaseInOut, alpha, (m_bActive) ? 1 : 0.5, 0.5, true);
m_tweenAlpha.start();
}
public function set itemId(_arg1:String):void{
m_strID = _arg1;
}
public function set state(_arg1:int):void{
m_nState = _arg1;
updateView();
}
public function set author(_arg1:String):void{
var _local2:TextField;
_local2 = (getChildByName(AUTHOR_TXT_NAME) as TextField);
if (_local2 != null){
_local2.text = ((_arg1 == null)) ? "" : _arg1;
};
}
private function listenOnUp(_arg1:MouseEvent):void{
var _local2:Point;
var _local3:Boolean;
_local2 = localToGlobal(new Point(mouseX, mouseY));
_local3 = hitTestPoint(_local2.x, _local2.y);
mouseState = (_local3) ? MOUSE_STATE_OVER : MOUSE_STATE_OUT;
}
public function removeFromStage():void{
if (parent != null){
parent.removeChild(this);
};
}
public function set levelName(_arg1:String):void{
var _local2:TextField;
_local2 = (getChildByName(NAME_TXT_NAME) as TextField);
if (_local2 != null){
_local2.text = ((_arg1 == null)) ? "" : _arg1;
};
}
private function listenOnOut(_arg1:MouseEvent):void{
if (m_bActive){
mouseState = MOUSE_STATE_OUT;
};
}
public function get itemId():String{
return (m_strID);
}
public function set levelDate(_arg1:String):void{
var _local2:TextField;
_local2 = (getChildByName(DATE_TXT_NAME) as TextField);
if (_local2 != null){
_local2.text = ((_arg1 == null)) ? "" : _arg1;
};
}
public function get bgHeight():int{
var _local1:UI_Table_Item_BG;
_local1 = (getChildByName(BG_NAME) as UI_Table_Item_BG);
if (_local1 != null){
return (_local1.height);
};
return (height);
}
public function set rate(_arg1:Number):void{
var _local2:UI_Rate;
_local2 = (getChildByName(RATE_NAME) as UI_Rate);
if (_local2 != null){
_local2.value = _arg1;
};
}
private function listenOnDown(_arg1:MouseEvent):void{
if (m_bActive){
mouseState = MOUSE_STATE_DOWN;
Global.sound_interface.playSound(null, "s_click", 0, 0);
dispatchEvent(new Event(ON_ITEN_SELECT, true));
};
}
}
}//package shared_levels.view.components
Section 351
//UI_Table_Item_BG (shared_levels.view.components.UI_Table_Item_BG)
package shared_levels.view.components {
import flash.display.*;
public class UI_Table_Item_BG extends MovieClip {
public static const PLAYED_AND_NOT_WIN_DOWN:int = 5;
public static const NOT_PLAYED_OUT:int = 7;
public static const NOT_PLAYED_DOWN:int = 8;
public static const PLAYED_AND_NOT_WIN_OUT:int = 4;
public static const NOT_PLAYED_OVER:int = 6;
public static const PLAYED_AND_WIN_OUT:int = 1;
public static const PLAYED_AND_WIN_DOWN:int = 2;
public static const PLAYED_AND_WIN_OVER:int = 0;
public static const PLAYED_AND_NOT_WIN_OVER:int = 3;
public function UI_Table_Item_BG(){
stop();
buttonMode = true;
useHandCursor = true;
}
public function set state(_arg1:int):void{
switch (_arg1){
case PLAYED_AND_WIN_OVER:
gotoAndStop("played_and_win_over");
break;
case PLAYED_AND_WIN_OUT:
gotoAndStop("played_and_win_out");
break;
case PLAYED_AND_WIN_DOWN:
gotoAndStop("played_and_win_press");
break;
case PLAYED_AND_NOT_WIN_OVER:
gotoAndStop("played_and_not_win_over");
break;
case PLAYED_AND_NOT_WIN_OUT:
gotoAndStop("played_and_not_win_out");
break;
case PLAYED_AND_NOT_WIN_DOWN:
gotoAndStop("played_and_not_win_press");
break;
case NOT_PLAYED_OVER:
gotoAndStop("not_played_over");
break;
case NOT_PLAYED_OUT:
gotoAndStop("not_played_out");
break;
case NOT_PLAYED_DOWN:
gotoAndStop("not_played_press");
break;
};
}
}
}//package shared_levels.view.components
Section 352
//LevelsTableMediator (shared_levels.view.LevelsTableMediator)
package shared_levels.view {
import flash.events.*;
import org.puremvc.as3.interfaces.*;
import shared_levels.model.*;
import main.*;
import shared_levels.view.components.*;
import org.puremvc.as3.patterns.mediator.*;
public class LevelsTableMediator extends Mediator implements IMediator {
private var m_pSharedLevels:SharedLevelsProxy;
private var m_arItems:Array;
public static const NAME:String = "LevelsTableMediator";
public function LevelsTableMediator(_arg1:Object){
m_arItems = new Array();
super(NAME, _arg1);
ui.addEventListener(UI_Table_Item.ON_ITEN_SELECT, listenOnItemSelect, false, 0, true);
m_pSharedLevels = (facade.retrieveProxy(SharedLevelsProxy.NAME) as SharedLevelsProxy);
}
public function calcMaxElementCount():int{
return (ui.calcMaxElementCount());
}
public function clear():void{
clearItems();
ui.clear();
}
private function listenOnItemSelect(_arg1:Event):void{
var _local2:UI_Table_Item;
trace(("event.target = " + _arg1.target));
_local2 = (_arg1.target as UI_Table_Item);
if (_local2 != null){
openLevel(_local2.itemId);
};
}
override public function listNotificationInterests():Array{
return ([ApplicationFacade.SL_RECEIVE_ERROR, ApplicationFacade.SL_RECEIVE_GET_PAGE_LIST, ApplicationFacade.SL_REQUEST_GET_PAGE_LIST, ApplicationFacade.SL_RECEIVE_GET_LEVEL]);
}
private function openLevel(_arg1:String):void{
if (m_pSharedLevels != null){
m_pSharedLevels.requestLevel(_arg1);
};
}
public function get ui():UI_Levels_Table{
return ((viewComponent as UI_Levels_Table));
}
private function onRequestPageList(_arg1:int):void{
clear();
}
override public function handleNotification(_arg1:INotification):void{
switch (_arg1.getName()){
case ApplicationFacade.SL_RECEIVE_ERROR:
break;
case ApplicationFacade.SL_RECEIVE_GET_PAGE_LIST:
trace("case ApplicationFacade.SL_RECEIVE_GET_PAGE_LIST:");
onReceivePageList((_arg1.getBody() as SharedLevelsPageProxy));
break;
case ApplicationFacade.SL_REQUEST_GET_PAGE_LIST:
trace("ApplicationFacade.SL_REQUEST_GET_PAGE_LIST");
onRequestPageList((_arg1.getBody() as int));
break;
case ApplicationFacade.SL_RECEIVE_GET_LEVEL:
break;
};
}
private function addItem(_arg1:SharedLevelProxy):Boolean{
var _local2:UI_Table_Item;
var _local3:LevelTableItemMediator;
if (_arg1 == null){
return (false);
};
_local2 = new UI_Table_Item();
ui.addItem(_local2);
_local3 = new LevelTableItemMediator(_arg1, _local2, m_arItems.length);
facade.registerMediator(_local3);
m_arItems.push(_local3);
return (true);
}
private function onReceivePageList(_arg1:SharedLevelsPageProxy):void{
var _local2:int;
var _local3:int;
clear();
if (_arg1 != null){
_local2 = _arg1.length;
_local3 = 0;
while (_local3 < _local2) {
addItem(_arg1.getLevel(_local3));
_local3++;
};
};
}
private function clearItems():void{
var _local1:LevelTableItemMediator;
if (m_arItems != null){
for each (_local1 in m_arItems) {
if (_local1 != null){
facade.removeMediator(_local1.getMediatorName());
};
};
};
m_arItems = new Array();
}
}
}//package shared_levels.view
Section 353
//LevelsTablesMediator (shared_levels.view.LevelsTablesMediator)
package shared_levels.view {
import flash.events.*;
import org.puremvc.as3.interfaces.*;
import shared_levels.model.*;
import main.*;
import shared_levels.view.components.*;
import com.gamezhero.as3.remoting.*;
import org.puremvc.as3.patterns.mediator.*;
public class LevelsTablesMediator extends Mediator implements IMediator {
private var m_mLevelsTable:LevelsTableMediator;
private var m_pSharedLevels:SharedLevelsProxy;
public static const NAME:String = "LevelsTablesMediator";
public function LevelsTablesMediator(_arg1:Object){
var _local2:UI_Levels_Table;
var _local3:int;
super(NAME, _arg1);
m_pSharedLevels = (facade.retrieveProxy(SharedLevelsProxy.NAME) as SharedLevelsProxy);
_local2 = (ui.getChildByName(UI_Levels_Tables.TABLE_NAME) as UI_Levels_Table);
if (_local2 == null){
_local2 = new UI_Levels_Table();
ui.addChild(_local2);
};
m_mLevelsTable = new LevelsTableMediator(_local2);
facade.registerMediator(m_mLevelsTable);
_local3 = m_mLevelsTable.calcMaxElementCount();
sendNotification(ApplicationFacade.CHANGE_SL_PER_PAGE_COUNT, _local3);
ui.addEventListener(UI_Levels_Tables.ON_FIRST_PAGE, listenOnFirstPage, false, 0, true);
ui.addEventListener(UI_Levels_Tables.ON_LAST_PAGE, listenOnLastPage, false, 0, true);
ui.addEventListener(UI_Levels_Tables.ON_NEXT_PAGE, listenOnNextPage, false, 0, true);
ui.addEventListener(UI_Levels_Tables.ON_PREV_PAGE, listenOnPrevPage, false, 0, true);
ui.addEventListener(UI_Levels_Tables.ON_REQUEST_BEST, listenOnBest, false, 0, true);
ui.addEventListener(UI_Levels_Tables.ON_REQUEST_RECENT, listenOnRecent, false, 0, true);
trace(("m_pSharedLevels.sort=" + m_pSharedLevels.sort));
ui.sort = m_pSharedLevels.sort;
ui.currentPage = m_pSharedLevels.currentPage;
ui.pageCount = m_pSharedLevels.pageCount;
ui.addEventListener(UI_Loading.ON_CANCEL, listenOnCancel, false, 0, true);
ui.addEventListener(UI_Loading.ON_TRY_AGAIN, listenOnTryAgain, false, 0, true);
}
override public function onRemove():void{
super.onRemove();
if (m_mLevelsTable != null){
facade.removeMediator(m_mLevelsTable.getMediatorName());
};
}
private function onGetPageCount(_arg1:int):void{
trace("X");
trace("LevelsTablesMediator private function onGetPageCount(nCount:int):void");
trace(("nCount=" + _arg1));
ui.pageCount = _arg1;
if (_arg1 > 0){
currentPage = m_pSharedLevels.currentPage;
};
}
public function set active(_arg1:Boolean):void{
ui.active = _arg1;
}
private function listenOnLastPage(_arg1:Event):void{
currentPage = (m_pSharedLevels.pageCount - 1);
}
private function listenOnRecent(_arg1:Event):void{
sort = RemotingLevelsGateway.SORT_BY_DATE_DEC;
}
private function listenOnBest(_arg1:Event):void{
sort = RemotingLevelsGateway.SORT_BY_RATE_DEC;
}
private function listenOnTryAgain(_arg1:Event):void{
sendNotification(ApplicationFacade.CHANGE_SL_CURRENT_PAGE, m_pSharedLevels.currentPage);
}
private function listenOnPrevPage(_arg1:Event):void{
currentPage = (m_pSharedLevels.currentPage - 1);
}
private function onReceive():void{
trace("X");
trace("LevelsTablesMediator private function onReceive():void");
ui.loading = false;
ui.active = true;
}
private function set currentPage(_arg1:int):void{
var _local2:Boolean;
var _local3:Boolean;
trace("X");
trace("LevelsTablesMediator private function set currentPage(nValue:int):void");
trace(("nValue=" + _arg1));
ui.currentPage = _arg1;
sendNotification(ApplicationFacade.CHANGE_SL_CURRENT_PAGE, _arg1);
_local2 = (_arg1 == 0);
_local3 = (_arg1 >= (m_pSharedLevels.pageCount - 1));
ui.firstPage = _local2;
ui.lastPage = _local3;
}
override public function listNotificationInterests():Array{
return ([ApplicationFacade.SL_RECEIVE_ERROR, ApplicationFacade.SL_RECEIVE_GET_LEVEL, ApplicationFacade.SL_RECEIVE_GET_PAGE_AMOUNT, ApplicationFacade.SL_RECEIVE_GET_PAGE_LIST, ApplicationFacade.SL_REQUEST_GET_LEVEL, ApplicationFacade.SL_REQUEST_GET_PAGE_AMOUNT, ApplicationFacade.SL_REQUEST_GET_PAGE_LIST]);
}
public function get ui():UI_Levels_Tables{
return ((viewComponent as UI_Levels_Tables));
}
private function listenOnNextPage(_arg1:Event):void{
currentPage = (m_pSharedLevels.currentPage + 1);
}
private function listenOnCancel(_arg1:Event):void{
}
override public function handleNotification(_arg1:INotification):void{
switch (_arg1.getName()){
case ApplicationFacade.SL_RECEIVE_ERROR:
trace("ApplicationFacade.SL_RECEIVE_ERROR");
onError();
break;
case ApplicationFacade.SL_RECEIVE_GET_LEVEL:
trace("ApplicationFacade.SL_RECEIVE_GET_LEVEL");
onReceive();
onReceiveLevel((_arg1.getBody() as SharedLevelProxy));
break;
case ApplicationFacade.SL_RECEIVE_GET_PAGE_AMOUNT:
trace("ApplicationFacade.SL_RECEIVE_GET_PAGE_AMOUNT");
onReceive();
onGetPageCount((_arg1.getBody() as int));
break;
case ApplicationFacade.SL_RECEIVE_GET_PAGE_LIST:
trace("ApplicationFacade.SL_RECEIVE_GET_PAGE_LIST");
onReceive();
break;
case ApplicationFacade.SL_REQUEST_GET_LEVEL:
trace("ApplicationFacade.SL_REQUEST_GET_LEVEL");
onRequest();
break;
case ApplicationFacade.SL_REQUEST_GET_PAGE_AMOUNT:
trace("ApplicationFacade.SL_REQUEST_GET_PAGE_AMOUNT");
onRequest();
break;
case ApplicationFacade.SL_REQUEST_GET_PAGE_LIST:
trace("ApplicationFacade.SL_REQUEST_GET_PAGE_LIST");
onRequest();
break;
};
}
private function set sort(_arg1:int):void{
sendNotification(ApplicationFacade.CHANGE_SL_SORT, _arg1);
ui.sort = _arg1;
}
private function onRequest():void{
trace("X");
trace("LevelsTablesMediator private function onRequest():void");
ui.tryAgain = false;
ui.loading = true;
ui.active = false;
}
private function onReceiveLevel(_arg1:SharedLevelProxy):void{
trace("X");
trace("LevelsTablesMediator private function onReceiveLevel(pSL:SharedLevelProxy):void");
trace(("pSL=" + _arg1));
if (_arg1 != null){
_arg1.rate = m_pSharedLevels.getLevelRateByUID(_arg1.id);
};
sendNotification(ApplicationFacade.PLAY_SHARED_LEVEL, _arg1);
}
private function listenOnFirstPage(_arg1:Event):void{
currentPage = 0;
}
private function onError():void{
trace("X");
trace("LevelsTablesMediator private function onError():void");
ui.active = true;
ui.tryAgain = true;
ui.loading = false;
}
}
}//package shared_levels.view
Section 354
//LevelTableItemMediator (shared_levels.view.LevelTableItemMediator)
package shared_levels.view {
import org.puremvc.as3.interfaces.*;
import shared_levels.model.*;
import shared_levels.view.components.*;
import org.puremvc.as3.patterns.mediator.*;
public class LevelTableItemMediator extends Mediator implements IMediator {
public static const NAME:String = "LevelTableItemMediator";
public function LevelTableItemMediator(_arg1:SharedLevelProxy, _arg2:Object, _arg3:int){
super(((NAME + "_") + _arg3), _arg2);
if (_arg1 != null){
ui.author = _arg1.author;
ui.levelDate = _arg1.levelDate;
ui.levelName = _arg1.levelName;
ui.rate = _arg1.rate;
ui.itemId = _arg1.id;
ui.state = _arg1.state;
};
}
override public function onRemove():void{
super.onRemove();
if (ui != null){
ui.removeFromStage();
};
}
public function get ui():UI_Table_Item{
return ((viewComponent as UI_Table_Item));
}
}
}//package shared_levels.view
Section 355
//SharedLevelsMediator (shared_levels.view.SharedLevelsMediator)
package shared_levels.view {
import flash.display.*;
import flash.events.*;
import shared_levels.model.*;
import main.*;
import main.view.*;
import main.controller.*;
import shared_levels.view.components.*;
import main.model.*;
public class SharedLevelsMediator extends PageMediator {
private var m_mLevelsTable:LevelsTablesMediator;
private var m_pSharedLevels:SharedLevelsProxy;
public static const NAME:String = "SharedLevelsMediator";
private static const LEVELS_HOLDER_NAME:String = "levels_selector_holder_mc";
public function SharedLevelsMediator(_arg1:Object){
trace("X");
trace("CONSTRUCTOR public function SharedLevelsMediator(viewComponent:Object ) ");
super(_arg1);
init();
ui.addEventListener(UI_SharedLevels.ON_EXIT_SHARED_LEVELS, listenOnExitMenu, false, 0, true);
ui.addEventListener(UI_SharedLevels.ON_EDITOR, listenOnEditor, false, 0, true);
}
override public function onRemove():void{
super.onRemove();
if (m_mLevelsTable != null){
facade.removeMediator(m_mLevelsTable.getMediatorName());
};
}
private function set active(_arg1:Boolean):void{
m_mLevelsTable.active = _arg1;
}
function init():void{
var _local1:UI_SharedLevels;
var _local2:MovieClip;
var _local3:UI_Levels_Tables;
var _local4:MovieClip;
trace("*");
trace("MapMediator function init():void");
m_pSharedLevels = (facade.retrieveProxy(SharedLevelsProxy.NAME) as SharedLevelsProxy);
trace(("m_pSharedLevels=" + m_pSharedLevels));
if (m_pSharedLevels != null){
_local1 = ui;
trace(("uiMap=" + _local1));
if (_local1 != null){
_local2 = (_local1.getChildByName(LEVELS_HOLDER_NAME) as MovieClip);
trace(("uiLevelsHolder=" + _local2));
if (_local2 != null){
_local4 = (_local2.getChildByName("levels_bg_mc") as MovieClip);
if (_local4 != null){
_local3 = new UI_Levels_Tables();
} else {
_local3 = new UI_Levels_Tables();
};
_local2.addChild(_local3);
_local3.x = UI_SharedLevels.LEFT_INDENT;
_local3.y = UI_SharedLevels.TOP_INDENT;
m_mLevelsTable = new LevelsTablesMediator(_local3);
facade.registerMediator(m_mLevelsTable);
};
};
};
}
private function listenOnExitMenu(_arg1:Event):void{
sendNotification(ApplicationFacade.CHANGE_PAGE, new PageCommandStruct(PagesProxy.PAGE_MENU));
}
override public function inactivate(_arg1:Boolean=true):void{
super.inactivate(_arg1);
if (_arg1){
active = !(_arg1);
};
}
private function listenOnEditor(_arg1:Event):void{
sendNotification(ApplicationFacade.CHANGE_PAGE, new PageCommandStruct(PagesProxy.PAGE_EDITOR, null, null, m_pSharedLevels));
}
public function get ui():UI_SharedLevels{
return ((viewComponent as UI_SharedLevels));
}
}
}//package shared_levels.view
Section 356
//Btn_Show (Btn_Show)
package {
import com.*;
public dynamic class Btn_Show extends TSimpleCheckit {
}
}//package
Section 357
//Btn_Show_Elements (Btn_Show_Elements)
package {
import com.*;
public dynamic class Btn_Show_Elements extends TSimpleCheckit {
}
}//package
Section 358
//editorText (editorText)
package {
import com.*;
public dynamic class editorText extends TElementWithText {
public function editorText(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 359
//Floor_00 (Floor_00)
package {
import flash.display.*;
public dynamic class Floor_00 extends MovieClip {
}
}//package
Section 360
//Floor_01 (Floor_01)
package {
import flash.display.*;
public dynamic class Floor_01 extends MovieClip {
}
}//package
Section 361
//GameNameText (GameNameText)
package {
import com.*;
public dynamic class GameNameText extends TElementWithText {
}
}//package
Section 362
//GameOverCongratulation0015 (GameOverCongratulation0015)
package {
import com.*;
public dynamic class GameOverCongratulation0015 extends TElementWithText {
}
}//package
Section 363
//GameOverCongratulation0020 (GameOverCongratulation0020)
package {
import com.*;
public dynamic class GameOverCongratulation0020 extends TElementWithText {
}
}//package
Section 364
//gate_close (gate_close)
package {
import flash.media.*;
public dynamic class gate_close extends Sound {
}
}//package
Section 365
//gate_open (gate_open)
package {
import flash.media.*;
public dynamic class gate_open extends Sound {
}
}//package
Section 366
//Grass_00 (Grass_00)
package {
import flash.display.*;
public dynamic class Grass_00 extends MovieClip {
}
}//package
Section 367
//Icon_Bubble (Icon_Bubble)
package {
import flash.display.*;
public dynamic class Icon_Bubble extends MovieClip {
}
}//package
Section 368
//Icon_Character_Ghost (Icon_Character_Ghost)
package {
import flash.display.*;
public dynamic class Icon_Character_Ghost extends MovieClip {
}
}//package
Section 369
//Icon_Character_Hero (Icon_Character_Hero)
package {
import flash.display.*;
public dynamic class Icon_Character_Hero extends MovieClip {
}
}//package
Section 370
//Icon_Character_Knight (Icon_Character_Knight)
package {
import flash.display.*;
public dynamic class Icon_Character_Knight extends MovieClip {
}
}//package
Section 371
//Icon_Character_Madam (Icon_Character_Madam)
package {
import flash.display.*;
public dynamic class Icon_Character_Madam extends MovieClip {
}
}//package
Section 372
//Icon_Floor_Ground_Dark (Icon_Floor_Ground_Dark)
package {
import flash.display.*;
public dynamic class Icon_Floor_Ground_Dark extends MovieClip {
}
}//package
Section 373
//Icon_Floor_Ground_Light (Icon_Floor_Ground_Light)
package {
import flash.display.*;
public dynamic class Icon_Floor_Ground_Light extends MovieClip {
}
}//package
Section 374
//Icon_Floor_Tile_Dark (Icon_Floor_Tile_Dark)
package {
import flash.display.*;
public dynamic class Icon_Floor_Tile_Dark extends MovieClip {
}
}//package
Section 375
//Icon_Floor_Tile_Light (Icon_Floor_Tile_Light)
package {
import flash.display.*;
public dynamic class Icon_Floor_Tile_Light extends MovieClip {
}
}//package
Section 376
//Icon_Info_0 (Icon_Info_0)
package {
import flash.display.*;
public dynamic class Icon_Info_0 extends MovieClip {
}
}//package
Section 377
//Icon_Info_1 (Icon_Info_1)
package {
import flash.display.*;
public dynamic class Icon_Info_1 extends MovieClip {
}
}//package
Section 378
//Icon_Info_10 (Icon_Info_10)
package {
import flash.display.*;
public dynamic class Icon_Info_10 extends MovieClip {
}
}//package
Section 379
//Icon_Info_2 (Icon_Info_2)
package {
import flash.display.*;
public dynamic class Icon_Info_2 extends MovieClip {
}
}//package
Section 380
//Icon_Info_3 (Icon_Info_3)
package {
import flash.display.*;
public dynamic class Icon_Info_3 extends MovieClip {
}
}//package
Section 381
//Icon_Info_4 (Icon_Info_4)
package {
import flash.display.*;
public dynamic class Icon_Info_4 extends MovieClip {
}
}//package
Section 382
//Icon_Info_5 (Icon_Info_5)
package {
import flash.display.*;
public dynamic class Icon_Info_5 extends MovieClip {
}
}//package
Section 383
//Icon_Info_6 (Icon_Info_6)
package {
import flash.display.*;
public dynamic class Icon_Info_6 extends MovieClip {
}
}//package
Section 384
//Icon_Info_7 (Icon_Info_7)
package {
import flash.display.*;
public dynamic class Icon_Info_7 extends MovieClip {
}
}//package
Section 385
//Icon_Info_8 (Icon_Info_8)
package {
import flash.display.*;
public dynamic class Icon_Info_8 extends MovieClip {
}
}//package
Section 386
//Icon_Info_9 (Icon_Info_9)
package {
import flash.display.*;
public dynamic class Icon_Info_9 extends MovieClip {
}
}//package
Section 387
//Icon_Item_Box (Icon_Item_Box)
package {
import flash.display.*;
public dynamic class Icon_Item_Box extends MovieClip {
}
}//package
Section 388
//Icon_Item_Candlestick (Icon_Item_Candlestick)
package {
import flash.display.*;
public dynamic class Icon_Item_Candlestick extends MovieClip {
}
}//package
Section 389
//Icon_Item_Fire (Icon_Item_Fire)
package {
import flash.display.*;
public dynamic class Icon_Item_Fire extends MovieClip {
}
}//package
Section 390
//Icon_Item_Vase (Icon_Item_Vase)
package {
import flash.display.*;
public dynamic class Icon_Item_Vase extends MovieClip {
}
}//package
Section 391
//Icon_Labyrinth (Icon_Labyrinth)
package {
import flash.display.*;
public dynamic class Icon_Labyrinth extends MovieClip {
}
}//package
Section 392
//Icon_Labyrinth_Fence (Icon_Labyrinth_Fence)
package {
import flash.display.*;
public dynamic class Icon_Labyrinth_Fence extends MovieClip {
}
}//package
Section 393
//Icon_Labyrinth_Item_Ensign_Bow (Icon_Labyrinth_Item_Ensign_Bow)
package {
import flash.display.*;
public dynamic class Icon_Labyrinth_Item_Ensign_Bow extends MovieClip {
}
}//package
Section 394
//Icon_Labyrinth_Item_Ensign_Swords (Icon_Labyrinth_Item_Ensign_Swords)
package {
import flash.display.*;
public dynamic class Icon_Labyrinth_Item_Ensign_Swords extends MovieClip {
}
}//package
Section 395
//Icon_Labyrinth_Item_Ensign_Tower (Icon_Labyrinth_Item_Ensign_Tower)
package {
import flash.display.*;
public dynamic class Icon_Labyrinth_Item_Ensign_Tower extends MovieClip {
}
}//package
Section 396
//Icon_Labyrinth_Item_Horns (Icon_Labyrinth_Item_Horns)
package {
import flash.display.*;
public dynamic class Icon_Labyrinth_Item_Horns extends MovieClip {
}
}//package
Section 397
//Icon_Labyrinth_Item_Shield_Black_n_White (Icon_Labyrinth_Item_Shield_Black_n_White)
package {
import flash.display.*;
public dynamic class Icon_Labyrinth_Item_Shield_Black_n_White extends MovieClip {
}
}//package
Section 398
//Icon_Labyrinth_Item_Shield_Green (Icon_Labyrinth_Item_Shield_Green)
package {
import flash.display.*;
public dynamic class Icon_Labyrinth_Item_Shield_Green extends MovieClip {
}
}//package
Section 399
//Icon_Labyrinth_Item_Shield_Red (Icon_Labyrinth_Item_Shield_Red)
package {
import flash.display.*;
public dynamic class Icon_Labyrinth_Item_Shield_Red extends MovieClip {
}
}//package
Section 400
//Icon_Labyrinth_Item_Torch (Icon_Labyrinth_Item_Torch)
package {
import flash.display.*;
public dynamic class Icon_Labyrinth_Item_Torch extends MovieClip {
}
}//package
Section 401
//Icon_Raft (Icon_Raft)
package {
import flash.display.*;
public dynamic class Icon_Raft extends MovieClip {
}
}//package
Section 402
//Icon_Stairway_Left (Icon_Stairway_Left)
package {
import flash.display.*;
public dynamic class Icon_Stairway_Left extends MovieClip {
}
}//package
Section 403
//Icon_Stairway_Right (Icon_Stairway_Right)
package {
import flash.display.*;
public dynamic class Icon_Stairway_Right extends MovieClip {
}
}//package
Section 404
//Icon_Stairway_Up (Icon_Stairway_Up)
package {
import flash.display.*;
public dynamic class Icon_Stairway_Up extends MovieClip {
}
}//package
Section 405
//Icon_Trap_Key_Blue (Icon_Trap_Key_Blue)
package {
import flash.display.*;
public dynamic class Icon_Trap_Key_Blue extends MovieClip {
}
}//package
Section 406
//Icon_Trap_Key_Green (Icon_Trap_Key_Green)
package {
import flash.display.*;
public dynamic class Icon_Trap_Key_Green extends MovieClip {
}
}//package
Section 407
//Icon_Trap_Key_Red (Icon_Trap_Key_Red)
package {
import flash.display.*;
public dynamic class Icon_Trap_Key_Red extends MovieClip {
}
}//package
Section 408
//Icon_Trap_Sharp_Blue (Icon_Trap_Sharp_Blue)
package {
import flash.display.*;
public dynamic class Icon_Trap_Sharp_Blue extends MovieClip {
}
}//package
Section 409
//Icon_Trap_Sharp_Green (Icon_Trap_Sharp_Green)
package {
import flash.display.*;
public dynamic class Icon_Trap_Sharp_Green extends MovieClip {
}
}//package
Section 410
//Icon_Trap_Sharp_Red (Icon_Trap_Sharp_Red)
package {
import flash.display.*;
public dynamic class Icon_Trap_Sharp_Red extends MovieClip {
}
}//package
Section 411
//Icon_Water (Icon_Water)
package {
import flash.display.*;
public dynamic class Icon_Water extends MovieClip {
}
}//package
Section 412
//InstructionsHeader (InstructionsHeader)
package {
import com.*;
public dynamic class InstructionsHeader extends TElementWithText {
}
}//package
Section 413
//introText (introText)
package {
import com.*;
public dynamic class introText extends TElementWithText {
public function introText(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 414
//Item_Box (Item_Box)
package {
import flash.display.*;
public dynamic class Item_Box extends MovieClip {
}
}//package
Section 415
//Item_Vase (Item_Vase)
package {
import flash.display.*;
public dynamic class Item_Vase extends MovieClip {
}
}//package
Section 416
//menu_title (menu_title)
package {
import com.*;
public dynamic class menu_title extends TElementWithText {
public function menu_title(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 417
//music_game (music_game)
package {
import flash.media.*;
public dynamic class music_game extends Sound {
}
}//package
Section 418
//music_intro (music_intro)
package {
import flash.media.*;
public dynamic class music_intro extends Sound {
}
}//package
Section 419
//music_menu (music_menu)
package {
import flash.media.*;
public dynamic class music_menu extends Sound {
}
}//package
Section 420
//pauseText (pauseText)
package {
import com.*;
public dynamic class pauseText extends TElementWithText {
public function pauseText(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 421
//playGameText (playGameText)
package {
import com.*;
public dynamic class playGameText extends TElementWithText {
public function playGameText(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 422
//playMoreGamesText (playMoreGamesText)
package {
import com.*;
public dynamic class playMoreGamesText extends TElementWithText {
public function playMoreGamesText(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 423
//putThisGametext (putThisGametext)
package {
import com.*;
public dynamic class putThisGametext extends TElementWithText {
}
}//package
Section 424
//s_click (s_click)
package {
import flash.media.*;
public dynamic class s_click extends Sound {
}
}//package
Section 425
//s_over (s_over)
package {
import flash.media.*;
public dynamic class s_over extends Sound {
}
}//package
Section 426
//sendToFriendsText (sendToFriendsText)
package {
import com.*;
public dynamic class sendToFriendsText extends TElementWithText {
public function sendToFriendsText(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 427
//sharedLevelsText (sharedLevelsText)
package {
import com.*;
public dynamic class sharedLevelsText extends TElementWithText {
public function sharedLevelsText(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 428
//show_this_again (show_this_again)
package {
import main.view.components.*;
public dynamic class show_this_again extends UI_CheckitSimple {
}
}//package
Section 429
//skipBtnText (skipBtnText)
package {
import com.*;
public dynamic class skipBtnText extends TElementWithText {
}
}//package
Section 430
//sound_fight (sound_fight)
package {
import flash.media.*;
public dynamic class sound_fight extends Sound {
}
}//package
Section 431
//sound_ghost_breath (sound_ghost_breath)
package {
import flash.media.*;
public dynamic class sound_ghost_breath extends Sound {
}
}//package
Section 432
//sound_ghost_step (sound_ghost_step)
package {
import flash.media.*;
public dynamic class sound_ghost_step extends Sound {
}
}//package
Section 433
//sound_girl_cry (sound_girl_cry)
package {
import flash.media.*;
public dynamic class sound_girl_cry extends Sound {
}
}//package
Section 434
//sound_girl_in_raft (sound_girl_in_raft)
package {
import flash.media.*;
public dynamic class sound_girl_in_raft extends Sound {
}
}//package
Section 435
//sound_girl_push_items (sound_girl_push_items)
package {
import flash.media.*;
public dynamic class sound_girl_push_items extends Sound {
}
}//package
Section 436
//sound_girl_step (sound_girl_step)
package {
import flash.media.*;
public dynamic class sound_girl_step extends Sound {
}
}//package
Section 437
//sound_knight_breath (sound_knight_breath)
package {
import flash.media.*;
public dynamic class sound_knight_breath extends Sound {
}
}//package
Section 438
//sound_knight_step (sound_knight_step)
package {
import flash.media.*;
public dynamic class sound_knight_step extends Sound {
}
}//package
Section 439
//sound_madam_breath (sound_madam_breath)
package {
import flash.media.*;
public dynamic class sound_madam_breath extends Sound {
}
}//package
Section 440
//sound_madam_step (sound_madam_step)
package {
import flash.media.*;
public dynamic class sound_madam_step extends Sound {
}
}//package
Section 441
//sound_mama_cry_intro (sound_mama_cry_intro)
package {
import flash.media.*;
public dynamic class sound_mama_cry_intro extends Sound {
}
}//package
Section 442
//sound_pin_close (sound_pin_close)
package {
import flash.media.*;
public dynamic class sound_pin_close extends Sound {
}
}//package
Section 443
//sound_pin_open (sound_pin_open)
package {
import flash.media.*;
public dynamic class sound_pin_open extends Sound {
}
}//package
Section 444
//sound_raft_move (sound_raft_move)
package {
import flash.media.*;
public dynamic class sound_raft_move extends Sound {
}
}//package
Section 445
//Stairway_Left (Stairway_Left)
package {
import flash.display.*;
public dynamic class Stairway_Left extends MovieClip {
}
}//package
Section 446
//Stairway_Right (Stairway_Right)
package {
import flash.display.*;
public dynamic class Stairway_Right extends MovieClip {
}
}//package
Section 447
//Stairway_Up (Stairway_Up)
package {
import flash.display.*;
public dynamic class Stairway_Up extends MovieClip {
}
}//package
Section 448
//submitScoreText (submitScoreText)
package {
import com.*;
public dynamic class submitScoreText extends TElementWithText {
}
}//package
Section 449
//submitTopScoreHeaderText (submitTopScoreHeaderText)
package {
import com.*;
public dynamic class submitTopScoreHeaderText extends TElementWithText {
}
}//package
Section 450
//Tile_Dark (Tile_Dark)
package {
import flash.display.*;
public dynamic class Tile_Dark extends MovieClip {
}
}//package
Section 451
//Tile_Light (Tile_Light)
package {
import flash.display.*;
public dynamic class Tile_Light extends MovieClip {
}
}//package
Section 452
//TryAgainText (TryAgainText)
package {
import com.*;
public dynamic class TryAgainText extends TElementWithText {
}
}//package
Section 453
//UI_Rate_2 (UI_Rate_2)
package {
import shared_levels.view.components.*;
public dynamic class UI_Rate_2 extends UI_Rate {
}
}//package
Section 454
//undoText (undoText)
package {
import com.*;
public dynamic class undoText extends TElementWithText {
}
}//package
Section 455
//Wall_00 (Wall_00)
package {
import flash.display.*;
public dynamic class Wall_00 extends MovieClip {
}
}//package
Section 456
//Wall_01 (Wall_01)
package {
import flash.display.*;
public dynamic class Wall_01 extends MovieClip {
}
}//package
Section 457
//Wall_02 (Wall_02)
package {
import flash.display.*;
public dynamic class Wall_02 extends MovieClip {
}
}//package
Section 458
//Wall_Block_00 (Wall_Block_00)
package {
import flash.display.*;
public dynamic class Wall_Block_00 extends MovieClip {
}
}//package
Section 459
//Wall_Fence (Wall_Fence)
package {
import flash.display.*;
public dynamic class Wall_Fence extends MovieClip {
}
}//package
Section 460
//Wall_Items_Ensign_00 (Wall_Items_Ensign_00)
package {
import flash.display.*;
public dynamic class Wall_Items_Ensign_00 extends MovieClip {
}
}//package
Section 461
//Wall_Items_Ensign_Bow (Wall_Items_Ensign_Bow)
package {
import flash.display.*;
public dynamic class Wall_Items_Ensign_Bow extends MovieClip {
}
}//package
Section 462
//Wall_Items_Ensign_Tower (Wall_Items_Ensign_Tower)
package {
import flash.display.*;
public dynamic class Wall_Items_Ensign_Tower extends MovieClip {
}
}//package
Section 463
//Wall_Items_Horns (Wall_Items_Horns)
package {
import flash.display.*;
public dynamic class Wall_Items_Horns extends MovieClip {
}
}//package
Section 464
//Wall_Items_Shield_BlackAndWhite (Wall_Items_Shield_BlackAndWhite)
package {
import flash.display.*;
public dynamic class Wall_Items_Shield_BlackAndWhite extends MovieClip {
}
}//package
Section 465
//Wall_Items_Shield_Green (Wall_Items_Shield_Green)
package {
import flash.display.*;
public dynamic class Wall_Items_Shield_Green extends MovieClip {
}
}//package
Section 466
//Wall_Items_Shield_Red (Wall_Items_Shield_Red)
package {
import flash.display.*;
public dynamic class Wall_Items_Shield_Red extends MovieClip {
}
}//package
Section 467
//Water_07 (Water_07)
package {
import flash.display.*;
public dynamic class Water_07 extends MovieClip {
}
}//package
Section 468
//Water_09 (Water_09)
package {
import flash.display.*;
public dynamic class Water_09 extends MovieClip {
}
}//package
Section 469
//Water_Bubble (Water_Bubble)
package {
import flash.display.*;
public dynamic class Water_Bubble extends MovieClip {
}
}//package
Section 470
//Water_Empty_L_BL_B (Water_Empty_L_BL_B)
package {
import flash.display.*;
public dynamic class Water_Empty_L_BL_B extends MovieClip {
}
}//package
Section 471
//Water_Empty_L_R_BL_B_BR (Water_Empty_L_R_BL_B_BR)
package {
import flash.display.*;
public dynamic class Water_Empty_L_R_BL_B_BR extends MovieClip {
}
}//package
Section 472
//Water_Empty_R_B_BR (Water_Empty_R_B_BR)
package {
import flash.display.*;
public dynamic class Water_Empty_R_B_BR extends MovieClip {
}
}//package
Section 473
//Water_Empty_T_TR_L_R_BL_B (Water_Empty_T_TR_L_R_BL_B)
package {
import flash.display.*;
public dynamic class Water_Empty_T_TR_L_R_BL_B extends MovieClip {
}
}//package
Section 474
//Water_Empty_T_TR_L_R_BL_B_BR (Water_Empty_T_TR_L_R_BL_B_BR)
package {
import flash.display.*;
public dynamic class Water_Empty_T_TR_L_R_BL_B_BR extends MovieClip {
}
}//package
Section 475
//Water_Empty_T_TR_R (Water_Empty_T_TR_R)
package {
import flash.display.*;
public dynamic class Water_Empty_T_TR_R extends MovieClip {
}
}//package
Section 476
//Water_Empty_T_TR_R_B_BR (Water_Empty_T_TR_R_B_BR)
package {
import flash.display.*;
public dynamic class Water_Empty_T_TR_R_B_BR extends MovieClip {
}
}//package
Section 477
//Water_Empty_TL_T_L (Water_Empty_TL_T_L)
package {
import flash.display.*;
public dynamic class Water_Empty_TL_T_L extends MovieClip {
}
}//package
Section 478
//Water_Empty_TL_T_L_BL_B (Water_Empty_TL_T_L_BL_B)
package {
import flash.display.*;
public dynamic class Water_Empty_TL_T_L_BL_B extends MovieClip {
}
}//package
Section 479
//Water_Empty_TL_T_L_R_B_BR (Water_Empty_TL_T_L_R_B_BR)
package {
import flash.display.*;
public dynamic class Water_Empty_TL_T_L_R_B_BR extends MovieClip {
}
}//package
Section 480
//Water_Empty_TL_T_L_R_BL_B_BR (Water_Empty_TL_T_L_R_BL_B_BR)
package {
import flash.display.*;
public dynamic class Water_Empty_TL_T_L_R_BL_B_BR extends MovieClip {
}
}//package
Section 481
//Water_Empty_TL_T_TR_L_R (Water_Empty_TL_T_TR_L_R)
package {
import flash.display.*;
public dynamic class Water_Empty_TL_T_TR_L_R extends MovieClip {
}
}//package
Section 482
//Water_Empty_TL_T_TR_L_R_B_BR (Water_Empty_TL_T_TR_L_R_B_BR)
package {
import flash.display.*;
public dynamic class Water_Empty_TL_T_TR_L_R_B_BR extends MovieClip {
}
}//package
Section 483
//Water_Empty_TL_T_TR_L_R_BL_B (Water_Empty_TL_T_TR_L_R_BL_B)
package {
import flash.display.*;
public dynamic class Water_Empty_TL_T_TR_L_R_BL_B extends MovieClip {
}
}//package
Section 484
//Water_Empty_TL_T_TR_L_R_BL_B_BR (Water_Empty_TL_T_TR_L_R_BL_B_BR)
package {
import flash.display.*;
public dynamic class Water_Empty_TL_T_TR_L_R_BL_B_BR extends MovieClip {
}
}//package
Section 485
//Water_Fill (Water_Fill)
package {
import flash.display.*;
public dynamic class Water_Fill extends MovieClip {
}
}//package
Section 486
//Water_Fill_B (Water_Fill_B)
package {
import flash.display.*;
public dynamic class Water_Fill_B extends MovieClip {
}
}//package
Section 487
//Water_Fill_B_L (Water_Fill_B_L)
package {
import flash.display.*;
public dynamic class Water_Fill_B_L extends MovieClip {
}
}//package
Section 488
//Water_Fill_B_R (Water_Fill_B_R)
package {
import flash.display.*;
public dynamic class Water_Fill_B_R extends MovieClip {
}
}//package
Section 489
//Water_Fill_L (Water_Fill_L)
package {
import flash.display.*;
public dynamic class Water_Fill_L extends MovieClip {
}
}//package
Section 490
//Water_Fill_L_R (Water_Fill_L_R)
package {
import flash.display.*;
public dynamic class Water_Fill_L_R extends MovieClip {
}
}//package
Section 491
//Water_Fill_R (Water_Fill_R)
package {
import flash.display.*;
public dynamic class Water_Fill_R extends MovieClip {
}
}//package
Section 492
//Water_Fill_T (Water_Fill_T)
package {
import flash.display.*;
public dynamic class Water_Fill_T extends MovieClip {
}
}//package
Section 493
//Water_Fill_T_L (Water_Fill_T_L)
package {
import flash.display.*;
public dynamic class Water_Fill_T_L extends MovieClip {
}
}//package
Section 494
//Water_Fill_T_R (Water_Fill_T_R)
package {
import flash.display.*;
public dynamic class Water_Fill_T_R extends MovieClip {
}
}//package
Section 495
//Water_Fill_TL_L (Water_Fill_TL_L)
package {
import flash.display.*;
public dynamic class Water_Fill_TL_L extends MovieClip {
}
}//package
Section 496
//Water_Fill_TL_L_B (Water_Fill_TL_L_B)
package {
import flash.display.*;
public dynamic class Water_Fill_TL_L_B extends MovieClip {
}
}//package
Section 497
//Water_Fill_TL_L_R_B (Water_Fill_TL_L_R_B)
package {
import flash.display.*;
public dynamic class Water_Fill_TL_L_R_B extends MovieClip {
}
}//package
Section 498
//Water_Fill_TL_TR_L_R_B (Water_Fill_TL_TR_L_R_B)
package {
import flash.display.*;
public dynamic class Water_Fill_TL_TR_L_R_B extends MovieClip {
}
}//package
Section 499
//Water_Fill_TR_L_R_B (Water_Fill_TR_L_R_B)
package {
import flash.display.*;
public dynamic class Water_Fill_TR_L_R_B extends MovieClip {
}
}//package
Section 500
//Water_Fill_TR_R (Water_Fill_TR_R)
package {
import flash.display.*;
public dynamic class Water_Fill_TR_R extends MovieClip {
}
}//package
Section 501
//Water_Fill_TR_R_B (Water_Fill_TR_R_B)
package {
import flash.display.*;
public dynamic class Water_Fill_TR_R_B extends MovieClip {
}
}//package
Section 502
//Water_Lake (Water_Lake)
package {
import flash.display.*;
public dynamic class Water_Lake extends MovieClip {
}
}//package
Section 503
//viewTopScoreText (viewTopScoreText)
package {
import com.*;
public dynamic class viewTopScoreText extends TElementWithText {
public function viewTopScoreText(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package