Section 1
//PropTween (com.greensock.core.PropTween)
package com.greensock.core {
public class PropTween {
public var priority:int;
public var start:Number;
public var prevNode:PropTween;
public var change:Number;
public var target:Object;
public var name:String;
public var property:String;
public var nextNode:PropTween;
public var isPlugin:Boolean;
public function PropTween(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Number, _arg5:String, _arg6:Boolean, _arg7:PropTween=null, _arg8:int=0){
this.target = _arg1;
this.property = _arg2;
this.start = _arg3;
this.change = _arg4;
this.name = _arg5;
this.isPlugin = _arg6;
if (_arg7){
_arg7.prevNode = this;
this.nextNode = _arg7;
};
this.priority = _arg8;
}
}
}//package com.greensock.core
Section 2
//SimpleTimeline (com.greensock.core.SimpleTimeline)
package com.greensock.core {
public class SimpleTimeline extends TweenCore {
public var autoRemoveChildren:Boolean;
protected var _lastChild:TweenCore;
protected var _firstChild:TweenCore;
public function SimpleTimeline(_arg1:Object=null){
super(0, _arg1);
}
override public function renderTime(_arg1:Number, _arg2:Boolean=false, _arg3:Boolean=false):void{
var _local5:Number;
var _local6:TweenCore;
var _local4:TweenCore = _firstChild;
this.cachedTotalTime = _arg1;
this.cachedTime = _arg1;
while (_local4) {
_local6 = _local4.nextNode;
if (((_local4.active) || ((((((_arg1 >= _local4.cachedStartTime)) && (!(_local4.cachedPaused)))) && (!(_local4.gc)))))){
if (!_local4.cachedReversed){
_local4.renderTime(((_arg1 - _local4.cachedStartTime) * _local4.cachedTimeScale), _arg2, false);
} else {
_local5 = (_local4.cacheIsDirty) ? _local4.totalDuration : _local4.cachedTotalDuration;
_local4.renderTime((_local5 - ((_arg1 - _local4.cachedStartTime) * _local4.cachedTimeScale)), _arg2, false);
};
};
_local4 = _local6;
};
}
public function addChild(_arg1:TweenCore):void{
if (((!(_arg1.cachedOrphan)) && (_arg1.timeline))){
_arg1.timeline.remove(_arg1, true);
};
_arg1.timeline = this;
if (_arg1.gc){
_arg1.setEnabled(true, true);
};
if (_firstChild){
_firstChild.prevNode = _arg1;
};
_arg1.nextNode = _firstChild;
_firstChild = _arg1;
_arg1.prevNode = null;
_arg1.cachedOrphan = false;
}
public function remove(_arg1:TweenCore, _arg2:Boolean=false):void{
if (_arg1.cachedOrphan){
return;
};
if (!_arg2){
_arg1.setEnabled(false, true);
};
if (_arg1.nextNode){
_arg1.nextNode.prevNode = _arg1.prevNode;
} else {
if (_lastChild == _arg1){
_lastChild = _arg1.prevNode;
};
};
if (_arg1.prevNode){
_arg1.prevNode.nextNode = _arg1.nextNode;
} else {
if (_firstChild == _arg1){
_firstChild = _arg1.nextNode;
};
};
_arg1.cachedOrphan = true;
}
public function get rawTime():Number{
return (this.cachedTotalTime);
}
}
}//package com.greensock.core
Section 3
//TweenCore (com.greensock.core.TweenCore)
package com.greensock.core {
import com.greensock.*;
public class TweenCore {
public var initted:Boolean;
protected var _hasUpdate:Boolean;
public var active:Boolean;
protected var _delay:Number;
public var cachedTime:Number;
public var cachedReversed:Boolean;
public var nextNode:TweenCore;
protected var _rawPrevTime:Number;// = -1
public var vars:Object;
public var cachedTotalTime:Number;
public var data;
public var timeline:SimpleTimeline;
public var cachedOrphan:Boolean;
public var cachedStartTime:Number;
public var prevNode:TweenCore;
public var cachedDuration:Number;
public var gc:Boolean;
protected var _pauseTime:Number;
public var cacheIsDirty:Boolean;
public var cachedPaused:Boolean;
public var cachedTimeScale:Number;
public var cachedTotalDuration:Number;
public static const version:Number = 1.382;
protected static var _classInitted:Boolean;
public function TweenCore(_arg1:Number=0, _arg2:Object=null){
this.vars = ((_arg2)!=null) ? _arg2 : {};
this.cachedDuration = (this.cachedTotalDuration = _arg1);
_delay = (this.vars.delay) ? Number(this.vars.delay) : 0;
this.cachedTimeScale = (this.vars.timeScale) ? Number(this.vars.timeScale) : 1;
this.active = Boolean((((((_arg1 == 0)) && ((_delay == 0)))) && (!((this.vars.immediateRender == false)))));
this.cachedTotalTime = (this.cachedTime = 0);
this.data = this.vars.data;
if (!_classInitted){
if (isNaN(TweenLite.rootFrame)){
TweenLite.initClass();
_classInitted = true;
} else {
return;
};
};
var _local3:SimpleTimeline = ((this.vars.timeline is SimpleTimeline)) ? this.vars.timeline : (this.vars.useFrames) ? TweenLite.rootFramesTimeline : TweenLite.rootTimeline;
this.cachedStartTime = (_local3.cachedTotalTime + _delay);
_local3.addChild(this);
if (this.vars.reversed){
this.cachedReversed = true;
};
if (this.vars.paused){
this.paused = true;
};
}
public function renderTime(_arg1:Number, _arg2:Boolean=false, _arg3:Boolean=false):void{
}
public function get delay():Number{
return (_delay);
}
public function restart(_arg1:Boolean=false, _arg2:Boolean=true):void{
this.reversed = false;
this.paused = false;
this.setTotalTime((_arg1) ? -(_delay) : 0, _arg2);
}
public function get duration():Number{
return (this.cachedDuration);
}
public function set reversed(_arg1:Boolean):void{
if (_arg1 != this.cachedReversed){
this.cachedReversed = _arg1;
setTotalTime(this.cachedTotalTime, true);
};
}
public function set startTime(_arg1:Number):void{
var _local2:Boolean = Boolean(((!((this.timeline == null))) && (((!((_arg1 == this.cachedStartTime))) || (this.gc)))));
this.cachedStartTime = _arg1;
if (_local2){
this.timeline.addChild(this);
};
}
public function set delay(_arg1:Number):void{
this.startTime = (this.startTime + (_arg1 - _delay));
_delay = _arg1;
}
public function resume():void{
this.paused = false;
}
public function get paused():Boolean{
return (this.cachedPaused);
}
public function play():void{
this.reversed = false;
this.paused = false;
}
public function set duration(_arg1:Number):void{
this.cachedDuration = (this.cachedTotalDuration = _arg1);
setDirtyCache(false);
}
public function invalidate():void{
}
public function complete(_arg1:Boolean=false, _arg2:Boolean=false):void{
if (!_arg1){
renderTime(this.totalDuration, _arg2, false);
return;
};
if (this.timeline.autoRemoveChildren){
this.setEnabled(false, false);
} else {
this.active = false;
};
if (!_arg2){
if (((((this.vars.onComplete) && ((this.cachedTotalTime == this.cachedTotalDuration)))) && (!(this.cachedReversed)))){
this.vars.onComplete.apply(null, this.vars.onCompleteParams);
} else {
if (((((this.cachedReversed) && ((this.cachedTotalTime == 0)))) && (this.vars.onReverseComplete))){
this.vars.onReverseComplete.apply(null, this.vars.onReverseCompleteParams);
};
};
};
}
public function get reversed():Boolean{
return (this.cachedReversed);
}
public function get totalTime():Number{
return (this.cachedTotalTime);
}
public function get startTime():Number{
return (this.cachedStartTime);
}
public function set currentTime(_arg1:Number):void{
setTotalTime(_arg1, false);
}
protected function setDirtyCache(_arg1:Boolean=true):void{
var _local2:TweenCore = (_arg1) ? this : this.timeline;
while (_local2) {
_local2.cacheIsDirty = true;
_local2 = _local2.timeline;
};
}
public function reverse(_arg1:Boolean=true):void{
this.reversed = true;
if (_arg1){
this.paused = false;
} else {
if (this.gc){
this.setEnabled(true, false);
};
};
}
public function set paused(_arg1:Boolean):void{
if (((!((_arg1 == this.cachedPaused))) && (this.timeline))){
if (_arg1){
_pauseTime = this.timeline.rawTime;
} else {
this.cachedStartTime = (this.cachedStartTime + (this.timeline.rawTime - _pauseTime));
_pauseTime = NaN;
setDirtyCache(false);
};
this.cachedPaused = _arg1;
this.active = Boolean(((((!(this.cachedPaused)) && ((this.cachedTotalTime > 0)))) && ((this.cachedTotalTime < this.cachedTotalDuration))));
};
if (((!(_arg1)) && (this.gc))){
this.setTotalTime(this.cachedTotalTime, false);
this.setEnabled(true, false);
};
}
public function kill():void{
setEnabled(false, false);
}
public function set totalTime(_arg1:Number):void{
setTotalTime(_arg1, false);
}
public function get currentTime():Number{
return (this.cachedTime);
}
protected function setTotalTime(_arg1:Number, _arg2:Boolean=false):void{
var _local3:Number;
var _local4:Number;
if (this.timeline){
_local3 = (((_pauseTime) || ((_pauseTime == 0)))) ? _pauseTime : this.timeline.cachedTotalTime;
if (this.cachedReversed){
_local4 = (this.cacheIsDirty) ? this.totalDuration : this.cachedTotalDuration;
this.cachedStartTime = (_local3 - ((_local4 - _arg1) / this.cachedTimeScale));
} else {
this.cachedStartTime = (_local3 - (_arg1 / this.cachedTimeScale));
};
if (!this.timeline.cacheIsDirty){
setDirtyCache(false);
};
if (this.cachedTotalTime != _arg1){
renderTime(_arg1, _arg2, false);
};
};
}
public function pause():void{
this.paused = true;
}
public function set totalDuration(_arg1:Number):void{
this.duration = _arg1;
}
public function get totalDuration():Number{
return (this.cachedTotalDuration);
}
public function setEnabled(_arg1:Boolean, _arg2:Boolean=false):Boolean{
this.gc = !(_arg1);
if (_arg1){
this.active = Boolean(((((!(this.cachedPaused)) && ((this.cachedTotalTime > 0)))) && ((this.cachedTotalTime < this.cachedTotalDuration))));
if (((!(_arg2)) && (this.cachedOrphan))){
this.timeline.addChild(this);
};
} else {
this.active = false;
if (((!(_arg2)) && (!(this.cachedOrphan)))){
this.timeline.remove(this, true);
};
};
return (false);
}
}
}//package com.greensock.core
Section 4
//Back (com.greensock.easing.Back)
package com.greensock.easing {
public class Back {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=1.70158):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) + _arg5)) + 1)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=1.70158):Number{
_arg1 = (_arg1 / _arg4);
return (((((_arg3 * _arg1) * _arg1) * (((_arg5 + 1) * _arg1) - _arg5)) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=1.70158):Number{
_arg1 = (_arg1 / (_arg4 * 0.5));
if (_arg1 < 1){
_arg5 = (_arg5 * 1.525);
return ((((_arg3 * 0.5) * ((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) - _arg5))) + _arg2));
};
_arg1 = (_arg1 - 2);
_arg5 = (_arg5 * 1.525);
return ((((_arg3 / 2) * (((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) + _arg5)) + 2)) + _arg2));
}
}
}//package com.greensock.easing
Section 5
//Expo (com.greensock.easing.Expo)
package com.greensock.easing {
public class Expo {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (((_arg1)==_arg4) ? (_arg2 + _arg3) : ((_arg3 * (-(Math.pow(2, ((-10 * _arg1) / _arg4))) + 1)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (((_arg1)==0) ? _arg2 : (((_arg3 * Math.pow(2, (10 * ((_arg1 / _arg4) - 1)))) + _arg2) - (_arg3 * 0.001)));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 == 0){
return (_arg2);
};
if (_arg1 == _arg4){
return ((_arg2 + _arg3));
};
_arg1 = (_arg1 / (_arg4 * 0.5));
if (_arg1 < 1){
return ((((_arg3 * 0.5) * Math.pow(2, (10 * (_arg1 - 1)))) + _arg2));
};
--_arg1;
return ((((_arg3 * 0.5) * (-(Math.pow(2, (-10 * _arg1))) + 2)) + _arg2));
}
}
}//package com.greensock.easing
Section 6
//Linear (com.greensock.easing.Linear)
package com.greensock.easing {
public class Linear {
public static const power:uint = 0;
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeNone(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
}
}//package com.greensock.easing
Section 7
//Quad (com.greensock.easing.Quad)
package com.greensock.easing {
public class Quad {
public static const power:uint = 1;
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((_arg3 * _arg1) * _arg1) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 * 0.5));
if (_arg1 < 1){
return (((((_arg3 * 0.5) * _arg1) * _arg1) + _arg2));
};
--_arg1;
return ((((-(_arg3) * 0.5) * ((_arg1 * (_arg1 - 2)) - 1)) + _arg2));
}
}
}//package com.greensock.easing
Section 8
//RemoveTintPlugin (com.greensock.plugins.RemoveTintPlugin)
package com.greensock.plugins {
public class RemoveTintPlugin extends TintPlugin {
public static const API:Number = 1;
public function RemoveTintPlugin(){
this.propName = "removeTint";
}
}
}//package com.greensock.plugins
Section 9
//TintPlugin (com.greensock.plugins.TintPlugin)
package com.greensock.plugins {
import flash.display.*;
import flash.geom.*;
import com.greensock.core.*;
import com.greensock.*;
public class TintPlugin extends TweenPlugin {
protected var _ct:ColorTransform;
protected var _transform:Transform;
protected var _ignoreAlpha:Boolean;
public static const API:Number = 1;
protected static var _props:Array = ["redMultiplier", "greenMultiplier", "blueMultiplier", "alphaMultiplier", "redOffset", "greenOffset", "blueOffset", "alphaOffset"];
public function TintPlugin(){
this.propName = "tint";
this.overwriteProps = ["tint"];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (!(_arg1 is DisplayObject)){
return (false);
};
var _local4:ColorTransform = new ColorTransform();
if (((!((_arg2 == null))) && (!((_arg3.vars.removeTint == true))))){
_local4.color = uint(_arg2);
};
_ignoreAlpha = true;
init((_arg1 as DisplayObject), _local4);
return (true);
}
override public function set changeFactor(_arg1:Number):void{
var _local2:ColorTransform;
updateTweens(_arg1);
if (_ignoreAlpha){
_local2 = _transform.colorTransform;
_ct.alphaMultiplier = _local2.alphaMultiplier;
_ct.alphaOffset = _local2.alphaOffset;
};
_transform.colorTransform = _ct;
}
public function init(_arg1:DisplayObject, _arg2:ColorTransform):void{
var _local4:String;
_transform = _arg1.transform;
_ct = _transform.colorTransform;
var _local3:int = _props.length;
while (_local3--) {
_local4 = _props[_local3];
if (_ct[_local4] != _arg2[_local4]){
_tweens[_tweens.length] = new PropTween(_ct, _local4, _ct[_local4], (_arg2[_local4] - _ct[_local4]), "tint", false);
};
};
}
}
}//package com.greensock.plugins
Section 10
//TweenPlugin (com.greensock.plugins.TweenPlugin)
package com.greensock.plugins {
import com.greensock.core.*;
import com.greensock.*;
public class TweenPlugin {
public var activeDisable:Boolean;
protected var _changeFactor:Number;// = 0
protected var _tweens:Array;
public var onDisable:Function;
public var propName:String;
public var round:Boolean;
public var onEnable:Function;
public var priority:int;// = 0
public var overwriteProps:Array;
public var onComplete:Function;
public static const VERSION:Number = 1.31;
public static const API:Number = 1;
public function TweenPlugin(){
_tweens = [];
super();
}
protected function updateTweens(_arg1:Number):void{
var _local3:PropTween;
var _local4:Number;
var _local2:int = _tweens.length;
if (this.round){
while (_local2--) {
_local3 = _tweens[_local2];
_local4 = (_local3.start + (_local3.change * _arg1));
_local3.target[_local3.property] = ((_local4)>0) ? int((_local4 + 0.5)) : int((_local4 - 0.5));
};
} else {
while (_local2--) {
_local3 = _tweens[_local2];
_local3.target[_local3.property] = (_local3.start + (_local3.change * _arg1));
};
};
}
protected function addTween(_arg1:Object, _arg2:String, _arg3:Number, _arg4, _arg5:String=null):void{
var _local6:Number;
if (_arg4 != null){
_local6 = ((typeof(_arg4))=="number") ? (Number(_arg4) - _arg3) : Number(_arg4);
if (_local6 != 0){
_tweens[_tweens.length] = new PropTween(_arg1, _arg2, _arg3, _local6, ((_arg5) || (_arg2)), false);
};
};
}
public function get changeFactor():Number{
return (_changeFactor);
}
public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
addTween(_arg1, this.propName, _arg1[this.propName], _arg2, this.propName);
return (true);
}
public function killProps(_arg1:Object):void{
var _local2:int = this.overwriteProps.length;
while (_local2--) {
if ((this.overwriteProps[_local2] in _arg1)){
this.overwriteProps.splice(_local2, 1);
};
};
_local2 = _tweens.length;
while (_local2--) {
if ((PropTween(_tweens[_local2]).name in _arg1)){
_tweens.splice(_local2, 1);
};
};
}
public function set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
_changeFactor = _arg1;
}
public static function activate(_arg1:Array):Boolean{
var _local3:Object;
TweenLite.onPluginEvent = TweenPlugin.onTweenEvent;
var _local2:int = _arg1.length;
while (_local2--) {
if (_arg1[_local2].hasOwnProperty("API")){
_local3 = new ((_arg1[_local2] as Class));
TweenLite.plugins[_local3.propName] = _arg1[_local2];
};
};
return (true);
}
private static function onTweenEvent(_arg1:String, _arg2:TweenLite):Boolean{
var _local4:Boolean;
var _local5:Array;
var _local6:int;
var _local3:PropTween = _arg2.cachedPT1;
if (_arg1 == "onInit"){
_local5 = [];
while (_local3) {
_local5[_local5.length] = _local3;
_local3 = _local3.nextNode;
};
_local5.sortOn("priority", (Array.NUMERIC | Array.DESCENDING));
_local6 = _local5.length;
while (_local6--) {
PropTween(_local5[_local6]).nextNode = _local5[(_local6 + 1)];
PropTween(_local5[_local6]).prevNode = _local5[(_local6 - 1)];
};
_arg2.cachedPT1 = _local5[0];
} else {
while (_local3) {
if (((_local3.isPlugin) && (_local3.target[_arg1]))){
if (_local3.target.activeDisable){
_local4 = true;
};
var _local7 = _local3.target;
_local7[_arg1]();
};
_local3 = _local3.nextNode;
};
};
return (_local4);
}
}
}//package com.greensock.plugins
Section 11
//OverwriteManager (com.greensock.OverwriteManager)
package com.greensock {
import com.greensock.core.*;
public class OverwriteManager {
public static const ALL_ONSTART:int = 4;
public static const CONCURRENT:int = 3;
public static const ALL_IMMEDIATE:int = 1;
public static const PREEXISTING:int = 5;
public static const AUTO:int = 2;
public static const version:Number = 6.03;
public static const NONE:int = 0;
public static var enabled:Boolean;
public static var mode:int;
public static function getGlobalPaused(_arg1:TweenCore):Boolean{
var _local2:Boolean;
while (_arg1) {
if (_arg1.cachedPaused){
_local2 = true;
break;
};
_arg1 = _arg1.timeline;
};
return (_local2);
}
public static function init(_arg1:int=2):int{
if (TweenLite.version < 11.1){
throw (new Error("Warning: Your TweenLite class needs to be updated to work with OverwriteManager (or you may need to clear your ASO files). Please download and install the latest version from http://www.tweenlite.com."));
};
TweenLite.overwriteManager = OverwriteManager;
mode = _arg1;
enabled = true;
return (mode);
}
public static function manageOverwrites(_arg1:TweenLite, _arg2:Object, _arg3:Array, _arg4:uint):Boolean{
var _local5:int;
var _local6:Boolean;
var _local7:TweenLite;
var _local13:uint;
var _local14:Number;
var _local15:Number;
var _local16:TweenCore;
var _local17:Number;
var _local18:SimpleTimeline;
if (_arg4 >= 4){
_local13 = _arg3.length;
_local5 = 0;
while (_local5 < _local13) {
_local7 = _arg3[_local5];
if (_local7 != _arg1){
if (_local7.setEnabled(false, false)){
_local6 = true;
};
} else {
if (_arg4 == 5){
break;
};
};
_local5++;
};
return (_local6);
};
var _local8:Number = (_arg1.cachedStartTime + 1E-10);
var _local9:Array = [];
var _local10:Array = [];
var _local11:uint;
var _local12:uint;
_local5 = _arg3.length;
while (--_local5 > -1) {
_local7 = _arg3[_local5];
if ((((_local7 == _arg1)) || (_local7.gc))){
} else {
if (_local7.timeline != _arg1.timeline){
if (!getGlobalPaused(_local7)){
var _temp1 = _local11;
_local11 = (_local11 + 1);
var _local19 = _temp1;
_local10[_local19] = _local7;
};
} else {
if ((((((_local7.cachedStartTime <= _local8)) && ((((_local7.cachedStartTime + _local7.totalDuration) + 1E-10) > _local8)))) && (!(getGlobalPaused(_local7))))){
var _temp2 = _local12;
_local12 = (_local12 + 1);
_local19 = _temp2;
_local9[_local19] = _local7;
};
};
};
};
if (_local11 != 0){
_local14 = _arg1.cachedTimeScale;
_local15 = _local8;
_local18 = _arg1.timeline;
while (_local18) {
_local14 = (_local14 * _local18.cachedTimeScale);
_local15 = (_local15 + _local18.cachedStartTime);
_local18 = _local18.timeline;
};
_local8 = (_local14 * _local15);
_local5 = _local11;
while (--_local5 > -1) {
_local16 = _local10[_local5];
_local14 = _local16.cachedTimeScale;
_local15 = _local16.cachedStartTime;
_local18 = _local16.timeline;
while (_local18) {
_local14 = (_local14 * _local18.cachedTimeScale);
_local15 = (_local15 + _local18.cachedStartTime);
_local18 = _local18.timeline;
};
_local17 = (_local14 * _local15);
if ((((_local17 <= _local8)) && ((((((_local17 + (_local16.totalDuration * _local14)) + 1E-10) > _local8)) || ((_local16.cachedDuration == 0)))))){
var _temp3 = _local12;
_local12 = (_local12 + 1);
_local19 = _temp3;
_local9[_local19] = _local16;
};
};
};
if (_local12 == 0){
return (_local6);
};
_local5 = _local12;
if (_arg4 == 2){
while (--_local5 > -1) {
_local7 = _local9[_local5];
if (_local7.killVars(_arg2)){
_local6 = true;
};
if ((((_local7.cachedPT1 == null)) && (_local7.initted))){
_local7.setEnabled(false, false);
};
};
} else {
while (--_local5 > -1) {
if (TweenLite(_local9[_local5]).setEnabled(false, false)){
_local6 = true;
};
};
};
return (_local6);
}
}
}//package com.greensock
Section 12
//TimelineLite (com.greensock.TimelineLite)
package com.greensock {
import com.greensock.core.*;
import flash.utils.*;
public class TimelineLite extends SimpleTimeline {
protected var _endCaps:Array;
protected var _labels:Object;
public static const version:Number = 1.382;
private static var _overwriteMode:int = (OverwriteManager.enabled) ? OverwriteManager.mode : OverwriteManager.init(2);
;
public function TimelineLite(_arg1:Object=null){
super(_arg1);
_endCaps = [null, null];
_labels = {};
this.autoRemoveChildren = Boolean((this.vars.autoRemoveChildren == true));
_hasUpdate = Boolean((typeof(this.vars.onUpdate) == "function"));
if ((this.vars.tweens is Array)){
this.insertMultiple(this.vars.tweens, 0, ((this.vars.align)!=null) ? this.vars.align : "normal", (this.vars.stagger) ? Number(this.vars.stagger) : 0);
};
}
public function set timeScale(_arg1:Number):void{
if (_arg1 == 0){
_arg1 = 0.0001;
};
var _local2:Number = (((_pauseTime) || ((_pauseTime == 0)))) ? _pauseTime : this.timeline.cachedTotalTime;
this.cachedStartTime = (_local2 - (((_local2 - this.cachedStartTime) * this.cachedTimeScale) / _arg1));
this.cachedTimeScale = _arg1;
setDirtyCache(false);
}
public function stop():void{
this.paused = true;
}
override public function renderTime(_arg1:Number, _arg2:Boolean=false, _arg3:Boolean=false):void{
var _local8:TweenCore;
var _local9:Boolean;
var _local10:Boolean;
var _local11:TweenCore;
var _local12:Number;
if (this.gc){
this.setEnabled(true, false);
} else {
if (((!(this.active)) && (!(this.cachedPaused)))){
this.active = true;
};
};
var _local4:Number = (this.cacheIsDirty) ? this.totalDuration : this.cachedTotalDuration;
var _local5:Number = this.cachedTime;
var _local6:Number = this.cachedStartTime;
var _local7:Number = this.cachedTimeScale;
var _local13:Boolean = this.cachedPaused;
if (_arg1 >= _local4){
if ((((_rawPrevTime <= _local4)) && (!((_rawPrevTime == _arg1))))){
this.cachedTotalTime = (this.cachedTime = _local4);
forceChildrenToEnd(_local4, _arg2);
_local9 = !(this.hasPausedChild());
_local10 = true;
if ((((((this.cachedDuration == 0)) && (_local9))) && ((((_arg1 == 0)) || ((_rawPrevTime < 0)))))){
_arg3 = true;
};
};
} else {
if (_arg1 <= 0){
if (_arg1 < 0){
this.active = false;
if ((((this.cachedDuration == 0)) && ((_rawPrevTime > 0)))){
_arg3 = true;
_local9 = true;
};
};
if ((((_rawPrevTime >= 0)) && (!((_rawPrevTime == _arg1))))){
forceChildrenToBeginning(0, _arg2);
this.cachedTotalTime = 0;
this.cachedTime = 0;
_local10 = true;
if (this.cachedReversed){
_local9 = true;
};
};
} else {
this.cachedTotalTime = (this.cachedTime = _arg1);
};
};
_rawPrevTime = _arg1;
if ((((this.cachedTime == _local5)) && (!(_arg3)))){
return;
};
if (!this.initted){
this.initted = true;
};
if ((((((((_local5 == 0)) && (this.vars.onStart))) && (!((this.cachedTime == 0))))) && (!(_arg2)))){
this.vars.onStart.apply(null, this.vars.onStartParams);
};
if (_local10){
} else {
if ((this.cachedTime - _local5) > 0){
_local8 = _firstChild;
while (_local8) {
_local11 = _local8.nextNode;
if (((this.cachedPaused) && (!(_local13)))){
break;
} else {
if (((_local8.active) || (((((!(_local8.cachedPaused)) && ((_local8.cachedStartTime <= this.cachedTime)))) && (!(_local8.gc)))))){
if (!_local8.cachedReversed){
_local8.renderTime(((this.cachedTime - _local8.cachedStartTime) * _local8.cachedTimeScale), _arg2, false);
} else {
_local12 = (_local8.cacheIsDirty) ? _local8.totalDuration : _local8.cachedTotalDuration;
_local8.renderTime((_local12 - ((this.cachedTime - _local8.cachedStartTime) * _local8.cachedTimeScale)), _arg2, false);
};
};
};
_local8 = _local11;
};
} else {
_local8 = _lastChild;
while (_local8) {
_local11 = _local8.prevNode;
if (((this.cachedPaused) && (!(_local13)))){
break;
} else {
if (((_local8.active) || (((((!(_local8.cachedPaused)) && ((_local8.cachedStartTime <= _local5)))) && (!(_local8.gc)))))){
if (!_local8.cachedReversed){
_local8.renderTime(((this.cachedTime - _local8.cachedStartTime) * _local8.cachedTimeScale), _arg2, false);
} else {
_local12 = (_local8.cacheIsDirty) ? _local8.totalDuration : _local8.cachedTotalDuration;
_local8.renderTime((_local12 - ((this.cachedTime - _local8.cachedStartTime) * _local8.cachedTimeScale)), _arg2, false);
};
};
};
_local8 = _local11;
};
};
};
if (((_hasUpdate) && (!(_arg2)))){
this.vars.onUpdate.apply(null, this.vars.onUpdateParams);
};
if (((((_local9) && ((((_local6 == this.cachedStartTime)) || (!((_local7 == this.cachedTimeScale))))))) && ((((_local4 >= this.totalDuration)) || ((this.cachedTime == 0)))))){
complete(true, _arg2);
};
}
override public function remove(_arg1:TweenCore, _arg2:Boolean=false):void{
if (_arg1.cachedOrphan){
return;
};
if (!_arg2){
_arg1.setEnabled(false, true);
};
var _local3:TweenCore = (this.gc) ? _endCaps[0] : _firstChild;
var _local4:TweenCore = (this.gc) ? _endCaps[1] : _lastChild;
if (_arg1.nextNode){
_arg1.nextNode.prevNode = _arg1.prevNode;
} else {
if (_local4 == _arg1){
_local4 = _arg1.prevNode;
};
};
if (_arg1.prevNode){
_arg1.prevNode.nextNode = _arg1.nextNode;
} else {
if (_local3 == _arg1){
_local3 = _arg1.nextNode;
};
};
if (this.gc){
_endCaps[0] = _local3;
_endCaps[1] = _local4;
} else {
_firstChild = _local3;
_lastChild = _local4;
};
_arg1.cachedOrphan = true;
setDirtyCache(true);
}
public function get currentProgress():Number{
return ((this.cachedTime / this.duration));
}
override public function get totalDuration():Number{
var _local1:Number;
var _local2:Number;
var _local3:TweenCore;
var _local4:Number;
var _local5:TweenCore;
if (this.cacheIsDirty){
_local1 = 0;
_local3 = (this.gc) ? _endCaps[0] : _firstChild;
_local4 = -(Infinity);
while (_local3) {
_local5 = _local3.nextNode;
if (_local3.cachedStartTime < _local4){
this.addChild(_local3);
_local4 = _local3.prevNode.cachedStartTime;
} else {
_local4 = _local3.cachedStartTime;
};
if (_local3.cachedStartTime < 0){
_local1 = (_local1 - _local3.cachedStartTime);
this.shiftChildren(-(_local3.cachedStartTime), false, -9999999999);
};
_local2 = (_local3.cachedStartTime + (_local3.totalDuration / _local3.cachedTimeScale));
if (_local2 > _local1){
_local1 = _local2;
};
_local3 = _local5;
};
this.cachedDuration = (this.cachedTotalDuration = _local1);
this.cacheIsDirty = false;
};
return (this.cachedTotalDuration);
}
public function gotoAndPlay(_arg1, _arg2:Boolean=true):void{
setTotalTime(parseTimeOrLabel(_arg1), _arg2);
play();
}
public function appendMultiple(_arg1:Array, _arg2:Number=0, _arg3:String="normal", _arg4:Number=0):void{
insertMultiple(_arg1, (this.duration + _arg2), _arg3, _arg4);
}
public function set currentProgress(_arg1:Number):void{
setTotalTime((this.duration * _arg1), false);
}
public function clear(_arg1:Array=null):void{
if (_arg1 == null){
_arg1 = getChildren(false, true, true);
};
var _local2:int = _arg1.length;
while (--_local2 > -1) {
TweenCore(_arg1[_local2]).setEnabled(false, false);
};
}
public function prepend(_arg1:TweenCore, _arg2:Boolean=false):void{
shiftChildren(((_arg1.totalDuration / _arg1.cachedTimeScale) + _arg1.delay), _arg2, 0);
insert(_arg1, 0);
}
public function removeLabel(_arg1:String):Number{
var _local2:Number = _labels[_arg1];
delete _labels[_arg1];
return (_local2);
}
protected function parseTimeOrLabel(_arg1):Number{
if (typeof(_arg1) == "string"){
if (!(_arg1 in _labels)){
throw (new Error((("TimelineLite error: the " + _arg1) + " label was not found.")));
};
return (getLabelTime(String(_arg1)));
};
return (Number(_arg1));
}
public function addLabel(_arg1:String, _arg2:Number):void{
_labels[_arg1] = _arg2;
}
public function hasPausedChild():Boolean{
var _local1:TweenCore = (this.gc) ? _endCaps[0] : _firstChild;
while (_local1) {
if (((_local1.cachedPaused) || ((((_local1 is TimelineLite)) && ((_local1 as TimelineLite).hasPausedChild()))))){
return (true);
};
_local1 = _local1.nextNode;
};
return (false);
}
public function getTweensOf(_arg1:Object, _arg2:Boolean=true):Array{
var _local5:int;
var _local3:Array = getChildren(_arg2, true, false);
var _local4:Array = [];
var _local6:uint = _local3.length;
var _local7:uint;
_local5 = 0;
while (_local5 < _local6) {
if (TweenLite(_local3[_local5]).target == _arg1){
var _temp1 = _local7;
_local7 = (_local7 + 1);
var _local8 = _temp1;
_local4[_local8] = _local3[_local5];
};
_local5++;
};
return (_local4);
}
public function gotoAndStop(_arg1, _arg2:Boolean=true):void{
setTotalTime(parseTimeOrLabel(_arg1), _arg2);
this.paused = true;
}
public function append(_arg1:TweenCore, _arg2:Number=0):void{
insert(_arg1, (this.duration + _arg2));
}
override public function get duration():Number{
var _local1:Number;
if (this.cacheIsDirty){
_local1 = this.totalDuration;
};
return (this.cachedDuration);
}
public function get useFrames():Boolean{
var _local1:SimpleTimeline = this.timeline;
while (_local1.timeline) {
_local1 = _local1.timeline;
};
return (Boolean((_local1 == TweenLite.rootFramesTimeline)));
}
public function shiftChildren(_arg1:Number, _arg2:Boolean=false, _arg3:Number=0):void{
var _local5:String;
var _local4:TweenCore = (this.gc) ? _endCaps[0] : _firstChild;
while (_local4) {
if (_local4.cachedStartTime >= _arg3){
_local4.cachedStartTime = (_local4.cachedStartTime + _arg1);
};
_local4 = _local4.nextNode;
};
if (_arg2){
for (_local5 in _labels) {
if (_labels[_local5] >= _arg3){
_labels[_local5] = (_labels[_local5] + _arg1);
};
};
};
this.setDirtyCache(true);
}
public function goto(_arg1, _arg2:Boolean=true):void{
setTotalTime(parseTimeOrLabel(_arg1), _arg2);
}
public function killTweensOf(_arg1:Object, _arg2:Boolean=true, _arg3:Object=null):Boolean{
var _local6:TweenLite;
var _local4:Array = getTweensOf(_arg1, _arg2);
var _local5:int = _local4.length;
while (--_local5 > -1) {
_local6 = _local4[_local5];
if (_arg3 != null){
_local6.killVars(_arg3);
};
if ((((_arg3 == null)) || ((((_local6.cachedPT1 == null)) && (_local6.initted))))){
_local6.setEnabled(false, false);
};
};
return (Boolean((_local4.length > 0)));
}
override public function invalidate():void{
var _local1:TweenCore = (this.gc) ? _endCaps[0] : _firstChild;
while (_local1) {
_local1.invalidate();
_local1 = _local1.nextNode;
};
}
public function insertMultiple(_arg1:Array, _arg2=0, _arg3:String="normal", _arg4:Number=0):void{
var _local5:int;
var _local6:TweenCore;
var _local7:Number = ((Number(_arg2)) || (0));
var _local8:uint = _arg1.length;
if (typeof(_arg2) == "string"){
if (!(_arg2 in _labels)){
addLabel(_arg2, this.duration);
};
_local7 = _labels[_arg2];
};
_local5 = 0;
while (_local5 < _local8) {
_local6 = (_arg1[_local5] as TweenCore);
insert(_local6, _local7);
if (_arg3 == "sequence"){
_local7 = (_local6.cachedStartTime + (_local6.totalDuration / _local6.cachedTimeScale));
} else {
if (_arg3 == "start"){
_local6.cachedStartTime = (_local6.cachedStartTime - _local6.delay);
};
};
_local7 = (_local7 + _arg4);
_local5++;
};
}
public function getLabelTime(_arg1:String):Number{
return (((_arg1 in _labels)) ? Number(_labels[_arg1]) : -1);
}
override public function get rawTime():Number{
if (((!((this.cachedTotalTime == 0))) && (!((this.cachedTotalTime == this.cachedTotalDuration))))){
return (this.cachedTotalTime);
};
return (((this.timeline.rawTime - this.cachedStartTime) * this.cachedTimeScale));
}
override public function set duration(_arg1:Number):void{
if (((!((this.duration == 0))) && (!((_arg1 == 0))))){
this.timeScale = (this.duration / _arg1);
};
}
override public function set totalDuration(_arg1:Number):void{
if (((!((this.totalDuration == 0))) && (!((_arg1 == 0))))){
this.timeScale = (this.totalDuration / _arg1);
};
}
public function getChildren(_arg1:Boolean=true, _arg2:Boolean=true, _arg3:Boolean=true, _arg4:Number=-9999999999):Array{
var _local5:Array = [];
var _local6:uint;
var _local7:TweenCore = (this.gc) ? _endCaps[0] : _firstChild;
while (_local7) {
if (_local7.cachedStartTime < _arg4){
} else {
if ((_local7 is TweenLite)){
if (_arg2){
var _temp1 = _local6;
_local6 = (_local6 + 1);
var _local8 = _temp1;
_local5[_local8] = _local7;
};
} else {
if (_arg3){
var _temp2 = _local6;
_local6 = (_local6 + 1);
_local8 = _temp2;
_local5[_local8] = _local7;
};
if (_arg1){
_local5 = _local5.concat(TimelineLite(_local7).getChildren(true, _arg2, _arg3));
};
};
};
_local7 = _local7.nextNode;
};
return (_local5);
}
protected function forceChildrenToEnd(_arg1:Number, _arg2:Boolean=false):Number{
var _local4:TweenCore;
var _local5:Number;
var _local3:TweenCore = _firstChild;
var _local6:Boolean = this.cachedPaused;
while (_local3) {
_local4 = _local3.nextNode;
if (((this.cachedPaused) && (!(_local6)))){
break;
} else {
if (((_local3.active) || (((((!(_local3.cachedPaused)) && (!(_local3.gc)))) && (((!((_local3.cachedTotalTime == _local3.cachedTotalDuration))) || ((_local3.cachedDuration == 0)))))))){
if ((((_arg1 == this.cachedDuration)) && (((!((_local3.cachedDuration == 0))) || ((_local3.cachedStartTime == this.cachedDuration)))))){
_local3.renderTime((_local3.cachedReversed) ? 0 : _local3.cachedTotalDuration, _arg2, false);
} else {
if (!_local3.cachedReversed){
_local3.renderTime(((_arg1 - _local3.cachedStartTime) * _local3.cachedTimeScale), _arg2, false);
} else {
_local5 = (_local3.cacheIsDirty) ? _local3.totalDuration : _local3.cachedTotalDuration;
_local3.renderTime((_local5 - ((_arg1 - _local3.cachedStartTime) * _local3.cachedTimeScale)), _arg2, false);
};
};
};
};
_local3 = _local4;
};
return (_arg1);
}
protected function forceChildrenToBeginning(_arg1:Number, _arg2:Boolean=false):Number{
var _local4:TweenCore;
var _local5:Number;
var _local3:TweenCore = _lastChild;
var _local6:Boolean = this.cachedPaused;
while (_local3) {
_local4 = _local3.prevNode;
if (((this.cachedPaused) && (!(_local6)))){
break;
} else {
if (((_local3.active) || (((((!(_local3.cachedPaused)) && (!(_local3.gc)))) && (((!((_local3.cachedTotalTime == 0))) || ((_local3.cachedDuration == 0)))))))){
if ((((_arg1 == 0)) && (((!((_local3.cachedDuration == 0))) || ((_local3.cachedStartTime == 0)))))){
_local3.renderTime((_local3.cachedReversed) ? _local3.cachedTotalDuration : 0, _arg2, false);
} else {
if (!_local3.cachedReversed){
_local3.renderTime(((_arg1 - _local3.cachedStartTime) * _local3.cachedTimeScale), _arg2, false);
} else {
_local5 = (_local3.cacheIsDirty) ? _local3.totalDuration : _local3.cachedTotalDuration;
_local3.renderTime((_local5 - ((_arg1 - _local3.cachedStartTime) * _local3.cachedTimeScale)), _arg2, false);
};
};
};
};
_local3 = _local4;
};
return (_arg1);
}
public function insert(_arg1:TweenCore, _arg2=0):void{
if (typeof(_arg2) == "string"){
if (!(_arg2 in _labels)){
addLabel(_arg2, this.duration);
};
_arg2 = Number(_labels[_arg2]);
};
_arg1.cachedStartTime = (Number(_arg2) + _arg1.delay);
addChild(_arg1);
}
override public function addChild(_arg1:TweenCore):void{
var _local4:TweenCore;
var _local5:Number;
if (((!(_arg1.cachedOrphan)) && (_arg1.timeline))){
_arg1.timeline.remove(_arg1, true);
};
_arg1.timeline = this;
if (_arg1.gc){
_arg1.setEnabled(true, true);
};
setDirtyCache(true);
var _local2:TweenCore = (this.gc) ? _endCaps[0] : _firstChild;
var _local3:TweenCore = (this.gc) ? _endCaps[1] : _lastChild;
if (_local3 == null){
_local3 = _arg1;
_local2 = _local3;
_arg1.nextNode = (_arg1.prevNode = null);
} else {
_local4 = _local3;
_local5 = _arg1.cachedStartTime;
while (((!((_local4 == null))) && ((_local5 <= _local4.cachedStartTime)))) {
_local4 = _local4.prevNode;
};
if (_local4 == null){
_local2.prevNode = _arg1;
_arg1.nextNode = _local2;
_arg1.prevNode = null;
_local2 = _arg1;
} else {
if (_local4.nextNode){
_local4.nextNode.prevNode = _arg1;
} else {
if (_local4 == _local3){
_local3 = _arg1;
};
};
_arg1.prevNode = _local4;
_arg1.nextNode = _local4.nextNode;
_local4.nextNode = _arg1;
};
};
_arg1.cachedOrphan = false;
if (this.gc){
_endCaps[0] = _local2;
_endCaps[1] = _local3;
} else {
_firstChild = _local2;
_lastChild = _local3;
};
}
public function get timeScale():Number{
return (this.cachedTimeScale);
}
public function prependMultiple(_arg1:Array, _arg2:String="normal", _arg3:Number=0, _arg4:Boolean=false):void{
var _local5:TimelineLite = new TimelineLite({tweens:_arg1, align:_arg2, stagger:_arg3});
shiftChildren(_local5.duration, _arg4, 0);
insertMultiple(_arg1, 0, _arg2, _arg3);
_local5.kill();
}
override public function setEnabled(_arg1:Boolean, _arg2:Boolean=false):Boolean{
var _local3:TweenCore;
var _local4:TweenCore;
if (_arg1 == this.gc){
if (_arg1){
_local3 = _endCaps[0];
_firstChild = _local3;
_lastChild = _endCaps[1];
_endCaps = [null, null];
} else {
_local3 = _firstChild;
_endCaps = [_firstChild, _lastChild];
_firstChild = (_lastChild = null);
};
while (_local3) {
_local3.setEnabled(_arg1, true);
_local3 = _local3.nextNode;
};
};
return (super.setEnabled(_arg1, _arg2));
}
}
}//package com.greensock
Section 13
//TweenLite (com.greensock.TweenLite)
package com.greensock {
import flash.display.*;
import flash.events.*;
import com.greensock.core.*;
import com.greensock.plugins.*;
import flash.utils.*;
public class TweenLite extends TweenCore {
protected var _hasPlugins:Boolean;
public var propTweenLookup:Object;
public var cachedPT1:PropTween;
protected var _overwrite:uint;
protected var _ease:Function;
public var target:Object;
public var ratio:Number;// = 0
protected var _overwrittenProps:Object;
protected var _notifyPluginsOfEnabled:Boolean;
public static const version:Number = 11.36;
public static var rootTimeline:SimpleTimeline;
public static var fastEaseLookup:Dictionary = new Dictionary(false);
public static var onPluginEvent:Function;
public static var rootFramesTimeline:SimpleTimeline;
public static var defaultEase:Function = TweenLite.easeOut;
public static var plugins:Object = {};
public static var masterList:Dictionary = new Dictionary(false);
public static var overwriteManager:Object;
public static var rootFrame:Number;
public static var killDelayedCallsTo:Function = TweenLite.killTweensOf;
private static var _shape:Shape = new Shape();
protected static var _reservedProps:Object = {ease:1, delay:1, overwrite:1, onComplete:1, onCompleteParams:1, useFrames:1, runBackwards:1, startAt:1, onUpdate:1, onUpdateParams:1, roundProps:1, onStart:1, onStartParams:1, onInit:1, onInitParams:1, onReverseComplete:1, onReverseCompleteParams:1, onRepeat:1, onRepeatParams:1, proxiedEase:1, easeParams:1, yoyo:1, onCompleteListener:1, onUpdateListener:1, onStartListener:1, onReverseCompleteListener:1, onRepeatListener:1, orientToBezier:1, timeScale:1, immediateRender:1, repeat:1, repeatDelay:1, timeline:1, data:1, paused:1};
public function TweenLite(_arg1:Object, _arg2:Number, _arg3:Object){
var _local5:TweenLite;
super(_arg2, _arg3);
this.target = _arg1;
if ((((this.target is TweenCore)) && (this.vars.timeScale))){
this.cachedTimeScale = 1;
};
propTweenLookup = {};
_ease = defaultEase;
_overwrite = (((!((Number(_arg3.overwrite) > -1))) || (((!(overwriteManager.enabled)) && ((_arg3.overwrite > 1)))))) ? overwriteManager.mode : int(_arg3.overwrite);
var _local4:Array = masterList[_arg1];
if (!_local4){
masterList[_arg1] = [this];
} else {
if (_overwrite == 1){
for each (_local5 in _local4) {
if (!_local5.gc){
_local5.setEnabled(false, false);
};
};
masterList[_arg1] = [this];
} else {
_local4[_local4.length] = this;
};
};
if (((this.active) || (this.vars.immediateRender))){
renderTime(0, false, true);
};
}
protected function easeProxy(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (this.vars.proxiedEase.apply(null, arguments.concat(this.vars.easeParams)));
}
override public function renderTime(_arg1:Number, _arg2:Boolean=false, _arg3:Boolean=false):void{
var _local4:Boolean;
var _local5:Number = this.cachedTime;
if (_arg1 >= this.cachedDuration){
this.cachedTotalTime = (this.cachedTime = this.cachedDuration);
this.ratio = 1;
_local4 = true;
if (this.cachedDuration == 0){
if ((((((_arg1 == 0)) || ((_rawPrevTime < 0)))) && (!((_rawPrevTime == _arg1))))){
_arg3 = true;
};
_rawPrevTime = _arg1;
};
} else {
if (_arg1 <= 0){
this.cachedTotalTime = (this.cachedTime = (this.ratio = 0));
if (_arg1 < 0){
this.active = false;
if (this.cachedDuration == 0){
if (_rawPrevTime > 0){
_arg3 = true;
_local4 = true;
};
_rawPrevTime = _arg1;
};
};
if (((this.cachedReversed) && (!((_local5 == 0))))){
_local4 = true;
};
} else {
this.cachedTotalTime = (this.cachedTime = _arg1);
this.ratio = _ease(_arg1, 0, 1, this.cachedDuration);
};
};
if ((((this.cachedTime == _local5)) && (!(_arg3)))){
return;
};
if (!this.initted){
init();
if (((!(_local4)) && (this.cachedTime))){
this.ratio = _ease(this.cachedTime, 0, 1, this.cachedDuration);
};
};
if (((!(this.active)) && (!(this.cachedPaused)))){
this.active = true;
};
if ((((((((_local5 == 0)) && (this.vars.onStart))) && (!((this.cachedTime == 0))))) && (!(_arg2)))){
this.vars.onStart.apply(null, this.vars.onStartParams);
};
var _local6:PropTween = this.cachedPT1;
while (_local6) {
_local6.target[_local6.property] = (_local6.start + (this.ratio * _local6.change));
_local6 = _local6.nextNode;
};
if (((_hasUpdate) && (!(_arg2)))){
this.vars.onUpdate.apply(null, this.vars.onUpdateParams);
};
if (_local4){
if (((_hasPlugins) && (this.cachedPT1))){
onPluginEvent("onComplete", this);
};
complete(true, _arg2);
};
}
override public function setEnabled(_arg1:Boolean, _arg2:Boolean=false):Boolean{
var _local3:Array;
if (_arg1){
_local3 = TweenLite.masterList[this.target];
if (!_local3){
TweenLite.masterList[this.target] = [this];
} else {
_local3[_local3.length] = this;
};
};
super.setEnabled(_arg1, _arg2);
if (((_notifyPluginsOfEnabled) && (this.cachedPT1))){
return (onPluginEvent((_arg1) ? "onEnable" : "onDisable", this));
};
return (false);
}
protected function init():void{
var _local1:String;
var _local2:int;
var _local3:*;
var _local4:Boolean;
var _local5:Array;
var _local6:PropTween;
if (this.vars.onInit){
this.vars.onInit.apply(null, this.vars.onInitParams);
};
if (typeof(this.vars.ease) == "function"){
_ease = this.vars.ease;
};
if (this.vars.easeParams){
this.vars.proxiedEase = _ease;
_ease = easeProxy;
};
this.cachedPT1 = null;
this.propTweenLookup = {};
for (_local1 in this.vars) {
if ((((_local1 in _reservedProps)) && (!((((_local1 == "timeScale")) && ((this.target is TweenCore))))))){
} else {
if ((((_local1 in plugins)) && (new ((plugins[_local1] as Class)).onInitTween(this.target, this.vars[_local1], this)))){
this.cachedPT1 = new PropTween(_local3, "changeFactor", 0, 1, ((_local3.overwriteProps.length)==1) ? _local3.overwriteProps[0] : "_MULTIPLE_", true, this.cachedPT1);
if (this.cachedPT1.name == "_MULTIPLE_"){
_local2 = _local3.overwriteProps.length;
while (--_local2 > -1) {
this.propTweenLookup[_local3.overwriteProps[_local2]] = this.cachedPT1;
};
} else {
this.propTweenLookup[this.cachedPT1.name] = this.cachedPT1;
};
if (_local3.priority){
this.cachedPT1.priority = _local3.priority;
_local4 = true;
};
if (((_local3.onDisable) || (_local3.onEnable))){
_notifyPluginsOfEnabled = true;
};
_hasPlugins = true;
} else {
this.cachedPT1 = new PropTween(this.target, _local1, Number(this.target[_local1]), ((typeof(this.vars[_local1]))=="number") ? (Number(this.vars[_local1]) - this.target[_local1]) : Number(this.vars[_local1]), _local1, false, this.cachedPT1);
this.propTweenLookup[_local1] = this.cachedPT1;
};
};
};
if (_local4){
onPluginEvent("onInit", this);
};
if (this.vars.runBackwards){
_local6 = this.cachedPT1;
while (_local6) {
_local6.start = (_local6.start + _local6.change);
_local6.change = -(_local6.change);
_local6 = _local6.nextNode;
};
};
_hasUpdate = Boolean(!((this.vars.onUpdate == null)));
if (_overwrittenProps){
killVars(_overwrittenProps);
if (this.cachedPT1 == null){
this.setEnabled(false, false);
};
};
if ((((((((_overwrite > 1)) && (this.cachedPT1))) && (masterList[this.target]))) && ((_local5.length > 1)))){
if (overwriteManager.manageOverwrites(this, this.propTweenLookup, _local5, _overwrite)){
init();
};
};
this.initted = true;
}
public function killVars(_arg1:Object, _arg2:Boolean=true):Boolean{
var _local3:String;
var _local4:PropTween;
var _local5:Boolean;
if (_overwrittenProps == null){
_overwrittenProps = {};
};
for (_local3 in _arg1) {
if ((_local3 in propTweenLookup)){
_local4 = propTweenLookup[_local3];
if (((_local4.isPlugin) && ((_local4.name == "_MULTIPLE_")))){
_local4.target.killProps(_arg1);
if (_local4.target.overwriteProps.length == 0){
_local4.name = "";
};
};
if (_local4.name != "_MULTIPLE_"){
if (_local4.nextNode){
_local4.nextNode.prevNode = _local4.prevNode;
};
if (_local4.prevNode){
_local4.prevNode.nextNode = _local4.nextNode;
} else {
if (this.cachedPT1 == _local4){
this.cachedPT1 = _local4.nextNode;
};
};
if (((_local4.isPlugin) && (_local4.target.onDisable))){
_local4.target.onDisable();
if (_local4.target.activeDisable){
_local5 = true;
};
};
delete propTweenLookup[_local3];
};
};
if (((_arg2) && (!((_arg1 == _overwrittenProps))))){
_overwrittenProps[_local3] = 1;
};
};
return (_local5);
}
override public function invalidate():void{
if (((_notifyPluginsOfEnabled) && (this.cachedPT1))){
onPluginEvent("onDisable", this);
};
this.cachedPT1 = null;
_overwrittenProps = null;
_hasUpdate = (this.initted = (this.active = (_notifyPluginsOfEnabled = false)));
this.propTweenLookup = {};
}
public static function initClass():void{
rootFrame = 0;
rootTimeline = new SimpleTimeline(null);
rootFramesTimeline = new SimpleTimeline(null);
rootTimeline.cachedStartTime = (getTimer() * 0.001);
rootFramesTimeline.cachedStartTime = rootFrame;
rootTimeline.autoRemoveChildren = true;
rootFramesTimeline.autoRemoveChildren = true;
_shape.addEventListener(Event.ENTER_FRAME, updateAll, false, 0, true);
if (overwriteManager == null){
overwriteManager = {mode:1, enabled:false};
};
}
public static function killTweensOf(_arg1:Object, _arg2:Boolean=false, _arg3:Object=null):void{
var _local4:Array;
var _local5:int;
var _local6:TweenLite;
if ((_arg1 in masterList)){
_local4 = masterList[_arg1];
_local5 = _local4.length;
while (--_local5 > -1) {
_local6 = _local4[_local5];
if (!_local6.gc){
if (_arg2){
_local6.complete(false, false);
};
if (_arg3 != null){
_local6.killVars(_arg3);
};
if ((((_arg3 == null)) || ((((_local6.cachedPT1 == null)) && (_local6.initted))))){
_local6.setEnabled(false, false);
};
};
};
if (_arg3 == null){
delete masterList[_arg1];
};
};
}
public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
_arg3.runBackwards = true;
if (!("immediateRender" in _arg3)){
_arg3.immediateRender = true;
};
return (new TweenLite(_arg1, _arg2, _arg3));
}
protected static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (1 - (_arg1 / _arg4));
return ((1 - (_arg1 * _arg1)));
}
public static function delayedCall(_arg1:Number, _arg2:Function, _arg3:Array=null, _arg4:Boolean=false):TweenLite{
return (new TweenLite(_arg2, 0, {delay:_arg1, onComplete:_arg2, onCompleteParams:_arg3, immediateRender:false, useFrames:_arg4, overwrite:0}));
}
protected static function updateAll(_arg1:Event=null):void{
var _local2:Dictionary;
var _local3:Object;
var _local4:Array;
var _local5:int;
rootTimeline.renderTime((((getTimer() * 0.001) - rootTimeline.cachedStartTime) * rootTimeline.cachedTimeScale), false, false);
rootFrame++;
rootFramesTimeline.renderTime(((rootFrame - rootFramesTimeline.cachedStartTime) * rootFramesTimeline.cachedTimeScale), false, false);
if (!(rootFrame % 60)){
_local2 = masterList;
for (_local3 in _local2) {
_local4 = _local2[_local3];
_local5 = _local4.length;
while (--_local5 > -1) {
if (TweenLite(_local4[_local5]).gc){
_local4.splice(_local5, 1);
};
};
if (_local4.length == 0){
delete _local2[_local3];
};
};
};
}
public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
return (new TweenLite(_arg1, _arg2, _arg3));
}
}
}//package com.greensock
Section 14
//IKeyboardEvent (lj.src.interfaces.IKeyboardEvent)
package lj.src.interfaces {
import flash.events.*;
public interface IKeyboardEvent {
function handleKeyDown(_arg1:KeyboardEvent):void;
function handleKeyUp(_arg1:KeyboardEvent):void;
}
}//package lj.src.interfaces
Section 15
//IMouseEvent (lj.src.interfaces.IMouseEvent)
package lj.src.interfaces {
import flash.events.*;
public interface IMouseEvent {
function handleMouseEvent(_arg1:MouseEvent):void;
}
}//package lj.src.interfaces
Section 16
//IUpdate (lj.src.interfaces.IUpdate)
package lj.src.interfaces {
public interface IUpdate {
function updateEvents():void;
function remove():void;
function pause():void;
function replay():void;
}
}//package lj.src.interfaces
Section 17
//Array2D (lj.src.structure.Array2D)
package lj.src.structure {
public dynamic class Array2D extends Array {
public var col:int;
public var row:int;
public function Array2D(_arg1:int=0, _arg2:int=0, _arg3:Array=null){
var _local5:int;
super(_arg1);
var _local4:int;
while (_local4 < _arg1) {
this[_local4] = new Array();
_local5 = 0;
while (_local5 < _arg2) {
this[_local4].push(0);
_local5++;
};
_local4++;
};
col = _arg1;
row = _arg2;
this.data = _arg3;
}
public function set data(_arg1:Array):void{
var _local2:int;
var _local3:int;
if (_arg1){
_local2 = 0;
while (_local2 < _arg1.length) {
this[_local2] = _arg1[_local2];
_local3 = 0;
while (_local3 < _arg1[_local2].length) {
this[_local2][_local3] = _arg1[_local2][_local3];
_local3++;
};
_local2++;
};
};
}
public function toString():String{
var _local3:int;
var _local1 = "[ \n";
var _local2:int;
while (_local2 < length) {
_local1 = (_local1 + "[ ");
_local3 = 0;
while (_local3 < this[_local2].length) {
_local1 = (_local1 + (this[_local2][_local3] + ","));
_local3++;
};
_local1 = (_local1 + " ], \n");
_local2++;
};
_local1 = (_local1 + " ]");
return (_local1);
}
}
}//package lj.src.structure
Section 18
//GameControl (lj.src.sys.GameControl)
package lj.src.sys {
import flash.display.*;
import flash.events.*;
import lj.src.interfaces.*;
import lj.src.util.*;
public class GameControl {
protected var mouseHDArr:Array;
private var _stage:Stage;
protected var keyboardHDArr:Array;
public static const MOUSE:String = "mouse";
public static const KEYBOARD:String = "keyboard";
public function GameControl(){
_stage = Global.stage;
mouseHDArr = new Array();
keyboardHDArr = new Array();
_stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHD);
_stage.addEventListener(KeyboardEvent.KEY_UP, keyUpHD);
_stage.addEventListener(MouseEvent.MOUSE_DOWN, onMyMouseDown);
_stage.addEventListener(MouseEvent.MOUSE_UP, onMyMouseUp);
_stage.addEventListener(MouseEvent.MOUSE_MOVE, onMyMouseMove);
_stage.addEventListener(MouseEvent.MOUSE_OVER, onMyMouseOver);
_stage.addEventListener(MouseEvent.MOUSE_OUT, onMyMouseOut);
_stage.addEventListener(MouseEvent.MOUSE_WHEEL, onMyMouseWheel);
_stage.addEventListener(MouseEvent.CLICK, onMyMouseClick);
}
protected function onMyMouseWheel(_arg1:MouseEvent):void{
doMouseEvent("Wheel", _arg1);
}
public function remove():void{
mouseHDArr.splice(0);
mouseHDArr = null;
keyboardHDArr.splice(0);
keyboardHDArr = null;
_stage.removeEventListener(KeyboardEvent.KEY_DOWN, keyDownHD);
_stage.removeEventListener(KeyboardEvent.KEY_UP, keyUpHD);
_stage.removeEventListener(MouseEvent.MOUSE_DOWN, onMyMouseDown);
_stage.removeEventListener(MouseEvent.MOUSE_UP, onMyMouseUp);
_stage.removeEventListener(MouseEvent.MOUSE_MOVE, onMyMouseMove);
_stage.removeEventListener(MouseEvent.MOUSE_WHEEL, onMyMouseWheel);
_stage.removeEventListener(MouseEvent.CLICK, onMyMouseClick);
_stage = null;
}
protected function doKeyboardEvent(_arg1:String, _arg2:KeyboardEvent):void{
var _local3:int;
while (_local3 < keyboardHDArr.length) {
var _local4 = keyboardHDArr[_local3];
_local4[("handleKey" + _arg1)](_arg2);
_local3++;
};
}
protected function onMyMouseDown(_arg1:MouseEvent):void{
doMouseEvent("Down", _arg1);
}
private function keyDownHD(_arg1:KeyboardEvent):void{
var _local2:int = _arg1.keyCode;
doKeyboardEvent("Down", _arg1);
}
protected function onMyMouseUp(_arg1:MouseEvent):void{
doMouseEvent("Up", _arg1);
}
protected function onMyMouseClick(_arg1:MouseEvent):void{
doMouseEvent("Click", _arg1);
}
protected function doMouseEvent(_arg1:String, _arg2:MouseEvent):void{
var _local3:int;
while (_local3 < mouseHDArr.length) {
mouseHDArr[_local3].handleMouseEvent(_arg2);
_local3++;
};
}
protected function onMyMouseMove(_arg1:MouseEvent):void{
doMouseEvent("Move", _arg1);
}
protected function onMyMouseOut(_arg1:MouseEvent):void{
doMouseEvent("Out", _arg1);
}
public function removeMouseListener(_arg1:IMouseEvent):void{
GameUtil.removeObjInArr(mouseHDArr, _arg1);
}
private function keyUpHD(_arg1:KeyboardEvent):void{
var _local2:int = _arg1.keyCode;
doKeyboardEvent("Up", _arg1);
}
public function addMouseListener(_arg1:IMouseEvent):void{
mouseHDArr.push(_arg1);
}
public function addKeyboardListener(_arg1:IKeyboardEvent):void{
keyboardHDArr.push(_arg1);
}
protected function onMyMouseOver(_arg1:MouseEvent):void{
doMouseEvent("Over", _arg1);
}
public function removeKeyBoardListener(_arg1:IKeyboardEvent):void{
GameUtil.removeObjInArr(keyboardHDArr, _arg1);
}
}
}//package lj.src.sys
Section 19
//Global (lj.src.sys.Global)
package lj.src.sys {
import flash.display.*;
import lj.src.util.*;
public class Global {
public static var control:GameControl;
public static var updateArr:Array;
public static var xmlLoader:XMLLoader;
public static var scene:DisplayObjectContainer;
public static var canControl:Boolean = true;
public static var myKeySet:Object;
public static var loader:DynamicLoader;
public static var removeArr:Array;
public static var pause:Boolean = true;
public static var docSprite:Sprite;
public static var stage:Stage;
public static var language:String = "english";
}
}//package lj.src.sys
Section 20
//GV (lj.src.sys.GV)
package lj.src.sys {
public class GV {
public static const keyArr:Array = [[32, "SPACE"], [17, "CTRL"], [16, "SHIFT"], [20, "CAPS"], [27, "ESC"], [8, "BACK"], [112, "F1"], [113, "F2"], [114, "F3"], [115, "F4"], [116, "F5"], [117, "F6"], [118, "F7"], [119, "F8"], [120, "F9"], [121, "F10"], [122, "F11"], [123, "F12"], [19, "SCRLK"], [45, "INSERT"], [36, "HOME"], [33, "PAGEUP"], [34, "PAGEDN"], [46, "DEL"], [35, "END"], [38, "↑"], [40, "↓"], [37, "←"], [39, "→"], [13, "ENTER"], [144, "NUMLOCK"]];
public static const KeySpaceCode:int = 32;
public static const KeyAcode:int = 65;
public static const KeyCcode:int = 67;
public static const KeyDcode:int = 68;
public static const KeyGcode:int = 71;
public static const KeyHcode:int = 72;
public static const KeyIcode:int = 73;
public static const KeyJcode:int = 74;
public static const KeyKcode:int = 75;
public static const KeyLcode:int = 76;
public static const KeyMcode:int = 77;
public static const KeyNcode:int = 78;
public static const KeyPcode:int = 80;
public static const KeyQcode:int = 81;
public static const Key2Code:int = 50;
public static const KeyScode:int = 83;
public static const Key4Code:int = 52;
public static const Key5Code:int = 53;
public static const Key6Code:int = 54;
public static const KeyWcode:int = 87;
public static const KeyXcode:int = 88;
public static const Key9Code:int = 57;
public static const KeyZcode:int = 90;
public static const Key7Code:int = 55;
public static const Key8Code:int = 56;
public static const Key1Code:int = 49;
public static const Key3Code:int = 51;
public static const Key0Code:int = 48;
}
}//package lj.src.sys
Section 21
//Main (lj.src.sys.Main)
package lj.src.sys {
import flash.display.*;
import flash.events.*;
import lj.src.util.*;
public class Main {
private static var _startFunc:Function;
public static var _loaderName:Array = ["assets"];
public static function initOptions(_arg1:String="high", _arg2:Number=1, _arg3:Number=1):void{
if (SaveMgr.loadData("quality") == undefined){
SaveMgr.saveData("quality", _arg1);
};
Global.stage.quality = SaveMgr.loadData("quality");
if (SaveMgr.loadData("soundVolume") == undefined){
SaveMgr.saveData("soundVolume", _arg2);
};
SoundObject.soundvolume(SaveMgr.loadData("soundVolume"));
if (SaveMgr.loadData("musicVolume") == undefined){
SaveMgr.saveData("musicVolume", _arg3);
};
SoundObject.musicvolume(SaveMgr.loadData("musicVolume"));
}
public static function setQuality(_arg1:String):void{
SaveMgr.saveData("quality", _arg1);
Global.stage.quality = _arg1;
}
private static function load():void{
var _local1:Array = _loaderName;
var _local2:DynamicLoader = new DynamicLoader();
_local2.load(GameUtil.clone(_local1), null);
_local2.addEventListener(Event.COMPLETE, onLoaderComplete);
Global.loader = _local2;
}
public static function loadInit(_arg1:Stage, _arg2:Sprite, _arg3:Function, _arg4:Array=null):void{
_arg1.scaleMode = StageScaleMode.NO_SCALE;
Global.stage = _arg1;
Global.docSprite = _arg2;
_startFunc = _arg3;
if (((_arg4) && (_arg4.length))){
_loaderName = _arg4;
load();
trace("Load!");
} else {
_startFunc.call(null);
};
}
private static function onLoaderComplete(_arg1:Event):void{
_arg1.target.removeEventListener(Event.COMPLETE, onLoaderComplete);
_startFunc.call(null);
}
public static function setVolume(_arg1:Number, _arg2:String):void{
SaveMgr.saveData((_arg2 + "Volume"), _arg1);
var _local3 = SoundObject;
_local3[(_arg2 + "volume")](_arg1);
}
public static function initKeyShareObj(_arg1:Object):void{
if (!SaveMgr.loadData("keyset")){
SaveMgr.saveData("keyset", _arg1);
};
Global.myKeySet = SaveMgr.loadData("keyset");
}
}
}//package lj.src.sys
Section 22
//SaveMgr (lj.src.sys.SaveMgr)
package lj.src.sys {
import flash.net.*;
public class SaveMgr {
protected static const minDiskSpace:int = 2000;
protected static var localInfo:SharedObject;
public static function init(_arg1:String):void{
var _local2:Object;
localInfo = SharedObject.getLocal(_arg1);
if (!localInfo.data.saveObj){
_local2 = new Object();
localInfo.data.saveObj = _local2;
};
localInfo.flush(minDiskSpace);
}
public static function flush():void{
localInfo.flush(minDiskSpace);
}
public static function saveData(_arg1:String, _arg2):void{
localInfo.data.saveObj[_arg1] = _arg2;
}
public static function clear():void{
delete localInfo.data.saveObj;
}
public static function loadData(_arg1:String){
return (localInfo.data.saveObj[_arg1]);
}
}
}//package lj.src.sys
Section 23
//DynamicLoader (lj.src.util.DynamicLoader)
package lj.src.util {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import lj.src.sys.*;
import flash.net.*;
public class DynamicLoader extends EventDispatcher {
protected const PATH:String = "res/";
public var loaderArr:Array;
private var _loadPercentTxt:TextField;
protected var totalNum:int;
protected var nextLoadArr:Array;
private var _loadNumTxt:TextField;
protected var curLoadArr:Array;
protected var _completeFunc:Function;
public function DynamicLoader(){
loaderArr = new Array();
curLoadArr = new Array();
nextLoadArr = new Array();
createText();
}
protected function allComplete():void{
_loadNumTxt.parent.removeChild(_loadNumTxt);
_loadPercentTxt.parent.removeChild(_loadPercentTxt);
trace("全部读取完毕!");
dispatchEvent(new Event(Event.COMPLETE));
}
protected function checkLoader(_arg1:String):Boolean{
return (GameUtil.checkInArr(loaderArr, _arg1, "name"));
}
protected function createText():void{
_loadNumTxt = new TextField();
Global.stage.addChild(_loadNumTxt);
_loadNumTxt.x = 200;
_loadNumTxt.y = 250;
_loadNumTxt.textColor = 0xFFFFFF;
_loadPercentTxt = new TextField();
Global.stage.addChild(_loadPercentTxt);
_loadPercentTxt.x = 350;
_loadPercentTxt.y = 250;
_loadPercentTxt.textColor = 0xFFFFFF;
}
public function remove():void{
loaderArr.splice(0);
}
protected function loadSingle():void{
var _local1:String;
var _local2:String;
var _local3:Loader;
if (curLoadArr.length){
_local1 = curLoadArr[0];
if (!checkLoader(_local1)){
_loadNumTxt.text = ((((totalNum - curLoadArr.length) + 1) + "/") + totalNum);
_local2 = ((PATH + _local1) + ".swf");
_local3 = new Loader();
_local3.name = _local1;
_local3.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loadProgress);
_local3.contentLoaderInfo.addEventListener(Event.COMPLETE, singleComplete);
_local3.load(new URLRequest(_local2));
} else {
loadComplete();
};
} else {
allComplete();
};
}
protected function singleComplete(_arg1:Event):void{
var _local2:LoaderInfo = (_arg1.target as LoaderInfo);
_local2.removeEventListener(Event.COMPLETE, singleComplete);
loaderArr.push(_local2.loader);
loadComplete();
}
public function load(_arg1:Array, _arg2:Function):void{
_completeFunc = _arg2;
if (!curLoadArr.length){
curLoadArr = _arg1;
totalNum = _arg1.length;
loadSingle();
} else {
nextLoadArr = _arg1;
totalNum = (_arg1.length + 1);
curLoadArr.splice(1);
};
}
private function loadProgress(_arg1:ProgressEvent):void{
var _local2:LoaderInfo = (_arg1.target as LoaderInfo);
var _local3:Number = (Math.floor(((_local2.bytesLoaded / _local2.bytesTotal) * 10000)) / 100);
_loadPercentTxt.text = (_local3.toString() + "% Loaded");
}
protected function loadComplete():void{
curLoadArr.shift();
if (nextLoadArr.length){
curLoadArr = nextLoadArr;
} else {
if (curLoadArr.length > 0){
};
};
loadSingle();
if (_completeFunc != null){
_completeFunc();
};
}
}
}//package lj.src.util
Section 24
//FPSShow (lj.src.util.FPSShow)
package lj.src.util {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.utils.*;
public class FPSShow extends Sprite {
private var txt:TextField;
private var _timer:uint;
private var _totalCount:uint;
private var count:int;// = 0
public function FPSShow(){
mouseChildren = false;
mouseEnabled = false;
init();
}
private function timerHandler(_arg1:TimerEvent):void{
txt.text = ("FPS:" + count.toString());
count = 0;
}
private function init():void{
var _local1:uint;
txt = new TextField();
txt.textColor = 0xFFFFFF;
txt.background = true;
txt.backgroundColor = 0;
txt.autoSize = TextFieldAutoSize.LEFT;
addChild(txt);
var _local2:Timer = new Timer(1000);
_local2.addEventListener("timer", timerHandler);
_local2.start();
addEventListener("enterFrame", countHandler);
}
private function countHandler(_arg1:Event):void{
count++;
_totalCount++;
}
}
}//package lj.src.util
Section 25
//GameUtil (lj.src.util.GameUtil)
package lj.src.util {
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import lj.src.sys.*;
import flash.utils.*;
import flash.filters.*;
public class GameUtil {
public static var nonTrans:ColorTransform = new ColorTransform(1, 1, 1, 1, 0, 0, 0, 0);
public static var whiteTrans:ColorTransform = new ColorTransform(0.6, 0.6, 0.6, 1, 100, 100, 100, 0);
public static function StrDiscardNum(_arg1:String):String{
var _local4:int;
var _local2 = "";
var _local3:int;
while (_local3 < _arg1.length) {
_local4 = _arg1.charCodeAt(_local3);
if ((((_local4 >= 48)) && ((_local4 <= 57)))){
} else {
_local2 = _local2.concat(_arg1.charAt(_local3));
};
_local3++;
};
return (_local2);
}
public static function getClass(_arg1:String, _arg2:String):Class{
var tempClass:Class;
var i:int;
var loader:Loader;
var loaderName = _arg1;
var className = _arg2;
try {
tempClass = (getDefinitionByName(className) as Class);
} catch(e:Error) {
i = 0;
while (i < Global.loader.loaderArr.length) {
try {
loader = Global.loader.loaderArr[i];
tempClass = (loader.contentLoaderInfo.applicationDomain.getDefinition(className) as Class);
} catch(e:Error) {
};
i = (i + 1);
};
};
return (tempClass);
}
public static function addSprite(_arg1:String, _arg2:String, _arg3:DisplayObjectContainer, _arg4:int, _arg5:int):Sprite{
var _local6:Class = (getDefinitionByName(((_arg2 + ".") + _arg1)) as Class);
var _local7:Sprite = new (_local6);
_local7.x = _arg4;
_local7.y = _arg5;
_arg3.addChild(_local7);
return (_local7);
}
public static function getColorBy2Muti2(_arg1:Sprite, _arg2:Number, _arg3:Number):uint{
var _local4:int = getTimer();
var _local5:BitmapData = new BitmapData(2, 2, true, 4294967295);
var _local6:Matrix = new Matrix();
_local6.tx = -(_arg2);
_local6.ty = -(_arg3);
_local5.draw(_arg1, _local6);
var _local7:uint = _local5.getPixel(1, 1);
_local5.dispose();
var _local8:int = getTimer();
return (_local7);
}
public static function createMask(_arg1:Sprite, _arg2:Number, _arg3:Number):void{
var _local4:Shape = new Shape();
_local4.graphics.beginFill(0);
_local4.graphics.drawRect(0, 0, _arg2, _arg3);
_local4.graphics.endFill();
_arg1.mask = _local4;
_arg1.addChild(_local4);
}
public static function addChild(_arg1:DisplayObject, _arg2:DisplayObjectContainer, _arg3:Number, _arg4:Number):void{
_arg1.x = _arg3;
_arg1.y = _arg4;
_arg2.addChild(_arg1);
}
public static function setDrawStyle():void{
}
public static function randomBetween(_arg1:Number, _arg2:Number):Number{
return (((_arg1 < _arg2)) ? ((Math.random() * (_arg2 - _arg1)) + _arg1) : 0);
}
public static function setGrayColor(_arg1:DisplayObject):void{
var _local2:Array = [0.3086, 0.6094, 0.082, 0, 0, 0.3086, 0.6094, 0.082, 0, 0, 0.3086, 0.6094, 0.082, 0, 0, 0, 0, 0, 1, 0];
applyColorFilter(_arg1, _local2);
}
public static function deleteMask(_arg1:Sprite):void{
if (_arg1.mask != null){
_arg1.removeChild(_arg1.mask);
_arg1.mask = null;
};
}
public static function getMirrorXAngle(_arg1:Number):Number{
var _local2:Number;
if (_arg1 > 360){
_arg1 = (_arg1 - 360);
} else {
if (_arg1 < 0){
_arg1 = (_arg1 + 360);
};
};
_local2 = (360 - _arg1);
return (_local2);
}
public static function checkNumBetween(_arg1:Number, _arg2:Number, _arg3:Number):Boolean{
var _local4:Boolean;
if ((((_arg1 < _arg2)) && ((_arg1 > _arg3)))){
_local4 = true;
};
return (_local4);
}
public static function setColorTransform(_arg1:DisplayObject, _arg2:ColorTransform):void{
_arg1.transform.colorTransform = _arg2;
}
public static function checkInArr(_arg1:Array, _arg2:Object, _arg3=""):Boolean{
var _local5:*;
var _local4:Boolean;
if (((!((_arg3 is int))) && ((_arg3 == "")))){
if (_arg1.indexOf(_arg2) != -1){
_local4 = true;
};
} else {
for each (_local5 in _arg1) {
if (_local5[_arg3] == _arg2){
_local4 = true;
break;
};
};
};
return (_local4);
}
public static function setScoreNum(_arg1:int, _arg2:int, _arg3:MovieClip=null):Array{
var _local4:Array = new Array();
var _local5:int = _arg1;
var _local6:uint;
while (_local6 < _arg2) {
_local4.push((_local5 % 10));
_local5 = int((_local5 / 10));
if (_arg3 != null){
(_arg3.getChildAt(_local6) as MovieClip).gotoAndStop((_local4[_local6] + 1));
};
_local6++;
};
return (_local4);
}
public static function getDir(_arg1:Number):int{
return (((_arg1 == 0)) ? 1 : (Math.abs(_arg1) / _arg1));
}
public static function addColorTransform(_arg1:Sprite, _arg2:ColorTransform):void{
_arg1.transform.colorTransform = _arg2;
}
public static function removeFilter(_arg1:DisplayObject):void{
var _local2:Array = new Array();
_arg1.filters = _local2;
}
public static function to360StdDegree(_arg1:Number):Number{
if (_arg1 < 0){
_arg1 = (_arg1 + 360);
};
return (_arg1);
}
public static function numToStr(_arg1:int, _arg2:int):String{
var _local5:int;
var _local3 = "";
var _local4:int = _arg2;
while (_local4 > 0) {
_local5 = (_arg1 / Math.pow(10, (_local4 - 1)));
_local3 = _local3.concat(_local5.toString());
_local4--;
};
return (_local3);
}
public static function ToTime(_arg1:int):Object{
var _local2:int = (_arg1 / 3600);
var _local3:int = ((_arg1 - (3600 * _local2)) / 60);
_arg1 = ((_arg1 - (3600 * _local2)) - (60 * _local3));
return ({h:_local2, m:_local3, s:_arg1});
}
public static function depthManager3D(_arg1:DisplayObjectContainer, _arg2:Array):void{
var _local3:int;
if (_arg2){
_arg2.sortOn(["my_y", "my_x", "my_z"], [Array.NUMERIC, Array.NUMERIC, (Array.NUMERIC | Array.DESCENDING)]);
_local3 = 0;
while (_local3 < _arg2.length) {
if (_arg2[_local3].mc){
_arg1.setChildIndex(_arg2[_local3].mc, _local3);
} else {
trace("Warning!!!!!! 深度数组的MC不存在!!!!!");
};
_local3++;
};
};
}
public static function depthManager(_arg1:DisplayObjectContainer, _arg2:Object):void{
var _local3:Array = new Array();
var _local4:int = _arg1.numChildren;
var _local5:int;
while (_local5 < _local4) {
_local3.push(_arg1.getChildAt(_local5));
_local5++;
};
_local3.sortOn(_arg2, Array.NUMERIC);
_local4 = _local3.length;
_local5 = 0;
while (_local5 < _local4) {
_arg1.setChildIndex((_local3[_local5] as DisplayObject), _local5);
_local5++;
};
}
public static function clone(_arg1:Object){
var _local2:ByteArray = new ByteArray();
_local2.writeObject(_arg1);
_local2.position = 0;
return (_local2.readObject());
}
public static function toDegree(_arg1:Number):Number{
return (((_arg1 * 180) / Math.PI));
}
public static function removeObjInArr(_arg1:Array, _arg2:Object, _arg3=""):Boolean{
var _local6:int;
var _local7:*;
var _local4:Boolean;
var _local5:Object = _arg2;
if (_arg1){
if (_arg3 != ""){
for each (_local7 in _arg1) {
if (_local7[_arg3] == _arg2){
_local5 = _local7;
break;
};
};
};
_local6 = _arg1.indexOf(_local5);
if (_local6 != -1){
_arg1.splice(_local6, 1);
_local4 = true;
};
};
return (_local4);
}
public static function setMCEnable(_arg1:MovieClip, _arg2:Boolean):void{
_arg1.enabled = _arg2;
_arg1.mouseEnabled = _arg2;
_arg1.mouseChildren = false;
_arg1.buttonMode = _arg2;
if (_arg2){
removeFilter(_arg1);
} else {
setGrayColor(_arg1);
};
}
public static function getDistance(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (Math.sqrt((Math.pow((_arg3 - _arg1), 2) + Math.pow((_arg4 - _arg2), 2))));
}
public static function checkPointInCircle(_arg1:Point, _arg2:Point, _arg3:Number):Boolean{
var _local4:Boolean;
if ((Math.pow((_arg1.x - _arg2.x), 2) + Math.pow((_arg1.y - _arg2.y), 2)) <= (_arg3 * _arg3)){
_local4 = true;
};
return (_local4);
}
public static function applyColorFilter(_arg1:DisplayObject, _arg2:Array):void{
var _local3:ColorMatrixFilter;
var _local4:Array;
if (_arg1){
_local3 = new ColorMatrixFilter(_arg2);
_local4 = new Array();
_local4.push(_local3);
_arg1.filters = _local4;
};
}
public static function addText(_arg1:DisplayObjectContainer, _arg2:uint, _arg3:Boolean, _arg4:uint, _arg5:String="left"):TextField{
var _local6:TextField = new TextField();
_local6.textColor = _arg2;
_local6.background = _arg3;
_local6.backgroundColor = _arg4;
_local6.autoSize = _arg5;
_arg1.addChild(_local6);
return (_local6);
}
public static function getMirrorYAngle(_arg1:Number):Number{
var _local2:Number;
if (_arg1 > 360){
_arg1 = (_arg1 - 360);
} else {
if (_arg1 < 0){
_arg1 = (_arg1 + 360);
};
};
if ((((_arg1 > 0)) && ((_arg1 <= 180)))){
_local2 = (180 - _arg1);
} else {
if ((((_arg1 > 180)) && ((_arg1 <= 360)))){
_local2 = (540 - _arg1);
};
};
return (_local2);
}
public static function getRadiansBy2Point(_arg1:Point, _arg2:Point):Number{
var _local3:Number;
var _local4:Number = (_arg2.x - _arg1.x);
var _local5:Number = (_arg2.y - _arg1.y);
if (!_local4){
_local3 = (((Math.PI / 2) * Math.abs(_local5)) / _local5);
} else {
_local3 = Math.atan2(_local5, _local4);
};
return (_local3);
}
public static function checkHit(_arg1:Point, _arg2:DisplayObject, _arg3:DisplayObjectContainer):Boolean{
var _local4:Boolean;
var _local5:Point = _arg3.localToGlobal(_arg1);
if (_arg2.hitTestPoint(_local5.x, _local5.y, true)){
_local4 = true;
};
return (_local4);
}
public static function applyGlowFilter(_arg1:DisplayObject, _arg2:uint=0xFF0000, _arg3:Number=1, _arg4:Number=6, _arg5:Number=6, _arg6:Number=2, _arg7:int=1, _arg8:Boolean=false, _arg9:Boolean=false):void{
var _local10:GlowFilter = new GlowFilter(_arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9);
var _local11:Array = new Array();
_local11.push(_local10);
_arg1.filters = _local11;
}
public static function getArrNextIndex(_arg1:int, _arg2:int, _arg3:int):int{
_arg2 = (_arg2 + _arg3);
if (_arg2 >= _arg1){
_arg2 = (_arg2 - _arg1);
} else {
if (_arg2 < 0){
_arg2 = (_arg2 + _arg1);
};
};
return (_arg2);
}
public static function getColorByBMD(_arg1:BitmapData, _arg2:Number, _arg3:Number):uint{
var _local4:int = getTimer();
var _local5:uint = _arg1.getPixel(_arg2, _arg3);
var _local6:int = getTimer();
return (_local5);
}
public static function getDegreeBy2Point(_arg1:Point, _arg2:Point):Number{
var _local3:int;
var _local4:Number = (_arg2.x - _arg1.x);
var _local5:Number = (_arg2.y - _arg1.y);
_local3 = (Math.atan2(_local5, _local4) / 0.0174);
return (_local3);
}
public static function createTextField(_arg1:DisplayObjectContainer, _arg2:Number, _arg3:Number):TextField{
var _local4:TextField = new TextField();
_local4.x = _arg2;
_local4.y = _arg3;
_local4.autoSize = TextFieldAutoSize.CENTER;
_local4.selectable = false;
_local4.border = true;
_local4.background = true;
_local4.backgroundColor = 0xFFFFFF;
_local4.textColor = 0xFF0000;
_arg1.addChild(_local4);
return (_local4);
}
public static function randomArrObj(_arg1:Array):Array{
var _local5:int;
var _local2:int = _arg1.length;
var _local3:Array = new Array();
var _local4:int;
while (_local4 < _local2) {
_local5 = (Math.random() * _arg1.length);
_local3.push(_arg1[_local5]);
_arg1.splice(_local5, 1);
_local4++;
};
return (_local3);
}
public static function getSign(_arg1:Number):int{
return (((_arg1 == 0)) ? 0 : (Math.abs(_arg1) / _arg1));
}
public static function getObjInArr(_arg1:Array, _arg2:Object, _arg3):Object{
var _local5:*;
var _local4:Object;
if (_arg1){
for each (_local5 in _arg1) {
if (_local5[_arg3] == _arg2){
_local4 = _local5;
break;
};
};
};
return (_local4);
}
public static function setBtnEnable(_arg1:SimpleButton, _arg2:Boolean):void{
_arg1.enabled = _arg2;
_arg1.mouseEnabled = _arg2;
if (_arg2){
removeFilter(_arg1);
} else {
setGrayColor(_arg1);
};
}
public static function toRadians(_arg1:Number):Number{
return (((_arg1 * Math.PI) / 180));
}
}
}//package lj.src.util
Section 26
//SoundObject (lj.src.util.SoundObject)
package lj.src.util {
import flash.events.*;
import flash.media.*;
public class SoundObject {
private static var actionSound:Sound;
private static var musicChannelStopData:Array = [];
private static var sound:Array;
private static var musicChannel:Array;
private static var music_total:int = 1;
private static var sound_total:int = 10;
private static var soundClass:Array = [];
private static var sound_index:int = 0;
private static var music:Array;
private static var music_index:int = 0;
private static var actionSoundChannel:SoundChannel;
private static var sound_volume:SoundTransform = new SoundTransform();
private static var soundChannelStopData:Array = [];
private static var sound_holds:int = 2;
public static var finished:Boolean = true;
private static var soundChannel:Array;
private static var music_volume:SoundTransform = new SoundTransform();
public function SoundObject():void{
}
private static function setSoundIndex():void{
sound_index = (sound_index + 1);
if (sound_index >= sound_total){
sound_index = 0;
};
}
private static function creatSound():void{
soundChannel = [];
sound = [];
var _local1:int;
while (_local1 < sound_total) {
soundChannel.push([null, null, null]);
sound.push(null);
_local1++;
};
}
private static function soundvalume_change():Boolean{
var _local2:int;
if (!soundChannel){
creatSound();
return (false);
};
var _local1:int;
while (_local1 < soundChannel.length) {
_local2 = 1;
while (_local2 <= sound_holds) {
if ((soundChannel[_local1][_local2] is SoundChannel)){
soundChannel[_local1][_local2].soundTransform = sound_volume;
};
_local2++;
};
_local1++;
};
return (true);
}
public static function pushSound(_arg1:String, _arg2:Class, _arg3:Boolean=true):void{
soundClass.push([_arg1, _arg2]);
if (_arg3){
SoundObject.playSound(_arg1);
};
}
private static function creatMusic():void{
musicChannel = [];
music = [];
var _local1:int;
while (_local1 < music_total) {
musicChannel.push([null, null]);
musicChannelStopData.push([null, null]);
music.push(null);
_local1++;
};
}
public static function isMusic(_arg1:String):Boolean{
if (SoundObject.index_result(musicChannel, _arg1, 0) >= 0){
return (true);
};
return (false);
}
private static function creatSoundStop():void{
soundChannelStopData = [];
var _local1:int;
while (_local1 < sound_total) {
soundChannelStopData.push([null, null, null]);
_local1++;
};
}
public static function stopSound():Boolean{
var _local2:int;
creatSoundStop();
if (!soundChannel){
return (false);
};
var _local1:int;
_local1 = 0;
while (_local1 < soundChannel.length) {
_local2 = 1;
while (_local2 <= sound_holds) {
if ((((soundChannel[_local1][_local2] is SoundChannel)) && (!((soundChannel[_local1][_local2].position == 0))))){
soundChannelStopData[_local1][0] = soundChannel[_local1][0];
soundChannelStopData[_local1][_local2] = soundChannel[_local1][_local2].position;
soundChannel[_local1][_local2].stop();
};
soundChannel[_local1][_local2] = null;
_local2++;
};
soundChannel[_local1][0] = null;
_local1++;
};
SoundMixer.stopAll();
return (true);
}
public static function get sound_volume_val():Number{
return (sound_volume.volume);
}
private static function index_result(_arg1:Array, _arg2:String, ... _args):int{
var _local4:Array;
var _local5:int;
var _local6:int;
if (!each_type(_args, "number")){
return (-2);
};
_local5 = 0;
while (_local5 < _arg1.length) {
_local4 = _arg1[_local5];
_local6 = 0;
while (_local6 < _args.length) {
if (_local6 == (_args.length - 1)){
if (_local4[_args[_local6]] == _arg2){
return (_local5);
};
} else {
if ((_local4 is Array)){
_local4 = _local4[_args[_local6]];
} else {
return (-3);
};
};
//unresolved jump
_local6++;
};
if (_arg1[_local5] == _arg2){
return (_local5);
};
_local5++;
};
return (-1);
}
public static function playSound(_arg1:String, _arg2:int=0, _arg3:Number=0, _arg4:Boolean=false):Boolean{
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
if (!soundChannel){
creatSound();
};
var _local5:int = SoundObject.index_result(soundChannel, _arg1, 0);
if (_local5 < 0){
_local5 = SoundObject.index_result(soundClass, _arg1, 0);
if (_local5 >= 0){
_local6 = 1;
for (;_local6 <= sound_holds;(soundChannel[sound_index][_local6] = null), _local6++) {
if (soundChannel[sound_index][_local6]){
soundChannel[sound_index][_local6].stop();
continue;
};
};
sound[sound_index] = new (soundClass[_local5][1]);
if ((Math.round((sound[sound_index].length * 100)) / 100) != (Math.round((_arg3 * 100)) / 100)){
soundChannel[sound_index][0] = soundClass[_local5][0];
soundChannel[sound_index][1] = sound[sound_index].play(_arg3, _arg2);
if (soundChannel[sound_index][1]){
soundChannel[sound_index][1].soundTransform = sound_volume;
//unresolved jump
};
setSoundIndex();
return (true);
} else {
soundChannel[sound_index][0] = null;
sound[sound_index] = null;
return (false);
};
};
} else {
_local7 = 0;
_local8 = 1;
_local9 = 0;
_local7 = SoundObject.index_result(soundClass, _arg1, 0);
sound[_local5] = new (soundClass[_local7][1]);
if ((Math.round((sound[_local5].length * 100)) / 100) >= (Math.round((_arg3 * 100)) / 100)){
_local6 = 1;
for (;_local6 <= sound_holds;return (true), continue, if (_local9 < soundChannel[_local5][_local6].position){
_local9 = soundChannel[_local5][_local6].position;
_local8 = _local6;
}, _local6++) {
//unresolved if
soundChannel[_local5][_local6] = sound[_local5].play(_arg3, _arg2);
if (soundChannel[_local5][_local6]){
soundChannel[_local5][_local6].soundTransform = sound_volume;
continue;
};
};
soundChannel[_local5][_local8].stop();
soundChannel[_local5][_local8] = sound[_local5].play(_arg3, _arg2);
if (soundChannel[_local5][_local8]){
soundChannel[_local5][_local8].soundTransform = sound_volume;
//unresolved jump
};
return (true);
} else {
_local6 = 0;
while (_local6 <= sound_holds) {
soundChannel[_local5][_local6] = null;
_local6++;
};
sound[_local5] = null;
};
};
return (false);
}
public static function get sound_transform():SoundTransform{
return (sound_volume);
}
private static function musicvalume_change():Boolean{
if (!musicChannel){
creatMusic();
return (false);
};
var _local1:int;
while (_local1 < musicChannel.length) {
if ((musicChannel[_local1][1] is SoundChannel)){
musicChannel[_local1][1].soundTransform = music_volume;
};
_local1++;
};
return (true);
}
private static function each_type(_arg1:Array, _arg2:String):Boolean{
var _local3:int;
while (_local3 < _arg1.lengt) {
if (typeof(_arg1[_local3]) != _arg2){
return (false);
};
_local3++;
};
return (Boolean(_arg1.length));
}
private static function setMusicIndex():void{
music_index = (music_index + 1);
if (music_index >= music_total){
music_index = 0;
};
}
private static function soundEvent(_arg1:Event):void{
var _local3:int;
_arg1.target.removeEventListener(Event.SOUND_COMPLETE, soundEvent);
var _local2:int;
while (_local2 < soundChannel.length) {
_local3 = 1;
while (_local3 <= sound_holds) {
if (musicChannel[_local2][_local3] == _arg1.target){
playMusic(musicChannel[_local2][_local3]);
};
_local3++;
};
_local2++;
};
}
public static function get music_volume_val():Number{
return (music_volume.volume);
}
public static function playMusic(_arg1:String, _arg2:Number=0, _arg3:Boolean=false):Boolean{
if (!musicChannel){
creatMusic();
};
var _local4:int = SoundObject.index_result(musicChannel, _arg1, 0);
if (_local4 < 0){
_local4 = SoundObject.index_result(soundClass, _arg1, 0);
if (_local4 >= 0){
music[music_index] = new (soundClass[_local4][1]);
if (musicChannel[music_index][1]){
musicChannel[music_index][1].stop();
//unresolved jump
};
musicChannel[music_index][0] = soundClass[_local4][0];
musicChannel[music_index][1] = music[music_index].play(_arg2);
if (musicChannel[music_index][1]){
musicChannel[music_index][1].soundTransform = music_volume;
//unresolved jump
};
musicChannel[music_index][1].addEventListener(Event.SOUND_COMPLETE, musicEvent);
setMusicIndex();
return (true);
};
} else {
musicChannel[_local4][1].stop();
musicChannel[_local4][1] = music[_local4].play(_arg2);
if (musicChannel[_local4][1]){
musicChannel[_local4][1].soundTransform = music_volume;
//unresolved jump
};
musicChannel[_local4][1].addEventListener(Event.SOUND_COMPLETE, musicEvent);
return (true);
};
return (false);
}
public static function stopMusic():Boolean{
if (!musicChannel){
return (false);
};
var _local1:int;
_local1 = 0;
while (_local1 < musicChannel.length) {
if ((((musicChannel[_local1][1] is SoundChannel)) && (!((musicChannel[_local1][1].position == 0))))){
musicChannelStopData[_local1][0] = musicChannel[_local1][0];
musicChannelStopData[_local1][1] = musicChannel[_local1][1].position;
musicChannel[_local1][1].removeEventListener(Event.SOUND_COMPLETE, musicEvent);
musicChannel[_local1][1].stop();
};
_local1++;
};
return (true);
}
public static function completeSound(_arg1:Class):Boolean{
stopSound();
stopMusic();
finished = false;
actionSound = new (_arg1);
actionSoundChannel = actionSound.play();
actionSoundChannel.addEventListener(Event.SOUND_COMPLETE, completeHD);
return (true);
}
public static function get music_transform():SoundTransform{
return (music_volume);
}
public static function resumeSound():Boolean{
var _local2:int;
if (!soundChannel){
return (false);
};
var _local1:int;
_local1 = 0;
while (_local1 < soundChannelStopData.length) {
_local2 = 1;
while (_local2 <= sound_holds) {
if (soundChannelStopData[_local1][_local2] != null){
playSound(soundChannelStopData[_local1][0], (soundChannelStopData[_local1][_local2] + 200));
soundChannelStopData[_local1][_local2] = null;
};
_local2++;
};
soundChannelStopData[_local1][0] = null;
_local1++;
};
return (true);
}
public static function soundvolume(_arg1:Number=1, _arg2:Number=0):Boolean{
if ((((_arg1 <= 1)) && ((_arg1 >= 0)))){
sound_volume = new SoundTransform(_arg1, _arg2);
soundvalume_change();
return (true);
};
return (false);
}
private static function musicEvent(_arg1:Event):void{
_arg1.target.removeEventListener(Event.SOUND_COMPLETE, musicEvent);
var _local2:int;
while (_local2 < musicChannel.length) {
if (musicChannel[_local2][1] == _arg1.target){
playMusic(musicChannel[_local2][0]);
};
_local2++;
};
}
public static function resumeMusic():Boolean{
if (!musicChannel){
return (false);
};
var _local1:int;
_local1 = 0;
while (_local1 < musicChannelStopData.length) {
if (musicChannelStopData[_local1][1] != null){
SoundObject.playMusic(musicChannelStopData[_local1][0], musicChannelStopData[_local1][1]);
musicChannelStopData[_local1][1] = null;
musicChannelStopData[_local1][0] = null;
};
_local1++;
};
return (true);
}
private static function completeHD(_arg1:Event):void{
actionSoundChannel.removeEventListener(Event.SOUND_COMPLETE, completeHD);
finished = true;
}
public static function pushSounds(... _args):void{
var _local2:int;
while (_local2 < _args.length) {
pushSound(_args[_local2][0], _args[_local2][1], false);
_local2++;
};
}
public static function musicvolume(_arg1:Number=1, _arg2:Number=0):Boolean{
if ((((_arg1 <= 1)) && ((_arg1 >= 0)))){
music_volume = new SoundTransform(_arg1, _arg2);
musicvalume_change();
return (true);
};
return (false);
}
}
}//package lj.src.util
Section 27
//XMLLoader (lj.src.util.XMLLoader)
package lj.src.util {
import flash.events.*;
import flash.net.*;
public class XMLLoader extends EventDispatcher {
protected var myXML:XML;
protected function onMyComplete(_arg1:Event):void{
myXML = new XML(_arg1.target.data);
_arg1.target.removeEventListener(Event.COMPLETE, onMyComplete);
dispatchEvent(new Event(Event.COMPLETE));
}
public function load(_arg1:String):void{
var _local2:URLLoader = new URLLoader(new URLRequest(_arg1));
_local2.addEventListener(Event.COMPLETE, onMyComplete);
}
public function get xml():XML{
return (myXML);
}
}
}//package lj.src.util
Section 28
//DocumentClass (lj.src.DocumentClass)
package lj.src {
import flash.display.*;
import flash.events.*;
import src.data.*;
import lj.src.sys.*;
public class DocumentClass extends Sprite {
public function DocumentClass(){
if (stage){
init();
trace("stage init!! ");
} else {
addEventListener(Event.ADDED_TO_STAGE, onMyAddToStage);
trace("add to stage!! ");
};
}
private function init():void{
Main.loadInit(stage, this, start, Data.loaderName);
trace("Init !");
stage.scaleMode = StageScaleMode.SHOW_ALL;
}
protected function start():void{
}
private function onMyAddToStage(_arg1:Event):void{
removeEventListener(Event.ADDED_TO_STAGE, onMyAddToStage);
init();
}
}
}//package lj.src
Section 29
//Continue_56 (main_fla.Continue_56)
package main_fla {
import flash.display.*;
public dynamic class Continue_56 extends MovieClip {
public var Con:MovieClip;
public function Continue_56(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package main_fla
Section 30
//Continue_58 (main_fla.Continue_58)
package main_fla {
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.utils.*;
import flash.ui.*;
import flash.filters.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.xml.*;
public dynamic class Continue_58 extends MovieClip {
public var Con:SimpleButton;
public function Continue_58(){
addFrameScript(0, frame1);
}
public function run(_arg1){
var _local2:* = root;
gotoAndStop(_local2.GoTo);
}
function frame1(){
stop();
stage.addEventListener(Event.ENTER_FRAME, run);
}
}
}//package main_fla
Section 31
//GamesBookas31_120 (main_fla.GamesBookas31_120)
package main_fla {
import flash.display.*;
import flash.events.*;
public dynamic class GamesBookas31_120 extends MovieClip {
public var Goto:Number;
public var Logo:MovieClip;
public var Type:String;
public var OK:Boolean;
public function GamesBookas31_120(){
addFrameScript(1, frame2, 3, frame4);
}
function frame2(){
stop();
Logo.buttonMode = true;
Logo.mouseChildren = false;
Logo.addEventListener(MouseEvent.CLICK, NewLogo);
Logo.addEventListener(MouseEvent.MOUSE_OVER, Over);
Logo.addEventListener(MouseEvent.MOUSE_OUT, Out);
if (!OK){
gotoAndStop(1);
OK = true;
};
}
function frame4(){
stop();
}
public function NewLogo(_arg1){
trace(Type);
MoreGameURLOK.MoreGameURLOK(Type);
}
public function Out(_arg1){
gotoAndStop(1);
}
public function Over(_arg1){
gotoAndStop(2);
}
}
}//package main_fla
Section 32
//GamesBookas33_124 (main_fla.GamesBookas33_124)
package main_fla {
import flash.display.*;
public dynamic class GamesBookas33_124 extends MovieClip {
public function GamesBookas33_124(){
addFrameScript(1, frame2);
}
function frame2(){
gotoAndStop(MoreGameURLOK.Goto);
}
}
}//package main_fla
Section 33
//Intro_1 (main_fla.Intro_1)
package main_fla {
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.utils.*;
import flash.ui.*;
import flash.filters.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.xml.*;
public dynamic class Intro_1 extends MovieClip {
public var S3:Sound;
public var On:SimpleButton;
public var H:MovieClip;
public var f2:MovieClip;
public var f3:MovieClip;
public var SS1:SoundChannel;
public var SS2:SoundChannel;
public var Loading:MovieClip;
public var yz:MovieClip;
public var Con:MovieClip;
public var scf2:SoundTransform;
public var a1:MovieClip;
public var a2:MovieClip;
public var S1:Sound;
public var S2:Sound;
public function Intro_1(){
addFrameScript(0, frame1, 9, frame10, 11, frame12, 34, frame35);
}
function frame12(){
On.addEventListener(MouseEvent.CLICK, introOK);
}
public function introOK(_arg1){
MovieClip(root).intro(true);
}
function frame10(){
stop();
if (MovieClip(root).continueButton == 2){
Con.scaleX = 1.4;
Con.scaleY = 1.4;
};
Con.buttonMode = true;
Con.addEventListener(MouseEvent.CLICK, Click);
Con.addEventListener(MouseEvent.ROLL_OVER, Over);
Con.addEventListener(MouseEvent.ROLL_OUT, Out);
scf2 = new SoundTransform();
}
public function OnOK(_arg1){
MovieClip(root).preloader(true);
}
public function YzOK(_arg1){
yz.play();
}
function frame35(){
stop();
NewTime();
H.mouseEnabled = false;
H.mouseChildren = false;
SS2 = S2.play(0, 11111);
}
public function Click(_arg1){
Con.removeEventListener(MouseEvent.ROLL_OUT, Out);
NewSod();
play();
}
function frame1(){
stop();
On.addEventListener(MouseEvent.CLICK, OnOK);
yz.addEventListener(MouseEvent.MOUSE_MOVE, YzOK);
yz.buttonMode = true;
a1.mouseEnabled = false;
a1.mouseChildren = false;
S1 = new s1ID();
S2 = new s2ID();
S3 = new s3ID();
SS1 = S1.play(0, 11111);
SS2 = S3.play(0, 11111);
}
public function NewTime(){
var _local1:* = root;
var _local2:* = _local1.TimeNum;
var _local3:* = setTimeout(Star, _local2);
}
public function Out(_arg1){
Con.gotoAndStop(1);
}
public function NewSod(){
scf2.volume = 0;
SS1.soundTransform = scf2;
}
public function Star(){
MovieClip(root).JSod();
H.play();
}
public function Over(_arg1){
Con.gotoAndStop(2);
}
}
}//package main_fla
Section 34
//loaded100_55 (main_fla.loaded100_55)
package main_fla {
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.utils.*;
import flash.ui.*;
import flash.filters.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.xml.*;
public dynamic class loaded100_55 extends MovieClip {
public function loaded100_55(){
addFrameScript(0, frame1);
}
public function run(_arg1){
var _local2:* = root;
gotoAndStop(_local2.GoTo);
}
function frame1(){
stop();
stage.addEventListener(Event.ENTER_FRAME, run);
}
}
}//package main_fla
Section 35
//Loading_54 (main_fla.Loading_54)
package main_fla {
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.utils.*;
import flash.ui.*;
import flash.filters.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.xml.*;
public dynamic class Loading_54 extends MovieClip {
public var txt:TextField;
public function Loading_54(){
addFrameScript(0, frame1);
}
public function run(_arg1){
var _local2:* = root;
gotoAndStop(_local2.GoTo);
}
function frame1(){
stop();
stage.addEventListener(Event.ENTER_FRAME, run);
}
}
}//package main_fla
Section 36
//MainTimeline (main_fla.MainTimeline)
package main_fla {
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.utils.*;
import flash.ui.*;
import flash.filters.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.xml.*;
public dynamic class MainTimeline extends MovieClip {
public var portal:String;
public var ServerFps;
public var scf:SoundTransform;
public var GoTo:String;
public var sender:LocalConnection;
public var TypeS;
public var Volume:Number;
public var GameName:String;
public var main;
public var domain:String;
public var continueButton:Number;
public var Intro:MovieClip;
public var Url:String;
public var TimeNum:Number;
public var MochiBotKey:String;
public var utm_content:String;
public var branding:String;
public var url:String;
public function MainTimeline(){
addFrameScript(0, frame1, 4, frame5);
}
function frame5(){
main = new CastleMain();
addChild(main);
}
public function com(_arg1){
var _local2:String;
_local2 = _arg1.target.data.toLowerCase();
if (_local2 == "gamesbook.com"){
Url = "http://www.gamesbook.com";
GoTo = "gamesbook";
} else {
if (_local2 == "wyspagier.pl"){
Url = "http://www.wyspagier.pl";
GoTo = "wyspagier";
} else {
if (_local2 == "oyunlaradasi.com"){
Url = "http://www.oyunlaradasi.com";
GoTo = "oyunlaradasi";
} else {
if (_local2 == "joacajocuri.ro"){
Url = "http://www.joacajocuri.ro";
GoTo = "joacajocuri";
} else {
if (_local2 == "gladespil.dk"){
Url = "http://www.gladespil.dk";
GoTo = "gladespil";
} else {
if (_local2 == "jogarlegal.com.br"){
Url = "http://www.jogarlegal.com.br";
GoTo = "jogarlegal";
} else {
if (_local2 == "jeuxdroles.fr"){
Url = "http://www.jeuxdroles.fr";
GoTo = "jeuxdroles";
} else {
if (_local2 == "universodelgioco.it"){
Url = "http://www.universodelgioco.it";
GoTo = "universodelgioco";
} else {
if (_local2 == "jocjogos.com"){
Url = "http://www.jocjogos.com";
GoTo = "jocjogos";
} else {
if (_local2 == "juegoswapos.es"){
Url = "http://www.juegoswapos.es";
GoTo = "juegoswapos";
} else {
if (_local2 == "speeleiland.nl"){
Url = "http://www.speeleiland.nl";
GoTo = "speeleiland";
} else {
if (_local2 == "brincar.pt"){
Url = "http://www.brincar.pt";
GoTo = "brincar";
} else {
if (_local2 == "gratisspill.no"){
Url = "http://www.gratisspill.no";
GoTo = "gratisspill";
} else {
if (_local2 == "spielkarussell.de"){
Url = "http://www.spielkarussell.de";
GoTo = "spielkarussell";
} else {
Url = "http://www.gamesbook.com";
GoTo = "gamesbook";
};
};
};
};
};
};
};
};
};
};
};
};
};
};
Intro.a2.a.a.gotoAndStop(GoTo);
MoreGameURLOK.Goto = GoTo;
}
public function onEnterFramee(_arg1:Event){
var _local2:*;
var _local3:String;
var _local4:URLLoader;
var _local5:Number;
var _local6:Number;
if (framesLoaded == totalFrames){
stage.removeEventListener(Event.ENTER_FRAME, onEnterFramee);
_local2 = sender.domain;
if (_local2 != "localhost"){
_local4 = new URLLoader(new URLRequest("http://api.jaludo.com/geoip/index.php?return=domain&type=gameshell&portal=gamesbook"));
_local4.addEventListener(Event.COMPLETE, com);
};
Intro.gotoAndStop(10);
} else {
_local5 = (root.loaderInfo.bytesLoaded / root.loaderInfo.bytesTotal);
_local6 = Math.round((_local5 * 100));
Intro.Loading.LoadingTxt.txt.text = (_local6 + "%");
};
}
public function ingameOK(_arg1){
utm_content = "ingame";
MoreGameURL(true);
}
public function gameover(_arg1){
utm_content = "gameover";
MoreGameURL(true);
}
public function LogoMoreGame(_arg1:String){
utm_content = _arg1;
MoreGameURL(true);
}
public function youwin(_arg1){
utm_content = "youwin";
MoreGameURL(true);
}
public function menu(_arg1){
utm_content = "menu";
MoreGameURL(true);
}
function frame1(){
GameName = "Castle Hotel";
MochiBotKey = "f6ead976";
branding = "original";
continueButton = 1;
TimeNum = 5000;
stop();
stage.addEventListener(Event.ENTER_FRAME, onEnterFramee);
Volume = 1;
scf = new SoundTransform();
ServerFps = stage.frameRate;
stage.frameRate = 30;
MochiBot.track(this, MochiBotKey);
sender = new LocalConnection();
url = root.loaderInfo.url;
domain = sender.domain;
utm_content = "intro";
Url = "http://www.gamesbook.com";
TypeS = 1;
GoTo = "gamesbook";
MoreGameURLOK.MoreGameURLOK = LogoMoreGame;
MoreGameURLOK.Goto = GoTo;
stop();
}
public function JSod(){
stage.addEventListener(Event.ENTER_FRAME, NewSod);
}
public function MoreGameURL(_arg1){
var _local2:String = ((((((("/?utm_campaign=" + escape(GameName)) + "&utm_content=") + escape(utm_content)) + "&utm_medium=") + escape(branding)) + "&utm_source=") + escape(url));
var _local3:String = (Url + _local2);
var _local4:URLRequest = new URLRequest(_local3);
navigateToURL(_local4);
}
public function intro(_arg1){
utm_content = "intro";
MoreGameURL(true);
}
public function NewSod(_arg1){
Volume = (Volume - 0.02);
scf.volume = Volume;
soundTransform = scf;
if (Volume < 0){
stage.removeEventListener(Event.ENTER_FRAME, NewSod);
};
}
public function LoadGamePlay(){
stage.frameRate = ServerFps;
SoundMixer.stopAll();
gotoAndStop(5);
}
public function preloader(_arg1){
utm_content = "preloader";
MoreGameURL(true);
}
public function GameUrl(){
var _local1:String = ((((((("/?utm_campaign=" + escape(GameName)) + "&utm_content=") + escape(utm_content)) + "&utm_medium=") + escape(branding)) + "&utm_source=") + escape(url));
var _local2:String = ("http://www.speeleiland.nl/spel/gooi_gevecht_robin_hoek.html" + _local1);
var _local3:URLRequest = new URLRequest(_local2);
navigateToURL(_local3);
}
}
}//package main_fla
Section 37
//Timeline_174 (main_fla.Timeline_174)
package main_fla {
import flash.display.*;
public dynamic class Timeline_174 extends MovieClip {
public var popMc:MovieClip;
public function Timeline_174(){
addFrameScript(18, frame19);
}
function frame19(){
stop();
}
}
}//package main_fla
Section 38
//Timeline_32 (main_fla.Timeline_32)
package main_fla {
import flash.display.*;
public dynamic class Timeline_32 extends MovieClip {
public function Timeline_32(){
addFrameScript(99, frame100);
}
function frame100(){
gotoAndPlay(1);
}
}
}//package main_fla
Section 39
//Timeline_45 (main_fla.Timeline_45)
package main_fla {
import flash.display.*;
public dynamic class Timeline_45 extends MovieClip {
public function Timeline_45(){
addFrameScript(1, frame2);
}
function frame2(){
stop();
}
}
}//package main_fla
Section 40
//Timeline_48 (main_fla.Timeline_48)
package main_fla {
import flash.display.*;
public dynamic class Timeline_48 extends MovieClip {
public var a:MovieClip;
public function Timeline_48(){
addFrameScript(57, frame58, 79, frame80);
}
function frame58(){
gotoAndPlay(1);
}
function frame80(){
stop();
}
}
}//package main_fla
Section 41
//Timeline_5 (main_fla.Timeline_5)
package main_fla {
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.utils.*;
import flash.ui.*;
import flash.filters.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.xml.*;
public dynamic class Timeline_5 extends MovieClip {
public var a:MovieClip;
public var c:MovieClip;
public var b:MovieClip;
public var d:MovieClip;
public function Timeline_5(){
addFrameScript(0, frame1);
}
public function Yun(_arg1){
var _local2:MovieClip;
_local2 = _arg1.target;
if (_local2.x < -100){
_local2.x = ((Math.random() * 500) + 800);
_local2.Speed = ((Math.random() * 2) + 1);
};
if (!_local2.Speed){
_local2.Speed = ((Math.random() * 2) + 1);
};
_local2.x = (_local2.x - _local2.Speed);
}
function frame1(){
a.addEventListener(Event.ENTER_FRAME, Yun);
b.addEventListener(Event.ENTER_FRAME, Yun);
c.addEventListener(Event.ENTER_FRAME, Yun);
d.addEventListener(Event.ENTER_FRAME, Yun);
}
}
}//package main_fla
Section 42
//Timeline_50 (main_fla.Timeline_50)
package main_fla {
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.utils.*;
import flash.ui.*;
import flash.filters.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.xml.*;
public dynamic class Timeline_50 extends MovieClip {
public var a:MovieClip;
public var b:MovieClip;
public function Timeline_50(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
run();
}
public function run(){
var _local1:* = root;
a.gotoAndStop(_local1.GoTo);
b.gotoAndStop(_local1.GoTo);
}
}
}//package main_fla
Section 43
//Timeline_6 (main_fla.Timeline_6)
package main_fla {
import flash.display.*;
public dynamic class Timeline_6 extends MovieClip {
public function Timeline_6(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package main_fla
Section 44
//Timeline_61 (main_fla.Timeline_61)
package main_fla {
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.utils.*;
import flash.ui.*;
import flash.filters.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.xml.*;
public dynamic class Timeline_61 extends MovieClip {
public function Timeline_61(){
addFrameScript(0, frame1, 45, frame46);
}
function frame1(){
stop();
}
function frame46(){
stop();
MovieClip(root).LoadGamePlay();
}
}
}//package main_fla
Section 45
//Timeline_84 (main_fla.Timeline_84)
package main_fla {
import flash.display.*;
public dynamic class Timeline_84 extends MovieClip {
public function Timeline_84(){
addFrameScript(28, frame29);
}
function frame29(){
stop();
}
}
}//package main_fla
Section 46
//Timeline_86 (main_fla.Timeline_86)
package main_fla {
import flash.display.*;
public dynamic class Timeline_86 extends MovieClip {
public function Timeline_86(){
addFrameScript(24, frame25);
}
function frame25(){
stop();
}
}
}//package main_fla
Section 47
//Timeline_9 (main_fla.Timeline_9)
package main_fla {
import flash.display.*;
public dynamic class Timeline_9 extends MovieClip {
public function Timeline_9(){
addFrameScript(1, frame2);
}
function frame2(){
x = ((Math.random() * 700) - 350);
gotoAndPlay(int(((Math.random() * 100) + 3)));
}
}
}//package main_fla
Section 48
//Data (src.data.Data)
package src.data {
import src.vo.*;
import lj.src.util.*;
public class Data {
public static const MUSIC:Number = 1;
public static const keyArr:Array = [[32, "SPACE"], [17, "CTRL"], [16, "SHIFT"], [20, "CAPS"], [27, "ESC"], [8, "BACK"], [112, "F1"], [113, "F2"], [114, "F3"], [115, "F4"], [116, "F5"], [117, "F6"], [118, "F7"], [119, "F8"], [120, "F9"], [121, "F10"], [122, "F11"], [123, "F12"], [19, "SCRLK"], [45, "INSERT"], [36, "HOME"], [33, "PAGEUP"], [34, "PAGEDN"], [46, "DEL"], [35, "END"], [38, "↑"], [40, "↓"], [37, "←"], [39, "→"], [13, "ENTER"], [144, "NUMLOCK"]];
public static const QUALITY:String = "high";
public static const defKeySet:Object = {};
public static const SOUND:Number = 1;
public static var MapData:Object = {offsetX:0, offsetY:8, gridArr:[[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 2, 2, 2, 2, 2, 1, 1, 0, 1], [1, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 1, 0, 1], [1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1], [1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]};
public static var CANT_CLICK:Array = ["chair1", "chair2"];
public static var SFX_TryAgain:String = "Sfx_TryAgain";
public static var SFX_MayI_Woman:String = "Sfx_MayI_Woman";
public static var AllSounds:Array = [SFX_Button, SFX_Button2, SFX_Win, SFX_Fail, SFX_Pass, SFX_GameBG1, SFX_CoverBG, SFX_Hello_Women, SFX_Door_Close, SFX_Door_Open, SFX_Hello_Men, SFX_Sweep, SFX_Buy, SFX_Take, SFX_MayI_Man, SFX_MayI_Woman, SFX_Bell, SFX_ShopBGM, SFX_Deal, SFX_TryAgain, SFX_ReachGoal, SFX_Cash, SFX_Key, SFX_CG];
public static var SFX_Deal:String = "Sfx_Deal";
public static var ROLE_SCALE:Number = 0.34;
public static var FurnitureMap:Object = {dinner_table:[[19, 7], [[0, 0, 0, 0, 0], [0, 0, 0, 0, 0]]], front_table:[[19, 17], [[0, 0], [0, 0], [0, 0]]], newspaper:[[17, 11], [[0, 0]]], chair1:[[19, 14], [[0, 0], [0, 0]]], chair2:[[19, 20], [[0, 0], [0, 0]]], chair1max:[[19, 12], [[1, 1, 0, 0, 0], [0, 0, 0, 0, 0], [0, 2, 2, 2, 2]]], chair2max:[[19, 19], [[0, 0, 0, 1, 1, 1], [0, 0, 0, 0, 0, 0], [2, 2, 2, 2, 0, 1]]]};
public static var custom_frame:Object = {pay:[[20], ["animOver"], []]};
public static var Server_Tile:Array = [[23, 34, 22, 29], [23, 0, 22, 5]];
public static var LevelInfo:Array = [["Goal", "Num", "Freq", "Customer", "BaseCost", "ServeNum", "ServeType"], [0, 2, 20, 12, 40, [1, 0], 5], [0, 2, 20, 12, 40, [1, 0], 5], [30, 3, 20, 12, 40, [1, 0], 5], [50, 3, 20, 12, 40, [1, 0], 5], [70, 3, 15, 12, 40, [1, 0], 5], [90, 3, 15, 12, 40, [1, 0], 5], [100, 3, 15, 12, 40, [1, 0], 5], [110, 3, 15, 12, 40, [1, 0], 5], [120, 3, 15, 12, 40, [1, 0], 5], [130, 3, 10, 12, 40, [1, 0], 5], [150, 4, 10, 12, 40, [1, 0], 5], [160, 4, 10, 12, 40, [1, 0], 5], [170, 4, 10, 12, 40, [1, 0], 5], [185, 4, 8, 12, 40, [1, 0], 5], [200, 4, 8, 12, 40, [1, 0], 5]];
public static var Shop_Items:Array = [["NAME", "LEVELS", "BUILD_CDT", "Cost", "ADD_SERVER", "CUSTOM", "POPULARITY", "DETAIL"], ["coffee", 1, null, 300, ServeVO.Coffee, 0, 10, "extra service for your guests"], ["newspaper", 1, null, 70, ServeVO.Newspaper, 0, 20, "extra service for your guests"], ["phone", 1, null, 160, ServeVO.Phone, 0, 10, "extra service for your guests"], ["door", 6, "floor3", [50, 200], null, 0, 10, "makes your hotel more popular (more money per service)"], ["floor2", 1, null, 200, null, 2, 0, "brings you more customers"], ["floor3", 1, "floor2", 400, null, 2, 0, "brings you more customers"], ["platform", 5, null, [300, 200], null, 0, 10, "makes your hotel more popular (more money per service)"], ["dinner_table", 1, null, 400, ServeVO.Dinner, 0, 20, "extra service for your guests"], ["tree", 1, null, 600, ServeVO.Water, 0, 20, "makes your hotel more popular (more money per service)"], ["chairs", 5, "chair", [200, 200], null, 0, 10, "makes your hotel more popular (more money per service)"], ["chair1", 1, null, 400, null, 1, 0, "customers can wait longer on a comfortable chair"], ["chair2", 1, null, 400, null, 1, 0, "customers can wait longer on a comfortable chair"], ["front_table", 1, null, 600, null, 0, 20, "makes your hotel more popular (more money per service)"], ["armor", 1, null, 500, null, 0, 20, "makes your hotel more popular (more money per service)"], ["lamp", 1, null, 700, null, 0, 20, "makes your hotel more popular (more money per service)"], ["paint", 1, null, 800, null, 0, 20, "makes your hotel more popular (more money per service)"], ["bigpaint", 1, null, 1000, null, 0, 20, "makes your hotel more popular (more money per service)"], ["hangs", 1, null, 1500, null, 0, 30, "makes your hotel more popular (more money per service)"]];
public static var One_Serve_Cash:int = 10;
public static var SFX_Hello_Women:String = "Sfx_Hello";
public static var SFX_Door_Close:String = "Sfx_DoorClose";
public static var SFX_CoverBG:String = "Sfx_TitleBGM";
public static var Comeout_Tile:Array = [[17, 3], [17, 30]];
public static var loaderName:Array;
public static var SFX_Button2:String = "Sfx_Button2";
public static var SFX_Take:String = "Sfx_Take";
public static var IF_Sound:Boolean = true;
public static var SFX_Hello_Men:String = "Sfx_HiThere";
public static var Reach_Pos:Object = {door1:[16, 7], door2:[16, 28], door3:[10, 7], door4:[10, 17], door5:[10, 28], door6:[4, 7], door7:[4, 18], door8:[4, 28], platform:[18, 17], key:[18, 18], phone:[18, 19], coffee:[18, 23], newspaper:[18, 12], tree1:[17, 9], tree2:[17, 25], chair1:[21, 15], chair2:[21, 20], dinner_table:[21, 8], food:[17, 5]};
public static var SFX_GameBG1:String = "Sfx_BGMusic";
public static var SFX_Key:String = "Sfx_Key";
public static var stageWidth:int = 700;
public static var SERVE_ID:Array = [ServeVO.Key, ServeVO.Dinner, ServeVO.Newspaper, ServeVO.Coffee, ServeVO.Phone];
public static var SFX_Button:String = "Sfx_Button";
public static var SFX_Sweep:String = "Sfx_Sweep";
public static var SFX_CG:String = "Sfx_CG";
public static var SAVENAME:String = ("LJ_Castle_Hotel_SAVESLOT" + VERSION);
public static var IF_DEBUG:Boolean = false;
public static var SFX_Buy:String = "Sfx_Buy";
public static var FurnitureName:Array = ["armor", "tree", "newspaper", "coffee", "dinner_table", "chair", "front_table", "phone", "paint", "hangs", "main_table", "lamp", "bigpaint", "door"];
public static var FurnitureData:Array = [["TYPE", "NUMS", "OWN", "PATH", "LEVELS", "EXTRA", "Scale"], ["platform", 1, 1, null, 5, null], ["chair", 2, 1, null, 5, null], ["front_table", 1, 1, null, 2, null], ["main_table", 1, 1, "platform", 5, null], ["tree", 2, 2, null, 1, null], ["dinner_table", 1, 1, null, 1, null], ["armor", 2, 2, null, 1, null], ["newspaper", 1, 1, null, 1, "platform.paper"], ["coffee", 1, 1, null, 1, null], ["phone", 1, 1, "platform", 1, null], ["paint", 2, 2, null, 1, null], ["hangs", 2, 2, null, 1, null], ["lamp", 2, 2, null, 1, null], ["bigpaint", 1, 1, null, 1, null], ["stair", 2, 2, null, 1, null], ["door", 8, 8, null, [2, 1, 1], null]];
public static var SFX_ReachGoal:String = "Sfx_ReachGoal";
public static var VERSION:String = "1.0.100";
public static var SFX_MayI_Man:String = "Sfx_MayI_Man";
public static var SFX_Bell:String = "Sfx_Bell";
public static var Custom_Num:int = 5;
public static var SERVE_STR:Array = ["key", "food", "newspaper", "coffee", "phone"];
public static var stageHeight:int = 500;
public static var Max_level:int = 15;
public static var SFX_Pass:String = "Sfx_Pass";
public static var SFX_Door_Open:String = "Sfx_DoorOpen";
public static var SFX_Win:String = "Sfx_Win";
public static var SFX_Fail:String = "Sfx_Fail";
public static var Waiter_Tile:Array = [[16, 17, 16, 17], [16, 18, 16, 18], Server_Tile[0], Server_Tile[1]];
public static var SFX_Cash:String = "Sfx_Cash";
public static var waiter_frame:Object = {bored:[[129], ["animOver"], []]};
public static var TileSize:int = 20;
public static var SFX_ShopBGM:String = "Sfx_ShopBGM";
public static var InvisibleTiles:Array = [[19, 34], [18, 34], [18, 0], [19, 0], [23, 0], [23, 34]];
public static function getServeStr(_arg1:int):String{
var _local2:String;
var _local3:int = SERVE_ID.indexOf(_arg1);
if (_local3 != -1){
_local2 = SERVE_STR[_local3];
};
return (_local2);
}
public static function getServeNum(_arg1:String):int{
var _local2:int;
var _local3:int = SERVE_STR.indexOf(_arg1);
if (_local3 != -1){
_local2 = SERVE_ID[_local3];
};
return (_local2);
}
public static function getTypeNums(_arg1:String):int{
var _local2:int = Data.FurnitureData[0].indexOf("NUMS");
var _local3:Object = GameUtil.getObjInArr(Data.FurnitureData, _arg1, 0);
return (_local3[_local2]);
}
}
}//package src.data
Section 49
//Road (src.model.AStar.Road)
package src.model.AStar {
import lj.src.structure.*;
public class Road {
protected const LINE_VALUE:int = 10;
protected const BIAS_VALUE:int = 14;
protected var targetIX:int;
public var HEIGHT_NUMBER:int;
public var WIDTH_NUMBER:int;
protected var targetIY:int;
protected var lockList:Object;
protected var unlockList:Array;
protected var map:Array2D;
public function Road(_arg1:Array2D){
this.map = _arg1;
WIDTH_NUMBER = _arg1.length;
HEIGHT_NUMBER = _arg1[0].length;
}
protected function addUnlockList(_arg1:Sign):void{
if (_arg1){
unlockList.push(_arg1);
unlockList[((_arg1.ix + "_") + _arg1.iy)] = _arg1;
};
}
protected function isBlock(_arg1:int, _arg2:int):Boolean{
var _local3:Boolean;
if (!map[_arg1][_arg2]){
_local3 = true;
};
return (_local3);
}
protected function getRouteScore(_arg1:int, _arg2:int):int{
return (map[_arg1][_arg2]);
}
private function createSign(_arg1:int, _arg2:int, _arg3:Boolean, _arg4:Sign):Sign{
if ((((((((_arg1 < 0)) || ((_arg2 < 0)))) || ((_arg1 >= WIDTH_NUMBER)))) || ((_arg2 >= HEIGHT_NUMBER)))){
return (null);
};
if (isBlock(_arg1, _arg2)){
return (null);
};
if (lockList[((_arg1 + "_") + _arg2)]){
return (null);
};
if (unlockList[((_arg1 + "_") + _arg2)]){
return (null);
};
if (_arg3){
if (((isBlock(_arg4.ix, _arg2)) || (isBlock(_arg1, _arg4.iy)))){
return (null);
};
};
var _local5:Number = Math.abs((targetIX - _arg1));
var _local6:Number = Math.abs((targetIY - _arg2));
return (new Sign(_arg1, _arg2, ((_arg3) ? BIAS_VALUE : LINE_VALUE * getRouteScore(_arg1, _arg2)), ((_local5 + _local6) * 10), _arg4));
}
public function seekRoad(_arg1:int, _arg2:int, _arg3:int, _arg4:int):Array{
if (!map){
return (null);
};
if (isBlock(_arg3, _arg4)){
return (null);
};
var _local5:int = _arg1;
var _local6:int = _arg2;
targetIX = _arg3;
targetIY = _arg4;
var _local7:Array = new Array();
unlockList = new Array();
lockList = new Object();
var _local8:Sign = new Sign(_arg1, _arg2, 0, 0, null);
lockList[((_arg1 + "_") + _arg2)] = _local8;
while (true) {
addUnlockList(createSign((_local5 + 1), (_local6 - 1), true, _local8));
addUnlockList(createSign((_local5 + 1), _local6, false, _local8));
addUnlockList(createSign((_local5 + 1), (_local6 + 1), true, _local8));
addUnlockList(createSign((_local5 - 1), (_local6 + 1), true, _local8));
addUnlockList(createSign(_local5, (_local6 + 1), false, _local8));
addUnlockList(createSign((_local5 - 1), _local6, false, _local8));
addUnlockList(createSign((_local5 - 1), (_local6 - 1), true, _local8));
addUnlockList(createSign(_local5, (_local6 - 1), false, _local8));
if (unlockList.length == 0){
break;
};
unlockList.sortOn("s", Array.NUMERIC);
_local8 = unlockList.shift();
lockList[((_local8.ix + "_") + _local8.iy)] = _local8;
_local5 = _local8.ix;
_local6 = _local8.iy;
if ((((_local5 == targetIX)) && ((_local6 == targetIY)))){
while (_local8 != null) {
_local7.push(_local8.getSign());
_local8 = _local8.p;
};
break;
};
};
_local8 = null;
return (_local7.reverse());
}
}
}//package src.model.AStar
Section 50
//Sign (src.model.AStar.Sign)
package src.model.AStar {
public class Sign {
private var _c:int;// = 0
private var _h:int;// = 0
private var _ix:Number;
private var _p:Sign;
private var _s:int;// = 0
private var _iy:Number;
public function Sign(_arg1:Number, _arg2:Number, _arg3:int, _arg4:int, _arg5:Sign=null){
this._ix = _arg1;
this._iy = _arg2;
this._p = _arg5;
if (_arg5){
_c = (_arg5.c + _arg3);
_h = _arg4;
_s = (_c + _h);
};
}
public function get h():int{
return (_h);
}
public function get c():int{
return (_c);
}
public function get ix():int{
return (_ix);
}
public function get s():int{
return (_s);
}
public function toString():String{
return (((ix + ",") + iy));
}
public function get iy():int{
return (_iy);
}
public function get p():Sign{
return (_p);
}
public function getSign():Object{
return ({x:_ix, y:_iy});
}
}
}//package src.model.AStar
Section 51
//CustomM (src.model.role.CustomM)
package src.model.role {
import src.view.role.*;
import src.sys.*;
import src.sys.scene.*;
import src.data.*;
import lj.src.util.*;
import lj.src.sys.*;
import flash.utils.*;
public class CustomM extends PersonM {
protected var myNeedSeq:Array;
protected var availServers:Array;
protected var myRoomId:int;
private var _myStayPlace:String;
protected var mode_total:int;
protected var readyCount:int;
protected var modeLevel:int;
protected var _customArr:Array;
private var _curNeed:int;
protected var modeCount:int;
protected var serveCount:int;
protected var curIndex:int;
private var _phase:int;
public static const PHASE_FAIL:int = 4;
public static const Serve_Phone:int = 5;
public static const Serve_Money:int = 9;
public static const Serve_Coffee:int = 3;
public static const PHASE_END:int = 3;
public static const PHASE_WAIT:int = 1;
public static const PHASE_READY:int = 0;
public static const Serve_Clean:int = 2;
public static const Serve_Newspaper:int = 4;
public static const PHASE_ACCEPT:int = 2;
public static const Serve_Key:int = 1;
public static const Serve_Dinner:int = 6;
public static const Serve_Mend:int = 7;
public static var MenIds:Array = [2, 4];
public function CustomM(){
mode_total = (20 * Global.stage.frameRate);
super();
}
override public function remove():void{
super.remove();
if (_customArr){
GameUtil.removeObjInArr(_customArr, myView);
(SceneMgr.scene as GameScene).customSend.checkLastCustom();
_customArr = null;
};
}
public function payOut():void{
_roomM.addMoney(1);
onServeEnd();
}
override public function arrival():void{
super.arrival();
if (phase == PHASE_READY){
if (curNeed == Serve_Key){
_personV.changeFrame("bre");
if (GameUtil.checkInArr(MenIds, id)){
SoundObject.playSound(Data.SFX_Hello_Men);
} else {
SoundObject.playSound(Data.SFX_Hello_Women);
};
} else {
if ((((curNeed == Serve_Coffee)) || ((curNeed == Serve_Newspaper)))){
myView.seatIn(myStayPlace);
} else {
if (curNeed == Serve_Dinner){
myView.seatIn("dinner_table");
} else {
trace("Other Ready State: ", curNeed, " !!!!");
};
};
};
readyEnd();
} else {
if (phase == PHASE_ACCEPT){
if (curNeed == Serve_Key){
onServeEnd();
};
} else {
if (phase == PHASE_END){
if (curNeed == Serve_Money){
_personV.remove();
} else {
_roomM.setDoorState(myRoomId, 0);
_personV.visible = false;
setTimeout(checkNewServer, 3000);
};
} else {
if (phase == PHASE_FAIL){
if (curNeed == Serve_Key){
_personV.remove();
} else {
_roomM.setDoorState(myRoomId, 0);
_personV.visible = false;
setTimeout(checkNewServer, 3000);
};
};
};
};
};
}
protected function addScore(_arg1:Number):void{
(SceneMgr.scene as GameScene).addScore(Data.One_Serve_Cash);
Method.addScore((myView.x + 10), (myView.y - _arg1), Data.One_Serve_Cash);
}
protected function checkHasDinner():Boolean{
var _local1:Boolean;
if (_roomM.checkHasPerson("dinner_table")){
_local1 = false;
};
return (_local1);
}
protected function updateMode():void{
if (_phase == PHASE_WAIT){
modeCount++;
if (modeCount >= mode_total){
onServeFail();
modeCount = 0;
};
setModeMc((modeCount / mode_total), curNeed);
};
}
override protected function init():void{
initMyNeed();
}
public function initMyNeed():void{
var _local1:int;
myNeedSeq = new Array();
availServers = _roomM.getAvailServe();
myNeedSeq.push(Serve_Key);
while (availServers.length) {
_local1 = (Math.random() * availServers.length);
myNeedSeq.push(availServers[_local1]);
availServers.splice(_local1, 1);
};
myNeedSeq.push(Serve_Money);
}
protected function checkServeMoney():void{
var _local1:Number = (myView.visible) ? (myView.height - 20) : ((myView.height / 2) - 15);
var _local2:int;
if (myView.mc.parent != myView){
_local1 = 70;
};
if (curNeed != Serve_Money){
setTimeout(addTip, _local2, _local1);
_local2 = (_local2 + 800);
SoundObject.playSound(Data.SFX_Deal);
};
if (((!((curNeed == Serve_Key))) && (!((curNeed == Serve_Money))))){
setTimeout(addScore, _local2, _local1);
};
}
public function waitServe():void{
_phase = PHASE_WAIT;
modeCount = 0;
setModeMc(0, curNeed);
switch (curNeed){
case Serve_Money:
onServeStart();
break;
};
}
protected function setModeMc(_arg1:Number, _arg2:int):void{
(_personV as CustomV).setNeedMc(_arg1, _arg2);
if (myStayPlace.search("door") != -1){
_roomM.roomV.bg.setNeedMc(myRoomId, _arg2, this.id, _arg1);
};
}
public function onServeFail():void{
_phase = PHASE_FAIL;
setModeMc(0, curNeed);
myView.setMark(false);
if (myStayPlace.search("door") != -1){
_roomM.roomV.bg.setMark(false, myStayPlace);
};
(SceneMgr.scene as GameScene).waiterMgr.checkDissableServe(curNeed);
switch (curNeed){
case Serve_Key:
if (myStayPlace){
_roomM.removePlacePerson(myStayPlace);
};
_personV.moveTo(initPos[0], initPos[1]);
break;
default:
this.myNeedSeq.shift();
if (myStayPlace.search("door") == -1){
myView.seatOut();
_roomM.setDoorState(myRoomId, 1);
moveToPlace(("door" + myRoomId));
} else {
checkNewServer();
};
};
}
protected function readyEnd():void{
waitServe();
}
protected function randomServeSeq():void{
if (myNeedSeq.length > 2){
myNeedSeq.splice((myNeedSeq.length - 1), 1);
myNeedSeq = GameUtil.randomArrObj(GameUtil.clone(myNeedSeq));
myNeedSeq.push(Serve_Money);
checkNewServer();
} else {
_roomM.addDinnerWaitCustom(this);
};
}
protected function getPlacePos(_arg1:String):Array{
return (Data.Reach_Pos[_arg1]);
}
public function checkCanServe():Boolean{
var _local1:Boolean;
if (_phase == PHASE_WAIT){
_local1 = true;
};
return (_local1);
}
protected function moveToPlace(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false):void{
if (!_arg3){
if (myStayPlace){
_roomM.removePlacePerson(myStayPlace);
};
};
var _local4:Array = getPlacePos(_arg1);
_personV.moveTo(_local4[0], _local4[1]);
if (!_arg2){
myStayPlace = _arg1;
_roomM.addPlacePerson(myStayPlace, (_personV as CustomV));
};
}
public function onServeEnd():void{
_phase = PHASE_END;
this.myNeedSeq.shift();
switch (curNeed){
case Serve_Key:
_roomM.setDoorState(myRoomId, 0);
_personV.visible = false;
SoundObject.playSound(Data.SFX_Door_Close);
setTimeout(checkNewServer, 3000);
break;
case Serve_Clean:
checkNewServer();
break;
case Serve_Newspaper:
case Serve_Coffee:
if (myStayPlace.search("door") != -1){
checkNewServer();
} else {
myView.seatOut();
_roomM.setDoorState(myRoomId, 1);
moveToPlace(("door" + myRoomId));
};
break;
case Serve_Phone:
checkNewServer();
break;
case Serve_Dinner:
_roomM.roomV.getItem("dinner_table").setBreakfast(false);
_roomM.setDoorState(myRoomId, 1);
myView.seatOut();
moveToPlace(("door" + myRoomId));
break;
case Serve_Money:
_personV.moveTo(initPos[0], initPos[1]);
break;
};
}
public function updateServe():void{
if (_phase == PHASE_ACCEPT){
if (serveCount){
serveCount--;
if (!serveCount){
serveCount = 0;
onServeEnd();
};
};
};
}
override public function setData(_arg1:Object):void{
super.setData(_arg1);
id = _arg1.mcName.replace("Custom", "");
_customArr = _arg1.customArr;
_customArr.push(myView);
checkNewServer();
}
public function onServeStart():void{
var _local1:int;
_phase = PHASE_ACCEPT;
(SceneMgr.scene as GameScene).waiterMgr.checkDissableServe(curNeed);
checkServeMoney();
setModeMc(0, curNeed);
myView.setMark(false);
switch (curNeed){
case Serve_Key:
_local1 = (myRoomId = _roomM.getEmptyRoom());
_roomM.setDoorState(_local1, 1);
moveToPlace(("door" + _local1));
SoundObject.playSound(Data.SFX_Door_Open);
break;
case Serve_Phone:
case Serve_Clean:
serveCount = ((Math.random() * 60) + 100);
break;
case Serve_Coffee:
serveCount = ((Math.random() * 60) + 60);
checkOutSideServe("coffee");
break;
case Serve_Newspaper:
serveCount = ((Math.random() * 60) + 60);
checkOutSideServe("news");
break;
case Serve_Dinner:
_roomM.roomV.getItem("dinner_table").setBreakfast(true);
serveCount = ((Math.random() * 60) + 180);
myView.changeFrame("eat");
break;
case Serve_Money:
myView.changeFrame("pay");
break;
};
}
public function set myStayPlace(_arg1:String):void{
_myStayPlace = _arg1;
}
protected function updateReady():void{
if (_phase == PHASE_READY){
if (readyCount){
readyCount--;
if (!readyCount){
readyCount = 0;
readyEnd();
};
};
};
}
public function checkNewServer():void{
var _local1:int;
_phase = PHASE_READY;
curNeed = myNeedSeq[0];
switch (curNeed){
case Serve_Key:
moveToPlace("platform");
myView.setNeedMc(1, curNeed);
break;
case Serve_Phone:
case Serve_Clean:
readyStart();
break;
case Serve_Newspaper:
case Serve_Coffee:
_local1 = checkHasChair();
if (_local1){
moveToPlace(("chair" + _local1), false, true);
} else {
readyStart();
};
break;
case Serve_Dinner:
if (checkHasDinner()){
moveToPlace("dinner_table", false, true);
} else {
randomServeSeq();
};
break;
case Serve_Money:
moveToPlace("platform", true);
break;
};
}
protected function addTip(_arg1:Number):void{
var _local2:Number = (modeCount / mode_total);
SoundObject.playSound(Data.SFX_Deal);
if (_local2 <= 0.4){
Method.addComment((myView.x + 20), (myView.y - _arg1));
(SceneMgr.scene as GameScene).addTip(1);
};
}
override public function update():void{
super.update();
updateMode();
this.updateReady();
this.updateServe();
}
public function get myStayPlace():String{
return (_myStayPlace);
}
public function set curNeed(_arg1:int):void{
_curNeed = _arg1;
}
protected function get myView():CustomV{
return ((_personV as CustomV));
}
protected function checkOutSideServe(_arg1:String):void{
if (myStayPlace.search("door") == -1){
myView.changeFrame(_arg1);
};
}
protected function checkHasChair():int{
var _local1:int;
_local1 = _roomM.getEmptyChair();
return (_local1);
}
public function get curNeed():int{
return (_curNeed);
}
public function get phase():int{
return (_phase);
}
protected function readyStart():void{
readyCount = ((Math.random() * 50) + 80);
}
}
}//package src.model.role
Section 52
//MyRoleM (src.model.role.MyRoleM)
package src.model.role {
import src.view.role.*;
import src.data.*;
import lj.src.util.*;
public class MyRoleM extends PersonM {
protected var myActArr:Array;
protected var bComeOut:Boolean;// = true
protected var serveType:String;
protected var phase:int;
public static var PHASE_STAY:int = 1;
public static var PHASE_SERVE:int = 3;
public static var PHASE_WALK:int = 2;
public function updateServe():void{
}
public function checkServeAvail(_arg1):Object{
return (null);
}
override public function update():void{
super.update();
updateServe();
}
public function startServe(_arg1:Object):void{
phase = PHASE_SERVE;
var _local2:String = _arg1.type;
var _local3:int = _arg1.take;
if (!_local3){
_roomM.doServe(_local2);
};
if (_arg1.custom){
_arg1.custom.setMark(false);
} else {
_roomM.setMark(false, _arg1.type, this, _arg1.take);
};
}
public function checkRepeatAct(_arg1:String, _arg2:CustomV, _arg3:Boolean):Boolean{
var _local5:int;
var _local6:Object;
var _local4:Boolean;
if (myActArr.length){
_local5 = 0;
while (_local5 < myActArr.length) {
_local6 = myActArr[_local5];
if ((((((_local6.type == _arg1)) && ((_local6.custom == _arg2)))) && ((_local6.take == _arg3)))){
_local4 = true;
break;
};
_local5++;
};
};
return (_local4);
}
override protected function init():void{
super.init();
phase = PHASE_STAY;
myActArr = new Array();
}
protected function doReachSth(_arg1:Object):void{
}
public function removeFromAct(_arg1:String):void{
var _local2 = 1;
while (_local2 < myActArr.length) {
if (myActArr[_local2].type == _arg1){
myActArr.splice(_local2, 1);
break;
};
_local2++;
};
}
protected function getDesTile(_arg1:String):Array{
var _local2:Array;
if ((((((_arg1 == "platform")) || ((_arg1 == "home")))) || ((_arg1 == "key")))){
_local2 = initPos;
} else {
_local2 = Data.Reach_Pos[_arg1];
};
return (_local2);
}
override public function setData(_arg1:Object):void{
super.setData(_arg1);
var _local2:String = _personV.mcName;
serveType = GameUtil.StrDiscardNum(_local2);
id = int(_local2.replace(serveType, ""));
}
public function addInstruction(_arg1:String, _arg2:CustomV=null, _arg3:Boolean=false, _arg4:Boolean=false):Boolean{
var _local6:String;
var _local7:Object;
var _local5:Boolean;
_local6 = _arg1;
if (checkRepeatAct(_arg1, _arg2, _arg3)){
return (_local5);
};
_local7 = {type:_local6, custom:_arg2, take:_arg3, money:_arg4};
myActArr.push(_local7);
_local5 = true;
if (_arg2){
_arg2.setMark(true);
} else {
_roomM.setMark(true, _arg1, this, _arg3);
};
if ((((myActArr.length == 1)) && ((phase == PHASE_STAY)))){
checkNewDes();
};
return (_local5);
}
public function get actArr():Array{
return (myActArr);
}
public function endServe():void{
phase = PHASE_STAY;
myActArr.shift();
checkNewDes();
}
override public function arrival():void{
var _local1:*;
var _local2:Boolean;
var _local3:*;
super.arrival();
phase = PHASE_STAY;
if (myActArr[0]){
_local1 = (myActArr[0].custom) ? myActArr[0].custom : myActArr[0].type;
_local3 = checkServeAvail(_local1);
if ((_local3 is Boolean)){
_local2 = _local3;
} else {
_local2 = _local3.r;
};
if (_local2){
startServe(myActArr[0]);
} else {
endServe();
};
};
}
protected function checkNewDes():void{
var _local1:String;
var _local2:Array;
if (phase == PHASE_STAY){
if (((myActArr) && (myActArr.length))){
phase = PHASE_WALK;
_personV.gotoFrame("std");
_local1 = myActArr[0].type;
_local2 = getDesTile(_local1);
_personV.moveTo(_local2[0], _local2[1]);
} else {
if (bComeOut){
if (((!((_personV.myCol == initPos[0]))) || (!((_personV.myRow == initPos[1]))))){
addInstruction("home");
};
};
};
};
}
public function checkDisableServe(_arg1:int):void{
}
}
}//package src.model.role
Section 53
//PersonM (src.model.role.PersonM)
package src.model.role {
import src.sys.scene.*;
import src.model.*;
import src.sys.obj.*;
public class PersonM {
public const STATUS_REACH:int = 2;
public const STATUS_WALK:int = 1;
protected var _personV:PersonV;
protected var walk_status:int;
protected var initPos:Array;
protected var _customMgr:CustomSend;
protected var _roomM:RoomM;
public var id:int;
public function PersonM(){
_roomM = (SceneMgr.scene as GameScene).roomV.roomM;
_customMgr = (SceneMgr.scene as GameScene).customSend;
init();
}
public function get personV():PersonV{
return (_personV);
}
public function set personV(_arg1:PersonV):void{
_personV = _arg1;
}
public function setData(_arg1:Object):void{
}
public function setInitPos(_arg1:int, _arg2:int):void{
initPos = [_arg1, _arg2];
}
protected function init():void{
}
public function update():void{
}
public function arrival():void{
}
public function remove():void{
}
}
}//package src.model.role
Section 54
//ServerM (src.model.role.ServerM)
package src.model.role {
import src.vo.*;
import src.view.item.*;
import src.data.*;
import lj.src.util.*;
public class ServerM extends MyRoleM {
protected var serveCount:int;
protected function hasSthToDo(_arg1:int):Boolean{
var _local2:Boolean;
if (_arg1 == 1){
_local2 = checkMendServe();
} else {
if (_arg1 == 2){
_local2 = checkCleanServe();
};
};
return (_local2);
}
public function goOut():void{
addInstruction("back");
bComeOut = false;
}
public function checkMendServe():Boolean{
var _local1:Boolean;
_local1 = _roomM.checkMaleServe();
return (_local1);
}
override protected function getDesTile(_arg1:String):Array{
var _local2:Array = super.getDesTile(_arg1);
if (!_local2){
if (_arg1 == "back"){
_local2 = Data.Server_Tile[(id - 1)];
};
};
return (_local2);
}
override public function startServe(_arg1:Object):void{
super.startServe(_arg1);
serveCount = 60;
if (_arg1.type.search("door") != -1){
_personV.changeFrame("sweep");
SoundObject.playSound(Data.SFX_Sweep);
} else {
if (RoomItem.Mend_Item.indexOf(_arg1.type) != -1){
_personV.changeFrame("repair");
} else {
if (_arg1.type.search("tree") != -1){
_personV.changeFrame("water");
};
};
};
}
public function checkCleanServe():Boolean{
var _local1:Boolean;
if (_customMgr.checkServeId(ServeVO.Clean)){
_local1 = true;
};
if (!_local1){
_local1 = _roomM.checkFemaleServe();
};
return (_local1);
}
override public function checkServeAvail(_arg1):Object{
var _local3:String;
var _local4:CustomM;
var _local2:Boolean;
if ((_arg1 is String)){
_local3 = _arg1;
if (id == 1){
_local2 = _roomM.checkMaleServeOn(_arg1);
} else {
if (id == 2){
if (_roomM.getPlacePerson(_arg1)){
_local4 = (_roomM.getPlacePerson(_arg1).personM as CustomM);
_local2 = checkCustomNeed(_local4);
};
if (!_local2){
_local2 = _roomM.checkFemaleServeOn(_arg1);
};
};
};
};
return (_local2);
}
override protected function init():void{
super.init();
bComeOut = false;
}
public function get comeOut():Boolean{
return (bComeOut);
}
override public function endServe():void{
var _local1:Object = myActArr[0];
if (((GameUtil.checkInArr(RoomItem.Mend_Item, _local1.type)) || (!((_local1.type.search("tree") == -1))))){
_roomM.mendSth(_local1.type);
};
_personV.commonAction();
super.endServe();
}
override public function updateServe():void{
super.updateServe();
if (phase == PHASE_SERVE){
if (serveCount){
serveCount--;
if (!serveCount){
endServe();
};
};
};
}
public function callMe():void{
var _local1:Boolean;
if (!bComeOut){
_local1 = hasSthToDo(id);
if (_local1){
addInstruction("home");
bComeOut = true;
if (id == 1){
SoundObject.playSound(Data.SFX_MayI_Man);
} else {
SoundObject.playSound(Data.SFX_MayI_Woman);
};
};
};
}
override public function arrival():void{
super.arrival();
if (!bComeOut){
_personV.visible = false;
};
}
override protected function checkNewDes():void{
var _local1:Boolean;
super.checkNewDes();
if (bComeOut){
if (phase == PHASE_STAY){
_local1 = hasSthToDo(id);
if (!_local1){
goOut();
};
};
};
}
public function set comeOut(_arg1:Boolean):void{
bComeOut = _arg1;
}
protected function checkCustomNeed(_arg1:CustomM):Boolean{
var _local2:Boolean;
if (_arg1.phase == CustomM.PHASE_WAIT){
if (_arg1.curNeed == ServeVO.Clean){
_local2 = true;
};
};
return (_local2);
}
}
}//package src.model.role
Section 55
//WaiterM (src.model.role.WaiterM)
package src.model.role {
import src.vo.*;
import src.view.role.*;
import src.sys.*;
import src.sys.scene.*;
import src.view.item.*;
import src.data.*;
import lj.src.util.*;
import lj.src.sys.*;
public class WaiterM extends MyRoleM {
protected var initpos:Array;
protected var handItem:Array;
protected var hasKey:Boolean;
protected var sleepCount:int;
protected var flashCount:int;// = 0
public static var Hand_Item:Array = ["newspaper", "food", "phone", "platform", "coffee", "key"];
public static var SleepTotal:int = (20 * Global.stage.frameRate);
public function WaiterM(){
handItem = [0, 0];
super();
}
protected function removeHandItem(_arg1:String):void{
var _local2:Boolean = GameUtil.removeObjInArr(handItem, _arg1);
if (_local2){
handItem.push(0);
};
myView.setHandMc(handItem);
}
override public function update():void{
super.update();
checkSleep();
if (flashCount){
flashCount--;
Method.flashMe(this.myView, flashCount);
};
}
override public function startServe(_arg1:Object):void{
super.startServe(_arg1);
doReachSth(_arg1);
}
public function checkDist(_arg1:String):int{
var _local2:Array = Data.Reach_Pos[_arg1];
var _local3:Array = _personV.findRoad(_local2[0], _local2[1]);
return (_local3.length);
}
protected function checkCustomNeed(_arg1:CustomM):Boolean{
var _local3:int;
var _local4:int;
var _local2:Boolean;
if (_arg1.phase == CustomM.PHASE_WAIT){
_local3 = 0;
while (_local3 < handItem.length) {
if (handItem[_local3]){
if (_arg1.curNeed == Data.getServeNum(handItem[_local3])){
_local2 = true;
break;
};
};
_local3++;
};
_local4 = 0;
while (_local4 < myActArr.length) {
if (_arg1.curNeed == Data.getServeNum(myActArr[_local4].type)){
_local2 = true;
break;
};
_local4++;
};
};
return (_local2);
}
override public function checkServeAvail(_arg1):Object{
var _local5:CustomM;
var _local6:RoomItem;
var _local2:Boolean;
var _local3 = "";
var _local4:Boolean;
if (isPerson(_arg1)){
_local5 = ((_arg1 as CustomV).personM as CustomM);
if ((((_local5.curNeed == CustomM.Serve_Key)) && (hasKey))){
_local2 = true;
} else {
_local2 = checkCustomNeed(_local5);
};
_local3 = _local5.myStayPlace;
} else {
if ((((_arg1 == "platform")) && (_roomM.moneyNum))){
_local4 = true;
_local2 = true;
} else {
if (Hand_Item.indexOf(_arg1) != -1){
_local6 = _roomM.roomV.getItem(_arg1);
if (_local6){
if (_local6.enable){
_local2 = checkTakeItem(_arg1);
};
} else {
_local2 = checkTakeItem(_arg1);
};
} else {
if (_roomM.checkHasPerson(_arg1)){
_local5 = (_roomM.getPlacePerson(_arg1).personM as CustomM);
if (((!((_arg1.search("door") == -1))) && (_local5.personV.visible))){
trace("Door Custom Empty!!!");
} else {
_local2 = checkCustomNeed(_local5);
};
};
};
};
_local3 = _arg1;
};
return ({r:_local2, type:_local3, money:_local4, custom:_local5});
}
public function repeatHandItem(_arg1:String):Boolean{
var _local2:Boolean;
var _local3:int;
while (_local3 < handItem.length) {
if ((((handItem[_local3] == _arg1)) || ((((_arg1 == "key")) && (this.hasKey))))){
_local2 = true;
break;
};
_local3++;
};
return (_local2);
}
protected function isPerson(_arg1):Boolean{
return ((_arg1 is CustomV));
}
public function deleteInstruction(_arg1):Boolean{
var _local2:Boolean;
if (GameUtil.checkInArr(myActArr, _arg1)){
GameUtil.removeObjInArr(myActArr, _arg1);
_local2 = true;
};
return (_local2);
}
override protected function doReachSth(_arg1:Object):void{
if (_arg1.money){
(SceneMgr.scene as GameScene).takeMoney();
SoundObject.playSound(Data.SFX_Cash);
_roomM.setMoney(0);
endServe();
return;
};
if (_arg1.type == "platform"){
if (_arg1.take){
} else {
hasKey = false;
GameMain.getInstance().removeMyMouse();
};
endServe();
} else {
if (_arg1.take){
addHandItem(_arg1.type);
(SceneMgr.scene as GameScene).waiterMgr.checkDissableServe(Data.getServeNum(_arg1.type));
};
endServe();
};
}
public function checkTakeItem(_arg1:String):Boolean{
var _local2:Boolean;
var _local3:Boolean;
if (_arg1 == "key"){
if (!hasKey){
_local3 = (SceneMgr.scene as GameScene).waiterMgr.checkHasItem(id, _arg1);
} else {
return (_local2);
};
} else {
if (hasFreeHand(_arg1)){
_local3 = (SceneMgr.scene as GameScene).waiterMgr.checkHasItem(id, _arg1);
};
};
if (!_local3){
_local2 = _customMgr.checkServer(_arg1);
};
return (_local2);
}
protected function addHandItem(_arg1:String):void{
var _local2:int;
if ((((_arg1 == "key")) && (!(hasKey)))){
hasKey = true;
GameMain.getInstance().changeMouse("Key", true);
SoundObject.playSound(Data.SFX_Key);
} else {
_local2 = 0;
while (_local2 < handItem.length) {
if (!handItem[_local2]){
handItem[_local2] = _arg1;
break;
};
_local2++;
};
myView.setHandMc(handItem);
SoundObject.playSound(Data.SFX_Take);
};
}
override public function addInstruction(_arg1:String, _arg2:CustomV=null, _arg3:Boolean=false, _arg4:Boolean=false):Boolean{
var _local5:Boolean = super.addInstruction(_arg1, _arg2, _arg3, _arg4);
if (((_local5) && (!((_arg1 == "home"))))){
flashCount = 8;
};
return (_local5);
}
protected function checkSleep():void{
if ((((((((phase == PHASE_STAY)) && (!(handItem[0])))) && (!(handItem[1])))) && (!(hasKey)))){
sleepCount++;
if (sleepCount >= SleepTotal){
sleepCount = 0;
myView.changeFrame("bored");
};
} else {
sleepCount = 0;
};
}
protected function get myView():WaiterV{
return ((_personV as WaiterV));
}
protected function hasFreeHand(_arg1:String):Boolean{
var _local2:Boolean;
_local2 = repeatHandItem(_arg1);
if (_local2){
return (_local2);
};
var _local3:int;
while (_local3 < handItem.length) {
if (handItem[_local3] == 0){
_local2 = true;
break;
};
_local3++;
};
return (_local2);
}
override public function checkDisableServe(_arg1:int):void{
var _local2:String;
super.checkDisableServe(_arg1);
if (_arg1 == ServeVO.Key){
hasKey = false;
GameMain.getInstance().removeMyMouse();
_roomM.roomV.bg.setMark(false, "key");
} else {
removeHandItem(Data.getServeStr(_arg1));
if (_arg1 == ServeVO.Dinner){
_roomM.roomV.bg.setMark(false, "food");
} else {
_local2 = Data.getServeStr(_arg1);
if (_local2){
_roomM.roomV.getItem(_local2).setMark(false, this);
};
};
};
}
override public function arrival():void{
super.arrival();
}
public function checkTotalDist():int{
var _local2:int;
var _local3:Array;
var _local4:Array;
var _local1:int;
if (actArr.length > 1){
_local2 = 1;
while (_local2 < actArr.length) {
_local3 = Data.Reach_Pos[actArr[_local2].type];
_local4 = _personV.findRoad(_local3[0], _local3[1]);
_local1 = (_local1 + _local4.length);
_local2++;
};
};
return (_local1);
}
}
}//package src.model.role
Section 56
//CustomSend (src.model.CustomSend)
package src.model {
import src.vo.*;
import src.view.role.*;
import src.model.role.*;
import src.sys.*;
import src.sys.scene.*;
import src.data.*;
import lj.src.util.*;
public class CustomSend {
protected var timeCount:int;
protected var custom_freq:int;
public var total_num:int;
protected var _scene:GameScene;
protected var left_num:int;
private var _customArr:Array;
public function CustomSend(_arg1:GameScene){
_scene = _arg1;
init();
}
public function checkServer(_arg1:String):Boolean{
var _local2:Boolean;
var _local3:int = Data.getServeNum(_arg1);
_local2 = checkServeId(_local3);
return (_local2);
}
protected function checkEmpty():Boolean{
var _local1:Boolean;
var _local2:int = _scene.roomV.roomM.getEmptyRoom();
if (!_local2){
_local1 = false;
};
return (_local1);
}
public function checkServeId(_arg1:int):Boolean{
var _local4:CustomM;
var _local2:Boolean;
var _local3:int;
while (_local3 < customArr.length) {
_local4 = (customArr[_local3].personM as CustomM);
if (_local4.curNeed == _arg1){
if ((((_local4.phase == CustomM.PHASE_WAIT)) || ((((_local4.phase == CustomM.PHASE_READY)) && ((_local4.curNeed == ServeVO.Key)))))){
_local2 = true;
break;
};
};
_local3++;
};
return (_local2);
}
protected function init():void{
total_num = (left_num = GameValue.curCustom);
custom_freq = GameValue.custom_freq;
_customArr = new Array();
_scene.ui_hud.setCustom((total_num - left_num), total_num);
}
public function addCustom():void{
var _local1:int = ((Math.random() * Data.Custom_Num) + 1);
var _local2:CustomV = new CustomV(("Custom" + _local1));
var _local3:int = (Math.random() * Data.Comeout_Tile.length);
_local2.setTilePos(Data.Comeout_Tile[_local3][0], Data.Comeout_Tile[_local3][1]);
_local2.personM.setInitPos(Data.Comeout_Tile[_local3][0], Data.Comeout_Tile[_local3][1]);
_local2.setData({customArr:_customArr, mcName:_local2.mcName});
_scene.midCtn.addChild(_local2);
left_num--;
_scene.ui_hud.setCustom((total_num - left_num), total_num);
SoundObject.playSound(Data.SFX_Bell);
}
public function get customArr():Array{
return (_customArr);
}
public function update():void{
if (left_num){
if ((++timeCount % custom_freq) == 1){
if (((checkEmpty()) && (!(_scene.roomV.roomM.checkHasPerson("platform"))))){
addCustom();
} else {
trace("没有空位!!");
};
};
};
}
public function remove():void{
_customArr.splice(0);
_scene = null;
}
public function checkLastCustom():void{
if (((!(_customArr.length)) && ((left_num <= 0)))){
(SceneMgr.scene as GameScene).readyToEnd = true;
};
}
}
}//package src.model
Section 57
//MyMap (src.model.MyMap)
package src.model {
import flash.geom.*;
import src.model.AStar.*;
import lj.src.structure.*;
import src.data.*;
public class MyMap {
protected var mapArr:Array2D;
protected var _offsetX:Number;
protected var _offsetY:Number;
protected var _road:Road;
public function MyMap(_arg1:Array){
mapArr = new Array2D(_arg1.length, _arg1[0].length, _arg1);
init();
}
public function get road():Road{
return (_road);
}
public function get offsetY():Number{
return (_offsetY);
}
public function set road(_arg1:Road):void{
_road = _arg1;
}
protected function init():void{
road = new Road(mapArr);
_offsetX = Data.MapData.offsetX;
_offsetY = Data.MapData.offsetY;
}
public function get offsetX():Number{
return (_offsetX);
}
public function get mapData():Array2D{
return (mapArr);
}
public function posToTile(_arg1:Number, _arg2:Number):Point{
var _local3:Point = new Point(int(((_arg2 - offsetY) / Data.TileSize)), int(((_arg1 - offsetX) / Data.TileSize)));
return (_local3);
}
}
}//package src.model
Section 58
//RoomM (src.model.RoomM)
package src.model {
import src.vo.*;
import src.view.role.*;
import src.model.role.*;
import src.view.*;
import src.view.item.*;
import src.data.*;
import lj.src.util.*;
public class RoomM {
public var stair1:int;// = 1
public var stair2:int;// = 1
public var chair1:int;// = 0
public var chair2:int;// = 0
public var hangs1:int;// = 0
public var hangs2:int;// = 0
public var paint1:int;// = 0
public var paint2:int;// = 0
public var newspaper:int;// = 0
public var moneyNum:int;// = 0
public var front_table:int;// = 0
public var popularity:int;// = 10
protected var availDoor:Array;
public var dinner_table:int;// = 0
public var doorLevels:Array;
public var coffee:int;// = 0
public var tree1:int;// = 0
public var tree2:int;// = 0
public var totalCustom:int;// = 3
public var lamp1:int;// = 0
public var lamp2:int;// = 0
public var bigpaint:int;// = 0
public var armor1:int;// = 0
protected var waitDinnerCustoms:Array;
private var _roomV:RoomV;
public var placeCustomArr:Array;
public var armor2:int;// = 0
public var phone:int;// = 0
public var platform:int;// = 0
public static var CustomItemList:Array = ["door1", "door2", "door3", "door4", "door5", "door6", "door7", "door8", "chair1", "chair2", "dinner_table"];
public function RoomM(){
availDoor = [1, 2, 3, 4, 5, 6, 7, 8];
super();
init();
}
public function checkDinnerWaitCustom():void{
if (waitDinnerCustoms.length){
waitDinnerCustoms[0].checkNewServer();
waitDinnerCustoms.shift();
};
}
public function getPlacePerson(_arg1:String):CustomV{
return (placeCustomArr[_arg1]);
}
public function getEmptyRoom():int{
var _local1:int;
var _local2:Array = GameUtil.randomArrObj(GameUtil.clone(availDoor));
var _local3:int;
while (_local3 < _local2.length) {
if (!checkHasPerson(("door" + _local2[_local3]))){
_local1 = _local2[_local3];
break;
};
_local3++;
};
return (_local1);
}
public function removePlacePerson(_arg1:String):Boolean{
var _local2:Boolean;
if (checkHasPerson(_arg1)){
_local2 = true;
placeCustomArr[_arg1] = null;
if (_arg1 == "dinner_table"){
checkDinnerWaitCustom();
};
};
return (_local2);
}
public function addMoney(_arg1:int):void{
moneyNum = (moneyNum + _arg1);
_roomV.setMoney(moneyNum);
}
public function checkCanGo(_arg1:String):Boolean{
var _local2:Boolean;
if (placeCustomArr[_arg1]){
_local2 = false;
};
return (_local2);
}
public function addDinnerWaitCustom(_arg1:CustomM):void{
if (!GameUtil.checkInArr(waitDinnerCustoms, _arg1)){
waitDinnerCustoms.push(_arg1);
};
}
public function checkFemaleServeOn(_arg1:String):Boolean{
var _local2:Boolean;
if (_arg1.search("tree") != -1){
if (checkItemBroken(_arg1)){
_local2 = true;
};
};
return (_local2);
}
public function setShopData(_arg1:ShopData):void{
var _local3:int;
var _local4:String;
var _local5:int;
var _local6:int;
var _local7:int;
doorLevels = [2, 2, 1, 1, 1, 1, 1, 1];
if (_arg1){
_local3 = 1;
while (_local3 < Data.Shop_Items.length) {
_local4 = Data.Shop_Items[_local3][0];
_local5 = _arg1[_local4];
if (_local5){
if (this.hasOwnProperty(_local4)){
this[_local4] = _local5;
} else {
if (_local4 == "floor2"){
if (_arg1.door <= 2){
doorLevels = [2, 2, 2, 2, 2, 1, 1, 1];
};
} else {
if (_local4 == "floor3"){
if (_arg1.door <= 2){
doorLevels = [2, 2, 2, 2, 2, 2, 2, 2];
};
} else {
if (_local4 == "door"){
if (_local5 > 2){
doorLevels = [_local5, _local5, _local5, _local5, _local5, _local5, _local5, _local5];
};
} else {
if (_local4 == "chairs"){
if (_local5 > 1){
chair1 = _local5;
chair2 = _local5;
};
} else {
_local6 = Data.getTypeNums(_local4);
_local7 = 0;
while (_local7 < _local6) {
this[(_local4 + (_local7 + 1))] = _local5;
_local7++;
};
};
};
};
};
};
};
_local3++;
};
};
if (_arg1.chairs >= 2){
chair1 = _arg1.chairs;
chair2 = _arg1.chairs;
};
availDoor = new Array();
var _local2:int;
while (_local2 < doorLevels.length) {
if (doorLevels[_local2] > 1){
availDoor.push((_local2 + 1));
};
_local2++;
};
}
public function set roomV(_arg1:RoomV):void{
_roomV = _arg1;
}
public function setDoorState(_arg1:int, _arg2:int):void{
roomV.bg.setDoorState(_arg1, _arg2);
}
protected function init():void{
placeCustomArr = new Array();
waitDinnerCustoms = new Array();
}
public function doServe(_arg1:String):Boolean{
var _local2:Boolean;
if (checkHasPerson(_arg1)){
(placeCustomArr[_arg1].personM as CustomM).onServeStart();
_local2 = true;
};
return (_local2);
}
public function get roomV():RoomV{
return (_roomV);
}
public function setMark(_arg1:Boolean, _arg2:String, _arg3:MyRoleM, _arg4:Boolean):void{
if (((((!((_arg2.search("door") == -1))) || ((_arg2 == "food")))) || ((_arg2 == "key")))){
roomV.bg.setMark(_arg1, _arg2);
} else {
if (!_arg4){
if (checkHasPerson(_arg2)){
getPlacePerson(_arg2).setMark(_arg1);
return;
};
};
if (roomV.getItem(_arg2)){
roomV.getItem(_arg2).setMark(_arg1, _arg3);
};
};
}
public function getAvailServe():Array{
var _local1:Array = [0, 1, coffee, newspaper, phone, dinner_table];
var _local2:Array = new Array();
var _local3:int;
while (_local3 < _local1.length) {
if (_local1[_local3]){
_local2.push((_local3 + 1));
};
_local3++;
};
return (_local2);
}
public function checkMaleServeOn(_arg1:String):Boolean{
var _local2:Boolean;
if (GameUtil.checkInArr(RoomItem.Mend_Item, _arg1)){
if (checkItemBroken(_arg1)){
_local2 = true;
};
};
return (_local2);
}
public function checkHasPerson(_arg1:String):Boolean{
var _local2:Boolean;
if ((placeCustomArr[_arg1] is CustomV)){
_local2 = true;
};
return (_local2);
}
public function checkMaleServe():Boolean{
var _local1:Boolean;
var _local2:int;
while (_local2 < RoomItem.Mend_Item.length) {
if (this[RoomItem.Mend_Item[_local2]]){
if (checkItemBroken(RoomItem.Mend_Item[_local2])){
_local1 = true;
break;
};
};
_local2++;
};
return (_local1);
}
public function getEmptyChair():int{
var _local1:int;
var _local2:Array = GameUtil.randomArrObj([1, 2]);
var _local3:int;
while (_local3 < _local2.length) {
if (this[("chair" + _local2[_local3])]){
if (!checkHasPerson(("chair" + _local2[_local3]))){
_local1 = _local2[_local3];
break;
};
};
_local3++;
};
return (_local1);
}
public function checkItemBroken(_arg1:String):Boolean{
var _local2:Boolean;
if (_roomV.getItem(_arg1).broken){
_local2 = true;
};
return (_local2);
}
public function mendSth(_arg1:String):void{
_roomV.getItem(_arg1).setBroken(false);
}
public function checkFemaleServe():Boolean{
var _local1:Boolean;
var _local2:int;
while (_local2 < 2) {
if (this[("tree" + (_local2 + 1))]){
if (checkItemBroken(("tree" + (_local2 + 1)))){
_local1 = true;
break;
};
};
_local2++;
};
return (_local1);
}
public function addPlacePerson(_arg1:String, _arg2:CustomV):Boolean{
var _local3:Boolean;
if (!checkHasPerson(_arg1)){
placeCustomArr[_arg1] = _arg2;
_local3 = true;
};
return (_local3);
}
public function setMoney(_arg1:int):void{
moneyNum = _arg1;
_roomV.setMoney(moneyNum);
}
}
}//package src.model
Section 59
//WaiterMgr (src.model.WaiterMgr)
package src.model {
import src.view.role.*;
import src.model.role.*;
import flash.display.*;
import src.sys.scene.*;
import src.data.*;
public class WaiterMgr {
protected var _customSend:CustomSend;
public var waiterArr:Array;
public static var CUR_WAITER_NUM:int = 2;
protected function sortWaiter(_arg1:Object, _arg2:Object):Number{
if (((_arg1.dist + _arg1.curRoute) + _arg1.total) > ((_arg2.dist + _arg2.curRoute) + _arg2.total)){
return (1);
};
if (((_arg1.dist + _arg1.curRoute) + _arg1.total) < ((_arg2.dist + _arg2.curRoute) + _arg2.total)){
return (-1);
};
return (0);
}
public function callServer(_arg1:int):void{
(waiterArr[(1 + _arg1)].personM as ServerM).callMe();
}
public function remove():void{
waiterArr.splice(0);
_customSend = null;
}
public function checkHasItem(_arg1:int, _arg2:String):Boolean{
var _local3:Boolean;
var _local4:int;
while (_local4 < CUR_WAITER_NUM) {
_local3 = (waiterArr[_local4].personM as WaiterM).repeatHandItem(_arg2);
if (_local3){
break;
};
_local4++;
};
return (_local3);
}
public function checkDissableServe(_arg1:int):void{
var _local2:int;
if (!_customSend.checkServeId(_arg1)){
_local2 = 0;
while (_local2 < CUR_WAITER_NUM) {
(waiterArr[_local2].personM as WaiterM).checkDisableServe(_arg1);
_local2++;
};
};
}
protected function checkServer(_arg1:String):Boolean{
var _local5:ServerM;
var _local2:Boolean;
var _local3:Boolean;
var _local4 = 2;
while (_local4 < waiterArr.length) {
_local5 = (waiterArr[_local4].personM as ServerM);
if (_local5.comeOut){
_local3 = _local5.checkServeAvail(_arg1);
if (_local3){
_local2 = _local5.addInstruction(_arg1);
break;
};
};
_local4++;
};
return (_local2);
}
public function checkSameInstruct(_arg1:int, _arg2:String, _arg3:CustomV, _arg4:Boolean):Boolean{
var _local5:Boolean;
var _local6:int;
while (_local6 < CUR_WAITER_NUM) {
if ((_local6 + 1) != _arg1){
_local5 = (waiterArr[_local6].personM as WaiterM).checkRepeatAct(_arg2, _arg3, _arg4);
if (_local5){
trace("重复了!!!指令!!!");
break;
};
};
_local6++;
};
return (_local5);
}
public function init(_arg1:DisplayObjectContainer):void{
var _local3:WaiterV;
_customSend = (SceneMgr.scene as GameScene).customSend;
waiterArr = new Array();
var _local2:int;
while (_local2 < Data.Waiter_Tile.length) {
if (_local2 < 2){
_local3 = new WaiterV(("Waiter" + (_local2 + 1)));
} else {
_local3 = new WaiterV(("Server" + ((_local2 % 2) + 1)));
};
_local3.setTilePos(Data.Waiter_Tile[_local2][0], Data.Waiter_Tile[_local2][1]);
_local3.personM.setInitPos(Data.Waiter_Tile[_local2][2], Data.Waiter_Tile[_local2][3]);
_arg1.addChild(_local3);
waiterArr.push(_local3);
_local2++;
};
}
public function clickCustom(_arg1:CustomV):void{
var _local5:Object;
var _local6:Boolean;
var _local2:String = (_arg1.personM as CustomM).myStayPlace;
var _local3:Array = getOrderWaiter(_local2);
var _local4:int;
while (_local4 < CUR_WAITER_NUM) {
if (checkSameInstruct((_local4 + 1), _local2, _arg1, false)){
break;
};
_local5 = (_local3[_local4].role.personM as WaiterM).checkServeAvail(_arg1);
if (_local5.r){
_local6 = (_local3[_local4].role.personM as WaiterM).addInstruction(_local2, _arg1);
if (_local6){
break;
} else {
trace("重复添加!!");
break;
};
};
_local4++;
};
}
protected function getOrderWaiter(_arg1:String):Array{
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local2:Array = new Array();
var _local3:int;
while (_local3 < CUR_WAITER_NUM) {
_local4 = (waiterArr[_local3].personM as WaiterM).checkDist(_arg1);
_local5 = (waiterArr[_local3].personM as WaiterM).actArr.length;
_local6 = waiterArr[_local3].routeArrLength;
_local7 = (waiterArr[_local3].personM as WaiterM).checkTotalDist();
_local2.push({dist:_local4, role:waiterArr[_local3], actNum:_local5, curRoute:_local6, total:_local7});
_local3++;
};
_local2.sort(sortWaiter);
return (_local2);
}
public function clickItem(_arg1:String):void{
var _local2:Array;
var _local3:int;
var _local4:Object;
var _local5:Boolean;
var _local6:Boolean;
if (!checkServer(_arg1)){
_local2 = getOrderWaiter(_arg1);
_local3 = 0;
while (_local3 < CUR_WAITER_NUM) {
_local4 = (_local2[_local3].role.personM as WaiterM).checkServeAvail(_arg1);
if (_local4.r){
_local5 = false;
if (WaiterM.Hand_Item.indexOf(_arg1) != -1){
_local5 = true;
};
if (checkSameInstruct((_local3 + 1), _arg1, null, _local5)){
break;
};
_local6 = (_local2[_local3].role.personM as WaiterM).addInstruction(_arg1, null, _local5, _local4.money);
if (_local6){
break;
} else {
if (_local4.custom){
trace("不去顾客那里了 ! Repeat");
break;
};
};
};
_local3++;
};
};
}
}
}//package src.model
Section 60
//AStarObj (src.sys.obj.AStarObj)
package src.sys.obj {
import src.sys.scene.*;
import flash.geom.*;
import src.model.*;
import src.data.*;
import lj.src.util.*;
public class AStarObj extends MovingObj {
public var myRow:int;
protected var radius:Number;
protected var tileArr:Array;
protected var routeArr:Array;
protected var _rMap:MyMap;
protected var _tileSize:int;
public var myCol:int;
public function AStarObj(_arg1:String){
if ((SceneMgr.scene is GameScene)){
_rMap = (SceneMgr.scene as GameScene).map;
};
super(_arg1);
}
protected function arrival():void{
myXspeed = 0;
myYspeed = 0;
if (((tileArr) && (tileArr.length))){
myCol = tileArr[(tileArr.length - 1)].x;
myRow = tileArr[(tileArr.length - 1)].y;
};
}
override public function updateEvents():void{
super.updateEvents();
}
public function setTilePos(_arg1:int, _arg2:int):void{
myCol = _arg1;
myRow = _arg2;
myX = getTilePosX(_arg1, _arg2);
myY = getTilePosY(_arg1, _arg2);
convertXYAction();
}
protected function posRouteMove():void{
if (((routeArr) && (routeArr.length))){
if (((!(myXspeed)) && (!(myYspeed)))){
radius = Math.atan2((routeArr[0].y - myY), (routeArr[0].x - myX));
myXspeed = (Math.cos(radius) * mySpeed);
myYspeed = (Math.sin(radius) * mySpeed);
} else {
myX = (myX + myXspeed);
myY = (myY + myYspeed);
if ((((((myX + myXspeed) * GameUtil.getDir(myXspeed)) >= (routeArr[0].x * GameUtil.getDir(myXspeed)))) && ((((myY + myYspeed) * GameUtil.getDir(myYspeed)) >= (routeArr[0].y * GameUtil.getDir(myYspeed)))))){
myX = routeArr[0].x;
myY = routeArr[0].y;
myCol = routeArr[0].col;
myRow = routeArr[0].row;
routeArr.shift();
arriveCenter();
myXspeed = (myYspeed = 0);
if (!routeArr.length){
arrival();
};
};
};
};
}
public function getTilePosX(_arg1:int, _arg2:int):Number{
var _local3:Number = (_rMap.offsetX + ((_arg2 + 0.5) * Data.TileSize));
return (_local3);
}
public function getTilePosY(_arg1:int, _arg2:int):Number{
var _local3:Number = (_rMap.offsetY + ((_arg1 + 0.5) * Data.TileSize));
return (_local3);
}
protected function arriveCenter():void{
}
public function moveToPos(_arg1:Number, _arg2:Number):void{
var _local3:Point = new Point(_arg1, _arg2);
routeArr = new Array();
routeArr.push(_local3);
var _local4:Number = Math.atan2((_arg2 - myY), (_arg1 - myX));
myXspeed = (Math.cos(_local4) * mySpeed);
myYspeed = (Math.sin(_local4) * mySpeed);
}
override protected function moveAction():void{
posRouteMove();
}
override public function setData(_arg1:Object):void{
_tileSize = Data.TileSize;
super.setData(_arg1);
}
public function findRoad(_arg1:int, _arg2:int):Array{
var _local3:Array = _rMap.road.seekRoad(myCol, myRow, _arg1, _arg2);
return (_local3);
}
public function moveToTile(_arg1:int, _arg2:int):Array{
var _local3:int;
var _local4:int;
var _local5:int;
tileArr = _rMap.road.seekRoad(myCol, myRow, _arg1, _arg2);
if (((tileArr) && (tileArr.length))){
routeArr = new Array();
_local3 = 1;
while (_local3 < tileArr.length) {
_local4 = tileArr[_local3].x;
_local5 = tileArr[_local3].y;
routeArr.push({x:getTilePosX(_local4, _local5), y:getTilePosY(_local4, _local5), col:_local4, row:_local5});
_local3++;
};
};
return (tileArr);
}
protected function tileRouteMove():void{
if (((routeArr) && ((routeArr.length > 1)))){
myXspeed = ((routeArr[1].y - routeArr[0].y) * mySpeed);
myYspeed = ((routeArr[1].x - routeArr[0].x) * mySpeed);
if (((myXspeed) && (myYspeed))){
myXspeed = (myXspeed * 0.7);
myYspeed = (myYspeed * 0.7);
};
myX = (myX + myXspeed);
myY = (myY + myYspeed);
trace("speed: ", myXspeed, myYspeed);
if ((((Math.abs((myX - ((routeArr[1].y + 0.5) * _tileSize))) <= Math.abs(myXspeed))) && ((Math.abs((myY - ((routeArr[1].x + 0.5) * _tileSize))) <= Math.abs(myYspeed))))){
myX = ((routeArr[1].y + 0.5) * _tileSize);
myY = ((routeArr[1].x + 0.5) * _tileSize);
routeArr.shift();
myCol = routeArr[0].x;
myRow = routeArr[0].y;
trace("Shift!!", "myCol: ", myCol, "myRow: ", myRow);
if (routeArr.length == 1){
arrival();
};
};
};
}
}
}//package src.sys.obj
Section 61
//MovingObj (src.sys.obj.MovingObj)
package src.sys.obj {
import flash.display.*;
import flash.geom.*;
import lj.src.interfaces.*;
import src.data.*;
import lj.src.util.*;
import lj.src.sys.*;
public class MovingObj extends ViewMC implements IUpdate {
protected var left:int;// = 0
public var myXspeed:Number;// = 0
protected var right:int;
protected var bottom:int;
protected var myY:Number;
protected var curDir:int;// = 1
protected var myPause:int;
protected var myX:Number;
public var myYspeed:Number;// = 0
protected var top:int;// = 0
protected var myPushXspeed:Number;// = 0
protected var floatCycle:int;// = 10
protected var myPushYspeed:Number;// = 0
protected var mySpeed:Number;// = 3
protected var animCount:int;
public function MovingObj(_arg1:String){
right = Data.stageWidth;
bottom = Data.stageHeight;
super(_arg1);
init();
}
override public function remove():void{
super.remove();
if (!GameUtil.checkInArr(Global.removeArr, this)){
Global.removeArr.push(this);
} else {
trace("Warning!!!! removeArr中已经存在我 ", mcName);
};
}
protected function setValidBounds(_arg1:Rectangle):void{
if (_arg1){
left = _arg1.left;
right = _arg1.right;
top = _arg1.top;
bottom = _arg1.bottom;
};
}
protected function init():void{
Global.updateArr.push(this);
}
public function hitMe(_arg1:MovingObj):void{
}
protected function checkHitByPoint(_arg1:MovingObj):Boolean{
var _local3:Point;
var _local4:Rectangle;
var _local2:Boolean;
if (_arg1){
_local3 = _arg1.mc.globalToLocal(new Point(myX, myY));
_local4 = _arg1.getBounds(_arg1.mc);
_local2 = _local4.containsPoint(_local3);
};
return (_local2);
}
public function initSpeed():void{
myXspeed = (myYspeed = (myPushXspeed = (myPushYspeed = 0)));
}
public function setPos(_arg1:Number, _arg2:Number):void{
myX = _arg1;
myY = _arg2;
convertXYAction();
}
public function set pushXspeed(_arg1:Number):void{
myPushXspeed = _arg1;
}
public function set ySpeed(_arg1:Number):void{
myYspeed = _arg1;
}
protected function checkHitByRect(_arg1:MovingObj):Boolean{
var _local2:Boolean;
if (_arg1){
_local2 = getBounds(_arg1.mc).intersects(_arg1.getBounds(_arg1.mc));
};
return (_local2);
}
override public function setData(_arg1:Object):void{
super.setData(_arg1);
}
public function get xSpeed():Number{
return (myXspeed);
}
protected function lightWhite(_arg1:int):void{
if ((_arg1 % 4) == 0){
_mc.transform.colorTransform = GameUtil.nonTrans;
} else {
_mc.transform.colorTransform = GameUtil.whiteTrans;
};
}
public function setY(_arg1:Number):void{
myY = _arg1;
}
public function setX(_arg1:Number):void{
myX = _arg1;
}
public function updateEvents():void{
updateStill();
if (myPause){
return;
};
moveAction();
convertXYAction();
}
protected function convertXYAction():void{
if (_mc){
x = Math.round(myX);
y = Math.round(myY);
};
}
public function checkDist(_arg1:Number, _arg2:Number, _arg3:Number):Boolean{
var _local4:Boolean;
if ((((x - _arg1) * (x - _arg1)) + ((y - _arg2) * (y - _arg2))) > (((width / 2) - _arg3) * ((width / 2) - _arg3))){
_local4 = true;
};
return (_local4);
}
public function set pushYspeed(_arg1:Number):void{
myPushYspeed = _arg1;
}
public function get ySpeed():Number{
return (myYspeed);
}
public function set xSpeed(_arg1:Number):void{
myXspeed = _arg1;
}
protected function updateStill():void{
if (myPause){
myPause--;
};
}
override public function addToStage(_arg1:DisplayObjectContainer, _arg2:Number=0, _arg3:Number=0):void{
super.addToStage(_arg1, _arg2, _arg3);
setPos(_arg2, _arg3);
}
protected function float():void{
animCount++;
var _local1:Number = Math.sin((animCount / floatCycle));
myPushYspeed = _local1;
}
protected function checkDir():void{
if ((((myXspeed > 0)) || ((myPushXspeed > 0)))){
curDir = 1;
} else {
if ((((myXspeed < 0)) || ((myPushXspeed < 0)))){
curDir = -1;
};
};
scaleMe(curDir);
}
protected function moveAction():void{
myX = (myX + (myXspeed + myPushXspeed));
myY = (myY + (myYspeed + myPushYspeed));
}
public function replay():void{
if ((_mc.getChildAt(0) as MovieClip)){
(_mc.getChildAt(0) as MovieClip).play();
};
}
public function pause():void{
if ((_mc.getChildAt(0) as MovieClip)){
(_mc.getChildAt(0) as MovieClip).stop();
};
}
}
}//package src.sys.obj
Section 62
//PersonV (src.sys.obj.PersonV)
package src.sys.obj {
import src.model.role.*;
import src.data.*;
import lj.src.util.*;
public class PersonV extends RoleV {
protected var walkStr:String;// = ""
protected var _personM:PersonM;
public function PersonV(_arg1:String){
super(_arg1);
changeFrame("std");
setScale(Data.ROLE_SCALE);
mySpeed = 6;
}
override protected function arrival():void{
super.arrival();
commonAction();
_personM.arrival();
}
override public function commonAction():void{
if (myActionFinished){
changeFrame(("std" + walkStr));
};
}
override public function updateEvents():void{
if (_personM){
_personM.update();
};
super.updateEvents();
walkAction();
}
override public function remove():void{
super.remove();
_personM.remove();
}
override public function animOver():void{
super.animOver();
}
protected function checkVisible():void{
if (((GameUtil.checkInArr(Data.InvisibleTiles, myCol, 0)) && (GameUtil.checkInArr(Data.InvisibleTiles, myRow, 1)))){
visible = false;
} else {
visible = true;
};
}
override public function setData(_arg1:Object):void{
super.setData(_arg1);
_personM.setData(_arg1);
}
override protected function arriveCenter():void{
checkVisible();
}
override protected function init():void{
super.init();
}
public function get personM():PersonM{
return (_personM);
}
public function moveTo(_arg1:int, _arg2:int):void{
var _local3:Array = this.moveToTile(_arg1, _arg2);
if (((_local3) && (!(_local3.length)))){
this.arrival();
};
}
protected function walkAction():void{
var _local1:int;
if (!myActionFinished){
return;
};
if (((myXspeed) || (myYspeed))){
_local1 = int((radius / 0.0174));
changeFrame(((("walk" + walkStr) + "_") + GameUtil.to360StdDegree(_local1)));
};
}
}
}//package src.sys.obj
Section 63
//RoleV (src.sys.obj.RoleV)
package src.sys.obj {
import flash.display.*;
import src.data.*;
import lj.src.util.*;
public class RoleV extends AStarObj {
protected var myCurrentFrame:int;
protected var myCurrentLabel:String;
protected var bStopFrame:Boolean;
protected var myActionFinished:Boolean;// = true
protected var innerLayer:int;// = 0
protected var frameEvent:Array;
protected var myFrameInfo:Object;
public function RoleV(_arg1:String){
super(_arg1);
}
public function commonAction():void{
}
override public function updateEvents():void{
super.updateEvents();
updateFrameEvent();
}
public function animOver():void{
myActionFinished = true;
commonAction();
}
public function gotoFrame(_arg1:String):void{
_mc.gotoAndStop(_arg1);
myActionFinished = true;
}
public function get innerMc():MovieClip{
return ((_mc.getChildAt(innerLayer) as MovieClip));
}
override protected function init():void{
super.init();
}
protected function updateFrameEvent():void{
var _local1:String;
var _local2:int;
var _local3:int;
if (((frameEvent) && (frameEvent.length))){
for (_local1 in frameEvent[0]) {
if ((frameEvent[0][_local1] is int)){
if (myCurrentFrame == Number(frameEvent[0][_local1])){
this[frameEvent[1][_local1]].apply(this, frameEvent[2][_local1]);
continue;
};
} else {
if ((frameEvent[0][_local1] is Array)){
_local2 = int(frameEvent[0][_local1][0]);
_local3 = int(frameEvent[0][_local1][1]);
if ((((myCurrentFrame >= _local2)) && ((myCurrentFrame <= _local3)))){
this[frameEvent[1][_local1]].apply(this, frameEvent[2][_local1]);
continue;
};
};
};
};
if (!bStopFrame){
myCurrentFrame++;
};
};
}
override public function setMc(_arg1:String):void{
super.setMc(_arg1);
setFrameInfo(_arg1);
}
public function win():void{
}
public function changeFrame(_arg1:String):Boolean{
var _local2:Boolean;
if (myCurrentLabel != _arg1){
myCurrentFrame = 1;
myCurrentLabel = _arg1;
gotoFrame(_arg1);
if (myFrameInfo){
frameEvent = myFrameInfo[_arg1];
if (((frameEvent) && (frameEvent.length))){
myActionFinished = false;
};
};
_local2 = true;
};
return (_local2);
}
public function fail():void{
}
protected function innerMcJump(_arg1:int, _arg2:Boolean):void{
var _local3:MovieClip;
if (_mc){
_local3 = innerMc;
if (_local3){
if (_arg2){
_local3.gotoAndStop(_arg1);
} else {
_local3.gotoAndPlay((_arg1 + 1));
};
};
};
if (_arg2){
bStopFrame = true;
} else {
bStopFrame = false;
};
myCurrentFrame = _arg1;
}
override public function replay():void{
super.replay();
innerMcJump(myCurrentFrame, false);
}
override public function setData(_arg1:Object):void{
super.setData(_arg1);
}
protected function setFrameInfo(_arg1:String):void{
myFrameInfo = Data[(GameUtil.StrDiscardNum(_arg1).toLowerCase() + "_frame")];
}
override public function pause():void{
super.pause();
innerMcJump(myCurrentFrame, true);
}
}
}//package src.sys.obj
Section 64
//ViewMC (src.sys.obj.ViewMC)
package src.sys.obj {
import flash.display.*;
import lj.src.util.*;
public dynamic class ViewMC extends Sprite {
protected var _mcName:String;
public var depthLevel:int;
protected var _mc:MovieClip;
protected var _depthArr:Array;
protected var myScale:Number;// = 1
public function ViewMC(_arg1:String){
if (_arg1){
setMc(_arg1);
};
}
public function setMCPos(_arg1:Number, _arg2:Number):void{
x = _arg1;
y = _arg2;
}
public function remove():void{
if (parent){
parent.removeChild(this);
} else {
trace("Warning: parent已删除!!!!", _mcName);
};
if (_depthArr){
GameUtil.removeObjInArr(_depthArr, this);
};
}
public function setScale(_arg1:Number):void{
scaleX = _arg1;
scaleY = _arg1;
myScale = _arg1;
}
public function addToStage(_arg1:DisplayObjectContainer, _arg2:Number=0, _arg3:Number=0):void{
if (_arg1){
_arg1.addChild(this);
};
setMCPos(_arg2, _arg3);
}
public function setData(_arg1:Object):void{
if (_arg1.depthArr){
_depthArr = _arg1.depthArr;
_depthArr.push(this);
};
}
public function get mcName():String{
return (_mcName);
}
public function scaleMe(_arg1:Number):void{
_mc.scaleX = _arg1;
}
public function removeCurMc():void{
if (_mc){
if (_mc.parent){
_mc.parent.removeChild(_mc);
};
_mc = null;
};
}
public function get mc():MovieClip{
return (_mc);
}
public function setMc(_arg1:String):void{
_mcName = _arg1;
var _local2:Class = (GameUtil.getClass("assets", _arg1) as Class);
_mc = new (_local2);
addChild(_mc);
}
}
}//package src.sys.obj
Section 65
//GameScene (src.sys.scene.GameScene)
package src.sys.scene {
import src.ui.*;
import src.vo.*;
import src.view.*;
import src.sys.*;
import flash.display.*;
import flash.geom.*;
import src.model.*;
import src.data.*;
import lj.src.util.*;
import lj.src.sys.*;
import src.ui.pop.*;
public class GameScene extends SuperScene {
public var level:int;
public var gameEnd:int;// = 0
protected var depthCount:int;// = 0
protected var addTime:int;
protected var one_tip_cash:int;
protected var myControl:MyControl;
protected var goal:int;
public var customSend:CustomSend;
protected var curTime:int;
protected var totalTime:int;
protected var tipCount:int;
protected var totalTip:int;
protected var curScore:int;
protected var curTip:int;
public var fg:FGView;
protected var dis_goalreach:DropDisplay;
public var waiterMgr:WaiterMgr;
public var roomV:RoomV;
public var map:MyMap;
public var readyToEnd:Boolean;// = false
public function takeMoney():void{
var _local1:int = (roomV.roomM.moneyNum * Data.One_Serve_Cash);
if (_local1){
Method.addScore(347, 314, _local1);
addScore(_local1);
};
}
public function doAddTime():void{
curTime = (curTime + (addTime * Global.stage.frameRate));
curTime = Math.max(0, curTime);
curTime = Math.min(curTime, (totalTime * Global.stage.frameRate));
}
override public function remove():void{
super.remove();
myControl.remove();
myControl = null;
SoundObject.stopMusic();
SoundObject.stopSound();
roomV.remove();
waiterMgr.remove();
waiterMgr = null;
customSend.remove();
customSend = null;
map = null;
}
public function start1():void{
var _local1:DropDisplay = new DropDisplay("Display_ReadyGo");
_local1.start(upperCtn, start2);
}
protected function writeMap(_arg1:Array, _arg2:int, _arg3:int, _arg4:Array):Array{
var _local6:int;
var _local5:int;
while (_local5 < _arg4.length) {
_local6 = 0;
while (_local6 < _arg4[0].length) {
_arg1[(_arg2 + _local5)][(_arg3 + _local6)] = _arg4[_local5][_local6];
_local6++;
};
_local5++;
};
return (_arg1);
}
public function start2():void{
Global.pause = false;
GameMain.getInstance().actionPause(false);
myControl = new MyControl();
myControl.init(this);
}
override public function handlePause(_arg1:Boolean):void{
super.handlePause(_arg1);
}
public function checkOut():void{
var _local1:int;
if (!gameEnd){
takeMoney();
roomV.roomM.setMoney(0);
_local1 = (curTip * one_tip_cash);
if (_local1){
};
};
}
public function addTip(_arg1:int):void{
curTip = (curTip + _arg1);
ui_hud.setTip((curTip / totalTip));
}
protected function updateTime():void{
}
protected function initGoal():void{
Global.pause = true;
GameMain.getInstance().actionPause(true);
}
protected function initHUD():void{
ui_hud = new UI_HUD();
GameUtil.addChild(ui_hud, uiCtn, 0, 0);
ui_hud.setGoal(goal);
ui_hud.setTip(0);
}
override public function update():void{
var _local1:Point;
super.update();
updateTime();
if ((++depthCount % 5) == 1){
GameUtil.depthManager(midCtn, "y");
};
if (customSend){
customSend.update();
};
if (readyToEnd){
this.checkOut();
if (curTip){
if ((++tipCount % 10) == 0){
_local1 = ui_hud.setTip((--curTip / totalTip));
Method.addScore(_local1.x, _local1.y, one_tip_cash);
addScore(one_tip_cash);
};
} else {
this.checkScore();
};
};
}
protected function initLevel():void{
customSend = new CustomSend(this);
var _local1:Array = checkMapData();
map = new MyMap(_local1);
waiterMgr = new WaiterMgr();
waiterMgr.init(midCtn);
GameUtil.depthManager(midCtn, "y");
var _local2:int = (roomV.roomM.getAvailServe().length + 1);
var _local3:int = customSend.total_num;
totalTip = (_local2 * _local3);
one_tip_cash = GameValue.one_tip_cash;
}
protected function initBG():void{
var _local1:ShopData = (LevelControl.getCurSaveData().shop as ShopData);
var _local2:RoomM = new RoomM();
_local2.setShopData(_local1);
roomV = new RoomV(midCtn);
roomV.roomM = _local2;
roomV.setItems();
roomV.initBG(mapCtn);
}
protected function setTime():void{
if (ui_hud){
ui_hud.setTime((totalTime - curTime), totalTime);
};
}
protected function enterLoseUI():void{
remove();
GameMain.getInstance().changeCover("UI_Lose", 0, 0);
}
public function gameOver(_arg1:int):void{
var _local3:UI_Win;
var _local4:DropDisplay;
endLevel();
if (_arg1 > 0){
_local3 = (GameMain.getInstance().changeCover("pop.UI_Win", 0, 0) as UI_Win);
_local3.setData({goal:goal, score:curScore});
SoundObject.playSound(Data.SFX_Pass);
} else {
if (_arg1 < 0){
_local4 = new DropDisplay("Display_TryAgain");
_local4.start(upperCtn, enterLoseUI);
SoundObject.playSound(Data.SFX_TryAgain);
};
};
var _local2:Boolean = ((_arg1 > 0)) ? true : false;
LevelControl.saveLevelEnd(LevelControl.curUser, _local2, level, curScore);
}
protected function endLevel():void{
SoundObject.stopMusic();
SoundObject.stopSound();
ui_hud.setBtnEnable(false);
GameMain.getInstance().actionPause(true);
myControl.remove();
}
protected function checkScore():void{
if (curScore >= goal){
gameEnd = 1;
} else {
gameEnd = -1;
};
gameOver(gameEnd);
}
public function addScore(_arg1:Number):void{
curScore = (curScore + _arg1);
ui_hud.setScore(curScore);
if (curScore >= goal){
if (!dis_goalreach){
dis_goalreach = new DropDisplay("Display_GoalReach");
dis_goalreach.start(upperCtn, null);
SoundObject.playSound(Data.SFX_ReachGoal);
};
};
}
protected function initFront():void{
fg = new FGView("FG");
upperCtn.addChild(fg);
upperCtn.mouseEnabled = false;
upperCtn.mouseChildren = false;
}
override public function create(_arg1):void{
super.create(_arg1);
Global.pause = true;
level = _arg1;
LevelControl.curLevel = level;
goal = GameValue.goal;
initFront();
initBG();
initHUD();
initLevel();
start1();
SoundObject.stopMusic();
if (level <= 5){
GameMain.getInstance().playMusic(Data.SFX_GameBG1);
} else {
if ((((level > 5)) && ((level <= 10)))){
GameMain.getInstance().playMusic(Data.SFX_CoverBG);
} else {
if ((((level > 10)) && ((level <= 15)))){
GameMain.getInstance().playMusic(Data.SFX_CG);
};
};
};
}
protected function checkMapData():Array{
var _local3:String;
var _local4:Array;
var _local1:Array = GameUtil.clone(Data.MapData.gridArr);
var _local2:ShopData = (LevelControl.getCurSaveData().shop as ShopData);
for (_local3 in Data.FurnitureMap) {
if (_local3.search("max") == -1){
if (_local2[_local3]){
_local4 = Data.FurnitureMap[_local3][0];
writeMap(_local1, _local4[0], _local4[1], Data.FurnitureMap[_local3][1]);
};
} else {
if (_local2.chairs == 5){
_local4 = Data.FurnitureMap[_local3][0];
writeMap(_local1, _local4[0], _local4[1], Data.FurnitureMap[_local3][1]);
};
};
};
return (_local1);
}
public static function drawDebugLine(_arg1:Graphics):void{
_arg1.lineStyle(1, 0xCCCCCC);
var _local2:int = (Data.stageHeight / Data.TileSize);
var _local3:int = (Data.stageWidth / Data.TileSize);
var _local4:int;
while (_local4 < _local2) {
_arg1.moveTo(0, (Data.TileSize * (_local4 + 1)));
_arg1.lineTo(Data.stageWidth, (Data.TileSize * (_local4 + 1)));
_local4++;
};
var _local5:int;
while (_local5 < _local3) {
_arg1.moveTo((Data.TileSize * (_local5 + 1)), 0);
_arg1.lineTo((Data.TileSize * (_local5 + 1)), Data.stageHeight);
_local5++;
};
}
}
}//package src.sys.scene
Section 66
//SceneMgr (src.sys.scene.SceneMgr)
package src.sys.scene {
import flash.utils.*;
public class SceneMgr {
private var clsArr:Array;
private static var _scene:SuperScene;
public function SceneMgr(){
clsArr = [GameScene];
super();
}
public static function createScene(_arg1:String, ... _args):void{
var _local3:Class = (getDefinitionByName(("src.sys.scene::" + _arg1)) as Class);
_scene = new (_local3);
_scene.create.apply(_scene, _args);
}
public static function removeScene():void{
_scene.remove();
_scene = null;
}
public static function get scene():SuperScene{
return (_scene);
}
}
}//package src.sys.scene
Section 67
//SuperScene (src.sys.scene.SuperScene)
package src.sys.scene {
import src.ui.*;
import flash.display.*;
import lj.src.util.*;
import lj.src.sys.*;
public class SuperScene {
protected var _upperCtn:Sprite;
protected var gameCtn:Sprite;
public var ui_hud:UI_HUD;
protected var _midCtn:Sprite;
protected var updateArr:Array;
protected var mapCtn:Sprite;
public var uiCtn:Sprite;
protected var removeArr:Array;
public function SuperScene(){
initCtn();
initArr();
}
public function remove():void{
var _local1:int;
while (_local1 < removeArr.length) {
GameUtil.removeObjInArr(updateArr, removeArr[_local1]);
_local1++;
};
removeArr.splice(0);
var _local2:int;
while (_local2 < updateArr.length) {
updateArr[_local2].remove();
_local2++;
};
updateArr.splice(0);
removeArr.splice(0);
gameCtn.parent.removeChild(gameCtn);
if (ui_hud){
ui_hud.remove();
ui_hud = null;
};
}
public function update():void{
var _local1:int;
var _local2:int;
if (!Global.pause){
_local1 = updateArr.length;
while (_local1 > 0) {
updateArr[(_local1 - 1)].updateEvents();
_local1--;
};
_local2 = 0;
while (_local2 < removeArr.length) {
GameUtil.removeObjInArr(updateArr, removeArr[_local2]);
_local2++;
};
removeArr.splice(0);
};
}
public function get upperCtn():Sprite{
return (_upperCtn);
}
protected function initCtn():void{
gameCtn = new Sprite();
Global.scene.addChildAt(gameCtn, 0);
mapCtn = new Sprite();
GameUtil.addChild(mapCtn, gameCtn, 0, 0);
_midCtn = new Sprite();
GameUtil.addChild(_midCtn, gameCtn, 0, 0);
_upperCtn = new Sprite();
GameUtil.addChild(_upperCtn, gameCtn, 0, 0);
uiCtn = new Sprite();
GameUtil.addChild(uiCtn, gameCtn, 0, 0);
}
public function handlePause(_arg1:Boolean):void{
var _local2:int;
Global.pause = _arg1;
if (_arg1){
_local2 = 0;
while (_local2 < updateArr.length) {
updateArr[_local2].pause();
_local2++;
};
} else {
_local2 = 0;
while (_local2 < updateArr.length) {
updateArr[_local2].replay();
_local2++;
};
};
}
protected function initArr():void{
updateArr = new Array();
Global.updateArr = updateArr;
removeArr = new Array();
Global.removeArr = removeArr;
}
public function get midCtn():Sprite{
return (_midCtn);
}
public function create(_arg1):void{
}
}
}//package src.sys.scene
Section 68
//GameMain (src.sys.GameMain)
package src.sys {
import src.ui.*;
import src.vo.*;
import src.view.*;
import flash.display.*;
import flash.events.*;
import src.sys.scene.*;
import src.sys.obj.*;
import src.data.*;
import lj.src.util.*;
import lj.src.sys.*;
import flash.net.*;
import src.ui.load.*;
import src.ui.pop.*;
import flash.utils.*;
import flash.ui.*;
public class GameMain {
private var ui_pause2:UI_Pause2;
private var ui_pause:UI_Pause;
private var scene:Sprite;
private var preClass:Array;
private var _VolumnMusic:Number;
protected var mouseView:ViewMC;
public var btn_sound:SoundMC;
private var _VolumnFX:Number;
private static var _instance:GameMain;
public function GameMain(){
preClass = [UI_Title, UI_Input, UI_Warn, UI_Load, UI_Goal, UI_Win, UI_Lose, UI_Congratulation, UI_Shop, UI_Options];
super();
_instance = this;
}
protected function onMyEnterFrame(_arg1:Event):void{
if (SceneMgr.scene){
if (!Global.pause){
SceneMgr.scene.update();
};
};
if (mouseView){
mouseView.x = Global.stage.mouseX;
mouseView.y = Global.stage.mouseY;
};
}
public function set VolumnFX(_arg1:Number):void{
_VolumnFX = _arg1;
Main.setVolume(_arg1, "sound");
}
public function remove():void{
GameUtil.deleteMask(scene);
Global.stage.removeChild(scene);
scene = null;
Global.stage.removeEventListener(Event.ENTER_FRAME, onMyEnterFrame);
Global.control.remove();
}
protected function onCGComplete(_arg1:Event):void{
_arg1.target.removeEventListener(Event.COMPLETE, onCGComplete);
SceneMgr.createScene("GameScene", 1);
}
public function setTime(_arg1:int, _arg2:MovieClip):void{
var _local3:int = (_arg1 / Global.stage.frameRate);
var _local4:Object = GameUtil.ToTime(_local3);
GameUtil.setScoreNum(_local4.h, 3, _arg2.hour);
GameUtil.setScoreNum(_local4.m, 2, _arg2.minute);
GameUtil.setScoreNum(_local4.s, 2, _arg2.sec);
}
public function init():void{
var _local2:FPSShow;
var _local1:GameControl = new GameControl();
Global.control = _local1;
registerClassAlias("src.vo.ShopData", ShopData);
SaveMgr.init(Data.SAVENAME);
Global.stage.addEventListener(Event.ENTER_FRAME, onMyEnterFrame);
scene = new Sprite();
Global.stage.addChild(scene);
Global.scene = scene;
Main.initOptions(Data.QUALITY, Data.SOUND, Data.MUSIC);
Main.initKeyShareObj(Data.defKeySet);
_VolumnMusic = SoundObject.music_volume_val;
_VolumnFX = SoundObject.sound_volume_val;
LevelControl.loadLevel();
GameUtil.createMask(scene, Data.stageWidth, Data.stageHeight);
initUI();
pushSounds();
if (Data.IF_DEBUG){
_local2 = new FPSShow();
scene.addChild(_local2);
};
}
public function playMusic(_arg1:String):void{
var _local2:Class;
if (!SoundObject.playMusic(_arg1, 0, true)){
_local2 = GameUtil.getClass("assets", _arg1);
SoundObject.pushSound(_arg1, _local2, false);
SoundObject.playMusic(_arg1);
};
}
public function handlePause2(_arg1:Boolean):void{
if (Global.canControl){
if (!_arg1){
ui_pause2.remove();
ui_pause2 = null;
SoundObject.resumeMusic();
} else {
ui_pause2 = (changeCover("UI_Pause2", (Data.stageWidth / 2), (Data.stageHeight / 2)) as UI_Pause2);
SoundObject.stopMusic();
};
actionPause(_arg1);
};
}
public function changeMouse(_arg1:String, _arg2:Boolean=false):void{
if (!mouseView){
mouseView = new ViewMC(_arg1);
SceneMgr.scene.upperCtn.addChild(mouseView);
mouseView.mouseEnabled = false;
mouseView.mouseChildren = false;
if (!_arg2){
Mouse.hide();
};
};
}
public function addSoundBtn(_arg1:DisplayObjectContainer):SoundMC{
btn_sound = new SoundMC("SoundBtn");
btn_sound.addToStage(_arg1, 655, 13);
return (btn_sound);
}
public function actionPause(_arg1:Boolean):void{
Global.pause = _arg1;
SceneMgr.scene.handlePause(_arg1);
Global.stage.focus = null;
}
public function get VolumnMusic():Number{
return (_VolumnMusic);
}
public function initUI():void{
changeCover("UI_Title", 0, 0);
}
public function set VolumnMusic(_arg1:Number):void{
_VolumnMusic = _arg1;
Main.setVolume(_arg1, "music");
}
public function changeCover(_arg1:String, _arg2:Number=0, _arg3:Number=0):Cover{
var _local4:Class = (getDefinitionByName(("src.ui." + _arg1)) as Class);
var _local5:Cover = new (_local4);
if (_arg2){
_local5.x = _arg2;
};
if (_arg3){
_local5.y = _arg3;
};
scene.addChild(_local5);
scene.setChildIndex(_local5, (scene.numChildren - 1));
return (_local5);
}
public function initScene(_arg1):void{
var _local2:CG;
if ((((_arg1 == 1)) && (!(CG.hasPlay)))){
_local2 = new CG("CGs");
_local2.addToStage(scene, 0, 0);
_local2.addEventListener(Event.COMPLETE, onCGComplete);
} else {
SceneMgr.createScene("GameScene", _arg1);
};
}
public function get VolumnFX():Number{
return (_VolumnFX);
}
public function handlePause(_arg1:Boolean):void{
if (Global.canControl){
if (!_arg1){
ui_pause.remove();
ui_pause = null;
SoundObject.resumeMusic();
} else {
ui_pause = (changeCover("UI_Pause", 0, 0) as UI_Pause);
SoundObject.stopMusic();
};
actionPause(_arg1);
};
}
public function removeScene():void{
SceneMgr.removeScene();
}
public function removeSoundBtn():void{
if (btn_sound){
btn_sound.remove();
btn_sound = null;
};
}
public function removeMyMouse():void{
if (mouseView){
mouseView.parent.removeChild(mouseView);
Mouse.show();
mouseView = null;
};
}
protected function pushSounds():void{
var _local3:Class;
var _local1:Array = Data.AllSounds;
var _local2:int;
while (_local2 < _local1.length) {
_local3 = GameUtil.getClass("assets", _local1[_local2]);
SoundObject.pushSound(_local1[_local2], _local3, false);
_local2++;
};
}
public static function getInstance():GameMain{
return (_instance);
}
}
}//package src.sys
Section 69
//GameValue (src.sys.GameValue)
package src.sys {
import src.vo.*;
import src.data.*;
import lj.src.util.*;
import lj.src.sys.*;
public class GameValue {
public static var custom_freq:int;
public static var one_tip_cash:int;
public static var curCustom:int;
public static var goal:int;
public static var popularity:int;
public static function getCost(_arg1:String, _arg2:int):int{
var _local3:int;
var _local4:* = getShopData(_arg1, "Cost");
if ((_local4 is int)){
_local3 = _local4;
} else {
_local3 = (_local4[0] + ((_arg2 - 1) * _local4[1]));
};
return (_local3);
}
public static function getCurState(_arg1:ShopData, _arg2:int):void{
var _local7:String;
var _local8:int;
curCustom = LevelControl.getData(_arg2, "Num");
goal = LevelControl.getData(_arg2, "Goal");
custom_freq = (LevelControl.getData(_arg2, "Freq") * Global.stage.frameRate);
popularity = 0;
var _local3 = 2;
var _local4 = 1;
while (_local4 < Data.Shop_Items.length) {
_local7 = Data.Shop_Items[_local4][0];
_local8 = _arg1[_local7];
if (_local8){
if (((Data.Shop_Items[_local4][4]) && (!((Data.Shop_Items[_local4][4] == ServeVO.Water))))){
_local3++;
};
popularity = (popularity + getPop(_local7, _local8));
curCustom = (curCustom + getShopData(_local7, "CUSTOM"));
};
_local4++;
};
Data.One_Serve_Cash = (10 + (popularity / 10));
one_tip_cash = (Data.One_Serve_Cash / 5);
var _local5:int = (((_local3 - 1) * Data.One_Serve_Cash) * curCustom);
var _local6:int = ((one_tip_cash * (_local3 - 1)) * curCustom);
goal = (goal + ((_local5 + _local6) * 0.8));
trace("State: custom: ", curCustom, "serve: ", _local3, "pop: ", popularity, "serve: ", _local3, "com: ", _local5, "popMoney:", _local6, "one_tip_cash: ", one_tip_cash, "ServeCash: ", Data.One_Serve_Cash);
}
public static function getShopData(_arg1:String, _arg2:String){
var _local3:Array = (GameUtil.getObjInArr(Data.Shop_Items, _arg1, 0) as Array);
var _local4:int = Data.Shop_Items[0].indexOf(_arg2);
return (_local3[_local4]);
}
public static function getPop(_arg1:String, _arg2:int):int{
var _local3:int;
var _local4:* = getShopData(_arg1, "POPULARITY");
if ((_local4 is int)){
_local3 = _local4;
} else {
_local3 = (_local4[0] + ((_arg2 - 1) * _local4[1]));
};
return (_local3);
}
}
}//package src.sys
Section 70
//LevelControl (src.sys.LevelControl)
package src.sys {
import src.vo.*;
import src.data.*;
import lj.src.util.*;
import lj.src.sys.*;
public class LevelControl {
protected static var saveArr:Array;
public static var curLevel:int = 1;
private static var Str_OpenLevel:String = "openLevel";
public static var curUser:String;
public static function getData(_arg1:int, _arg2:String){
var _local3:* = null;
var _local4:int = Data.LevelInfo[0].indexOf(_arg2);
if (_local4 != -1){
_local3 = Data.LevelInfo[_arg1][_local4];
};
return (_local3);
}
public static function saveShopInfo(_arg1:String, _arg2:ShopData, _arg3:int):void{
var _local5:int;
var _local4:Object = GameUtil.getObjInArr(saveArr, _arg1, "name");
if (_local4){
_local5 = saveArr.indexOf(_local4);
saveArr[_local5].score = (saveArr[_local5].score - _arg3);
saveArr[_local5].shop = _arg2;
SaveMgr.saveData("saveArr", saveArr);
SaveMgr.flush();
};
}
public static function getPlayerInfo(_arg1:String):Object{
return (GameUtil.getObjInArr(saveArr, _arg1, "name"));
}
public static function getCurSaveData():Object{
return (GameUtil.getObjInArr(saveArr, curUser, "name"));
}
public static function getSaveArr():Array{
return (saveArr);
}
public static function saveLevelByName(_arg1:String, _arg2:int):void{
var _local4:int;
var _local3:Object = GameUtil.getObjInArr(saveArr, _arg1, "name");
if (_local3){
_local4 = saveArr.indexOf(_local3);
saveArr[_local4].level = _arg2;
SaveMgr.saveData("saveArr", saveArr);
};
}
public static function loadName(_arg1:String):void{
var _local2:Object = GameUtil.getObjInArr(saveArr, _arg1, "name");
curUser = _arg1;
curLevel = _local2.level;
}
public static function checkName(_arg1:String):Boolean{
var _local2:Boolean = GameUtil.checkInArr(saveArr, _arg1, "name");
return (_local2);
}
public static function saveLevelEnd(_arg1:String, _arg2:Boolean, _arg3:int, _arg4:int):void{
var _local5:Object;
var _local6:int;
if (_arg2){
_local5 = GameUtil.getObjInArr(saveArr, _arg1, "name");
if (_local5){
if (_arg3 >= _local5.level){
if (_arg3 < Data.Max_level){
_local5.level = (_arg3 + 1);
};
};
_local5.score = (_local5.score + _arg4);
_local6 = getPlayerIndex(_arg1);
saveArr[_local6] = _local5;
SaveMgr.saveData("saveArr", saveArr);
};
};
}
public static function saveName(_arg1:String, _arg2:int):void{
var _local3:ShopData = new ShopData();
var _local4:int;
if (Data.IF_DEBUG){
_local4 = 100000;
};
var _local5:Object = {name:_arg1, level:_arg2, score:_local4, shop:_local3};
saveArr.push(_local5);
SaveMgr.saveData("saveArr", saveArr);
curUser = _arg1;
curLevel = _arg2;
}
public static function getPlayerIndex(_arg1:String):int{
var _local2:Object = GameUtil.getObjInArr(saveArr, _arg1, "name");
return (saveArr.indexOf(_local2));
}
public static function deleteName(_arg1:String):void{
GameUtil.removeObjInArr(saveArr, _arg1, "name");
SaveMgr.saveData("saveArr", saveArr);
}
public static function loadLevel():void{
var _local1:Array;
if (!SaveMgr.loadData("saveArr")){
_local1 = new Array();
SaveMgr.saveData("saveArr", _local1);
};
saveArr = SaveMgr.loadData("saveArr");
}
}
}//package src.sys
Section 71
//Method (src.sys.Method)
package src.sys {
import src.view.*;
import flash.display.*;
import src.sys.scene.*;
import flash.geom.*;
import lj.src.util.*;
public class Method {
protected static var countArr:Array;
public static function addScore(_arg1:Number, _arg2:Number, _arg3:int):void{
var _local4 = "Score_Tip";
var _local5 = 2;
if (_arg3 < 10){
_local4 = "Score_Tip2";
_local5 = 1;
};
var _local6:ScoreTip = new ScoreTip(_local4);
_local6.addToStage((SceneMgr.scene as GameScene).upperCtn, _arg1, _arg2);
_local6.setScore(_arg3, _local5);
}
protected static function iniCircle(_arg1:Graphics):void{
_arg1.clear();
_arg1.beginFill(0x990033, 1);
_arg1.moveTo(0, 0);
}
public static function setNeedMc(_arg1:MovieClip, _arg2:Number, _arg3:int, _arg4:int):void{
var _local6:int;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:int;
var _local5:int = (28 / 2);
if (_arg2 == 0){
_arg1.visible = false;
iniCircle(_arg1.circle.graphics);
_arg1.bg.graphics.beginFill(0xFFFFFF);
_arg1.bg.graphics.drawCircle(0, 0, _local5);
_arg1.bg.mask = _arg1.circle;
} else {
_arg1.visible = true;
if (_arg3 >= 0){
_arg1.gotoAndStop(_arg3);
};
};
if (_arg2 < 0.8){
_local6 = (((_arg2 / 0.8) * 360) - 90);
_local7 = (_local5 * Math.cos((_local6 * 0.0174)));
_local8 = (_local5 * Math.sin((_local6 * 0.0174)));
_arg1.circle.graphics.lineTo(_local7, _local8);
_local9 = (_local6 * (360 / 0xFF));
_local10 = ((-((0xFF / 360)) * _local6) + 0x0100);
_arg1.bg.transform.colorTransform = new ColorTransform(0, 0, 0, 1, _local9, _local10, 0, 0);
} else {
if ((((_arg2 >= 0.8)) && ((_arg2 < 1)))){
_arg1.bg.mask = null;
_local11 = ((Math.sin((_arg4 * 0.0174)) + 1) * 2);
iniCircle(_arg1.circle.graphics);
_arg1.circle.graphics.drawCircle(0, 0, ((_local5 + _local11) + 2));
};
};
}
public static function flashMe(_arg1:Sprite, _arg2:int):void{
if ((_arg2 % 4) == 1){
GameUtil.applyGlowFilter(_arg1, 0xFF0000);
} else {
GameUtil.removeFilter(_arg1);
};
}
public static function addComment(_arg1:Number, _arg2:Number):void{
var _local3:ScoreTip = new ScoreTip("Comment");
_local3.addToStage((SceneMgr.scene as GameScene).upperCtn, _arg1, _arg2);
_local3.randomFrame();
}
public static function setMark(_arg1:Boolean, _arg2:MovieClip):void{
_arg2.mark.visible = _arg1;
}
}
}//package src.sys
Section 72
//MyControl (src.sys.MyControl)
package src.sys {
import src.view.role.*;
import flash.events.*;
import src.sys.scene.*;
import lj.src.interfaces.*;
import src.data.*;
import lj.src.sys.*;
public class MyControl implements IMouseEvent, IKeyboardEvent {
protected var _scene:GameScene;
public function init(_arg1:GameScene):void{
_scene = _arg1;
Global.control.addMouseListener(this);
if (Data.IF_DEBUG){
Global.control.addKeyboardListener(this);
};
}
public function handleKeyUp(_arg1:KeyboardEvent):void{
}
public function remove():void{
_scene = null;
Global.control.removeMouseListener(this);
if (Data.IF_DEBUG){
Global.control.removeKeyBoardListener(this);
};
}
public function handleKeyDown(_arg1:KeyboardEvent):void{
if (Data.IF_DEBUG){
if (_arg1.keyCode == GV.KeyXcode){
(SceneMgr.scene as GameScene).gameOver(1);
} else {
if (_arg1.keyCode == GV.KeyCcode){
(SceneMgr.scene as GameScene).gameOver(-1);
};
};
};
}
public function handleMouseEvent(_arg1:MouseEvent):void{
if (_arg1.type == MouseEvent.CLICK){
_scene.roomV.onMouseClick(_arg1);
if ((_arg1.target is CustomV)){
(_arg1.target as CustomV).onMouseClick(_arg1);
};
} else {
if (_arg1.type == MouseEvent.MOUSE_OVER){
_scene.roomV.onMouseOver(_arg1);
if ((_arg1.target is CustomV)){
(_arg1.target as CustomV).onMouseOver(_arg1);
};
} else {
if (_arg1.type == MouseEvent.MOUSE_UP){
} else {
if (_arg1.type == MouseEvent.MOUSE_DOWN){
} else {
if (_arg1.type == MouseEvent.MOUSE_OUT){
_scene.roomV.onMouseOut(_arg1);
if ((_arg1.target is CustomV)){
(_arg1.target as CustomV).onMouseOut(_arg1);
};
} else {
if (_arg1.type == MouseEvent.MOUSE_MOVE){
};
};
};
};
};
};
}
}
}//package src.sys
Section 73
//UI_Input (src.ui.load.UI_Input)
package src.ui.load {
import src.sys.*;
import flash.events.*;
import src.data.*;
import lj.src.sys.*;
import com.greensock.easing.*;
import src.ui.pop.*;
import flash.ui.*;
public class UI_Input extends UI_Pop {
override protected function init():void{
super.init();
mc_content.txt_name.text = "";
mc_content.txt_name.addEventListener(Event.CHANGE, onTextChange);
Global.stage.focus = mc_content.txt_name;
Global.stage.addEventListener(KeyboardEvent.KEY_DOWN, onMyKeyDown);
}
protected function checkName(_arg1:String):Boolean{
var _local2:Boolean = LevelControl.checkName(_arg1);
return (_local2);
}
override public function anim_in(_arg1:int):void{
super.anim_in(_arg1);
}
override public function remove():void{
super.remove();
mc_content.txt_name.removeEventListener(Event.CHANGE, onTextChange);
Global.stage.removeEventListener(KeyboardEvent.KEY_DOWN, onMyKeyDown);
}
protected function warn_callback(_arg1:Boolean):void{
var _local2:String;
if (_arg1){
remove();
_local2 = mc_content.txt_name.text;
LevelControl.deleteName(_local2);
saveNameSlot(_local2);
_func.call(this, true);
} else {
Global.stage.focus = mc_content.txt_name;
setBtnEnable(true);
};
}
protected function onMyKeyDown(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.ENTER){
btn_ok_Func();
};
}
public function btn_ok_Func():void{
var _local2:UI_Warn;
var _local1:String = mc_content.txt_name.text;
if (_local1 != ""){
if (!checkName(_local1)){
saveNameSlot(_local1);
remove();
_func.call(this, true);
} else {
setBtnEnable(false);
_local2 = (GameMain.getInstance().changeCover("load.UI_Warn", (Data.stageWidth / 2), (Data.stageHeight / 2)) as UI_Warn);
_local2.setCallback(warn_callback);
};
};
}
protected function onTextChange(_arg1:Event):void{
var _local2:String;
if (_arg1.target.text.length > 15){
_local2 = _arg1.target.text.substr(0, (_arg1.target.text.length - 1));
_arg1.target.text = _local2;
};
}
protected function saveNameSlot(_arg1:String):void{
LevelControl.saveName(_arg1, 1);
}
public function btn_close_Func():void{
remove();
_func.call(this, false);
}
}
}//package src.ui.load
Section 74
//UI_Load (src.ui.load.UI_Load)
package src.ui.load {
import src.sys.*;
import flash.events.*;
import src.ui.pop.*;
public class UI_Load extends UI_Pop {
protected var saveArr:Array;
protected var curPage:int;// = 1
protected var OnePageNum:int;// = 4
protected function onClickMe(_arg1:MouseEvent):void{
var _local3:String;
var _local2:String = _arg1.target.parent.name;
if (_arg1.target.name == "btn_delete"){
_local3 = _arg1.target.parent.textMc.txt_name.text;
LevelControl.deleteName(_local3);
refreshPage();
} else {
if (_arg1.target.name == "textMc"){
_local3 = _arg1.target.parent.textMc.txt_name.text;
if (_local3){
enterGame(_local3);
};
};
};
}
protected function refreshPage():Boolean{
var _local5:Object;
var _local1:Boolean;
var _local2:Array = saveArr;
var _local3:int = (((curPage - 1) * OnePageNum) + 1);
var _local4:int;
while (_local4 < OnePageNum) {
_local5 = _local2[((_local3 + _local4) - 1)];
if (_local5){
mc_content[("slot" + (_local4 + 1))].txt_id.text = (_local3 + _local4);
mc_content[("slot" + (_local4 + 1))].textMc.txt_name.text = _local5.name;
} else {
mc_content[("slot" + (_local4 + 1))].txt_id.text = "";
mc_content[("slot" + (_local4 + 1))].textMc.txt_name.text = "";
};
_local4++;
};
return (_local1);
}
override public function remove():void{
super.remove();
mc_content.removeEventListener(MouseEvent.CLICK, onClickMe);
}
protected function enterGame(_arg1:String):void{
LevelControl.loadName(_arg1);
remove();
_func.call(this, true);
}
override protected function init():void{
super.init();
initName();
mc_content.addEventListener(MouseEvent.CLICK, onClickMe);
saveArr = LevelControl.getSaveArr();
refreshPage();
}
public function btn_pageDown_Func():void{
var _local1:int = (curPage + 1);
var _local2:int = (((_local1 - 1) * OnePageNum) + 1);
if (saveArr.length < _local2){
return;
};
curPage++;
refreshPage();
}
override public function btn_back_Func():void{
remove();
_func.call(this, false);
}
override public function anim_in(_arg1:int):void{
super.anim_in(_arg1);
}
protected function initName():void{
var _local1:int;
while (_local1 < OnePageNum) {
mc_content[("slot" + (_local1 + 1))].textMc.mouseChildren = false;
mc_content[("slot" + (_local1 + 1))].textMc.buttonMode = true;
_local1++;
};
}
public function btn_pageUp_Func():void{
var _local1:int = (curPage - 1);
if (_local1 <= 0){
return;
};
curPage--;
curPage = Math.max(0, curPage);
refreshPage();
}
}
}//package src.ui.load
Section 75
//UI_Warn (src.ui.load.UI_Warn)
package src.ui.load {
import src.ui.*;
public class UI_Warn extends Cover {
protected var _func:Function;
public function btn_yes_Func():void{
remove();
_func.call(this, true);
}
public function btn_no_Func():void{
remove();
_func.call(this, false);
}
public function setCallback(_arg1:Function):void{
_func = _arg1;
}
}
}//package src.ui.load
Section 76
//UI_TilteM (src.ui.model.UI_TilteM)
package src.ui.model {
import src.ui.*;
import src.sys.*;
public class UI_TilteM {
public function enterInput():Cover{
return (GameMain.getInstance().changeCover("load.UI_Input"));
}
public function moreGame():void{
MoreGameURLOK.MoreGameURLOK("moregames-menu");
}
public function enterHelp():Cover{
return (GameMain.getInstance().changeCover("UI_Help", 0, 0));
}
public function enterGoal():Cover{
return (GameMain.getInstance().changeCover("pop.UI_Goal"));
}
public function enterPlay():void{
GameMain.getInstance().initScene(LevelControl.curLevel);
}
public function enterLoad():Cover{
return (GameMain.getInstance().changeCover("load.UI_Load"));
}
}
}//package src.ui.model
Section 77
//UI_Goal (src.ui.pop.UI_Goal)
package src.ui.pop {
import src.vo.*;
import src.sys.*;
import flash.events.*;
public class UI_Goal extends UI_Pop {
override protected function init():void{
var _local2:int;
super.init();
var _local1:ShopData = (LevelControl.getCurSaveData().shop as ShopData);
_local2 = LevelControl.curLevel;
GameValue.getCurState(_local1, _local2);
buttonMode = true;
mouseChildren = false;
mc_content.txt_level.text = ("LEVEL:" + _local2);
var _local3:int = GameValue.goal;
mc_content.txt_info.text = (("GOAL: $" + _local3) + "\n\n");
mc_content.mc_load.bar.x = -(mc_content.mc_load.bar.width);
mc_content.txt_tip.visible = false;
addEventListener(Event.ENTER_FRAME, onMyEF);
}
override public function remove():void{
super.remove();
removeEventListener(MouseEvent.CLICK, onMyClick);
}
protected function startGame():void{
remove();
_func.call(this);
GameMain.getInstance().initScene(LevelControl.curLevel);
}
protected function onMyEF(_arg1:Event):void{
mc_content.mc_load.bar.x = (mc_content.mc_load.bar.x + 5);
if (mc_content.mc_load.bar.x >= 0){
mc_content.mc_load.bar.x = 0;
removeEventListener(Event.ENTER_FRAME, onMyEF);
mc_content.txt_tip.visible = true;
addEventListener(MouseEvent.CLICK, onMyClick);
};
}
protected function onMyClick(_arg1:MouseEvent):void{
startGame();
}
protected function setText():void{
}
}
}//package src.ui.pop
Section 78
//UI_Options (src.ui.pop.UI_Options)
package src.ui.pop {
import src.sys.*;
import flash.display.*;
import flash.events.*;
import flash.geom.*;
public class UI_Options extends UI_Pop {
override protected function init():void{
super.init();
mc_content.addEventListener(MouseEvent.CLICK, onClickContent);
mc_content.mc_sound.mouseChildren = false;
mc_content.mc_music.mouseChildren = false;
setVolumn();
}
protected function setBar(_arg1:MovieClip, _arg2:Number):void{
_arg1.bar.x = (-(_arg1.bar.width) + (_arg1.bar.width * _arg2));
}
override public function remove():void{
super.remove();
mc_content.removeEventListener(MouseEvent.CLICK, onClickContent);
applyFunc();
}
protected function setVolumn():void{
var _local1:Number = GameMain.getInstance().VolumnMusic;
var _local2:Number = GameMain.getInstance().VolumnFX;
setBar(mc_content.mc_music, _local1);
setBar(mc_content.mc_sound, _local2);
}
protected function onClickContent(_arg1:MouseEvent):void{
var _local3:Point;
var _local4:int;
var _local2:MovieClip = (_arg1.target as MovieClip);
if ((((_local2.name == "mc_sound")) || ((_local2.name == "mc_music")))){
_local3 = _local2.myMask.globalToLocal(new Point(_arg1.stageX, _arg1.stageY));
_local4 = ((_local3.x / _local2.myMask.width) * 100);
if (_local2.name == "mc_sound"){
GameMain.getInstance().VolumnFX = (_local4 / 100);
} else {
if (_local2.name == "mc_music"){
GameMain.getInstance().VolumnMusic = (_local4 / 100);
};
};
setBar(_local2, (_local4 / 100));
if (GameMain.getInstance().btn_sound){
GameMain.getInstance().btn_sound.setMusicBtn();
};
};
}
public function btn_ok_Func():void{
remove();
}
}
}//package src.ui.pop
Section 79
//UI_Pop (src.ui.pop.UI_Pop)
package src.ui.pop {
import src.ui.*;
import com.greensock.*;
import src.data.*;
import com.greensock.easing.*;
public class UI_Pop extends Cover {
protected var _func:Function;
protected var animStyle:int;
protected var _args:Array;
public function UI_Pop(){
has_soundbtn = false;
super();
}
protected function dissapear():void{
TweenLite.to(this, 0.3, {y:(Data.stageHeight + (height / 2)), ease:Expo.easeIn, onComplete:easeInComplete});
}
override public function remove():void{
super.remove();
}
protected function easeInComplete():void{
remove();
}
public function setCallback(_arg1:Function, ... _args):void{
_func = _arg1;
_args = _args;
}
override protected function init():void{
has_soundbtn = false;
super.init();
if (!animStyle){
x = (Data.stageWidth / 2);
y = (Data.stageHeight + (height / 2));
TweenLite.to(this, 0.4, {y:(Data.stageHeight / 2), ease:Back.easeOut, onComplete:easeOutComplete});
};
}
protected function applyFunc():void{
_func.apply(this, _args);
}
protected function easeOutComplete():void{
}
}
}//package src.ui.pop
Section 80
//UI_Win (src.ui.pop.UI_Win)
package src.ui.pop {
import src.sys.*;
import src.data.*;
public class UI_Win extends UI_Pop {
protected var earned:int;
protected var goal:int;
public function btn_levelup_Func():void{
remove();
GameMain.getInstance().removeScene();
if (LevelControl.curLevel >= Data.Max_level){
GameMain.getInstance().changeCover("UI_Congratulation", 0, 0);
} else {
LevelControl.curLevel++;
GameMain.getInstance().changeCover("UI_Shop", 0, 0);
};
}
override public function setData(_arg1:Object):void{
super.setData(_arg1);
goal = _arg1.goal;
earned = _arg1.score;
setText();
}
protected function setText():void{
mc_content.txt.text = (((("GOAL: $" + goal) + "\n MONEY EARNED: $") + earned) + "\n");
}
}
}//package src.ui.pop
Section 81
//Cover (src.ui.Cover)
package src.ui {
import src.sys.*;
import flash.display.*;
import flash.events.*;
import src.data.*;
import lj.src.util.*;
public class Cover extends MovieClip {
public var mybtns:MovieClip;
public var mc_content:MovieClip;
protected var playBtnSound:Boolean;// = true
protected var has_soundbtn:Boolean;// = true
public function Cover(){
stop();
anim_in(0);
}
public function remove():void{
parent.removeChild(this);
removeBtns(mybtns);
if (has_soundbtn){
GameMain.getInstance().removeSoundBtn();
};
}
protected function initBtns(_arg1:MovieClip):void{
if (_arg1){
_arg1.addEventListener(MouseEvent.CLICK, onBtnsClick);
_arg1.addEventListener(MouseEvent.MOUSE_OVER, onBtnsOver);
};
}
protected function onBtnsOver(_arg1:MouseEvent):void{
if (playBtnSound){
if (_arg1.target.name.search("btn_") != -1){
SoundObject.playSound(Data.SFX_Button);
};
};
}
public function setBtnEnable(_arg1:Boolean):void{
mouseEnabled = _arg1;
mouseChildren = _arg1;
}
protected function onBtnsClick(_arg1:MouseEvent):void{
var e = _arg1;
try {
this[(e.target.name + "_Func")].call();
if (playBtnSound){
SoundObject.playSound(Data.SFX_Button2);
};
} catch(error:Error) {
trace((("错误" + error.message) + e.target.name));
};
}
public function anim_in(_arg1:int):void{
init();
}
protected function init():void{
initBtns(mybtns);
if (has_soundbtn){
GameMain.getInstance().addSoundBtn(this);
};
}
public function btn_back_Func():void{
}
public function btn_sound_Func():void{
}
protected function doEfx_dark(_arg1:Function, ... _args):void{
}
public function enterUI(... _args):void{
remove();
GameMain.getInstance().changeCover(_args[0], (Data.stageWidth / 2), (Data.stageHeight / 2));
}
public function mybtns_Func():void{
}
public function setData(_arg1:Object):void{
}
protected function initPauseBtn():void{
mybtns.btn_pause.gotoAndStop(1);
mybtns.btn_pause.buttonMode = true;
mybtns.btn_pause.mouseChildren = false;
}
protected function setMusicBtn():void{
}
protected function removeBtns(_arg1:MovieClip):void{
if (_arg1){
_arg1.removeEventListener(MouseEvent.CLICK, onBtnsClick);
_arg1.removeEventListener(MouseEvent.MOUSE_OVER, onBtnsOver);
};
}
protected function initSoundBtn():void{
mybtns.btn_sound.gotoAndStop(1);
mybtns.btn_sound.buttonMode = true;
mybtns.btn_sound.mouseChildren = false;
}
}
}//package src.ui
Section 82
//UI_Congratulation (src.ui.UI_Congratulation)
package src.ui {
import src.sys.*;
import flash.display.*;
import src.data.*;
public class UI_Congratulation extends Cover {
public var __id4_:MovieClip;
public function UI_Congratulation(){
GameMain.getInstance().playMusic(Data.SFX_Win);
__setProp___id4__UI_Congratulation_();
}
function __setProp___id4__UI_Congratulation_(){
try {
__id4_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id4_.Type = "logo-donepage";
try {
__id4_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
public function restartLevel():void{
remove();
GameMain.getInstance().changeCover("UI_Title", 0, 0);
}
override public function btn_back_Func():void{
restartLevel();
setBtnEnable(false);
}
public function btn_more_Func():void{
MoreGameURLOK.MoreGameURLOK("moregames-donepage");
}
}
}//package src.ui
Section 83
//UI_HUD (src.ui.UI_HUD)
package src.ui {
import src.sys.*;
import flash.display.*;
import flash.events.*;
import src.sys.scene.*;
import flash.geom.*;
import src.model.*;
import src.data.*;
import lj.src.sys.*;
import src.ui.pop.*;
public class UI_HUD extends Cover {
public var mc_tips:MovieClip;
public var __id3_:MovieClip;
public var mc_text:MovieClip;
public var mc_tools:MovieClip;
public function UI_HUD(){
playBtnSound = false;
__setProp___id3__UI_HUD_();
}
protected function back_title():void{
(SceneMgr.scene as GameScene).gameEnd = 2;
GameMain.getInstance().removeScene();
GameMain.getInstance().changeCover("UI_Title", 0, 0);
}
protected function help_callback():void{
setBtnEnable(true);
GameMain.getInstance().handlePause(false);
}
override public function remove():void{
super.remove();
mc_tools.removeEventListener(MouseEvent.CLICK, onClickTools);
}
public function setLevel(_arg1:int):void{
}
public function setTime(_arg1:Number, _arg2:Number):void{
}
override protected function init():void{
super.init();
setScore(0);
setGoal(0);
var _local1:RoomM = (SceneMgr.scene as GameScene).roomV.roomM;
if (((_local1.tree1) || (_local1.tree2))){
mc_tools.tool_2.visible = true;
} else {
mc_tools.tool_2.visible = false;
};
mc_tools.addEventListener(MouseEvent.CLICK, onClickTools);
mc_tools.buttonMode = true;
}
protected function setBar(_arg1:MovieClip, _arg2:Number):void{
_arg1.bar.x = (-(_arg1.bar.width) + (_arg1.bar.width * _arg2));
}
public function setGoal(_arg1:int):void{
mc_text.txt_goal.text = ("$" + _arg1.toString());
}
public function setScore(_arg1:int):void{
mc_text.txt_coin.text = _arg1.toString();
}
override public function btn_back_Func():void{
setBtnEnable(false);
var _local1:UI_Pop = (GameMain.getInstance().changeCover("pop.UI_Sure", (Data.stageWidth / 2), (Data.stageHeight / 2)) as UI_Pop);
_local1.setCallback(sure_callback);
GameMain.getInstance().actionPause(true);
}
public function btn_server2_Func():void{
}
public function btn_pause_Func():void{
GameMain.getInstance().handlePause2(true);
}
public function setTip(_arg1:Number, _arg2:Boolean=false):Point{
setBar(mc_tips, _arg1);
var _local3:Point = mc_tips.bar.parent.localToGlobal(new Point((mc_tips.bar.x + mc_tips.bar.width), 0));
return (_local3);
}
public function btn_menu_Func():void{
if (!Global.pause){
GameMain.getInstance().handlePause(true);
};
}
protected function sure_callback(_arg1:Boolean):void{
if (_arg1){
back_title();
} else {
setBtnEnable(true);
GameMain.getInstance().actionPause(false);
};
}
public function onClickTools(_arg1:MouseEvent):void{
var _local2:int;
if (!Global.pause){
_local2 = _arg1.target.name.replace("tool_", "");
if ((((_local2 == 1)) || ((_local2 == 2)))){
(SceneMgr.scene as GameScene).waiterMgr.callServer(2);
} else {
if (_local2 == 3){
(SceneMgr.scene as GameScene).waiterMgr.callServer(1);
};
};
};
}
function __setProp___id3__UI_HUD_(){
try {
__id3_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id3_.Type = "logo-ingame";
try {
__id3_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
public function btn_server1_Func():void{
}
public function setCustom(_arg1:int, _arg2:int):void{
mc_text.txt_custom.text = ((_arg1.toString() + "/") + _arg2.toString());
}
public function btn_help_Func():void{
btn_pause_Func();
}
}
}//package src.ui
Section 84
//UI_Lose (src.ui.UI_Lose)
package src.ui {
import src.sys.*;
import flash.display.*;
import flash.events.*;
import src.data.*;
import lj.src.util.*;
public class UI_Lose extends Cover {
public var __id2_:MovieClip;
public var mc_efx:MovieClip;
public function UI_Lose(){
__setProp___id2__UI_Lose_();
}
public function btn_replay_Func():void{
remove();
restartLevel();
}
function __setProp___id2__UI_Lose_(){
try {
__id2_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id2_.Type = "logo-donepage";
try {
__id2_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
override public function remove():void{
super.remove();
mc_efx.removeEventListener(Event.ENTER_FRAME, onEfxEnterFrame);
}
public function btn_more_Func():void{
MoreGameURLOK.MoreGameURLOK("moregames-donepage");
}
protected function onEfxEnterFrame(_arg1:Event):void{
if (_arg1.target.currentFrame == _arg1.target.totalFrames){
_arg1.target.stop();
mc_efx.removeEventListener(Event.ENTER_FRAME, onEfxEnterFrame);
};
}
override protected function init():void{
super.init();
mc_efx.addEventListener(Event.ENTER_FRAME, onEfxEnterFrame);
SoundObject.playSound(Data.SFX_Fail);
}
public function restartLevel():void{
var _local1:UI_Title;
if (LevelControl.curLevel != 1){
GameMain.getInstance().changeCover("UI_Shop", 0, 0);
} else {
_local1 = (GameMain.getInstance().changeCover("UI_Title") as UI_Title);
_local1.anim_in(1);
_local1.addGoal();
};
}
override public function btn_back_Func():void{
remove();
GameMain.getInstance().changeCover("UI_Title", 0, 0);
}
}
}//package src.ui
Section 85
//UI_Pause (src.ui.UI_Pause)
package src.ui {
import src.sys.*;
import flash.display.*;
import src.ui.load.*;
import src.ui.pop.*;
public class UI_Pause extends Cover {
public var __id1_:MovieClip;
public function UI_Pause(){
__setProp___id1__UI_Pause_();
}
override protected function init():void{
super.init();
}
public function btn_load_Func():void{
var _local1:UI_Load = (GameMain.getInstance().changeCover("load.UI_Load") as UI_Load);
_local1.setCallback(pop_cb);
setBtnEnable(false);
}
public function btn_options_Func():void{
var _local1:UI_Pop = (GameMain.getInstance().changeCover("pop.UI_Options") as UI_Pop);
_local1.setCallback(setBtnEnable, true);
setBtnEnable(false);
}
public function btn_resume_Func():void{
GameMain.getInstance().handlePause(false);
}
public function btn_more_Func():void{
MoreGameURLOK.MoreGameURLOK("moregames-donepage");
trace("more!");
}
protected function pop_cb(_arg1:Boolean):void{
var _local2:UI_Pop;
if (_arg1){
GameMain.getInstance().removeScene();
_local2 = (GameMain.getInstance().changeCover("pop.UI_Goal") as UI_Pop);
_local2.setCallback(remove);
} else {
setBtnEnable(true);
};
}
function __setProp___id1__UI_Pause_(){
try {
__id1_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id1_.Type = "logo-ingame";
try {
__id1_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package src.ui
Section 86
//UI_Pause2 (src.ui.UI_Pause2)
package src.ui {
import src.sys.*;
import src.data.*;
public class UI_Pause2 extends Cover {
override protected function init():void{
super.init();
graphics.beginFill(0, 0.4);
graphics.drawRect((-(Data.stageWidth) / 2), (-(Data.stageHeight) / 2), Data.stageWidth, Data.stageHeight);
}
public function btn_menu_Func():void{
GameMain.getInstance().handlePause2(false);
GameMain.getInstance().removeScene();
GameMain.getInstance().changeCover("UI_Title", 0, 0);
}
public function btn_resume_Func():void{
GameMain.getInstance().handlePause2(false);
}
public function btn_more_Func():void{
trace("more!");
MoreGameURLOK.MoreGameURLOK("moregames-donepage");
}
}
}//package src.ui
Section 87
//UI_Shop (src.ui.UI_Shop)
package src.ui {
import src.vo.*;
import src.view.*;
import src.sys.*;
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import src.data.*;
import lj.src.util.*;
public class UI_Shop extends Cover {
protected var pageIndex:int;// = 0
protected var shopMap:ShopMap;
public var mc_txt:MovieClip;
public var scene:MovieClip;
public var mc_items:MovieClip;
protected var totalCash:int;
protected var _shopData:ShopData;
protected var availItemList:Array;
protected var curCost:int;
protected var curItem:Object;
public static var Item_Num:int = 5;
override public function remove():void{
super.remove();
shopMap.remove();
mc_items.removeEventListener(MouseEvent.CLICK, onClickItems);
availItemList.splice(0);
}
protected function removeCurItem(_arg1:Boolean=false):void{
var _local2:ColorTransform;
if (curItem){
_local2 = new ColorTransform();
mc_items[("btn_" + curItem.id)].transform.colorTransform = _local2;
if (!_arg1){
shopMap.setMcState(curItem.name, (curItem.level - 1), false);
};
curItem = null;
};
}
override protected function init():void{
super.init();
mc_items.addEventListener(MouseEvent.CLICK, onClickItems);
_shopData = LevelControl.getCurSaveData().shop;
totalCash = LevelControl.getCurSaveData().score;
setCash(totalCash);
shopMap = new ShopMap("Shop_Map");
shopMap.initMap(_shopData);
scene.map.addChild(shopMap);
refreshItems();
setItemBtns();
setClients(GameValue.curCustom);
setPopularity(GameValue.popularity);
GameMain.getInstance().playMusic(Data.SFX_ShopBGM);
GameUtil.setBtnEnable(mybtns.btn_buy, false);
}
protected function setClients(_arg1:int):void{
mc_txt.txt_clients.text = ("CLIENTS: " + _arg1);
}
public function setItemBtns():void{
var _local2:int;
var _local3:String;
var _local1:int;
while (_local1 < Item_Num) {
_local2 = (pageIndex + _local1);
if (_local2 < availItemList.length){
_local3 = ((availItemList[_local2].level == 1)) ? "" : availItemList[_local2].level;
mc_items[("item" + (_local1 + 1))].gotoAndStop((availItemList[_local2].name + _local3));
mc_items[("item" + (_local1 + 1))].mouseEnabled = false;
mc_items[("item" + (_local1 + 1))].mouseChildren = false;
mc_items[("item" + (_local1 + 1))].visible = true;
if (availItemList[_local2].cost > totalCash){
GameUtil.setMCEnable(mc_items[("item" + (_local1 + 1))], false);
GameUtil.setBtnEnable(mc_items[("btn_" + (_local1 + 1))], false);
} else {
GameUtil.setBtnEnable(mc_items[("btn_" + (_local1 + 1))], true);
GameUtil.removeFilter(mc_items[("item" + (_local1 + 1))]);
((mc_items[("btn_" + (_local1 + 1))].overState as Sprite).getChildAt(1) as MovieClip).popMc.txt.text = ((("Cost: $" + availItemList[_local2].cost) + ". ") + GameValue.getShopData(availItemList[_local2].name, "DETAIL"));
};
} else {
mc_items[("item" + (_local1 + 1))].visible = false;
((mc_items[("btn_" + (_local1 + 1))].overState as Sprite).getChildAt(1) as MovieClip).popMc.txt.text = "";
};
_local1++;
};
}
protected function checkBuiltCtd(_arg1:String):Boolean{
var _local2:Boolean;
if (_shopData.hasOwnProperty(_arg1)){
if (_shopData[_arg1]){
_local2 = true;
};
} else {
if (((_shopData[(_arg1 + "1")]) && (_shopData[(_arg1 + "2")]))){
_local2 = true;
};
};
return (_local2);
}
protected function displayItem(_arg1:int):void{
var _local2:ColorTransform;
removeCurItem();
if (((pageIndex + _arg1) - 1) < availItemList.length){
curItem = availItemList[((pageIndex + _arg1) - 1)];
curItem.id = _arg1;
_local2 = new ColorTransform(0.5, 0.5, 0.5, 1, 92, 46, 46);
mc_items[("btn_" + _arg1)].transform.colorTransform = _local2;
shopMap.setMcState(curItem.name, curItem.level, true);
setClients((curItem.custom + GameValue.curCustom));
setPopularity((curItem.pop + GameValue.popularity));
};
}
protected function refreshItems():void{
var _local2:String;
var _local3:int;
var _local4:String;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
availItemList = new Array();
var _local1 = 1;
while (_local1 < Data.Shop_Items.length) {
_local2 = Data.Shop_Items[_local1][0];
_local3 = Data.Shop_Items[_local1][1];
if (_shopData[_local2] < _local3){
_local4 = Data.Shop_Items[_local1][2];
if (((!(_local4)) || (checkBuiltCtd(_local4)))){
_local5 = (_shopData[_local2] + 1);
_local6 = GameValue.getCost(_local2, _local5);
_local7 = GameValue.getShopData(_local2, "CUSTOM");
_local8 = GameValue.getPop(_local2, _local5);
availItemList.push({name:_local2, level:(_shopData[_local2] + 1), cost:_local6, custom:_local7, pop:_local8});
};
};
_local1++;
};
}
protected function btn_pageNext():void{
pageIndex++;
pageIndex = Math.min(pageIndex, Math.max(0, (availItemList.length - Item_Num)));
setItemBtns();
removeCurItem();
}
protected function onClickItems(_arg1:MouseEvent):void{
var _local3:int;
var _local2:String = _arg1.target.name;
if (_local2 == "btn_prev"){
btn_pagePrev();
GameUtil.setBtnEnable(mybtns.btn_buy, false);
} else {
if (_local2 == "btn_next"){
btn_pageNext();
GameUtil.setBtnEnable(mybtns.btn_buy, false);
} else {
_local3 = parseInt(_local2.replace("btn_", ""));
if (_local3){
displayItem(_local3);
GameUtil.setBtnEnable(mybtns.btn_buy, true);
};
};
};
}
protected function btn_pagePrev():void{
pageIndex--;
pageIndex = Math.max(0, pageIndex);
setItemBtns();
removeCurItem();
}
protected function setPopularity(_arg1:int):void{
mc_txt.txt_popularity.text = ("POPULARITY: " + _arg1);
}
public function btn_buy_Func():void{
if (curItem){
if (curItem.cost <= totalCash){
totalCash = (totalCash - curItem.cost);
curCost = (curCost + curItem.cost);
shopMap.setMcState(curItem.name, curItem.level, false);
_shopData[curItem.name] = curItem.level;
GameValue.popularity = (GameValue.popularity + curItem.pop);
GameValue.curCustom = (GameValue.curCustom + curItem.custom);
refreshItems();
removeCurItem(true);
setItemBtns();
setCash(totalCash);
SoundObject.playSound(Data.SFX_Buy);
};
};
}
public function btn_play_Func():void{
LevelControl.saveShopInfo(LevelControl.curUser, _shopData, curCost);
remove();
var _local1:UI_Title = (GameMain.getInstance().changeCover("UI_Title") as UI_Title);
_local1.anim_in(1);
_local1.addGoal();
}
protected function setCash(_arg1:int):void{
mc_txt.txt_cash.text = ("CASH: $" + _arg1);
}
}
}//package src.ui
Section 88
//UI_Title (src.ui.UI_Title)
package src.ui {
import src.sys.*;
import flash.display.*;
import flash.events.*;
import src.ui.model.*;
import src.data.*;
import src.ui.pop.*;
public class UI_Title extends Cover {
public var __id0_:MovieClip;
protected var _myModel:UI_TilteM;
public function UI_Title(){
__setProp___id0__();
}
public function addGoal():void{
pop_cb(true);
}
override public function remove():void{
super.remove();
_myModel = null;
}
public function btn_options_Func():void{
var _local1:UI_Pop = (GameMain.getInstance().changeCover("pop.UI_Options") as UI_Pop);
_local1.setCallback(setBtnEnable, true);
setBtnEnable(false);
}
public function btn_more_Func():void{
_myModel.moreGame();
trace("more");
}
public function btn_play_Func():void{
setBtnEnable(false);
var _local1:UI_Pop = (_myModel.enterInput() as UI_Pop);
_local1.setCallback(pop_cb);
}
protected function pop_cb(_arg1:Boolean):void{
var _local2:UI_Pop;
if (_arg1){
_local2 = (_myModel.enterGoal() as UI_Pop);
_local2.setCallback(remove);
} else {
setBtnEnable(true);
};
}
override protected function init():void{
super.init();
if (Data.IF_Sound){
GameMain.getInstance().playMusic(Data.SFX_CoverBG);
};
}
override public function anim_in(_arg1:int):void{
_myModel = new UI_TilteM();
if (!_arg1){
if (((LevelControl.getSaveArr()) && (LevelControl.getSaveArr().length))){
play();
} else {
gotoAndPlay("b");
};
addEventListener(Event.ENTER_FRAME, onMyEF);
} else {
stop();
};
}
public function btn_load_Func():void{
var _local1:UI_Pop = (_myModel.enterLoad() as UI_Pop);
_local1.setCallback(pop_cb);
setBtnEnable(false);
}
protected function onMyEF(_arg1:Event):void{
if ((((currentFrame == totalFrames)) || ((this.currentLabel == "a")))){
stop();
init();
removeEventListener(Event.ENTER_FRAME, onMyEF);
};
}
function __setProp___id0__(){
try {
__id0_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id0_.Type = "logo-menu";
try {
__id0_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
public function btn_help_Func():void{
remove();
_myModel.enterHelp();
}
}
}//package src.ui
Section 89
//RoomItem (src.view.item.RoomItem)
package src.view.item {
import src.vo.*;
import src.model.role.*;
import src.sys.*;
import flash.display.*;
import src.sys.obj.*;
import lj.src.util.*;
import lj.src.sys.*;
public class RoomItem extends ViewMC {
protected var wait_count:int;
private var _bBroken:Boolean;// = false
protected var anim_count:int;// = 0
private var _enable:Boolean;// = true
protected var broken_count:int;
protected var timeMulti:int;// = 1
protected var wait_total:int;
public static var Mend_Item:Array = ["phone", "coffee"];
public static var BROKEN_BASE:int = (60 * Global.stage.frameRate);
public static var BROKEN_RANDOM:int = (120 * Global.stage.frameRate);
public function RoomItem(_arg1:String){
wait_total = (15 * Global.stage.frameRate);
super(_arg1);
init();
}
public function updateEvents():void{
var _local1:MovieClip;
if (broken_count){
broken_count--;
if (!broken_count){
broken_count = 0;
setBroken(true);
};
};
if (_bBroken){
if (_enable){
wait_count++;
if (wait_count >= wait_total){
_enable = false;
wait_count = 0;
};
updateMode((wait_count / wait_total));
} else {
updateMode(0.9);
};
};
if (mcName == "Tree"){
_local1 = (_mc.tree.getChildAt(0) as MovieClip);
if (_local1){
if (_local1.currentFrame == _local1.totalFrames){
_local1.gotoAndPlay("fall");
};
};
};
}
public function get enable():Boolean{
return (_enable);
}
protected function initBroken():void{
broken_count = ((BROKEN_BASE * timeMulti) + (Math.random() * BROKEN_RANDOM));
timeMulti++;
trace("Broke: ", mcName, timeMulti, broken_count);
}
override public function remove():void{
super.remove();
if (!GameUtil.checkInArr(Global.removeArr, this)){
Global.removeArr.push(this);
} else {
trace("Warning!!!! removeArr中已经存在我 ", mcName);
};
}
protected function updateMode(_arg1:Number):void{
anim_count = (anim_count + 10);
Method.setNeedMc(_mc.need, _arg1, -1, anim_count);
}
public function setMark(_arg1:Boolean, _arg2:MyRoleM=null):void{
if (((!(_arg2)) || (!((_arg2 is ServerM))))){
if (_mc.mark){
_mc.mark.visible = _arg1;
};
};
if (((!(_arg2)) || (!((_arg2 is WaiterM))))){
if (_mc.need){
Method.setMark(_arg1, _mc.need);
};
};
}
protected function init():void{
if (_mc.need){
_mc.need.visible = false;
Method.setMark(false, _mc.need);
};
setMark(false);
if (mcName == "Dinner_table"){
setBreakfast(false);
} else {
if (mcName == "Tree"){
mc.tree.gotoAndStop(1);
};
};
if (((GameUtil.checkInArr(Mend_Item, mcName.toLowerCase())) || ((mcName == "Tree")))){
initBroken();
Global.updateArr.push(this);
};
}
public function get broken():Boolean{
return (_bBroken);
}
public function setBroken(_arg1:Boolean):void{
_bBroken = _arg1;
if (!_arg1){
_mc.need.visible = false;
if (mcName == "Tree"){
_mc.tree.gotoAndStop(1);
};
_enable = true;
wait_count = 0;
initBroken();
} else {
_mc.need.visible = true;
if (mcName == "Tree"){
_mc.tree.gotoAndStop(2);
_mc.need.gotoAndStop(ServeVO.Water);
} else {
_mc.need.gotoAndStop(ServeVO.Mend);
};
updateMode(0);
};
}
public function setBreakfast(_arg1:Boolean):void{
_mc.breakfast.visible = _arg1;
}
public function replay():void{
}
public function pause():void{
}
}
}//package src.view.item
Section 90
//CustomV (src.view.role.CustomV)
package src.view.role {
import src.model.role.*;
import src.sys.*;
import flash.display.*;
import flash.events.*;
import src.sys.scene.*;
import flash.geom.*;
import src.view.item.*;
import src.sys.obj.*;
import lj.src.util.*;
public class CustomV extends PersonV {
protected var anim_count:int;
protected var needMc:MovieClip;
public function CustomV(_arg1:String){
super(_arg1);
}
public function onMouseClick(_arg1:MouseEvent):void{
if ((_personM as CustomM).checkCanServe()){
(SceneMgr.scene as GameScene).waiterMgr.clickCustom(this);
};
}
override public function animOver():void{
if (myCurrentLabel == "pay"){
(_personM as CustomM).payOut();
};
super.animOver();
}
override public function commonAction():void{
super.commonAction();
changeFrame("std");
}
override public function updateEvents():void{
super.updateEvents();
}
public function seatIn(_arg1:String):void{
var _local2:RoomItem;
var _local3:Point;
_local2 = (SceneMgr.scene as GameScene).roomV.getItem(_arg1);
if (_arg1 != "dinner_table"){
_local3 = _local2.mc.localToGlobal(new Point(_local2.mc.p1.x, _local2.mc.p1.y));
myX = _local3.x;
myY = _local3.y;
_mc.need.scaleX = (_mc.need.scaleX * _local2.mc.scaleX);
scaleMe(_local2.mc.scaleX);
} else {
_local2.mc.p1.addChild(_mc);
_mc.scaleX = 0.34;
_mc.scaleY = 0.34;
};
changeFrame("seat");
}
public function seatOut():void{
if (_mc.parent != this){
_mc.scaleX = 1;
_mc.scaleY = 1;
addChild(_mc);
};
_mc.need.scaleX = (_mc.need.scaleX * _mc.scaleX);
scaleMe(1);
setTilePos(myCol, myRow);
}
public function setNeedMc(_arg1:Number, _arg2:int):void{
anim_count = (anim_count + 10);
Method.setNeedMc(_mc.need, _arg1, _arg2, anim_count);
}
public function setMark(_arg1:Boolean):void{
Method.setMark(_arg1, _mc.need);
}
override protected function init():void{
super.init();
_personM = new CustomM();
_personM.personV = this;
mouseChildren = false;
setNeedMc(0, 1);
setMark(false);
}
public function onMouseOut(_arg1:MouseEvent):void{
var _local2:String = _arg1.target.name;
GameUtil.removeFilter((_arg1.target as DisplayObject));
}
override protected function arrival():void{
super.arrival();
if ((_personM as CustomM).curNeed == CustomM.Serve_Key){
commonAction();
};
}
public function onMouseOver(_arg1:MouseEvent):void{
var _local2:String = _arg1.target.name;
GameUtil.applyGlowFilter((_arg1.target as DisplayObject), 0xFFFF00);
}
public function resetNeedMc():void{
}
}
}//package src.view.role
Section 91
//WaiterV (src.view.role.WaiterV)
package src.view.role {
import src.model.role.*;
import src.sys.obj.*;
public class WaiterV extends PersonV {
protected var hand1:String;
protected var hand2:String;
protected var init_pos:Array;
public function WaiterV(_arg1:String){
super(_arg1);
}
override public function setTilePos(_arg1:int, _arg2:int):void{
super.setTilePos(_arg1, _arg2);
myY = (myY + _personM.id);
y = myY;
if (mcName.search("Server") != -1){
checkVisible();
};
}
public function setHandMc(_arg1:Array):void{
var _local2:int;
var _local3:int;
while (_local3 < _arg1.length) {
if (_arg1[_local3]){
this[("hand" + (_local3 + 1))] = _arg1[_local3];
_local2++;
} else {
this[("hand" + (_local3 + 1))] = 0;
};
_local3++;
};
if (_local2){
walkStr = _local2.toString();
} else {
walkStr = "";
};
if (((!(myXspeed)) && (!(myYspeed)))){
commonAction();
};
updateHandMc();
}
override public function updateEvents():void{
super.updateEvents();
updateHandMc();
}
override public function setData(_arg1:Object):void{
super.setData(_arg1);
}
protected function updateHandMc():void{
if (((_mc) && (innerMc))){
if (innerMc.arm1){
innerMc.arm1.item.gotoAndStop(hand1);
};
if (innerMc.arm2){
innerMc.arm2.item.gotoAndStop(hand2);
};
};
}
override protected function init():void{
super.init();
if (mcName.search("Waiter") != -1){
_personM = new WaiterM();
} else {
_personM = new ServerM();
};
_personM.personV = this;
_personM.setData({mcName:mcName});
}
override public function changeFrame(_arg1:String):Boolean{
var _local2:Boolean = super.changeFrame(_arg1);
if (_local2){
this.updateHandMc();
};
return (_local2);
}
override public function moveToTile(_arg1:int, _arg2:int):Array{
var _local3:int;
tileArr = super.moveToTile(_arg1, _arg2);
if (((routeArr) && (routeArr.length))){
_local3 = 0;
while (_local3 < routeArr.length) {
routeArr[_local3].y = (routeArr[_local3].y + _personM.id);
_local3++;
};
};
return (tileArr);
}
protected function get myModel():WaiterM{
return ((_personM as WaiterM));
}
public function get routeArrLength():int{
var _local1:int;
if (routeArr){
_local1 = routeArr.length;
};
return (_local1);
}
public function clickSth(_arg1:String):void{
}
}
}//package src.view.role
Section 92
//BGView (src.view.BGView)
package src.view {
import src.sys.*;
import flash.display.*;
import flash.events.*;
import src.model.*;
import src.sys.obj.*;
public class BGView extends ViewMC {
protected var anim_count:int;
protected var doorState:Array;
private var _roomM:RoomM;
public static var Door_Num:int = 8;
public function BGView(_arg1:String){
super(_arg1);
init();
}
override public function remove():void{
doorState.splice(0);
super.remove();
removeEventListener(Event.ENTER_FRAME, onMyEF);
}
public function setDoorState(_arg1:int, _arg2:int):void{
doorState[(_arg1 - 1)] = _arg2;
}
protected function onMyEF(_arg1:Event):void{
var _local3:MovieClip;
var _local2:int;
while (_local2 < Door_Num) {
_local3 = _mc[("door" + (_local2 + 1))].getChildAt(0);
if (_local3){
if (!doorState[_local2]){
if (_local3.currentFrame == 12){
_local3.play();
} else {
if (_local3.currentFrame <= 2){
_local3.stop();
};
};
} else {
if (_local3.currentFrame <= 2){
_local3.play();
} else {
if (_local3.currentFrame == 12){
_local3.stop();
};
};
};
};
_local2++;
};
}
public function setNeedMc(_arg1:int, _arg2:int, _arg3:int, _arg4:Number):void{
if (_arg4){
_mc[("door" + _arg1)].need.role.gotoAndStop(_arg3);
};
anim_count = (anim_count + 10);
Method.setNeedMc(_mc[("door" + _arg1)].need, _arg4, _arg2, anim_count);
}
public function setMark(_arg1:Boolean, _arg2:String):void{
var _local3:int = parseInt(_arg2.replace("door", ""));
if (_local3){
Method.setMark(_arg1, _mc[("door" + _local3)].need);
} else {
if (_mc.hasOwnProperty(_arg2)){
_mc[_arg2].mark.visible = _arg1;
};
};
}
protected function init():void{
doorState = new Array();
var _local1:int;
while (_local1 < Door_Num) {
doorState.push(0);
_mc[("door" + (_local1 + 1))].need.visible = false;
Method.setMark(false, _mc[("door" + (_local1 + 1))].need);
_local1++;
};
trace("key: ", _mc.key);
_mc.key.mouseChildren = false;
_mc.key.buttonMode = true;
_mc.food.buttonMode = true;
setMark(false, "food");
setMark(false, "key");
addEventListener(Event.ENTER_FRAME, onMyEF);
}
public function get roomM():RoomM{
return (_roomM);
}
public function setMcVisible(_arg1:String, _arg2:Boolean):void{
_mc[_arg1].visible = _arg2;
}
public function set roomM(_arg1:RoomM):void{
_roomM = _arg1;
}
}
}//package src.view
Section 93
//CG (src.view.CG)
package src.view {
import src.sys.*;
import flash.events.*;
import src.sys.obj.*;
import com.greensock.*;
import src.data.*;
import com.greensock.plugins.*;
import flash.utils.*;
public class CG extends ViewMC {
protected var pageCount:int;
protected var btn_sound:SoundMC;
protected var curPage:int;// = 1
public static var hasPlay:Boolean = false;
public function CG(_arg1:String){
super(_arg1);
_mc.stop();
TweenPlugin.activate([TintPlugin, RemoveTintPlugin]);
TweenLite.to(this, 0, {tint:0});
TweenLite.to(this, 1, {removeTint:true, onComplete:init});
hasPlay = true;
GameMain.getInstance().playMusic(Data.SFX_CG);
}
protected function onClickMe(_arg1:Event):void{
nextPage();
}
protected function nextPage():void{
curPage++;
trace("curPage: ", curPage);
if (curPage > _mc.totalFrames){
TweenLite.to(this, 0.3, {tint:0, onComplete:playOver});
} else {
TweenLite.to(this, 0.3, {tint:0, onComplete:playNext});
setTimeout(checkNextPage, 4000, curPage);
};
_mc.mouseEnabled = false;
_mc.mouseChildren = false;
}
override public function remove():void{
super.remove();
_mc.removeEventListener(MouseEvent.CLICK, onClickMe);
GameMain.getInstance().removeSoundBtn();
}
protected function playOver():void{
remove();
dispatchEvent(new Event(Event.COMPLETE));
}
protected function checkNextPage(_arg1:int):void{
if (curPage == _arg1){
nextPage();
};
}
protected function playNext():void{
_mc.gotoAndStop(curPage);
TweenLite.to(this, 0, {removeTint:true});
_mc.mouseEnabled = true;
_mc.mouseChildren = true;
}
protected function init():void{
buttonMode = true;
trace("init CG ");
_mc.addEventListener(MouseEvent.CLICK, onClickMe);
setTimeout(checkNextPage, 4000, curPage);
GameMain.getInstance().addSoundBtn(this);
}
}
}//package src.view
Section 94
//DropDisplay (src.view.DropDisplay)
package src.view {
import flash.display.*;
import src.sys.obj.*;
import com.greensock.*;
import src.data.*;
import com.greensock.easing.*;
public class DropDisplay extends ViewMC {
protected var _func:Function;
public function DropDisplay(_arg1:String){
super(_arg1);
init();
}
protected function init():void{
var _local1:TimelineLite = new TimelineLite();
_local1.append(new TweenLite(this, 0.5, {y:((Data.stageHeight / 2) + (height / 2)), ease:Expo.easeOut}));
_local1.append(new TweenLite(this, 1, {}));
_local1.append(new TweenLite(this, 0.5, {y:(-(height) / 2), onComplete:animFinish, ease:Expo.easeOut}));
}
public function start(_arg1:DisplayObjectContainer, _arg2:Function):void{
_func = _arg2;
addToStage(_arg1, (Data.stageWidth / 2), (-(height) / 2));
init();
}
protected function animFinish():void{
remove();
if (_func != null){
_func.call();
};
}
}
}//package src.view
Section 95
//FGView (src.view.FGView)
package src.view {
import src.sys.obj.*;
public class FGView extends ViewMC {
public function FGView(_arg1:String){
super(_arg1);
}
public function setMcVisible(_arg1:String, _arg2:Boolean):void{
_mc[_arg1].visible = _arg2;
}
}
}//package src.view
Section 96
//RoomV (src.view.RoomV)
package src.view {
import flash.display.*;
import flash.events.*;
import src.sys.scene.*;
import src.view.item.*;
import src.model.*;
import src.data.*;
import lj.src.util.*;
public class RoomV {
public var bg:BGView;
protected var _parent:DisplayObjectContainer;
protected var itemArr:Object;
protected var lightItem:String;
private var _roomM:RoomM;
public static var Door_Num:int = 8;
public static var Item_Pos:Array = [[220, 354, 1], [139, 388, 1], [41, 379, -1, 660, 379, 1], [438, 365, 1], [296, 363, 1], [28, 391, 1, 628, 391, 1], [327, 426, 1], [283, 394, 1, 435, 392, -1], [368, 375, 1], [207, 333, 1, 472, 333, 1]];
public static var Item_List:Array = ["Newspaper", "Dinner_table", "Stair", "Coffee", "Platform", "Armor", "Front_table", "Chair", "Phone", "Tree"];
public static var Item_Scale:Array = [0.367, 1, 1, 1, 1, 0.229, 0.287, 0.453, 1, 1];
public function RoomV(_arg1:DisplayObjectContainer){
_parent = _arg1;
itemArr = new Array();
}
public function setMoney(_arg1:int):void{
if (_arg1){
itemArr.platform.mc.money.visible = true;
} else {
itemArr.platform.mc.money.visible = false;
};
}
public function onMouseOver(_arg1:MouseEvent):void{
var _local2:String = _arg1.target.name;
if (canClick(_local2)){
GameUtil.applyGlowFilter((_arg1.target as DisplayObject), 0xFFFF00);
};
}
public function onMouseClick(_arg1:MouseEvent):void{
if (canClick(_arg1.target.name)){
(SceneMgr.scene as GameScene).waiterMgr.clickItem(_arg1.target.name);
};
}
public function remove():void{
bg.remove();
_parent = null;
}
public function onMouseOut(_arg1:MouseEvent):void{
var _local2:String = _arg1.target.name;
if (canClick(_local2)){
GameUtil.removeFilter((_arg1.target as DisplayObject));
};
}
public function set roomM(_arg1:RoomM):void{
_roomM = _arg1;
_roomM.roomV = this;
}
protected function parseBoolean(_arg1:int):Boolean{
return ((_arg1) ? true : false);
}
public function get roomM():RoomM{
return (_roomM);
}
public function initBG(_arg1:DisplayObjectContainer):void{
bg = new BGView("Map");
bg.addToStage(_arg1, 0, 0);
bg.roomM = _roomM;
initDoor();
bg.setMcVisible("paint1", parseBoolean(_roomM.paint1));
bg.setMcVisible("paint2", parseBoolean(_roomM.paint2));
bg.setMcVisible("bigpaint", parseBoolean(_roomM.bigpaint));
bg.setMcVisible("food", parseBoolean(_roomM.dinner_table));
(SceneMgr.scene as GameScene).fg.setMcVisible("hangs1", parseBoolean(_roomM.hangs1));
(SceneMgr.scene as GameScene).fg.setMcVisible("hangs2", parseBoolean(_roomM.hangs2));
bg.setMcVisible("lamp1", parseBoolean(_roomM.lamp1));
bg.setMcVisible("lamp2", parseBoolean(_roomM.lamp2));
}
public function initDoor():void{
var _local2:int;
var _local1:int;
while (_local1 < Door_Num) {
_local2 = _roomM.doorLevels[_local1];
bg.mc[("door" + (_local1 + 1))].gotoAndStop(_local2);
bg.mc[("door" + (_local1 + 1))].mouseChildren = false;
if (_local2 > 1){
bg.mc[("door" + (_local1 + 1))].buttonMode = true;
};
_local1++;
};
}
public function getItem(_arg1:String):RoomItem{
return (itemArr[_arg1]);
}
public function setItems():void{
var _local1:String;
var _local2:int;
var _local3:int;
var _local4:String;
var _local5:String;
var _local6:RoomItem;
var _local7:int;
for each (_local1 in Item_List) {
_local2 = Data.getTypeNums(_local1.toLowerCase());
_local3 = 0;
while (_local3 < _local2) {
_local4 = ((_local2 > 1)) ? (_local3 + 1).toString() : "";
_local5 = (_local1.toLowerCase() + _local4);
if (_roomM[_local5]){
_local6 = new RoomItem(_local1);
_local6.name = (_local1.toLowerCase() + _local4);
_local6.mc.gotoAndStop(_roomM[_local5]);
_local7 = Item_List.indexOf(_local1);
_local6.addToStage(_parent, Item_Pos[_local7][(_local3 * 3)], Item_Pos[_local7][((_local3 * 3) + 1)]);
_local6.setScale(Item_Scale[_local7]);
_local6.scaleMe(Item_Pos[_local7][((_local3 * 3) + 2)]);
_local6.mouseChildren = false;
if (canClick(_local6.name)){
_local6.buttonMode = true;
};
itemArr[_local5] = _local6;
};
_local3++;
};
};
setMoney(0);
}
public function canClick(_arg1:String):Boolean{
var _local2:Boolean;
if (Data.Reach_Pos[_arg1]){
if (Data.CANT_CLICK.indexOf(_arg1) == -1){
_local2 = true;
};
};
return (_local2);
}
}
}//package src.view
Section 97
//ScoreTip (src.view.ScoreTip)
package src.view {
import flash.display.*;
import src.sys.obj.*;
import com.greensock.*;
import lj.src.util.*;
import com.greensock.easing.*;
public class ScoreTip extends ViewMC {
public function ScoreTip(_arg1:String){
super(_arg1);
}
public function setScore(_arg1:int, _arg2:int):void{
GameUtil.setScoreNum(_arg1, _arg2, _mc);
}
override public function addToStage(_arg1:DisplayObjectContainer, _arg2:Number=0, _arg3:Number=0):void{
super.addToStage(_arg1, _arg2, _arg3);
TweenLite.to(this, 1, {y:(_arg3 - 15), ease:Linear.easeIn});
TweenLite.to(this, 1, {alpha:0.2, ease:Quad.easeIn, onComplete:remove});
}
public function randomFrame():void{
var _local1:int = ((Math.random() * _mc.totalFrames) + 1);
_mc.gotoAndStop(_local1);
}
}
}//package src.view
Section 98
//ShopMap (src.view.ShopMap)
package src.view {
import src.vo.*;
import flash.events.*;
import src.sys.obj.*;
import src.data.*;
public class ShopMap extends ViewMC {
protected var count:int;
protected var curItemNum:int;
protected var itemMcArr:Array;
public function ShopMap(_arg1:String){
super(_arg1);
itemMcArr = new Array();
addEventListener(Event.ENTER_FRAME, onMyEF);
}
protected function setFloorLevel(_arg1:String, _arg2:int, _arg3:Boolean):void{
var _local5:int;
var _local4:int = ((_arg2 == 1)) ? 2 : 1;
if (_arg1 == "floor2"){
_local5 = 3;
while (_local5 <= 5) {
mc[("door" + _local5)].gotoAndStop(_local4);
if (_arg3){
itemMcArr.push(("door" + _local5));
};
_local5++;
};
} else {
if (_arg1 == "floor3"){
_local5 = 6;
while (_local5 <= 8) {
mc[("door" + _local5)].gotoAndStop(_local4);
if (_arg3){
itemMcArr.push(("door" + _local5));
};
_local5++;
};
};
};
}
override public function remove():void{
super.remove();
removeEventListener(Event.ENTER_FRAME, onMyEF);
}
public function initMap(_arg1:ShopData):void{
var _local2:int;
var _local3:String;
var _local4:int;
if (_arg1){
_local2 = 1;
while (_local2 < Data.Shop_Items.length) {
_local3 = Data.Shop_Items[_local2][0];
_local4 = _arg1[_local3];
if ((((((_local3 == "chair1")) || ((_local3 == "chair2")))) && (!((_arg1.chairs == 1))))){
} else {
setMcState(_local3, _local4, false);
};
_local2++;
};
if (_arg1.door > 2){
setMcState("door", _arg1.door, false);
};
};
}
public function setMcState(_arg1:String, _arg2:int, _arg3:Boolean):void{
var _local4:int;
var _local5:int;
var _local6:int;
if (itemMcArr.length){
_local4 = 0;
while (_local4 < itemMcArr.length) {
mc[itemMcArr[_local4]].alpha = 1;
_local4++;
};
};
itemMcArr.splice(0);
if (_mc.hasOwnProperty(_arg1)){
if (!_arg2){
setMcVisible(_arg1, false);
} else {
setMcVisible(_arg1, true);
_mc[_arg1].gotoAndStop(_arg2);
if (_arg3){
itemMcArr.push(_arg1);
};
};
} else {
if (_arg1.search("floor") == -1){
if (_arg1 == "chairs"){
_arg1 = "chair";
};
_local5 = Data.getTypeNums(_arg1);
trace("Shop: ", _arg1, _arg2, _local5);
_local6 = 0;
while (_local6 < _local5) {
if (!_arg2){
setMcVisible((_arg1 + (_local6 + 1)), false);
} else {
setMcVisible((_arg1 + (_local6 + 1)), true);
_mc[(_arg1 + (_local6 + 1))].gotoAndStop(_arg2);
if (_arg3){
itemMcArr.push((_arg1 + (_local6 + 1)));
};
};
_local6++;
};
} else {
setFloorLevel(_arg1, _arg2, _arg3);
};
};
}
public function setMcVisible(_arg1:String, _arg2:Boolean):void{
_mc[_arg1].visible = _arg2;
}
protected function onMyEF(_arg1:Event):void{
var _local2:Number;
var _local3:int;
if (itemMcArr.length){
count = (count + 10);
_local2 = ((Math.sin((count * 0.0174)) + 1) / 2);
_local3 = 0;
while (_local3 < itemMcArr.length) {
mc[itemMcArr[_local3]].alpha = _local2;
_local3++;
};
};
}
}
}//package src.view
Section 99
//SoundMC (src.view.SoundMC)
package src.view {
import src.sys.*;
import flash.events.*;
import src.sys.obj.*;
public class SoundMC extends ViewMC {
public function SoundMC(_arg1:String){
super(_arg1);
init();
}
protected function init():void{
initSoundBtn();
setMusicBtn();
addEventListener(MouseEvent.CLICK, onClickMe);
}
protected function onClickMe(_arg1:MouseEvent):void{
if (((GameMain.getInstance().VolumnFX) || (GameMain.getInstance().VolumnMusic))){
GameMain.getInstance().VolumnFX = 0;
GameMain.getInstance().VolumnMusic = 0;
} else {
GameMain.getInstance().VolumnFX = 0.5;
GameMain.getInstance().VolumnMusic = 0.5;
};
setMusicBtn();
}
override public function remove():void{
super.remove();
removeEventListener(MouseEvent.CLICK, onClickMe);
}
protected function initSoundBtn():void{
_mc.buttonMode = true;
_mc.mouseChildren = false;
}
public function setMusicBtn():void{
if (((GameMain.getInstance().VolumnFX) || (GameMain.getInstance().VolumnMusic))){
_mc.gotoAndStop(1);
} else {
_mc.gotoAndStop(2);
};
}
}
}//package src.view
Section 100
//ServeVO (src.vo.ServeVO)
package src.vo {
public class ServeVO {
public static const Money:int = 9;
public static const Dinner:int = 6;
public static const Clean:int = 2;
public static const Coffee:int = 3;
public static const Phone:int = 5;
public static const Mend:int = 7;
public static const Water:int = 8;
public static const Newspaper:int = 4;
public static const Key:int = 1;
}
}//package src.vo
Section 101
//ShopData (src.vo.ShopData)
package src.vo {
public class ShopData {
public var dinner_table:int;
public var hangs:int;
public var chair1:int;
public var chair2:int;
public var chairs:int;// = 1
public var newspaper:int;
public var coffee:int;// = 1
public var tree:int;
public var paint:int;
public var floor2:int;
public var floor3:int;
public var door:int;// = 2
public var platform:int;// = 1
public var phone:int;
public var bigpaint:int;
public var front_table:int;
public var lamp:int;
public var armor:int;
}
}//package src.vo
Section 102
//Armor (Armor)
package {
import flash.display.*;
public dynamic class Armor extends MovieClip {
}
}//package
Section 103
//CastleMain (CastleMain)
package {
import src.sys.*;
import flash.display.*;
import lj.src.sys.*;
import lj.src.*;
public class CastleMain extends DocumentClass {
override protected function start():void{
var _local1:GameMain = new GameMain();
_local1.init();
Global.stage.quality = StageQuality.MEDIUM;
}
}
}//package
Section 104
//CGs (CGs)
package {
import flash.display.*;
public dynamic class CGs extends MovieClip {
}
}//package
Section 105
//Chair (Chair)
package {
import flash.display.*;
public dynamic class Chair extends MovieClip {
public var p1:MovieClip;
public var p2:MovieClip;
}
}//package
Section 106
//Coffee (Coffee)
package {
import flash.display.*;
public dynamic class Coffee extends MovieClip {
public var mark:MovieClip;
public var need:MovieClip;
}
}//package
Section 107
//Comment (Comment)
package {
import flash.display.*;
public dynamic class Comment extends MovieClip {
}
}//package
Section 108
//Custom1 (Custom1)
package {
import flash.display.*;
public dynamic class Custom1 extends MovieClip {
public var need:MovieClip;
}
}//package
Section 109
//Custom2 (Custom2)
package {
import flash.display.*;
public dynamic class Custom2 extends MovieClip {
public var need:MovieClip;
}
}//package
Section 110
//Custom3 (Custom3)
package {
import flash.display.*;
public dynamic class Custom3 extends MovieClip {
public var need:MovieClip;
}
}//package
Section 111
//Custom4 (Custom4)
package {
import flash.display.*;
public dynamic class Custom4 extends MovieClip {
public var need:MovieClip;
}
}//package
Section 112
//Custom5 (Custom5)
package {
import flash.display.*;
public dynamic class Custom5 extends MovieClip {
public var need:MovieClip;
}
}//package
Section 113
//Dinner_table (Dinner_table)
package {
import flash.display.*;
public dynamic class Dinner_table extends MovieClip {
public var p1:MovieClip;
public var breakfast:MovieClip;
}
}//package
Section 114
//Display_GoalReach (Display_GoalReach)
package {
import flash.display.*;
public dynamic class Display_GoalReach extends MovieClip {
}
}//package
Section 115
//Display_ReadyGo (Display_ReadyGo)
package {
import flash.display.*;
public dynamic class Display_ReadyGo extends MovieClip {
}
}//package
Section 116
//Display_TryAgain (Display_TryAgain)
package {
import flash.display.*;
public dynamic class Display_TryAgain extends MovieClip {
}
}//package
Section 117
//FG (FG)
package {
import flash.display.*;
public dynamic class FG extends MovieClip {
public var hangs1:MovieClip;
public var hangs2:MovieClip;
}
}//package
Section 118
//Front_table (Front_table)
package {
import flash.display.*;
public dynamic class Front_table extends MovieClip {
}
}//package
Section 119
//Key (Key)
package {
import flash.display.*;
public dynamic class Key extends MovieClip {
}
}//package
Section 120
//Map (Map)
package {
import flash.display.*;
public dynamic class Map extends MovieClip {
public var door1:MovieClip;
public var door2:MovieClip;
public var door3:MovieClip;
public var door5:MovieClip;
public var door6:MovieClip;
public var door7:MovieClip;
public var door8:MovieClip;
public var door4:MovieClip;
public var paint1:MovieClip;
public var paint2:MovieClip;
public var lamp1:MovieClip;
public var lamp2:MovieClip;
public var food:MovieClip;
public var key:MovieClip;
public var bigpaint:MovieClip;
}
}//package
Section 121
//MochiBot (MochiBot)
package {
import flash.display.*;
import flash.net.*;
import flash.system.*;
public dynamic class MochiBot extends Sprite {
public static function track(_arg1:Sprite, _arg2:String):MochiBot{
if (Security.sandboxType == "localWithFile"){
return (null);
};
var _local3:MochiBot = new (MochiBot);
_arg1.addChild(_local3);
Security.allowDomain("*");
Security.allowInsecureDomain("*");
var _local4 = "http://core.mochibot.com/my/core.swf";
var _local5:URLVariables = new URLVariables();
_local5["sb"] = Security.sandboxType;
_local5["v"] = Capabilities.version;
_local5["swfid"] = _arg2;
_local5["mv"] = "8";
_local5["fv"] = "9";
var _local6:String = _local3.root.loaderInfo.loaderURL;
if (_local6.indexOf("http") == 0){
_local5["url"] = _local6;
} else {
_local5["url"] = "local";
};
var _local7:URLRequest = new URLRequest(_local4);
_local7.contentType = "application/x-www-form-urlencoded";
_local7.method = URLRequestMethod.POST;
_local7.data = _local5;
var _local8:Loader = new Loader();
_local3.addChild(_local8);
_local8.load(_local7);
return (_local3);
}
}
}//package
Section 122
//MoreGameURLOK (MoreGameURLOK)
package {
public class MoreGameURLOK {
public static var Goto:String;
public static var MoreGameURLOK:Function;
public static var DONE_PAGE:String = "moregames-donepage";
public static var MENU:String = "moregames-menu";
public static function Ready():void{
}
}
}//package
Section 123
//Newspaper (Newspaper)
package {
import flash.display.*;
public dynamic class Newspaper extends MovieClip {
public var mark:MovieClip;
}
}//package
Section 124
//Phone (Phone)
package {
import flash.display.*;
public dynamic class Phone extends MovieClip {
public var mark:MovieClip;
public var need:MovieClip;
}
}//package
Section 125
//Platform (Platform)
package {
import flash.display.*;
public dynamic class Platform extends MovieClip {
public var money:MovieClip;
public var flower:MovieClip;
}
}//package
Section 126
//s1ID (s1ID)
package {
import flash.media.*;
public dynamic class s1ID extends Sound {
}
}//package
Section 127
//s2ID (s2ID)
package {
import flash.media.*;
public dynamic class s2ID extends Sound {
}
}//package
Section 128
//s3ID (s3ID)
package {
import flash.media.*;
public dynamic class s3ID extends Sound {
}
}//package
Section 129
//Score_Tip (Score_Tip)
package {
import flash.display.*;
public dynamic class Score_Tip extends MovieClip {
}
}//package
Section 130
//Score_Tip2 (Score_Tip2)
package {
import flash.display.*;
public dynamic class Score_Tip2 extends MovieClip {
}
}//package
Section 131
//Server1 (Server1)
package {
import flash.display.*;
public dynamic class Server1 extends MovieClip {
}
}//package
Section 132
//Server2 (Server2)
package {
import flash.display.*;
public dynamic class Server2 extends MovieClip {
}
}//package
Section 133
//Sfx_Bell (Sfx_Bell)
package {
import flash.media.*;
public dynamic class Sfx_Bell extends Sound {
}
}//package
Section 134
//Sfx_BGMusic (Sfx_BGMusic)
package {
import flash.media.*;
public dynamic class Sfx_BGMusic extends Sound {
}
}//package
Section 135
//Sfx_Button (Sfx_Button)
package {
import flash.media.*;
public dynamic class Sfx_Button extends Sound {
}
}//package
Section 136
//Sfx_Button2 (Sfx_Button2)
package {
import flash.media.*;
public dynamic class Sfx_Button2 extends Sound {
}
}//package
Section 137
//Sfx_Buy (Sfx_Buy)
package {
import flash.media.*;
public dynamic class Sfx_Buy extends Sound {
}
}//package
Section 138
//Sfx_Cash (Sfx_Cash)
package {
import flash.media.*;
public dynamic class Sfx_Cash extends Sound {
}
}//package
Section 139
//Sfx_CG (Sfx_CG)
package {
import flash.media.*;
public dynamic class Sfx_CG extends Sound {
}
}//package
Section 140
//Sfx_Deal (Sfx_Deal)
package {
import flash.media.*;
public dynamic class Sfx_Deal extends Sound {
}
}//package
Section 141
//Sfx_DoorClose (Sfx_DoorClose)
package {
import flash.media.*;
public dynamic class Sfx_DoorClose extends Sound {
}
}//package
Section 142
//Sfx_DoorOpen (Sfx_DoorOpen)
package {
import flash.media.*;
public dynamic class Sfx_DoorOpen extends Sound {
}
}//package
Section 143
//Sfx_Fail (Sfx_Fail)
package {
import flash.media.*;
public dynamic class Sfx_Fail extends Sound {
}
}//package
Section 144
//Sfx_Goodbye (Sfx_Goodbye)
package {
import flash.media.*;
public dynamic class Sfx_Goodbye extends Sound {
}
}//package
Section 145
//Sfx_Hello (Sfx_Hello)
package {
import flash.media.*;
public dynamic class Sfx_Hello extends Sound {
}
}//package
Section 146
//Sfx_HiThere (Sfx_HiThere)
package {
import flash.media.*;
public dynamic class Sfx_HiThere extends Sound {
}
}//package
Section 147
//Sfx_Key (Sfx_Key)
package {
import flash.media.*;
public dynamic class Sfx_Key extends Sound {
}
}//package
Section 148
//Sfx_MayI_Man (Sfx_MayI_Man)
package {
import flash.media.*;
public dynamic class Sfx_MayI_Man extends Sound {
}
}//package
Section 149
//Sfx_MayI_Woman (Sfx_MayI_Woman)
package {
import flash.media.*;
public dynamic class Sfx_MayI_Woman extends Sound {
}
}//package
Section 150
//Sfx_Pass (Sfx_Pass)
package {
import flash.media.*;
public dynamic class Sfx_Pass extends Sound {
}
}//package
Section 151
//Sfx_ReachGoal (Sfx_ReachGoal)
package {
import flash.media.*;
public dynamic class Sfx_ReachGoal extends Sound {
}
}//package
Section 152
//Sfx_ShopBGM (Sfx_ShopBGM)
package {
import flash.media.*;
public dynamic class Sfx_ShopBGM extends Sound {
}
}//package
Section 153
//Sfx_Sweep (Sfx_Sweep)
package {
import flash.media.*;
public dynamic class Sfx_Sweep extends Sound {
}
}//package
Section 154
//Sfx_Take (Sfx_Take)
package {
import flash.media.*;
public dynamic class Sfx_Take extends Sound {
}
}//package
Section 155
//Sfx_TitleBGM (Sfx_TitleBGM)
package {
import flash.media.*;
public dynamic class Sfx_TitleBGM extends Sound {
}
}//package
Section 156
//Sfx_TryAgain (Sfx_TryAgain)
package {
import flash.media.*;
public dynamic class Sfx_TryAgain extends Sound {
}
}//package
Section 157
//Sfx_Water (Sfx_Water)
package {
import flash.media.*;
public dynamic class Sfx_Water extends Sound {
}
}//package
Section 158
//Sfx_Win (Sfx_Win)
package {
import flash.media.*;
public dynamic class Sfx_Win extends Sound {
}
}//package
Section 159
//Shop_Map (Shop_Map)
package {
import flash.display.*;
public dynamic class Shop_Map extends MovieClip {
public var stair2:Stair;
public var chair1:Chair;
public var chair2:Chair;
public var stair1:Stair;
public var hangs2:MovieClip;
public var paint1:MovieClip;
public var hangs1:MovieClip;
public var paint2:MovieClip;
public var newspaper:MovieClip;
public var front_table:Front_table;
public var dinner_table:MovieClip;
public var door1:MovieClip;
public var door2:MovieClip;
public var door3:MovieClip;
public var door4:MovieClip;
public var door5:MovieClip;
public var door6:MovieClip;
public var door7:MovieClip;
public var door8:MovieClip;
public var coffee:MovieClip;
public var armor1:Armor;
public var tree1:MovieClip;
public var tree2:MovieClip;
public var lamp1:MovieClip;
public var lamp2:MovieClip;
public var bigpaint:MovieClip;
public var armor2:Armor;
public var phone:MovieClip;
public var platform:MovieClip;
}
}//package
Section 160
//SoundBtn (SoundBtn)
package {
import flash.display.*;
public dynamic class SoundBtn extends MovieClip {
}
}//package
Section 161
//Stair (Stair)
package {
import flash.display.*;
public dynamic class Stair extends MovieClip {
}
}//package
Section 162
//Tree (Tree)
package {
import flash.display.*;
public dynamic class Tree extends MovieClip {
public var tree:MovieClip;
public var need:MovieClip;
}
}//package
Section 163
//Waiter1 (Waiter1)
package {
import flash.display.*;
public dynamic class Waiter1 extends MovieClip {
}
}//package
Section 164
//Waiter2 (Waiter2)
package {
import flash.display.*;
public dynamic class Waiter2 extends MovieClip {
}
}//package