Section 1
//1_instructions_window_3 (briscolaMainGraphics_fla.1_instructions_window_3)
package briscolaMainGraphics_fla {
import flash.display.*;
public dynamic class 1_instructions_window_3 extends MovieClip {
public var cardAnim:MovieClip;
public var arrow:MovieClip;
public var countdown:MovieClip;
public var startButton:MovieClip;
public var textBox:MovieClip;
public function 1_instructions_window_3(){
addFrameScript(14, frame15);
}
function frame15(){
stop();
}
}
}//package briscolaMainGraphics_fla
Section 2
//1_opponent_states_141 (briscolaMainGraphics_fla.1_opponent_states_141)
package briscolaMainGraphics_fla {
import flash.display.*;
public dynamic class 1_opponent_states_141 extends MovieClip {
public var sad3_in:MovieClip;
public var worried2_in:MovieClip;
public var worried1_out:MovieClip;
public var worried2_out:MovieClip;
public var happy3_in:MovieClip;
public var worried3_out:MovieClip;
public var worried1_in:MovieClip;
public var sad2_in:MovieClip;
public var sad1_out:MovieClip;
public var sad2_out:MovieClip;
public var sad3_out:MovieClip;
public var sad4_out:MovieClip;
public var worried:MovieClip;
public var happy2_in:MovieClip;
public var help:MovieClip;
public var sad1_in:MovieClip;
public var happy1_in:MovieClip;
public var idle1:MovieClip;
public var idle2:MovieClip;
public var idle4:MovieClip;
public var worried3_in:MovieClip;
public var happy3_out:MovieClip;
public var sad:MovieClip;
public var sad4_in:MovieClip;
public var happy2_out:MovieClip;
public var intro:MovieClip;
public var idle3:MovieClip;
public var happy1_out:MovieClip;
public var idle5:MovieClip;
public var happy:MovieClip;
public function 1_opponent_states_141(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package briscolaMainGraphics_fla
Section 3
//happy1_in_186 (briscolaMainGraphics_fla.happy1_in_186)
package briscolaMainGraphics_fla {
import flash.display.*;
public dynamic class happy1_in_186 extends MovieClip {
public function happy1_in_186(){
addFrameScript(4, frame5);
}
function frame5(){
stop();
}
}
}//package briscolaMainGraphics_fla
Section 4
//happy1_out_187 (briscolaMainGraphics_fla.happy1_out_187)
package briscolaMainGraphics_fla {
import flash.display.*;
public dynamic class happy1_out_187 extends MovieClip {
public function happy1_out_187(){
addFrameScript(3, frame4);
}
function frame4(){
stop();
}
}
}//package briscolaMainGraphics_fla
Section 5
//happy2_in_188 (briscolaMainGraphics_fla.happy2_in_188)
package briscolaMainGraphics_fla {
import flash.display.*;
public dynamic class happy2_in_188 extends MovieClip {
public function happy2_in_188(){
addFrameScript(4, frame5);
}
function frame5(){
stop();
}
}
}//package briscolaMainGraphics_fla
Section 6
//happy2_out_189 (briscolaMainGraphics_fla.happy2_out_189)
package briscolaMainGraphics_fla {
import flash.display.*;
public dynamic class happy2_out_189 extends MovieClip {
public function happy2_out_189(){
addFrameScript(5, frame6);
}
function frame6(){
stop();
}
}
}//package briscolaMainGraphics_fla
Section 7
//happy3_in_190 (briscolaMainGraphics_fla.happy3_in_190)
package briscolaMainGraphics_fla {
import flash.display.*;
public dynamic class happy3_in_190 extends MovieClip {
public function happy3_in_190(){
addFrameScript(5, frame6);
}
function frame6(){
stop();
}
}
}//package briscolaMainGraphics_fla
Section 8
//happy3_out_191 (briscolaMainGraphics_fla.happy3_out_191)
package briscolaMainGraphics_fla {
import flash.display.*;
public dynamic class happy3_out_191 extends MovieClip {
public function happy3_out_191(){
addFrameScript(3, frame4);
}
function frame4(){
stop();
}
}
}//package briscolaMainGraphics_fla
Section 9
//info_button_76 (briscolaMainGraphics_fla.info_button_76)
package briscolaMainGraphics_fla {
import flash.display.*;
public dynamic class info_button_76 extends MovieClip {
public var icon:MovieClip;
public function info_button_76(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package briscolaMainGraphics_fla
Section 10
//sad1_in_216 (briscolaMainGraphics_fla.sad1_in_216)
package briscolaMainGraphics_fla {
import flash.display.*;
public dynamic class sad1_in_216 extends MovieClip {
public function sad1_in_216(){
addFrameScript(8, frame9);
}
function frame9(){
stop();
}
}
}//package briscolaMainGraphics_fla
Section 11
//sad1_out_217 (briscolaMainGraphics_fla.sad1_out_217)
package briscolaMainGraphics_fla {
import flash.display.*;
public dynamic class sad1_out_217 extends MovieClip {
public function sad1_out_217(){
addFrameScript(7, frame8);
}
function frame8(){
stop();
}
}
}//package briscolaMainGraphics_fla
Section 12
//sad2_in_218 (briscolaMainGraphics_fla.sad2_in_218)
package briscolaMainGraphics_fla {
import flash.display.*;
public dynamic class sad2_in_218 extends MovieClip {
public function sad2_in_218(){
addFrameScript(9, frame10);
}
function frame10(){
stop();
}
}
}//package briscolaMainGraphics_fla
Section 13
//sad2_out_219 (briscolaMainGraphics_fla.sad2_out_219)
package briscolaMainGraphics_fla {
import flash.display.*;
public dynamic class sad2_out_219 extends MovieClip {
public function sad2_out_219(){
addFrameScript(4, frame5);
}
function frame5(){
stop();
}
}
}//package briscolaMainGraphics_fla
Section 14
//sad3_in_220 (briscolaMainGraphics_fla.sad3_in_220)
package briscolaMainGraphics_fla {
import flash.display.*;
public dynamic class sad3_in_220 extends MovieClip {
public function sad3_in_220(){
addFrameScript(4, frame5);
}
function frame5(){
stop();
}
}
}//package briscolaMainGraphics_fla
Section 15
//sad3_out_221 (briscolaMainGraphics_fla.sad3_out_221)
package briscolaMainGraphics_fla {
import flash.display.*;
public dynamic class sad3_out_221 extends MovieClip {
public function sad3_out_221(){
addFrameScript(4, frame5);
}
function frame5(){
stop();
}
}
}//package briscolaMainGraphics_fla
Section 16
//sad4_in_222 (briscolaMainGraphics_fla.sad4_in_222)
package briscolaMainGraphics_fla {
import flash.display.*;
public dynamic class sad4_in_222 extends MovieClip {
public function sad4_in_222(){
addFrameScript(8, frame9);
}
function frame9(){
stop();
}
}
}//package briscolaMainGraphics_fla
Section 17
//sad4_out_223 (briscolaMainGraphics_fla.sad4_out_223)
package briscolaMainGraphics_fla {
import flash.display.*;
public dynamic class sad4_out_223 extends MovieClip {
public function sad4_out_223(){
addFrameScript(10, frame11);
}
function frame11(){
stop();
}
}
}//package briscolaMainGraphics_fla
Section 18
//Timeline_142 (briscolaMainGraphics_fla.Timeline_142)
package briscolaMainGraphics_fla {
import flash.display.*;
public dynamic class Timeline_142 extends MovieClip {
public function Timeline_142(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package briscolaMainGraphics_fla
Section 19
//Timeline_192 (briscolaMainGraphics_fla.Timeline_192)
package briscolaMainGraphics_fla {
import flash.display.*;
public dynamic class Timeline_192 extends MovieClip {
public function Timeline_192(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package briscolaMainGraphics_fla
Section 20
//Timeline_224 (briscolaMainGraphics_fla.Timeline_224)
package briscolaMainGraphics_fla {
import flash.display.*;
public dynamic class Timeline_224 extends MovieClip {
public function Timeline_224(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package briscolaMainGraphics_fla
Section 21
//Timeline_231 (briscolaMainGraphics_fla.Timeline_231)
package briscolaMainGraphics_fla {
import flash.display.*;
public dynamic class Timeline_231 extends MovieClip {
public var shadow:MovieClip;
public function Timeline_231(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package briscolaMainGraphics_fla
Section 22
//Timeline_232 (briscolaMainGraphics_fla.Timeline_232)
package briscolaMainGraphics_fla {
import flash.display.*;
public dynamic class Timeline_232 extends MovieClip {
public function Timeline_232(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package briscolaMainGraphics_fla
Section 23
//Timeline_233 (briscolaMainGraphics_fla.Timeline_233)
package briscolaMainGraphics_fla {
import flash.display.*;
public dynamic class Timeline_233 extends MovieClip {
public function Timeline_233(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package briscolaMainGraphics_fla
Section 24
//Timeline_234 (briscolaMainGraphics_fla.Timeline_234)
package briscolaMainGraphics_fla {
import flash.display.*;
public dynamic class Timeline_234 extends MovieClip {
public function Timeline_234(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package briscolaMainGraphics_fla
Section 25
//Timeline_239 (briscolaMainGraphics_fla.Timeline_239)
package briscolaMainGraphics_fla {
import flash.display.*;
public dynamic class Timeline_239 extends MovieClip {
public function Timeline_239(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package briscolaMainGraphics_fla
Section 26
//Timeline_245 (briscolaMainGraphics_fla.Timeline_245)
package briscolaMainGraphics_fla {
import flash.display.*;
public dynamic class Timeline_245 extends MovieClip {
public function Timeline_245(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package briscolaMainGraphics_fla
Section 27
//Timeline_248 (briscolaMainGraphics_fla.Timeline_248)
package briscolaMainGraphics_fla {
import flash.display.*;
public dynamic class Timeline_248 extends MovieClip {
public function Timeline_248(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package briscolaMainGraphics_fla
Section 28
//timer_118 (briscolaMainGraphics_fla.timer_118)
package briscolaMainGraphics_fla {
import flash.display.*;
public dynamic class timer_118 extends MovieClip {
public var sec1:MovieClip;
public var sec0:MovieClip;
public var pause:MovieClip;
public var min0:MovieClip;
public var min1:MovieClip;
public function timer_118(){
addFrameScript(0, frame1, 4, frame5);
}
function frame1(){
stop();
}
function frame5(){
stop();
}
}
}//package briscolaMainGraphics_fla
Section 29
//timer_digits_127 (briscolaMainGraphics_fla.timer_digits_127)
package briscolaMainGraphics_fla {
import flash.display.*;
public dynamic class timer_digits_127 extends MovieClip {
public function timer_digits_127(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package briscolaMainGraphics_fla
Section 30
//tjej_pratbubbla2_243 (briscolaMainGraphics_fla.tjej_pratbubbla2_243)
package briscolaMainGraphics_fla {
import flash.display.*;
public dynamic class tjej_pratbubbla2_243 extends MovieClip {
public var bubble:MovieClip;
public var opponent:MovieClip;
public function tjej_pratbubbla2_243(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package briscolaMainGraphics_fla
Section 31
//worried1_in_225 (briscolaMainGraphics_fla.worried1_in_225)
package briscolaMainGraphics_fla {
import flash.display.*;
public dynamic class worried1_in_225 extends MovieClip {
public function worried1_in_225(){
addFrameScript(3, frame4);
}
function frame4(){
stop();
}
}
}//package briscolaMainGraphics_fla
Section 32
//worried1_out_226 (briscolaMainGraphics_fla.worried1_out_226)
package briscolaMainGraphics_fla {
import flash.display.*;
public dynamic class worried1_out_226 extends MovieClip {
public function worried1_out_226(){
addFrameScript(3, frame4);
}
function frame4(){
stop();
}
}
}//package briscolaMainGraphics_fla
Section 33
//worried2_in_227 (briscolaMainGraphics_fla.worried2_in_227)
package briscolaMainGraphics_fla {
import flash.display.*;
public dynamic class worried2_in_227 extends MovieClip {
public function worried2_in_227(){
addFrameScript(3, frame4);
}
function frame4(){
stop();
}
}
}//package briscolaMainGraphics_fla
Section 34
//worried2_out_228 (briscolaMainGraphics_fla.worried2_out_228)
package briscolaMainGraphics_fla {
import flash.display.*;
public dynamic class worried2_out_228 extends MovieClip {
public function worried2_out_228(){
addFrameScript(6, frame7);
}
function frame7(){
stop();
}
}
}//package briscolaMainGraphics_fla
Section 35
//worried3_in_229 (briscolaMainGraphics_fla.worried3_in_229)
package briscolaMainGraphics_fla {
import flash.display.*;
public dynamic class worried3_in_229 extends MovieClip {
public function worried3_in_229(){
addFrameScript(3, frame4);
}
function frame4(){
stop();
}
}
}//package briscolaMainGraphics_fla
Section 36
//worried3_out_230 (briscolaMainGraphics_fla.worried3_out_230)
package briscolaMainGraphics_fla {
import flash.display.*;
public dynamic class worried3_out_230 extends MovieClip {
public function worried3_out_230(){
addFrameScript(6, frame7);
}
function frame7(){
stop();
}
}
}//package briscolaMainGraphics_fla
Section 37
//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 38
//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.gc)) && (_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;
}
public function remove(_arg1:TweenCore, _arg2:Boolean=false):void{
if (_arg1.gc){
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;
};
};
}
public function get rawTime():Number{
return (this.cachedTotalTime);
}
}
}//package com.greensock.core
Section 39
//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 timeline:SimpleTimeline;
public var data;
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.13;
protected static var _classInitted:Boolean;
public function TweenCore(_arg1:Number=0, _arg2:Object=null){
this.vars = ((_arg2) || ({}));
this.cachedDuration = (this.cachedTotalDuration = ((_arg1) || (0)));
_delay = ((this.vars.delay) || (0));
this.cachedTimeScale = ((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 get duration():Number{
return (this.cachedDuration);
}
public function restart(_arg1:Boolean=false, _arg2:Boolean=true):void{
this.reversed = false;
this.paused = false;
this.setTotalTime((_arg1) ? -(_delay) : 0, _arg2);
}
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 complete(_arg1:Boolean=false, _arg2:Boolean=false):void{
if (!_arg1){
renderTime(this.cachedTotalDuration, _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 invalidate():void{
}
public function get totalTime():Number{
return (this.cachedTotalTime);
}
public function get reversed():Boolean{
return (this.cachedReversed);
}
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{
if (_arg1){
this.active = Boolean(((((!(this.cachedPaused)) && ((this.cachedTotalTime > 0)))) && ((this.cachedTotalTime < this.cachedTotalDuration))));
if (((!(_arg2)) && (this.gc))){
this.timeline.addChild(this);
};
} else {
this.active = false;
if (!_arg2){
this.timeline.remove(this, true);
};
};
this.gc = !(_arg1);
return (false);
}
}
}//package com.greensock.core
Section 40
//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 41
//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 42
//BezierPlugin (com.greensock.plugins.BezierPlugin)
package com.greensock.plugins {
import com.greensock.*;
import com.greensock.core.*;
public class BezierPlugin extends TweenPlugin {
protected var _future:Object;
protected var _orient:Boolean;
protected var _orientData:Array;
protected var _target:Object;
protected var _beziers:Object;
public static const API:Number = 1;
protected static const _RAD2DEG:Number = 57.2957795130823;
public function BezierPlugin(){
_future = {};
super();
this.propName = "bezier";
this.overwriteProps = [];
}
override public function killProps(_arg1:Object):void{
var _local2:String;
for (_local2 in _beziers) {
if ((_local2 in _arg1)){
delete _beziers[_local2];
};
};
super.killProps(_arg1);
}
protected function init(_arg1:TweenLite, _arg2:Array, _arg3:Boolean):void{
var _local6:int;
var _local7:String;
var _local8:Object;
_target = _arg1.target;
var _local4:Object = ((_arg1.vars.isTV)==true) ? _arg1.vars.exposedVars : _arg1.vars;
if (_local4.orientToBezier == true){
_orientData = [["x", "y", "rotation", 0, 0.01]];
_orient = true;
} else {
if ((_local4.orientToBezier is Array)){
_orientData = _local4.orientToBezier;
_orient = true;
};
};
var _local5:Object = {};
_local6 = 0;
while (_local6 < _arg2.length) {
for (_local7 in _arg2[_local6]) {
if (_local5[_local7] == undefined){
_local5[_local7] = [_arg1.target[_local7]];
};
if (typeof(_arg2[_local6][_local7]) == "number"){
_local5[_local7].push(_arg2[_local6][_local7]);
} else {
_local5[_local7].push((_arg1.target[_local7] + Number(_arg2[_local6][_local7])));
};
};
_local6++;
};
for (_local7 in _local5) {
this.overwriteProps[this.overwriteProps.length] = _local7;
if (_local4[_local7] != undefined){
if (typeof(_local4[_local7]) == "number"){
_local5[_local7].push(_local4[_local7]);
} else {
_local5[_local7].push((_arg1.target[_local7] + Number(_local4[_local7])));
};
_local8 = {};
_local8[_local7] = true;
_arg1.killVars(_local8, false);
delete _local4[_local7];
};
};
_beziers = parseBeziers(_local5, _arg3);
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (!(_arg2 is Array)){
return (false);
};
init(_arg3, (_arg2 as Array), false);
return (true);
}
override public function set changeFactor(_arg1:Number):void{
var _local2:int;
var _local3:String;
var _local4:Object;
var _local5:Number;
var _local6:uint;
var _local7:Number;
var _local8:Object;
var _local9:Number;
var _local10:Number;
var _local11:Array;
var _local12:Number;
var _local13:Object;
var _local14:Boolean;
if (_arg1 == 1){
for (_local3 in _beziers) {
_local2 = (_beziers[_local3].length - 1);
_target[_local3] = _beziers[_local3][_local2][2];
};
} else {
for (_local3 in _beziers) {
_local6 = _beziers[_local3].length;
if (_arg1 < 0){
_local2 = 0;
} else {
if (_arg1 >= 1){
_local2 = (_local6 - 1);
} else {
_local2 = int((_local6 * _arg1));
};
};
_local5 = ((_arg1 - (_local2 * (1 / _local6))) * _local6);
_local4 = _beziers[_local3][_local2];
if (this.round){
_local7 = (_local4[0] + (_local5 * (((2 * (1 - _local5)) * (_local4[1] - _local4[0])) + (_local5 * (_local4[2] - _local4[0])))));
_target[_local3] = ((_local7)>0) ? int((_local7 + 0.5)) : int((_local7 - 0.5));
} else {
_target[_local3] = (_local4[0] + (_local5 * (((2 * (1 - _local5)) * (_local4[1] - _local4[0])) + (_local5 * (_local4[2] - _local4[0])))));
};
};
};
if (_orient){
_local2 = _orientData.length;
_local8 = {};
while (_local2--) {
_local11 = _orientData[_local2];
_local8[_local11[0]] = _target[_local11[0]];
_local8[_local11[1]] = _target[_local11[1]];
};
_local13 = _target;
_local14 = this.round;
_target = _future;
this.round = false;
_orient = false;
_local2 = _orientData.length;
while (_local2--) {
_local11 = _orientData[_local2];
this.changeFactor = (_arg1 + ((_local11[4]) || (0.01)));
_local12 = ((_local11[3]) || (0));
_local9 = (_future[_local11[0]] - _local8[_local11[0]]);
_local10 = (_future[_local11[1]] - _local8[_local11[1]]);
_local13[_local11[2]] = ((Math.atan2(_local10, _local9) * _RAD2DEG) + _local12);
};
_target = _local13;
this.round = _local14;
_orient = true;
};
}
public static function parseBeziers(_arg1:Object, _arg2:Boolean=false):Object{
var _local3:int;
var _local4:Array;
var _local5:Object;
var _local6:String;
var _local7:Object = {};
if (_arg2){
for (_local6 in _arg1) {
_local4 = _arg1[_local6];
_local5 = [];
_local7[_local6] = _local5;
if (_local4.length > 2){
_local5[_local5.length] = [_local4[0], (_local4[1] - ((_local4[2] - _local4[0]) / 4)), _local4[1]];
_local3 = 1;
while (_local3 < (_local4.length - 1)) {
_local5[_local5.length] = [_local4[_local3], (_local4[_local3] + (_local4[_local3] - _local5[(_local3 - 1)][1])), _local4[(_local3 + 1)]];
_local3++;
};
} else {
_local5[_local5.length] = [_local4[0], ((_local4[0] + _local4[1]) / 2), _local4[1]];
};
};
} else {
for (_local6 in _arg1) {
_local4 = _arg1[_local6];
_local5 = [];
_local7[_local6] = _local5;
if (_local4.length > 3){
_local5[_local5.length] = [_local4[0], _local4[1], ((_local4[1] + _local4[2]) / 2)];
_local3 = 2;
while (_local3 < (_local4.length - 2)) {
_local5[_local5.length] = [_local5[(_local3 - 2)][2], _local4[_local3], ((_local4[_local3] + _local4[(_local3 + 1)]) / 2)];
_local3++;
};
_local5[_local5.length] = [_local5[(_local5.length - 1)][2], _local4[(_local4.length - 2)], _local4[(_local4.length - 1)]];
} else {
if (_local4.length == 3){
_local5[_local5.length] = [_local4[0], _local4[1], _local4[2]];
} else {
if (_local4.length == 2){
_local5[_local5.length] = [_local4[0], ((_local4[0] + _local4[1]) / 2), _local4[1]];
};
};
};
};
};
return (_local7);
}
}
}//package com.greensock.plugins
Section 43
//TweenPlugin (com.greensock.plugins.TweenPlugin)
package com.greensock.plugins {
import com.greensock.*;
import com.greensock.core.*;
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 44
//TweenLite (com.greensock.TweenLite)
package com.greensock {
import flash.events.*;
import flash.display.*;
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.133;
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, 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)) && (("timeScale" in this.vars)))){
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 (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--) {
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){
_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):void{
var _local3:Array;
var _local4:int;
if ((_arg1 in masterList)){
_local3 = masterList[_arg1];
_local4 = _local3.length;
while (_local4--) {
if (!TweenLite(_local3[_local4]).gc){
if (_arg2){
TweenLite(_local3[_local4]).complete(false, false);
} else {
TweenLite(_local3[_local4]).setEnabled(false, false);
};
};
};
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--) {
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 45
//AvatarLoader (com.midasplayer.avatar.AvatarLoader)
package com.midasplayer.avatar {
import flash.events.*;
import flash.display.*;
import flash.net.*;
import flash.system.*;
import flash.external.*;
public class AvatarLoader {
private var path:String;
public var isMoneyGame:Boolean;
private var onError:Function;
private var local:Boolean;
private var loaderId:int;
private var onComplete:Function;
private var onLoadProgress:Function;
private var onPreloadProgress:Function;
public function AvatarLoader(_arg1:Boolean=true, _arg2:String=null){
var _local3:Object = (_arg1) ? null : ExternalInterface.call("isMoneyGame");
isMoneyGame = (_local3) ? (1 == _local3.message) : false;
this.local = _arg1;
this.path = (((_arg2) && (_arg2.length))) ? _arg2 : "AvatarManager.swf";
}
public function load(_arg1:Function, _arg2:Function=null, _arg3:Function=null, _arg4:Function=null):void{
this.onComplete = _arg1;
this.onError = _arg2;
this.onPreloadProgress = _arg3;
this.onLoadProgress = _arg4;
simpleLoad();
}
private function simpleLoad():void{
var avatarContext:LoaderContext = new LoaderContext();
avatarContext.applicationDomain = ApplicationDomain.currentDomain;
avatarContext.securityDomain = (local) ? null : SecurityDomain.currentDomain;
var urlReq:URLRequest = new URLRequest(path);
var avatarLoader:Loader = new Loader();
if (null != onError){
avatarLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, function (_arg1:IOErrorEvent):void{
onError(_arg1.text);
});
};
if (null != onLoadProgress){
avatarLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, function (_arg1:ProgressEvent):void{
onLoadProgress(_arg1.bytesLoaded, _arg1.bytesTotal);
});
};
avatarLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);
avatarLoader.load(urlReq, avatarContext);
}
private function moneyLoad():void{
ExternalInterface.addCallback("onSwfProgress", onSwfProgress);
var _local1:Object = ExternalInterface.call("preloadSwf", path);
if (_local1 != null){
loaderId = _local1.message;
};
}
public function onSwfProgress(_arg1:int, _arg2:int, _arg3:String):void{
if (_arg2 == 100){
path = _arg3;
simpleLoad();
} else {
if ((((0 <= _arg2)) && (!((null == onPreloadProgress))))){
onPreloadProgress(_arg2, 100);
} else {
if ((((0 > _arg2)) && (!((null == onError))))){
onError(("Preload error #" + _arg2));
};
};
};
}
}
}//package com.midasplayer.avatar
Section 46
//Debug (com.midasplayer.debug.Debug)
package com.midasplayer.debug {
public class Debug {
private static var s_assertHandler:IAssertHandler = null;
public static function setAssertHandler(_arg1:IAssertHandler):void{
s_assertHandler = _arg1;
}
public static function assert(_arg1:Boolean, _arg2:String):void{
var condition = _arg1;
var message = _arg2;
if (condition){
return;
};
if (s_assertHandler != null){
s_assertHandler.assert(message);
return;
};
try {
throw (new Error("StackTrace"));
} catch(e:Error) {
trace(((("Assertion failed: " + message) + "\n") + e.getStackTrace()));
};
}
}
}//package com.midasplayer.debug
Section 47
//FPSGraph (com.midasplayer.debug.FPSGraph)
package com.midasplayer.debug {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.utils.*;
public class FPSGraph extends Sprite {
private var _resetTxt:TextField;
private var _container:Sprite;
private var _numPoints:int;
private var _maxFps:int;
private var _samplePoints:int;// = 0
private var _isReset:Boolean;
private var _currentFpsTxt:TextField;
private var _fpsRoof:int;
private var _newMin:Boolean;
private var _minFpsTxt:TextField;
private var _avarageFpsTxt:TextField;
private var _newMax:Boolean;
private var _maxFpsTxt:TextField;
private var _updateInterval:int;
private var _graph:Shape;
private var _oldTime:int;
private var _minFps:int;
private var _currentCounter:int;// = 0
private var _bg:Shape;
private var _resetBtn:Sprite;
private var _graphMatrix:Matrix;
private var _isUpdate:Boolean;// = false
private var _totalFps:int;// = 0
private var _yPoints:Array;
public function FPSGraph(_arg1:int=150){
_fpsRoof = _arg1;
_container = new Sprite();
addChild(_container);
_bg = new Shape();
_bg.graphics.beginFill(0);
_bg.graphics.drawRect(0, 0, 220, 120);
_bg.graphics.endFill();
_numPoints = 170;
_container.addChild(_bg);
_graph = new Shape();
_container.addChild(_graph);
_yPoints = [];
_minFpsTxt = new TextField();
_container.addChild(_minFpsTxt);
_minFpsTxt.text = ("min: " + _minFps);
_minFpsTxt.textColor = 0xFF00;
_minFpsTxt.height = 20;
_minFpsTxt.width = 50;
_minFpsTxt.x = 170;
_minFpsTxt.y = 0;
_minFpsTxt.border = true;
_minFpsTxt.borderColor = 0xFF00;
_maxFpsTxt = new TextField();
_container.addChild(_maxFpsTxt);
_maxFpsTxt.text = ("max: " + _maxFps);
_maxFpsTxt.textColor = 0xFF00;
_maxFpsTxt.height = 20;
_maxFpsTxt.width = 50;
_maxFpsTxt.x = 170;
_maxFpsTxt.y = 25;
_maxFpsTxt.border = true;
_maxFpsTxt.borderColor = 0xFF00;
_avarageFpsTxt = new TextField();
_container.addChild(_avarageFpsTxt);
_avarageFpsTxt.text = ("av.: " + _maxFps);
_avarageFpsTxt.textColor = 0xFF00;
_avarageFpsTxt.height = 20;
_avarageFpsTxt.width = 50;
_avarageFpsTxt.x = 170;
_avarageFpsTxt.y = 50;
_avarageFpsTxt.border = true;
_avarageFpsTxt.borderColor = 0xFF00;
_currentFpsTxt = new TextField();
_container.addChild(_currentFpsTxt);
_currentFpsTxt.text = ("curr.: " + _maxFps);
_currentFpsTxt.textColor = 0xFF00;
_currentFpsTxt.height = 20;
_currentFpsTxt.width = 50;
_currentFpsTxt.x = 170;
_currentFpsTxt.y = 75;
_currentFpsTxt.border = true;
_currentFpsTxt.borderColor = 0xFF00;
_resetTxt = new TextField();
_container.addChild(_resetTxt);
_resetTxt.text = " reset";
_resetTxt.textColor = 0xFFFF00;
_resetTxt.height = 20;
_resetTxt.width = 50;
_resetTxt.x = 170;
_resetTxt.y = 100;
_resetTxt.border = true;
_resetTxt.borderColor = 0xFFFF00;
_resetBtn = new Sprite();
_resetBtn.graphics.beginFill(0, 0);
_resetBtn.graphics.drawRect(0, 0, 50, 20);
_resetBtn.graphics.endFill();
_resetBtn.x = _resetTxt.x;
_resetBtn.y = _resetTxt.y;
_container.addChild(_resetBtn);
_graphMatrix = new Matrix();
_graphMatrix.createGradientBox(140, _bg.height, (Math.PI / 2));
}
private function _drawGraph(_arg1:int):void{
var _local5:int;
if (_yPoints.length == _numPoints){
_yPoints.shift();
};
var _local2:int = (_bg.height - ((_arg1 / _fpsRoof) * _bg.height));
_yPoints.push(_local2);
var _local3:int = int(_yPoints[0]);
_graph.graphics.clear();
_graph.graphics.beginGradientFill(GradientType.LINEAR, [0xFF00, 0xFF0000], [1, 1], [100, 0xFF], _graphMatrix);
_graph.graphics.moveTo(0, _local3);
var _local4:int;
for each (_local5 in _yPoints) {
_graph.graphics.lineTo(_local4, _local5);
_local4++;
};
_graph.graphics.lineTo(_local4, _bg.height);
_graph.graphics.lineTo(0, _bg.height);
_graph.graphics.lineTo(0, _local3);
_graph.graphics.endFill();
if (_currentCounter == 3){
_currentFpsTxt.text = ("curr:. " + _arg1);
_currentCounter = 0;
} else {
_currentCounter++;
};
if (_newMax){
_maxFpsTxt.text = ("max: " + _maxFps);
_newMax = false;
};
if (_newMin){
_minFpsTxt.text = ("min: " + _minFps);
_newMin = false;
};
_avarageFpsTxt.text = ("av.: " + Math.round((_totalFps / _samplePoints)));
}
private function _onResetClick(_arg1:MouseEvent):void{
_isReset = true;
}
public function startMonitor():void{
_oldTime = getTimer();
_currentCounter = 0;
_isReset = true;
this.addEventListener(Event.ENTER_FRAME, _onUpdate, false, 0, true);
_resetBtn.addEventListener(MouseEvent.CLICK, _onResetClick, false, 0, true);
}
private function _getFPS():int{
var _local1:int = getTimer();
var _local2:int = (_local1 - _oldTime);
_oldTime = _local1;
var _local3:int = ((1000 / _local2) * 2);
if ((((_local3 > _maxFps)) || (_isReset))){
_maxFps = _local3;
_newMax = true;
};
if ((((_local3 < _minFps)) || (_isReset))){
_minFps = _local3;
_newMin = true;
};
if (_isReset){
_totalFps = 0;
_samplePoints = 0;
_isReset = false;
};
_totalFps = (_totalFps + _local3);
_samplePoints++;
return (_local3);
}
private function _onUpdate(_arg1:Event):void{
if (_isUpdate){
_drawGraph(_getFPS());
};
_isUpdate = !(_isUpdate);
}
public function stopMonitor():void{
this.removeEventListener(Event.ENTER_FRAME, _onUpdate);
_resetBtn.removeEventListener(MouseEvent.CLICK, _onResetClick);
}
}
}//package com.midasplayer.debug
Section 48
//IAssertHandler (com.midasplayer.debug.IAssertHandler)
package com.midasplayer.debug {
public interface IAssertHandler {
function assert(_arg1:String):void;
}
}//package com.midasplayer.debug
Section 49
//DebugGameComm (com.midasplayer.game.comm.DebugGameComm)
package com.midasplayer.game.comm {
import com.midasplayer.debug.*;
import flash.utils.*;
public class DebugGameComm implements IGameComm {
private var traceExternalCalls:Boolean;
private var currentState:int;// = 0
private var queue:Array;
private var endedTime:Number;
private var playDataEntries:Array;
private var gameData:String;
private static const STARTED:uint = 1;
private static const NOT_STARTED:uint = 0;
private static const ENDED:uint = 2;
private static const QUIT:uint = 3;
public function DebugGameComm(_arg1:String, _arg2:Boolean=true){
queue = new Array();
playDataEntries = new Array();
super();
gameData = _arg1;
this.traceExternalCalls = _arg2;
}
public function getGameData():String{
return (gameData);
}
public function gameEnd(_arg1:uint):void{
Debug.assert((currentState == STARTED), "Trying to end a game that is not in the started state.");
if (STARTED != currentState){
return;
};
if (traceExternalCalls){
trace("gameEnd", _arg1);
};
endedTime = new Date().getTime();
currentState = ENDED;
}
private function quit():void{
if (traceExternalCalls){
trace("gameQuit");
};
}
public function gameStart():void{
Debug.assert((currentState == NOT_STARTED), "Trying to start the game when it's already started.");
if (NOT_STARTED != currentState){
return;
};
if (traceExternalCalls){
trace("gameStart");
};
currentState = STARTED;
while (queue.length) {
addPlayData(queue.shift());
};
}
public function get state():int{
return (currentState);
}
public function gameQuit():void{
Debug.assert((currentState == ENDED), "Trying to quit the game before it has been ended.");
if (QUIT == currentState){
return;
};
switch (currentState){
case NOT_STARTED:
gameStart();
case STARTED:
gameEnd(0);
};
var _local1:Number = (2000 - (new Date().getTime() - endedTime));
if (0 < _local1){
setTimeout(quit, _local1);
} else {
quit();
};
currentState = QUIT;
}
public function enqueuePlayData(_arg1:String):void{
switch (currentState){
case NOT_STARTED:
queue.push(_arg1);
break;
case STARTED:
addPlayData(_arg1);
break;
};
}
public function get playData():Array{
return (playDataEntries);
}
public function addPlayData(_arg1:String):void{
Debug.assert(!((currentState == NOT_STARTED)), "Trying to add playdata before the game has been started.");
Debug.assert(!((_arg1 == null)), "Trying to add a playdata that is null.");
if (STARTED != currentState){
return;
};
if (traceExternalCalls){
trace("playData", _arg1);
};
playDataEntries.push(_arg1);
}
}
}//package com.midasplayer.game.comm
Section 50
//GameComm (com.midasplayer.game.comm.GameComm)
package com.midasplayer.game.comm {
import com.midasplayer.debug.*;
import flash.utils.*;
import flash.system.*;
import flash.external.*;
public class GameComm implements IGameComm {
private var endedTime:Number;
private var queue:Array;
private var currentState:int;// = 0
private static const STARTED:uint = 1;
private static const NOT_STARTED:uint = 0;
private static const ENDED:uint = 2;
private static const QUIT:uint = 3;
public function GameComm(){
queue = new Array();
super();
}
public function gameQuit():void{
Debug.assert((currentState == ENDED), "Trying to quit the game before it has been ended.");
if (QUIT == currentState){
return;
};
switch (currentState){
case NOT_STARTED:
gameStart();
case STARTED:
gameEnd(0);
};
var _local1:Number = (2000 - (new Date().getTime() - endedTime));
if (0 < _local1){
setTimeout(quit, _local1);
} else {
quit();
};
currentState = QUIT;
}
public function gameStart():void{
Debug.assert((currentState == NOT_STARTED), "Trying to start the game when it's already started.");
if (NOT_STARTED != currentState){
return;
};
fscommand("gameStart", "");
currentState = STARTED;
while (queue.length) {
addPlayData(queue.shift());
};
}
public function gameEnd(_arg1:uint):void{
Debug.assert((currentState == STARTED), "Trying to end a game that is not in the started state.");
if (STARTED != currentState){
return;
};
fscommand("gameEnd", ("" + _arg1));
endedTime = new Date().getTime();
currentState = ENDED;
}
public function enqueuePlayData(_arg1:String):void{
switch (currentState){
case NOT_STARTED:
queue.push(_arg1);
break;
case STARTED:
addPlayData(_arg1);
break;
};
}
private function quit():void{
fscommand("gameQuit", "");
}
public function getGameData():String{
var _local1:Object = ExternalInterface.call("getGameData");
if (_local1 == null){
throw (new Error("The getGameData external interface call returned null."));
};
if (_local1.success == false){
throw (new Error("The getGameData returned object is not success."));
};
if (_local1.message == null){
throw (new Error("The GameData returned object has a null message."));
};
return (_local1.message);
}
public function addPlayData(_arg1:String):void{
Debug.assert(!((currentState == NOT_STARTED)), "Trying to add playdata before the game has been started.");
Debug.assert(!((_arg1 == null)), "Trying to add a playdata that is null.");
if (STARTED != currentState){
return;
};
ExternalInterface.call("playData", _arg1);
}
}
}//package com.midasplayer.game.comm
Section 51
//GameDataParser (com.midasplayer.game.comm.GameDataParser)
package com.midasplayer.game.comm {
import com.midasplayer.debug.*;
public class GameDataParser {
private var _seed:int;// = 0
private var _textElements:XMLList;
private var _gameData:XML;
public function GameDataParser(_arg1:String){
Debug.assert(!((_arg1 == null)), "Could not parse the game data, the xml parameter is null.");
_gameData = new XML(_arg1);
Debug.assert((_gameData.length() == 1), "The game data XML should only have 1 root child.");
_seed = parseInt(_gameData.attribute("randomseed"));
Debug.assert(!((_seed == 0)), "The game data randomseed attribute is 0, this may result in complete randomness.");
_textElements = _gameData.child("text");
}
public function getText(_arg1:String):String{
var texts:XMLList;
var id = _arg1;
texts = _textElements.(@id == id);
Debug.assert((texts.length() == 1), (("Could not find the text element (or found more than 1) with attribute id '" + id) + "' in the game data."));
return (texts.text());
}
public function getElementTextAsInt(_arg1:String):int{
var _local2:XMLList;
_local2 = _getOneElement(_arg1);
var _local3:Number = parseInt(_local2.text());
Debug.assert(!(isNaN(_local3)), ((("Could not parse a game data property as int '" + _arg1) + "' value: ") + _local2.text()));
return (int(_local3));
}
private function _getOneElement(_arg1:String):XMLList{
var _local2:XMLList = _gameData.child(_arg1);
Debug.assert((_local2.length() == 1), (("Could not find the element (or found more than 1) with the name '" + _arg1) + "' in the game data."));
return (_local2);
}
public function getElementTextAsBool(_arg1:String):Boolean{
var _local2:String = getElementTextAsString(_arg1).toLowerCase();
Debug.assert((((((((_local2 == "0")) || ((_local2 == "1")))) || ((_local2 == "false")))) || ((_local2 == "true"))), ((("Could not parse a boolean, the value should be 'true', 'false', '0' or '1'. Element: " + _arg1) + ", value: ") + _local2));
return ((((_local2 == "true")) || ((_local2 == "1"))));
}
public function get randomSeed():int{
return (_seed);
}
public function getElementTextAsString(_arg1:String):String{
return (_getOneElement(_arg1).text());
}
}
}//package com.midasplayer.game.comm
Section 52
//IGameComm (com.midasplayer.game.comm.IGameComm)
package com.midasplayer.game.comm {
public interface IGameComm {
function gameStart():void;
function gameQuit():void;
function getGameData():String;
function enqueuePlayData(_arg1:String):void;
function gameEnd(_arg1:uint):void;
function addPlayData(_arg1:String):void;
}
}//package com.midasplayer.game.comm
Section 53
//AnimatedPointsCounter (com.midasplayer.games.briscola.AnimatedPointsCounter)
package com.midasplayer.games.briscola {
import flash.display.*;
import flash.text.*;
import com.greensock.*;
public class AnimatedPointsCounter {
private var _ticker:Number;// = 0
private var activeFrame:int;
private var inFrame:int;
private var inactiveFrame:int;
private var anim:Animation;
private var field:TextField;
private var currentPoints:int;// = 0
private var outFrame:int;
public function AnimatedPointsCounter(_arg1:MovieClip, _arg2:TextField){
var _local3:FrameLabel;
super();
anim = new Animation(_arg1);
this.field = _arg2;
for each (_local3 in _arg1.currentLabels) {
switch (_local3.name){
case "in":
inFrame = _local3.frame;
break;
case "active":
activeFrame = _local3.frame;
break;
case "out":
outFrame = _local3.frame;
break;
case "inactive":
inactiveFrame = _local3.frame;
break;
};
};
}
public function setPoints(_arg1:int, _arg2:Number):void{
var points = _arg1;
var duration = _arg2;
anim.stopAnim(true);
anim.stopAnim(true);
currentPoints = (currentPoints + points);
ticker = points;
anim.animate(inFrame, activeFrame, 0, false, function ():void{
anim.animate(outFrame, inactiveFrame, (duration - (((activeFrame - inFrame) + (inactiveFrame - outFrame)) / 32)));
});
}
public function addPoints(_arg1:int, _arg2:Number):void{
var self:AnimatedPointsCounter;
var points = _arg1;
var duration = _arg2;
anim.stopAnim(true);
TweenLite.killTweensOf(this, true);
currentPoints = (currentPoints + points);
self = this;
anim.animate(inFrame, activeFrame, 0, false, function ():void{
TweenLite.to(self, (duration - (((activeFrame - inFrame) + (inactiveFrame - outFrame)) / 32)), {ticker:currentPoints, onComplete:function ():void{
anim.animate(outFrame, inactiveFrame);
}});
});
}
public function get ticker():Number{
return (_ticker);
}
public function set ticker(_arg1:Number):void{
_ticker = _arg1;
field.text = Math.floor(_arg1).toString();
}
}
}//package com.midasplayer.games.briscola
Section 54
//Animation (com.midasplayer.games.briscola.Animation)
package com.midasplayer.games.briscola {
import flash.display.*;
import com.greensock.*;
import com.greensock.easing.*;
public class Animation {
public var clip:MovieClip;
private var endFrame:uint;
private var _currentFrame:uint;// = 1
private var onComplete:Function;
private var onCompleteParams:Array;
private static const CLIP_FPS:uint = 32;
public function Animation(_arg1:MovieClip){
this.clip = _arg1;
_arg1.stop();
_currentFrame = _arg1.currentFrame;
}
public function animate(_arg1:uint, _arg2:uint, _arg3:Number=0, _arg4:Boolean=false, _arg5:Function=null, _arg6:Array=null):void{
stopAnim(false);
currentFrame = _arg1;
endFrame = _arg2;
this.onComplete = _arg5;
this.onCompleteParams = _arg6;
var _local7:Number = ((_arg1 < _arg2)) ? ((_arg2 - _arg1) + 1) : ((_arg1 - _arg2) + 1);
if (_arg4){
if (_arg3){
TweenLite.to(this, (_local7 / CLIP_FPS), {currentFrame:_arg2, delay:_arg3, ease:Linear.easeNone, onComplete:animate, onCompleteParams:[_arg1, _arg2, 0, true]});
} else {
TweenLite.to(this, (_local7 / CLIP_FPS), {currentFrame:_arg2, ease:Linear.easeNone, onComplete:animate, onCompleteParams:[_arg1, _arg2, 0, true]});
};
} else {
if (_arg3){
TweenLite.to(this, (_local7 / CLIP_FPS), {currentFrame:_arg2, delay:_arg3, ease:Linear.easeNone, onComplete:stopAnim, onCompleteParams:[true]});
} else {
TweenLite.to(this, (_local7 / CLIP_FPS), {currentFrame:_arg2, ease:Linear.easeNone, onComplete:stopAnim, onCompleteParams:[true]});
};
};
}
public function goto(_arg1:String):void{
clip.gotoAndStop(_arg1);
_currentFrame = clip.currentFrame;
}
public function animateLoop(_arg1:uint, _arg2:uint, _arg3:uint, _arg4:uint, _arg5:Number, _arg6:Function=null, _arg7:Array=null):void{
stopAnim(false);
currentFrame = _arg1;
endFrame = _arg4;
this.onComplete = _arg6;
this.onCompleteParams = _arg7;
var _local8:Number = ((_arg1 < _arg2)) ? ((_arg2 - _arg1) + 1) : ((_arg1 - _arg2) + 1);
if (_arg5){
TweenLite.to(this, (_local8 / CLIP_FPS), {currentFrame:_arg2, delay:_arg5, ease:Linear.easeNone, onComplete:animate, onCompleteParams:[_arg3, _arg4, 0, true]});
} else {
TweenLite.to(this, (_local8 / CLIP_FPS), {currentFrame:_arg2, ease:Linear.easeNone, onComplete:animate, onCompleteParams:[_arg3, _arg4, 0, true]});
};
}
public function set currentFrame(_arg1:uint):void{
if (_arg1 != clip.currentFrame){
clip.gotoAndStop(_arg1);
};
_currentFrame = _arg1;
}
public function animateBounce(_arg1:uint, _arg2:uint, _arg3:Number=0, _arg4:Function=null, _arg5:Array=null):void{
stopAnim(false);
currentFrame = _arg1;
endFrame = _arg2;
this.onComplete = _arg4;
this.onCompleteParams = _arg5;
var _local6:Number = ((_arg1 < _arg2)) ? ((_arg2 - _arg1) + 1) : ((_arg1 - _arg2) + 1);
if (_arg3){
TweenLite.to(this, (_local6 / CLIP_FPS), {currentFrame:_arg2, delay:_arg3, ease:Linear.easeNone, onComplete:animBounceBackward, onCompleteParams:[_arg1, _arg2, _local6]});
} else {
TweenLite.to(this, (_local6 / CLIP_FPS), {currentFrame:_arg2, ease:Linear.easeNone, onComplete:animBounceBackward, onCompleteParams:[_arg1, _arg2, _local6]});
};
}
private function animBounceBackward(_arg1:uint, _arg2:uint, _arg3:Number):void{
TweenLite.to(this, (_arg3 / CLIP_FPS), {currentFrame:_arg1, ease:Linear.easeNone, onComplete:animBounceForward, onCompleteParams:[_arg1, _arg2, _arg3]});
}
private function animBounceForward(_arg1:uint, _arg2:uint, _arg3:Number):void{
TweenLite.to(this, (_arg3 / CLIP_FPS), {currentFrame:_arg2, ease:Linear.easeNone, onComplete:animBounceBackward, onCompleteParams:[_arg1, _arg2, _arg3]});
}
public function get currentFrame():uint{
return (_currentFrame);
}
public function stopAnim(_arg1:Boolean):void{
TweenLite.killTweensOf(this, false);
if (_arg1){
currentFrame = endFrame;
if (null != onComplete){
onComplete.apply(this, onCompleteParams);
};
};
}
}
}//package com.midasplayer.games.briscola
Section 55
//BigButton (com.midasplayer.games.briscola.BigButton)
package com.midasplayer.games.briscola {
import flash.events.*;
import flash.display.*;
public class BigButton {
private var _pressed:Boolean;
private var anim:Animation;
private static const MOUSE_PRESS:uint = 10;
private static const MOUSE_OVER_END:uint = 9;
private static const INACTIVE:uint = 21;
private static const MOUSE_OUT_END:uint = 21;
private static const MOUSE_OVER_START:uint = 1;
private static const MOUSE_OUT_START:uint = 18;
private static const MOUSE_RELEASE_END:uint = 21;
private static const MOUSE_RELEASE_START:uint = 11;
public function BigButton(_arg1:MovieClip, _arg2:String, _arg3:String){
anim = new Animation(_arg1);
anim.goto("inactive");
anim.clip.mouseChildren = false;
anim.clip.textClip.mouseEnabled = false;
anim.clip.textClip.mouseChildren = false;
anim.clip.textClip.topField.text = _arg2;
anim.clip.textClip.bottomField.text = _arg3;
deactivate();
}
public function press():void{
_pressed = true;
}
public function set visible(_arg1:Boolean):void{
anim.clip.visible = _arg1;
}
public function mouseDown(_arg1:Event):void{
anim.stopAnim(false);
anim.currentFrame = MOUSE_PRESS;
}
public function get pressed():Boolean{
return (_pressed);
}
public function mouseOut(_arg1:Event):void{
anim.animate(MOUSE_OUT_START, MOUSE_OUT_END);
}
public function get visible():Boolean{
return (anim.clip.visible);
}
public function activate():void{
anim.clip.mouseEnabled = true;
anim.clip.addEventListener(MouseEvent.MOUSE_OVER, mouseOver);
anim.clip.addEventListener(MouseEvent.MOUSE_OUT, mouseOut);
anim.clip.addEventListener(MouseEvent.MOUSE_DOWN, mouseDown);
anim.clip.addEventListener(MouseEvent.CLICK, mouseClick);
}
public function deactivate():void{
anim.clip.mouseEnabled = false;
anim.clip.removeEventListener(MouseEvent.MOUSE_OVER, mouseOver);
anim.clip.removeEventListener(MouseEvent.MOUSE_OUT, mouseOut);
anim.clip.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDown);
anim.clip.removeEventListener(MouseEvent.CLICK, mouseClick);
}
public function mouseOver(_arg1:Event):void{
anim.animate(MOUSE_OVER_START, MOUSE_OVER_END);
}
public function mouseClick(_arg1:Event):void{
MainView.objectClicked = true;
_pressed = true;
deactivate();
anim.animate(MOUSE_RELEASE_START, MOUSE_RELEASE_END);
}
}
}//package com.midasplayer.games.briscola
Section 56
//BriscolaEvent (com.midasplayer.games.briscola.BriscolaEvent)
package com.midasplayer.games.briscola {
import flash.events.*;
import com.midasplayer.util.*;
public dynamic class BriscolaEvent extends Event {
public static const PLAYING_CARD_IID:int = 7;
public static const TIMELIMIT_HIT_IID:int = 11;
public static const MESSAGE:String = "message";
public static const ENDING_GAME:String = "endingGame";
public static const STARTING_GAME:String = "startingGame";
public static const USER_SETTINGS:String = "userSettings";
public static const DEALING_CARDS:String = "dealingCards";
public static const COUNTDOWN_UPDATE_IID:int = 10;
public static const PLAYING_CARD:String = "playingCard";
public static const TIMELIMIT_HIT:String = "timelimitHit";
public static const NEW_GAME_IID:int = 0;
public static const COUNTDOWN_UPDATE:String = "countdownUpdate";
public static const QUIT_GAME_IID:int = 2;
public static const ENDING_FIRST_TIME_HELP_IID:int = 5;
public static const ENTERING_PLAYER_TURN_IID:int = 4;
public static const CAPTURING_CARDS_IID:int = 8;
public static const MAKE_PLAY_IID:int = 6;
public static const MESSAGE_IID:int = 13;
public static const NEW_GAME:String = "newGame";
public static const QUIT_GAME:String = "quitGame";
public static const MAKE_PLAY:String = "makePlay";
public static const ENTERING_PLAYER_TURN:String = "enteringPlayerTurn";
public static const CAPTURING_CARDS:String = "capturingCards";
public static const ENDING_GAME_IID:int = 3;
public static const STARTING_GAME_IID:int = 1;
public static const ENDING_FIRST_TIME_HELP:String = "endingFirstTimeHelp";
public static const USER_SETTINGS_IID:int = 12;
public static const DEALING_CARDS_IID:int = 9;
public function BriscolaEvent(_arg1:String, _arg2:Object=null){
var _local3:String;
super(_arg1);
if (_arg2){
for (_local3 in _arg2) {
this[_local3] = _arg2[_local3];
};
};
}
public function toPlayData():String{
switch (type){
case _slot1.NEW_GAME:
return (toStringList(NEW_GAME_IID, this.onTick, this.player));
case _slot1.STARTING_GAME:
return (toStringList(STARTING_GAME_IID, this.onTick, 0, this.timelimit));
case _slot1.QUIT_GAME:
return (toStringList(QUIT_GAME_IID, this.onTick, this.player));
case _slot1.ENDING_GAME:
return (toStringList(ENDING_GAME_IID, this.onTick, this.cause, this.points0, this.points1, this.winner, this.score, this.bonus));
case _slot1.ENTERING_PLAYER_TURN:
return (toStringList(ENTERING_PLAYER_TURN_IID, this.onTick, this.player, (this.help) ? 1 : 0));
case _slot1.ENDING_FIRST_TIME_HELP:
return (toStringList(ENDING_FIRST_TIME_HELP_IID, this.onTick));
case _slot1.MAKE_PLAY:
return (toStringList(MAKE_PLAY_IID, this.onTick, this.player, this.index));
case _slot1.PLAYING_CARD:
return (toStringList(PLAYING_CARD_IID, this.onTick, this.player, this.index));
case _slot1.CAPTURING_CARDS:
return (toStringList(CAPTURING_CARDS_IID, this.onTick, this.player, this.points));
case _slot1.DEALING_CARDS:
return (toStringList(DEALING_CARDS_IID, this.onTick));
case _slot1.COUNTDOWN_UPDATE:
return (toStringList(DEALING_CARDS_IID, this.onTick, this.remaining));
case _slot1.TIMELIMIT_HIT:
return (toStringList(TIMELIMIT_HIT_IID, this.onTick));
case _slot1.USER_SETTINGS:
return (toStringList(USER_SETTINGS_IID, this.sound, this.music, this.firstGame));
case _slot1.MESSAGE:
return (toStringList(MESSAGE_IID, this.message));
default:
Assert.halt("The event type is unrecognized.");
return (null);
};
}
private function toStringList(... _args):String{
var _local2:String = _args[0].toString();
var _local3 = 1;
while (_local3 < _args.length) {
_local2 = (_local2 + (" " + _args[_local3].toString()));
_local3++;
};
return (_local2);
}
public static function messagePlayData(_arg1:String):String{
return (new BriscolaEvent(_slot1.MESSAGE, {message:_arg1}).toPlayData());
}
}
}//package com.midasplayer.games.briscola
Section 57
//Card (com.midasplayer.games.briscola.Card)
package com.midasplayer.games.briscola {
import com.midasplayer.util.*;
public class Card {
public var rank:uint;
public var suit:uint;
public var faceUp:Boolean;
public static const RANK_KNIGHT:uint = 9;
public static const RANK_DEUCE:uint = 2;
public static const SUIT_SWORDS:uint = 1;
public static const RANK_KING:uint = 10;
public static const RANK_ACE:uint = 1;
public static const RANK_FOUR:uint = 4;
public static const RANK_KNAVE:uint = 8;
public static const RANK_SEVEN:uint = 7;
public static const RANK_FIVE:uint = 5;
public static const SUIT_CUPS:uint = 2;
public static const SUIT_CLUBS:uint = 3;
public static const briscolaRanks:Array = [0, 12, 2, 11, 4, 5, 6, 7, 8, 9, 10];
public static const briscolaPoints:Array = [0, 11, 0, 10, 0, 0, 0, 0, 2, 3, 4];
public static const SUIT_COINS:uint = 0;
public static const RANK_SIX:uint = 6;
public static const RANK_THREE:uint = 3;
public function Card(_arg1:uint, _arg2:uint, _arg3:Boolean=false){
Assert.assert((_arg1 <= SUIT_CLUBS), "Suit value for new card is out of bounds.");
Assert.assert((((_arg2 >= RANK_ACE)) && ((_arg2 <= RANK_KING))), "Rank value for new card is out of bounds.");
this.suit = _arg1;
this.rank = _arg2;
this.faceUp = _arg3;
}
public function flip():void{
faceUp = !(faceUp);
}
public static function briscolaRankCompare(_arg1:Card, _arg2:Card):int{
return ((briscolaRanks[_arg1.rank] - briscolaRanks[_arg2.rank]));
}
}
}//package com.midasplayer.games.briscola
Section 58
//CardGraphics (com.midasplayer.games.briscola.CardGraphics)
package com.midasplayer.games.briscola {
import flash.display.*;
public dynamic class CardGraphics extends MovieClip {
public var symbol:MovieClip;
}
}//package com.midasplayer.games.briscola
Section 59
//Clock (com.midasplayer.games.briscola.Clock)
package com.midasplayer.games.briscola {
import flash.display.*;
public class Clock {
private var sec1:MovieClip;
private var sec0:MovieClip;
private var anim:Animation;
private var _time:uint;
private var pause:MovieClip;
private var lastSec:int;// = -1
private var min0:MovieClip;
private var min1:MovieClip;
public function Clock(_arg1:MovieClip, _arg2:uint=0, _arg3:Boolean=true){
anim = new Animation(_arg1);
pause = anim.clip.pause;
sec0 = anim.clip.sec0;
sec1 = anim.clip.sec1;
min0 = anim.clip.min0;
min1 = anim.clip.min1;
this.time = _arg2;
pause.visible = _arg3;
anim.goto("inactive");
anim.clip.mouseEnabled = false;
anim.clip.mouseChildren = false;
}
public function set time(_arg1:uint):void{
var _local2:uint;
var _local3:uint;
var _local4:uint;
_time = _arg1;
if (time == 0){
sec0.gotoAndStop(10);
sec1.gotoAndStop(10);
min0.gotoAndStop(10);
min1.gotoAndStop(10);
} else {
_local2 = Math.floor(_arg1);
if (lastSec != _local2){
if (10 >= _local2){
anim.animate(1, 5);
};
_local3 = (_local2 / 60);
_local2 = (_local2 - (_local3 * 60));
_local4 = (_local3 % 10);
min0.gotoAndStop(((_local4 == 0)) ? 10 : _local4);
_local4 = (0.1 * (_local3 - (_local3 % 10)));
min1.gotoAndStop(((_local4 == 0)) ? 10 : _local4);
_local4 = (_local2 % 10);
sec0.gotoAndStop(((_local4 == 0)) ? 10 : _local4);
_local4 = (0.1 * (_local2 - (_local2 % 10)));
sec1.gotoAndStop(((_local4 == 0)) ? 10 : _local4);
lastSec = _local2;
};
};
}
public function set visible(_arg1:Boolean):void{
anim.clip.visible = _arg1;
}
public function get showPauseSymbol():Boolean{
return (pause.visible);
}
public function set showPauseSymbol(_arg1:Boolean):void{
pause.visible = _arg1;
}
public function get visible():Boolean{
return (anim.clip.visible);
}
public function get time():uint{
return (_time);
}
}
}//package com.midasplayer.games.briscola
Section 60
//Config (com.midasplayer.games.briscola.Config)
package com.midasplayer.games.briscola {
import com.midasplayer.math.*;
import com.midasplayer.game.comm.*;
import flash.geom.*;
public class Config {
public var captureVolume:Number;// = 0.94
public var dealMinDuration:Number;// = 0.5
public var opponentHandPosX:Number;// = 377
public var opponentHandPosY:Number;// = 55
public var captureDelta:Number;// = 4
public var playerDealBezierPointX:Number;// = 40
public var stockPosRandX:Number;// = 0.9
public var stockPosRandY:Number;// = 0.9
public var instructionsCountdownLength:Number;// = 16.8
public var gameComm:IGameComm;
public var playerDealBezierPointY:Number;// = -80
public var resultMelodyDelay:Number;// = 0.3
public var opponentDelay:int;// = 5
public var captureMoveYDiff:Number;// = 5
public var startFrame:int;// = 5
public var dealDuration:Number;
public var cardLineupRadius:Number;// = 240
public var playerCapturedRandX:Number;// = 21
public var stockPosDiffX:Number;// = 0.35
public var randSeed:int;
public var stockPosDiffY:Number;// = -0.75
public var gatherMaxDuration:Number;// = 38
public var startDelay:int;// = 42
public var playerCapturedRandY:Number;// = 18
public var playMinDuration:Number;// = 0.5
public var playerCaptureBezierPointY:Number;// = 200
public var fullDealDuration:Number;
public var opponentCaptureBezierPointX:Number;// = 240
public var opponentCaptureBezierPointY:Number;// = 312
public var debug:Boolean;// = false
public var playerCapturedDiffX:Number;// = -0.6
public var playerCapturedDiffY:Number;// = -1.14
public var playerCapturedX:Number;// = 61
public var playerCapturedY:Number;// = 540
public var playerCaptureBezierPointX:Number;// = 76
public var viewRand:MtRandom;
public var captureMoveStart:Number;
public var logComm:Boolean;// = true
public var aceCaptureVolume:Number;// = 0.94
public var dealDelay:int;// = 11
public var playerCapturedRotation:Number;// = -105
public var revealTrumpDuration:Number;
public var gatherDelta:Number;// = 5
public var revealTrumpPos3DiffX:Number;// = -32
public var revealTrumpPos3DiffY:Number;// = 0
public var opponentCapturedScaleY:Number;// = 0.89
public var opponentCapturedScaleX:Number;// = 0.89
public var opponentDealBezierPointY:Number;// = -8
public var opponentTablePosX:Number;// = 384
public var opponentTablePosY:Number;// = 223
public var opponentDealBezierPointX:Number;// = 110
public var revealTrumpStart:Number;
public var cardLineupMaxWidth:Number;// = 70
public var firstgame:Boolean;
public var fullDealVolume:Number;// = 0.96
public var dealDelta:Number;// = 3
public var captureMoveXDiff:Number;// = 25
public var playDelay:int;// = 3
public var playerCapturedDiffRot:Number;// = 2.6
public var dealVolume:Number;// = 0.96
public var playerHandDist:Number;// = 16
public var opponentCapturedDiffRot:Number;// = 2.6
public var aiCaptureVolume:Number;// = 0.94
public var stockPosX:Number;// = 618
public var stockPosY:Number;// = 232
public var gameData:GameDataParser;
public var introMelodyVolume:Number;// = 0.87
public var gatherDuration:Number;// = 1.7
public var helpDelay:int;// = 225
public var captureStart:Number;
public var gameChimeVolume:Number;// = 0.77
public var gameMelodyFadeOutOnFinish:Number;// = 0.7
public var opponentHandScaleY:Number;// = 0.948
public var playerCaptureCacheRect:Rectangle;
public var pointScore:int;// = 100
public var gameMelodyFadeIn:Number;// = 0.8
public var fullDealDelta:Number;// = 3
public var captureMinDuration:Number;// = 0.5
public var playDuration:Number;
public var timesupVolume:Number;// = 0.8
public var captureMoveDuration:Number;
public var resultScoreStart:Number;// = 0
public var openGamePlayLimit:int;// = 20
public var gatherVolume:Number;// = 0.6
public var opponentCapturedRotation:Number;// = 105
public var openGameDialogTimeout:Number;// = 3.5
public var resultMelodyVolume:Number;// = 0.7
public var lostWorriedToSadPoint:int;// = 10
public var resultMelodyFadeOut:Number;// = 0.3
public var gatherMinDuration:Number;// = 12
public var playerCapturedScaleX:Number;// = 0.94
public var timelimit:int;
public var playerCapturedScaleY:Number;// = 0.94
public var introMelodyFadeOut:Number;// = 0.35
public var scoreCountVolume:Number;// = 1
public var timestep:Number;
public var captureDuration:Number;
public var avatarPath:String;
public var gameMelodyDelay:Number;// = 0.3
public var lostTriggerChances:Array;
public var resultScoreDuration:Number;// = 0.8
public var opponentHandDist:Number;// = 16
public var gameRand:MtRandom;
public var opponentCapturedRandX:Number;// = 19
public var opponentCapturedRandY:Number;// = 16
public var capturePointsDelay:Number;// = 0.15
public var resultChimeVolume:Number;// = 0.7
public var opengame:Boolean;
public var trumpPosX:Number;// = 538
public var trumpPosY:Number;// = 223
public var gameChimeDelay:Number;// = 0.1
public var startingPlayer:int;// = 1
public var gameMelodyVolume:Number;// = 0.43
public var masterSoundVolume:Number;// = 0.68
public var revealTrumpPos1DiffX:Number;// = -15
public var revealTrumpPos1DiffY:Number;// = 0
public var captureMoveMinDuration:Number;// = 0.5
public var gameMelodyFadeOut:Number;// = 0.12
public var trumpVolume:Number;// = 0.96
public var opponentCapturedDiffX:Number;// = 0.26
public var avatar:String;
public var opponentCapturedX:Number;// = 194
public var opponentCapturedDiffY:Number;// = -1.12
public var opponentCaptureCacheRect:Rectangle;
public var opponentCapturedY:Number;// = 128
public var local:Boolean;// = false
public var cardLineupMaxDist:Number;// = 8
public var playVolume:Number;// = 0.8
public var fullDealMinDuration:Number;// = 0.5
public var resultTotalStart:Number;// = 1.75
public var resultBonusStart:Number;// = 0.85
public var fullDealStart:Number;
public var playerTablePosX:Number;// = 280
public var playerTablePosY:Number;// = 223
public var playerHandPosX:Number;// = 377
public var playerHandPosY:Number;// = 400
public var captureNullDelay:Number;// = 0.26
public var resultCloseTextStart:Number;// = 2.2
public var resultsCountdownLength:Number;// = 14.4
public var resultBonusDuration:Number;// = 0.8
public var emoteChanceModifier:Number;// = 1.8
public var timeScore:int;// = 1000
public var cardLineupScale:Number;// = 0.5
public var captureTriggerChances:Array;
public var resultTotalDuration:Number;// = 0.18
public var captureDelay:int;// = 24
public var revealTrumpPos2DiffX:Number;// = -34
public var revealTrumpPos2DiffY:Number;// = 3
public var masterMusicVolume:Number;// = 0.68
public var scoreDingVolume:Number;// = 0.9
public var revealTrumpMinDuration:Number;// = 0.25
public var tickrate:Number;// = 15
public function Config(){
timestep = (1 / tickrate);
captureTriggerChances = [0, 0, 0, 0.2, 0.3, 0.3, 0.4, 0.5, 0.6, 0.6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
lostTriggerChances = [0, 0, 0.2, 0.3, 0.5, 0.6, 0.7, 0.7, 0.7, 0.7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
playerCaptureCacheRect = new Rectangle(0, 350, 220, 260);
opponentCaptureCacheRect = new Rectangle(0, 20, 220, 260);
fullDealStart = (0 * startDelay);
fullDealDuration = (0.65 * startDelay);
revealTrumpStart = (0.6 * startDelay);
revealTrumpDuration = (0.4 * startDelay);
playDuration = (2 * playDelay);
captureMoveStart = (0.25 * captureDelay);
captureMoveDuration = (0.22 * captureDelay);
captureStart = (0.62 * captureDelay);
captureDuration = (0.6 * captureDelay);
dealDuration = (1.2 * dealDelay);
super();
}
}
}//package com.midasplayer.games.briscola
Section 61
//Controller (com.midasplayer.games.briscola.Controller)
package com.midasplayer.games.briscola {
import flash.events.*;
import de.polygonal.ds.*;
public class Controller extends TaskManager {
private var config:Config;
private var outgoingEvents:LinkedQueue;
private var incomingEvents:LinkedQueue;
public var dispatcher:EventDispatcher;
public function Controller(_arg1:Config){
dispatcher = new EventDispatcher();
incomingEvents = new LinkedQueue();
outgoingEvents = new LinkedQueue();
super();
this.config = _arg1;
}
protected function dequeueIncomingEvent():BriscolaEvent{
return ((incomingEvents.dequeue() as BriscolaEvent));
}
protected function enqueueIncomingEvent(_arg1:BriscolaEvent):void{
_arg1.onTick = currentTick;
if (!config.opengame){
config.gameComm.addPlayData(_arg1.toPlayData());
};
incomingEvents.enqueue(_arg1);
}
protected function enqueueOutgoingEvent(_arg1:BriscolaEvent):void{
_arg1.onTick = currentTick;
outgoingEvents.enqueue(_arg1);
}
protected function clearOutgoingEvents():void{
outgoingEvents.clear();
}
protected function dequeueOutgoingEvent():BriscolaEvent{
return ((outgoingEvents.dequeue() as BriscolaEvent));
}
protected function dispatchOutgoingEvents():void{
var _local1:BriscolaEvent;
while (outgoingEvents.size()) {
_local1 = dequeueOutgoingEvent();
if (((!(config.opengame)) && (!((_local1.type == BriscolaEvent.COUNTDOWN_UPDATE))))){
config.gameComm.addPlayData(_local1.toPlayData());
};
dispatcher.dispatchEvent(_local1);
};
}
protected function hasIncomingEvents():Boolean{
return (!((0 == incomingEvents.size())));
}
protected function clearIncomingEvents():void{
incomingEvents.clear();
}
protected function hasOutgoingEvents():Boolean{
return (!((0 == outgoingEvents.size())));
}
}
}//package com.midasplayer.games.briscola
Section 62
//DisplayCard (com.midasplayer.games.briscola.DisplayCard)
package com.midasplayer.games.briscola {
import flash.events.*;
import flash.display.*;
import com.greensock.*;
import com.greensock.easing.*;
public class DisplayCard extends Card {
private var cardAnim:Animation;
public var isMouseOver:Boolean;// = false
public var clip:MovieClip;
private static const MOUSE_OUT_ANIM_LENGTH:uint = 7;
private static const MOUSE_OVER_ANIM_LENGTH:uint = 10;
public static const WIDTH:uint = 87;
public static const HEIGHT:uint = 154;
private static const FLIP_IN_ANIM_LENGTH:uint = 11;
private static const FLIP_OUT_ANIM_END:uint = 28;
private static const FLIP_OUT_ANIM_LENGTH:uint = 11;
private static const FLIP_IN_ANIM_END:uint = 39;
private static const ANIM_FPS:uint = 32;
private static const MOUSE_OVER_ANIM_END:uint = 10;
private static const MOUSE_OUT_ANIM_END:uint = 17;
private static var suitFrames:Array;
public function DisplayCard(_arg1:uint, _arg2:uint, _arg3:Boolean=false){
var _local4:FrameLabel;
clip = new CardGraphics();
cardAnim = new Animation(clip);
super(_arg1, _arg2, _arg3);
if (!suitFrames){
suitFrames = new Array(0, 0, 0, 0);
for each (_local4 in clip.symbol.currentLabels) {
switch (_local4.name){
case "coins":
suitFrames[SUIT_COINS] = _local4.frame;
break;
case "swords":
suitFrames[SUIT_SWORDS] = _local4.frame;
break;
case "cups":
suitFrames[SUIT_CUPS] = _local4.frame;
break;
case "clubs":
suitFrames[SUIT_CLUBS] = _local4.frame;
break;
};
};
};
clip.mouseEnabled = false;
clip.mouseChildren = false;
clip.symbol.gotoAndStop(((suitFrames[_arg1] + _arg2) - 1));
if (_arg3){
cardAnim.currentFrame = MOUSE_OUT_ANIM_END;
} else {
cardAnim.goto("back");
};
}
private function loop(_arg1:Animation, _arg2:String, _arg3:uint, _arg4:Number, _arg5:Function):void{
_arg1.goto(_arg2);
TweenLite.to(_arg1, _arg4, {currentFrame:_arg3, ease:Linear.easeNone, onComplete:_arg5, onCompleteParams:[_arg1, _arg2, _arg3, _arg4, _arg5]});
}
public function mouseOut(_arg1:Event=null):void{
cardAnim.goto("mouseOut");
TweenLite.to(cardAnim, (MOUSE_OUT_ANIM_LENGTH / ANIM_FPS), {currentFrame:MOUSE_OUT_ANIM_END, ease:Linear.easeNone});
isMouseOver = false;
}
override public function flip():void{
super.flip();
cardAnim.goto((faceUp) ? "face" : "back");
}
public function mouseOver(_arg1:Event=null):void{
cardAnim.goto("mouseOver");
TweenLite.to(cardAnim, (MOUSE_OVER_ANIM_LENGTH / ANIM_FPS), {currentFrame:MOUSE_OVER_ANIM_END, ease:Linear.easeNone});
isMouseOver = true;
}
public function killFlipAnim(_arg1:Boolean=false):void{
TweenLite.killTweensOf(cardAnim, _arg1);
}
public function animFlip(_arg1:Number=INF):void{
super.flip();
if (faceUp){
cardAnim.goto("flipIn");
TweenLite.to(cardAnim, Math.min(_arg1, (FLIP_IN_ANIM_LENGTH / ANIM_FPS)), {currentFrame:FLIP_IN_ANIM_END, ease:Linear.easeNone});
} else {
cardAnim.goto("flipOut");
TweenLite.to(cardAnim, Math.min(_arg1, (FLIP_IN_ANIM_LENGTH / ANIM_FPS)), {currentFrame:FLIP_OUT_ANIM_END, ease:Linear.easeNone});
};
}
}
}//package com.midasplayer.games.briscola
Section 63
//FieldClip (com.midasplayer.games.briscola.FieldClip)
package com.midasplayer.games.briscola {
import flash.display.*;
import flash.text.*;
public class FieldClip {
private var clip:MovieClip;
private var field:TextField;
public function FieldClip(_arg1:MovieClip){
this.clip = _arg1;
this.field = _arg1.field;
_arg1.stop();
_arg1.mouseEnabled = false;
_arg1.mouseChildren = false;
field.mouseEnabled = false;
field.blendMode = BlendMode.LAYER;
}
public function set text(_arg1:String):void{
field.text = _arg1;
}
public function get visible():Boolean{
return (clip.visible);
}
public function set visible(_arg1:Boolean):void{
clip.visible = _arg1;
}
public function get text():String{
return (field.text);
}
}
}//package com.midasplayer.games.briscola
Section 64
//GameView (com.midasplayer.games.briscola.GameView)
package com.midasplayer.games.briscola {
import flash.events.*;
import flash.display.*;
import de.polygonal.ds.*;
import com.midasplayer.sound.*;
import com.greensock.*;
import com.midasplayer.util.*;
import flash.geom.*;
import com.midasplayer.text.*;
import sound.*;
import com.greensock.easing.*;
import com.greensock.plugins.*;
import flash.utils.*;
public class GameView extends TaskManager {
private var handHighlight:Animation;
private var stockCache:Vector;
private var clock:Clock;
private var inputIn:LinkedQueue;
public var gameEndEvent:BriscolaEvent;
private var stockCount:FieldClip;
private var controller:MainController;
private var soundManager:SoundManager;
private var thisPlayer:int;
private var opponentPoints:AnimatedPointsCounter;
private var inputOut:LinkedQueue;
private var playerPoints:AnimatedPointsCounter;
private var model:ViewModel;
public var pointCards:Array;
private var config:Config;
private var emoteChanceModifier:Number;// = 1
private var musicManager:SoundManager;
private var cardContainer:Array2;
private var tablePoints:AnimatedPointsCounter;
private var captureCache:Array;
private var opponent:Opponent;
private var incomingEvents:LinkedQueue;
private var quitButton:StandardButton;
private var cards:DisplayObjectContainer;
private var messagePopup:MessagePopup;
public var finished:Boolean;// = false
private var stage:Stage;
public function GameView(_arg1:Config, _arg2:Stage, _arg3:MainController, _arg4:Array2, _arg5:Vector, _arg6:MessagePopup, _arg7:StandardButton, _arg8:FieldClip, _arg9:Clock, _arg10:AnimatedPointsCounter, _arg11:AnimatedPointsCounter, _arg12:AnimatedPointsCounter, _arg13:Opponent, _arg14:DisplayObjectContainer, _arg15:Animation, _arg16:SoundManager, _arg17:SoundManager){
pointCards = [new Vector(), new Vector()];
inputOut = new LinkedQueue();
inputIn = inputOut;
incomingEvents = new LinkedQueue();
captureCache = new Array();
super();
TweenPlugin.activate([BezierPlugin]);
this.config = _arg1;
this.stage = _arg2;
this.controller = _arg3;
this.cardContainer = _arg4;
this.stockCache = _arg5;
this.thisPlayer = _arg3.playerInput.player;
this.messagePopup = _arg6;
this.quitButton = _arg7;
this.stockCount = _arg8;
this.clock = _arg9;
this.tablePoints = _arg10;
this.playerPoints = _arg11;
this.opponentPoints = _arg12;
this.opponent = _arg13;
this.cards = _arg14;
this.handHighlight = _arg15;
this.soundManager = _arg16;
this.musicManager = _arg17;
_arg15.clip.x = _arg1.playerHandPosX;
_arg15.clip.y = (_arg1.playerHandPosY + (0.5 * DisplayCard.HEIGHT));
cards.mouseEnabled = false;
cards.mouseChildren = true;
_arg3.dispatcher.addEventListener(BriscolaEvent.STARTING_GAME, incomingEvents.enqueue);
_arg3.dispatcher.addEventListener(BriscolaEvent.ENDING_GAME, incomingEvents.enqueue);
_arg3.dispatcher.addEventListener(BriscolaEvent.ENTERING_PLAYER_TURN, incomingEvents.enqueue);
_arg3.dispatcher.addEventListener(BriscolaEvent.ENDING_FIRST_TIME_HELP, incomingEvents.enqueue);
_arg3.dispatcher.addEventListener(BriscolaEvent.PLAYING_CARD, incomingEvents.enqueue);
_arg3.dispatcher.addEventListener(BriscolaEvent.CAPTURING_CARDS, incomingEvents.enqueue);
_arg3.dispatcher.addEventListener(BriscolaEvent.DEALING_CARDS, incomingEvents.enqueue);
_arg3.dispatcher.addEventListener(BriscolaEvent.COUNTDOWN_UPDATE, incomingEvents.enqueue);
_arg3.dispatcher.addEventListener(BriscolaEvent.TIMELIMIT_HIT, incomingEvents.enqueue);
_arg3.playerInput.handleEvent(new BriscolaEvent(BriscolaEvent.NEW_GAME));
}
private function handleInput():void{
var _local1:Object;
while (inputOut.size()) {
_local1 = inputOut.dequeue();
controller.playerInput.handleEvent(_local1.toPlayerCommand());
};
}
private function onTimelimitHit(_arg1:BriscolaEvent):void{
model.timeRemaining = 0;
clock.time = 0;
clock.showPauseSymbol = false;
quitButton.deactivate();
messagePopup.text = I18n.getString("game_timesup");
messagePopup.animIn();
}
private function onMakePlayInput(_arg1:MouseEvent):void{
var index:int;
var event = _arg1;
disableInputOnCards();
var i:int;
while (i < model.hands[thisPlayer].size()) {
if (event.target == model.hands[thisPlayer].get(i).clip){
index = i;
break;
};
i = (i + 1);
};
inputIn.enqueue({toPlayerCommand:function ():BriscolaEvent{
return (new BriscolaEvent(BriscolaEvent.MAKE_PLAY, {index:index}));
}});
}
private function onDealingCards(_arg1:BriscolaEvent):void{
var event = _arg1;
model.state = Model.STATE_DEALING_CARDS;
var tweenArgs:Vector = getTweenArgsArray(2, event.onTick, currentTick, config.dealDuration, config.dealMinDuration, config.dealDelta);
var positions:Vector = getHandPositions(1, 3);
positions.concat(getHandPositions(0, 3));
var i = 1;
while (0 <= i) {
addTask(tweenArgs.get((1 - i)).onTick, function (_arg1:int, _arg2:Number, _arg3:Boolean):void{
var _local6:DisplayCard;
if (_arg3){
soundManager.getFromClass(deal).play(config.dealVolume);
};
var _local4:Vector = getHandPositions(_arg1, 3);
var _local5:int;
while (_local5 < 2) {
TweenLite.to(model.hands[_arg1].get(_local5).clip, (_arg2 / config.tickrate), {x:_local4.get(_local5).x, y:_local4.get(_local5).y});
_local5++;
};
if (model.stock.size()){
_local6 = (model.stock.pop() as DisplayCard);
cards.addChild(_local6.clip);
if (model.stock.size()){
stockCount.text = model.stock.size().toString();
} else {
stockCount.visible = false;
};
} else {
_local6 = (model.trump as DisplayCard);
model.trump = null;
};
model.hands[_arg1].pushBack(_local6);
if ((((((_arg1 == thisPlayer)) && (model.trump))) || (((!((_arg1 == thisPlayer))) && (!(model.trump)))))){
_local6.animFlip((_arg2 / config.tickrate));
};
if (_arg1 == thisPlayer){
TweenLite.to(_local6.clip, (_arg2 / config.tickrate), {bezier:[{x:(_local4.get(2).x + config.playerDealBezierPointX), y:(_local4.get(2).y + config.playerDealBezierPointY)}, {x:_local4.get(2).x, y:_local4.get(2).y}]});
} else {
TweenLite.to(_local6.clip, (_arg2 / config.tickrate), {bezier:[{x:(_local4.get(2).x + config.opponentDealBezierPointX), y:(_local4.get(2).y + config.opponentDealBezierPointY)}, {x:_local4.get(2).x, y:_local4.get(2).y}], scaleY:config.opponentHandScaleY});
};
}, i, tweenArgs.get(i).duration, (i == 1));
i = (i - 1);
};
}
private function getHandPositions(_arg1:int, _arg2:int):Vector{
var _local3:Vector = new Vector();
var _local4:int = ((thisPlayer == _arg1)) ? (config.playerHandPosX - (0.5 * ((DisplayCard.WIDTH * _arg2) + (config.playerHandDist * (_arg2 - 1))))) : (config.opponentHandPosX - (0.5 * ((DisplayCard.WIDTH * _arg2) + (config.opponentHandDist * (_arg2 - 1)))));
var _local5:int = ((thisPlayer == _arg1)) ? config.playerHandPosY : config.opponentHandPosY;
var _local6:int = (((thisPlayer == _arg1)) ? config.playerHandDist : config.opponentHandDist + DisplayCard.WIDTH);
var _local7:int;
while (_local7 < _arg2) {
_local3.pushBack(new Point(Math.round((_local4 + (_local7 * _local6))), Math.round(_local5)));
_local7++;
};
return (_local3);
}
private function fullDeal(_arg1:Vector):void{
var tweenArgs = _arg1;
var positions:Vector = getHandPositions(0, 3);
positions.concat(getHandPositions(1, 3));
var i:int;
while (i < 6) {
addTask(tweenArgs.get(i).onTick, function (_arg1:int, _arg2:Number, _arg3:Object, _arg4:Boolean):void{
var _local5:DisplayCard = (model.stock.pop() as DisplayCard);
stockCount.text = model.stock.size().toString();
model.hands[_arg1].pushBack(_local5);
cards.addChild(_local5.clip);
if (_arg4){
soundManager.getFromClass(fulldeal).play(config.fullDealVolume);
};
if (_arg1 == thisPlayer){
_local5.animFlip((_arg2 / config.tickrate));
};
TweenLite.to(_local5.clip, (_arg2 / config.tickrate), _arg3);
}, ((i < 3)) ? 0 : 1, tweenArgs.get(i).duration, {bezier:[{x:(positions.get(i).x + ((i < 3)) ? config.playerDealBezierPointX : config.opponentDealBezierPointX), y:(positions.get(i).y + ((i < 3)) ? config.playerDealBezierPointY : config.opponentDealBezierPointY)}, {x:positions.get(i).x, y:positions.get(i).y}], scaleY:((i < 3)) ? 1 : config.opponentHandScaleY}, (i == 0));
i = (i + 1);
};
}
private function handleIncomingEvents():void{
var _local1:BriscolaEvent;
while (0 != incomingEvents.size()) {
_local1 = (incomingEvents.dequeue() as BriscolaEvent);
switch (_local1.type){
case BriscolaEvent.STARTING_GAME:
onStartingGame(_local1);
break;
case BriscolaEvent.ENDING_GAME:
onEndingGame(_local1);
break;
case BriscolaEvent.ENTERING_PLAYER_TURN:
onEnteringPlayerTurn(_local1);
break;
case BriscolaEvent.ENDING_FIRST_TIME_HELP:
onEndingFirstTimeHelp(_local1);
break;
case BriscolaEvent.PLAYING_CARD:
onPlayingCard(_local1);
break;
case BriscolaEvent.CAPTURING_CARDS:
onCapturingCards(_local1);
break;
case BriscolaEvent.DEALING_CARDS:
onDealingCards(_local1);
break;
case BriscolaEvent.COUNTDOWN_UPDATE:
onCountdownUpdate(_local1);
break;
case BriscolaEvent.TIMELIMIT_HIT:
onTimelimitHit(_local1);
break;
default:
Log.warning((("Incoming event to game view is of unrecognized type (" + _local1.type) + ")."));
};
};
}
private function getCards(_arg1:int, _arg2:int):Vector{
var _local5:DisplayCard;
var _local3:Vector = new Vector();
var _local4:Object = model.captured[_arg2].iterator();
while (_local4.hasNext()) {
_local5 = (_local4.next() as DisplayCard);
if (_arg1 == _local5.rank){
_local3.pushBack(_local5);
};
};
return (_local3);
}
private function onQuitInput():void{
inputIn.enqueue({toPlayerCommand:function ():BriscolaEvent{
return (new BriscolaEvent(BriscolaEvent.QUIT_GAME));
}});
}
private function enableInputOnCards(_arg1:Boolean=true):void{
var _local3:DisplayCard;
var _local2:Object = model.hands[thisPlayer].iterator();
while (_local2.hasNext()) {
_local3 = (_local2.next() as DisplayCard);
_local3.clip.mouseEnabled = true;
_local3.clip.addEventListener(MouseEvent.MOUSE_DOWN, (_arg1) ? onFirstTimePlayInput : onMakePlayInput);
_local3.clip.addEventListener(MouseEvent.MOUSE_OVER, _local3.mouseOver);
_local3.clip.addEventListener(MouseEvent.MOUSE_OUT, _local3.mouseOut);
};
}
private function disableInputOnCards():void{
var _local2:DisplayCard;
var _local1:Object = model.hands[thisPlayer].iterator();
while (_local1.hasNext()) {
_local2 = (_local1.next() as DisplayCard);
_local2.clip.mouseEnabled = false;
_local2.clip.removeEventListener(MouseEvent.MOUSE_DOWN, onFirstTimePlayInput);
_local2.clip.removeEventListener(MouseEvent.MOUSE_DOWN, onMakePlayInput);
_local2.clip.removeEventListener(MouseEvent.MOUSE_OVER, _local2.mouseOver);
_local2.clip.removeEventListener(MouseEvent.MOUSE_OUT, _local2.mouseOut);
if (_local2.isMouseOver){
_local2.mouseOut();
};
};
}
private function getTweenArgsArray(_arg1:int, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number=1, _arg7:Boolean=false):Vector{
var _local10:int;
var _local11:int;
var _local12:Number;
var _local13:Number;
var _local14:Number;
if (0 >= _arg1){
return (new Vector());
};
var _local8:Vector = new Vector(_arg1);
var _local9:Number = Math.min(_arg4, Math.max(0, ((_arg2 + _arg4) - _arg3)));
if (((_arg7) && ((_arg5 > _local9)))){
_local9 = _arg5;
};
if (_arg5 > _local9){
_local10 = 0;
while (_local10 < _arg1) {
_local8.pushBack({duration:0, onTick:0});
_local10++;
};
} else {
_local11 = ((_arg6 + _arg1) - 1);
_local12 = (_local9 / _local11);
_local13 = (_arg6 * _local12);
_local14 = Math.max(0, (_arg2 - _arg3));
_local10 = 0;
while (_local10 < _arg1) {
_local8.pushBack({onTick:(_arg3 + _local14), duration:_local13});
_local10++;
_local14 = (_local14 + _local12);
};
};
return (_local8);
}
private function revealTrump(_arg1:Vector):void{
var tweenArgs = _arg1;
addTask(tweenArgs.get(0).onTick, function ():void{
var card:DisplayCard;
card = (model.stock.pop() as DisplayCard);
stockCount.text = model.stock.size().toString();
model.trump = card;
soundManager.getFromClass(trump).play(config.trumpVolume);
cards.addChildAt(card.clip, cards.numChildren);
card.animFlip((tweenArgs.get(0).duration / config.tickrate));
var leftX:int = config.trumpPosX;
var midY:int = Math.round((0.5 * (card.clip.y + config.trumpPosY)));
TweenLite.to(card.clip, ((0.65 * tweenArgs.get(0).duration) / config.tickrate), {x:(leftX + config.revealTrumpPos2DiffX), y:(midY + config.revealTrumpPos2DiffY), ease:Quad.easeInOut, onComplete:function ():void{
cards.setChildIndex(card.clip, 0);
TweenLite.to(card.clip, ((0.35 * tweenArgs.get(0).duration) / config.tickrate), {x:config.trumpPosX, y:config.trumpPosY, ease:Quad.easeInOut});
}});
});
}
public function update(_arg1:Number):void{
currentTick = _arg1;
if (quitButton.functionState == StandardButton.STATE_OFF){
quitButton.functionState = StandardButton.STATE_ON;
quitButton.deactivate();
onQuitInput();
};
executeTasks();
handleIncomingEvents();
handleInput();
}
private function tickUpScore(_arg1:int, _arg2:int, _arg3:Number):void{
model.points[_arg1] = (model.points[_arg1] + _arg2);
if (thisPlayer == _arg1){
playerPoints.addPoints(_arg2, _arg3);
} else {
opponentPoints.addPoints(_arg2, _arg3);
};
}
private function onFirstTimePlayInput(_arg1:MouseEvent):void{
onMakePlayInput(_arg1);
if (!model.helpShown){
model.helpShown = true;
opponent.animateHelpOut(deactivateFirstTimeHelp);
};
}
private function onStartingGame(_arg1:BriscolaEvent):void{
var _local8:uint;
captureCache.push(new Bitmap(new BitmapData(config.playerCaptureCacheRect.width, config.playerCaptureCacheRect.height, true, 0)));
captureCache[0].x = config.playerCaptureCacheRect.x;
captureCache[0].y = config.playerCaptureCacheRect.y;
captureCache.push(new Bitmap(new BitmapData(config.opponentCaptureCacheRect.width, config.opponentCaptureCacheRect.height, true, 0)));
captureCache[1].x = config.opponentCaptureCacheRect.x;
captureCache[1].y = config.opponentCaptureCacheRect.y;
cards.addChild(captureCache[0]);
cards.addChild(captureCache[1]);
var _local2:Vector = new Vector(_arg1.stock.size());
var _local3:uint = Card.SUIT_COINS;
while (_local3 <= Card.SUIT_CLUBS) {
_local8 = Card.RANK_ACE;
while (_local8 <= Card.RANK_KING) {
_local2.pushBack(new Point(cardContainer.get(_local3, (_local8 - 1)).clip.x, cardContainer.get(_local3, (_local8 - 1)).clip.y));
_local8++;
};
_local3++;
};
var _local4:ViewStock = new ViewStock(cardContainer, _arg1.stock, _local2, stockCache);
stockCache = null;
_local4.clip.x = (config.stockPosX - 2);
_local4.clip.y = (config.stockPosY - 31);
cards.addChild(_local4.clip);
model = new ViewModel(_arg1.timelimit, _local4);
model.helpShown = !(config.firstgame);
model.state = Model.STATE_STARTING_GAME;
var _local5:Vector = getTweenArgsArray(6, (_arg1.onTick + config.fullDealStart), currentTick, config.fullDealDuration, config.fullDealMinDuration, config.fullDealDelta);
var _local6:Vector = getTweenArgsArray(1, (_arg1.onTick + config.revealTrumpStart), currentTick, config.revealTrumpDuration, config.revealTrumpMinDuration);
var _local7:int;
while (_local7 < 6) {
_local5.get(_local7).onTick = Math.min(_local5.get(_local7).onTick, _local6.get(0).onTick);
_local7++;
};
fullDeal(_local5);
revealTrump(_local6);
}
private function onEnteringPlayerTurn(_arg1:BriscolaEvent):void{
model.state = _arg1.player;
if (thisPlayer == _arg1.player){
handHighlight.animate(1, 8);
if (_arg1.help){
activateFirstTimeHelp();
} else {
model.timePaused = false;
clock.showPauseSymbol = false;
enableInputOnCards(false);
};
};
}
private function gatherRemainingCards(_arg1:int):void{
var i:int;
var tickUpDuration:Number;
var player = _arg1;
var remaining:Vector = new Vector();
i = 0;
while (i < model.hands[1].size()) {
remaining.pushBack(function ():DisplayCard{
return (model.hands[1].popFront());
});
i = (i + 1);
};
if (model.table[0]){
remaining.pushBack(function ():DisplayCard{
var _local1:DisplayCard = model.table[0];
model.table[0] = null;
return (_local1);
});
};
if (model.table[1]){
remaining.pushBack(function ():DisplayCard{
var _local1:DisplayCard = model.table[1];
model.table[1] = null;
return (_local1);
});
};
i = 0;
while (i < model.hands[0].size()) {
remaining.pushBack(function ():DisplayCard{
return (model.hands[0].popFront());
});
i = (i + 1);
};
i = 0;
while (i < model.stock.size()) {
remaining.pushBack(function ():DisplayCard{
var _local1:DisplayCard = (model.stock.pop() as DisplayCard);
stockCount.text = model.stock.size().toString();
if (!model.stock.size()){
stockCount.visible = false;
};
cards.addChild(_local1.clip);
return (_local1);
});
i = (i + 1);
};
if (model.trump){
remaining.pushBack(function ():DisplayCard{
var _local1:DisplayCard = (model.trump as DisplayCard);
model.trump = null;
return (_local1);
});
};
var count:int = remaining.size();
var tweenArgs:Vector = getTweenArgsArray(count, currentTick, currentTick, Math.min(config.gatherMaxDuration, (count * config.gatherDuration)), config.gatherMinDuration, config.gatherDelta, true);
tickUpDuration = 0;
if (tweenArgs.size()){
tickUpDuration = ((tweenArgs.get(0).duration / config.gatherDelta) / config.tickrate);
};
soundManager.getFromClass(gather).loop(config.gatherVolume);
i = 0;
while (i < count) {
addTask(tweenArgs.get(i).onTick, function (_arg1:Function, _arg2:Number, _arg3:Boolean):void{
var _local4:DisplayCard = _arg1();
cards.setChildIndex(_local4.clip, (cards.numChildren - 1));
if (_local4.faceUp){
_local4.animFlip((_arg2 / config.tickrate));
};
if (Card.briscolaPoints[_local4.rank]){
tickUpScore(player, Card.briscolaPoints[_local4.rank], tickUpDuration);
};
captureCard(_local4, player, _arg2, true, (_arg3) ? shutDown : null);
if (_arg3){
soundManager.getFromClass(gather).fadeTo(0, 100);
};
}, remaining.get(i), tweenArgs.get(i).duration, (i == (count - 1)));
i = (i + 1);
};
}
private function deactivateFirstTimeHelp():void{
var _local2:MovieClip;
var _local3:Point;
var _local4:Point;
opponent.clip.mouseChildren = false;
if (!inputIn.size()){
opponent.clip.mouseChildren = false;
disableInputOnCards();
enableInputOnCards(false);
};
var _local1:Object = model.hands[thisPlayer].iterator();
while (_local1.hasNext()) {
_local2 = _local1.next().clip;
_local3 = opponent.clip.localToGlobal(new Point(_local2.x, _local2.y));
_local4 = cards.globalToLocal(new Point(_local3.x, _local3.y));
_local2.x = _local4.x;
_local2.y = _local4.y;
opponent.clip.removeChild(_local2);
cards.addChild(_local2);
};
opponent.helpOpponent.stopAnim(false);
opponent.animateIdle();
while (inputIn.size()) {
inputOut.enqueue(inputIn.dequeue());
};
inputIn = inputOut;
quitButton.activate();
}
private function activateFirstTimeHelp():void{
var _local2:MovieClip;
var _local3:Point;
var _local4:Point;
var _local1:Object = model.hands[thisPlayer].iterator();
while (_local1.hasNext()) {
_local2 = _local1.next().clip;
_local3 = cards.localToGlobal(new Point(_local2.x, _local2.y));
_local4 = opponent.clip.globalToLocal(new Point(_local3.x, _local3.y));
_local2.x = _local4.x;
_local2.y = _local4.y;
cards.removeChild(_local2);
opponent.clip.addChild(_local2);
};
quitButton.deactivate();
inputIn = new LinkedQueue();
opponent.clip.mouseChildren = true;
opponent.animateHelpIn(enableInputOnCards);
}
private function onCapturingCards(_arg1:BriscolaEvent):void{
var p0:Point;
var p1:Point;
var tweenArgs:Vector;
var event = _arg1;
model.state = Model.STATE_CAPTURING_CARDS;
model.leading = -1;
if (event.points){
tablePoints.setPoints(event.points, (config.captureStart / config.tickrate));
};
if (thisPlayer != event.player){
setTimeout(function ():void{
soundManager.getFromClass(aicapture).play(config.aiCaptureVolume);
}, (event.points) ? (config.capturePointsDelay * 1000) : (config.captureNullDelay * 1000));
} else {
if ((((model.table[0].rank == Card.RANK_ACE)) || ((model.table[1].rank == Card.RANK_ACE)))){
setTimeout(function ():void{
soundManager.getFromClass(acecapture).play(config.aceCaptureVolume);
}, (config.capturePointsDelay * 1000));
} else {
setTimeout(function ():void{
soundManager.getFromClass(capture).play(config.captureVolume);
}, (event.points) ? (config.capturePointsDelay * 1000) : (config.captureNullDelay * 1000));
};
};
p0 = new Point();
p1 = new Point();
var emote:Function;
if (thisPlayer == event.player){
cards.setChildIndex(model.table[0].clip, (cards.numChildren - 1));
p0.x = (config.playerTablePosX + config.captureMoveXDiff);
p0.y = (config.playerTablePosY - config.captureMoveYDiff);
p1.x = (config.opponentTablePosX - config.captureMoveXDiff);
p1.y = (config.opponentTablePosY + config.captureMoveYDiff);
if ((1 - (config.lostTriggerChances[event.points] * emoteChanceModifier)) < config.viewRand.nextDouble()){
if (event.points < config.lostWorriedToSadPoint){
emote = opponent.animateWorried;
} else {
emote = opponent.animateSad;
};
};
} else {
cards.setChildIndex(model.table[1].clip, (cards.numChildren - 1));
p0.x = (config.playerTablePosX + config.captureMoveXDiff);
p0.y = (config.playerTablePosY + config.captureMoveYDiff);
p1.x = (config.opponentTablePosX - config.captureMoveXDiff);
p1.y = (config.opponentTablePosY - config.captureMoveYDiff);
if ((1 - (config.captureTriggerChances[event.points] * emoteChanceModifier)) < config.viewRand.nextDouble()){
emote = opponent.animateHappy;
};
};
if (null != emote){
emote();
emoteChanceModifier = 1;
} else {
emoteChanceModifier = (emoteChanceModifier * config.emoteChanceModifier);
};
tweenArgs = getTweenArgsArray(1, (event.onTick + config.captureMoveStart), currentTick, config.captureMoveDuration, config.captureMoveMinDuration);
addTask(tweenArgs.get(0).onTick, function ():void{
TweenLite.to(model.table[0].clip, (tweenArgs.get(0).duration / config.tickrate), {x:p0.x, y:p0.y});
TweenLite.to(model.table[1].clip, (tweenArgs.get(0).duration / config.tickrate), {x:p1.x, y:p1.y, onComplete:function ():void{
var firstCapture:*;
TweenLite.killTweensOf(model.table[0].clip, true);
tweenArgs = getTweenArgsArray(2, (event.onTick + config.captureStart), currentTick, config.captureDuration, config.captureMinDuration, config.captureDelta);
firstCapture = true;
var i:* = 0;
while (i < 2) {
addTask(tweenArgs.get(i).onTick, function (_arg1:int, _arg2:Number):void{
var _local3:* = (model.table[_arg1] as DisplayCard);
model.table[_arg1] = null;
if (((firstCapture) && (event.points))){
tickUpScore(event.player, event.points, (_arg2 / config.tickrate));
firstCapture = false;
};
cards.setChildIndex(_local3.clip, (cards.numChildren - 1));
_local3.animFlip((_arg2 / config.tickrate));
captureCard(_local3, event.player, _arg2);
}, ((thisPlayer == event.player)) ? i : (1 - i), tweenArgs.get(i).duration);
i = (i + 1);
};
}});
});
}
private function onEndingFirstTimeHelp(_arg1:BriscolaEvent):void{
if (!model.helpShown){
model.helpShown = true;
clock.showPauseSymbol = false;
opponent.animateHelpOut(deactivateFirstTimeHelp);
};
}
private function shutDown():void{
pointCards[0].concat(getCards(Card.RANK_KNAVE, 0));
pointCards[0].concat(getCards(Card.RANK_KNIGHT, 0));
pointCards[0].concat(getCards(Card.RANK_KING, 0));
pointCards[0].concat(getCards(Card.RANK_THREE, 0));
pointCards[0].concat(getCards(Card.RANK_ACE, 0));
pointCards[1].concat(getCards(Card.RANK_KNAVE, 1));
pointCards[1].concat(getCards(Card.RANK_KNIGHT, 1));
pointCards[1].concat(getCards(Card.RANK_KING, 1));
pointCards[1].concat(getCards(Card.RANK_THREE, 1));
pointCards[1].concat(getCards(Card.RANK_ACE, 1));
finished = true;
}
private function onEndingGame(_arg1:BriscolaEvent):void{
model.state = Model.STATE_POSTGAME;
gameEndEvent = _arg1;
if (9 > handHighlight.currentFrame){
handHighlight.animate(9, 13);
};
disableInputOnCards();
clearTasks();
incomingEvents.clear();
if (config.opengame){
finished = true;
} else {
switch (_arg1.cause){
case MainController.CAUSE_FINISHED_GAME:
musicManager.getFromClass(game).fadeToAndStop(0, (config.gameMelodyFadeOutOnFinish * 1000));
shutDown();
break;
case MainController.CAUSE_TIMELIMIT_HIT:
musicManager.getFromClass(game).fadeToAndStop(0, (config.gameMelodyFadeOut * 1000));
soundManager.getFromClass(timesup).play(config.timesupVolume);
gatherRemainingCards(1);
break;
case MainController.CAUSE_PLAYER_QUIT:
musicManager.getFromClass(game).fadeToAndStop(0, (config.gameMelodyFadeOut * 1000));
soundManager.getFromClass(timesup).play(config.timesupVolume);
gatherRemainingCards(1);
break;
default:
Log.warning((("Game end cause is unrecognized (" + _arg1.cause) + ")."));
};
};
}
private function onCountdownUpdate(_arg1:BriscolaEvent):void{
model.timeRemaining = _arg1.remaining;
clock.time = (model.timeRemaining + 0.999);
if (0 == model.timeRemaining){
clock.showPauseSymbol = false;
};
}
private function captureCard(_arg1:DisplayCard, _arg2:int, _arg3:Number, _arg4:Boolean=false, _arg5:Function=null, _arg6:Array=null):void{
var card = _arg1;
var player = _arg2;
var duration = _arg3;
var linear = _arg4;
var onComplete = _arg5;
var onCompleteParams = _arg6;
model.captured[player].push(card);
var args:Object = {rotation:0, scaleX:1, scaleY:1};
var index:int = (model.captured[player].size() - 1);
if (player == thisPlayer){
if (linear){
args["x"] = ((config.playerCapturedX + (index * config.playerCapturedDiffX)) + (config.playerCapturedRandX * (0.5 - config.viewRand.nextDouble())));
args["y"] = ((config.playerCapturedY + (index * config.playerCapturedDiffY)) + (config.playerCapturedRandY * (0.5 - config.viewRand.nextDouble())));
} else {
args["bezier"] = [{x:config.playerCaptureBezierPointX, y:config.playerCaptureBezierPointY}, {x:((config.playerCapturedX + (index * config.playerCapturedDiffX)) + (config.playerCapturedRandX * (0.5 - config.viewRand.nextDouble()))), y:((config.playerCapturedY + (index * config.playerCapturedDiffY)) + (config.playerCapturedRandY * (0.5 - config.viewRand.nextDouble())))}];
};
args.rotation = ((config.playerCapturedRotation + ((2 * config.playerCapturedDiffRot) * config.viewRand.nextDouble())) - config.playerCapturedDiffRot);
args.scaleX = config.playerCapturedScaleX;
args.scaleY = config.playerCapturedScaleY;
} else {
if (linear){
args["x"] = ((config.opponentCapturedX + (index * config.opponentCapturedDiffX)) + (config.opponentCapturedRandX * (0.5 - config.viewRand.nextDouble())));
args["y"] = ((config.opponentCapturedY + (index * config.opponentCapturedDiffY)) + (config.opponentCapturedRandY * (0.5 - config.viewRand.nextDouble())));
} else {
args["bezier"] = [{x:config.opponentCaptureBezierPointX, y:config.opponentCaptureBezierPointY}, {x:((config.opponentCapturedX + (index * config.opponentCapturedDiffX)) + (config.opponentCapturedRandX * (0.5 - config.viewRand.nextDouble()))), y:((config.opponentCapturedY + (index * config.opponentCapturedDiffY)) + (config.opponentCapturedRandY * (0.5 - config.viewRand.nextDouble())))}];
};
args.rotation = ((config.opponentCapturedRotation + ((2 * config.opponentCapturedDiffRot) * config.viewRand.nextDouble())) - config.opponentCapturedDiffRot);
args.scaleX = config.opponentCapturedScaleX;
args.scaleY = config.opponentCapturedScaleY;
};
var funcs:Array = new Array();
var funcsArgs:Array = new Array();
funcs.push(function (_arg1:DisplayCard):void{
_arg1.killFlipAnim(true);
var _local2:Bitmap = captureCache[player];
cards.removeChild(_local2);
cards.removeChild(_arg1.clip);
var _local3:Number = _local2.x;
var _local4:Number = _local2.y;
_local2.x = 0;
_local2.y = 0;
_arg1.clip.x = (_arg1.clip.x - _local3);
_arg1.clip.y = (_arg1.clip.y - _local4);
var _local5:Sprite = new Sprite();
_local5.addChild(_local2);
_local5.addChild(_arg1.clip);
var _local6:BitmapData = new BitmapData(_local2.width, _local2.height, true, 0);
_local6.draw(_local5);
_local5.removeChild(_local2);
_local5.removeChild(_arg1.clip);
_local2.x = _local3;
_local2.y = _local4;
_local2.bitmapData = _local6;
cards.addChildAt(_local2, 0);
});
funcsArgs.push([card]);
if (null != onComplete){
funcs.push(onComplete);
funcsArgs.push(onCompleteParams);
};
if (funcs.length){
args.onComplete = function (_arg1:Array, _arg2:Array):void{
var _local3:int;
while (_local3 < _arg1.length) {
_arg1[_local3].apply(null, _arg2[_local3]);
_local3++;
};
};
args.onCompleteParams = [funcs, funcsArgs];
};
TweenLite.to(card.clip, (duration / config.tickrate), args);
}
private function onPlayingCard(_arg1:BriscolaEvent):void{
model.state = Model.STATE_PLAYING_CARD;
model.openGamePlayCount++;
if (thisPlayer == _arg1.player){
model.timePaused = true;
clock.showPauseSymbol = true;
handHighlight.animate(9, 13);
};
if (!model.table[((0 == _arg1.player)) ? 1 : 0]){
model.leading = _arg1.player;
};
if (thisPlayer == _arg1.player){
soundManager.getFromClass(play1).play(config.playVolume);
} else {
soundManager.getFromClass(play2).play(config.playVolume);
};
var _local2:Vector = getTweenArgsArray(1, _arg1.onTick, currentTick, config.playDuration, config.playMinDuration);
var _local3:DisplayCard = model.hands[_arg1.player].removeAt(_arg1.index);
model.table[_arg1.player] = _local3;
cards.setChildIndex(_local3.clip, (cards.numChildren - 1));
if (_arg1.player != thisPlayer){
_local3.animFlip((_local2.get(0).duration / config.tickrate));
};
TweenLite.to(_local3.clip, (_local2.get(0).duration / config.tickrate), {x:((_arg1.player == thisPlayer)) ? config.playerTablePosX : config.opponentTablePosX, y:((_arg1.player == thisPlayer)) ? config.playerTablePosY : config.opponentTablePosY, scaleY:1});
}
}
}//package com.midasplayer.games.briscola
Section 65
//HandHighlight (com.midasplayer.games.briscola.HandHighlight)
package com.midasplayer.games.briscola {
import flash.display.*;
public dynamic class HandHighlight extends MovieClip {
}
}//package com.midasplayer.games.briscola
Section 66
//Instructions (com.midasplayer.games.briscola.Instructions)
package com.midasplayer.games.briscola {
import flash.events.*;
import flash.display.*;
import com.midasplayer.text.*;
public class Instructions {
private var cardAnim:Animation;
private var countdownFinished:Boolean;
private var countdownField:FieldClip;
private var anim:Animation;
private var textBoxOnFirst:Boolean;// = true
private var arrow:Animation;
private var textBox:Animation;
private var currentCountdownTime:Number;
private var countdownStart:Number;
public var startButton:BigButton;
private var countdownLength:Number;
private static const ARROW_MOUSE_OUT_START:uint = 8;
private static const ARROW_MOUSE_OVER:uint = 2;
private static const ARROW_MOUSE_OUT_END:uint = 11;
private static const ARROW_MOUSE_PRESS:uint = 3;
private static const ARROW_MOUSE_RELEASE_END:uint = 7;
private static const ARROW_MOUSE_RELEASE_START:uint = 4;
public function Instructions(_arg1:Config, _arg2:MovieClip){
startButton = new BigButton(_arg2.startButton, I18n.getString("inst_startbutton_line1"), I18n.getString("inst_startbutton_line2"));
anim = new Animation(_arg2);
textBox = new Animation(anim.clip.textBox);
cardAnim = new Animation(anim.clip.cardAnim);
arrow = new Animation(anim.clip.arrow);
countdownLength = _arg1.instructionsCountdownLength;
currentCountdownTime = countdownLength;
countdownField = new FieldClip(anim.clip.countdown);
countdownField.text = I18n.getString("inst_countdown", countdownLength.toString());
anim.goto("active");
cardAnim.goto("inactive");
arrow.goto("inactive");
arrow.clip.icon.gotoAndStop(1);
textBox.currentFrame = 1;
anim.clip.mouseEnabled = false;
textBox.clip.mouseEnabled = false;
textBox.clip.mouseChildren = false;
cardAnim.clip.mouseEnabled = false;
cardAnim.clip.mouseChildren = false;
arrow.clip.mouseEnabled = true;
arrow.clip.mouseChildren = false;
_arg2.textBox.page1.header.field.text = I18n.getString("inst_page1_header");
_arg2.textBox.page1.field.text = ((I18n.getString("inst_page1_field1") + "\n\n") + I18n.getString("inst_page1_field2"));
_arg2.textBox.page2.topfield.text = I18n.getString("inst_page2_topfield");
_arg2.textBox.page2.ace.text = I18n.getString("inst_page2_ace");
_arg2.textBox.page2.acePoints.text = I18n.getString("inst_page2_acepoints");
_arg2.textBox.page2.three.text = I18n.getString("inst_page2_three");
_arg2.textBox.page2.threePoints.text = I18n.getString("inst_page2_threepoints");
_arg2.textBox.page2.king.text = I18n.getString("inst_page2_king");
_arg2.textBox.page2.kingPoints.text = I18n.getString("inst_page2_kingpoints");
_arg2.textBox.page2.knight.text = I18n.getString("inst_page2_knight");
_arg2.textBox.page2.knightPoints.text = I18n.getString("inst_page2_knightpoints");
_arg2.textBox.page2.knave.text = I18n.getString("inst_page2_knave");
_arg2.textBox.page2.knavePoints.text = I18n.getString("inst_page2_knavepoints");
_arg2.textBox.page2.bottomfield.text = I18n.getString("inst_page2_bottomfield");
deactivate();
}
public function get done():Boolean{
return (((countdownFinished) || (startButton.pressed)));
}
public function activate():void{
anim.clip.mouseChildren = true;
arrow.clip.mouseEnabled = true;
startButton.activate();
cardAnim.animate(1, cardAnim.clip.totalFrames, 0, true);
countdownStart = (new Date().getTime() / 1000);
anim.clip.addEventListener(Event.ENTER_FRAME, updateCountdown);
arrow.clip.addEventListener(MouseEvent.MOUSE_OVER, arrowMouseOver);
arrow.clip.addEventListener(MouseEvent.MOUSE_OUT, arrowMouseOut);
arrow.clip.addEventListener(MouseEvent.MOUSE_DOWN, arrowMouseDown);
arrow.clip.addEventListener(MouseEvent.CLICK, arrowMouseClick);
}
public function arrowMouseClick(_arg1:Event):void{
MainView.objectClicked = true;
arrow.animate(ARROW_MOUSE_RELEASE_START, ARROW_MOUSE_RELEASE_END);
if (textBoxOnFirst){
textBox.animate(textBox.currentFrame, textBox.clip.totalFrames);
arrow.clip.icon.gotoAndStop(2);
textBoxOnFirst = false;
} else {
textBox.animate(textBox.currentFrame, 1);
arrow.clip.icon.gotoAndStop(1);
textBoxOnFirst = true;
};
}
public function arrowMouseOver(_arg1:Event):void{
arrow.stopAnim(false);
arrow.currentFrame = ARROW_MOUSE_OVER;
}
public function arrowMouseOut(_arg1:Event):void{
arrow.animate(ARROW_MOUSE_OUT_START, ARROW_MOUSE_OUT_END);
}
public function set visible(_arg1:Boolean):void{
anim.clip.visible = _arg1;
}
public function arrowMouseDown(_arg1:Event):void{
arrow.stopAnim(false);
arrow.currentFrame = ARROW_MOUSE_PRESS;
}
private function updateCountdown(_arg1:Event):void{
var _local2:Number = (new Date().getTime() / 1000);
var _local3:Number = (countdownLength - (_local2 - countdownStart));
if (0 < _local3){
if (_local3 != currentCountdownTime){
countdownField.text = I18n.getString("inst_countdown", Math.ceil(_local3).toString());
currentCountdownTime = _local3;
};
} else {
countdownField.text = I18n.getString("inst_countdown", "0");
countdownFinished = true;
anim.clip.removeEventListener(Event.ENTER_FRAME, updateCountdown);
};
}
public function get visible():Boolean{
return (anim.clip.visible);
}
public function transitionOut():void{
anim.animate(1, anim.clip.totalFrames);
}
public function deactivate():void{
anim.clip.mouseChildren = false;
arrow.clip.mouseEnabled = false;
startButton.deactivate();
cardAnim.stopAnim(false);
anim.clip.removeEventListener(Event.ENTER_FRAME, updateCountdown);
arrow.clip.removeEventListener(MouseEvent.MOUSE_OVER, arrowMouseOver);
arrow.clip.removeEventListener(MouseEvent.MOUSE_OUT, arrowMouseOut);
arrow.clip.removeEventListener(MouseEvent.MOUSE_DOWN, arrowMouseDown);
arrow.clip.removeEventListener(MouseEvent.CLICK, arrowMouseClick);
}
}
}//package com.midasplayer.games.briscola
Section 67
//Main (com.midasplayer.games.briscola.Main)
package com.midasplayer.games.briscola {
import flash.events.*;
import com.midasplayer.timing.*;
import flash.display.*;
import com.midasplayer.math.*;
import com.midasplayer.game.comm.*;
import com.midasplayer.avatar.*;
import com.midasplayer.util.*;
import com.midasplayer.text.*;
public class Main extends Sprite implements Timeable {
private var timer:Timer;
private var view:MainView;
private var game:MainController;
private var startCounter:int;// = 0
public static var avatarFactory:Object;
public static var config:Config;
public function Main():void{
if (stage){
init();
} else {
addEventListener(Event.ADDED_TO_STAGE, init);
};
}
private function getDebugGameDataXML():String{
var _local1:int = (1 + (Math.random() * 999));
var _local2:XML = new XML((("<gamedata randomseed=\"" + ??esc_xattr
) + "\">\r\n\t\t\t\r\n\t\t\t\t<sound>1</sound>\r\n\t\t\t\t<music>1</music>\r\n\t\t\t\t<opengame>0</opengame>\r\n\t\t\t\t<firstgame>0</firstgame>\r\n\t\t\t\t<timelimit>120</timelimit>\r\n\t\t\t\t\r\n\t\t\t\t<avatarpath></avatarpath>\r\n\t\t\t\t<avatar>head1,955a38:blush1,955a38:mouth1,955a38:lips2,513618:sweat1,955a38:makeup7:eyes1:eyebrows1:nose4,955a38:hair14B,513618:ear1,955a38:earring6:hair14A,513618:</avatar>\r\n\t\t\t\t\r\n\t\t\t\t<text id=\"inst_page1_header\">Let's Play Briscola!</text>\r\n\t\t\t\t<text id=\"inst_page1_field1\">You will play a round of Briscola against the computer opponent.</text>\r\n\t\t\t\t<text id=\"inst_page1_field2\">The open card next to the deck will be trumps for the game. The computer will play the first card. There is no need to follow suit, but the highest card of the played suit or trumps takes the trick. The winner of the trick plays first in the next hand.</text>\r\n\t\t\t\t<text id=\"inst_page2_topfield\">The cards are valued in the following order:</text>\r\n\t\t\t\t<text id=\"inst_page2_ace\">Ace:</text>\r\n\t\t\t\t<text id=\"inst_page2_acepoints\">11 points</text>\r\n\t\t\t\t<text id=\"inst_page2_three\">Three:</text>\r\n\t\t\t\t<text id=\"inst_page2_threepoints\">10 points</text>\r\n\t\t\t\t<text id=\"inst_page2_king\">Re:</text>\r\n\t\t\t\t<text id=\"inst_page2_kingpoints\">4 points</text>\r\n\t\t\t\t<text id=\"inst_page2_knight\">Cavallo:</text>\r\n\t\t\t\t<text id=\"inst_page2_knightpoints\">3 points</text>\r\n\t\t\t\t<text id=\"inst_page2_knave\">Fante:</text>\r\n\t\t\t\t<text id=\"inst_page2_knavepoints\">2 points</text>\r\n\t\t\t\t<text id=\"inst_page2_bottomfield\">You will also get a time bonus. Have fun!</text>\r\n\t\t\t\t<text id=\"inst_countdown\">The Game Will Start in {0} Seconds</text>\r\n\t\t\t\t<text id=\"inst_startbutton_line1\">Start</text>\r\n\t\t\t\t<text id=\"inst_startbutton_line2\">Game!</text>\r\n\t\t\t\t\r\n\t\t\t\t<text id=\"game_first_time_help\">Click on one of the cards on your hand to play it.</text>\r\n\t\t\t\t<text id=\"game_timesup\">Time's Up!</text>\r\n\t\t\t\t\r\n\t\t\t\t<text id=\"rslt_score\">Score</text>\r\n\t\t\t\t<text id=\"rslt_bonus\">Bonus</text>\r\n\t\t\t\t<text id=\"rslt_total\">Total Score</text>\r\n\t\t\t\t<text id=\"rslt_countdown\">The Game Ends in {0} Seconds</text>\r\n\t\t\t\t<text id=\"rslt_quitbutton_line1\">Click to</text>\r\n\t\t\t\t<text id=\"rslt_quitbutton_line2\">Quit</text>\r\n\t\t\t\t\r\n\t\t\t\t<text id=\"register_header\">Game Over</text>\r\n\t\t\t\t<text id=\"register_desc\">Please register to continue playing and complete the game!</text>\r\n\t\t\t\t<text id=\"register_button\">OK!</text>\r\n\t\t\t\r\n\t\t\t</gamedata>"));
return (_local2.toString());
}
private function onAvatarLoadProgress(_arg1:Number, _arg2:Number):void{
config.gameComm.enqueuePlayData(BriscolaEvent.messagePlayData(((("Avatar manager load progress at " + _arg1) + " of ") + _arg2)));
}
private function frame(_arg1:Event=null):void{
if (config.startFrame == ++startCounter){
startGame();
};
timer.advanceTime2();
}
private function init(_arg1:Event=null):void{
var avatarLoader:AvatarLoader;
var message:String;
var event = _arg1;
removeEventListener(Event.ADDED_TO_STAGE, init);
stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.showDefaultContextMenu = false;
var assertionHandler:Function = function (_arg1:String, _arg2:String, _arg3:int, _arg4:String, _arg5:String, _arg6:String):Boolean{
Log.warning(Assert.getAsFormattedString(_arg1, null, 0, _arg4, _arg5, _arg6));
return (false);
};
Assert.pushHandler(assertionHandler);
Log.enabled = false;
config = new Config();
initConfig(config);
var textElements:XMLList = new XML(config.gameComm.getGameData()).child("text");
var texts:Object = new Object();
var i:int;
while (i < textElements.length()) {
texts[textElements[i].@id] = textElements[i];
i = (i + 1);
};
I18n.init(texts);
timer = new Timer(this, config.timestep);
if (((!(config.opengame)) && (!((config.avatar == ""))))){
MainView.tryLoadAvatar = true;
avatarLoader = new AvatarLoader(config.local, config.avatarPath);
config.gameComm.enqueuePlayData(BriscolaEvent.messagePlayData(("Trying to load avatar manager using " + (avatarLoader.isMoneyGame) ? "money load" : "simple load")));
avatarLoader.load(onAvatarLoaded, onAvatarError, onAvatarPreloadProgress, onAvatarLoadProgress);
} else {
message = "Will not load avatar manager: ";
if (((config.opengame) && ((config.avatar == "")))){
message = (message + "opengame is 1 and avatar string is empty");
} else {
if (config.opengame){
message = (message + "opengame is 1");
} else {
message = (message + "avatar string is empty");
};
};
config.gameComm.enqueuePlayData(BriscolaEvent.messagePlayData(message));
config.startFrame = 1;
};
addEventListener(Event.ENTER_FRAME, frame);
}
public function tick(_arg1:int):void{
if (game){
game.update(_arg1);
};
}
public function render(_arg1:int, _arg2:Number):void{
if (view){
view.update(((_arg1 + _arg2) - 1));
};
}
private function onAvatarError(_arg1:String):void{
config.gameComm.enqueuePlayData(BriscolaEvent.messagePlayData(("Avatar manager failed to load with error code " + _arg1)));
}
private function initConfig(_arg1:Config):void{
_arg1.gameComm = (_arg1.local) ? new DebugGameComm(getDebugGameDataXML(), _arg1.logComm) : new GameComm();
_arg1.gameData = new GameDataParser(_arg1.gameComm.getGameData());
_arg1.opengame = _arg1.gameData.getElementTextAsBool("opengame");
_arg1.firstgame = _arg1.gameData.getElementTextAsBool("firstgame");
_arg1.randSeed = _arg1.gameData.randomSeed;
_arg1.timelimit = _arg1.gameData.getElementTextAsInt("timelimit");
_arg1.gameRand = new MtRandom(_arg1.randSeed);
_arg1.viewRand = new MtRandom(_arg1.randSeed);
_arg1.avatarPath = _arg1.gameData.getElementTextAsString("avatarpath");
_arg1.avatar = _arg1.gameData.getElementTextAsString("avatar");
}
private function startGame():void{
Log.info((((("Starting game with random seed " + config.randSeed) + " and time limit ") + config.timelimit) + "."));
game = new MainController(config);
view = new MainView(config, stage, game);
}
private function onAvatarLoaded(_arg1:Event):void{
config.gameComm.enqueuePlayData(BriscolaEvent.messagePlayData("Avatar manager finished loading"));
avatarFactory = _arg1.target.content;
}
private function onAvatarPreloadProgress(_arg1:Number, _arg2:Number):void{
config.gameComm.enqueuePlayData(BriscolaEvent.messagePlayData(((("Avatar manager preload progress at " + _arg1) + " of ") + _arg2)));
}
}
}//package com.midasplayer.games.briscola
Section 68
//MainController (com.midasplayer.games.briscola.MainController)
package com.midasplayer.games.briscola {
import de.polygonal.ds.*;
import com.midasplayer.util.*;
public class MainController extends Controller {
private var config:Config;
private var model:Model;
public var playerInput:PlayerInputReceiver;
private var stateMachine:StateMachine;
private var inputReceivers:Array;
public static const CAUSE_PLAYER_QUIT:int = 2;
public static const CAUSE_FINISHED_GAME:int = 0;
public static const CAUSE_TIMELIMIT_HIT:int = 1;
public function MainController(_arg1:Config){
inputReceivers = [new PlayerInputReceiver(0, enqueueIncomingEvent), new PlayerInputReceiver(1, enqueueIncomingEvent)];
playerInput = inputReceivers[0];
super(_arg1);
this.config = _arg1;
model = new Model(_arg1.timelimit, null, _arg1.gameRand);
stateMachine = new StateMachine();
stateMachine.addState(Model.STATE_PREGAME);
stateMachine.addState(Model.STATE_STARTING_GAME);
stateMachine.addState(Model.STATE_PLAYER1_TURN);
stateMachine.addState(Model.STATE_PLAYER2_TURN);
stateMachine.addState(Model.STATE_PLAYING_CARD);
stateMachine.addState(Model.STATE_CAPTURING_CARDS);
stateMachine.addState(Model.STATE_DEALING_CARDS);
stateMachine.addState(Model.STATE_POSTGAME);
stateMachine.addTransition(Model.STATE_PREGAME, Model.STATE_STARTING_GAME);
stateMachine.addTransition(Model.STATE_STARTING_GAME, Model.STATE_PLAYER1_TURN);
stateMachine.addTransition(Model.STATE_STARTING_GAME, Model.STATE_PLAYER2_TURN);
stateMachine.addTransition(Model.STATE_PLAYER1_TURN, Model.STATE_PLAYING_CARD);
stateMachine.addTransition(Model.STATE_PLAYER2_TURN, Model.STATE_PLAYING_CARD);
stateMachine.addTransition(Model.STATE_PLAYING_CARD, Model.STATE_PLAYER1_TURN);
stateMachine.addTransition(Model.STATE_PLAYING_CARD, Model.STATE_PLAYER2_TURN);
stateMachine.addTransition(Model.STATE_PLAYING_CARD, Model.STATE_CAPTURING_CARDS);
stateMachine.addTransition(Model.STATE_CAPTURING_CARDS, Model.STATE_DEALING_CARDS);
stateMachine.addTransition(Model.STATE_DEALING_CARDS, Model.STATE_PLAYER1_TURN);
stateMachine.addTransition(Model.STATE_DEALING_CARDS, Model.STATE_PLAYER2_TURN);
stateMachine.addTransition(Model.STATE_CAPTURING_CARDS, Model.STATE_PLAYER1_TURN);
stateMachine.addTransition(Model.STATE_CAPTURING_CARDS, Model.STATE_PLAYER2_TURN);
stateMachine.addTransition(Model.STATE_CAPTURING_CARDS, Model.STATE_POSTGAME);
stateMachine.addTransition(Model.STATE_STARTING_GAME, Model.STATE_POSTGAME);
stateMachine.addTransition(Model.STATE_PLAYER1_TURN, Model.STATE_POSTGAME);
stateMachine.addTransition(Model.STATE_PLAYER2_TURN, Model.STATE_POSTGAME);
stateMachine.addTransition(Model.STATE_PLAYING_CARD, Model.STATE_POSTGAME);
stateMachine.addTransition(Model.STATE_DEALING_CARDS, Model.STATE_POSTGAME);
}
private function onMakePlay(_arg1:BriscolaEvent):void{
Assert.assert((_arg1.player == model.state), "Another player than the active player tried to play a card.");
if (_arg1.player != model.state){
return;
};
if (!stateMachine.transition(Model.STATE_PLAYING_CARD)){
return;
};
model.state = stateMachine.currentState;
if (removeTask(endFirstTimeHelp)){
endFirstTimeHelp();
};
enqueueOutgoingEvent(new BriscolaEvent(BriscolaEvent.PLAYING_CARD, {player:_arg1.player, index:_arg1.index}));
model.openGamePlayCount++;
if (_arg1.player == playerInput.player){
model.timePaused = true;
};
model.table[_arg1.player] = model.hands[_arg1.player].removeAt(_arg1.index);
if (!model.table[((0 == _arg1.player)) ? 1 : 0]){
model.leading = _arg1.player;
};
if (((!(model.table[0])) || (!(model.table[1])))){
addTask((currentTick + config.playDelay), enterPlayerTurn, (model.table[0]) ? 1 : 0);
} else {
addTask((currentTick + config.playDelay), captureCards);
};
}
private function enterPlayerTurn(_arg1:int):void{
if (!stateMachine.transition(_arg1)){
return;
};
model.state = stateMachine.currentState;
var _local2:Boolean = (((((_arg1 == playerInput.player)) && (config.firstgame))) && (!(model.helpShown)));
enqueueOutgoingEvent(new BriscolaEvent(BriscolaEvent.ENTERING_PLAYER_TURN, {player:_arg1, help:_local2}));
if (_arg1 != playerInput.player){
addTask((currentTick + config.opponentDelay), makeAIMove, _arg1);
} else {
if (!_local2){
model.timePaused = false;
};
};
if (_local2){
addTask((currentTick + config.helpDelay), endFirstTimeHelp);
};
}
private function makeAIMove(_arg1:int):void{
var _local3:Vector;
var _local4:Vector;
var _local5:int;
var _local6:Card;
var _local2:Card = model.table[((0 == _arg1)) ? 1 : 0];
if (!_local2){
inputReceivers[_arg1].handleEvent(new BriscolaEvent(BriscolaEvent.MAKE_PLAY, {index:config.gameRand.nextInt(model.hands[_arg1].size())}));
} else {
_local3 = model.hands[_arg1];
_local4 = new Vector(3);
_local5 = 0;
while (_local5 < _local3.size()) {
_local6 = (_local3.get(_local5) as Card);
if (_local6.suit == _local2.suit){
if (0 < Card.briscolaRankCompare(_local6, _local2)){
_local4.pushBack(_local5);
};
} else {
if (_local6.suit == model.trump.suit){
_local4.pushBack(_local5);
};
};
_local5++;
};
if (_local4.size()){
inputReceivers[_arg1].handleEvent(new BriscolaEvent(BriscolaEvent.MAKE_PLAY, {index:_local4.get(config.gameRand.nextInt(_local4.size()))}));
} else {
inputReceivers[_arg1].handleEvent(new BriscolaEvent(BriscolaEvent.MAKE_PLAY, {index:leastValueIndex(_arg1)}));
};
};
}
public function update(_arg1:int):void{
currentTick = _arg1;
if (model.state == Model.STATE_POSTGAME){
clearIncomingEvents();
Assert.assert((0 == numTasks()), "Tasks are left unexecuted in post game state.");
return;
};
if (!model.timePaused){
model.timeRemaining = (model.timeRemaining - config.timestep);
if (0 < model.timeRemaining){
enqueueOutgoingEvent(new BriscolaEvent(BriscolaEvent.COUNTDOWN_UPDATE, {remaining:model.timeRemaining}));
} else {
enqueueOutgoingEvent(new BriscolaEvent(BriscolaEvent.TIMELIMIT_HIT));
model.timeRemaining = 0;
model.timePaused = true;
if (!config.opengame){
gatherRemaining(((0 == playerInput.player)) ? 1 : 0);
};
endGame(CAUSE_TIMELIMIT_HIT);
};
};
executeTasks();
handleIncomingEvents();
dispatchOutgoingEvents();
}
private function onNewGame(_arg1:BriscolaEvent):void{
var _local3:int;
if (!stateMachine.transition(Model.STATE_STARTING_GAME)){
return;
};
model.state = stateMachine.currentState;
enqueueOutgoingEvent(new BriscolaEvent(BriscolaEvent.STARTING_GAME, {stock:model.stock.clone(true), timelimit:model.timeRemaining}));
var _local2:int;
while (_local2 < 2) {
_local3 = 0;
while (_local3 < 3) {
model.hands[_local2].pushBack(model.stock.pop());
_local3++;
};
_local2++;
};
model.trump = (model.stock.pop() as Card);
addTask((currentTick + config.startDelay), enterPlayerTurn, config.startingPlayer);
}
private function dealCards(_arg1:int):void{
Assert.assert((0 < model.stock.size()), "Trying to deal cards when stock is empty.");
if (!stateMachine.transition(Model.STATE_DEALING_CARDS)){
return;
};
model.state = stateMachine.currentState;
enqueueOutgoingEvent(new BriscolaEvent(BriscolaEvent.DEALING_CARDS));
model.hands[1].pushBack(model.stock.pop());
model.hands[0].pushBack((model.stock.size()) ? model.stock.pop() : model.trump);
addTask((currentTick + config.dealDelay), enterPlayerTurn, _arg1);
}
private function gameAcceptsCommandInState(_arg1:int, _arg2:String):Boolean{
switch (_arg2){
case BriscolaEvent.NEW_GAME:
return ((_arg1 == Model.STATE_PREGAME));
case BriscolaEvent.QUIT_GAME:
return (((!((_arg1 == Model.STATE_PREGAME))) && (!((_arg1 == Model.STATE_POSTGAME)))));
case BriscolaEvent.MAKE_PLAY:
return ((((_arg1 == Model.STATE_PLAYER1_TURN)) || ((_arg1 == Model.STATE_PLAYER2_TURN))));
default:
Log.warning((("Unrecognized event type (" + _arg2) + ") for main controller."));
return (false);
};
}
private function onQuitGame(_arg1:BriscolaEvent):void{
model.timeRemaining = 0;
model.timePaused = true;
enqueueOutgoingEvent(new BriscolaEvent(BriscolaEvent.COUNTDOWN_UPDATE, {remaining:model.timeRemaining}));
if (!config.opengame){
gatherRemaining(((0 == playerInput.player)) ? 1 : 0);
};
endGame(CAUSE_PLAYER_QUIT);
}
private function endFirstTimeHelp():void{
enqueueOutgoingEvent(new BriscolaEvent(BriscolaEvent.ENDING_FIRST_TIME_HELP));
model.helpShown = true;
model.timePaused = false;
}
private function handleIncomingEvents():void{
var _local1:BriscolaEvent;
while (hasIncomingEvents()) {
_local1 = dequeueIncomingEvent();
if (!gameAcceptsCommandInState(model.state, _local1.type)){
Log.warning((((("Incoming event to main controller is of illegal type (" + _local1.type) + ") for current game state (") + model.state) + ")."));
} else {
switch (_local1.type){
case BriscolaEvent.NEW_GAME:
onNewGame(_local1);
break;
case BriscolaEvent.QUIT_GAME:
onQuitGame(_local1);
break;
case BriscolaEvent.MAKE_PLAY:
onMakePlay(_local1);
break;
default:
Log.warning((("Incoming event to main controller is of unrecognized type (" + _local1.type) + ")."));
};
};
};
}
private function leastValueIndex(_arg1:int):int{
var _local4:int;
var _local2:Vector = new Vector();
_local2.pushBack({index:0, value:Card.briscolaPoints[model.hands[_arg1].get(0).rank]});
var _local3 = 1;
while (_local3 < model.hands[_arg1].size()) {
_local4 = Card.briscolaPoints[model.hands[_arg1].get(_local3).rank];
if (_local4 < _local2.get(0).value){
_local2.clear();
_local2.pushBack({index:_local3, value:_local4});
} else {
if (_local4 == _local2.get(0).value){
_local2.pushBack({index:_local3, value:_local4});
};
};
_local3++;
};
if (1 == _local2.size()){
return (_local2.get(0).index);
};
return (_local2.get(config.gameRand.nextInt(_local2.size())).index);
}
private function endGame(_arg1:int):void{
var _local2:int;
var _local5:int;
var _local6:int;
if (!stateMachine.transition(Model.STATE_POSTGAME)){
return;
};
model.state = stateMachine.currentState;
clearIncomingEvents();
clearTasks();
_local2 = model.points[0];
var _local3:int = model.points[1];
var _local4:int = (config.pointScore * _local2);
if (config.opengame){
model.timePaused = true;
enqueueOutgoingEvent(new BriscolaEvent(BriscolaEvent.ENDING_GAME, {cause:_arg1, points0:_local2, points1:_local3, winner:-1, score:_local4, bonus:0}));
} else {
_local5 = ((_local2 > _local3)) ? 0 : ((_local3 > _local2)) ? 1 : -1;
_local6 = Math.floor((config.timeScore * (model.timeRemaining / config.timelimit)));
enqueueOutgoingEvent(new BriscolaEvent(BriscolaEvent.ENDING_GAME, {cause:_arg1, points0:_local2, points1:_local3, winner:_local5, score:_local4, bonus:_local6}));
};
}
private function gatherRemaining(_arg1:int):void{
var _local2:int;
while (_local2 < 2) {
while (model.hands[_local2].size()) {
model.captured[_arg1].push(model.hands[_local2].popBack());
};
_local2++;
};
if (model.table[0]){
model.captured[_arg1].push(model.table[0]);
};
if (model.table[1]){
model.captured[_arg1].push(model.table[1]);
};
if (model.trump){
model.captured[_arg1].push(model.trump);
};
while (model.stock.size()) {
model.captured[_arg1].push(model.stock.pop());
};
model.points[_arg1] = (120 - model.points[((0 == _arg1)) ? 1 : 0]);
}
private function captureCards():void{
Assert.assert(((model.table[0]) && (model.table[1])), "Trying to capture cards when there are not two cards on the table.");
if (!stateMachine.transition(Model.STATE_CAPTURING_CARDS)){
return;
};
model.state = stateMachine.currentState;
var _local1 = -1;
var _local2:Card = (model.table[0] as Card);
var _local3:Card = (model.table[1] as Card);
if (_local2.suit == _local3.suit){
if (0 < Card.briscolaRankCompare(_local2, _local3)){
_local1 = 0;
} else {
_local1 = 1;
};
} else {
if (_local2.suit == model.trump.suit){
_local1 = 0;
} else {
if (_local3.suit == model.trump.suit){
_local1 = 1;
} else {
_local1 = model.leading;
};
};
};
var _local4:int = (Card.briscolaPoints[_local2.rank] + Card.briscolaPoints[_local3.rank]);
model.points[_local1] = (model.points[_local1] + _local4);
enqueueOutgoingEvent(new BriscolaEvent(BriscolaEvent.CAPTURING_CARDS, {player:_local1, points:_local4}));
model.leading = -1;
model.captured[_local1].push(model.table[0]);
model.table[0] = null;
model.captured[_local1].push(model.table[1]);
model.table[1] = null;
if (((config.opengame) && ((config.openGamePlayLimit == model.openGamePlayCount)))){
addTask((currentTick + config.captureDelay), endGame, CAUSE_FINISHED_GAME);
} else {
if (model.stock.size()){
addTask((currentTick + config.captureDelay), dealCards, _local1);
} else {
if (model.hands[_local1].size()){
addTask((currentTick + config.captureDelay), enterPlayerTurn, _local1);
} else {
addTask((currentTick + config.captureDelay), endGame, CAUSE_FINISHED_GAME);
};
};
};
}
}
}//package com.midasplayer.games.briscola
Section 69
//MainGraphics (com.midasplayer.games.briscola.MainGraphics)
package com.midasplayer.games.briscola {
import flash.display.*;
public dynamic class MainGraphics extends MovieClip {
public var pointsTable:MovieClip;
public var clock:MovieClip;
public var score:MovieClip;
public var effectsButton:MovieClip;
public var systemDialog:MovieClip;
public var stockCount:MovieClip;
public var capturedOpponent:MovieClip;
public var opponent:MovieClip;
public var capturedPlayer:MovieClip;
public var pointsOpponent:MovieClip;
public var quitButton:MovieClip;
public var cardScore:MovieClip;
public var cards:MovieClip;
public var resultsQuit:MovieClip;
public var logo:MovieClip;
public var messagePopup:MovieClip;
public var avatar:MovieClip;
public var pointsPlayer:MovieClip;
public var instructions:MovieClip;
public var musicButton:MovieClip;
}
}//package com.midasplayer.games.briscola
Section 70
//MainView (com.midasplayer.games.briscola.MainView)
package com.midasplayer.games.briscola {
import flash.events.*;
import flash.display.*;
import com.midasplayer.debug.*;
import de.polygonal.ds.*;
import com.midasplayer.sound.*;
import flash.text.*;
import com.midasplayer.util.*;
import com.midasplayer.text.*;
import sound.*;
import flash.utils.*;
import flash.system.*;
public class MainView {
private var gameMelody:ManagedSound;
private var handHighlight:Animation;
private var mainStateAnim:Animation;
private var stockCache:Vector;
private var clock:Clock;
private var scoreClip:MovieClip;
private var cardPoints:MovieClip;
private var memText:TextField;
private var stockCount:FieldClip;
private var controller:MainController;
private var soundManager:SoundManager;
private var currentState:uint;// = 0
private var opponentPoints:AnimatedPointsCounter;
private var soundButton:StandardButton;
private var playerPoints:AnimatedPointsCounter;
private var instructions:Instructions;
private var avatarContainer:MovieClip;
private var cardLayerClip:DisplayObjectContainer;
private var capturedCards:Array;
private var gameEndEvent:BriscolaEvent;
private var musicButton:StandardButton;
private var config:Config;
private var haveExited:Boolean;
private var musicManager:SoundManager;
private var tablePoints:AnimatedPointsCounter;
private var systemDialog:SystemDialog;
private var stageClicked:Boolean;
private var opponentCaptured:MovieClip;
private var opponent:Opponent;
private var playerCaptured:MovieClip;
private var quitButton:StandardButton;
private var cards:Array2;
private var mainGraphics:MainGraphics;
private var messagePopup:MessagePopup;
private var resultsQuit:BigButton;
private var resultMelody:ManagedSound;
private var gameView:GameView;
private var results:Results;
private var introMelody:ManagedSound;
private var stage:Stage;
private static const GAME_FRAME:uint = 23;
private static const RESULT_TRANSITION_END_FRAME:uint = 50;
private static const RESULT_TRANSITION_START_FRAME:uint = 24;
private static const STATE_INVALID:uint = 0;
private static const GAME_TRANSITION_END_FRAME:uint = 23;
private static const STATE_GAME:uint = 3;
private static const GAME_TRANSITION_START_FRAME:uint = 2;
private static const INTRO_FRAME:uint = 1;
private static const STATE_QUIT:uint = 7;
private static const STATE_RESULT_TRANSITION:uint = 4;
private static const RESULT_FRAME:uint = 50;
private static const STATE_RESULT:uint = 5;
private static const STATE_GAME_TRANSITION:uint = 2;
private static const STATE_OPEN_GAME_END:uint = 6;
private static const STATE_INTRO:uint = 1;
public static var objectClicked:Boolean;
public static var tryLoadAvatar:Boolean;
public function MainView(_arg1:Config, _arg2:Stage, _arg3:MainController){
var _local4:FPSGraph;
soundManager = new SoundManager();
musicManager = new SoundManager();
mainGraphics = new MainGraphics();
cards = new Array2(4, 10);
stockCache = new Vector(40);
mainStateAnim = new Animation(mainGraphics);
messagePopup = new MessagePopup(mainGraphics.messagePopup);
soundButton = new StandardButton(mainGraphics.effectsButton, 1, StandardButton.STATE_ON);
musicButton = new StandardButton(mainGraphics.musicButton, 2, StandardButton.STATE_ON);
quitButton = new StandardButton(mainGraphics.quitButton, 3, StandardButton.STATE_ON);
stockCount = new FieldClip(mainGraphics.stockCount);
tablePoints = new AnimatedPointsCounter(mainGraphics.pointsTable, mainGraphics.pointsTable.clip.field);
playerPoints = new AnimatedPointsCounter(mainGraphics.pointsPlayer, mainGraphics.pointsPlayer.field);
opponentPoints = new AnimatedPointsCounter(mainGraphics.pointsOpponent, mainGraphics.pointsOpponent.field);
playerCaptured = mainGraphics.capturedPlayer;
opponentCaptured = mainGraphics.capturedOpponent;
cardPoints = mainGraphics.cardScore;
scoreClip = mainGraphics.score;
cardLayerClip = mainGraphics.cards;
super();
this.config = _arg1;
this.stage = _arg2;
this.controller = _arg3;
clock = new Clock(mainGraphics.clock, _arg1.timelimit);
opponent = new Opponent(_arg1.randSeed, mainGraphics.opponent);
resultsQuit = new BigButton(mainGraphics.resultsQuit, I18n.getString("rslt_quitbutton_line1"), I18n.getString("rslt_quitbutton_line2"));
soundButton.functionState = _arg1.gameData.getElementTextAsInt("sound");
soundManager.setVolume((soundButton.functionState * _arg1.masterSoundVolume));
musicButton.functionState = _arg1.gameData.getElementTextAsInt("music");
musicManager.setVolume((musicButton.functionState * _arg1.masterMusicVolume));
soundButton.visible = false;
musicButton.visible = false;
quitButton.visible = false;
stockCount.visible = false;
stockCount.text = "40";
mainGraphics.pointsTable.gotoAndStop("inactive");
mainGraphics.pointsTable.visible = false;
resultsQuit.visible = false;
playerCaptured.visible = false;
opponentCaptured.visible = false;
cardPoints.visible = false;
scoreClip.visible = false;
stopAnimationOnFullTree(mainGraphics);
disableMouseOnFullTree(mainGraphics);
mainGraphics.mouseChildren = true;
_arg2.addChild(mainGraphics);
createCardsAndStockCache();
if (_arg1.opengame){
systemDialog = new SystemDialog(_arg1, mainGraphics.systemDialog);
systemDialog.visible = false;
} else {
mainGraphics.removeChild(mainGraphics.systemDialog);
};
if (tryLoadAvatar){
avatarContainer = mainGraphics.avatar;
avatarContainer.visible = false;
} else {
mainGraphics.removeChild(mainGraphics.avatar);
};
if (_arg1.debug){
_local4 = new FPSGraph();
_local4.alpha = 0.5;
_arg2.addChild(_local4);
_local4.startMonitor();
memText = new TextField();
memText.defaultTextFormat = new TextFormat("Times New Roman", 12, 0xCCCCCC, true);
memText.mouseEnabled = false;
memText.text = ("Mem: " + (System.totalMemory / 1000000).toString().slice(0, 5));
_arg2.addChild(memText);
};
_arg2.addEventListener(MouseEvent.CLICK, onStageClick);
enterIntroState();
}
private function exitFromResults():void{
if (haveExited){
return;
};
haveExited = true;
resultMelody.fadeToAndStop(0, config.resultMelodyFadeOut);
results.deactivate();
quit();
}
private function transitionToGameState():void{
currentState = STATE_GAME_TRANSITION;
handHighlight = new Animation(new HandHighlight());
handHighlight.goto("inactive");
cardLayerClip.addChild(handHighlight.clip);
soundButton.deactivate();
musicButton.deactivate();
quitButton.visible = true;
stockCount.visible = true;
mainGraphics.pointsTable.visible = true;
instructions.deactivate();
instructions.transitionOut();
opponent.animateIdle();
mainStateAnim.animate(GAME_TRANSITION_START_FRAME, GAME_TRANSITION_END_FRAME, 0, false, enterGameState);
introMelody.fadeToAndStop(0, (config.introMelodyFadeOut * 1000));
setTimeout(function ():void{
soundManager.getFromClass(gamestart).play(config.gameChimeVolume);
}, (config.gameChimeDelay * 1000));
gameMelody = musicManager.getFromClass(game);
setTimeout(function ():void{
gameMelody.loop(0);
gameMelody.fadeTo(config.gameMelodyVolume, config.gameMelodyFadeIn);
}, (config.gameMelodyDelay * 1000));
}
public function update(_arg1:Number):void{
var _local2:MovieClip;
if ((soundButton.functionState * config.masterSoundVolume) != soundManager.getVolume()){
soundManager.setVolume((soundButton.functionState * config.masterSoundVolume));
};
if ((musicButton.functionState * config.masterMusicVolume) != musicManager.getVolume()){
musicManager.setVolume((musicButton.functionState * config.masterMusicVolume));
};
soundManager.update();
musicManager.update();
if (((tryLoadAvatar) && (Main.avatarFactory))){
_local2 = (Main.avatarFactory.getAvatar(config.avatar) as MovieClip);
_local2.scaleX = -1;
_local2.x = (_local2.x + 109);
_local2.y = (_local2.y + -27);
avatarContainer.removeChild(avatarContainer.clip);
avatarContainer.addChild(_local2);
avatarContainer.visible = true;
config.gameComm.enqueuePlayData(BriscolaEvent.messagePlayData("Avatar loaded"));
tryLoadAvatar = false;
};
switch (currentState){
case STATE_INTRO:
if (((stageClicked) || (instructions.done))){
transitionToGameState();
};
break;
case STATE_GAME:
gameView.update(_arg1);
if (gameView.finished){
gameEndEvent = gameView.gameEndEvent;
capturedCards = gameView.pointCards;
if (config.opengame){
config.gameComm.gameEnd((gameEndEvent.score + gameEndEvent.bonus));
enterOpenGameEndState();
} else {
config.gameComm.addPlayData(new BriscolaEvent(BriscolaEvent.USER_SETTINGS, {sound:soundButton.functionState, music:musicButton.functionState, firstGame:(config.firstgame) ? 1 : 0}).toPlayData());
config.gameComm.gameEnd((gameEndEvent.score + gameEndEvent.bonus));
transitionToResultState();
};
};
break;
case STATE_RESULT:
if (((stageClicked) || (results.done))){
exitFromResults();
};
break;
case STATE_OPEN_GAME_END:
if (systemDialog.closed){
gameMelody.fadeToAndStop(0, 200);
quit();
};
break;
case STATE_INVALID:
Log.warning("Main view is in invalid state during update.");
break;
};
objectClicked = false;
stageClicked = false;
if (memText){
memText.text = ("Mem: " + (System.totalMemory / 1000000).toString().slice(0, 5));
};
}
private function enterResultState():void{
currentState = STATE_RESULT;
soundButton.activate();
musicButton.activate();
quitButton.visible = false;
playerCaptured.visible = true;
opponentCaptured.visible = true;
results.activate(config, playerCaptured, opponentCaptured, gameEndEvent, capturedCards);
gameEndEvent = null;
capturedCards = null;
}
public function stopAnimationOnFullTree(_arg1:DisplayObjectContainer):void{
var _local3:Object;
if ((_arg1 is MovieClip)){
(_arg1 as MovieClip).stop();
};
var _local2:int;
while (_local2 < _arg1.numChildren) {
_local3 = _arg1.getChildAt(_local2);
if ((_local3 is DisplayObjectContainer)){
stopAnimationOnFullTree((_local3 as DisplayObjectContainer));
};
_local2++;
};
}
private function transitionToResultState():void{
currentState = STATE_RESULT_TRANSITION;
gameView = null;
handHighlight = null;
soundButton.deactivate();
musicButton.deactivate();
quitButton.deactivate();
resultsQuit.visible = true;
cardPoints.visible = true;
scoreClip.visible = true;
scoreClip.closeText.visible = false;
opponent.animateOutro();
results = new Results(config, resultsQuit, cardPoints, scoreClip, soundManager);
mainStateAnim.animate(RESULT_TRANSITION_START_FRAME, RESULT_TRANSITION_END_FRAME, 0, false, enterResultState);
resultMelody = musicManager.getFromClass(result);
setTimeout(function ():void{
resultMelody.play(config.resultMelodyVolume);
}, (config.resultMelodyDelay * 1000));
}
private function enterGameState():void{
currentState = STATE_GAME;
instructions = null;
soundButton.activate();
musicButton.activate();
quitButton.activate();
var _local1:Sprite = new Sprite();
cardLayerClip.addChild(_local1);
cardLayerClip.mouseChildren = true;
config.gameComm.gameStart();
gameView = new GameView(config, stage, controller, cards, stockCache, messagePopup, quitButton, stockCount, clock, tablePoints, playerPoints, opponentPoints, opponent, _local1, handHighlight, soundManager, musicManager);
}
private function createCardsAndStockCache():void{
var _local6:uint;
var _local7:DisplayCard;
var _local8:BitmapData;
var _local9:Bitmap;
var _local1:Sprite = new Sprite();
var _local2:int = Math.abs(Math.ceil((40 * config.stockPosDiffX)));
var _local3:int = Math.abs(Math.ceil((40 * config.stockPosDiffY)));
var _local4:int;
var _local5:uint = Card.SUIT_COINS;
while (_local5 <= Card.SUIT_CLUBS) {
_local6 = Card.RANK_ACE;
while (_local6 <= Card.RANK_KING) {
_local7 = new DisplayCard(_local5, _local6);
_local7.clip.mouseEnabled = false;
_local7.clip.mouseChildren = false;
cards.set(_local5, (_local6 - 1), _local7);
_local7.clip.x = (((_local4 * config.stockPosDiffX) + (config.stockPosRandX * (0.5 - config.viewRand.nextDouble()))) + 2);
_local7.clip.y = ((((_local4 * config.stockPosDiffY) + (config.stockPosRandY * (0.5 - config.viewRand.nextDouble()))) + 2) + _local3);
_local4++;
_local1.addChild(_local7.clip);
if ((((1 == (_local4 % 4))) || ((_local4 == 40)))){
_local8 = new BitmapData((93 + _local2), (160 + _local3), true, 0);
_local8.draw(_local1);
_local9 = new Bitmap(_local8);
stockCache.pushBack(_local9);
} else {
stockCache.pushBack(null);
};
_local6++;
};
_local5++;
};
}
private function quit():void{
currentState = STATE_QUIT;
config.gameComm.gameQuit();
}
private function onStageClick(_arg1:Event):void{
if (!objectClicked){
stageClicked = true;
};
}
private function enterOpenGameEndState():void{
currentState = STATE_OPEN_GAME_END;
quitButton.deactivate();
systemDialog.visible = true;
systemDialog.animIn();
}
private function disableMouseOnFullTree(_arg1:InteractiveObject):void{
var _local2:DisplayObjectContainer;
var _local3:int;
var _local4:Object;
_arg1.mouseEnabled = false;
if ((_arg1 is DisplayObjectContainer)){
_local2 = (_arg1 as DisplayObjectContainer);
_local2.mouseChildren = false;
_local3 = 0;
while (_local3 < _local2.numChildren) {
_local4 = _local2.getChildAt(_local3);
if ((_local4 is InteractiveObject)){
disableMouseOnFullTree((_local4 as InteractiveObject));
};
_local3++;
};
};
}
private function enterIntroState():void{
currentState = STATE_INTRO;
soundButton.visible = true;
soundButton.activate();
musicButton.visible = true;
musicButton.activate();
opponent.animateIntro();
instructions = new Instructions(config, mainGraphics.instructions);
instructions.activate();
introMelody = musicManager.getFromClass(intro);
introMelody.play(config.introMelodyVolume);
}
}
}//package com.midasplayer.games.briscola
Section 71
//MessagePopup (com.midasplayer.games.briscola.MessagePopup)
package com.midasplayer.games.briscola {
import flash.display.*;
public class MessagePopup extends FieldClip {
private var anim:Animation;
public function MessagePopup(_arg1:MovieClip){
super(_arg1.textClip);
anim = new Animation(_arg1);
anim.goto("inactive");
anim.clip.mouseEnabled = false;
anim.clip.mouseChildren = false;
}
override public function set visible(_arg1:Boolean):void{
anim.clip.visible = _arg1;
}
public function animIn():void{
anim.animate(11, 28, 0, false, animOut);
}
override public function get visible():Boolean{
return (anim.clip.visible);
}
override public function set text(_arg1:String):void{
anim.clip.textClip.field.text = _arg1;
anim.clip.textBack.field.text = _arg1;
}
public function animOut():void{
anim.animate(1, 10, 0.5, false, function ():void{
visible = false;
});
}
}
}//package com.midasplayer.games.briscola
Section 72
//Model (com.midasplayer.games.briscola.Model)
package com.midasplayer.games.briscola {
import de.polygonal.ds.*;
import com.midasplayer.math.*;
public class Model {
public var leading:int;// = -1
public var table:Array;
public var helpShown:Boolean;// = false
public var state:int;// = 2
public var stock:ArrayedStack;
public var trump:Card;
public var timePaused:Boolean;// = true
public var captured:Array;
public var points:Array;
public var hands:Array;
public var timeRemaining:Number;
public var openGamePlayCount:int;// = 0
public static const STATE_PLAYER2_TURN:int = 1;
public static const STATE_STARTING_GAME:int = 3;
public static const STATE_PREGAME:int = 2;
public static const STATE_DEALING_CARDS:int = 6;
public static const STATE_POSTGAME:int = 7;
public static const STATE_PLAYING_CARD:int = 4;
public static const STATE_CAPTURING_CARDS:int = 5;
public static const STATE_PLAYER1_TURN:int = 0;
public function Model(_arg1:Number, _arg2:ArrayedStack=null, _arg3:MtRandom=null){
var _local4:uint;
var _local5:uint;
table = [null, null];
hands = [new Vector(3), new Vector(3)];
captured = [new ArrayedStack(40), new ArrayedStack(40)];
points = [0, 0];
super();
if (_arg2){
stock = _arg2;
} else {
stock = new ArrayedStack(40);
_local4 = Card.SUIT_COINS;
while (_local4 <= Card.SUIT_CLUBS) {
_local5 = Card.RANK_ACE;
while (_local5 <= Card.RANK_KING) {
stock.push(new Card(_local4, _local5));
_local5++;
};
_local4++;
};
};
if (_arg3){
shuffle(stock, _arg3);
};
timeRemaining = _arg1;
}
private function shuffle(_arg1:ArrayedStack, _arg2:MtRandom):void{
var _local3:Vector = new Vector(_arg1.size());
var _local4:uint;
while (_local4 < _arg1.size()) {
_local3.pushBack(_arg2.nextDouble());
_local4++;
};
_arg1.shuffle(_local3);
}
}
}//package com.midasplayer.games.briscola
Section 73
//Opponent (com.midasplayer.games.briscola.Opponent)
package com.midasplayer.games.briscola {
import flash.events.*;
import flash.display.*;
import com.midasplayer.math.*;
import com.midasplayer.text.*;
public class Opponent {
private var worried2_in:Animation;
private var worried2_out:Animation;
private var idleAnims:Array;
private var rand:MtRandom;
private var sad2_in:Animation;
private var sad1_out:Animation;
private var sad3_out:Animation;
private var currentAnim:Animation;
private var happy2_in:Animation;
private var help:Animation;
private var lastWorried:int;// = -1
private var sadAnims:Array;
public var clip:MovieClip;
private var lastSad:int;// = -1
private var worried3_in:Animation;
private var happy3_out:Animation;
private var intro:Animation;
private var happy1_out:Animation;
private var sad3_in:Animation;
private var happyAnims:Array;
private var lastIdle:int;// = -1
private var worried1_out:Animation;
private var happy3_in:Animation;
private var worried3_out:Animation;
private var worried1_in:Animation;
private var sad2_out:Animation;
private var sad4_out:Animation;
private var worried:Animation;
private var worriedAnims:Array;
public var helpOpponent:Animation;
private var sad1_in:Animation;
private var happy1_in:Animation;
private var currentAnimName:String;
private var sad:Animation;
private var idle1:Animation;
private var idle2:Animation;
private var idle3:Animation;
private var idle4:Animation;
private var sad4_in:Animation;
private var happy:Animation;
private var idle5:Animation;
private var lastHappy:int;// = -1
private var happy2_out:Animation;
public function Opponent(_arg1:int, _arg2:MovieClip){
this.clip = _arg2;
this.rand = new MtRandom(_arg1);
intro = new Animation(_arg2.intro);
help = new Animation(_arg2.help);
help.clip.bubble.field.text = I18n.getString("game_first_time_help");
help.goto("inactive");
helpOpponent = new Animation(_arg2.help.opponent);
idle1 = new Animation(_arg2.idle1);
idle2 = new Animation(_arg2.idle2);
idle3 = new Animation(_arg2.idle3);
idle4 = new Animation(_arg2.idle4);
idle5 = new Animation(_arg2.idle5);
worried = new Animation(_arg2.worried);
worried1_in = new Animation(_arg2.worried1_in);
worried1_out = new Animation(_arg2.worried1_out);
worried2_in = new Animation(_arg2.worried2_in);
worried2_out = new Animation(_arg2.worried2_out);
worried3_in = new Animation(_arg2.worried3_in);
worried3_out = new Animation(_arg2.worried3_out);
sad = new Animation(_arg2.sad);
sad1_in = new Animation(_arg2.sad1_in);
sad1_out = new Animation(_arg2.sad1_out);
sad2_in = new Animation(_arg2.sad2_in);
sad2_out = new Animation(_arg2.sad2_out);
sad3_in = new Animation(_arg2.sad3_in);
sad3_out = new Animation(_arg2.sad3_out);
sad4_in = new Animation(_arg2.sad4_in);
sad4_out = new Animation(_arg2.sad4_out);
happy = new Animation(_arg2.happy);
happy1_in = new Animation(_arg2.happy1_in);
happy1_out = new Animation(_arg2.happy1_out);
happy2_in = new Animation(_arg2.happy2_in);
happy2_out = new Animation(_arg2.happy2_out);
happy3_in = new Animation(_arg2.happy3_in);
happy3_out = new Animation(_arg2.happy3_out);
idleAnims = [[{anim:idle1, start:1, end:idle1.clip.totalFrames}], [{anim:idle2, start:1, end:idle2.clip.totalFrames}], [{anim:idle3, start:1, end:idle3.clip.totalFrames}], [{anim:idle4, start:1, end:idle4.clip.totalFrames}]];
worriedAnims = [[{anim:worried1_in, start:1, end:worried1_in.clip.totalFrames}, {anim:worried, start:9, end:34}, {anim:worried1_out, start:1, end:worried1_out.clip.totalFrames}], [{anim:worried2_in, start:1, end:worried2_in.clip.totalFrames}, {anim:worried, start:39, end:83}, {anim:worried2_out, start:1, end:worried2_out.clip.totalFrames}], [{anim:worried3_in, start:1, end:worried3_in.clip.totalFrames}, {anim:worried, start:85, end:137}, {anim:worried3_out, start:1, end:worried3_out.clip.totalFrames}]];
sadAnims = [[{anim:sad1_in, start:1, end:sad1_in.clip.totalFrames}, {anim:sad, start:14, end:39}, {anim:sad1_out, start:1, end:sad1_out.clip.totalFrames}], [{anim:sad2_in, start:1, end:sad2_in.clip.totalFrames}, {anim:sad, start:46, end:80}, {anim:sad2_out, start:1, end:sad2_out.clip.totalFrames}], [{anim:sad3_in, start:1, end:sad3_in.clip.totalFrames}, {anim:sad, start:89, end:121}, {anim:sad3_out, start:1, end:sad3_out.clip.totalFrames}], [{anim:sad4_in, start:1, end:sad4_in.clip.totalFrames}, {anim:sad, start:125, end:171}, {anim:sad4_out, start:1, end:sad4_out.clip.totalFrames}]];
happyAnims = [[{anim:happy1_in, start:1, end:happy1_in.clip.totalFrames}, {anim:happy, start:10, end:43}, {anim:happy1_out, start:1, end:happy1_out.clip.totalFrames}], [{anim:happy2_in, start:1, end:happy2_in.clip.totalFrames}, {anim:happy, start:55, end:94}, {anim:happy2_out, start:1, end:happy2_out.clip.totalFrames}], [{anim:happy3_in, start:1, end:happy3_in.clip.totalFrames}, {anim:happy, start:88, end:141}, {anim:happy3_out, start:1, end:happy3_out.clip.totalFrames}]];
intro.clip.visible = false;
help.clip.visible = false;
idle1.clip.visible = false;
idle2.clip.visible = false;
idle3.clip.visible = false;
idle4.clip.visible = false;
idle5.clip.visible = false;
worried.clip.visible = false;
worried1_in.clip.visible = false;
worried1_out.clip.visible = false;
worried2_in.clip.visible = false;
worried2_out.clip.visible = false;
worried3_in.clip.visible = false;
worried3_out.clip.visible = false;
sad.clip.visible = false;
sad1_in.clip.visible = false;
sad1_out.clip.visible = false;
sad2_in.clip.visible = false;
sad2_out.clip.visible = false;
sad3_in.clip.visible = false;
sad3_out.clip.visible = false;
sad4_in.clip.visible = false;
sad4_out.clip.visible = false;
happy.clip.visible = false;
happy1_in.clip.visible = false;
happy1_out.clip.visible = false;
happy2_in.clip.visible = false;
happy2_out.clip.visible = false;
happy3_in.clip.visible = false;
happy3_out.clip.visible = false;
_arg2.stop();
_arg2.mouseEnabled = false;
_arg2.mouseChildren = false;
currentAnim = intro;
currentAnim.clip.visible = true;
currentAnimName = "intro";
}
private function hideShadow(_arg1:Event):void{
currentAnim.clip.shadow.visible = false;
idle5.clip.removeEventListener(Event.ENTER_FRAME, hideShadow);
}
private function animEmotion(_arg1:Array, _arg2:int):int{
var nextIndex:int;
var next:Array;
var anims = _arg1;
var last = _arg2;
if (1 == anims.length){
nextIndex = 0;
} else {
if (-1 == last){
nextIndex = rand.nextInt(anims.length);
} else {
nextIndex = rand.nextInt((anims.length - 1));
if (nextIndex >= last){
nextIndex = (nextIndex + 1);
};
};
};
next = anims[nextIndex];
if (1 == next.length){
animate(next[0].anim, next[0].start, next[0].end, animateIdle);
} else {
if (3 == next.length){
animate(next[0].anim, next[0].start, next[0].end, function ():void{
animate(next[1].anim, next[1].start, next[1].end, function ():void{
animate(next[2].anim, next[2].start, next[2].end, animateIdle);
});
});
};
};
return (nextIndex);
}
public function animateIntro():void{
currentAnimName = "intro";
animateLoop(intro, 1, intro.clip.totalFrames);
}
private function animateLoop(_arg1:Animation, _arg2:int, _arg3:int, _arg4:uint=0, _arg5:uint=0):void{
currentAnim.stopAnim(false);
currentAnim.clip.visible = false;
currentAnim = _arg1;
currentAnim.clip.visible = true;
if (_arg4){
currentAnim.animateLoop(_arg2, _arg3, _arg4, _arg5, 0);
} else {
currentAnim.animate(_arg2, _arg3, 0, true);
};
}
public function animateSad():void{
currentAnimName = "sad";
lastSad = animEmotion(sadAnims, lastSad);
}
public function animateHelpOut(_arg1:Function=null):void{
animate(help, 16, 29, _arg1);
}
public function stopAnim():void{
currentAnim.stopAnim(false);
currentAnim.clip.visible = false;
currentAnim = idle1;
currentAnim.clip.visible = true;
}
public function animateIdle():void{
currentAnimName = "idle";
lastIdle = animEmotion(idleAnims, lastIdle);
}
public function get visible():Boolean{
return (clip.visible);
}
public function animateHappy():void{
currentAnimName = "happy";
lastHappy = animEmotion(happyAnims, lastHappy);
}
public function animateHelpIn(_arg1:Function=null):void{
currentAnimName = "help";
animate(help, 1, 15, _arg1);
helpOpponent.animate(1, helpOpponent.clip.totalFrames, 0, true);
}
public function animateWorried():void{
if (((("sad" == currentAnimName)) || (("happy" == currentAnimName)))){
return;
};
currentAnimName = "worried";
lastWorried = animEmotion(worriedAnims, lastWorried);
}
public function animateOutro():void{
currentAnimName = "outro";
animateLoop(idle5, 1, idle5.clip.totalFrames);
idle5.clip.addEventListener(Event.ENTER_FRAME, hideShadow);
}
private function animate(_arg1:Animation, _arg2:int, _arg3:int, _arg4:Function=null):void{
currentAnim.stopAnim(false);
currentAnim.clip.visible = false;
currentAnim = _arg1;
currentAnim.clip.visible = true;
if (null != _arg4){
currentAnim.animate(_arg2, _arg3, 0, false, _arg4);
} else {
currentAnim.animate(_arg2, _arg3);
};
}
public function set visible(_arg1:Boolean):void{
clip.visible = _arg1;
}
}
}//package com.midasplayer.games.briscola
Section 74
//PlayerInputReceiver (com.midasplayer.games.briscola.PlayerInputReceiver)
package com.midasplayer.games.briscola {
public class PlayerInputReceiver {
public var player:uint;
private var handler:Function;
public function PlayerInputReceiver(_arg1:uint, _arg2:Function){
this.player = _arg1;
this.handler = _arg2;
}
public function handleEvent(_arg1:BriscolaEvent):void{
_arg1["player"] = player;
handler(_arg1);
}
}
}//package com.midasplayer.games.briscola
Section 75
//Results (com.midasplayer.games.briscola.Results)
package com.midasplayer.games.briscola {
import flash.events.*;
import flash.display.*;
import de.polygonal.ds.*;
import com.midasplayer.sound.*;
import flash.text.*;
import com.greensock.*;
import com.midasplayer.text.*;
import sound.*;
public class Results {
private var cardShowDelta:Number;
private var totalText:TextField;
private var score:TextField;
private var _playerPointTicker:Number;// = 0
private var soundManager:SoundManager;
private var bonus:TextField;
private var opponentPoints:FieldClip;
private var playerPoints:FieldClip;
private var closeEnabled:Boolean;
private var _totalTicker:Number;// = 0
private var countdownStart:Number;
private var cardShowStart:Number;
private var countdownFinished:Boolean;
private var total:TextField;
private var countdownField:FieldClip;
private var _bonusTicker:Number;// = 0
private var opponentCaptured:Vector;
private var _opponentPointTicker:Number;// = 0
private var playerCaptured:Vector;
private var quitButton:BigButton;
private var countdownAnim:Animation;
private var scoreText:TextField;
private var countdownLast:Number;
private var bonusText:TextField;
private var cardShowEnd:Number;
private var countdownLength:Number;
private var _scoreTicker:Number;// = 0
public function Results(_arg1:Config, _arg2:BigButton, _arg3:MovieClip, _arg4:MovieClip, _arg5:SoundManager){
this.quitButton = _arg2;
this.soundManager = _arg5;
playerPoints = new FieldClip(_arg3.player);
opponentPoints = new FieldClip(_arg3.opponent);
score = _arg4.score;
scoreText = _arg4.scoreText;
bonus = _arg4.bonus;
bonusText = _arg4.bonusText;
total = _arg4.total;
totalText = _arg4.totalText;
_arg3.player.field.blendMode = BlendMode.LAYER;
_arg3.opponent.field.blendMode = BlendMode.LAYER;
score.blendMode = (scoreText.blendMode = BlendMode.LAYER);
bonus.blendMode = (bonusText.blendMode = BlendMode.LAYER);
total.blendMode = (totalText.blendMode = BlendMode.LAYER);
_arg4.closeText.clip.field.blendMode = BlendMode.LAYER;
scoreText.text = I18n.getString("rslt_score");
bonusText.text = I18n.getString("rslt_bonus");
totalText.text = I18n.getString("rslt_total");
countdownAnim = new Animation(_arg4.closeText);
countdownLength = _arg1.resultsCountdownLength;
countdownLast = countdownLength;
countdownField = new FieldClip(_arg4.closeText.clip);
countdownField.text = I18n.getString("rslt_countdown", countdownLength.toString());
}
public function get done():Boolean{
return (((quitButton.pressed) || (countdownFinished)));
}
public function get bonusTicker():Number{
return (_bonusTicker);
}
public function get scoreTicker():Number{
return (_scoreTicker);
}
public function get totalTicker():Number{
return (_totalTicker);
}
public function get opponentPointTicker():Number{
return (_opponentPointTicker);
}
public function set bonusTicker(_arg1:Number):void{
_bonusTicker = _arg1;
bonus.text = Math.floor(_arg1).toString();
}
public function get playerPointTicker():Number{
return (_playerPointTicker);
}
public function set playerPointTicker(_arg1:Number):void{
_playerPointTicker = _arg1;
playerPoints.text = Math.floor(_arg1).toString();
}
private function lineUpCapturedCards(_arg1:Config, _arg2:Vector, _arg3:DisplayObjectContainer):void{
var _local9:DisplayCard;
var _local10:Number;
var _local11:Number;
var _local12:Number;
if (0 == _arg2.size()){
return;
};
var _local4:Number = 0;
var _local5:Number = _arg1.cardLineupRadius;
var _local6:Number = Math.min(_arg1.cardLineupMaxDist, (_arg1.cardLineupMaxWidth / _arg2.size()));
var _local7:Number = ((-0.5 * (_arg2.size() - 1)) * _local6);
var _local8:int;
while (_local8 < _arg2.size()) {
_local9 = (_arg2.get(_local8) as DisplayCard);
_local9.clip.visible = false;
_arg3.addChild(_local9.clip);
_local10 = ((_local7 * Math.PI) / 180);
_local11 = Math.sin(_local10);
_local12 = Math.cos(_local10);
_local9.clip.scaleX = _arg1.cardLineupScale;
_local9.clip.scaleY = _arg1.cardLineupScale;
_local9.clip.x = Math.round(((((_local12 * -(_local4)) - (_local11 * -(_local5))) + _local4) - (((_local12 * 0.5) * _arg1.cardLineupScale) * DisplayCard.WIDTH)));
_local9.clip.y = Math.round(((((_local11 * -(_local4)) + (_local12 * -(_local5))) + _local5) - (((_local11 * 0.5) * _arg1.cardLineupScale) * DisplayCard.WIDTH)));
_local9.clip.rotation = _local7;
if (!_local9.faceUp){
_local9.flip();
};
_local7 = (_local7 + _local6);
_local8++;
};
}
public function set opponentPointTicker(_arg1:Number):void{
_opponentPointTicker = _arg1;
opponentPoints.text = Math.floor(_arg1).toString();
}
public function animInCloseText():void{
countdownStart = (new Date().getTime() / 1000);
countdownAnim.clip.visible = true;
countdownAnim.animate(6, 10);
closeEnabled = true;
countdownAnim.clip.addEventListener(Event.ENTER_FRAME, updateCountdown);
}
public function animOutCloseText():void{
countdownAnim.clip.removeEventListener(Event.ENTER_FRAME, updateCountdown);
countdownAnim.animate(1, 5);
}
public function set totalTicker(_arg1:Number):void{
_totalTicker = _arg1;
total.text = Math.floor(_arg1).toString();
}
private function updateCountdown(_arg1:Event):void{
var _local2:Number = (new Date().getTime() / 1000);
var _local3:Number = (countdownLength - (_local2 - countdownStart));
if (0 < _local3){
if (_local3 != countdownLast){
countdownField.text = I18n.getString("rslt_countdown", Math.ceil(_local3).toString());
countdownLast = _local3;
};
} else {
countdownField.text = I18n.getString("rslt_countdown", "0");
countdownFinished = true;
countdownAnim.clip.removeEventListener(Event.ENTER_FRAME, updateCountdown);
};
}
private function showCards(_arg1:Event=null):void{
var _local3:int;
var _local2:Number = new Date().getTime();
_local3 = 0;
while (_local3 < playerCaptured.size()) {
if (_local2 > ((_local3 * cardShowDelta) + cardShowStart)){
if (false == playerCaptured.get(_local3).clip.visible){
playerCaptured.get(_local3).clip.visible = true;
};
};
_local3++;
};
_local3 = 0;
while (_local3 < opponentCaptured.size()) {
if (_local2 > ((_local3 * cardShowDelta) + cardShowStart)){
if (false == opponentCaptured.get(_local3).clip.visible){
opponentCaptured.get(_local3).clip.visible = true;
};
};
_local3++;
};
if (_local2 > cardShowEnd){
countdownAnim.clip.removeEventListener(Event.ENTER_FRAME, showCards);
};
}
public function activate(_arg1:Config, _arg2:DisplayObjectContainer, _arg3:DisplayObjectContainer, _arg4:BriscolaEvent, _arg5:Array):void{
var config = _arg1;
var playerCaptured = _arg2;
var opponentCaptured = _arg3;
var gameEndEvent = _arg4;
var capturedCards = _arg5;
this.playerCaptured = capturedCards[0];
this.opponentCaptured = capturedCards[1];
lineUpCapturedCards(config, capturedCards[0], playerCaptured);
lineUpCapturedCards(config, capturedCards[1], opponentCaptured);
quitButton.activate();
TweenLite.delayedCall(config.resultScoreStart, function (_arg1:Results):void{
soundManager.getFromClass(scorecount).play(config.scoreCountVolume);
TweenLite.to(_arg1, config.resultScoreDuration, {playerPointTicker:gameEndEvent.points0, opponentPointTicker:gameEndEvent.points1, scoreTicker:gameEndEvent.score});
_arg1.cardShowStart = new Date().getTime();
_arg1.cardShowEnd = (cardShowStart + (1000 * config.resultScoreDuration));
_arg1.cardShowDelta = ((cardShowEnd - cardShowStart) / Math.max(capturedCards[0].size(), capturedCards[1].size()));
countdownAnim.clip.addEventListener(Event.ENTER_FRAME, showCards);
}, [this]);
TweenLite.delayedCall(config.resultBonusStart, function (_arg1:Results):void{
TweenLite.to(_arg1, config.resultBonusDuration, {bonusTicker:gameEndEvent.bonus});
}, [this]);
TweenLite.delayedCall(config.resultTotalStart, function (_arg1:Results):void{
soundManager.getFromClass(scorecount).fadeToAndStop(0, 50);
soundManager.getFromClass(scoreding).play(config.scoreDingVolume);
totalTicker = (gameEndEvent.score + gameEndEvent.bonus);
_arg1.total.alpha = 0;
TweenLite.to(_arg1.total, config.resultTotalDuration, {alpha:1});
}, [this]);
TweenLite.delayedCall(config.resultCloseTextStart, function ():void{
if (((!(quitButton.pressed)) && (!((-1 == countdownStart))))){
animInCloseText();
};
});
}
public function deactivate():void{
if (countdownStart){
animOutCloseText();
} else {
countdownStart = -1;
};
quitButton.deactivate();
}
public function set scoreTicker(_arg1:Number):void{
_scoreTicker = _arg1;
score.text = Math.floor(_arg1).toString();
}
}
}//package com.midasplayer.games.briscola
Section 76
//StandardButton (com.midasplayer.games.briscola.StandardButton)
package com.midasplayer.games.briscola {
import flash.events.*;
import flash.display.*;
public class StandardButton {
private var icon:MovieClip;
private var off:MovieClip;
private var anim:Animation;
private var _functionState:uint;
public static const STATE_OFF:uint = 0;
private static const MOUSE_OUT_FRAME:uint = 2;
private static const INACTIVE:uint = 6;
public static const STATE_ON:uint = 1;
private static const MOUSE_PRESS_FRAME:uint = 7;
private static const MOUSE_RELEASE_FRAME:uint = 8;
private static const MOUSE_OVER_FRAME:uint = 1;
public function StandardButton(_arg1:MovieClip, _arg2:uint, _arg3:uint){
anim = new Animation(_arg1);
icon = anim.clip.icon;
off = anim.clip.off;
anim.goto("inactive");
icon.gotoAndStop(_arg2);
off.stop();
this.functionState = _arg3;
anim.clip.mouseChildren = false;
deactivate();
}
public function set functionState(_arg1:uint):void{
_functionState = _arg1;
off.visible = ((_arg1 == STATE_ON)) ? false : true;
}
public function mouseClick(_arg1:Event):void{
MainView.objectClicked = true;
mouseOut(null);
functionState = ((_functionState == STATE_ON)) ? STATE_OFF : STATE_ON;
}
public function set visible(_arg1:Boolean):void{
anim.clip.visible = _arg1;
}
public function mouseOver(_arg1:Event):void{
anim.stopAnim(false);
anim.currentFrame = MOUSE_OVER_FRAME;
}
public function mouseDown(_arg1:Event):void{
anim.stopAnim(false);
anim.currentFrame = MOUSE_PRESS_FRAME;
}
public function get functionState():uint{
return (_functionState);
}
public function activate():void{
anim.clip.mouseEnabled = true;
anim.clip.addEventListener(MouseEvent.MOUSE_OVER, mouseOver);
anim.clip.addEventListener(MouseEvent.MOUSE_OUT, mouseOut);
anim.clip.addEventListener(MouseEvent.MOUSE_DOWN, mouseDown);
anim.clip.addEventListener(MouseEvent.CLICK, mouseClick);
}
public function mouseOut(_arg1:Event):void{
anim.animate(MOUSE_OUT_FRAME, INACTIVE);
}
public function stopAnim():void{
anim.stopAnim(false);
}
public function loadAnim():void{
anim.animateBounce(2, 5);
}
public function get visible():Boolean{
return (anim.clip.visible);
}
public function deactivate():void{
anim.clip.mouseEnabled = false;
anim.clip.removeEventListener(MouseEvent.MOUSE_OVER, mouseOver);
anim.clip.removeEventListener(MouseEvent.MOUSE_OUT, mouseOut);
anim.clip.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDown);
anim.clip.removeEventListener(MouseEvent.CLICK, mouseClick);
if (anim.currentFrame != INACTIVE){
mouseOut(null);
};
}
}
}//package com.midasplayer.games.briscola
Section 77
//StateMachine (com.midasplayer.games.briscola.StateMachine)
package com.midasplayer.games.briscola {
import de.polygonal.ds.*;
import com.midasplayer.util.*;
public class StateMachine {
private var states:Vector;
private var state:int;
private var transitions:Vector;
public function StateMachine(){
states = new Vector();
transitions = new Vector();
super();
}
public function legalTransition(_arg1:int, _arg2:int):Boolean{
Assert.assert(!((-1 == states.indexOf(_arg1))), "State to transition from does not exist.");
Assert.assert(!((-1 == states.indexOf(_arg2))), "State to transition to does not exist.");
return (!((-1 == transitions.get(states.indexOf(_arg1)).indexOf(_arg2))));
}
public function addState(_arg1:int):void{
if (0 < states.size()){
Assert.assert((-1 == states.indexOf(_arg1)), "State already added to state machine.");
};
if (!states.size()){
this.state = _arg1;
};
states.pushBack(_arg1);
transitions.pushBack(new Vector());
}
public function transition(_arg1:int):Boolean{
Assert.assert((0 < states.size()), "State machine does not contain any states.");
if (legalTransition(state, _arg1)){
state = _arg1;
return (true);
};
Log.error("Attempted state transition is illegal.");
return (false);
}
public function addTransition(_arg1:int, _arg2:int):void{
Assert.assert((0 < states.size()), "Adding transition to state machine without any states.");
var _local3:int = states.indexOf(_arg1);
Assert.assert(!((-1 == _local3)), "Transition's 'from' state has not been added to state machine.");
Assert.assert(!((-1 == states.indexOf(_arg2))), "Transition's 'to' state has not been added to state machine.");
if ((((0 < transitions.size())) && ((0 < transitions.get(_local3).size())))){
Assert.assert((-1 == transitions.get(_local3).indexOf(_arg2)), "Transition have already been added to state machine.");
};
transitions.get(_local3).pushBack(_arg2);
}
public function get currentState():int{
Assert.assert((0 < states.size()), "State machine does not contain any states.");
return (state);
}
}
}//package com.midasplayer.games.briscola
Section 78
//SystemDialog (com.midasplayer.games.briscola.SystemDialog)
package com.midasplayer.games.briscola {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import com.midasplayer.text.*;
import flash.utils.*;
public class SystemDialog {
private var config:Config;
private var closeButton:Animation;
private var _closed:Boolean;
private var anim:Animation;
private var title:TextField;
private var text:TextField;
private var button:Animation;
private var closing:Boolean;
private var buttonText:TextField;
private static const DIALOG_OUT_START:int = 1;
private static const DIALOG_INACTIVE:int = 9;
private static const DIALOG_IN_END:int = 15;
private static const DIALOG_IN_START:int = 10;
private static const BUTTON_INACTIVE:int = 21;
private static const BUTTON_MOUSE_PRESS:int = 10;
private static const DIALOG_ACTIVE:int = 15;
private static const BUTTON_MOUSE_OUT_END:int = 21;
private static const BUTTON_MOUSE_OUT_START:int = 18;
private static const BUTTON_MOUSE_RELEASE_END:int = 21;
private static const BUTTON_MOUSE_RELEASE_START:int = 11;
private static const DIALOG_OUT_END:int = 9;
private static const BUTTON_MOUSE_OVER_END:int = 9;
private static const BUTTON_MOUSE_OVER_START:int = 1;
public function SystemDialog(_arg1:Config, _arg2:MovieClip){
this.config = _arg1;
anim = new Animation(_arg2);
button = new Animation(anim.clip.clip.button);
closeButton = new Animation(anim.clip.clip.closeButton);
title = anim.clip.clip.title;
text = anim.clip.clip.text;
buttonText = anim.clip.clip.button.textClip.field;
anim.goto("inactive");
button.goto("inactive");
closeButton.goto("inactive");
anim.clip.mouseEnabled = false;
anim.clip.clip.mouseEnabled = false;
anim.clip.clip.mouseChildren = true;
button.clip.mouseEnabled = true;
button.clip.mouseChildren = false;
closeButton.clip.mouseEnabled = false;
closeButton.clip.mouseChildren = false;
title.mouseEnabled = false;
text.mouseEnabled = false;
buttonText.mouseEnabled = false;
closeButton.clip.visible = false;
title.text = I18n.getString("register_header");
text.text = I18n.getString("register_desc");
buttonText.text = I18n.getString("register_button");
title.blendMode = (text.blendMode = (buttonText.blendMode = BlendMode.NORMAL));
deactivate();
}
public function press():void{
mouseClick(null);
}
public function activate():void{
anim.clip.mouseChildren = true;
anim.clip.clip.mouseChildren = true;
button.clip.mouseEnabled = true;
button.clip.addEventListener(MouseEvent.MOUSE_OVER, mouseOver);
button.clip.addEventListener(MouseEvent.MOUSE_OUT, mouseOut);
button.clip.addEventListener(MouseEvent.MOUSE_DOWN, mouseDown);
button.clip.addEventListener(MouseEvent.CLICK, mouseClick);
}
public function set closed(_arg1:Boolean):void{
_closed = _arg1;
}
public function mouseOver(_arg1:Event):void{
button.animate(BUTTON_MOUSE_OVER_START, BUTTON_MOUSE_OVER_END);
}
public function animIn():void{
anim.animate(DIALOG_IN_START, DIALOG_IN_END, 0, false, activate);
setTimeout(function ():void{
if (closing){
return;
};
closing = true;
deactivate();
animOut();
}, (config.openGameDialogTimeout * 1000));
}
public function mouseClick(_arg1:Event):void{
if (closing){
return;
};
closing = true;
deactivate();
animOut();
button.animate(BUTTON_MOUSE_RELEASE_START, BUTTON_MOUSE_RELEASE_END);
}
public function mouseDown(_arg1:Event):void{
button.stopAnim(false);
button.currentFrame = BUTTON_MOUSE_PRESS;
}
public function mouseOut(_arg1:Event):void{
button.animate(BUTTON_MOUSE_OUT_START, BUTTON_MOUSE_OUT_END);
}
public function set visible(_arg1:Boolean):void{
anim.clip.visible = _arg1;
}
public function get closed():Boolean{
return (_closed);
}
public function deactivate():void{
anim.clip.mouseChildren = false;
anim.clip.clip.mouseChildren = false;
button.clip.mouseEnabled = false;
button.clip.removeEventListener(MouseEvent.MOUSE_OVER, mouseOver);
button.clip.removeEventListener(MouseEvent.MOUSE_OUT, mouseOut);
button.clip.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDown);
button.clip.removeEventListener(MouseEvent.CLICK, mouseClick);
}
public function get visible():Boolean{
return (anim.clip.visible);
}
public function animOut(_arg1:Function=null):void{
var onComplete = _arg1;
deactivate();
anim.animate(DIALOG_OUT_START, DIALOG_OUT_END, 0, false, function ():void{
_closed = true;
});
}
}
}//package com.midasplayer.games.briscola
Section 79
//Task (com.midasplayer.games.briscola.Task)
package com.midasplayer.games.briscola {
public class Task {
public var handler:Function;
public var onTick:Number;
private var args:Array;
public function Task(_arg1:Number, _arg2:Function, _arg3:Array){
this.onTick = _arg1;
this.handler = _arg2;
this.args = _arg3;
}
public function execute():void{
handler.apply(null, args);
}
}
}//package com.midasplayer.games.briscola
Section 80
//TaskManager (com.midasplayer.games.briscola.TaskManager)
package com.midasplayer.games.briscola {
import de.polygonal.ds.*;
import com.midasplayer.util.*;
public class TaskManager {
public var currentTick:Number;// = 0
private var tasks:Vector;
public function TaskManager(){
tasks = new Vector();
super();
}
protected function executeTasks():void{
var _local1:int;
while (_local1 < tasks.size()) {
Log.debugIf((currentTick > tasks.get(_local1).onTick), "Tick on which task should execute has passed.");
if (currentTick >= tasks.get(_local1).onTick){
tasks.removeAt(_local1).execute();
} else {
_local1++;
};
};
}
protected function clearTasks():void{
tasks.clear();
}
protected function addTask(_arg1:Number, _arg2:Function, ... _args):void{
var _local5:int;
var _local4:Task = new Task(_arg1, _arg2, _args);
if (_arg1 <= currentTick){
_local4.execute();
} else {
if (!tasks.size()){
tasks.pushBack(_local4);
} else {
if (_local4.onTick >= tasks.get((tasks.size() - 1)).onTick){
tasks.pushBack(_local4);
} else {
_local5 = (tasks.size() - 1);
while (_local5 >= 0) {
if (_local5 > 0){
if (_local4.onTick >= tasks.get((_local5 - 1)).onTick){
tasks.insertAt(_local5, _local4);
break;
};
} else {
tasks.insertAt(0, _local4);
};
_local5--;
};
};
};
};
}
protected function numTasks():int{
return (tasks.size());
}
protected function removeTask(_arg1:Function):Task{
var _local2:int;
while (_local2 < tasks.size()) {
if (_arg1 == tasks.get(_local2).handler){
return ((tasks.removeAt(_local2) as Task));
};
_local2++;
};
return (null);
}
}
}//package com.midasplayer.games.briscola
Section 81
//ViewModel (com.midasplayer.games.briscola.ViewModel)
package com.midasplayer.games.briscola {
import de.polygonal.ds.*;
public class ViewModel extends Model {
public function ViewModel(_arg1:Number, _arg2:ArrayedStack){
super(_arg1, _arg2);
}
}
}//package com.midasplayer.games.briscola
Section 82
//ViewStock (com.midasplayer.games.briscola.ViewStock)
package com.midasplayer.games.briscola {
import flash.display.*;
import de.polygonal.ds.*;
import flash.geom.*;
public class ViewStock extends ArrayedStack {
public var clip:Sprite;
private var cache:Vector;
public function ViewStock(_arg1:Array2, _arg2:ArrayedStack, _arg3:Vector, _arg4:Vector){
var _local6:Card;
var _local7:DisplayCard;
clip = new Sprite();
super(_arg2.size());
var _local5:int;
while (_local5 < _arg2.size()) {
_local6 = (_arg2.get(_local5) as Card);
_local7 = (_arg1.get(_local6.suit, (_local6.rank - 1)) as DisplayCard);
_local7.clip.x = _arg3.get(_local5).x;
_local7.clip.y = _arg3.get(_local5).y;
push(_local7);
clip.addChild(_local7.clip);
_local5++;
};
this.cache = _arg4;
updateClip();
}
override public function pop():Object{
var _local1:DisplayCard = (super.pop() as DisplayCard);
var _local2:Point = clip.localToGlobal(new Point(_local1.clip.x, _local1.clip.y));
_local1.clip.x = _local2.x;
_local1.clip.y = _local2.y;
updateClip();
return (_local1);
}
private function updateClip():void{
while (0 < clip.numChildren) {
clip.removeChildAt(0);
};
var _local1:int = (size() - 1);
while ((((0 <= _local1)) && (!(cache.get(_local1))))) {
_local1--;
};
if (-1 < _local1){
var _temp1 = _local1;
_local1 = (_local1 + 1);
clip.addChild((cache.get(_temp1) as Bitmap));
} else {
_local1 = 0;
};
var _local2:int = _local1;
while (_local2 < size()) {
clip.addChild(get(_local2).clip);
_local2++;
};
}
}
}//package com.midasplayer.games.briscola
Section 83
//MtRandom (com.midasplayer.math.MtRandom)
package com.midasplayer.math {
import flash.utils.*;
public class MtRandom {
private var mt:Array;
private var mti:uint;
public var seed:uint;
public static var MATRIX_A:uint = 2567483615;
public static var UPPER_MASK:uint = 2147483648;
public static var LOWER_MASK:uint = 2147483647;
public static var M:int = 397;
public static var N:int = 624;
private static var mag01:Array = [uint(0), uint(MATRIX_A)];
public function MtRandom(_arg1:uint=0){
mti = (N + 1);
super();
if (_arg1 == 0){
_arg1 = getTimer();
};
this.seed = _arg1;
mt = new Array(N);
init_genrand(_arg1);
}
public function nextInt(_arg1:uint):uint{
return (((genrand_int32() & 2147483647) % _arg1));
}
private function init_genrand(_arg1:uint):void{
var _local2:uint;
var _local3:uint;
mt[0] = uint(_arg1);
mti = 1;
while (mti < N) {
_local2 = (mt[(mti - 1)] ^ (mt[(mti - 1)] >>> 30));
_local3 = uint((_local2 * 1289));
_local3 = uint((_local3 * 1406077));
_local3 = uint((_local3 + mti));
mt[mti] = _local3;
mti++;
};
}
public function nextFloat():Number{
return ((next(24) / 16777216));
}
public function setSeed(_arg1:uint):void{
init_genrand(_arg1);
}
private function next(_arg1:uint):uint{
return ((genrand_int32() & ((uint(1) << _arg1) - uint(1))));
}
public function nextDouble():Number{
return ((next(24) / 16777216));
}
private function genrand_int32():uint{
var _local1:Number;
var _local2:uint;
if (mti >= N){
if (mti == (N + 1)){
init_genrand(5489);
};
_local2 = 0;
while (_local2 < (N - M)) {
_local1 = ((mt[_local2] & UPPER_MASK) | (mt[(_local2 + 1)] & LOWER_MASK));
mt[_local2] = ((mt[(_local2 + M)] ^ (_local1 >>> 1)) ^ mag01[uint((_local1 & 1))]);
_local2++;
};
while (_local2 < (N - 1)) {
_local1 = ((mt[_local2] & UPPER_MASK) | (mt[(_local2 + 1)] & LOWER_MASK));
mt[_local2] = ((mt[(_local2 + (M - N))] ^ (_local1 >>> 1)) ^ mag01[uint((_local1 & 1))]);
_local2++;
};
_local1 = ((mt[(N - 1)] & UPPER_MASK) | (mt[0] & LOWER_MASK));
mt[(N - 1)] = ((mt[(M - 1)] ^ (_local1 >>> 1)) ^ mag01[uint((_local1 & 1))]);
mti = 0;
};
_local1 = mt[mti++];
_local1 = (_local1 ^ (_local1 >>> 11));
_local1 = (_local1 ^ ((_local1 << 7) & 2636928640));
_local1 = (_local1 ^ ((_local1 << 15) & 4022730752));
_local1 = (_local1 ^ (_local1 >>> 18));
return (uint(_local1));
}
}
}//package com.midasplayer.math
Section 84
//ManagedSound (com.midasplayer.sound.ManagedSound)
package com.midasplayer.sound {
import flash.media.*;
public class ManagedSound {
public var activeSounds:Array;
private var manager:SoundManager;
private var ClassReference:Class;
public function ManagedSound(_arg1:SoundManager, _arg2:Class){
activeSounds = new Array();
super();
this.manager = _arg1;
this.ClassReference = _arg2;
}
public function stop():void{
var _local1:int;
while (_local1 < activeSounds.length) {
activeSounds[_local1].stop();
_local1++;
};
}
public function play(_arg1:Number=1, _arg2:Number=0, _arg3:Number=0):ManagedSoundChannel{
var _local4:SoundChannel = new ClassReference().play(_arg2, 0, new SoundTransform(_arg1, _arg3));
return (new ManagedSoundChannel(manager, this, _local4));
}
public function loop(_arg1:Number=1, _arg2:Number=0, _arg3:Number=0, _arg4:Number=999999999):ManagedSoundChannel{
var _local5:SoundChannel = new ClassReference().play(_arg2, _arg4, new SoundTransform(_arg1, _arg3));
return (new ManagedSoundChannel(manager, this, _local5));
}
public function fadeToAndStop(_arg1:Number, _arg2:Number):void{
var _local3:int;
while (_local3 < activeSounds.length) {
activeSounds[_local3].fadeToAndStop(_arg1, _arg2);
_local3++;
};
}
public function isPlaying():Boolean{
return ((activeSounds.length > 0));
}
public function update():void{
var _local1:int;
while (_local1 < activeSounds.length) {
activeSounds[_local1].update();
_local1++;
};
}
public function fadeTo(_arg1:Number, _arg2:Number):void{
var _local3:int;
while (_local3 < activeSounds.length) {
activeSounds[_local3].fadeTo(_arg1, _arg2);
_local3++;
};
}
public function panTo(_arg1:Number, _arg2:Number):void{
var _local3:int;
while (_local3 < activeSounds.length) {
activeSounds[_local3].panTo(_arg1, _arg2);
_local3++;
};
}
public function setPan(_arg1:Number):void{
var _local2:int;
while (_local2 < activeSounds.length) {
activeSounds[_local2].setPan(_arg1);
_local2++;
};
}
public function setVolume(_arg1:Number):void{
var _local2:int;
while (_local2 < activeSounds.length) {
activeSounds[_local2].setVolume(_arg1);
_local2++;
};
}
}
}//package com.midasplayer.sound
Section 85
//ManagedSoundChannel (com.midasplayer.sound.ManagedSoundChannel)
package com.midasplayer.sound {
import flash.events.*;
import flash.media.*;
import flash.utils.*;
public class ManagedSoundChannel {
private var fadeStartVolume:Number;// = -1
private var channel:SoundChannel;
private var fadeEndVolume:Number;// = -1
private var targetVolume:Number;
private var targetPan:Number;
private var sound:ManagedSound;
private var stopAfterFade:Boolean;// = false
private var panEndTime:Number;// = -1
private var fadeEndTime:Number;// = -1
private var manager:SoundManager;
private var playing:Boolean;// = true
private var panStartTime:Number;// = -1
private var fadeStartTime:Number;// = -1
private var panEndVolume:Number;// = -1
private var panStartVolume:Number;// = -1
public function ManagedSoundChannel(_arg1:SoundManager, _arg2:ManagedSound, _arg3:SoundChannel){
this.manager = _arg1;
this.sound = _arg2;
this.channel = _arg3;
_arg2.activeSounds.push(this);
if (_arg3 == null){
soundComplete(null);
return;
};
_arg3.addEventListener(Event.SOUND_COMPLETE, soundComplete);
targetVolume = _arg3.soundTransform.volume;
targetPan = _arg3.soundTransform.pan;
update();
}
public function stop():void{
if (!playing){
return;
};
if (channel == null){
return;
};
channel.stop();
soundComplete(null);
}
public function update():void{
var _local1:Number;
if (!playing){
return;
};
if (fadeStartTime >= 0){
_local1 = ((getTimer() - fadeStartTime) / (fadeEndTime - fadeStartTime));
if (_local1 < 0){
_local1 = 0;
};
if (_local1 > 1){
_local1 = 1;
};
targetVolume = (fadeStartVolume + ((fadeEndVolume - fadeStartVolume) * _local1));
targetVolume = (targetVolume * targetVolume);
if (_local1 == 1){
fadeStartTime = -1;
};
if ((((_local1 == 1)) && (stopAfterFade))){
stop();
};
};
if (panStartTime >= 0){
_local1 = ((getTimer() - panStartTime) / (panEndTime - panStartTime));
if (_local1 < 0){
_local1 = 0;
};
if (_local1 > 1){
_local1 = 1;
};
targetPan = (panStartVolume + ((panEndVolume - panStartVolume) * _local1));
if (_local1 == 1){
panStartTime = -1;
};
};
var _local2:Number = (targetVolume * manager.volume);
var _local3:Number = targetPan;
if (channel == null){
return;
};
if (((!((_local2 == channel.soundTransform.volume))) || (!((_local3 == channel.soundTransform.pan))))){
channel.soundTransform = new SoundTransform(_local2, _local3);
};
}
public function panTo(_arg1:Number, _arg2:Number):void{
if (!playing){
return;
};
panStartVolume = targetPan;
panEndVolume = _arg1;
panStartTime = getTimer();
panEndTime = (getTimer() + _arg2);
}
public function fadeTo(_arg1:Number, _arg2:Number):void{
if (!playing){
return;
};
fadeStartVolume = Math.sqrt(targetVolume);
fadeEndVolume = Math.sqrt(_arg1);
fadeStartTime = getTimer();
fadeEndTime = (getTimer() + _arg2);
stopAfterFade = false;
}
public function setPan(_arg1:Number):void{
if (!playing){
return;
};
if (channel == null){
return;
};
channel.soundTransform.pan = _arg1;
panStartTime = -1;
update();
}
public function fadeToAndStop(_arg1:Number, _arg2:Number):void{
if (!playing){
return;
};
fadeTo(_arg1, _arg2);
stopAfterFade = true;
}
public function setVolume(_arg1:Number):void{
if (!playing){
return;
};
stopAfterFade = false;
this.targetVolume = _arg1;
fadeStartTime = -1;
update();
}
public function soundComplete(_arg1:Event):void{
if (!playing){
return;
};
sound.activeSounds.splice(sound.activeSounds.indexOf(this), 1);
playing = false;
}
public function isPlaying():Boolean{
return (playing);
}
}
}//package com.midasplayer.sound
Section 86
//SoundManager (com.midasplayer.sound.SoundManager)
package com.midasplayer.sound {
import flash.utils.*;
public class SoundManager {
private var fadeStartVolume:Number;// = -1
private var lastTime:Number;// = -1
private var managedSounds:Array;
private var fadeEndTime:Number;// = -1
private var fadeStartTime:Number;// = -1
private var fadeEndVolume:Number;// = -1
public var volume:Number;// = 1
private var managedSoundMap:Object;
public function SoundManager(){
managedSoundMap = new Object();
managedSounds = new Array();
super();
}
public function getVolume():Number{
return (volume);
}
public function update():void{
var _local3:Number;
var _local1:Number = getTimer();
if (lastTime < 0){
lastTime = _local1;
};
if (fadeStartTime >= 0){
_local3 = ((getTimer() - fadeStartTime) / (fadeEndTime - fadeStartTime));
if (_local3 < 0){
_local3 = 0;
};
if (_local3 > 1){
_local3 = 1;
};
volume = (fadeStartVolume + ((fadeEndVolume - fadeStartVolume) * _local3));
volume = (volume * volume);
if (_local3 == 1){
fadeStartTime = -1;
};
};
var _local2:int;
while (_local2 < managedSounds.length) {
managedSounds[_local2].update();
_local2++;
};
}
public function stopAll():void{
var _local1:int;
while (_local1 < managedSounds.length) {
managedSounds[_local1].stop();
_local1++;
};
}
public function getFromClass(_arg1:Class):ManagedSound{
var _local2:String = getQualifiedClassName(_arg1);
if (managedSoundMap[_local2] == null){
managedSoundMap[_local2] = new ManagedSound(this, _arg1);
managedSounds.push(managedSoundMap[_local2]);
};
return (managedSoundMap[_local2]);
}
public function get(_arg1:String):ManagedSound{
var classReference:Class;
var name = _arg1;
if (!managedSoundMap[name]){
try {
classReference = (getDefinitionByName(name) as Class);
} catch(e:ReferenceError) {
try {
classReference = (getDefinitionByName(("sound." + name)) as Class);
} catch(e:ReferenceError) {
throw (new Error(("Failed to find sound " + name)));
};
};
managedSoundMap[name] = new ManagedSound(this, classReference);
managedSounds.push(managedSoundMap[name]);
};
return (managedSoundMap[name]);
}
public function fadeTo(_arg1:Number, _arg2:Number):void{
fadeStartVolume = Math.sqrt(volume);
fadeEndVolume = Math.sqrt(_arg1);
fadeStartTime = getTimer();
fadeEndTime = (getTimer() + _arg2);
}
public function setVolume(_arg1:Number):void{
this.volume = _arg1;
fadeStartTime = -1;
}
}
}//package com.midasplayer.sound
Section 87
//I18n (com.midasplayer.text.I18n)
package com.midasplayer.text {
public class I18n {
private static var m_strings:Object;
public static function init(_arg1:Object):void{
var _local2:String;
m_strings = new Object();
for (_local2 in _arg1) {
m_strings[_local2] = _arg1[_local2];
};
}
public static function getString(_arg1:String, ... _args):String{
var _local3:String;
var _local4:int;
var _local5:RegExp;
if (m_strings[_arg1] != undefined){
_local3 = m_strings[_arg1];
if (_args.length > 0){
_local4 = 0;
while (_local4 < _args.length) {
_local5 = new RegExp((("\\{" + _local4) + "\\}"), "gi");
_local3 = _local3.replace(_local5, _args[_local4]);
_local4++;
};
};
return (_local3);
} else {
};
return ((!NULL! + !NULL!));
}
}
}//package com.midasplayer.text
Section 88
//IFloat (com.midasplayer.timing.IFloat)
package com.midasplayer.timing {
public class IFloat {
public var ivalue:Number;
private var lastValue:Number;
private static var alpha:Number;
public function IFloat(_arg1:Number){
ivalue = _arg1;
lastValue = _arg1;
alpha = 0;
}
public function get value():Number{
return ((lastValue + ((ivalue - lastValue) * alpha)));
}
public function set(_arg1:Number):void{
lastValue = ivalue;
ivalue = _arg1;
}
public function get(_arg1:Number):Number{
return ((lastValue + ((ivalue - lastValue) * _arg1)));
}
public function set value(_arg1:Number):void{
ivalue = _arg1;
lastValue = _arg1;
}
public function setTo(_arg1:Number):void{
ivalue = _arg1;
lastValue = _arg1;
}
public function copyFrom(_arg1:IFloat):void{
ivalue = _arg1.ivalue;
lastValue = _arg1.lastValue;
}
public static function setAlpha(_arg1:Number):void{
alpha = _arg1;
}
}
}//package com.midasplayer.timing
Section 89
//IRenderable (com.midasplayer.timing.IRenderable)
package com.midasplayer.timing {
public interface IRenderable {
function render(_arg1:int, _arg2:Number):void;
}
}//package com.midasplayer.timing
Section 90
//ITickable (com.midasplayer.timing.ITickable)
package com.midasplayer.timing {
public interface ITickable {
function tick(_arg1:int):void;
}
}//package com.midasplayer.timing
Section 91
//Timeable (com.midasplayer.timing.Timeable)
package com.midasplayer.timing {
public interface Timeable extends ITickable, IRenderable {
}
}//package com.midasplayer.timing
Section 92
//Timer (com.midasplayer.timing.Timer)
package com.midasplayer.timing {
import flash.utils.*;
public class Timer {
private var unprocessedTime:Number;// = 0
private var lastTime:Number;// = 0
private var millisPerGameTick:Number;// = 0
private var timeable:Timeable;
private var maxTickTime:Number;// = -1
private var startTime:Number;// = -1
private var time:Number;// = 0
private var tick:Number;// = 0
public function Timer(_arg1:Timeable, _arg2:Number){
millisPerGameTick = (1000 * _arg2);
this.timeable = _arg1;
this.maxTickTime = 500;
}
public function getMillisPerTick():Number{
return (millisPerGameTick);
}
public function advanceTime2():void{
var _local4:int;
var _local1:int = getTimer();
if (startTime < 0){
startTime = _local1;
unprocessedTime = millisPerGameTick;
};
time = (_local1 - startTime);
var _local2:int = (time - lastTime);
lastTime = time;
unprocessedTime = (unprocessedTime + _local2);
if (unprocessedTime >= millisPerGameTick){
_local4 = (maxTickTime + _local1);
do {
timeable.tick(tick);
tick++;
unprocessedTime = (unprocessedTime - millisPerGameTick);
} while ((((unprocessedTime >= millisPerGameTick)) && ((getTimer() < _local4))));
};
var _local3:Number = ((unprocessedTime % millisPerGameTick) / millisPerGameTick);
IFloat.setAlpha(_local3);
timeable.render(tick, _local3);
}
public function advanceTime():void{
time = getTimer();
var _local1:int = (time - lastTime);
lastTime = time;
unprocessedTime = (unprocessedTime + _local1);
var _local2:Number = 0;
while (unprocessedTime > millisPerGameTick) {
unprocessedTime = (unprocessedTime - millisPerGameTick);
timeable.tick(tick);
tick++;
_local2++;
if (_local2 >= 10){
unprocessedTime = 0;
};
};
var _local3:Number = (unprocessedTime / millisPerGameTick);
IFloat.setAlpha(_local3);
timeable.render(tick, _local3);
}
public function setMaxTickTime(_arg1:Number):void{
maxTickTime = _arg1;
}
}
}//package com.midasplayer.timing
Section 93
//Assert (com.midasplayer.util.Assert)
package com.midasplayer.util {
public class Assert {
public static var enabled:Boolean = true;
private static var handlers:Array = [defaultHandler];
public static function verify(_arg1:Boolean, _arg2:String=null):void{
assert(_arg1, _arg2);
}
public static function getAsFormattedString(_arg1:String, _arg2:String, _arg3:int, _arg4:String, _arg5:String, _arg6:String=null):String{
return ((((((("Assertion failure in " + _arg4) + ".") + _arg5) + (_arg1) ? (": " + _arg1) : "") + (_arg2) ? (((" " + _arg2) + ":") + _arg3) : "") + (_arg6) ? ("\n" + _arg6) : "\n"));
}
public static function assert(_arg1:Boolean, _arg2:String=null):void{
var _local3:String;
var _local4:int;
var _local5:int;
var _local7:int;
var _local10:int;
var _local11:String;
var _local16:String;
if (((!(enabled)) || (_arg1))){
return;
};
_local3 = new Error().getStackTrace();
_local3 = _local3.substring((_local3.indexOf("\n", 6) + 1));
_local4 = 4;
_local5 = _local3.indexOf("/", _local4);
var _local6:int = _local3.indexOf("(", _local4);
_local7 = _local3.indexOf("\n", _local4);
var _local8:int = ((_local5 >= _local7)) ? _local6 : (("$" == _local3.charAt((_local5 - 1)))) ? (_local5 - 1) : _local5;
var _local9:int = ((_local5 >= _local7)) ? _local4 : (_local5 + 1);
_local10 = _local6;
_local11 = _local3.substring((_local3.indexOf("[") + 1), _local3.indexOf("]"));
var _local12:String = _local11.substring(0, _local11.lastIndexOf(":"));
var _local13:int = int(_local11.substring((_local11.lastIndexOf(":") + 1)));
var _local14:String = _local3.substring(_local4, _local8);
var _local15:String = _local3.substring(_local9, _local10);
if (handlers[(handlers.length - 1)](_arg2, _local12, _local13, _local14, _local15, _local3)){
_local16 = getAsFormattedString(_arg2, _local12, _local13, _local14, _local15, null);
throw (new AssertionError(_local16.substr(0, (_local16.length - 1))));
};
}
public static function pushHandler(_arg1:Function):void{
handlers.push(_arg1);
}
public static function halt(_arg1:String=null):void{
if (_arg1){
throw (new Error(_arg1));
};
throw (new Error("Halting execution"));
}
public static function popHandler():void{
Assert.assert((1 < handlers.length), "Trying to pop the default assertion handler.");
if (1 < handlers.length){
handlers.pop();
};
}
private static function defaultHandler(_arg1:String, _arg2:String, _arg3:int, _arg4:String, _arg5:String, _arg6:String):Boolean{
return (true);
}
}
}//package com.midasplayer.util
Section 94
//AssertionError (com.midasplayer.util.AssertionError)
package com.midasplayer.util {
public class AssertionError extends Error {
public function AssertionError(_arg1:String){
super(_arg1);
}
}
}//package com.midasplayer.util
Section 95
//Log (com.midasplayer.util.Log)
package com.midasplayer.util {
public class Log {
public static const LEVEL_ERROR:int = 0;
public static const LEVEL_DEBUG:int = 3;
public static const LEVEL_WARNING:int = 1;
public static const LEVEL_INFO:int = 2;
public static var enabled:Boolean = true;
public static var level:int = 1;
private static var handlers:Array = [defaultHandler];
public static function errorIf(_arg1:Boolean, _arg2:String):void{
if (_arg1){
error(_arg2);
};
}
public static function attachHandler(_arg1:Function):void{
handlers.push(_arg1);
}
public static function error(_arg1:String):void{
var _local3:Function;
var _local2:Boolean;
if (((enabled) && ((LEVEL_ERROR <= level)))){
for each (_local3 in handlers) {
_local2 = ((_local3(LEVEL_ERROR, _arg1)) || (_local2));
};
};
if (_local2){
Assert.halt(("Log handler requested halt to execution - Error: " + _arg1));
};
}
public static function debugIf(_arg1:Boolean, _arg2:String):void{
if (_arg1){
debug(_arg2);
};
}
public static function debug(_arg1:String):void{
var _local3:Function;
var _local2:Boolean;
if (((enabled) && ((LEVEL_DEBUG <= level)))){
for each (_local3 in handlers) {
_local2 = ((_local3(LEVEL_DEBUG, _arg1)) || (_local2));
};
};
if (_local2){
Assert.halt(("Log handler requested halt to execution - Debug: " + _arg1));
};
}
public static function warningIf(_arg1:Boolean, _arg2:String):void{
if (_arg1){
warning(_arg2);
};
}
public static function warning(_arg1:String):void{
var _local3:Function;
var _local2:Boolean;
if (((enabled) && ((LEVEL_WARNING <= level)))){
for each (_local3 in handlers) {
_local2 = ((_local3(LEVEL_WARNING, _arg1)) || (_local2));
};
};
if (_local2){
Assert.halt(("Log handler requested halt to execution - Warning: " + _arg1));
};
}
public static function infoIf(_arg1:Boolean, _arg2:String):void{
if (_arg1){
info(_arg2);
};
}
public static function info(_arg1:String):void{
var _local3:Function;
var _local2:Boolean;
if (((enabled) && ((LEVEL_INFO <= level)))){
for each (_local3 in handlers) {
_local2 = ((_local3(LEVEL_INFO, _arg1)) || (_local2));
};
};
if (_local2){
Assert.halt(("Log handler requested halt to execution - Info: " + _arg1));
};
}
public static function defaultHandler(_arg1:int, _arg2:String):Boolean{
trace((((_arg1 == LEVEL_ERROR)) ? "Error: " : ((_arg1 == LEVEL_WARNING)) ? "Warning: " : ((_arg1 == LEVEL_INFO)) ? "Info: " : "Debug: " + _arg2));
return ((_arg1 == LEVEL_ERROR));
}
public static function detachHandler(_arg1:Function):void{
handlers.splice(handlers.indexOf(_arg1), 1);
}
}
}//package com.midasplayer.util
Section 96
//NumberFormat (de.polygonal.core.fmt.NumberFormat)
package de.polygonal.core.fmt {
public class NumberFormat {
public function NumberFormat():void{
}
public static function toBin(_arg1:int):String{
var _local2 = (null as String);
var _local3:int;
if (_arg1 == 0){
return ("0");
//unresolved jump
};
if (_arg1 == -1){
return ("11111111111111111111111111111111");
//unresolved jump
};
_local2 = "";
_local3 = _arg1;
while (_local3 > 0) {
_local2 = ((((_local3 & 1))>0) ? "1" : "0" + _local2);
_local3 = (_local3 >> 1);
};
return (_local2);
}
public static function toHex(_arg1:int):String{
var _local2 = (null as String);
var _local3:int;
var _local4:int;
if (_arg1 == 0){
return ("0");
};
if (_arg1 == -1){
return ("FFFFFFFF");
//unresolved jump
};
_local2 = "";
_local3 = _arg1;
for (;_local3 > 0;(_local3 = (_local3 >> 4))) {
_local4 = (_local3 & 15);
//unexpected switch
_local2 = (_local4 + _local2);
continue;
_local2 = ("A" + _local2);
continue;
_local2 = ("B" + _local2);
continue;
_local2 = ("C" + _local2);
continue;
_local2 = ("D" + _local2);
continue;
_local2 = ("E" + _local2);
continue;
_local2 = ("F" + _local2);
};
return (_local2);
}
public static function toOct(_arg1:int):String{
var _local4:int;
var _local2:String = "";
var _local3:int = _arg1;
while (_local3 > 0) {
_local4 = (_local3 & 7);
_local2 = (_local4 + _local2);
_local3 = (_local3 >> 3);
};
return (_local2);
}
public static function toRadix(_arg1:int, _arg2:int):String{
var _local5:int;
var _local3:String = "";
var _local4:int = _arg1;
while (_local4 > 0) {
_local5 = (_local4 % _arg2);
_local3 = (_local5 + _local3);
_local4 = (_local4 / _arg2);
};
return (_local3);
}
public static function toFixed(_arg1:Number, _arg2:int):String{
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8 = (null as String);
if (Math.isNaN(_arg1)){
return ("NaN");
//unresolved jump
};
_local4 = 10;
_local5 = _arg2;
_local6 = 1;
_local7 = 0;
while (true) {
if ((_local5 & 1) != 0){
_local6 = (_local4 * _local6);
};
_local5 = (_local5 >> 1);
if (_local5 == 0){
_local7 = _local6;
break;
} else {
_local4 = (_local4 * _local4);
};
};
_local3 = _local7;
_local8 = Std.string(((_arg1 * _local3) / _local3));
_local4 = _local8.indexOf(".");
if (_local4 != -1){
_local5 = _local8.substr((_local4 + 1)).length;
while (_local5 < _arg2) {
_local5++;
_local6 = _local5;
_local8 = (_local8 + "0");
};
} else {
_local8 = (_local8 + ".");
_local5 = 0;
while (_local5 < _arg2) {
_local5++;
_local6 = _local5;
_local8 = (_local8 + "0");
};
};
return (_local8);
}
public static function toMMSS(_arg1:int):String{
var _local2:int = (_arg1 % 1000);
var _local3:Number = ((_arg1 - _local2) / 1000);
var _local4:Number = (_local3 % 60);
return (((("0" + ((_local3 - _local4) / 60)).substr(-2) + ":") + ("0" + _local4).substr(-2)));
}
public static function groupDigits(_arg1:int, _arg2:String):String{
var _local6 = (null as String);
var _local7:int;
var _local8:int;
var _local3:Number = _arg1;
var _local4:int;
while (_local3 > 1) {
_local3 = (_local3 / 10);
_local4++;
};
_local4 = (_local4 / 3);
var _local5:String = Std.string(_arg1);
if (_local4 == 0){
return (_local5);
//unresolved jump
};
_local6 = "";
_local7 = 0;
_local8 = (_local5.length - 1);
while (_local8 >= 0) {
if (_local7 == 3){
_local8--;
_local6 = ((_local5.charAt(_local8) + _arg2) + _local6);
_local7 = 0;
_local4--;
} else {
_local8--;
_local6 = (_local5.charAt(_local8) + _local6);
};
_local7++;
};
return (_local6);
}
public static function centToEuro(_arg1:int, _arg2:String=",", _arg3:String="."):String{
var _local5 = (null as String);
var _local6:int;
var _local7:int;
var _local8:int;
var _local4:int = (_arg1 / 100);
if (_local4 == 0){
if (_arg1 < 10){
return (((("0" + _arg2) + "0") + _arg1));
} else {
return ((("0" + _arg2) + _arg1));
};
//unresolved jump
};
_local6 = (_arg1 - (_local4 * 100));
if (_local6 < 10){
_local5 = ((_arg2 + "0") + _local6);
} else {
_local5 = (_arg2 + _local6);
};
if (_local4 >= 1000){
_local7 = _local4;
while (_local7 >= 1000) {
_local7 = (_local4 / 1000);
_local8 = (_local4 - (_local7 * 1000));
if (_local8 < 10){
_local5 = (((_arg3 + "00") + _local8) + _local5);
} else {
if (_local8 < 100){
_local5 = (((_arg3 + "0") + _local8) + _local5);
} else {
_local5 = ((_arg3 + _local8) + _local5);
};
};
_local4 = _local7;
};
_local5 = (_local7 + _local5);
return (_local5);
} else {
_local5 = (_local4 + _local5);
};
return (_local5);
}
}
}//package de.polygonal.core.fmt
Section 97
//Sprintf (de.polygonal.core.fmt.Sprintf)
package de.polygonal.core.fmt {
import flash.*;
public class Sprintf {
public var _bits:Array;
public static var BIT_MINUS:int;
public static var BIT_PLUS:int;
public static var BIT_SPACE:int;
public static var BIT_SHARP:int;
public static var BIT_ZERO:int;
public static var BIT_h:int;
public static var BIT_l:int;
public static var BIT_L:int;
public static var BIT_c:int;
public static var BIT_d:int;
public static var BIT_i:int;
public static var BIT_e:int;
public static var BIT_E:int;
public static var BIT_f:int;
public static var BIT_g:int;
public static var BIT_G:int;
public static var BIT_o:int;
public static var BIT_s:int;
public static var BIT_u:int;
public static var BIT_x:int;
public static var BIT_X:int;
public static var BIT_p:int;
public static var BIT_n:int;
public static var BIT_b:int;
public static var MASK_SPECIFIERS:int;
public static var _instance:Sprintf;
public function Sprintf():void{
var _local3:int;
var _local4:int;
if (Boot.skip_constructor){
return;
};
_bits = [];
var _local1:String = "-+ #0hlLcdieEfgGosuxXpnb";
var _local2:int;
while (_local2 < 0xFF) {
_local2++;
_local3 = _local2;
_bits[_local3] = 0;
};
_local2 = 0;
_local3 = _local1.length;
while (_local2 < _local3) {
_local2++;
_local4 = _local2;
_bits[_local1.charCodeAt(_local4)] = (1 << _local4);
};
}
public function cca(_arg1:String, _arg2:int):int{
return (_arg1.charCodeAt(_arg2));
}
public function _rpad(_arg1:String, _arg2:String, _arg3:int):String{
var _local7:int;
var _local4:String = _arg2;
var _local5:int;
var _local6 = (_arg3 - 1);
while (_local5 < _local6) {
_local5++;
_local7 = _local5;
_local4 = (_local4 + _arg2);
};
return ((_arg1 + _local4));
}
public function _padNumber(_arg1:String, _arg2:Number, _arg3:int, _arg4:int):String{
var _local6 = (null as String);
var _local7:int;
var _local8:int;
var _local9:int;
var _local10 = (null as String);
var _local5:int = _arg1.length;
if (_arg4 > 0){
false;
};
if (false){
_arg4 = (_arg4 - _local5);
if ((_arg3 & 1) != 0){
_local6 = " ";
_local7 = 0;
_local8 = (_arg4 - 1);
while (_local7 < _local8) {
_local7++;
_local9 = _local7;
_local6 = (_local6 + " ");
};
_arg1 = (_arg1 + _local6);
} else {
if (_arg2 >= 0){
_local6 = (((_arg3 & 16))!=0) ? "0" : " ";
_local10 = _local6;
_local7 = 0;
_local8 = (_arg4 - 1);
while (_local7 < _local8) {
_local7++;
_local9 = _local7;
_local10 = (_local10 + _local6);
};
_arg1 = (_local10 + _arg1);
} else {
if ((_arg3 & 16) != 0){
_local6 = "0";
_local7 = 0;
_local8 = (_arg4 - 1);
while (_local7 < _local8) {
_local7++;
_local9 = _local7;
_local6 = (_local6 + "0");
};
_arg1 = ("-" + (_local6 + _arg1.substr(1)));
} else {
_local6 = " ";
_local7 = 0;
_local8 = (_arg4 - 1);
while (_local7 < _local8) {
_local7++;
_local9 = _local7;
_local6 = (_local6 + " ");
};
_arg1 = (_local6 + _arg1);
};
};
};
};
return (_arg1);
}
public function _lpad(_arg1:String, _arg2:String, _arg3:int):String{
var _local7:int;
var _local4:String = _arg2;
var _local5:int;
var _local6 = (_arg3 - 1);
while (_local5 < _local6) {
_local5++;
_local7 = _local5;
_local4 = (_local4 + _arg2);
};
return ((_local4 + _arg1));
}
public function _format(_arg1:String, _arg2:Array):String{
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:Boolean;
var _local11:int;
var _local12 = (null as String);
var _local13:int;
var _local14:Number;
var _local15:Number;
var _local16 = (null as String);
var _local17:int;
var _local18:int;
var _local19 = (null as String);
var _local20:int;
var _local21:int;
var _local22:int;
var _local23 = (null as String);
var _local24:int;
var _local3:int;
var _local4:String = "";
var _local5:int;
var _local6:int = _arg1.length;
while (_local5 < _local6) {
_local5++;
_local7 = _arg1.charCodeAt(_local5);
if (_local7 == 37){
_local5++;
_local7 = _arg1.charCodeAt(_local5);
if (_local7 == 37){
_local4 = (_local4 + "%");
} else {
_local8 = 0;
while ((_bits[_local7] & 31) != 0) {
_local8 = (_local8 | _bits[_local7]);
_local5++;
_local7 = _arg1.charCodeAt(_local5);
};
_local9 = 17;
if (((_local8 & _local9) == _local9)){
null;
_local8 = (_local8 & -17);
};
_local9 = 6;
if (((_local8 & _local9) == _local9)){
null;
_local8 = (_local8 & -5);
};
_local10 = false;
_local9 = 0;
if (_local7 == 42){
_local10 = true;
_local5++;
_local7 = _arg1.charCodeAt(_local5);
} else {
if (_local7 >= 48){
false;
};
if (false){
_local9 = (_local7 - 48);
_local5++;
_local7 = _arg1.charCodeAt(_local5);
if (_local7 >= 48){
false;
};
if (false){
_local9 = ((_local7 - 48) + (_local9 * 10));
_local5++;
_local7 = _arg1.charCodeAt(_local5);
if (_local7 >= 48){
false;
};
if (false){
while (if (_local7 >= 48){
false;
}, false) {
_local5++;
_local7 = _arg1.charCodeAt(_local5);
};
};
};
};
};
_local11 = -1;
if (_local7 == 46){
_local5++;
_local7 = _arg1.charCodeAt(_local5);
if (_local7 == 42){
_local3++;
_local11 = _arg2[_local3];
_local5++;
_local7 = _arg1.charCodeAt(_local5);
} else {
if (_local7 >= 48){
false;
};
if (false){
_local11 = (_local7 - 48);
_local5++;
_local7 = _arg1.charCodeAt(_local5);
if (_local7 >= 48){
false;
};
if (false){
_local11 = ((_local7 - 48) + (_local11 * 10));
_local5++;
_local7 = _arg1.charCodeAt(_local5);
if (_local7 >= 48){
false;
};
if (false){
while (if (_local7 >= 48){
false;
}, false) {
_local5++;
_local7 = _arg1.charCodeAt(_local5);
};
};
};
} else {
_local11 = 0;
};
};
};
while ((_bits[_local7] & 224) != 0) {
_local8 = (_local8 | _bits[_local7]);
_local5++;
_local7 = _arg1.charCodeAt(_local5);
};
_local12 = "";
if (_local10){
_local3++;
_local9 = _arg2[_local3];
};
_local13 = _bits[_local7];
if ((_local13 & 0xFFFF00) != 0){
if ((_local13 & 0x2000) != 0){
if (_local11 == -1){
_local11 = 6;
};
_local3++;
_local14 = _arg2[_local3];
if (_local11 == 0){
_local12 = Std.string(((_local14)>0) ? (_local14 + 0.5) : ((_local14)<0) ? (_local14 - 0.5) : 0);
if ((_local8 & 8) != 0){
_local12 = (_local12 + ".");
};
} else {
_local15 = Math.pow(0.1, _local11);
_local14 = (Math.round((_local14 / _local15)) * _local15);
_local12 = NumberFormat.toFixed(_local14, _local11);
};
if ((_local8 & 2) != 0){
false;
};
if (false){
_local12 = ("+" + _local12);
} else {
if ((_local8 & 4) != 0){
false;
};
if (false){
_local12 = (" " + _local12);
};
};
_local16 = _local12;
_local17 = _local9;
_local18 = _local16.length;
if (_local17 > 0){
false;
};
if (false){
_local17 = (_local17 - _local18);
if ((_local8 & 1) != 0){
_local19 = " ";
_local20 = 0;
_local21 = (_local17 - 1);
while (_local20 < _local21) {
_local20++;
_local22 = _local20;
_local19 = (_local19 + " ");
};
_local16 = (_local16 + _local19);
} else {
if (_local14 >= 0){
_local19 = (((_local8 & 16))!=0) ? "0" : " ";
_local23 = _local19;
_local20 = 0;
_local21 = (_local17 - 1);
while (_local20 < _local21) {
_local20++;
_local22 = _local20;
_local23 = (_local23 + _local19);
};
_local16 = (_local23 + _local16);
} else {
if ((_local8 & 16) != 0){
_local19 = "0";
_local20 = 0;
_local21 = (_local17 - 1);
while (_local20 < _local21) {
_local20++;
_local22 = _local20;
_local19 = (_local19 + "0");
};
_local16 = ("-" + (_local19 + _local16.substr(1)));
} else {
_local19 = " ";
_local20 = 0;
_local21 = (_local17 - 1);
while (_local20 < _local21) {
_local20++;
_local22 = _local20;
_local19 = (_local19 + " ");
};
_local16 = (_local19 + _local16);
};
};
};
};
_local4 = (_local4 + _local16);
} else {
if ((_local13 & 131328) != 0){
if ((_local8 & 2) != 0){
_local8 = (_local8 & -3);
null;
};
if ((_local8 & 4) != 0){
_local8 = (_local8 & -5);
null;
} else {
if ((_local8 & 16) != 0){
_local8 = (_local8 & -17);
null;
} else {
if ((_local8 & 8) != 0){
_local8 = (_local8 & -9);
null;
};
};
};
if (_local13 == 131072){
_local3++;
_local12 = Std.string(_arg2[_local3]);
if (_local11 > 0){
_local12 = _local12.substr(0, _local11);
};
} else {
_local3++;
_local12 = String.fromCharCode(_arg2[_local3]);
};
_local17 = _local12.length;
if (_local9 > 0){
false;
};
if (false){
_local9 = (_local9 - _local17);
if ((_local8 & 1) != 0){
_local16 = " ";
_local18 = 0;
_local20 = (_local9 - 1);
while (_local18 < _local20) {
_local18++;
_local21 = _local18;
_local16 = (_local16 + " ");
};
_local12 = (_local12 + _local16);
} else {
_local16 = " ";
_local18 = 0;
_local20 = (_local9 - 1);
while (_local18 < _local20) {
_local18++;
_local21 = _local18;
_local16 = (_local16 + " ");
};
_local12 = (_local16 + _local12);
};
};
_local4 = (_local4 + _local12);
} else {
if ((_local13 & 0x9D0600) != 0){
if (_local11 == -1){
_local11 = 1;
};
_local3++;
_local17 = _arg2[_local3];
if (_local11 == 0){
false;
};
if (false){
_local12 = "";
} else {
if ((_local13 & 32) != 0){
_local17 = (_local17 & 0xFFFF);
} else {
if ((_local13 & 65536) != 0){
_local12 = NumberFormat.toOct(_local17);
if ((_local8 & 8) != 0){
_local12 = ("0" + _local12);
};
} else {
if ((_local13 & 524288) != 0){
_local12 = NumberFormat.toHex(_local17).toLowerCase();
if ((_local8 & 8) != 0){
false;
};
if (false){
_local12 = ("0x" + _local12);
};
} else {
if ((_local13 & 0x100000) != 0){
_local12 = NumberFormat.toHex(_local17).toUpperCase();
if ((_local8 & 8) != 0){
false;
};
if (false){
_local12 = ("0X" + _local12);
};
} else {
if ((_local13 & 0x800000) != 0){
_local12 = NumberFormat.toBin(_local17);
if (_local11 > 1){
if (_local12.length < _local11){
_local11 = (_local11 - _local12.length);
_local18 = 0;
while (_local18 < _local11) {
_local18++;
_local20 = _local18;
_local12 = ("0" + _local12);
};
};
_local11 = 0;
};
if ((_local8 & 8) != 0){
_local12 = ("b" + _local12);
};
} else {
_local12 = Std.string(_local17);
};
};
};
};
};
if (_local11 > 1){
false;
};
if (false){
if (_local17 > 0){
_local18 = 0;
_local20 = (_local11 - 1);
while (_local18 < _local20) {
_local18++;
_local21 = _local18;
_local12 = ("0" + _local12);
};
} else {
_local12 = ("0" + -(_local17));
_local18 = 0;
_local20 = (_local11 - 2);
while (_local18 < _local20) {
_local18++;
_local21 = _local18;
_local12 = ("0" + _local12);
};
_local12 = ("-" + _local12);
};
};
};
if (_local17 >= 0){
if ((_local8 & 2) != 0){
_local12 = ("+" + _local12);
} else {
if ((_local8 & 4) != 0){
_local12 = (" " + _local12);
};
};
};
_local16 = _local12;
_local18 = _local9;
_local20 = _local16.length;
if (_local18 > 0){
false;
};
if (false){
_local18 = (_local18 - _local20);
if ((_local8 & 1) != 0){
_local19 = " ";
_local21 = 0;
_local22 = (_local18 - 1);
while (_local21 < _local22) {
_local21++;
_local24 = _local21;
_local19 = (_local19 + " ");
};
_local16 = (_local16 + _local19);
} else {
if (_local17 >= 0){
_local19 = (((_local8 & 16))!=0) ? "0" : " ";
_local23 = _local19;
_local21 = 0;
_local22 = (_local18 - 1);
while (_local21 < _local22) {
_local21++;
_local24 = _local21;
_local23 = (_local23 + _local19);
};
_local16 = (_local23 + _local16);
} else {
if ((_local8 & 16) != 0){
_local19 = "0";
_local21 = 0;
_local22 = (_local18 - 1);
while (_local21 < _local22) {
_local21++;
_local24 = _local21;
_local19 = (_local19 + "0");
};
_local16 = ("-" + (_local19 + _local16.substr(1)));
} else {
_local19 = " ";
_local21 = 0;
_local22 = (_local18 - 1);
while (_local21 < _local22) {
_local21++;
_local24 = _local21;
_local19 = (_local19 + " ");
};
_local16 = (_local19 + _local16);
};
};
};
};
_local4 = (_local4 + _local16);
} else {
if ((_local13 & 0x1800) != 0){
if (_local11 == -1){
_local11 = 6;
};
_local3++;
_local14 = _arg2[_local3];
_local17 = ((_local14)>=0) ? 1 : -1;
_local14 = ((_local14)<0) ? -(_local14) : _local14;
_local18 = 0;
if (_local14 > 1){
while (_local14 > 10) {
_local14 = (_local14 / 10);
_local18++;
};
} else {
while (_local14 < 1) {
_local14 = (_local14 * 10);
_local18--;
};
};
_local15 = 0.1;
_local20 = 0;
_local21 = (_local11 - 1);
while (_local20 < _local21) {
_local20++;
_local22 = _local20;
_local15 = (_local15 * 0.1);
};
_local14 = (Math.round((_local14 / _local15)) * _local15);
_local12 = (_local12 + (((_local17)<0) ? "-" : (((_local8 & 2))!=0) ? "+" : "" + Std.string(_local14).substr(0, (_local11 + 2))));
_local12 = (_local12 + (((_local13 & 0x0800))!=0) ? "e" : "E");
_local12 = (_local12 + ((_local18)>0) ? "+" : "-");
if (_local18 < 10){
_local16 = "0";
_local20 = 0;
_local21 = 1;
while (_local20 < _local21) {
_local20++;
_local22 = _local20;
_local16 = (_local16 + "0");
};
_local12 = (_local12 + _local16);
} else {
if (_local18 < 100){
_local16 = "0";
_local20 = 0;
_local21 = 0;
while (_local20 < _local21) {
_local20++;
_local22 = _local20;
_local16 = (_local16 + "0");
};
_local12 = (_local12 + _local16);
};
};
_local12 = (_local12 + Std.string(((_local18)<0) ? -(_local18) : _local18));
_local4 = (_local4 + _local12);
} else {
if ((_local13 & 0xC000) != 0){
_local11 = 0;
_local16 = "";
if ((_local8 & 1) != 0){
_local16 = (_local16 + "-");
};
if ((_local8 & 2) != 0){
_local16 = (_local16 + "+");
};
if ((_local8 & 4) != 0){
_local16 = (_local16 + " ");
};
if ((_local8 & 16) != 0){
_local16 = (_local16 + "0");
};
_local3++;
_local14 = _arg2[_local3];
_local19 = _format((((("%" + _local16) + ".") + _local11) + "f"), [_local14]);
_local23 = _format((((("%" + _local16) + ".") + _local11) + ((_local7)==71) ? "E" : "e"), [_local14]);
if ((_local8 & 8) != 0){
if (_local19.indexOf(".") != -1){
_local17 = (_local19.length - 1);
while (_local19.charCodeAt(_local17) == 48) {
_local17--;
};
_local19 = _local19.substr(0, _local17);
};
};
_local4 = (_local4 + ((_local19.length)<_local23.length) ? _local19 : _local23);
} else {
if ((_local13 & 0x600000) != 0){
Boot.lastError = new Error();
throw ("warning: specifier 'p' and 'n' are not supported");
};
};
};
};
};
};
} else {
Boot.lastError = new Error();
throw ("malformed format string: no specifier found");
};
};
} else {
_local4 = (_local4 + _arg1.charAt((_local5 - 1)));
};
};
return (_local4);
}
public static function get():Sprintf{
if (Sprintf._instance == null){
Sprintf._instance = new Sprintf();
};
return (Sprintf._instance);
}
public static function free():void{
Sprintf._instance = null;
}
public static function format(_arg1:String, _arg2:Array):String{
if (Sprintf._instance == null){
Sprintf._instance = new Sprintf();
};
return (Sprintf._instance._format(_arg1, _arg2));
}
}
Sprintf.BIT_MINUS = 1;
Sprintf.BIT_PLUS = 2;
Sprintf.BIT_SPACE = 4;
Sprintf.BIT_SHARP = 8;
Sprintf.BIT_ZERO = 16;
Sprintf.BIT_h = 32;
Sprintf.BIT_l = 64;
Sprintf.BIT_L = 128;
Sprintf.BIT_c = 0x0100;
Sprintf.BIT_d = 0x0200;
Sprintf.BIT_i = 0x0400;
Sprintf.BIT_e = 0x0800;
Sprintf.BIT_E = 0x1000;
Sprintf.BIT_f = 0x2000;
Sprintf.BIT_g = 0x4000;
Sprintf.BIT_G = 0x8000;
Sprintf.BIT_o = 65536;
Sprintf.BIT_s = 131072;
Sprintf.BIT_u = 262144;
Sprintf.BIT_x = 524288;
Sprintf.BIT_X = 0x100000;
Sprintf.BIT_p = 0x200000;
Sprintf.BIT_n = 0x400000;
Sprintf.BIT_b = 0x800000;
Sprintf.MASK_SPECIFIERS = 0xFFFF00;
Sprintf._instance = null;
}//package de.polygonal.core.fmt
Section 98
//Array2 (de.polygonal.ds.Array2)
package de.polygonal.ds {
import de.polygonal.core.fmt.*;
import flash.*;
public class Array2 implements Collection {
public var _w:int;
public var _h:int;
public var _a:Array;
public function Array2(_arg1:int=undefined, _arg2:int=undefined):void{
if (Boot.skip_constructor){
return;
};
var _local3:* = null;
_a = [];
_w = _arg1;
_h = _arg2;
}
public function walk(_arg1:Function):void{
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local2:int;
var _local3:int = _h;
while (_local2 < _local3) {
_local2++;
_local4 = _local2;
_local5 = 0;
_local6 = _w;
while (_local5 < _local6) {
_local5++;
_local7 = _local5;
_local8 = ((_local4 * _w) + _local7);
_a[_local8] = _arg1(_a[_local8], _local7, _local4);
};
};
}
public function transpose():void{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9 = (null as Object);
var _local10 = (null as Array);
if (_w == _h){
_local1 = 0;
_local2 = _h;
while (_local1 < _local2) {
_local1++;
_local3 = _local1;
_local4 = (_local3 + 1);
_local5 = _w;
while (_local4 < _local5) {
_local4++;
_local6 = _local4;
_local7 = ((_local3 * _w) + _local6);
_local8 = ((_local6 * _w) + _local3);
_local9 = _a[_local7];
_a[_local7] = _a[_local8];
_a[_local8] = _local9;
};
};
} else {
_local10 = [];
_local1 = 0;
_local2 = _h;
while (_local1 < _local2) {
_local1++;
_local3 = _local1;
_local4 = 0;
_local5 = _w;
while (_local4 < _local5) {
_local4++;
_local6 = _local4;
_local10[((_local6 * _h) + _local3)] = _a[((_local3 * _w) + _local6)];
};
};
_a = _local10;
_w = (_w ^ _h);
_h = (_h ^ _w);
_w = (_w ^ _h);
};
}
public function toVector(_arg1:Vector=undefined):Vector{
var _local4:int;
var _local5:int;
if (_arg1 == null){
_arg1 = new Vector();
};
var _local2:int;
var _local3 = (_w * _h);
while (_local2 < _local3) {
_local2++;
_local4 = _local2;
_local5 = _arg1._size;
_arg1._size = (_local5 + 1);
_arg1._a[_local5] = _a[_local4];
};
return (_arg1);
}
public function toString():String{
return (Sprintf.format("\n{Array2, %dx%d}", [_w, _h]));
}
public function toArray(_arg1:Array=undefined):Array{
var _local4:int;
if (_arg1 == null){
_arg1 = [];
};
var _local2:int;
var _local3 = (_w * _h);
while (_local2 < _local3) {
_local2++;
_local4 = _local2;
_arg1.push(_a[_local4]);
};
return (_arg1);
}
public function swap(_arg1:int, _arg2:int, _arg3:int, _arg4:int):void{
var _local5 = ((_arg2 * _w) + _arg1);
var _local6 = ((_arg4 * _w) + _arg3);
var _local7:Object = _a[_local5];
_a[_local5] = _a[_local6];
_a[_local6] = _local7;
}
public function size():int{
return ((_w * _h));
}
public function shuffle(_arg1:Vector=undefined):void{
var _local3 = (null as Class);
var _local4:int;
var _local5 = (null as Object);
var _local6:int;
var _local2 = (_w * _h);
if (_arg1 == null){
_local3 = Math;
while (_local2--, _local2 > 1) {
_local4 = (_local3.random() * _local2);
_local5 = _a[_local2];
_a[_local2] = _a[_local4];
_a[_local4] = _local5;
};
} else {
_local4 = 0;
while (_local2--, _local2 > 1) {
_local4++;
_local6 = (_arg1._a[_local4] * _local2);
_local5 = _a[_local2];
_a[_local2] = _a[_local6];
_a[_local6] = _local5;
};
};
}
public function shiftW():void{
var _local1 = (null as Object);
var _local2:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local3:int;
var _local4:int = _h;
while (_local3 < _local4) {
_local3++;
_local5 = _local3;
_local2 = (_local5 * _w);
_local1 = _a[_local2];
_local6 = 1;
_local7 = _w;
while (_local6 < _local7) {
_local6++;
_local8 = _local6;
_a[((_local2 + _local8) - 1)] = _a[(_local2 + _local8)];
};
_a[((_local2 + _w) - 1)] = _local1;
};
}
public function shiftS():void{
var _local1 = (null as Object);
var _local3:int;
var _local8:int;
var _local4 = (_h - 1);
var _local5 = (_local4 * _w);
var _local6:int;
var _local7:int = _w;
while (_local6 < _local7) {
_local6++;
_local8 = _local6;
_local1 = _a[(_local5 + _local8)];
_local3 = _local4;
while (_local3--, _local3 > 0) {
_a[(((_local3 + 1) * _w) + _local8)] = _a[((_local3 * _w) + _local8)];
};
_a[_local8] = _local1;
};
}
public function shiftN():void{
var _local1 = (null as Object);
var _local6:int;
var _local7:int;
var _local8:int;
var _local2 = (_h - 1);
var _local3 = ((_h - 1) * _w);
var _local4:int;
var _local5:int = _w;
while (_local4 < _local5) {
_local4++;
_local6 = _local4;
_local1 = _a[_local6];
_local7 = 0;
while (_local7 < _local2) {
_local7++;
_local8 = _local7;
_a[((_local8 * _w) + _local6)] = _a[(((_local8 + 1) * _w) + _local6)];
};
_a[(_local3 + _local6)] = _local1;
};
}
public function shiftE():void{
var _local1 = (null as Object);
var _local2:int;
var _local3:int;
var _local6:int;
var _local4:int;
var _local5:int = _h;
while (_local4 < _local5) {
_local4++;
_local6 = _local4;
_local3 = (_local6 * _w);
_local1 = _a[((_local3 + _w) - 1)];
_local2 = (_w - 1);
while (_local2--, _local2 > 0) {
_a[((_local3 + _local2) + 1)] = _a[(_local3 + _local2)];
};
_a[_local3] = _local1;
};
}
public function setW(_arg1:int):void{
resize(_arg1, _h);
}
public function setRow(_arg1:int, _arg2:Array):void{
var _local6:int;
var _local3 = (_arg1 * _w);
var _local4:int;
var _local5:int = _w;
while (_local4 < _local5) {
_local4++;
_local6 = _local4;
_a[(_local3 + _local6)] = _arg2[_local6];
};
}
public function setH(_arg1:int):void{
resize(_w, _arg1);
}
public function setCol(_arg1:int, _arg2:Array):void{
var _local5:int;
var _local3:int;
var _local4:int = _h;
while (_local3 < _local4) {
_local3++;
_local5 = _local3;
_a[((_local5 * _w) + _arg1)] = _arg2[_local5];
};
}
public function set(_arg1:int, _arg2:int, _arg3:Object):void{
_a[((_arg2 * _w) + _arg1)] = _arg3;
}
public function resize(_arg1:int, _arg2:int):void{
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:int;
var _local11:int;
if (_arg1 == _w){
false;
};
if (false){
return;
};
var _local3:Array = _a;
_a = [];
var _local4:int = ((_arg1)<_w) ? _arg1 : _w;
var _local5:int = ((_arg2)<_h) ? _arg2 : _h;
var _local6:int;
while (_local6 < _local5) {
_local6++;
_local7 = _local6;
_local8 = (_local7 * _arg1);
_local9 = (_local7 * _w);
_local10 = 0;
while (_local10 < _local4) {
_local10++;
_local11 = _local10;
_a[(_local8 + _local11)] = _local3[(_local9 + _local11)];
};
};
_w = _arg1;
_h = _arg2;
}
public function prependRow(_arg1:Array):void{
_h = (_h + 1);
var _local2 = (_w * _h);
while (_local2--, _local2 > _w) {
_a[_local2] = _a[(_local2 - _w)];
};
_local2++;
while (_local2--, _local2 > 0) {
_a[_local2] = _arg1[_local2];
};
}
public function prependCol(_arg1:Array):void{
var _local2 = ((_w * _h) + _h);
var _local3 = (_h - 1);
var _local4:int = _h;
var _local5:int;
var _local6:int = _local2;
while (_local6--, _local6 > 0) {
_local5++;
if (_local5 > _w){
_local5 = 0;
_local4--;
_local3--;
_a[_local6] = _arg1[_local3];
} else {
_a[_local6] = _a[(_local6 - _local4)];
};
};
_w = (_w + 1);
}
public function iterator():Object{
return (new Array2Iterator(this));
}
public function isEmpty():Boolean{
return (false);
}
public function getW():int{
return (_w);
}
public function getRow(_arg1:int, _arg2:Array):Array{
var _local6:int;
var _local3 = (_arg1 * _w);
var _local4:int;
var _local5:int = _w;
while (_local4 < _local5) {
_local4++;
_local6 = _local4;
_arg2.push(_a[(_local3 + _local6)]);
};
return (_arg2);
}
public function getH():int{
return (_h);
}
public function getCol(_arg1:int, _arg2:Array):Array{
var _local5:int;
var _local3:int;
var _local4:int = _h;
while (_local3 < _local4) {
_local3++;
_local5 = _local3;
_arg2.push(_a[((_local5 * _w) + _arg1)]);
};
return (_arg2);
}
public function getArray():Array{
return (_a);
}
public function get(_arg1:int, _arg2:int):Object{
return (_a[((_arg2 * _w) + _arg1)]);
}
public function contains(_arg1:Object):Boolean{
var _local4:int;
var _local2:int;
var _local3 = (_w * _h);
while (_local2 < _local3) {
_local2++;
_local4 = _local2;
if (_a[_local4] == _arg1){
return (true);
};
};
return (false);
}
public function clone(_arg1:Boolean, _arg2:Object=undefined):Collection{
var _local4:int;
var _local5:int;
var _local6:int;
var _local7 = (null as Cloneable);
var _local3:Array2 = new Array2(_w, _h);
if (_arg1){
_local4 = 0;
_local5 = (_w * _h);
while (_local4 < _local5) {
_local4++;
_local6 = _local4;
_local3._a[_local6] = _a[_local6];
};
} else {
if (_arg2 == null){
_local7 = null;
_local4 = 0;
_local5 = (_w * _h);
while (_local4 < _local5) {
_local4++;
_local6 = _local4;
_local7 = _a[_local6];
_local3._a[_local6] = _local7.clone();
};
} else {
_local4 = 0;
_local5 = (_w * _h);
while (_local4 < _local5) {
_local4++;
_local6 = _local4;
_local3._a[_local6] = _arg2(_a[_local6]);
};
};
};
return (_local3);
}
public function clear():void{
_a = [];
}
public function assign(_arg1, _arg2:Array=undefined):void{
var _local3:int;
var _local4:int;
var _local5:int;
if (Std.is(_arg1, Class)){
if (_arg2 == null){
_arg2 = [];
};
_local3 = 0;
_local4 = (_w * _h);
while (_local3 < _local4) {
_local3++;
_local5 = _local3;
_a[_local5] = Type.createInstance(_arg1, _arg2);
};
} else {
_local3 = 0;
_local4 = (_w * _h);
while (_local3 < _local4) {
_local3++;
_local5 = _local3;
_a[_local5] = _arg1;
};
};
}
public function appendRow(_arg1:Array):void{
var _local5:int;
var _local3:int = _h;
_h = (_local3 + 1);
var _local2 = (_w * _local3);
_local3 = 0;
var _local4:int = _w;
while (_local3 < _local4) {
_local3++;
_local5 = _local3;
_a[(_local5 + _local2)] = _arg1[_local5];
};
}
public function appendCol(_arg1:Array):void{
var _local2 = ((_w * _h) + _h);
var _local3 = (_h - 1);
var _local4:int = _h;
var _local5:int = _w;
var _local6:int = _local2;
while (_local6--, _local6 > 0) {
_local5++;
if (_local5 > _w){
_local5 = 0;
_local4--;
_local3--;
_a[_local6] = _arg1[_local3];
} else {
_a[_local6] = _a[(_local6 - _local4)];
};
};
_w = (_w + 1);
}
public function __set(_arg1:int, _arg2:Object):void{
_a[_arg1] = _arg2;
}
public function __get(_arg1:int):Object{
return (_a[_arg1]);
}
}
}//package de.polygonal.ds
Section 99
//Array2Iterator (de.polygonal.ds.Array2Iterator)
package de.polygonal.ds {
import flash.*;
public class Array2Iterator implements Itr {
public var _s:int;
public var _i:int;
public var _f:Array2;
public var _a:Array;
public function Array2Iterator(_arg1:Array2=undefined):void{
if (Boot.skip_constructor){
return;
};
_f = _arg1;
reset();
}
public function reset():void{
_a = _f._a;
var _local1:* = _f;
_s = (_local1._w * _local1._h);
_i = 0;
}
public function next():Object{
var _local1:int = _i;
_i = (_local1 + 1);
return (_a[_local1]);
}
public function hasNext():Boolean{
return ((_i < _s));
}
public function __size(_arg1:Object):int{
return ((_arg1._w * _arg1._h));
}
public function __a(_arg1:Object):Array{
return (_arg1._a);
}
}
}//package de.polygonal.ds
Section 100
//ArrayedStack (de.polygonal.ds.ArrayedStack)
package de.polygonal.ds {
import de.polygonal.core.fmt.*;
import flash.*;
public class ArrayedStack implements Stack {
public var _top:int;
public var _a:Array;
public function ArrayedStack(_arg1:int=-1):void{
if (Boot.skip_constructor){
return;
};
_a = [];
_top = 0;
}
public function walk(_arg1:Function):void{
var _local4:int;
var _local2:int;
var _local3:int = _top;
while (_local2 < _local3) {
_local2++;
_local4 = _local2;
_a[_local4] = _arg1(_a[_local4], _local4);
};
}
public function top():Object{
return (_a[(_top - 1)]);
}
public function toVector(_arg1:Vector=undefined):Vector{
var _local3:int;
if (_arg1 == null){
_arg1 = new Vector();
};
var _local2:int = _top;
while (_local2 > 0) {
_local3 = _arg1._size;
_arg1._size = (_local3 + 1);
_local2--;
_arg1._a[_local3] = _a[_local2];
};
return (_arg1);
}
public function toString():String{
return (Sprintf.format("\n{ArrayedStack, size/max: %d/%d}", [_top, -1]));
}
public function toArray(_arg1:Array=undefined):Array{
if (_arg1 == null){
_arg1 = [];
};
var _local2:int = _top;
while (_local2 > 0) {
_local2--;
_arg1.push(_a[_local2]);
};
return (_arg1);
}
public function swp(_arg1:int, _arg2:int):void{
var _local3:Object = _a[_arg1];
_a[_arg1] = _a[_arg2];
_a[_arg2] = _local3;
}
public function size():int{
return (_top);
}
public function shuffle(_arg1:Vector=undefined):void{
var _local3 = (null as Class);
var _local4:int;
var _local5 = (null as Object);
var _local6:int;
var _local2:int = _top;
if (_arg1 == null){
_local3 = Math;
while (_local2 > 1) {
_local2--;
_local4 = (_local3.random() * _local2);
_local5 = _a[_local2];
_a[_local2] = _a[_local4];
_a[_local4] = _local5;
};
} else {
_local4 = 0;
while (_local2 > 1) {
_local4++;
_local2--;
_local6 = (_arg1._a[_local4] * _local2);
_local5 = _a[_local2];
_a[_local2] = _a[_local6];
_a[_local6] = _local5;
};
};
}
public function set(_arg1:int, _arg2:Object):void{
_a[_arg1] = _arg2;
}
public function push(_arg1:Object):void{
var _local2:int = _top;
_top = (_local2 + 1);
_a[_local2] = _arg1;
}
public function pop():Object{
var _local1 = (_top - 1);
_top = _local1;
return (_a[_local1]);
}
public function maxSize():int{
return (-1);
}
public function iterator():Object{
return (new ArrayedStackIterator(this));
}
public function isEmpty():Boolean{
return ((_top == 0));
}
public function get(_arg1:int):Object{
return (_a[_arg1]);
}
public function cpy(_arg1:int, _arg2:int):void{
_a[_arg1] = _a[_arg2];
}
public function contains(_arg1:Object):Boolean{
var _local4:int;
var _local2:int;
var _local3:int = _top;
while (_local2 < _local3) {
_local2++;
_local4 = _local2;
if (_a[_local4] == _arg1){
return (true);
};
};
return (false);
}
public function compact():void{
_a.length = _top;
}
public function clone(_arg1:Boolean, _arg2:Object=undefined):Collection{
var _local5:int;
var _local6:int;
var _local7:int;
var _local8 = (null as Cloneable);
var _local3:ArrayedStack = new ArrayedStack();
if (_top == 0){
return (_local3);
};
var _local4:Array = _local3._a;
if (_arg1){
_local5 = 0;
_local6 = _top;
while (_local5 < _local6) {
_local5++;
_local7 = _local5;
_local4[_local7] = _a[_local7];
};
} else {
if (_arg2 == null){
_local8 = null;
_local5 = 0;
_local6 = _top;
while (_local5 < _local6) {
_local5++;
_local7 = _local5;
_local8 = _a[_local7];
_local4[_local7] = _local8.clone();
};
} else {
_local5 = 0;
_local6 = _top;
while (_local5 < _local6) {
_local5++;
_local7 = _local5;
_local4[_local7] = _arg2(_a[_local7]);
};
};
};
_local3._top = _top;
return (_local3);
}
public function clear():void{
_top = 0;
}
public function assign(_arg1, _arg2:Array=undefined, _arg3:int=0):void{
var _local4:int;
var _local5:int;
if (_arg3 > 0){
} else {
_arg3 = _top;
};
if (Std.is(_arg1, Class)){
if (_arg2 == null){
_arg2 = [];
};
_local4 = 0;
while (_local4 < _arg3) {
_local4++;
_local5 = _local4;
_a[_local5] = Type.createInstance(_arg1, _arg2);
};
} else {
_local4 = 0;
while (_local4 < _arg3) {
_local4++;
_local5 = _local4;
_a[_local5] = _arg1;
};
};
_top = _arg3;
}
public function __set(_arg1:int, _arg2:Object):void{
_a[_arg1] = _arg2;
}
public function __get(_arg1:int):Object{
return (_a[_arg1]);
}
}
}//package de.polygonal.ds
Section 101
//ArrayedStackIterator (de.polygonal.ds.ArrayedStackIterator)
package de.polygonal.ds {
import flash.*;
public class ArrayedStackIterator implements Itr {
public var _i:int;
public var _f:ArrayedStack;
public var _a:Array;
public function ArrayedStackIterator(_arg1:ArrayedStack=undefined):void{
if (Boot.skip_constructor){
return;
};
_f = _arg1;
reset();
}
public function reset():void{
_a = _f._a;
_i = (_f._top - 1);
}
public function next():Object{
var _local1:int = _i;
_i = (_local1 - 1);
return (_a[_local1]);
}
public function hasNext():Boolean{
return ((_i >= 0));
}
public function __top(_arg1:Object):int{
return (_arg1._top);
}
public function __a(_arg1:Object):Array{
return (_arg1._a);
}
}
}//package de.polygonal.ds
Section 102
//Cloneable (de.polygonal.ds.Cloneable)
package de.polygonal.ds {
public interface Cloneable {
function clone():Object;
}
}//package de.polygonal.ds
Section 103
//Collection (de.polygonal.ds.Collection)
package de.polygonal.ds {
public interface Collection {
function toVector(_arg1:Vector=undefined):Vector;
function toArray(_arg1:Array=undefined):Array;
function size():int;
function iterator():Object;
function isEmpty():Boolean;
function contains(_arg1:Object):Boolean;
function clone(_arg1:Boolean, _arg2:Object=undefined):Collection;
function clear():void;
}
}//package de.polygonal.ds
Section 104
//Itr (de.polygonal.ds.Itr)
package de.polygonal.ds {
public interface Itr {
function reset():void;
function next():Object;
function hasNext():Boolean;
}
}//package de.polygonal.ds
Section 105
//LinkedQueue (de.polygonal.ds.LinkedQueue)
package de.polygonal.ds {
import de.polygonal.core.fmt.*;
import flash.*;
public class LinkedQueue implements Queue {
public var _tail:LinkedQueueNode;
public var _size:int;
public var _head:LinkedQueueNode;
public function LinkedQueue(_arg1:int=-1):void{
if (Boot.skip_constructor){
return;
};
_size = 0;
}
public function toVector(_arg1:Vector=undefined):Vector{
var _local4:int;
var _local2:Vector = new Vector();
var _local3:LinkedQueueNode = _head;
while (_local3 != null) {
_local4 = _local2._size;
_local2._size = (_local4 + 1);
_local2._a[_local4] = _local3.val;
_local3 = _local3.next;
};
return (_local2);
}
public function toString():String{
return (Sprintf.format("\n{LinkedQueue size: %d}", [_size]));
}
public function toArray(_arg1:Array=undefined):Array{
var _local2:LinkedQueueNode = _head;
while (_local2 != null) {
_arg1.push(_local2.val);
_local2 = _local2.next;
};
return (_arg1);
}
public function size():int{
return (_size);
}
public function shuffle(_arg1:Vector=undefined):void{
var _local3 = (null as Class);
var _local4:int;
var _local5 = (null as LinkedQueueNode);
var _local6:int;
var _local7:int;
var _local8 = (null as Object);
var _local9 = (null as LinkedQueueNode);
var _local10:int;
var _local2:int = _size;
if (_arg1 == null){
_local3 = Math;
while (_local2 > 1) {
_local2--;
_local4 = (_local3.random() * _local2);
_local5 = _head;
_local6 = 0;
while (_local6 < _local2) {
_local6++;
_local7 = _local6;
_local5 = _local5.next;
};
_local8 = _local5.val;
_local9 = _head;
_local6 = 0;
while (_local6 < _local4) {
_local6++;
_local7 = _local6;
_local9 = _local9.next;
};
_local5.val = _local9.val;
_local9.val = _local8;
};
} else {
_local4 = 0;
while (_local2 > 1) {
_local2--;
_local4++;
_local6 = (_arg1._a[_local4] * _local2);
_local5 = _head;
_local7 = 0;
while (_local7 < _local2) {
_local7++;
_local10 = _local7;
_local5 = _local5.next;
};
_local8 = _local5.val;
_local9 = _head;
_local7 = 0;
while (_local7 < _local6) {
_local7++;
_local10 = _local7;
_local9 = _local9.next;
};
_local5.val = _local9.val;
_local9.val = _local8;
};
};
}
public function peek():Object{
return (_head.val);
}
public function maxSize():int{
return (-1);
}
public function iterator():Object{
return (new LinkedQueueIterator(this));
}
public function isEmpty():Boolean{
return ((_size == 0));
}
public function enqueue(_arg1:Object):void{
var _local3 = (null as LinkedQueueNode);
_size = (_size + 1);
var _local2:LinkedQueueNode = new LinkedQueueNode(_arg1);
if (_head == null){
_local3 = _local2;
_tail = _local3;
_head = _local3;
_head.next = _tail;
} else {
_tail.next = _local2;
_tail = _local2;
};
}
public function dequeue():Object{
_size = (_size - 1);
var _local1:LinkedQueueNode = _head;
if (_head == _tail){
_head = null;
_tail = null;
} else {
_head = _head.next;
};
_local1.next = null;
return (_local1.val);
}
public function contains(_arg1:Object):Boolean{
var _local2:LinkedQueueNode = _head;
var _local3:Boolean;
while (_local2 != null) {
if (_local2.val == _arg1){
return (true);
};
_local2 = _local2.next;
};
return (false);
}
public function clone(_arg1:Boolean, _arg2:Object=undefined):Collection{
var _local4 = (null as LinkedQueueNode);
var _local5 = (null as LinkedQueueNode);
var _local6 = (null as Cloneable);
var _local3:LinkedQueue = new LinkedQueue();
if (_size == 0){
return (_local3);
};
if (_arg1){
_local4 = _head;
if (_local4 != null){
_local5 = new LinkedQueueNode(_local4.val);
_local3._tail = _local5;
_local3._head = _local5;
_local3._head.next = _local3._tail;
};
_local4 = _local4.next;
while (_local4 != null) {
_local5 = new LinkedQueueNode(_local4.val);
_local3._tail.next = _local5;
_local3._tail = _local5;
_local4 = _local4.next;
};
} else {
if (_arg2 == null){
_local6 = null;
_local4 = _head;
if (_local4 != null){
_local6 = _local4.val;
_local5 = new LinkedQueueNode(_local6.clone());
_local3._tail = _local5;
_local3._head = _local5;
_local3._head.next = _local3._tail;
};
_local4 = _local4.next;
while (_local4 != null) {
_local6 = _local4.val;
_local5 = new LinkedQueueNode(_local6.clone());
_local3._tail.next = _local5;
_local3._tail = _local5;
_local4 = _local4.next;
};
} else {
_local4 = _head;
if (_local4 != null){
_local5 = new LinkedQueueNode(_arg2(_local4.val));
_local3._tail = _local5;
_local3._head = _local5;
_local3._head.next = _local3._tail;
};
_local4 = _local4.next;
while (_local4 != null) {
_local5 = new LinkedQueueNode(_arg2(_local4.val));
_local3._tail.next = _local5;
_local3._tail = _local5;
_local4 = _local4.next;
};
};
};
_local3._size = _size;
return (_local3);
}
public function clear():void{
var _local2 = (null as LinkedQueueNode);
var _local1:LinkedQueueNode = _head;
while (_local1 != null) {
_local2 = _local1.next;
_local1.next = null;
_local1 = _local1.next;
};
_local2 = null;
_tail = _local2;
_head = _local2;
_size = 0;
}
public function back():Object{
return (_tail.val);
}
public function assign(_arg1, _arg2:Array=undefined, _arg3:int=0):void{
var _local4 = (null as LinkedQueueNode);
var _local5:int;
var _local6:int;
if (_arg3 > 0){
} else {
_arg3 = _size;
};
if (Std.is(_arg1, Class)){
if (_arg2 == null){
_arg2 = [];
};
_local4 = _head;
_local5 = 0;
while (_local5 < _arg3) {
_local5++;
_local6 = _local5;
_local4.val = Type.createInstance(_arg1, _arg2);
_local4 = _local4.next;
};
} else {
_local4 = _head;
_local5 = 0;
while (_local5 < _arg3) {
_local5++;
_local6 = _local5;
_local4.val = _arg1;
_local4 = _local4.next;
};
};
}
}
}//package de.polygonal.ds
Section 106
//LinkedQueueIterator (de.polygonal.ds.LinkedQueueIterator)
package de.polygonal.ds {
import flash.*;
public class LinkedQueueIterator implements Itr {
public var _walker:LinkedQueueNode;
public var _f:LinkedQueue;
public function LinkedQueueIterator(_arg1:LinkedQueue=undefined):void{
if (Boot.skip_constructor){
return;
};
_f = _arg1;
reset();
}
public function reset():void{
_walker = _f._head;
}
public function next():Object{
var _local1:Object = _walker.val;
_walker = _walker.next;
return (_local1);
}
public function hasNext():Boolean{
return (!((_walker == null)));
}
public function __head(_arg1:Object):LinkedQueueNode{
return (_arg1._head);
}
}
}//package de.polygonal.ds
Section 107
//LinkedQueueNode (de.polygonal.ds.LinkedQueueNode)
package de.polygonal.ds {
import flash.*;
public class LinkedQueueNode {
public var val:Object;
public var next:LinkedQueueNode;
public function LinkedQueueNode(_arg1:Object=undefined):void{
if (Boot.skip_constructor){
return;
};
val = _arg1;
}
public function toString():String{
return (("" + val));
}
}
}//package de.polygonal.ds
Section 108
//Queue (de.polygonal.ds.Queue)
package de.polygonal.ds {
public interface Queue extends Collection {
function peek():Object;
function enqueue(_arg1:Object):void;
function dequeue():Object;
function back():Object;
}
}//package de.polygonal.ds
Section 109
//Stack (de.polygonal.ds.Stack)
package de.polygonal.ds {
public interface Stack extends Collection {
function top():Object;
function push(_arg1:Object):void;
function pop():Object;
}
}//package de.polygonal.ds
Section 110
//Vector (de.polygonal.ds.Vector)
package de.polygonal.ds {
import de.polygonal.core.fmt.*;
import flash.*;
public class Vector implements Collection {
public var _size:int;
public var _a:Array;
public function Vector(_arg1:int=-1):void{
if (Boot.skip_constructor){
return;
};
_a = [];
_size = 0;
}
public function toVector(_arg1:Vector=undefined):Vector{
var _local4:int;
var _local5:int;
if (_arg1 == null){
_arg1 = new Vector();
};
var _local2:int;
var _local3:int = _a.length;
while (_local2 < _local3) {
_local2++;
_local4 = _local2;
_local5 = _arg1._size;
_arg1._size = (_local5 + 1);
_arg1._a[_local5] = _a[_local4];
};
return (_arg1);
}
public function toString():String{
return (Sprintf.format("\n{Vector, size/max: %d/%d}", [_size, -1]));
}
public function toArray(_arg1:Array=undefined):Array{
var _local4:int;
if (_arg1 == null){
_arg1 = [];
};
var _local2:int;
var _local3:int = _size;
while (_local2 < _local3) {
_local2++;
_local4 = _local2;
_arg1.push(_a[_local4]);
};
return (_arg1);
}
public function swp(_arg1:int, _arg2:int):void{
var _local3:Object = _a[_arg1];
_a[_arg1] = _a[_arg2];
_a[_arg2] = _local3;
}
public function sort(_arg1:Function, _arg2:Boolean=false):void{
if (_size > 1){
if (_arg1 == null){
if (_arg2){
_insertionSortComparable();
} else {
_quickSortComparable(0, _size);
};
} else {
if (_arg2){
_insertionSort(_arg1);
} else {
_a.sort(_arg1);
};
};
};
}
public function size():int{
return (_size);
}
public function shuffle(_arg1:Vector=undefined):void{
var _local3 = (null as Class);
var _local4:int;
var _local5 = (null as Object);
var _local6:int;
var _local2:int = _size;
if (_arg1 == null){
_local3 = Math;
while (_local2--, _local2 > 1) {
_local4 = (_local3.random() * _local2);
_local5 = _a[_local2];
_a[_local2] = _a[_local4];
_a[_local4] = _local5;
};
} else {
_local4 = 0;
while (_local2--, _local2 > 1) {
_local4++;
_local6 = (_arg1._a[_local4] * _local2);
_local5 = _a[_local2];
_a[_local2] = _a[_local6];
_a[_local6] = _local5;
};
};
}
public function set(_arg1:int, _arg2:Object):void{
_a[_arg1] = _arg2;
}
public function reverse():void{
_a.reverse();
}
public function removeRange(_arg1:int, _arg2:int, _arg3:Vector=undefined):Vector{
var _local4 = (null as Object);
var _local5:int;
var _local6:int;
var _local7 = (null as Object);
var _local8:int;
var _local9:int;
if (_arg3 == null){
_local4 = _a[_arg1];
_local5 = _size;
_local6 = (_arg1 + _arg2);
while (_local6 < _local5) {
_local6++;
_a[(_local6 - _arg2)] = _a[_local6];
};
} else {
_local4 = _a[_arg1];
_local5 = _size;
_local6 = (_arg1 + _arg2);
while (_local6 < _local5) {
_local8 = (_local6 - _arg2);
_local7 = _a[_local8];
_local9 = _arg3._size;
_arg3._size = (_local9 + 1);
_arg3._a[_local9] = _local7;
_local6++;
_a[_local8] = _a[_local6];
};
};
_size = (_size - _arg2);
return (_arg3);
}
public function removeAt(_arg1:int):Object{
var _local2:Object = _a[_arg1];
var _local3 = (_size - 1);
var _local4:int = _arg1;
while (_local4 < _local3) {
_local4++;
_a[_local4] = _a[_local4];
};
_size = (_size - 1);
return (_local2);
}
public function pushFront(_arg1:Object):void{
var _local2:int = _size;
while (_local2 > 0) {
_local2--;
_a[_local2] = _a[_local2];
};
_a[0] = _arg1;
_size = (_size + 1);
}
public function pushBack(_arg1:Object):void{
var _local2:int = _size;
_size = (_local2 + 1);
_a[_local2] = _arg1;
}
public function popFront():Object{
var _local1:Object = _a[0];
var _local2 = (_size - 1);
var _local3:int;
while (_local3 < _local2) {
_local3++;
_a[_local3] = _a[_local3];
};
_size = (_size - 1);
return (_local1);
}
public function popBack():Object{
var _local1 = (_size - 1);
_size = _local1;
return (_a[_local1]);
}
public function move(_arg1:int, _arg2:int, _arg3:int):void{
var _local4:int;
var _local5:int;
var _local6 = (null as Array);
if ((_arg1 + _arg3) > _arg2){
true;
};
if (true){
_local4 = 0;
while (_local4 < _arg3) {
_local4++;
_local5 = _local4;
_a[(_arg1 + _local5)] = _a[(_arg2 + _local5)];
};
} else {
_local6 = [];
_local4 = 0;
while (_local4 < _arg3) {
_local4++;
_local5 = _local4;
_local6[_local5] = _a[(_arg2 + _local5)];
};
_local4 = 0;
while (_local4 < _arg3) {
_local4++;
_local5 = _local4;
_a[(_arg1 + _local5)] = _local6[_local5];
};
};
}
public function maxSize():int{
return (-1);
}
public function lastIndexOf(_arg1:Object, _arg2:int=-1):int{
if (_arg2 == -1){
_arg2 = (_size - 1);
};
var _local3 = -1;
var _local4:int = _arg2;
do {
} while (_a[_local4] != _arg1);
return (_local3);
}
public function join(_arg1:String):String{
return (_a.join(_arg1));
}
public function iterator():Object{
return (new VectorIterator(this));
}
public function isEmpty():Boolean{
return ((_a.length == 0));
}
public function insertAt(_arg1:int, _arg2:Object):void{
var _local3:int = _size;
while (_local3 > _arg1) {
_local3--;
_a[_local3] = _a[_local3];
};
_a[_arg1] = _arg2;
_size = (_size + 1);
}
public function indexOf(_arg1:Object, _arg2:int=0):int{
var _local3 = -1;
var _local4:int = _arg2;
var _local5 = (_size - 1);
do {
} while (_a[_local4] != _arg1);
return (_local3);
}
public function getArray():Array{
return (_a);
}
public function get(_arg1:int):Object{
return (_a[_arg1]);
}
public function front():Object{
return (_a[0]);
}
public function erase(_arg1:Object):Boolean{
var _local4:int;
var _local5 = (null as Object);
var _local6:int;
var _local7:int;
var _local2:int;
var _local3:int = _size;
while (_local2 < _local3) {
_local2++;
_local4 = _local2;
if (_a[_local4] == _arg1){
_local5 = _a[_local4];
_local6 = (_size - 1);
_local7 = _local4;
while (_local7 < _local6) {
_local7++;
_a[_local7] = _a[_local7];
};
_size = (_size - 1);
_local5;
return (true);
};
};
return (false);
}
public function cpy(_arg1:int, _arg2:int):void{
_a[_arg1] = _a[_arg2];
}
public function contains(_arg1:Object):Boolean{
var _local4:int;
var _local2:int;
var _local3:int = _size;
while (_local2 < _local3) {
_local2++;
_local4 = _local2;
if (_a[_local4] == _arg1){
return (true);
};
};
return (false);
}
public function concat(_arg1:Vector, _arg2:Boolean=false):Vector{
var _local3 = (null as Vector);
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
if (_arg2){
_local3 = new Vector();
_local3._size = (_size + _arg1._size);
_local4 = 0;
_local5 = _size;
while (_local4 < _local5) {
_local4++;
_local6 = _local4;
_local3._a[_local6] = _a[_local6];
};
_local4 = _size;
_local5 = (_size + _arg1._size);
while (_local4 < _local5) {
_local4++;
_local6 = _local4;
_local3._a[_local6] = _arg1._a[(_local6 - _size)];
};
return (_local3);
//unresolved jump
};
_local4 = _size;
_size = (_size + _arg1._size);
_local5 = 0;
_local6 = _arg1._size;
while (_local5 < _local6) {
_local5++;
_local7 = _local5;
_local4++;
_a[_local4] = _arg1._a[_local7];
};
return (this);
}
public function compact():void{
_a.length = _size;
}
public function clone(_arg1:Boolean, _arg2:Object=undefined):Collection{
var _local4:int;
var _local5:int;
var _local6:int;
var _local7 = (null as Cloneable);
var _local3:Vector = new Vector();
_local3._size = _size;
if (_arg1){
_local4 = 0;
_local5 = _size;
while (_local4 < _local5) {
_local4++;
_local6 = _local4;
_local3._a[_local6] = _a[_local6];
};
} else {
if (_arg2 == null){
_local7 = null;
_local4 = 0;
_local5 = _size;
while (_local4 < _local5) {
_local4++;
_local6 = _local4;
_local7 = _a[_local6];
_local3._a[_local6] = _local7.clone();
};
} else {
_local4 = 0;
_local5 = _size;
while (_local4 < _local5) {
_local4++;
_local6 = _local4;
_local3._a[_local6] = _arg2(_a[_local6]);
};
};
};
return (_local3);
}
public function clear():void{
_size = 0;
}
public function back():Object{
return (_a[(_size - 1)]);
}
public function assign(_arg1, _arg2:Array=undefined, _arg3:int=0):void{
var _local4:int;
var _local5:int;
if (_arg3 > 0){
} else {
_arg3 = _size;
};
_size = _arg3;
if (Std.is(_arg1, Class)){
if (_arg2 == null){
_arg2 = [];
};
_local4 = 0;
while (_local4 < _arg3) {
_local4++;
_local5 = _local4;
_a[_local5] = Type.createInstance(_arg1, _arg2);
};
} else {
_local4 = 0;
while (_local4 < _arg3) {
_local4++;
_local5 = _local4;
_a[_local5] = _arg1;
};
};
}
public function _quickSortComparable(_arg1:int, _arg2:int):void{
var _local6:int;
var _local7:int;
var _local8:int;
var _local9 = (null as Object);
var _local10 = (null as Object);
var _local11 = (null as Object);
var _local12:int;
var _local13:int;
var _local14 = (null as Object);
var _local3 = ((_arg1 + _arg2) - 1);
var _local4:int = _arg1;
var _local5:int = _local3;
if (_arg2 > 1){
_local6 = _arg1;
_local7 = (_local6 + (_arg2 >> 1));
_local8 = ((_local6 + _arg2) - 1);
_local9 = _a[_local6];
_local10 = _a[_local7];
_local11 = _a[_local8];
_local13 = _local9.compare(_local11);
if (_local13 < 0){
false;
};
if (false){
_local12 = ((_local10.compare(_local11))<0) ? _local7 : _local8;
} else {
if (_local9.compare(_local10) < 0){
false;
};
if (false){
_local12 = ((_local13)<0) ? _local6 : _local8;
} else {
_local12 = ((_local11.compare(_local9))<0) ? _local7 : _local6;
};
};
_local14 = _a[_local12];
_a[_local12] = _a[_arg1];
while (_local4 < _local5) {
while (if (_local14.compare(_a[_local5]) < 0){
false;
}, false) {
_local5--;
};
if (_local5 != _local4){
_a[_local4] = _a[_local5];
_local4++;
};
while (if (_local14.compare(_a[_local4]) > 0){
false;
}, false) {
_local4++;
};
if (_local5 != _local4){
_a[_local5] = _a[_local4];
_local5--;
};
};
_a[_local4] = _local14;
_quickSortComparable(_arg1, (_local4 - _arg1));
_quickSortComparable((_local4 + 1), (_local3 - _local4));
};
}
public function _quickSort(_arg1:int, _arg2:int, _arg3:Function):void{
var _local7:int;
var _local8:int;
var _local9:int;
var _local10 = (null as Object);
var _local11 = (null as Object);
var _local12 = (null as Object);
var _local13:int;
var _local14:int;
var _local15 = (null as Object);
var _local4 = ((_arg1 + _arg2) - 1);
var _local5:int = _arg1;
var _local6:int = _local4;
if (_arg2 > 1){
_local7 = _arg1;
_local8 = (_local7 + (_arg2 >> 1));
_local9 = ((_local7 + _arg2) - 1);
_local10 = _a[_local7];
_local11 = _a[_local8];
_local12 = _a[_local9];
_local14 = _arg3(_local10, _local12);
if (_local14 < 0){
false;
};
if (false){
_local13 = ((_arg3(_local11, _local12))<0) ? _local8 : _local9;
} else {
if (_arg3(_local11, _local10) < 0){
false;
};
if (false){
_local13 = ((_local14)<0) ? _local7 : _local9;
} else {
_local13 = ((_arg3(_local12, _local10))<0) ? _local8 : _local7;
};
};
_local15 = _a[_local13];
_a[_local13] = _a[_arg1];
while (_local5 < _local6) {
while (if (_arg3(_local15, _a[_local6]) < 0){
false;
}, false) {
_local6--;
};
if (_local6 != _local5){
_a[_local5] = _a[_local6];
_local5++;
};
while (if (_arg3(_local15, _a[_local5]) > 0){
false;
}, false) {
_local5++;
};
if (_local6 != _local5){
_a[_local6] = _a[_local5];
_local6--;
};
};
_a[_local5] = _local15;
_quickSort(_arg1, (_local5 - _arg1), _arg3);
_quickSort((_local5 + 1), (_local4 - _local5), _arg3);
};
}
public function _insertionSortComparable():void{
var _local3:int;
var _local4 = (null as Object);
var _local5:int;
var _local6 = (null as Object);
var _local1 = 1;
var _local2:int = _size;
while (_local1 < _local2) {
_local1++;
_local3 = _local1;
_local4 = _a[_local3];
_local5 = _local3;
while (_local5 > 0) {
_local6 = _a[(_local5 - 1)];
if (_local6.compare(_local4) > 0){
_a[_local5] = _local6;
_local5--;
} else {
break;
};
};
_a[_local5] = _local4;
};
}
public function _insertionSort(_arg1:Function):void{
var _local4:int;
var _local5 = (null as Object);
var _local6:int;
var _local7 = (null as Object);
var _local2 = 1;
var _local3:int = _size;
while (_local2 < _local3) {
_local2++;
_local4 = _local2;
_local5 = _a[_local4];
_local6 = _local4;
while (_local6 > 0) {
_local7 = _a[(_local6 - 1)];
if (_arg1(_local7, _local5) > 0){
_a[_local6] = _local7;
_local6--;
} else {
break;
};
};
_a[_local6] = _local5;
};
}
public function __set(_arg1:int, _arg2:Object):void{
_a[_arg1] = _arg2;
}
public function __get(_arg1:int):Object{
return (_a[_arg1]);
}
public function __cpy(_arg1:int, _arg2:int):void{
_a[_arg1] = _a[_arg2];
}
}
}//package de.polygonal.ds
Section 111
//VectorIterator (de.polygonal.ds.VectorIterator)
package de.polygonal.ds {
import flash.*;
public class VectorIterator implements Itr {
public var _s:int;
public var _i:int;
public var _f:Vector;
public var _a:Array;
public function VectorIterator(_arg1:Vector=undefined):void{
if (Boot.skip_constructor){
return;
};
_f = _arg1;
reset();
}
public function reset():void{
_a = _f._a;
_s = _f._size;
_i = 0;
}
public function next():Object{
var _local1:int = _i;
_i = (_local1 + 1);
return (_a[_local1]);
}
public function hasNext():Boolean{
return ((_i < _s));
}
public function __size(_arg1:Object):int{
return (_arg1._size);
}
public function __a(_arg1:Object):Array{
return (_arg1._a);
}
}
}//package de.polygonal.ds
Section 112
//Boot (flash.Boot)
package flash {
import flash.display.*;
import flash.text.*;
import flash.utils.*;
public dynamic class Boot extends MovieClip {
public static var init:Function;
public static var tf:TextField;
public static var lines:Array;
public static var lastError:Error;
public static var skip_constructor:Boolean;
public function Boot(_arg1:MovieClip=undefined):void{
var _local3:* = null;
if (Boot.skip_constructor){
return;
};
super();
_local3 = Array.prototype;
_local3.copy = function (){
return (this.slice());
};
_local3.insert = function (_arg1, _arg2):void{
this.splice(_arg1, 0, _arg2);
};
_local3.remove = function (_arg1):Boolean{
var _local2:int = this.indexOf(_arg1);
if (_local2 == -1){
return (false);
};
this.splice(_local2, 1);
return (true);
};
_local3.iterator = function ():Object{
var cur:int;
var arr = this;
return ({hasNext:function ():Boolean{
return ((cur < arr.length));
}, next:function (){
var _local1:int = cur;
cur = (_local1 + 1);
return (arr[_local1]);
}});
};
_local3.setPropertyIsEnumerable("copy", false);
_local3.setPropertyIsEnumerable("insert", false);
_local3.setPropertyIsEnumerable("remove", false);
_local3.setPropertyIsEnumerable("iterator", false);
var cca:* = String.prototype.charCodeAt;
String.prototype.charCodeAt = function (_arg1){
var _local2:* = cca.call(this, _arg1);
if (isNaN(_local2)){
return (null);
};
return (_local2);
};
Boot.lines = [];
var _local4:MovieClip = ((_arg1)==null) ? this : _arg1;
Lib.current = _local4;
try {
if (_local4.stage != null){
false;
};
if (false){
_local4.stage.align = "TOP_LEFT";
} else {
null;
};
} catch(#InvalidMultinameIndex#) {
_local3 = !NULL!;
};
if (Boot.init != null){
Boot.init();
};
}
public static function enum_to_string(_arg1:Object):String{
if (_arg1.params == null){
return (_arg1.tag);
};
return ((((_arg1.tag + "(") + _arg1.params.join(",")) + ")"));
}
public static function __instanceof(_arg1, _arg2):Boolean{
var _local4:* = null;
try {
if (_arg2 == Dynamic){
return (true);
};
return ((_arg1 is _arg2));
} catch!ERROR! return (false);
}
public static function __clear_trace():void{
if (Boot.tf == null){
return;
};
Lib.current.removeChild(Boot.tf);
Boot.tf = null;
Boot.lines = [];
}
public static function __set_trace_color(_arg1:uint):void{
Boot.getTrace().textColor = _arg1;
}
public static function getTrace():TextField{
var _local2 = (null as TextFormat);
var _local1:MovieClip = Lib.current;
if (Boot.tf == null){
Boot.tf = new TextField();
_local2 = Boot.tf.getTextFormat();
_local2.font = "Consolas";
Boot.tf.defaultTextFormat = _local2;
Boot.tf.selectable = false;
Boot.tf.width = ((_local1.stage)==null) ? 800 : _local1.stage.stageWidth;
Boot.tf.autoSize = TextFieldAutoSize.LEFT;
Boot.tf.mouseEnabled = false;
};
_local1.addChild(Boot.tf);
return (Boot.tf);
}
public static function __trace(_arg1, _arg2:Object):void{
var _local3:TextField = Boot.getTrace();
var _local4:String = ((_arg2)==null) ? "(null)" : ((_arg2.fileName + ":") + _arg2.lineNumber);
Boot.lines = Boot.lines.concat(((_local4 + ": ") + Boot.__string_rec(_arg1, "")).split("\n"));
_local3.text = Boot.lines.join("\n");
var _local5:Stage = Lib.current.stage;
if (_local5 == null){
return;
};
while (if (Boot.lines.length > 1){
false;
}, false) {
Boot.lines.shift();
_local3.text = Boot.lines.join("\n");
};
}
public static function __string_rec(_arg1, _arg2:String):String{
var _local4 = (null as String);
var _local5 = (null as Array);
var _local6 = (null as Array);
var _local7:int;
var _local8:* = null;
var _local9 = (null as String);
var _local10:Boolean;
var _local11:int;
var _local12:int;
var _local13 = (null as String);
var _local3:String = getQualifiedClassName(_arg1);
_local4 = _local3;
if (_local4 == "Object"){
_local7 = 0;
_local6 = [];
_local8 = _arg1;
for (/*?*/in _arg1) {
_local6.push(//unresolved nextvalue or nextname);
};
_local5 = _local6;
_local9 = "{";
_local10 = true;
_local7 = 0;
_local11 = _local5.length;
while (_local7 < _local11) {
_local7++;
_local12 = _local7;
_local13 = _local5[_local12];
if (_local10){
_local10 = false;
} else {
_local9 = (_local9 + ",");
};
_local9 = (_local9 + (((" " + _local13) + " : ") + Boot.__string_rec(_arg1[_local13], _arg2)));
};
if (!_local10){
_local9 = (_local9 + " ");
};
_local9 = (_local9 + "}");
return (_local9);
} else {
if (_local4 == "Array"){
_local9 = "[";
_local10 = true;
_local5 = _arg1;
_local7 = 0;
_local11 = _local5.length;
while (_local7 < _local11) {
_local7++;
_local12 = _local7;
if (_local10){
_local10 = false;
} else {
_local9 = (_local9 + ",");
};
_local9 = (_local9 + Boot.__string_rec(_local5[_local12], _arg2));
};
return ((_local9 + "]"));
} else {
_local4 = typeof(_arg1);
if (_local4 == "function"){
return ("<function>");
//unresolved jump
};
};
};
return (new String(_arg1));
}
public static function __unprotect__(_arg1:String):String{
return (_arg1);
}
}
Boot.skip_constructor = false;
??getglobalscope
.Boot.init = function ():void{
Math.NaN = Number.NaN;
Math.NEGATIVE_INFINITY = Number.NEGATIVE_INFINITY;
Math.POSITIVE_INFINITY = Number.POSITIVE_INFINITY;
Math.isFinite = function (_arg1:Number):Boolean{
return (isFinite(_arg1));
};
Math.isNaN = function (_arg1:Number):Boolean{
return (isNaN(_arg1));
};
null;
};
}//package flash
Section 113
//Lib (flash.Lib)
package flash {
import flash.display.*;
import flash.net.*;
import flash.utils.*;
import flash.system.*;
public class Lib {
public static var current:MovieClip;
public function Lib():void{
}
public static function getTimer():int{
return (getTimer());
}
public static function eval(_arg1:String){
var _local6:* = null;
var _local8 = (null as String);
var _local3:Array = _arg1.split(".");
var _local4:Array = [];
var _local5:* = null;
while (_local3.length > 0) {
try {
_local5 = getDefinitionByName(_local3.join("."));
} catch(#InvalidMultinameIndex#) {
if (( as Error)){
Boot.lastError = _local6;
};
_local4.unshift(_local3.pop());
};
if (_local5 != null){
break;
};
};
var _local7:int;
while (_local7 < _local4.length) {
_local8 = _local4[_local7];
_local7++;
if (_local5 == null){
return (null);
};
_local5 = _local5[_local8];
};
return (_local5);
}
public static function getURL(_arg1:URLRequest, _arg2:String=undefined):void{
var _local3:Function = navigateToURL;
if (_arg2 == null){
_local3(_arg1);
} else {
_local3(_arg1, _arg2);
};
}
public static function fscommand(_arg1:String, _arg2:String=undefined):void{
fscommand(_arg1, ((_arg2)==null) ? "" : _arg2);
}
public static function trace(_arg1):void{
trace(_arg1);
}
public static function attach(_arg1:String):MovieClip{
var _local2:* = (getDefinitionByName(_arg1) as Class);
return (new (_local2));
}
public static function as(_arg1, _arg2:Class):Object{
return ((_arg1 as _arg2));
}
}
}//package flash
Section 114
//acecapture (sound.acecapture)
package sound {
import flash.media.*;
public dynamic class acecapture extends Sound {
}
}//package sound
Section 115
//aicapture (sound.aicapture)
package sound {
import flash.media.*;
public dynamic class aicapture extends Sound {
}
}//package sound
Section 116
//capture (sound.capture)
package sound {
import flash.media.*;
public dynamic class capture extends Sound {
}
}//package sound
Section 117
//deal (sound.deal)
package sound {
import flash.media.*;
public dynamic class deal extends Sound {
}
}//package sound
Section 118
//fulldeal (sound.fulldeal)
package sound {
import flash.media.*;
public dynamic class fulldeal extends Sound {
}
}//package sound
Section 119
//game (sound.game)
package sound {
import flash.media.*;
public dynamic class game extends Sound {
}
}//package sound
Section 120
//gamestart (sound.gamestart)
package sound {
import flash.media.*;
public dynamic class gamestart extends Sound {
}
}//package sound
Section 121
//gather (sound.gather)
package sound {
import flash.media.*;
public dynamic class gather extends Sound {
}
}//package sound
Section 122
//intro (sound.intro)
package sound {
import flash.media.*;
public dynamic class intro extends Sound {
}
}//package sound
Section 123
//play1 (sound.play1)
package sound {
import flash.media.*;
public dynamic class play1 extends Sound {
}
}//package sound
Section 124
//play2 (sound.play2)
package sound {
import flash.media.*;
public dynamic class play2 extends Sound {
}
}//package sound
Section 125
//result (sound.result)
package sound {
import flash.media.*;
public dynamic class result extends Sound {
}
}//package sound
Section 126
//scorecount (sound.scorecount)
package sound {
import flash.media.*;
public dynamic class scorecount extends Sound {
}
}//package sound
Section 127
//scoreding (sound.scoreding)
package sound {
import flash.media.*;
public dynamic class scoreding extends Sound {
}
}//package sound
Section 128
//timesup (sound.timesup)
package sound {
import flash.media.*;
public dynamic class timesup extends Sound {
}
}//package sound
Section 129
//trump (sound.trump)
package sound {
import flash.media.*;
public dynamic class trump extends Sound {
}
}//package sound
Section 130
//Dynamic (Dynamic)
package {
public class Dynamic {
public function Dynamic():void{
}
}
}//package
Section 131
//Reflect (Reflect)
package {
public class Reflect {
public function Reflect():void{
}
public static function hasField(_arg1, _arg2:String):Boolean{
return (_arg1.hasOwnProperty(_arg2));
}
public static function field(_arg1, _arg2:String){
return (((_arg1)==null) ? null : _arg1[_arg2]);
}
public static function setField(_arg1, _arg2:String, _arg3):void{
_arg1[_arg2] = _arg3;
}
public static function callMethod(_arg1, _arg2, _arg3:Array){
return (_arg2.apply(_arg1, _arg3));
}
public static function fields(_arg1):Array{
if (_arg1 == null){
return ([]);
};
var _local4:int;
var _local3:Array = [];
var _local5:* = _arg1;
for (/*?*/in _arg1) {
_local3.push(//unresolved nextvalue or nextname);
};
var _local2:Array = _local3;
_local4 = 0;
while (_local4 < _local2.length) {
if (!_arg1.hasOwnProperty(_local2[_local4])){
_local2.splice(_local4, 1);
} else {
_local4++;
};
};
return (_local2);
}
public static function isFunction(_arg1):Boolean{
return ((typeof(_arg1) == "function"));
}
public static function compare(_arg1:Object, _arg2:Object):int{
return (((_arg1)==_arg2) ? 0 : ((_arg1)>_arg2) ? 1 : -1);
}
public static function compareMethods(_arg1, _arg2):Boolean{
if (_arg1 == _arg2){
return (true);
};
if (!!(Reflect.isFunction(_arg1))){
true;
};
if (true){
return (false);
};
return (false);
}
public static function isObject(_arg1):Boolean{
var _local4:* = null;
if (_arg1 == null){
return (false);
};
var _local3:String = typeof(_arg1);
if (_local3 == "object"){
try {
if (_arg1.__enum__ == true){
return (false);
};
} catch(#InvalidMultinameIndex#) {
_local4 = !NULL!;
};
return (true);
};
return ((_local3 == "string"));
}
public static function deleteField(_arg1, _arg2:String):Boolean{
if (_arg1.hasOwnProperty(_arg2) != true){
return (false);
};
delete _arg1[_arg2];
return (true);
}
public static function copy(_arg1:Object):Object{
var _local5 = (null as String);
var _local2:* = {};
var _local3:int;
var _local4:Array = Reflect.fields(_arg1);
while (_local3 < _local4.length) {
_local5 = _local4[_local3];
_local3++;
_local2[_local5] = ((_arg1)==null) ? null : _arg1[_local5];
};
return (_local2);
}
public static function makeVarArgs(_arg1:Function){
var f = _arg1;
return (function (... _args){
return (f(_args));
});
}
}
}//package
Section 132
//Std (Std)
package {
import flash.*;
public class Std {
public function Std():void{
}
public static function is(_arg1, _arg2):Boolean{
return (Boot.__instanceof(_arg1, _arg2));
}
public static function string(_arg1):String{
return (Boot.__string_rec(_arg1, ""));
}
public static function _int(_arg1:Number):int{
return (_arg1);
}
public static function parseInt(_arg1:String):Object{
var _local2:* = parseInt(_arg1);
if (isNaN(_local2)){
return (null);
};
return (_local2);
}
public static function parseFloat(_arg1:String):Number{
return (parseFloat(_arg1));
}
public static function random(_arg1:int):int{
return (Math.floor((Math.random() * _arg1)));
}
}
}//package
Section 133
//Type (Type)
package {
import flash.*;
import flash.utils.*;
public class Type {
public function Type():void{
}
public static function getClass(_arg1:Object):Class{
var _local2:String = getQualifiedClassName(_arg1);
if (_local2 != "null"){
true;
if (_local2 != "Object"){
true;
if (_local2 != "int"){
true;
if (_local2 != "Number"){
true;
};
};
};
};
if (true){
return (null);
};
if (_arg1.hasOwnProperty("prototype")){
return (null);
};
var _local3:* = (getDefinitionByName(_local2) as Class);
if (_local3.__isenum){
return (null);
};
return (_local3);
}
public static function getEnum(_arg1):Class{
var _local2:String = getQualifiedClassName(_arg1);
if (_local2 != "null"){
true;
};
if (true){
return (null);
};
if (_arg1.hasOwnProperty("prototype")){
return (null);
};
var _local3:* = (getDefinitionByName(_local2) as Class);
if (!_local3.__isenum){
return (null);
};
return (_local3);
}
public static function getSuperClass(_arg1:Class):Class{
var _local2:String = getQualifiedSuperclassName(_arg1);
if (_local2 == "Object"){
return (null);
};
return ((getDefinitionByName(_local2) as Class));
}
public static function getClassName(_arg1:Class):String{
if (_arg1 == null){
return (null);
};
var _local2:String = getQualifiedClassName(_arg1);
var _local3:String = _local2;
if (_local3 == "int"){
return ("Int");
} else {
if (_local3 == "Number"){
return ("Float");
} else {
if (_local3 == "Boolean"){
return ("Bool");
//unresolved jump
};
};
};
return (_local2.split("::").join("."));
}
public static function getEnumName(_arg1:Class):String{
return (Type.getClassName(_arg1));
}
public static function resolveClass(_arg1:String):Class{
var _local3 = (null as Class);
var _local4:* = null;
var _local5 = (null as String);
try {
_local3 = (getDefinitionByName(_arg1) as Class);
if (_local3.__isenum){
return (null);
};
return (_local3);
} catch(#InvalidMultinameIndex#) {
_local4 = !NULL!;
_local5 = _arg1;
if (_local5 == "Int"){
return (int);
} else {
if (_local5 == "Float"){
return (Number);
//unresolved jump
};
};
return (null);
};
if (_local3 != null){
true;
};
if (true){
return (null);
};
return (_local3);
}
public static function resolveEnum(_arg1:String):Class{
var _local3:* = null;
var _local4:* = null;
try {
_local3 = getDefinitionByName(_arg1);
if (!_local3.__isenum){
return (null);
};
return (_local3);
} catch(#InvalidMultinameIndex#) {
_local4 = !NULL!;
if (_arg1 == "Bool"){
return (Boolean);
};
return (null);
};
if (_local3 != null){
true;
};
if (true){
return (null);
};
return (_local3);
}
public static function createInstance(_arg1:Class, _arg2:Array):Object{
//unexpected switch
Boot.lastError = new Error();
throw ("Too many arguments");
//unresolved jump
//unresolved jump
//unresolved jump
//unresolved jump
//unresolved jump
//unresolved jump
//unresolved jump
//unresolved jump
//unresolved jump
//unresolved jump
//unresolved jump
//unresolved jump
//unresolved jump
//unresolved jump
//unresolved jump
return (new _arg1(_arg2[0], _arg2[1], _arg2[2], _arg2[3], _arg2[4], _arg2[5], _arg2[6], _arg2[7], _arg2[8], _arg2[9], _arg2[10], _arg2[11], _arg2[12], _arg2[13]));
}
public static function createEmptyInstance(_arg1:Class):Object{
var _local3 = (null as Object);
var _local4:* = null;
try {
Boot.skip_constructor = true;
_local3 = new (_arg1);
Boot.skip_constructor = false;
return (_local3);
} catch(#InvalidMultinameIndex#) {
_local4 = !NULL!;
Boot.skip_constructor = false;
Boot.lastError = new Error();
throw (_local4);
};
return (null);
}
public static function createEnum(_arg1:Class, _arg2:String, _arg3:Array=undefined):Object{
var _local4:Object = ((_arg1)==null) ? null : _arg1[_arg2];
if (_local4 == null){
Boot.lastError = new Error();
throw (("No such constructor " + _arg2));
};
if (Reflect.isFunction(_local4)){
if (_arg3 == null){
Boot.lastError = new Error();
throw ((("Constructor " + _arg2) + " need parameters"));
};
return (_local4.apply(_arg1, _arg3));
};
if (_arg3 != null){
false;
};
if (false){
Boot.lastError = new Error();
throw ((("Constructor " + _arg2) + " does not need parameters"));
};
return (_local4);
}
public static function createEnumIndex(_arg1:Class, _arg2:int, _arg3:Array=undefined):Object{
var _local4:String = Type.getEnumConstructs(_arg1)[_arg2];
if (_local4 == null){
Boot.lastError = new Error();
throw ((_arg2 + " is not a valid enum constructor index"));
};
return (Type.createEnum(_arg1, _local4, _arg3));
}
public static function describe(_arg1, _arg2:Boolean):Array{
var _local8:int;
var _local3:Array = [];
var _local4:XML = describeType(_arg1);
if (_arg2){
_local4 = _local4.factory[0];
};
var _local5:XMLList = _local4.child("method");
var _local6:int;
var _local7:int = _local5.length();
while (_local6 < _local7) {
_local6++;
_local8 = _local6;
_local3.push(Std.string(_local5[_local8].attribute("name")));
};
var _local9:XMLList = _local4.child("variable");
_local6 = 0;
_local7 = _local9.length();
while (_local6 < _local7) {
_local6++;
_local8 = _local6;
_local3.push(Std.string(_local9[_local8].attribute("name")));
};
var _local10:XMLList = _local4.child("accessor");
_local6 = 0;
_local7 = _local10.length();
while (_local6 < _local7) {
_local6++;
_local8 = _local6;
_local3.push(Std.string(_local10[_local8].attribute("name")));
};
return (_local3);
}
public static function getInstanceFields(_arg1:Class):Array{
return (Type.describe(_arg1, true));
}
public static function getClassFields(_arg1:Class):Array{
var _local2:Array = Type.describe(_arg1, false);
_local2.remove("__construct__");
_local2.remove("prototype");
return (_local2);
}
public static function getEnumConstructs(_arg1:Class):Array{
return (_arg1.__constructs__);
}
public static function typeof(_arg1):ValueType{
var _local5:* = null;
var _local6:* = null;
var _local3:String = getQualifiedClassName(_arg1);
var _local4:String = _local3;
if (_local4 == "null"){
return (ValueType.TNull);
} else {
if (_local4 == "void"){
return (ValueType.TNull);
} else {
if (_local4 == "int"){
return (ValueType.TInt);
} else {
if (_local4 == "Number"){
return (ValueType.TFloat);
} else {
if (_local4 == "Boolean"){
return (ValueType.TBool);
} else {
if (_local4 == "Object"){
return (ValueType.TObject);
} else {
_local5 = null;
try {
_local5 = getDefinitionByName(_local3);
if (_arg1.hasOwnProperty("prototype")){
return (ValueType.TObject);
};
if (_local5.__isenum){
return (ValueType.TEnum(_local5));
};
return (ValueType.TClass(_local5));
} catch(#InvalidMultinameIndex#) {
if (( as Error)){
Boot.lastError = _local6;
};
if (_local3 != "builtin.as$0::MethodClosure"){
true;
};
if (true){
return (ValueType.TFunction);
};
return (((_local5)==null) ? ValueType.TFunction : ValueType.TClass(_local5));
};
};
};
};
};
};
};
return (null);
}
public static function enumEq(_arg1:Object, _arg2:Object):Boolean{
var _local4 = (null as Array);
var _local5 = (null as Array);
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:* = null;
if (_arg1 == _arg2){
return (true);
};
try {
if (_arg1.index != _arg2.index){
return (false);
};
_local4 = _arg1.params;
_local5 = _arg2.params;
_local6 = 0;
_local7 = _local4.length;
while (_local6 < _local7) {
_local6++;
_local8 = _local6;
if (!Type.enumEq(_local4[_local8], _local5[_local8])){
return (false);
};
};
} catch(#InvalidMultinameIndex#) {
_local9 = !NULL!;
return (false);
};
return (true);
}
public static function enumConstructor(_arg1):String{
return (_arg1.tag);
}
public static function enumParameters(_arg1):Array{
return (((_arg1.params)==null) ? [] : _arg1.params);
}
public static function enumIndex(_arg1):int{
return (_arg1.index);
}
}
}//package
Section 134
//ValueType (ValueType)
package {
import flash.*;
public final class ValueType {
public const __enum__:Boolean = true;
public var tag:String;
public var index:int;
public var params:Array;
public static const __isenum:Boolean = true;
public static var __constructs__;
public static var TUnknown:ValueType;
public static var TObject:ValueType;
public static var TNull:ValueType;
public static var TInt:ValueType;
public static var TFunction:ValueType;
public static var TFloat:ValueType;
public static var TBool:ValueType;
public function ValueType(_arg1:String, _arg2:int, _arg3):void{
tag = _arg1;
index = _arg2;
params = _arg3;
}
final public function toString():String{
return (Boot.enum_to_string(this));
}
public static function TEnum(_arg1:Class):ValueType{
return (new ValueType("TEnum", 7, [_arg1]));
}
public static function TClass(_arg1:Class):ValueType{
return (new ValueType("TClass", 6, [_arg1]));
}
}
var _local1 = [OP_NEWCLASS ClassInfo:94 base:Object];
??getglobalscope
.ValueType = _local1;
var _slot1 = new ValueType("TBool", 3, null);
var _slot4 = new ValueType("TFloat", 2, null);
var _slot5 = new ValueType("TFunction", 5, null);
var _slot6 = new ValueType("TInt", 1, null);
var _slot7 = new ValueType("TNull", 0, null);
var _slot8 = new ValueType("TObject", 4, null);
var _slot9 = new ValueType("TUnknown", 8, null);
_local1.__constructs__ = ["TNull", "TInt", "TFloat", "TBool", "TObject", "TFunction", "TClass", "TEnum", "TUnknown"];
}//package
Section 135
//Void (Void)
package {
import flash.*;
public final class Void {
public const __enum__:Boolean = true;
public var tag:String;
public var index:int;
public var params:Array;
public static const __isenum:Boolean = true;
public static var __constructs__;
public function Void(_arg1:String, _arg2:int, _arg3):void{
tag = _arg1;
index = _arg2;
params = _arg3;
}
final public function toString():String{
return (Boot.enum_to_string(this));
}
}
var _local1 = [OP_NEWCLASS ClassInfo:56 base:Object];
??getglobalscope
.Void = _local1;
_local1.__constructs__ = [];
}//package