Section 1
//BacksidePile (guipackage.BacksidePile)
package guipackage {
import flash.display.*;
import flash.events.*;
public class BacksidePile extends CardContainer {
public const Y_SPACING:int = 3;
protected var col:int;
public static const WIDTH:int = 59;
public static const START_X:int = 21;
public static const X_SPACING:int = 13;
public static const Y:int = 142;
public function BacksidePile(_arg1:int, _arg2:TableG){
super(_arg2);
this.col = _arg1;
x = (BacksidePile.START_X + (_arg1 * (BacksidePile.WIDTH + BacksidePile.X_SPACING)));
y = BacksidePile.Y;
}
public function update(_arg1:Array):void{
var _local2:int;
var _local3:CardG;
var _local4:int;
while (_local4 < _arg1.length) {
_local2 = int(_arg1[_local4]);
_local3 = super.tableG.getCardG(_local2);
addChildAt(_local3, _local4);
_local3.y = (_local4 * Y_SPACING);
_local4++;
};
tableG.getPile(col).y = (BacksidePile.Y + (numChildren * Y_SPACING));
}
}
}//package guipackage
Section 2
//CardContainer (guipackage.CardContainer)
package guipackage {
import flash.display.*;
public class CardContainer extends Sprite {
public var tableG:TableG;
public function CardContainer(_arg1:TableG){
this.tableG = _arg1;
}
}
}//package guipackage
Section 3
//CardG (guipackage.CardG)
package guipackage {
import modelpackage.*;
import util.*;
import flash.display.*;
import flash.events.*;
public class CardG extends MovieClip implements Renderable {
public const DEALING:int = 0;
public const DISAPPEARING:int = 1;
public var table:TableG;
public var id:int;
public var animation:int;// = -1
public var renderState:int;
public var movement:Movement;
public var rot:Rotation;
public var resize:Resize;
public var dealStart:int;
public var previousParent:DisplayObject;
public static const HEIGHT:int = 90;
public static const WIDTH:int = 60;
public function CardG(_arg1:int, _arg2:TableG){
this.id = _arg1;
this.table = _arg2;
update();
addEventListener(MouseEvent.MOUSE_DOWN, tryToMove);
addEventListener(MouseEvent.ROLL_OVER, rollOver);
}
public function tryToMove(_arg1:Event):void{
if ((((((parent is Pile)) && (Document.doc.gameRunning))) && (GuiConnection.cardCanBeDragged(id)))){
Document.doc.addPlayData([App.INPUT_START_MOVE, id]);
table.movingCards.cardStartMouseX = mouseX;
table.movingCards.cardStartMouseY = mouseY;
};
}
public function rollOver(_arg1:MouseEvent):void{
if ((parent is Pile)){
Pile(parent).cardRollover(this, _arg1);
};
}
public function update():void{
if (GuiConnection.cardIsBackside(id)){
gotoAndStop("backside");
} else {
gotoAndStop(((GuiConnection.cardSuite(id) * 13) + GuiConnection.cardValue(id)));
};
}
public function initDealing(_arg1:int, _arg2:int, _arg3:int, _arg4:int):void{
this.dealStart = _arg1;
visible = false;
var _local5:int = GuiConnection.getcardFrame(id);
gotoAndStop(_local5);
animation = DEALING;
rotation = -90;
scaleX = 1.3;
scaleY = 1.3;
movement = new Movement(this, _arg1, _arg2, x, y, _arg3, _arg4);
rot = new Rotation(this, _arg1, _arg2, rotation, 0, 1, 0);
resize = new Resize(this, _arg1, (_arg1 + 5), 1.1, 1.1, 1, 1);
}
public function initDisappearing(_arg1:int, _arg2:int, _arg3):void{
animation = DISAPPEARING;
movement = new Movement(this, _arg1, _arg2, x, y, x, _arg3);
}
public function render(_arg1:int, _arg2:Number):int{
var _local3:Boolean;
if (animation == DEALING){
if ((((visible == false)) && ((_arg1 >= dealStart)))){
visible = true;
};
resize.update(_arg1);
rot.update(_arg1);
_local3 = movement.update(_arg1, _arg2);
if (_local3){
animation = -1;
return (Gui.RENDERABLE_STOP);
};
return (Gui.RENDERABLE_CONTINUE);
};
if (animation == DISAPPEARING){
_local3 = movement.update(_arg1, _arg2);
if (_local3){
animation = -1;
};
return (Gui.RENDERABLE_CONTINUE);
};
return (Gui.RENDERABLE_CONTINUE);
}
}
}//package guipackage
Section 4
//CardHilight (guipackage.CardHilight)
package guipackage {
import modelpackage.*;
import flash.display.*;
import flash.events.*;
public class CardHilight extends Sprite {
public var gui:Gui;
public var startCol:int;
public function CardHilight(_arg1:Gui){
this.gui = _arg1;
visible = false;
}
public function activate(_arg1:int):void{
this.startCol = _arg1;
gui.addEventListener(MouseEvent.MOUSE_MOVE, mouseMove);
}
public function deActivate():void{
gui.removeEventListener(MouseEvent.MOUSE_MOVE, mouseMove);
visible = false;
}
public function mouseMove(_arg1:MouseEvent):void{
var _local2:Pile;
var _local3:int = gui.table.getMouseCol();
if (((!((_local3 == startCol))) && (GuiConnection.movedCanBeAdded(_local3)))){
visible = true;
_local2 = gui.table.getPile(_local3);
x = _local2.x;
y = (_local2.y + _local2.getLastCardY());
} else {
visible = false;
};
}
}
}//package guipackage
Section 5
//Clock (guipackage.Clock)
package guipackage {
import modelpackage.*;
import util.*;
import flash.display.*;
import flash.text.*;
public class Clock extends Sprite implements Renderable {
public var minute10:TextField;
public var minute1:TextField;
public var colon:TextField;
public var second10:TextField;
public var second1:TextField;
public var moves:TextField;
public var white:Sprite;
public var blue:MovieClip;
protected var timeDisplay:TimeDisplay;
protected var timeWarningStart:int;// = 2147483647
protected var fadeInEnd:int;
protected var blueFramePlayer:FramePlayer;
protected var nextColorSwithTick:int;
public static const FADE_IN_TICKS:int = 60;
public static const ROTATION_TICKS:int = 60;
public static const SWITCH_COLOR_TICKS:int = 18;
public static const NORMAL_TEXT_COLOR:int = 14737924;
public static const BLINKING_TEXT_COLOR:int = 0x2B00;
public function Clock(){
blue.stop();
blue.visible = false;
timeDisplay = new TimeDisplay([second1, second10, minute1, minute10], App.TICKS_PER_SECOND);
}
public function initTimeWarning(_arg1:int):void{
timeWarningStart = _arg1;
fadeInEnd = (_arg1 + Clock.FADE_IN_TICKS);
blue.alpha = 0;
blue.visible = true;
nextColorSwithTick = timeWarningStart;
blueFramePlayer = new FramePlayer(blue, _arg1, Clock.ROTATION_TICKS, int.MAX_VALUE);
}
public function render(_arg1:int, _arg2:Number):int{
var _local3:Number;
var _local4:Number;
var _local5:int;
timeDisplay.update(GuiConnection.getCountDownTicks());
if (_arg1 >= timeWarningStart){
_local3 = (_arg1 + _arg2);
_local4 = (_local3 - timeWarningStart);
if (_local3 <= fadeInEnd){
blue.alpha = (_local4 / Clock.FADE_IN_TICKS);
} else {
blue.alpha = 1;
};
blueFramePlayer.update(_arg1, _arg2);
if (_arg1 >= nextColorSwithTick){
_local5 = Clock.BLINKING_TEXT_COLOR;
if (minute1.textColor == Clock.BLINKING_TEXT_COLOR){
_local5 = Clock.NORMAL_TEXT_COLOR;
};
minute10.textColor = _local5;
minute1.textColor = _local5;
colon.textColor = _local5;
second1.textColor = _local5;
second10.textColor = _local5;
nextColorSwithTick = (nextColorSwithTick + Clock.SWITCH_COLOR_TICKS);
};
};
return (Gui.RENDERABLE_CONTINUE);
}
}
}//package guipackage
Section 6
//DealAnimation (guipackage.DealAnimation)
package guipackage {
import modelpackage.*;
import flash.display.*;
import flash.events.*;
import flash.geom.*;
public class DealAnimation extends Sprite implements Renderable {
public var table:TableG;
public var gui:Gui;
protected static var flyCol:int = 0;
protected static var cardFlyInteval:int = 3;
protected static var cardFlyTicks:int = 30;
protected static var nextFlyingCardTick:int;
public function DealAnimation(_arg1:Gui){
this.gui = _arg1;
this.table = _arg1.table;
}
public function update(_arg1:Array, _arg2:int, _arg3:int):void{
var _local4:CardG;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:Pile;
var _local10:int;
var _local11:int;
var _local12:Point = gui.gamePanel.stock.getStartingPoint();
_local5 = 0;
while (_local5 < _arg1.length) {
_local6 = int(_arg1[_local5]);
_local4 = table.getCardG(_local6);
_local4.x = _local12.x;
_local4.y = _local12.y;
_local7 = (_arg2 + (_local5 * cardFlyInteval));
_local8 = (_arg3 - (((Table.NR_OF_COLS - _local5) - 1) * 6));
_local9 = table.getPile(_local5);
_local10 = _local9.x;
_local11 = (_local9.y + _local9.getNextCardY());
_local4.initDealing(_local7, _local8, _local10, _local11);
addChildAt(_local4, numChildren);
_local5++;
};
gui.soundManager.startSound(new DealSnd(), SoundManager.VOLUME_DEAL);
}
public function render(_arg1:int, _arg2:Number):int{
var _local3:int;
while (_local3 < numChildren) {
Renderable(getChildAt(_local3)).render(_arg1, _arg2);
_local3++;
};
return (Gui.RENDERABLE_CONTINUE);
}
}
}//package guipackage
Section 7
//DisappearAnimation (guipackage.DisappearAnimation)
package guipackage {
import flash.display.*;
import flash.events.*;
public class DisappearAnimation extends Sprite implements Renderable {
public var startTick:int;
protected var topCardY:int;
public static const MOVE_TICKS:int = 10;
public function DisappearAnimation(_arg1:int, _arg2:Pile, _arg3:Array){
var _local4:int;
var _local5:CardG;
var _local6:int;
super();
this.startTick = _arg1;
while (_local6 < _arg3.length) {
_local4 = int(_arg3[_local6]);
_local5 = Gui.gui.table.getCardG(_local4);
if (_local6 == 0){
topCardY = _local5.y;
} else {
_local5.y = (topCardY + (_local6 * _arg2.Y_SPACING));
};
_local5.initDisappearing(startTick, (startTick + MOVE_TICKS), topCardY);
addChild(_local5);
_local6++;
};
x = _arg2.x;
y = _arg2.y;
}
public function render(_arg1:int, _arg2:Number):int{
var _local3:CardG;
var _local4:int;
while (_local4 < numChildren) {
CardG(getChildAt(_local4)).render(_arg1, _arg2);
_local4++;
};
if (_arg1 >= (startTick + MOVE_TICKS)){
while (numChildren > 0) {
_local3 = CardG(removeChildAt(0));
Gui.gui.table.deleteCardG(_local3.id);
};
return (Gui.RENDERABLE_REMOVE);
};
return (Gui.RENDERABLE_CONTINUE);
}
}
}//package guipackage
Section 8
//Explosion (guipackage.Explosion)
package guipackage {
import util.*;
import flash.display.*;
public class Explosion extends Sprite implements Renderable {
public const CLOUD_TICKS:int = 60;
public const LIGHTNING_TICKS:int = 20;
public const X_OFFSET:int = 7;
public const Y_OFFSET:int = 30;
public var startTick:int;
public var lightning:MovieClip;
public var cloud:MovieClip;
public var lightningPlayer:FramePlayer;
public var cloudPlayer:FramePlayer;
public var isStarted:Boolean;// = false
public function Explosion(_arg1:int, _arg2:Pile){
this.startTick = _arg1;
x = (_arg2.x + X_OFFSET);
y = ((_arg2.y + Y_OFFSET) + ((_arg2.numChildren + 1) * _arg2.Y_SPACING));
this.mouseEnabled = false;
lightning.visible = false;
cloud.visible = false;
lightningPlayer = new FramePlayer(lightning, _arg1, LIGHTNING_TICKS, 0);
cloudPlayer = new FramePlayer(cloud, _arg1, CLOUD_TICKS, 0);
Gui.gui.startRenderable(this);
}
public function render(_arg1:int, _arg2:Number):int{
if ((((_arg1 >= startTick)) && (!(isStarted)))){
lightning.visible = true;
cloud.visible = true;
isStarted = true;
};
lightningPlayer.update(_arg1, _arg2);
if (cloudPlayer.update(_arg1, _arg2) == Gui.RENDERABLE_STOP){
return (Gui.RENDERABLE_REMOVE);
};
return (Gui.RENDERABLE_CONTINUE);
}
}
}//package guipackage
Section 9
//GamePanel (guipackage.GamePanel)
package guipackage {
import modelpackage.*;
import util.*;
import flash.display.*;
import flash.events.*;
import flash.text.*;
public class GamePanel extends Sprite {
public const HEART_START_X:int = 0xFF;
public const HEART_X_SPACING:int = 60;
public const HEART_Y:int = 76;
public var king:King;
public var scorePanel:ScorePanel;
public var bonusPanel:BonusPanel;
public var clock:Clock;
public var heartShells:Sprite;
public var hearts:Sprite;
public var line:Sprite;
public var exitBtn:Sprite;
public var soundBtn:Sprite;
public var soundOff:Sprite;
public var musicBtn:Sprite;
public var musicOff:Sprite;
public var quit_:TextField;
public var stock:Stock;
public var borderOverStock:Sprite;
protected var gui:Gui;
protected var heartShellIndex:int;// = 0
public function GamePanel(_arg1:Gui){
var _local2:Heart;
var _local3:HeartShell;
var _local4:int;
super();
this.gui = _arg1;
soundOff.visible = _arg1.intro.soundOff.visible;
musicOff.visible = _arg1.intro.musicOff.visible;
hearts = new Sprite();
hearts.x = HEART_START_X;
hearts.y = HEART_Y;
addChild(hearts);
heartShells = new Sprite();
heartShells.x = HEART_START_X;
heartShells.y = HEART_Y;
addChild(heartShells);
while (_local4 < Table.NR_OF_SETS) {
_local2 = new Heart();
_local2.x = (_local4 * HEART_X_SPACING);
hearts.addChild(_local2);
_local3 = new HeartShell();
_local3.x = (_local4 * HEART_X_SPACING);
heartShells.addChild(_local3);
_local4++;
};
king = new King(_arg1);
addChild(king);
stock = new Stock(_arg1);
addChild(stock);
borderOverStock = new BorderOverStock();
borderOverStock.x = 27;
borderOverStock.y = 0;
borderOverStock.mouseEnabled = false;
addChild(borderOverStock);
if (_arg1.document.relaxMode){
clock.minute10.visible = false;
clock.minute1.visible = false;
clock.colon.visible = false;
clock.second10.visible = false;
clock.second1.visible = false;
} else {
_arg1.startRenderable(clock);
clock.moves.visible = false;
};
Translator.translateTextfields(this);
exitBtn.addEventListener(MouseEvent.CLICK, exitClicked);
exitBtn.addEventListener(MouseEvent.ROLL_OVER, exitRollOver);
exitBtn.addEventListener(MouseEvent.ROLL_OUT, exitRollOut);
soundBtn.addEventListener(MouseEvent.CLICK, toggleSound);
musicBtn.addEventListener(MouseEvent.CLICK, toggleMusic);
}
public function exitClicked(_arg1:Event):void{
Document.doc.addPlayData([App.INPUT_EXIT]);
}
public function exitRollOver(_arg1:Event):void{
quit_.textColor = 13385287;
}
public function exitRollOut(_arg1:Event):void{
quit_.textColor = 0x6600;
}
public function toggleSound(_arg1:Event):void{
gui.soundManager.toggleSound();
soundOff.visible = !(soundOff.visible);
}
public function toggleMusic(_arg1:Event):void{
gui.soundManager.toggleMusic();
musicOff.visible = !(musicOff.visible);
}
public function getNextHeartShell():HeartShell{
return (HeartShell(heartShells.getChildAt(heartShellIndex++)));
}
public function getNextHeartShellX():int{
if (heartShellIndex >= (heartShells.numChildren - 1)){
return (250);
};
return (heartShells.getChildAt(heartShellIndex).x);
}
public function updateScore(_arg1:int):void{
scorePanel.scoreTf.text = ("" + _arg1);
}
public function updateBonus(_arg1:int):void{
bonusPanel.bonusTf.text = ("" + _arg1);
}
public function heartShellFinished(_arg1:HeartShell):void{
var _local2:int = heartShells.getChildIndex(_arg1);
var _local3:Heart = Heart(hearts.getChildAt(_local2));
Gui.gui.startRenderable(_local3);
}
public function lastCardFromStock():void{
swapChildren(king, borderOverStock);
}
}
}//package guipackage
Section 10
//Gui (guipackage.Gui)
package guipackage {
import flash.display.*;
import flash.events.*;
public class Gui extends Sprite {
public var table:TableG;
public var lamps:Lamps;
public var version:int;// = 0
public var background:Sprite;
public var intro:Intro;
public var gamePanel:GamePanel;
public var outro:Outro;
public var message:Message;
public var soundManager:SoundManager;
public var document:Document;
protected var objectsToRender:Array;
protected var gameRunning:Boolean;// = false
public var endReason:int;
public static const NORMAL:int = 0;
public static const CHRISTMAS:int = 1;
public static const RENDERABLE_CONTINUE:int = 0;
public static const RENDERABLE_STOP:int = 1;
public static const RENDERABLE_HIDE:int = 2;
public static const RENDERABLE_REMOVE:int = 3;
public static var gui:Gui;
public function Gui(_arg1:Document, _arg2, _arg3){
this.document = _arg1;
Gui.gui = this;
soundManager = new SoundManager(this);
objectsToRender = new Array();
background = new Background();
addChild(background);
intro = new Intro(this);
addChild(intro);
startRenderable(intro);
}
protected function initDisplayObjects():void{
}
public function startGame():void{
gamePanel = new GamePanel(this);
addChild(gamePanel);
if (version == Gui.CHRISTMAS){
lamps = new Lamps();
addChild(lamps);
startRenderable(lamps);
lamps.initInGame();
};
table = new TableG(this);
addChild(table);
table.initialize();
message = new Message();
message.x = (gamePanel.stock.x + 80);
message.y = (gamePanel.stock.y - 50);
addChild(message);
document.startGame();
soundManager.gameStart();
}
private function exitClicked(_arg1:MouseEvent):void{
}
private function toggleSound(_arg1:MouseEvent):void{
}
public function startRenderable(_arg1:Renderable):void{
var _local2:int = objectsToRender.indexOf(_arg1, 0);
if (_local2 == -1){
objectsToRender.push(_arg1);
};
}
public function stopRenderable(_arg1:Renderable):void{
var _local2:int = objectsToRender.indexOf(_arg1, 0);
if (_local2 != -1){
objectsToRender.splice(_local2, 1);
};
}
public function render(_arg1:int, _arg2:Number):void{
var _local3:Renderable;
var _local4:int;
var _local5:int = (objectsToRender.length - 1);
while (_local5 >= 0) {
_local3 = Renderable(objectsToRender[_local5]);
_local4 = _local3.render(_arg1, _arg2);
if (_local4 != Gui.RENDERABLE_CONTINUE){
stopRenderable(_local3);
if (_local4 == Gui.RENDERABLE_HIDE){
DisplayObject(_local3).visible = false;
} else {
if (_local4 == Gui.RENDERABLE_REMOVE){
DisplayObject(_local3).parent.removeChild(DisplayObject(_local3));
};
};
};
_local5--;
};
}
public function showTimeWarning():void{
}
public function gameOver(_arg1:int, _arg2:Boolean):void{
cleanUp();
outro = new Outro(this);
addChild(outro);
gamePanel.removeChild(gamePanel.line);
if (!document.relaxMode){
stopRenderable(gamePanel.clock);
};
soundManager.gameEnd(_arg2);
}
public function gameQuit():void{
document.gameQuit();
}
public function setGameRunning(_arg1:Boolean):void{
gameRunning = _arg1;
}
public function getGameRunning():Boolean{
return (gameRunning);
}
public function cleanUp():void{
table.cardHilight.deActivate();
table.movingCards.stopDrag();
if (!document.relaxMode){
stopRenderable(gamePanel.clock);
};
}
public function renderableIsRendered(_arg1:Renderable):Boolean{
if (objectsToRender.indexOf(_arg1) == -1){
return (false);
};
return (true);
}
public function showMessage():void{
gui.startRenderable(message);
}
}
}//package guipackage
Section 11
//Heart (guipackage.Heart)
package guipackage {
import util.*;
import flash.display.*;
public class Heart extends MovieClip implements Renderable {
public const TICKS:int = 60;
public const MAX_WAIT:int = 3600;
public const MIN_REPEATS:int = 3;
public const MAX_ADD_REPEAT:int = 10;
public var nextPulsingTick:int;// = 0
public var framePlayer:FramePlayer;
public function Heart(){
stop();
}
public function render(_arg1:int, _arg2:Number):int{
var _local3:int;
if (_arg1 >= nextPulsingTick){
_local3 = (MIN_REPEATS + (Math.random() * MAX_ADD_REPEAT));
framePlayer = new FramePlayer(this, _arg1, TICKS, _local3);
nextPulsingTick = ((_arg1 + ((_local3 + 1) * TICKS)) + (Math.random() * MAX_WAIT));
};
if (framePlayer != null){
if (framePlayer.update(_arg1, _arg2) == Gui.RENDERABLE_STOP){
framePlayer = null;
};
};
return (Gui.RENDERABLE_CONTINUE);
}
}
}//package guipackage
Section 12
//HeartShell (guipackage.HeartShell)
package guipackage {
import util.*;
import flash.display.*;
public class HeartShell extends MovieClip implements Renderable {
public var startTick:int;
public var framePlayer:FramePlayer;
public var soundPlayed:Boolean;// = false
public static const TICKS:int = 60;
public function HeartShell(){
stop();
}
public function init(_arg1:int):void{
var _local2:int;
this.startTick = _arg1;
framePlayer = new FramePlayer(this, _arg1, HeartShell.TICKS, _local2);
Gui.gui.startRenderable(this);
}
public function render(_arg1:int, _arg2:Number):int{
if ((((_arg1 >= startTick)) && (!(soundPlayed)))){
Gui.gui.soundManager.startSound(new ShellSnd(), SoundManager.VOLUME_SHELL);
soundPlayed = true;
};
if (framePlayer.update(_arg1, _arg2) == Gui.RENDERABLE_STOP){
Gui.gui.gamePanel.heartShellFinished(this);
return (Gui.RENDERABLE_STOP);
};
return (Gui.RENDERABLE_CONTINUE);
}
}
}//package guipackage
Section 13
//Intro (guipackage.Intro)
package guipackage {
import util.*;
import flash.display.*;
import flash.events.*;
import flash.text.*;
public class Intro extends Sprite implements Renderable {
protected const COUNT_DOWN_SECONDS:Number = 20;
protected const INSTRUCTION_TICKS:int = 1200;
public var gui:Gui;
public var soundBtn:Sprite;
public var soundOff:Sprite;
public var musicBtn:Sprite;
public var musicOff:Sprite;
public var instructionTf:TextField;
public var game_starts_in_:TextField;
public var countDownTf:TextField;
public var intro_seconds_:TextField;
public var kingIntro:KingIntro;
public var startBtn:Sprite;
public var lamps:Lamps;
protected var countDownTicks:int;
protected var countDownSec:int;
protected var startTick:int;// = -1
protected var endTick:int;// = -1
protected var lastTimeStr:String;
protected var kingPlayer:FramePlayer;
public function Intro(_arg1:Gui){
this.gui = _arg1;
soundOff.visible = false;
musicOff.visible = false;
if (_arg1.version == Gui.CHRISTMAS){
lamps = new Lamps();
addChild(lamps);
_arg1.startRenderable(lamps);
};
countDownTicks = (COUNT_DOWN_SECONDS * App.TICKS_PER_SECOND);
countDownSec = (countDownTicks / App.TICKS_PER_SECOND);
countDownTf.text = ("" + countDownSec);
startBtn.addEventListener(MouseEvent.CLICK, start);
_arg1.soundManager.startIntroSound();
soundBtn.addEventListener(MouseEvent.CLICK, toggleSound);
musicBtn.addEventListener(MouseEvent.CLICK, toggleMusic);
}
public function toggleSound(_arg1:Event):void{
gui.soundManager.toggleSound();
soundOff.visible = !(soundOff.visible);
}
public function toggleMusic(_arg1:Event):void{
gui.soundManager.toggleMusic();
musicOff.visible = !(musicOff.visible);
}
public function render(_arg1:int, _arg2:Number):int{
if (startTick == -1){
startTick = _arg1;
endTick = (startTick + countDownTicks);
Translator.translateTextfields(this);
kingPlayer = new FramePlayer(kingIntro, _arg1, INSTRUCTION_TICKS, 0);
};
kingPlayer.update(_arg1, _arg2);
var _local3:int = ((endTick - _arg1) / App.TICKS_PER_SECOND);
if (_local3 != countDownSec){
countDownSec = _local3;
countDownTf.text = ("" + countDownSec);
};
if (_arg1 >= endTick){
gui.startGame();
return (Gui.RENDERABLE_REMOVE);
};
return (Gui.RENDERABLE_CONTINUE);
}
protected function start(_arg1:MouseEvent):void{
removeEventListener(MouseEvent.CLICK, start);
endTick = 0;
}
}
}//package guipackage
Section 14
//King (guipackage.King)
package guipackage {
import flash.display.*;
public class King extends Sprite implements Renderable {
public const MIN_IDLE_DELAY:int = 60;
public const VARIABLE_IDLE_DELAY:int = 360;
public const PUSH_MIN_WAIT:int = 10;
public const KICK_POSITION:int = -70;
public const KING_X_OFFSET:int = 0;
public const MAX_DISTANCE_TO_NEXT_SHELL:int = 150;
public const MIN_X:int = 200;
public const MAX_X:int = 700;
public const HIDDEN:int = 0;
public const STILL:int = 1;
public const WAITING_FOR_PASSIVE_ANIMATION:int = 2;
public const DOING_PASSIVE_ANIMATION:int = 3;
public const WAITING_FOR_PUSH:int = 4;
public const PUSHING:int = 5;
public const WALKING:int = 6;
public const FINISHING:int = 7;
protected const PUSH_MOVE:int = -50;
public var startX:int;// = 100
public var startY:int;// = 111
public var gui:Gui;
public var kingStandby:KingStandby;
public var kingJump:KingJump;
public var kingPush:KingPush;
public var kingWalk:KingWalk;
public var currentKing:Renderable;
protected var countDownToPassiveAnimation:int;// = -1
protected var lastTick:int;// = 0
public var state:int;
protected var pushStartTick:int;// = -1
protected var finishStartTick:int;
protected var finishEndTick:int;
protected var finishInited:Boolean;// = false
protected var finishStartFrame:int;
protected var finishEndFrame:int;
protected var startWalkTick:int;// = 2147483647
public static const WAIT_FOR_PUSH_TICKS:int = 4;
public static const TICKS_TILL_KICK:int = 40;
public function King(_arg1:Gui){
this.gui = _arg1;
kingStandby = new KingStandby();
kingStandby.x = KING_X_OFFSET;
kingJump = new KingJump();
kingJump.x = KING_X_OFFSET;
kingPush = new KingPush();
kingPush.x = KING_X_OFFSET;
kingWalk = new KingWalk();
kingWalk.x = KING_X_OFFSET;
currentKing = kingWalk;
addChild(kingWalk);
state = HIDDEN;
visible = false;
countDownToPassiveAnimation = randomWait();
x = startX;
y = startY;
_arg1.startRenderable(this);
}
public function randomWait():int{
return ((MIN_IDLE_DELAY + (Math.random() * VARIABLE_IDLE_DELAY)));
}
public function render(_arg1:int, _arg2:Number):int{
var _local3:int;
var _local4:int = (_arg1 - lastTick);
lastTick = _arg1;
switch (state){
case HIDDEN:
if (_arg1 >= startWalkTick){
visible = true;
currentKing = kingWalk;
kingWalk.init(_arg1, getNewKingX());
state = WALKING;
};
break;
case STILL:
if (_arg1 >= startWalkTick){
currentKing = kingWalk;
kingWalk.init(_arg1, getNewKingX());
state = WALKING;
};
break;
case WAITING_FOR_PASSIVE_ANIMATION:
countDownToPassiveAnimation = (countDownToPassiveAnimation - _local4);
if (countDownToPassiveAnimation <= 0){
state = DOING_PASSIVE_ANIMATION;
initPassiveAnimation(_arg1);
currentKing.render(_arg1, _arg2);
};
break;
case WALKING:
_local3 = currentKing.render(_arg1, _arg2);
if (_local3 == Gui.RENDERABLE_STOP){
countDownToPassiveAnimation = randomWait();
state = WAITING_FOR_PASSIVE_ANIMATION;
};
break;
case DOING_PASSIVE_ANIMATION:
_local3 = currentKing.render(_arg1, _arg2);
if (_local3 == Gui.RENDERABLE_STOP){
countDownToPassiveAnimation = randomWait();
state = WAITING_FOR_PASSIVE_ANIMATION;
};
break;
case WAITING_FOR_PUSH:
if (finishAnimation(_arg1, King.WAIT_FOR_PUSH_TICKS)){
state = PUSHING;
removeCurentKing();
currentKing = kingPush;
addChild(kingPush);
kingPush.init(_arg1, PUSH_MOVE);
kingPush.render(_arg1, _arg2);
};
break;
case PUSHING:
_local3 = kingPush.render(_arg1, _arg2);
if (_local3 == Gui.RENDERABLE_STOP){
state = STILL;
removeCurentKing();
currentKing = kingWalk;
addChild(kingWalk);
pushStartTick = -1;
};
break;
case FINISHING:
if (finishAnimation(_arg1, Outro.FINISH_ANIMATIONS_TICKS)){
return (Gui.RENDERABLE_STOP);
};
break;
};
return (Gui.RENDERABLE_CONTINUE);
}
protected function finishAnimation(_arg1:int, _arg2:int):Boolean{
var _local3:Boolean;
var _local4:Boolean;
var _local5:MovieClip = MovieClip(currentKing);
if (!finishInited){
finishStartFrame = _local5.currentFrame;
_local3 = ((finishStartFrame * 2) > _local5.totalFrames);
if (_local3){
finishEndFrame = _local5.totalFrames;
} else {
finishEndFrame = 1;
};
finishInited = true;
};
var _local6:int = (_arg1 - finishStartTick);
var _local7:Number = (_local6 / _arg2);
var _local8:int = (finishEndFrame - finishStartFrame);
_local5.gotoAndStop((finishStartFrame + (_local7 * _local8)));
if (_arg1 >= finishEndTick){
_local5.gotoAndStop(finishEndFrame);
finishInited = false;
_local4 = true;
};
return (_local4);
}
public function initPassiveAnimation(_arg1:int):void{
randomizeKing();
if (currentKing == kingStandby){
kingStandby.init(_arg1);
} else {
if (currentKing == kingJump){
kingJump.init(_arg1);
};
};
}
public function randomizeKing():void{
removeCurentKing();
var _local1:int = (Math.random() * 2);
if (_local1 == 0){
currentKing = kingJump;
addChild(kingJump);
} else {
if (_local1 == 1){
currentKing = kingStandby;
addChild(kingStandby);
};
};
}
public function removeCurentKing():void{
if (currentKing == kingJump){
removeChild(kingJump);
} else {
if (currentKing == kingStandby){
removeChild(kingStandby);
} else {
if (currentKing == kingPush){
removeChild(kingPush);
} else {
if (currentKing == kingWalk){
removeChild(kingWalk);
};
};
};
};
}
public function initPush(_arg1:int):void{
var _local2:HeartShell = gui.gamePanel.getNextHeartShell();
_local2.init(((_arg1 + King.WAIT_FOR_PUSH_TICKS) + King.TICKS_TILL_KICK));
if (((((!((state == PUSHING))) && (!((state == WAITING_FOR_PUSH))))) && (!((state == HIDDEN))))){
state = WAITING_FOR_PUSH;
finishStartTick = (_arg1 + King.WAIT_FOR_PUSH_TICKS);
startWalkTick = (((_arg1 + King.WAIT_FOR_PUSH_TICKS) + King.TICKS_TILL_KICK) + HeartShell.TICKS);
};
if (state == HIDDEN){
startWalkTick = (((_arg1 + King.WAIT_FOR_PUSH_TICKS) + King.TICKS_TILL_KICK) + HeartShell.TICKS);
};
}
public function stopPassiveAnimation():void{
if (currentKing == kingStandby){
kingStandby.framePlayer.remainingRepeats = 0;
} else {
if (currentKing == kingJump){
kingJump.framePlayer.remainingRepeats = 0;
};
};
}
public function getNewKingX():int{
return (getKickX(gui.gamePanel.getNextHeartShellX()));
}
public function getKickX(_arg1:int):int{
return (((gui.gamePanel.heartShells.x + _arg1) + KICK_POSITION));
}
public function finishAnimations(_arg1:int, _arg2:int):void{
finishStartTick = _arg1;
finishEndTick = _arg2;
state = FINISHING;
}
public function lastCardFromStock():void{
if (state == HIDDEN){
startWalkTick = 0;
};
}
}
}//package guipackage
Section 15
//KingFinalJump (guipackage.KingFinalJump)
package guipackage {
import util.*;
import flash.display.*;
public class KingFinalJump extends MovieClip implements Renderable {
protected var framePlayer:FramePlayer;
protected var movement:Movement;
public static const TICKS:int = 80;
public static const MOVEMENT_START:int = 32;
public static const MOVEMENT_END:int = 60;
public static const MOVEMANET_PIXELS:int = 15;
public function KingFinalJump(){
stop();
}
public function init(_arg1:int):void{
framePlayer = new FramePlayer(this, _arg1, TICKS, 0);
movement = new Movement(this, (_arg1 + KingFinalJump.MOVEMENT_START), (_arg1 + KingFinalJump.MOVEMENT_END), x, y, x, (y + MOVEMANET_PIXELS));
Gui.gui.startRenderable(this);
}
public function render(_arg1:int, _arg2:Number):int{
var _local3:int = framePlayer.update(_arg1, _arg2);
movement.update(_arg1, _arg2);
if (_local3 == Gui.RENDERABLE_STOP){
y = movement.endY;
return (Gui.RENDERABLE_STOP);
};
return (_local3);
}
}
}//package guipackage
Section 16
//KingJump (guipackage.KingJump)
package guipackage {
import util.*;
import flash.display.*;
public class KingJump extends MovieClip implements Renderable {
public const TICKS:int = 40;
public const MAX_REPEATS:int = 6;
public var framePlayer:FramePlayer;
public function KingJump(){
stop();
}
public function init(_arg1:int):void{
var _local2:int = (Math.random() * MAX_REPEATS);
framePlayer = new FramePlayer(this, _arg1, TICKS, _local2);
}
public function render(_arg1:int, _arg2:Number):int{
var _local3:int = framePlayer.update(_arg1, _arg2);
if (_local3 == Gui.RENDERABLE_STOP){
gotoAndStop(0);
};
return (_local3);
}
}
}//package guipackage
Section 17
//KingPush (guipackage.KingPush)
package guipackage {
import util.*;
import flash.display.*;
public class KingPush extends MovieClip implements Renderable {
public const TICKS:int = 100;
public var startX:int;
public var framePlayer:FramePlayer;
public var flyDistance:int;
public var kickFrame:int;
public var landingFrame:int;
public var flyFrames:int;
public var hasLanded:Boolean;
public var hasKicked:Boolean;
public function KingPush(){
gotoAndStop("kick");
kickFrame = currentFrame;
gotoAndStop("landed");
landingFrame = currentFrame;
flyFrames = (landingFrame - kickFrame);
gotoAndStop(0);
}
public function init(_arg1:int, _arg2:int):void{
var _local3:int;
startX = parent.x;
hasLanded = false;
hasKicked = false;
this.flyDistance = _arg2;
framePlayer = new FramePlayer(this, _arg1, TICKS, _local3);
}
public function render(_arg1:int, _arg2:Number):int{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:int = framePlayer.update(_arg1, _arg2);
if (_local6 == Gui.RENDERABLE_STOP){
gotoAndStop(0);
};
if (currentLabel == "kick"){
_local3 = (currentFrame - kickFrame);
_local4 = (_local3 / flyFrames);
_local5 = (_local4 * flyDistance);
parent.x = Math.floor((startX + _local5));
} else {
if ((((currentLabel == "landed")) && (!(hasLanded)))){
parent.x = (startX + flyDistance);
hasLanded = true;
};
};
return (_local6);
}
}
}//package guipackage
Section 18
//KingStandby (guipackage.KingStandby)
package guipackage {
import util.*;
import flash.display.*;
public class KingStandby extends MovieClip implements Renderable {
public const TICKS:int = 40;
public const MAX_REPEATS:int = 6;
public var framePlayer:FramePlayer;
public function KingStandby(){
stop();
}
public function init(_arg1:int):void{
var _local2:int = (Math.random() * MAX_REPEATS);
framePlayer = new FramePlayer(this, _arg1, TICKS, _local2);
}
public function render(_arg1:int, _arg2:Number):int{
var _local3:int = framePlayer.update(_arg1, _arg2);
if (_local3 == Gui.RENDERABLE_STOP){
gotoAndStop(0);
};
return (_local3);
}
}
}//package guipackage
Section 19
//KingWalk (guipackage.KingWalk)
package guipackage {
import util.*;
import flash.display.*;
public class KingWalk extends MovieClip implements Renderable {
public const TICKS:int = 15;
public const STEP_DISTANCE:int = 17;
public var king:King;
public var movement:Movement;
public var framePlayer:FramePlayer;
public function KingWalk(){
stop();
}
public function init(_arg1:int, _arg2:int):void{
var _local3:int;
king = King(parent);
var _local4:int = Math.abs((king.x - _arg2));
var _local5:int = (_local4 / STEP_DISTANCE);
if ((_local4 % STEP_DISTANCE) > 0.5){
_local5++;
};
var _local6:* = (_arg2 > king.x);
if (_local5 > 0){
_local3 = (_arg1 + (_local5 * TICKS));
movement = new Movement(king, _arg1, _local3, king.x, king.y, _arg2, king.y);
framePlayer = new FramePlayer(this, _arg1, TICKS, (_local5 - 1), _local6);
Gui.gui.startRenderable(this);
};
}
public function render(_arg1:int, _arg2:Number):int{
var _local3:Boolean = movement.update(_arg1, _arg2);
var _local4:int = framePlayer.update(_arg1, _arg2);
if (((_local3) && ((_local4 == Gui.RENDERABLE_STOP)))){
gotoAndStop(0);
return (Gui.RENDERABLE_STOP);
};
return (Gui.RENDERABLE_CONTINUE);
}
}
}//package guipackage
Section 20
//Lamps (guipackage.Lamps)
package guipackage {
import flash.display.*;
import flash.events.*;
public class Lamps extends Sprite implements Renderable {
public var lamp1:Sprite;
public var lamp2:Sprite;
public var lamp3:Sprite;
public var lamp4:Sprite;
public var lamp5:Sprite;
public var lamp6:Sprite;
public var lamp7:Sprite;
public var nextLampChange:int;// = 0
public var currentColor:int;// = -1
public static const MIN_CHANGE_TIME:int = 20;
public static const MAX_CHANGE_ADD_TIME:int = 30;
public static const BLUE:int = 0;
public static const GREEN:int = 1;
public static const YELLOW:int = 2;
public static const PURPLE:int = 3;
public function Lamps(){
lamp1.visible = false;
lamp2.visible = false;
lamp3.visible = false;
lamp4.visible = false;
lamp5.visible = false;
lamp6.visible = false;
lamp7.visible = false;
}
public function initInGame():void{
lamp1.visible = true;
lamp2.visible = true;
lamp3.visible = true;
lamp4.visible = true;
lamp5.visible = true;
lamp6.visible = true;
lamp7.visible = true;
}
public function render(_arg1:int, _arg2:Number):int{
if (_arg1 >= nextLampChange){
switchColor(currentColor);
currentColor = (Math.random() * 4);
switchColor(currentColor);
nextLampChange = ((_arg1 + Lamps.MIN_CHANGE_TIME) + (Math.random() * MAX_CHANGE_ADD_TIME));
};
return (Gui.RENDERABLE_CONTINUE);
}
public function switchColor(_arg1:int):void{
var _local2:Class;
var _local3:int;
var _local4:Object;
var _local5:Boolean;
switch (_arg1){
case Lamps.BLUE:
_local2 = BlueLamp;
break;
case Lamps.GREEN:
_local2 = GreenLamp;
break;
case Lamps.PURPLE:
_local2 = PurpleLamp;
break;
case Lamps.YELLOW:
_local2 = YellowLamp;
break;
};
if (_local2 != null){
_local3 = 0;
_local3;
while (_local3 < numChildren) {
_local4 = getChildAt(_local3);
_local4;
if ((_local4 is _local2)){
_local5 = _local4.light.visible;
_local5;
(_local4.light.visible = !(_local5));
};
var _temp1 = _local3;
_local3 = (_local3 + 1);
_temp1;
};
};
}
}
}//package guipackage
Section 21
//Message (guipackage.Message)
package guipackage {
import util.*;
import flash.display.*;
import flash.text.*;
public class Message extends Sprite implements Renderable {
public const UP_TICKS:int = 10;
public const TO_NORMAL_TICKS:int = 5;
public const STILL_TICKS:int = 100;
public const MAX_SCALE:Number = 1.12;
public var startTick:int;// = -1
public var endTick:int;
public var bitmapImage:Sprite;
public var messageBox:Sprite;
public var can_not_deal_:TextField;
public var resizeUp:Resize;
public var resizeNormal:Resize;
public var bitmapD;
public var bitmapData:BitmapData;
public function Message(){
this.mouseEnabled = false;
can_not_deal_.mouseEnabled = false;
Translator.translateTextfield(can_not_deal_);
bitmapImage = new Sprite();
bitmapImage.x = -(Math.floor((width / 2)));
bitmapImage.y = -(Math.floor((height / 2)));
addChild(bitmapImage);
var _local1:BitmapData = new BitmapData(width, height, true, 0);
_local1.draw(this);
var _local2:Bitmap = new Bitmap(_local1);
bitmapImage.addChild(_local2);
messageBox.visible = false;
can_not_deal_.visible = false;
visible = false;
}
public function copySelf():void{
}
public function render(_arg1:int, _arg2:Number):int{
if (startTick == -1){
startTick = _arg1;
endTick = (((startTick + UP_TICKS) + TO_NORMAL_TICKS) + STILL_TICKS);
visible = true;
resizeUp = new Resize(this, startTick, (startTick + UP_TICKS), 0.4, 0.4, MAX_SCALE, MAX_SCALE);
resizeNormal = new Resize(this, ((startTick + UP_TICKS) + 1), ((startTick + UP_TICKS) + TO_NORMAL_TICKS), MAX_SCALE, MAX_SCALE, 1, 1);
};
resizeUp.update(_arg1);
resizeNormal.update(_arg1);
if (_arg1 >= endTick){
startTick = -1;
visible = false;
return (Gui.RENDERABLE_STOP);
};
return (Gui.RENDERABLE_CONTINUE);
}
}
}//package guipackage
Section 22
//MovingCards (guipackage.MovingCards)
package guipackage {
import flash.display.*;
import flash.events.*;
public class MovingCards extends Sprite {
public const Y_SPACING:int = 15;
public var table:TableG;
public var cardStartMouseX:int;
public var cardStartMouseY:int;
public function MovingCards(_arg1:TableG){
this.table = _arg1;
}
public function update(_arg1:Array, _arg2:int):void{
var _local3:int;
var _local4:CardG;
var _local5:int;
while (_local5 < _arg1.length) {
_local3 = int(_arg1[_local5]);
_local4 = table.getCardG(_local3);
_local4.x = 0;
addChildAt(_local4, _local5);
_local4.y = (_local5 * Y_SPACING);
_local5++;
};
}
public function startFollowMouse():void{
x = (table.mouseX - cardStartMouseX);
y = (table.mouseY - cardStartMouseY);
startDrag();
addEventListener(MouseEvent.MOUSE_UP, release);
}
public function release(_arg1:Event):void{
removeEventListener(MouseEvent.MOUSE_UP, release);
stopDrag();
Document.doc.addPlayData([App.INPUT_STOP_MOVE, Gui.gui.table.getMouseCol()]);
}
public function mouseOut(_arg1:Event):void{
}
}
}//package guipackage
Section 23
//Outro (guipackage.Outro)
package guipackage {
import modelpackage.*;
import util.*;
import flash.display.*;
import flash.events.*;
public class Outro extends Sprite implements Renderable {
public const TICKS:int = 900;
public const MINIMAL_GAME_QUIT_DELAY:int = 120;
public const PANEL_X:int = -27;
public const PANEL_Y:int = 127;
public var totalScore:int;// = 0
public var gui:Gui;
public var endReason:int;
public var panel:OutroPanel;
public var kingFinalJump:KingFinalJump;
public var kingDance:MovieClip;
public var kingFall:MovieClip;
public var registerLeft:Sprite;
public var registerRight:Sprite;
public var register:Sprite;
public var plexiGlass:Sprite;
protected var started:Boolean;// = false
protected var startTick:int;
protected var endTick:int;
protected var countDownSeconds:int;// = -1
public var chainMovement:ChainMovement;
public var chainMovementStatus:int;// = 0
public var chainResize:ChainResize;
public var chainResizeStatus:int;// = 0
public var chainRotation:ChainRotation;
public var chainRotationStatus:int;// = 0
public var registerChainResize:ChainResize;
public var dancePlayer:FramePlayer;
public var fallPlayer:FramePlayer;
public var fallSpeed:Number;
public var switchKingTick:int;
public var hideLineTick:int;
public var gameQuitSent:Boolean;// = false
public var fadeInTick:int;
public var fadeStopTick:int;
protected var registerStartX:int;
public var finishingAnimations:Boolean;// = true
public var kingVisible:Boolean;// = false
public var countDownStr1:String;
public var countDownStr2:String;
public static const FINISH_ANIMATIONS_TICKS:int = 4;
public function Outro(_arg1:Gui){
this.gui = _arg1;
plexiGlass = new PlexiGlass();
plexiGlass.visible = false;
plexiGlass.alpha = 0;
addChild(plexiGlass);
panel = new OutroPanel();
panel.x = 374;
panel.y = 127;
addChild(panel);
registerLeft = new RegisterLeft();
registerLeft.visible = false;
addChild(registerLeft);
registerRight = new RegisterRight();
registerRight.visible = false;
addChild(registerRight);
Translator.translateTextfields(this);
countDownStr1 = Translator.getTranslation("game_ends_in_");
countDownStr2 = Translator.getTranslation("seconds_");
_arg1.startRenderable(this);
if (_arg1.gamePanel != null){
kingVisible = !((_arg1.gamePanel.king.state == _arg1.gamePanel.king.HIDDEN));
};
}
public function init(_arg1:int, _arg2:int):void{
this.startTick = (_arg1 + Outro.FINISH_ANIMATIONS_TICKS);
this.endTick = (_arg1 + TICKS);
this.endReason = _arg2;
if (_arg2 == App.SHORT_GAME_END){
};
addEventListener(MouseEvent.CLICK, gameQuit);
chainResize = new ChainResize(panel.maskSprite);
var _local3:int = _arg1;
chainResize.addResize(_local3, 1, 0.005);
_local3 = (_local3 + (KingFinalJump.TICKS - 5));
chainResize.addResize(_local3, 1, 0.005);
hideLineTick = _local3;
_local3 = (_local3 + 6);
switchKingTick = _local3;
_local3 = (_local3 + 19);
chainResize.addResize(_local3, 1, 1);
_local3 = (_local3 + 60);
fadeInTick = _local3;
_local3 = (_local3 + 90);
fadeStopTick = _local3;
if (((!(kingVisible)) && (GuiConnection.shortMode()))){
registerRight.visible = true;
registerRight.x = (gui.gamePanel.stock.x + gui.gamePanel.stock.getChildAt(0).width);
registerRight.y = (gui.gamePanel.stock.y - (gui.gamePanel.stock.height / 2));
};
}
protected function gameQuit(_arg1:MouseEvent):void{
endTick = (startTick + MINIMAL_GAME_QUIT_DELAY);
removeEventListener(MouseEvent.CLICK, gameQuit);
}
public function render(_arg1:int, _arg2:Number):int{
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:Number;
if (_arg1 >= startTick){
if (((!(started)) && (kingVisible))){
kingFinalJump = new KingFinalJump();
kingFinalJump.x = gui.gamePanel.king.x;
kingFinalJump.y = gui.gamePanel.king.y;
addChild(kingFinalJump);
kingFinalJump.init(startTick);
gui.stopRenderable(gui.gamePanel.king);
gui.gamePanel.king.visible = false;
started = true;
};
if (chainResizeStatus != Gui.RENDERABLE_STOP){
chainResizeStatus = chainResize.update(_arg1, _arg2);
};
if (registerChainResize != null){
registerChainResize.update(_arg1, _arg2);
};
if ((((_arg1 >= hideLineTick)) && (panel.line.visible))){
panel.line.visible = false;
};
if (dancePlayer != null){
dancePlayer.update(_arg1, _arg2);
if (register != null){
_local5 = kingDance.currentFrame;
if (_local5 <= 13){
register.x = (registerStartX - _local5);
} else {
if (_local5 <= 37){
register.x = (((registerStartX - 13) - 13) + _local5);
} else {
register.x = ((registerStartX + 13) - (_local5 - 37));
};
};
};
};
if (fallPlayer != null){
fallPlayer.update(_arg1, _arg2);
_local6 = switchKingTick;
if (_arg1 > _local6){
fallSpeed = (0 + ((_arg1 - _local6) * 0.3));
_local7 = 17;
if (fallSpeed > _local7){
fallSpeed = _local7;
};
kingFall.y = (kingFall.y + fallSpeed);
};
};
if (((((kingVisible) && ((_arg1 >= switchKingTick)))) && (!((kingFinalJump.parent == null))))){
removeChild(kingFinalJump);
if (((GuiConnection.shortMode()) || ((endReason == App.COMPLETED)))){
kingDance = new KingDance();
kingDance.x = kingFinalJump.x;
kingDance.y = kingFinalJump.y;
addChild(kingDance);
kingDance.stop();
dancePlayer = new FramePlayer(kingDance, _arg1, 60, int.MAX_VALUE);
if (GuiConnection.shortMode()){
if (kingDance.x > 375){
register = registerLeft;
registerStartX = (kingDance.x - 30);
} else {
register = registerRight;
registerStartX = (kingDance.x + 30);
};
register.x = registerStartX;
register.scaleX = 0;
register.scaleY = 0;
register.visible = true;
register.y = (kingDance.y - 55);
registerChainResize = new ChainResize(register);
registerChainResize.addResize(_arg1, 0, 0);
registerChainResize.addResize((_arg1 + 30), 1.12, 1.12);
registerChainResize.addResize((_arg1 + 50), 1, 1);
};
} else {
kingFall = new KingFall();
kingFall.x = kingFinalJump.x;
kingFall.y = kingFinalJump.y;
addChild(kingFall);
kingFall.stop();
fallPlayer = new FramePlayer(kingFall, _arg1, 90, 0);
};
};
if ((((_arg1 > fadeInTick)) && ((_arg1 < fadeStopTick)))){
plexiGlass.visible = true;
_local8 = (_arg1 - fadeInTick);
_local9 = (fadeStopTick - fadeInTick);
_local10 = (_local8 / _local9);
plexiGlass.alpha = (_local10 * 0.25);
} else {
if (_arg1 >= fadeStopTick){
plexiGlass.alpha = 0.25;
};
};
if ((((_arg1 >= endTick)) && (!(gameQuitSent)))){
gui.gameQuit();
gameQuitSent = true;
panel.countDownTf.text = ((((countDownStr1 + " ") + 0) + " ") + countDownStr2);
};
_local3 = (endTick - _arg1);
_local4 = (_local3 / App.TICKS_PER_SECOND);
if (countDownSeconds != _local4){
countDownSeconds = _local4;
if (countDownSeconds >= 0){
panel.countDownTf.text = ((((countDownStr1 + " ") + _local4) + " ") + countDownStr2);
};
};
};
return (Gui.RENDERABLE_CONTINUE);
}
}
}//package guipackage
Section 24
//OutroPanel (guipackage.OutroPanel)
package guipackage {
import flash.display.*;
import flash.text.*;
public class OutroPanel extends Sprite {
public var bonusTf:TextField;
public var bonus_:TextField;
public var scoreTf:TextField;
public var score_:TextField;
public var line:Line;
public var countDownTf:TextField;
public var maskSprite:Sprite;
public var game_over_:TextField;
public var time_bonus_:TextField;
public var timeBonusTf:TextField;
public var total_score_:TextField;
public var totalScoreTf:TextField;
public function OutroPanel(){
maskSprite.scaleY = 0.005;
}
public function init(_arg1:int, _arg2:int, _arg3:int, _arg4:int):void{
scoreTf.text = ("" + _arg1);
bonusTf.text = ("" + _arg2);
timeBonusTf.text = ("" + _arg3);
totalScoreTf.text = ("" + _arg4);
}
}
}//package guipackage
Section 25
//Pile (guipackage.Pile)
package guipackage {
import modelpackage.*;
import util.*;
import flash.display.*;
import flash.events.*;
public class Pile extends CardContainer {
public const X_SPACING:int = 13;
public const Y_SPACING:int = 15;
public const WIDTH:int = 59;
public const START_X:int = 21;
public var col:int;
public var compressed:Boolean;// = false
public var maxPixels:int;// = 270
public var lastSequenceLength:int;
public var lastPixels:int;
public var unmovableCardsLength:int;
public var unmovablePixels:int;
public var unmovableSpacing:int;
public static const COMPRESS_LIMIT:int = 18;
public function Pile(_arg1:int, _arg2:TableG){
super(_arg2);
this.col = _arg1;
x = (START_X + (_arg1 * (WIDTH + X_SPACING)));
addEventListener(MouseEvent.ROLL_OUT, rollOut);
}
public function update(_arg1:Array):void{
var _local2:int;
var _local3:CardG;
var _local4:CardG;
var _local5:int;
while (_local5 < _arg1.length) {
_local2 = int(_arg1[_local5]);
_local3 = super.tableG.getCardG(_local2);
_local3.update();
_local3.scaleX = 1;
_local3.scaleY = 1;
_local3.x = 0;
_local3.y = (_local5 * Y_SPACING);
_local3.rotation = 0;
addChildAt(_local3, _local5);
_local5++;
};
while (numChildren > _arg1.length) {
_local4 = CardG(removeChildAt((numChildren - 1)));
_local4.previousParent = this;
};
compressed = (_arg1.length > Pile.COMPRESS_LIMIT);
if (compressed){
lastSequenceLength = GuiConnection.getLastSequenceLength(col);
lastPixels = (lastSequenceLength * Y_SPACING);
unmovableCardsLength = (numChildren - lastSequenceLength);
unmovablePixels = (maxPixels - lastPixels);
unmovableSpacing = (unmovablePixels / unmovableCardsLength);
};
if (compressed){
updateCompressedCardYs(-1, -1);
};
}
public function updateCompressedCardYs(_arg1:int, _arg2:int):void{
var _local3:int;
var _local4:int;
var _local5:* = 1;
while (_local5 < numChildren) {
_local3 = getChildAt((_local5 - 1)).y;
if (_local5 <= unmovableCardsLength){
if ((((_local5 >= _arg1)) && ((_local5 <= _arg2)))){
_local4 = Y_SPACING;
} else {
_local4 = unmovableSpacing;
};
} else {
_local4 = Y_SPACING;
};
getChildAt(_local5).y = (_local3 + _local4);
_local5++;
};
}
public function getLastCardY():int{
if (numChildren > 0){
return (getChildAt((numChildren - 1)).y);
};
return (0);
}
public function getNextCardY():int{
if (numChildren > 0){
return ((getChildAt((numChildren - 1)).y + Y_SPACING));
};
return (0);
}
public function cardRollover(_arg1:CardG, _arg2:MouseEvent):void{
var _local3:int;
var _local4:int;
var _local5:int;
if (compressed){
_local3 = getChildIndex(_arg1);
if (_local3 < unmovableCardsLength){
_local4 = (_local3 + 1);
if (_local4 < 0){
_local4 = 0;
};
_local5 = (_local3 + 10);
if (_local5 >= unmovableCardsLength){
_local5 = unmovableCardsLength;
};
updateCompressedCardYs(_local4, _local5);
} else {
updateCompressedCardYs(-1, -1);
};
};
}
public function rollOut(_arg1:MouseEvent):void{
if (compressed){
updateCompressedCardYs(-1, -1);
};
}
}
}//package guipackage
Section 26
//Renderable (guipackage.Renderable)
package guipackage {
public interface Renderable {
function render(_arg1:int, _arg2:Number):int;
}
}//package guipackage
Section 27
//SoundManager (guipackage.SoundManager)
package guipackage {
import util.*;
import flash.events.*;
import flash.media.*;
import flash.utils.*;
public class SoundManager {
public const LOOP_DELAY:int = 200;
public const OUTRO_DELAY:int = 300;
public const GOOD_DELAY:int = 1000;
public const BAD_DELAY:int = 1400;
private var soundOn:Boolean;// = true
private var musicOn:Boolean;// = true
private var introSound:Sound;
private var introSoundChannel:SoundChannel;
private var introSoundTransform:SoundTransform;
private var loopSound:Sound;
private var loopSoundChannel:SoundChannel;
private var loopSoundTransform:SoundTransform;
private var outroSoundTransform:SoundTransform;
private var outroSound:Sound;
public var outroSoundChannel:SoundChannel;
private var timeWarningSound:Sound;
private var timeWarningSoundChannel:SoundChannel;
private var timeWarningSoundTransform:SoundTransform;
private var fallSound:Sound;
private var fallSoundChannel:SoundChannel;
private var fallSoundTransform:SoundTransform;
private var danceSound:Sound;
private var danceSoundChannel:SoundChannel;
private var danceSoundTransform:SoundTransform;
private var timer:Timer;
public var gui:Gui;
public static const STEREO_INTENSITY:Number = 0.7;
public static const VOLUME_INTRO:Number = 0.7;
public static const VOLUME_LOOP:Number = 0.6;
public static const VOLUME_OUTRO:Number = 0.7;
public static const VOLUME_DEAL:Number = 0.8;
public static const VOLUME_ONE_CARD:Number = 0.8;
public static const VOLUME_CARDS:Number = 0.8;
public static const VOLUME_ERROR:Number = 0.8;
public static const VOLUME_SHELL:Number = 0.8;
public static const VOLUME_TIME_WARNING:Number = 1;
public static const VOLUME_FALL:Number = 0.8;
public static const VOLUME_DANCE:Number = 0.8;
public function SoundManager(_arg1:Gui){
this.gui = _arg1;
}
public function toggleSound(_arg1:MouseEvent=null):void{
soundOn = !(soundOn);
if (!soundOn){
if (timeWarningSoundChannel != null){
timeWarningSoundChannel.soundTransform = new SoundTransform(0);
};
} else {
if (timeWarningSoundChannel != null){
timeWarningSoundChannel.soundTransform = new SoundTransform(SoundManager.VOLUME_TIME_WARNING);
};
};
if (musicOn){
if (soundOn){
startMusic();
} else {
stopMusic();
};
};
}
public function toggleMusic(_arg1:Event=null):void{
musicOn = !(musicOn);
if (musicOn){
startMusic();
} else {
stopMusic();
};
}
public function stopMusic():void{
if (loopSoundChannel != null){
loopSoundChannel.soundTransform = new SoundTransform(0);
};
if (introSoundChannel != null){
introSoundChannel.soundTransform = new SoundTransform(0);
};
if (outroSoundChannel != null){
outroSoundChannel.soundTransform = new SoundTransform(0);
};
}
public function startMusic():void{
if (((soundOn) && (musicOn))){
if (loopSoundChannel != null){
loopSoundChannel.soundTransform = new SoundTransform(SoundManager.VOLUME_LOOP);
};
if (introSoundChannel != null){
introSoundChannel.soundTransform = new SoundTransform(SoundManager.VOLUME_INTRO);
};
if (outroSoundChannel != null){
outroSoundChannel.soundTransform = new SoundTransform(SoundManager.VOLUME_OUTRO);
};
};
}
public function startIntroSound(_arg1:Event=null):void{
var _local2:Number = SoundManager.VOLUME_INTRO;
if (((!(soundOn)) || (!(musicOn)))){
_local2 = 0;
};
introSoundTransform = new SoundTransform(_local2);
introSound = new IntroSnd();
introSoundChannel = introSound.play(0, 0, introSoundTransform);
}
public function gameStart(_arg1:Event=null):void{
if (introSoundChannel != null){
new SoundFader(introSoundChannel, LOOP_DELAY);
};
timer = new Timer(LOOP_DELAY, 1);
timer.addEventListener("timerComplete", startLoopSound);
timer.start();
}
public function startLoopSound(_arg1:Event=null):void{
var _local2:Number = SoundManager.VOLUME_LOOP;
if (((!(soundOn)) || (!(musicOn)))){
_local2 = 0;
};
loopSoundTransform = new SoundTransform(_local2);
loopSound = new LoopSnd();
loopSoundChannel = loopSound.play(0, int.MAX_VALUE, loopSoundTransform);
}
public function gameEnd(_arg1:Boolean):void{
if (introSoundChannel != null){
new SoundFader(introSoundChannel, OUTRO_DELAY);
};
if (loopSoundChannel != null){
new SoundFader(loopSoundChannel, OUTRO_DELAY);
};
timer = new Timer(OUTRO_DELAY, 1);
if (_arg1){
timer.addEventListener("timerComplete", startDanceSound);
} else {
timer.addEventListener("timerComplete", startFallSound);
};
timer.start();
}
public function startFallSound(_arg1:Event=null):void{
var _local2:Number = SoundManager.VOLUME_FALL;
if (!soundOn){
_local2 = 0;
};
fallSoundTransform = new SoundTransform(_local2);
fallSound = new FallSnd();
fallSoundChannel = fallSound.play(0, 0, fallSoundTransform);
timer = new Timer(BAD_DELAY, 1);
timer.addEventListener("timerComplete", startOutroSound);
timer.start();
}
public function startDanceSound(_arg1:Event=null):void{
var _local2:Number = SoundManager.VOLUME_DANCE;
if (!soundOn){
_local2 = 0;
};
danceSoundTransform = new SoundTransform(_local2);
danceSound = new DanceSnd();
danceSoundChannel = danceSound.play(0, 0, danceSoundTransform);
timer = new Timer(GOOD_DELAY, 1);
timer.addEventListener("timerComplete", startOutroSound);
timer.start();
}
public function startOutroSound(_arg1:Event=null):void{
var _local2:Number = SoundManager.VOLUME_OUTRO;
if (((!(soundOn)) || (!(musicOn)))){
_local2 = 0;
};
outroSoundTransform = new SoundTransform(_local2);
outroSound = new OutroSnd();
outroSoundChannel = outroSound.play(0, 0, outroSoundTransform);
}
protected function playSound(_arg1:Sound, _arg2:Number, _arg3:int=0):void{
var _local4:SoundTransform = new SoundTransform(_arg2);
var _local5:Sound = _arg1;
var _local6:SoundChannel = _local5.play(0, _arg3, _local4);
}
public function startSound(_arg1:Sound, _arg2:Number, _arg3:int=0):void{
if (soundOn){
playSound(_arg1, _arg2, _arg3);
};
}
public function startTimeWarning():void{
var _local1:Number = SoundManager.VOLUME_TIME_WARNING;
if (!soundOn){
_local1 = 0;
};
timeWarningSoundTransform = new SoundTransform(_local1);
timeWarningSound = new TimeWarningSnd();
timeWarningSoundChannel = timeWarningSound.play(0, 0, timeWarningSoundTransform);
}
}
}//package guipackage
Section 28
//Stock (guipackage.Stock)
package guipackage {
import modelpackage.*;
import flash.display.*;
import flash.events.*;
import flash.geom.*;
public class Stock extends Sprite {
public const X_SPACING = -4;
public const Y_SPACING = -4;
public var gui:Gui;
public function Stock(_arg1:Gui){
this.gui = _arg1;
x = 47;
y = 112;
addEventListener(MouseEvent.CLICK, tryToDeal);
}
public function tryToDeal(_arg1:Event):void{
if (!GuiConnection.isDealing()){
if (GuiConnection.dealIsPossible()){
Document.doc.addPlayData([App.INPUT_DEAL]);
} else {
Gui.gui.showMessage();
};
};
}
public function getStartingPoint():Point{
return (localToGlobal(new Point((numChildren * X_SPACING), (numChildren * Y_SPACING))));
}
public function update():void{
var _local1:Sprite;
var _local2:int = (GuiConnection.getStockLength() / Table.NR_OF_COLS);
if (_local2 == 0){
gui.gamePanel.lastCardFromStock();
gui.gamePanel.king.lastCardFromStock();
};
while (numChildren > _local2) {
removeChildAt((numChildren - 1));
};
while (_local2 > numChildren) {
_local1 = new BigCard();
_local1.rotation = -90;
_local1.x = (numChildren * X_SPACING);
_local1.y = (numChildren * Y_SPACING);
addChild(_local1);
};
}
}
}//package guipackage
Section 29
//TableG (guipackage.TableG)
package guipackage {
import modelpackage.*;
import flash.display.*;
import flash.events.*;
public class TableG extends Sprite {
public var gui:Gui;
public var message:Message;
public var cards:Array;
public var backsidePiles:Array;
public var piles:Array;
public var dealAnimation:DealAnimation;
public var cardHilight:CardHilight;
public var movingCards:MovingCards;
public function TableG(_arg1:Gui){
this.gui = _arg1;
}
public function initialize():void{
var _local1:BacksidePile;
var _local2:Pile;
var _local3:int;
cards = new Array((Table.NR_OF_SETS * 13));
backsidePiles = new Array(Table.NR_OF_COLS);
while (_local3 < Table.NR_OF_COLS) {
_local1 = new BacksidePile(_local3, this);
backsidePiles[_local3] = _local1;
addChild(_local1);
_local3++;
};
piles = new Array(Table.NR_OF_COLS);
_local3 = 0;
while (_local3 < Table.NR_OF_COLS) {
_local2 = new Pile(_local3, this);
piles[_local3] = _local2;
addChild(_local2);
_local3++;
};
dealAnimation = new DealAnimation(gui);
addChild(dealAnimation);
cardHilight = new CardHilight(gui);
addChild(cardHilight);
movingCards = new MovingCards(this);
addChild(movingCards);
}
public function getMouseCol():int{
var _local1:int = (BacksidePile.WIDTH + BacksidePile.X_SPACING);
var _local2:int = ((movingCards.x - BacksidePile.START_X) - (_local1 / 2));
var _local3:int = (1 + (_local2 / _local1));
if (_local3 < 0){
_local3 = 0;
} else {
if (_local3 >= Table.NR_OF_COLS){
_local3 = (Table.NR_OF_COLS - 1);
};
};
return (_local3);
}
public function getPile(_arg1:int):Pile{
return (Pile(piles[_arg1]));
}
public function getBacksidePile(_arg1:int):BacksidePile{
return (BacksidePile(backsidePiles[_arg1]));
}
public function getCardG(_arg1:int):CardG{
var _local2:CardG;
if (cards[_arg1] != null){
_local2 = CardG(cards[_arg1]);
} else {
_local2 = new CardG(_arg1, this);
cards[_arg1] = _local2;
};
return (_local2);
}
public function deleteCardG(_arg1:int):void{
cards[_arg1] = null;
}
public function removeSequence(_arg1:int, _arg2:Array, _arg3:int):void{
var _local4:CardG = getCardG(int(_arg2[0]));
var _local5:Pile = Pile(_local4.previousParent);
var _local6:DisappearAnimation = new DisappearAnimation(_arg1, _local5, _arg2);
addChild(_local6);
gui.startRenderable(_local6);
var _local7:Explosion = new Explosion(_arg1, _local5);
addChild(_local7);
}
}
}//package guipackage
Section 30
//Card (modelpackage.Card)
package modelpackage {
public class Card {
var suite:int;
var value:int;
var isBackside:Boolean;
var pile:int;
var col:int;
var index:int;
var id:int;
public static const HEARTS:int = 0;
public static const SPADES:int = 1;
public function Card(_arg1:int, _arg2:int, _arg3:Boolean, _arg4:int, _arg5:int, _arg6:int, _arg7:int){
if ((((_arg1 < Card.HEARTS)) || ((_arg1 > Card.SPADES)))){
throw (new Error("illegal card suite"));
};
this.suite = _arg1;
if ((((_arg2 < 1)) || ((_arg2 > 13)))){
throw (new Error("illegal card value"));
};
this.value = _arg2;
this.isBackside = _arg3;
this.pile = _arg4;
this.col = _arg5;
this.index = _arg6;
this.id = _arg7;
}
public function toString():String{
return (("" + value));
}
}
}//package modelpackage
Section 31
//GuiConnection (modelpackage.GuiConnection)
package modelpackage {
import util.*;
import guipackage.*;
import flash.net.*;
public class GuiConnection {
protected static var url:String;
protected static var request:URLRequest;
protected static var variables:URLVariables;
protected static var moveToComplete:Boolean = false;
protected static var moveInitialized:Boolean = false;
static var stockChanged:Boolean = false;
static var cardsInDealChanged:Boolean = false;
static var movingCardsChanged:Boolean = false;
static var scoreChanged:Boolean = true;
static var bonusChanged:Boolean = true;
static var model:Model;
static var table:Table;
static var changedBacksidePiles:Array;
static var changedPiles:Array;
static var changedRemovedSets:Array;
public static function initialize():void{
var _local1:int;
GuiConnection.model = Document.doc.model;
GuiConnection.table = Document.doc.model.table;
GuiConnection.changedBacksidePiles = new Array(Table.NR_OF_COLS);
GuiConnection.changedPiles = new Array(Table.NR_OF_COLS);
_local1 = 0;
while (_local1 < Table.NR_OF_COLS) {
GuiConnection.changedBacksidePiles[_local1] = true;
GuiConnection.changedPiles[_local1] = true;
_local1++;
};
GuiConnection.changedRemovedSets = new Array();
_local1 = 0;
while (_local1 < Table.NR_OF_SETS) {
GuiConnection.changedRemovedSets[_local1] = false;
_local1++;
};
}
public static function analyzeModel(_arg1:int):void{
var _local2:Card;
var _local3:Array;
var _local4:int;
var _local5:Stack;
var _local6:Stack;
var _local7:Array;
var _local9:int;
var _local10:int;
var _local8:TableG = Gui.gui.table;
if (stockChanged){
Gui.gui.gamePanel.stock.update();
stockChanged = false;
};
while (_local9 < Table.NR_OF_COLS) {
if (Boolean(changedBacksidePiles[_local9])){
_local5 = table.getBacksidePile(_local9);
_local3 = getIdsFromCardStack(_local5);
_local8.getBacksidePile(_local9).update(_local3);
changedBacksidePiles[_local9] = false;
};
if (Boolean(changedPiles[_local9])){
_local6 = table.getPile(_local9);
_local3 = getIdsFromCardStack(_local6);
_local8.getPile(_local9).update(_local3);
changedPiles[_local9] = false;
};
_local9++;
};
if (cardsInDealChanged){
_local3 = new Array();
_local4 = 0;
while (_local4 < table.dealArray.length) {
_local2 = Card(table.dealArray[_local4]);
_local3.push(_local2.id);
_local4++;
};
_local8.dealAnimation.update(_local3, model.stateStartTick, model.stateEndTick);
cardsInDealChanged = false;
};
if (movingCardsChanged){
_local3 = new Array();
_local4 = 0;
while (_local4 < table.movingCards.size()) {
_local2 = Card(table.movingCards.g(_local4));
_local3.push(_local2.id);
_local4++;
};
_local8.movingCards.update(_local3, table.movingCol);
_local8.movingCards.startFollowMouse();
movingCardsChanged = false;
};
while (_local10 < Table.NR_OF_SETS) {
if (Boolean(changedRemovedSets[_local10])){
_local7 = table.removed.g(_local10);
_local3 = new Array();
_local4 = 0;
while (_local4 < _local7.length) {
_local2 = Card(_local7[_local4]);
_local3.push(_local2.id);
_local4++;
};
_local8.removeSequence(_arg1, _local3, _local10);
Gui.gui.gamePanel.king.initPush(_arg1);
changedRemovedSets[_local10] = false;
};
_local10++;
};
if (scoreChanged){
Gui.gui.gamePanel.updateScore(model.score);
scoreChanged = false;
};
if (bonusChanged){
Gui.gui.gamePanel.updateBonus(model.bonus);
bonusChanged = false;
if (model.document.relaxMode){
Gui.gui.gamePanel.clock.moves.text = ("" + model.moves);
};
};
if (model.countDownTicks == App.TIME_WARNING_TICKS){
Gui.gui.gamePanel.clock.initTimeWarning(_arg1);
Gui.gui.soundManager.startTimeWarning();
};
}
public static function stateChanged(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int):void{
switch (_arg2){
case model.NOT_SET:
break;
case model.DEALING:
Gui.gui.stopRenderable(Gui.gui.table.dealAnimation);
break;
case model.IDLE:
break;
case model.MOVING:
Gui.gui.table.cardHilight.deActivate();
break;
case model.GAME_OVER:
break;
};
switch (_arg3){
case model.NOT_SET:
break;
case model.DEALING:
Gui.gui.startRenderable(Gui.gui.table.dealAnimation);
break;
case model.IDLE:
break;
case model.MOVING:
Gui.gui.table.cardHilight.activate(table.movingCol);
break;
case model.GAME_OVER:
break;
};
}
public static function movedCanBeAdded(_arg1:int):Boolean{
return (table.movedCanBeAdded(_arg1));
}
public static function cardIsBackside(_arg1:int):Boolean{
return (getCard(_arg1).isBackside);
}
public static function cardSuite(_arg1:int):int{
return (getCard(_arg1).suite);
}
public static function cardValue(_arg1:int):int{
return (getCard(_arg1).value);
}
public static function getcardFrame(_arg1:int):int{
var _local2:Card = getCard(_arg1);
return (((_local2.suite * 13) + _local2.value));
}
public static function getCardIndex(_arg1:int):int{
return (getCard(_arg1).index);
}
private static function getCard(_arg1:int):Card{
return (Card(table.cards[_arg1]));
}
public static function cardCanBeDragged(_arg1:int):Boolean{
if (model.state != model.IDLE){
return (false);
};
return (table.cardCanBeDragged(_arg1));
}
public static function dealIsPossible():Boolean{
var _local1:Stack;
var _local2:int;
if (model.state != model.IDLE){
return (false);
};
while (_local2 < Table.NR_OF_COLS) {
_local1 = table.getPile(_local2);
if (_local1.size() == 0){
return (false);
};
_local2++;
};
return (true);
}
public static function getStockLength():int{
return (table.stock.size());
}
private static function getIdsFromCardStack(_arg1:Stack):Array{
var _local2:Card;
var _local4:int;
var _local3:Array = new Array();
while (_local4 < _arg1.size()) {
_local2 = Card(_arg1.g(_local4));
_local3.push(_local2.id);
_local4++;
};
return (_local3);
}
public static function getCountDownTicks():int{
return (model.countDownTicks);
}
public static function traceCard(_arg1:int):void{
var _local2:Card = Card(table.cards[_arg1]);
}
public static function gameOver(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int):void{
var isGoodEnd:Boolean;
var startTick = _arg1;
var endReason = _arg2;
var score = _arg3;
var bonus = _arg4;
var timeBonus = _arg5;
var totalScore = _arg6;
if (((model.shortMode) || ((endReason == App.COMPLETED)))){
isGoodEnd = true;
} else {
isGoodEnd = false;
};
Gui.gui.gameOver(endReason, isGoodEnd);
Gui.gui.outro.init(startTick, endReason);
Gui.gui.outro.panel.init(score, bonus, timeBonus, totalScore);
if (model.document.relaxMode){
Gui.gui.outro.panel.time_bonus_.text = model.document.gameDataXml.text.(@id == "moves_");
Gui.gui.outro.panel.timeBonusTf.text = ("" + model.moves);
};
}
public static function shortMode():Boolean{
return (model.shortMode);
}
public static function getLastSequenceLength(_arg1:int):int{
var _local2:Card;
var _local5:int;
var _local3:Stack = table.getPile(_arg1);
var _local4:int = _local3.size();
var _local6:* = -1;
var _local7:* = -1;
while (_local4 > 0) {
_local2 = Card(_local3.g((_local4 - 1)));
if ((((_local6 == -1)) || ((((_local2.value == (_local6 + 1))) && ((_local2.suite == _local7)))))){
_local4--;
_local6 = _local2.value;
_local7 = _local2.suite;
_local5++;
} else {
return (_local5);
};
};
return (_local5);
}
public static function isDealing():Boolean{
return ((model.state == model.DEALING));
}
public static function addCardSound():void{
if (table.movingCards.size() > 1){
Gui.gui.soundManager.startSound(new CardsSnd(), SoundManager.VOLUME_CARDS);
} else {
Gui.gui.soundManager.startSound(new OneCardSnd(), SoundManager.VOLUME_ONE_CARD);
};
}
public static function errorSound(_arg1:Boolean):void{
if (_arg1){
Gui.gui.soundManager.startSound(new ErrorSnd(), SoundManager.VOLUME_ERROR);
};
}
}
}//package modelpackage
Section 32
//Model (modelpackage.Model)
package modelpackage {
import util.*;
import flash.net.*;
public class Model {
public const DEAL_TICKS:int = 60;
public const NOT_SET:int = -1;
public const DEALING:int = 1;
public const IDLE:int = 2;
public const MOVING:int = 3;
public const GAME_OVER:int = 4;
public const SCORE_PER_SEQUENCE:int = 200;
public const COST_PER_MOVE:int = 4;
public const MAX_TIME_BONUS:int = 500;
public const STATE_STRINGS:Array;
var rand:Random;
protected var playData:Stack;
var countDownTicks:int;
var document:Document;
var score:int;// = 0
var bonus:int;// = 2000
var moves:int;// = 0
public var totalScore:int;// = 0
var shortMode:Boolean;// = false
var previousState:int;// = -1
var state:int;// = -1
var nextState:int;// = 1
var stateStartTick:int;// = -1
var stateEndTick:int;// = -1
public var table:Table;
public static const SHORT_MODE_END_TICK:int = (App.COUNTDOWN_TICKS - ((3 * 60) * App.TICKS_PER_SECOND));
public function Model(_arg1:Document){
STATE_STRINGS = ["not set", "dealing", "idle", "moving", "game over"];
super();
this.document = _arg1;
var _local2:int = (int((Math.random() * 10000000000)) + 1);
if (App.GAME_TYPE == App.DEV_MODE){
_local2 = 2094053089;
};
rand = new Random(_local2);
var _local3:String = _arg1.gameDataXml.@mode;
if (_local3 == "short"){
this.countDownTicks = App.COUNTDOWN_TICKS;
};
if (!_arg1.relaxMode){
this.countDownTicks = App.COUNTDOWN_TICKS;
};
_arg1.log((("[seed " + _local2) + "]"));
_arg1.log((("[countDownTicks " + countDownTicks) + "]"));
playData = new Stack();
table = new Table(this);
}
public function tick(_arg1:int):void{
executePlayData(_arg1);
update(_arg1);
}
protected function executePlayData(_arg1:int):void{
var _local2:Array;
var _local3:int;
var _local4:int;
var _local5:String;
var _local6:String;
var _local7:int;
var _local8:int;
var _local9:int;
while (playData.size() > 0) {
_local2 = playData.remove(0);
_local3 = int(_local2[0]);
_local4 = int(_local2[1]);
_local5 = String(App.INPUT_STRINGS[_local3]);
if (App.isLogicPlayData(_local3)){
_local6 = ((_local5 + " ") + _local4);
_local7 = 2;
while (_local7 < _local2.length) {
var _temp1 = _local7;
_local7 = (_local7 + 1);
_local8 = int(_local2[_temp1]);
_local6 = (_local6 + (" " + _local8));
};
document.log((("[" + _local6) + "]"));
};
switch (_local3){
case App.INPUT_START_MOVE:
_local9 = int(_local2[2]);
if (table.cardCanBeDragged(_local9)){
table.startMove(_local9);
nextState = MOVING;
};
break;
case App.INPUT_STOP_MOVE:
table.stopMove(int(_local2[2]));
nextState = IDLE;
break;
case App.INPUT_DEAL:
nextState = DEALING;
break;
case App.INPUT_EXIT:
inputExit(_arg1);
break;
case App.LAST_TICK:
break;
case App.CHEAT_TIMER_ALERT:
break;
case App.FIRST_TICK:
break;
default:
document.log(("**** Error in gameCore.tick(). Invalid inputType: " + _local3));
};
if (((!((_local4 == _arg1))) && (!((_local3 == App.LAST_TICK))))){
document.log(((("**** Warning, bad sync! tickToExecute " + _local4) + " currentTick ") + _arg1));
};
};
}
protected function update(_arg1:int):void{
checkState(_arg1);
switch (state){
case DEALING:
if (_arg1 == stateStartTick){
table.startDeal();
} else {
if (_arg1 == stateEndTick){
nextState = IDLE;
};
};
break;
case IDLE:
if (_arg1 == stateStartTick){
if (previousState == DEALING){
table.endDeal();
};
};
score = (score + (table.checkForSequences() * SCORE_PER_SEQUENCE));
if (table.removed.size() == Table.NR_OF_SETS){
document.log("completed");
gameOver(_arg1, App.COMPLETED);
} else {
if (!document.relaxMode){
countDown(_arg1);
};
};
break;
case MOVING:
if (!document.relaxMode){
countDown(_arg1);
};
break;
case GAME_OVER:
break;
};
}
public function checkState(_arg1:int):void{
if (nextState != NOT_SET){
previousState = state;
state = nextState;
document.log(("state changed to " + String(STATE_STRINGS[state])));
nextState = NOT_SET;
stateStartTick = _arg1;
stateEndTick = NOT_SET;
switch (state){
case DEALING:
stateEndTick = (_arg1 + DEAL_TICKS);
break;
case IDLE:
break;
case MOVING:
break;
case GAME_OVER:
break;
};
GuiConnection.stateChanged(_arg1, previousState, state, stateStartTick, stateEndTick);
};
}
public function addPlayData(_arg1:Array):void{
playData.push(_arg1);
}
protected function inputExit(_arg1:int):void{
document.log("user chose exit");
bonus = 0;
gameOver(_arg1, App.USER_CHOSE_EXIT);
}
protected function countDown(_arg1:int):void{
countDownTicks--;
if (countDownTicks <= 0){
document.log(("time finished " + _arg1));
bonus = 0;
gameOver(_arg1, App.TIME_RAN_OUT);
};
if (((shortMode) && ((countDownTicks <= Model.SHORT_MODE_END_TICK)))){
document.log(("short mode time finished " + _arg1));
bonus = 0;
gameOver(_arg1, App.SHORT_GAME_END);
};
}
protected function gameOver(_arg1:int, _arg2:int):void{
var _local3:Number;
var _local4:Number;
var _local5:int;
table.gameEndStopMove();
GuiConnection.analyzeModel(_arg1);
if (!document.relaxMode){
_local3 = (countDownTicks / App.COUNTDOWN_TICKS);
_local4 = (table.removed.size() / Table.NR_OF_SETS);
_local5 = ((MAX_TIME_BONUS * _local3) * _local4);
};
totalScore = ((score + bonus) + _local5);
document.log(("gameOver currentTick " + _arg1));
document.log(("gameover countDownTicks " + countDownTicks));
document.log(("gameover score " + score));
document.log(("gameover bonus " + bonus));
document.log(("gameover timeBonus " + _local5));
document.log(("gameover totalScore " + totalScore));
state = GAME_OVER;
GuiConnection.gameOver(_arg1, _arg2, score, bonus, _local5, totalScore);
document.addPlayData([App.LAST_TICK]);
document.gameOver(totalScore, _arg2);
}
}
}//package modelpackage
Section 33
//Table (modelpackage.Table)
package modelpackage {
import util.*;
import flash.display.*;
public class Table {
var document:Document;
var cards:Array;
var stock:Stack;
var dealArray:Array;
var backsidePiles:Stack;
var piles:Stack;
var movingCards:Stack;
var removed:Stack;
var model:Model;
var movingCol:int;// = -1
public static const STOCK:int = 0;
public static const BACKSIDE_PILE:int = 1;
public static const PILE:int = 2;
public static const CARDS_IN_DEAL:int = 4;
public static const MOVING:int = 5;
public static const REMOVED:int = 6;
public static const NO_COL:int = -1;
public static const NR_OF_COLS:int = 10;
public static const NR_OF_SETS:int = 8;
public static const CARDS_PER_SET:int = 13;
public function Table(_arg1:Model){
this.model = _arg1;
this.document = _arg1.document;
makeArrays();
fillStock();
stock = randomizeStack(stock);
fillBacksidePiles();
}
public function getPile(_arg1:int):Stack{
return (Stack(piles.g(_arg1)));
}
public function getBacksidePile(_arg1:int):Stack{
return (Stack(backsidePiles.g(_arg1)));
}
function makeArrays():void{
var _local1:int;
cards = new Array((Table.NR_OF_SETS * Table.CARDS_PER_SET));
stock = new Stack();
movingCards = new Stack();
dealArray = new Array(Table.NR_OF_COLS);
backsidePiles = new Stack();
piles = new Stack();
_local1 = 0;
while (_local1 < Table.NR_OF_COLS) {
backsidePiles.push(new Stack());
piles.push(new Stack());
_local1++;
};
removed = new Stack();
}
function fillStock():void{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int = Card.HEARTS;
_local1 = 0;
while (_local1 < Table.NR_OF_SETS) {
_local2 = 1;
while (_local2 <= 13) {
_local3 = ((_local1 * 13) + (_local2 - 1));
createCard(_local4, _local2, _local3);
_local2++;
};
_local1++;
};
}
function randomizeStack(_arg1:Stack):Stack{
var _local2:int;
var _local3:Card;
var _local5:int;
var _local4:Stack = new Stack();
while (_arg1.size() > 0) {
_local2 = Math.floor((model.rand.nextDouble() * _arg1.size()));
_local3 = Card(_arg1.remove(_local2));
_local3.index = _local5;
_local4.add(_local5, _local3);
_local5++;
};
return (_local4);
}
function fillBacksidePiles():void{
var _local1:Stack;
var _local2:int;
var _local3:int;
var _local4:Card;
var _local5:int;
while (_local5 < Table.NR_OF_COLS) {
_local1 = Stack(backsidePiles.g(_local5));
_local2 = 5;
if (_local5 > 3){
_local2 = 4;
};
_local3 = 0;
while (_local3 < _local2) {
_local4 = stock.pop();
_local4.pile = Table.BACKSIDE_PILE;
_local4.col = _local5;
_local4.index = _local3;
_local1.push(_local4);
_local3++;
};
_local5++;
};
}
function createCard(_arg1:int, _arg2:int, _arg3:int):void{
var _local4:Card = new Card(_arg1, _arg2, true, Table.STOCK, Table.NO_COL, stock.size(), _arg3);
stock.push(_local4);
cards[_arg3] = _local4;
}
function addCardToPile(_arg1:Card, _arg2:int):void{
var _local3:Stack = Stack(piles.g(_arg2));
_arg1.index = _local3.size();
_arg1.isBackside = false;
_arg1.pile = Table.PILE;
_arg1.col = _arg2;
_local3.push(_arg1);
GuiConnection.changedPiles[_arg2] = true;
}
public function addMoved(_arg1:int, _arg2:Boolean):void{
var _local3:Card;
var _local4:Stack;
while (movingCards.size() > 0) {
_local3 = Card(movingCards.remove(0));
addCardToPile(_local3, _arg1);
GuiConnection.movingCardsChanged = true;
};
if (!_arg2){
_local4 = getPile(movingCol);
if (_local4.size() == 0){
pileEmptied(movingCol);
};
if (document.relaxMode){
model.moves++;
};
model.bonus = (model.bonus - model.COST_PER_MOVE);
if (model.bonus < 0){
model.bonus = 0;
};
GuiConnection.bonusChanged = true;
};
}
function pileEmptied(_arg1:int):void{
var _local2:int;
var _local3:int;
var _local4:Card;
var _local5:Stack = getBacksidePile(_arg1);
if (_local5.size() > 0){
_local2 = 5;
if (_arg1 <= 3){
_local2 = 6;
};
_local3 = (_local2 - _local5.size());
model.score = (model.score + _local3);
GuiConnection.scoreChanged = true;
_local4 = _local5.pop();
GuiConnection.changedBacksidePiles[_arg1] = true;
addCardToPile(_local4, _arg1);
};
}
function startDeal():void{
var _local1:Card;
var _local2:int;
while (_local2 < NR_OF_COLS) {
_local1 = Card(stock.pop());
_local1.col = _local2;
_local1.index = ((NR_OF_COLS - 1) - _local2);
_local1.pile = Table.CARDS_IN_DEAL;
dealArray[_local2] = _local1;
_local2++;
};
GuiConnection.stockChanged = true;
GuiConnection.cardsInDealChanged = true;
}
function endDeal():void{
var _local1:Card;
var _local2:int;
while (_local2 < NR_OF_COLS) {
_local1 = Card(dealArray[_local2]);
dealArray[_local2] = null;
addCardToPile(_local1, _local2);
_local2++;
};
}
public function cardCanBeDragged(_arg1:int):Boolean{
var _local2:Stack;
var _local3:Card;
var _local4:int;
var _local5:Card;
var _local6:Card = Card(cards[_arg1]);
if (_local6.pile == Table.PILE){
_local2 = Stack(piles.g(_local6.col));
_local3 = Card(_local2.g((_local2.size() - 1)));
_local4 = (_local2.size() - 2);
while (_local4 >= _local6.index) {
_local5 = Card(_local2.g(_local4));
if ((((_local5.suite == _local3.suite)) && ((_local5.value == (_local3.value + 1))))){
_local3 = _local5;
} else {
return (false);
};
_local4--;
};
return (true);
};
return (false);
}
public function startMove(_arg1:int):void{
var _local2:Card = Card(cards[_arg1]);
var _local3:Stack = Stack(piles.g(_local2.col));
var _local4:int = (_local3.size() - 1);
while (_local4 >= _local2.index) {
movingCards.add(0, _local3.pop());
_local2.pile = MOVING;
_local4--;
};
document.log(("moving cards " + movingCards));
GuiConnection.movingCardsChanged = true;
GuiConnection.changedPiles[_local2.col] = true;
movingCol = _local2.col;
}
public function stopMove(_arg1:int):void{
var _local2:Boolean;
if (((!((movingCol == _arg1))) && (movedCanBeAdded(_arg1)))){
GuiConnection.addCardSound();
document.log(("added to col " + _arg1));
_local2 = false;
addMoved(_arg1, _local2);
} else {
GuiConnection.errorSound(!((movingCol == _arg1)));
document.log("not added");
_local2 = true;
addMoved(movingCol, _local2);
};
}
public function gameEndStopMove():void{
var _local1:Boolean;
if (model.state == model.MOVING){
_local1 = true;
addMoved(movingCol, _local1);
};
}
public function movedCanBeAdded(_arg1:int):Boolean{
var _local2:Stack = Stack(piles.g(_arg1));
if (_local2.size() == 0){
return (true);
};
var _local3:Card = Card(_local2.g((_local2.size() - 1)));
var _local4:Card = Card(movingCards.g(0));
if (_local4.value == (_local3.value - 1)){
return (true);
};
return (false);
}
public function checkForSequences():int{
var _local1:Stack;
var _local2:Array;
var _local3:int;
var _local4:Card;
var _local5:int;
var _local6:int;
while (_local6 < Table.NR_OF_COLS) {
if (pileEndsWithCompleteSequence(_local6)){
_local1 = getPile(_local6);
_local2 = new Array(13);
_local3 = 12;
while (_local3 >= 0) {
_local4 = Card(_local1.pop());
_local4.index = _local3;
_local4.pile = REMOVED;
_local2[_local3] = _local4;
_local3--;
};
removed.push(_local2);
if (_local1.size() == 0){
pileEmptied(_local6);
};
document.log(("completed sequence in col " + _local6));
GuiConnection.changedRemovedSets[(removed.size() - 1)] = true;
GuiConnection.changedPiles[_local6] = true;
GuiConnection.scoreChanged = true;
_local5++;
};
_local6++;
};
return (_local5);
}
public function pileEndsWithCompleteSequence(_arg1:int):Boolean{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:Card;
var _local6:Stack = getPile(_arg1);
if (_local6.size() >= 13){
_local2 = 0;
_local3 = -1;
_local4 = (_local6.size() - 1);
while (_local4 >= 0) {
_local5 = Card(_local6.g(_local4));
if (_local3 == -1){
_local3 = _local5.suite;
};
++_local2;
if ((((_local5.value == _local2)) && ((_local5.suite == _local3)))){
if (_local5.value == 13){
return (true);
};
} else {
return (false);
};
_local4--;
};
};
return (false);
}
}
}//package modelpackage
Section 34
//ReplayControl (replay.ReplayControl)
package replay {
import flash.display.*;
import flash.text.*;
public class ReplayControl extends Sprite {
public var playBtn:MovieClip;
public var stopTickTf:TextField;
public var speedTf:TextField;
public function ReplayControl(){
playBtn.stop();
}
}
}//package replay
Section 35
//blixt_43 (spider_king_normal_fla.blixt_43)
package spider_king_normal_fla {
import flash.display.*;
public dynamic class blixt_43 extends MovieClip {
public function blixt_43(){
addFrameScript(5, frame6);
}
function frame6(){
stop();
}
}
}//package spider_king_normal_fla
Section 36
//moln2_42 (spider_king_normal_fla.moln2_42)
package spider_king_normal_fla {
import flash.display.*;
public dynamic class moln2_42 extends MovieClip {
public function moln2_42(){
addFrameScript(22, frame23);
}
function frame23(){
stop();
}
}
}//package spider_king_normal_fla
Section 37
//ChainMovement (util.ChainMovement)
package util {
import flash.display.*;
import guipackage.*;
public class ChainMovement {
public var displayObject:DisplayObject;
public var movePoints:Array;
public var from:MovePoint;
public var to:MovePoint;
public function ChainMovement(_arg1:DisplayObject){
this.displayObject = _arg1;
movePoints = new Array();
}
public function addMove(_arg1:int, _arg2:Number, _arg3:Number):void{
movePoints.push(new MovePoint(_arg1, _arg2, _arg3));
}
public function update(_arg1:int, _arg2:Number):int{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
if (from == null){
from = shiftMove();
to = shiftMove();
};
if (_arg1 >= to.tick){
if (movePoints.length > 0){
from = to;
to = shiftMove();
} else {
displayObject.x = to.x;
displayObject.y = to.y;
return (Gui.RENDERABLE_STOP);
};
};
if (((!((from == null))) && (!((to == null))))){
_local3 = (to.tick - from.tick);
_local4 = (to.x - from.x);
_local5 = (to.y - from.y);
_local6 = (((_arg1 + _arg2) - from.tick) / _local3);
displayObject.x = (from.x + (_local4 * _local6));
displayObject.y = (from.y + (_local5 * _local6));
};
return (Gui.RENDERABLE_CONTINUE);
}
public function shiftMove():MovePoint{
return (MovePoint(movePoints.shift()));
}
}
}//package util
Section 38
//ChainResize (util.ChainResize)
package util {
import flash.display.*;
import guipackage.*;
public class ChainResize {
var displayObject:DisplayObject;
var points:Array;
var from:ResizePoint;
var to:ResizePoint;
public function ChainResize(_arg1:DisplayObject){
this.displayObject = _arg1;
points = new Array();
}
public function addResize(_arg1:int, _arg2:Number, _arg3:Number):void{
points.push(new ResizePoint(_arg1, _arg2, _arg3));
}
public function update(_arg1:int, _arg2:Number):int{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
if (from == null){
from = shift();
to = shift();
};
if (_arg1 >= to.tick){
if (points.length > 0){
from = to;
to = shift();
} else {
displayObject.scaleX = to.scaleX;
displayObject.scaleY = to.scaleY;
return (Gui.RENDERABLE_STOP);
};
};
if (((!((from == null))) && (!((to == null))))){
_local3 = (to.tick - from.tick);
_local4 = (to.scaleX - from.scaleX);
_local5 = (to.scaleY - from.scaleY);
_local6 = (((_arg1 + _arg2) - from.tick) / _local3);
displayObject.scaleX = (from.scaleX + (_local4 * _local6));
displayObject.scaleY = (from.scaleY + (_local5 * _local6));
};
return (Gui.RENDERABLE_CONTINUE);
}
public function shift():ResizePoint{
return (ResizePoint(points.shift()));
}
}
}//package util
Section 39
//ChainRotation (util.ChainRotation)
package util {
import flash.display.*;
import guipackage.*;
public class ChainRotation {
var displayObject:DisplayObject;
var points:Array;
var from:RotationPoint;
var to:RotationPoint;
public function ChainRotation(_arg1:DisplayObject){
this.displayObject = _arg1;
points = new Array();
}
public function addRotation(_arg1:int, _arg2:Number, _arg3:Number):void{
points.push(new RotationPoint(_arg1, _arg2, _arg3));
}
public function update(_arg1:int, _arg2:Number):int{
var _local3:Number;
var _local4:Number;
var _local5:Number;
if (from == null){
from = shift();
to = shift();
};
if (_arg1 >= to.tick){
if (points.length > 0){
from = to;
to = shift();
} else {
displayObject.rotation = to.rotation;
return (Gui.RENDERABLE_STOP);
};
};
if (((!((from == null))) && (!((to == null))))){
_local3 = (to.tick - from.tick);
_local4 = (to.rotation - from.rotation);
_local5 = (((_arg1 + _arg2) - from.tick) / _local3);
displayObject.rotation = (from.rotation + (_local4 * _local5));
};
return (Gui.RENDERABLE_CONTINUE);
}
public function shift():RotationPoint{
return (RotationPoint(points.shift()));
}
}
}//package util
Section 40
//Communicator (util.Communicator)
package util {
import flash.external.*;
import flash.system.*;
public class Communicator {
public function sendPlayData(_arg1:Array):void{
var _local2:String = ((String(_arg1[0]) + ",") + String(_arg1[1]));
var _local3:int = _arg1.length;
var _local4:* = 2;
while (_local4 < _local3) {
_local2 = (_local2 + (" " + String(_arg1[_local4])));
_local4++;
};
_local2 = (_local2 + "=0");
ExternalInterface.call("playData", _local2);
}
public function sendFsCommand(_arg1:String, _arg2:String):void{
fscommand(_arg1, _arg2);
}
}
}//package util
Section 41
//FramePlayer (util.FramePlayer)
package util {
import flash.display.*;
import guipackage.*;
public class FramePlayer {
public var movieClip:MovieClip;
public var startTick:int;
public var ticks:int;
public var endTick:int;
public var remainingRepeats:int;
public var forward:Boolean;
public function FramePlayer(_arg1:MovieClip, _arg2:int, _arg3:int, _arg4:int, _arg5:Boolean=true){
this.movieClip = _arg1;
this.startTick = _arg2;
this.ticks = _arg3;
this.endTick = (_arg2 + _arg3);
this.forward = _arg5;
remainingRepeats = _arg4;
}
public function update(_arg1:int, _arg2:Number):int{
var _local3:int;
var _local4:Number;
var _local5:int;
if (_arg1 >= startTick){
if (_arg1 >= endTick){
if (remainingRepeats-- > 0){
endTick = (_arg1 + ticks);
startTick = _arg1;
update(_arg1, _arg2);
} else {
movieClip.gotoAndStop(getFrame(movieClip.totalFrames));
return (Gui.RENDERABLE_STOP);
};
} else {
_local3 = (_arg1 - startTick);
_local4 = (_local3 / ticks);
_local5 = (1 + (_local4 * movieClip.totalFrames));
movieClip.gotoAndStop(getFrame(_local5));
};
};
return (Gui.RENDERABLE_CONTINUE);
}
protected function getFrame(_arg1:int):int{
if (forward){
return (_arg1);
};
return (((movieClip.totalFrames + 1) - _arg1));
}
}
}//package util
Section 42
//GameTimer (util.GameTimer)
package util {
import flash.utils.*;
public class GameTimer {
private var lastTime:Number;// = -1
private var msPerTick:Number;
private var unprocessedTime:Number;// = 0
public var alpha:Number;// = 0
public var passedTime:Number;// = 0
public function GameTimer(_arg1:Number){
msPerTick = (1000 / _arg1);
}
public function advanceTime():int{
if (lastTime == -1){
lastTime = getTimer();
};
var _local1:int = getTimer();
passedTime = (_local1 - lastTime);
lastTime = _local1;
unprocessedTime = (unprocessedTime + passedTime);
var _local2:int = int((unprocessedTime / msPerTick));
unprocessedTime = (unprocessedTime - (_local2 * msPerTick));
alpha = (unprocessedTime / msPerTick);
return (_local2);
}
}
}//package util
Section 43
//Integer64 (util.Integer64)
package util {
import util.*;
class Integer64 {
private var p:Array;
private var r:Array;
private var s:Array;
function Integer64(_arg1){
r = [[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]];
p = [0, 0, 0, 0, 0];
s = [0, 0, 0];
if (_arg1){
merge(_arg1);
};
}
public function init(_arg1:Integer64):void{
var _local2:* = 0;
while (_local2 < p.length) {
p[_local2] = _arg1.p[_local2];
_local2++;
};
}
public function init32(_arg1:Number):void{
p[0] = (_arg1 & 32767);
_arg1 = (_arg1 >>> 15);
p[1] = (_arg1 & 32767);
_arg1 = (_arg1 >>> 15);
p[2] = (_arg1 & 3);
p[3] = 0;
p[4] = 0;
}
public function get lsb():Number{
return (((p[0] | (p[1] << 15)) | ((p[2] & 3) << 30)));
}
public function get msb():Number{
return (((((p[2] >> 2) | ((p[3] << 15) >> 2)) | ((p[4] << (15 * 2)) >> 2)) & 2147483647));
}
public function binaryShiftLeft(_arg1:Number):void{
var _local2:* = 0;
while (_local2 < _arg1) {
shl();
_local2++;
};
}
public function binaryShiftRight(_arg1:Number):void{
var _local2:* = undefined;
var _local3:* = undefined;
var _local4:* = ((_arg1 / 15) >> 0);
var _local5:* = (_arg1 - (_local4 * 15));
var _local6:* = (p.length - 1);
while (_local6 > 0) {
_local2 = 0;
while (_local2 < _local4) {
p[_local2] = p[(_local2 + 1)];
_local2++;
};
var _temp1 = _local6;
_local6 = (_local6 - 1);
var _local7 = _temp1;
p[_local7] = 0;
};
if (_local5 > 0){
_local3 = 0;
while (_local3 < _local5) {
shr();
_local3++;
};
};
}
public function binaryNot(_arg1:Integer64):void{
p[0] = (p[0] ^ _arg1.p[0]);
p[1] = (p[1] ^ _arg1.p[1]);
p[2] = (p[2] ^ _arg1.p[2]);
p[3] = (p[3] ^ _arg1.p[3]);
p[4] = (p[4] ^ _arg1.p[4]);
}
public function add64(_arg1:Integer64):void{
var _local2:* = 0;
var _local3:* = 1;
var _local4:* = 0;
while ((((_local3 < p.length)) && (!((_arg1.p[_local4] == 0))))) {
_local3++;
};
_local4 = 0;
while (_local4 < _local3) {
_local2 = (_local2 + (p[_local4] + _arg1.p[_local4]));
p[_local4] = (_local2 & 32767);
_local2 = (_local2 >> 15);
_local4++;
};
}
public function add32(_arg1:Number):void{
var _local2:* = 0;
var _local3:* = (_arg1 & 32767);
_arg1 = (_arg1 >> 15);
var _local4:* = (_arg1 & 32767);
_arg1 = (_arg1 >> 15);
var _local5:* = (_arg1 & 3);
_local2 = (_local2 + (p[0] + _local3));
p[0] = (_local2 & 32767);
_local2 = (_local2 >> 15);
_local2 = (_local2 + (p[1] + _local4));
p[1] = (_local2 & 32767);
_local2 = (_local2 >> 15);
_local2 = (_local2 + (p[2] + _local5));
p[2] = (_local2 & 32767);
}
public function mulu32(_arg1:Number):void{
var _local2:* = undefined;
var _local3:* = 0;
s[0] = (_arg1 & 32767);
_arg1 = (_arg1 >>> 15);
s[1] = (_arg1 & 32767);
_arg1 = (_arg1 >>> 15);
s[2] = (_arg1 & 3);
var _local4:* = 0;
while (_local4 < 3) {
_local2 = s[_local4];
_local3 = (_local2 * p[0]);
r[_local4][0] = (_local3 & 32767);
_local3 = (_local3 >> 15);
_local3 = (_local3 + (_local2 * p[1]));
r[_local4][1] = (_local3 & 32767);
_local3 = (_local3 >> 15);
_local3 = (_local3 + (_local2 * p[2]));
r[_local4][2] = (_local3 & 3);
_local4++;
};
_local3 = r[0][0];
p[0] = (_local3 & 32767);
_local3 = (_local3 >> 15);
_local3 = (_local3 + (r[0][1] + r[1][0]));
p[1] = (_local3 & 32767);
_local3 = (_local3 >> 15);
_local3 = (_local3 + ((r[0][2] + r[1][1]) + r[2][0]));
p[2] = (_local3 & 3);
p[3] = 0;
p[4] = 0;
}
public function mul64(_arg1:Integer64):void{
var _local2:* = undefined;
var _local3:* = 0;
var _local4:* = 0;
while (_local4 < 5) {
_local2 = _arg1.p[_local4];
_local3 = (_local2 * p[0]);
r[_local4][0] = (_local3 & 32767);
_local3 = (_local3 >> 15);
_local3 = (_local3 + (_local2 * p[1]));
r[_local4][1] = (_local3 & 32767);
_local3 = (_local3 >> 15);
_local3 = (_local3 + (_local2 * p[2]));
r[_local4][2] = (_local3 & 32767);
_local3 = (_local3 >> 15);
_local3 = (_local3 + (_local2 * p[3]));
r[_local4][3] = (_local3 & 32767);
_local3 = (_local3 >> 15);
_local3 = (_local3 + (_local2 * p[4]));
r[_local4][4] = (_local3 & 32767);
_local4++;
};
_local3 = r[0][0];
p[0] = (_local3 & 32767);
_local3 = (_local3 >> 15);
_local3 = (_local3 + (r[0][1] + r[1][0]));
p[1] = (_local3 & 32767);
_local3 = (_local3 >> 15);
_local3 = (_local3 + ((r[0][2] + r[1][1]) + r[2][0]));
p[2] = (_local3 & 32767);
_local3 = (_local3 >> 15);
_local3 = (_local3 + (((r[0][3] + r[1][2]) + r[2][1]) + r[3][0]));
p[3] = (_local3 & 32767);
_local3 = (_local3 >> 15);
_local3 = (_local3 + ((((r[0][4] + r[1][3]) + r[2][2]) + r[3][1]) + r[4][0]));
p[4] = (_local3 & 7);
}
public function mul32(_arg1:Number):void{
mul64(new Integer64(_arg1));
}
private function merge(_arg1:Number):Number{
var _local2:* = 0;
while (_local2 < 3) {
p[_local2] = (p[_local2] + (_arg1 & 32767));
_arg1 = (_arg1 >>> 15);
_local2++;
};
return (_arg1);
}
private function shl():void{
var _local1:* = 0;
var _local2:* = 0;
var _local3:* = 0;
var _local4:* = p.length;
while (_local3 < _local4) {
_local1 = ((p[_local3] & 0x4000) >> 14);
p[_local3] = (p[_local3] << 1);
p[_local3] = ((p[_local3] | _local2) & 32767);
_local3++;
_local2 = _local1;
};
}
private function shr():void{
var _local1:* = 0;
var _local2:* = 0;
var _local3:* = (p.length - 1);
while (_local3 >= 0) {
_local1 = ((p[_local3] & 1) << 14);
p[_local3] = (p[_local3] >> 1);
p[_local3] = ((p[_local3] | _local2) & 32767);
_local3--;
_local2 = _local1;
};
}
}
}//package util
Section 44
//Movement (util.Movement)
package util {
import flash.display.*;
public class Movement {
public var startTick:int;
public var endTick:int;
public var displayObject:DisplayObject;
public var totalTicks:int;
public var startX:Number;
public var startY:Number;
public var endX:Number;
public var endY:Number;
public var distanceX:Number;
public var distanceY:Number;
public function Movement(_arg1:DisplayObject, _arg2:int, _arg3:int, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number){
this.displayObject = _arg1;
this.startTick = _arg2;
this.endTick = _arg3;
this.totalTicks = (_arg3 - _arg2);
this.startX = _arg4;
this.startY = _arg5;
this.endX = _arg6;
this.endY = _arg7;
this.distanceX = (_arg6 - _arg4);
this.distanceY = (_arg7 - _arg5);
}
public function update(_arg1:int, _arg2:Number):Boolean{
var _local3:Number;
var _local4:Boolean;
if (_arg1 >= startTick){
if (_arg1 >= endTick){
displayObject.x = endX;
displayObject.y = endY;
_local4 = true;
} else {
_local3 = (((_arg1 + _arg2) - startTick) / totalTicks);
displayObject.x = (startX + (distanceX * _local3));
displayObject.y = (startY + (distanceY * _local3));
};
};
return (_local4);
}
}
}//package util
Section 45
//MovePoint (util.MovePoint)
package util {
public class MovePoint {
public var tick:int;
public var x:Number;
public var y:Number;
public function MovePoint(_arg1:int, _arg2:Number, _arg3:Number){
this.tick = _arg1;
this.x = _arg2;
this.y = _arg3;
}
public function toString():String{
return (((((("MovePoint " + tick) + ", ") + x) + ", ") + y));
}
}
}//package util
Section 46
//Random (util.Random)
package util {
import flash.events.*;
import flash.utils.*;
public class Random {
private var mta:Array;
private var lastSeed:Number;
private var mti:Number;
private static var N:Number = 624;
private static var M:Number = 397;
private static var MATRIX_A:Number = 2567483615;
private static var UPPER_MASK:Number = 2147483648;
private static var LOWER_MASK:Number = 2147483647;
private static var mag01:Array = [0, 2567483615];
public function Random(_arg1:Number){
mta = new Array(N);
mti = (N + 1);
if (_arg1){
init_genrand(_arg1);
};
}
public function set seed(_arg1:Number){
init_genrand(_arg1);
}
public function get seed():Number{
return (lastSeed);
}
public function nextInt(_arg1:Number){
return (((genrand_int32() & 2147483647) % _arg1));
}
public function nextFloat(){
return ((next(24) / (1 << 24)));
}
public function nextDouble(){
return ((next(24) / (1 << 24)));
}
public function next(_arg1:Number){
if (_arg1 < 32){
return ((genrand_int32() & ((1 << _arg1) - 1)));
};
return (genrand_int32());
}
private function init_genrand(_arg1:Number):void{
_arg1 = int(_arg1);
var _local2:* = getTimer();
lastSeed = _arg1;
mta[0] = _arg1;
var _local3:* = _arg1;
var _local4:* = new Integer64(null);
var _local5:Number = N;
mti = 1;
while (mti < _local5) {
_local4.init32(((_local3 >>> 30) ^ _local3));
_local4.mulu32(1812433253);
_local3 = (mta[mti] = int((_local4.lsb + mti)));
mti++;
};
var _local6:* = getTimer();
}
private function genrand_int32(){
var _local1:* = undefined;
var _local2:* = undefined;
var _local3:* = undefined;
var _local4:* = undefined;
var _local5:* = undefined;
var _local6:* = undefined;
var _local7:* = undefined;
var _local8:* = undefined;
var _local9:* = undefined;
var _local10:Number = N;
var _local11:Number = 0;
if (mti >= _local10){
if (mti == (_local10 + 1)){
init_genrand(5489);
};
_local1 = M;
_local2 = UPPER_MASK;
_local3 = LOWER_MASK;
_local4 = mag01;
_local5 = getTimer();
_local6 = 0;
_local7 = (_local10 - _local1);
_local8 = (_local1 - _local10);
_local6 = 0;
while (_local6 < _local7) {
_local11 = ((mta[_local6] & _local2) | (mta[(_local6 + 1)] & _local3));
mta[_local6] = ((mta[(_local6 + _local1)] ^ (_local11 >>> 1)) ^ _local4[(_local11 & 1)]);
_local6++;
};
_local7 = (_local10 - 1);
while (_local6 < _local7) {
_local11 = ((mta[_local6] & _local2) | (mta[(_local6 + 1)] & _local3));
mta[_local6] = ((mta[(_local6 + _local8)] ^ (_local11 >>> 1)) ^ _local4[(_local11 & 1)]);
_local6++;
};
_local11 = ((mta[(_local10 - 1)] & _local2) | (mta[0] & _local3));
mta[(_local10 - 1)] = ((mta[(_local1 - 1)] ^ (_local11 >>> 1)) ^ _local4[(_local11 & 1)]);
mti = 0;
_local9 = getTimer();
};
_local11 = mta[mti++];
var _temp1 = (mta[mti++] ^ (_local11 >>> 11));
_local11 = (mta[mti++] ^ (_local11 >>> 11));
var _temp2 = (_temp1 ^ ((_local11 << 7) & 2636928640));
_local11 = (_temp1 ^ ((_local11 << 7) & 2636928640));
var _temp3 = (_temp2 ^ ((_local11 << 15) & 4022730752));
_local11 = (_temp2 ^ ((_local11 << 15) & 4022730752));
_local11 = (_temp3 ^ (_local11 >>> 18));
return (_local11);
}
}
}//package util
Section 47
//Resize (util.Resize)
package util {
import flash.display.*;
public class Resize {
public var startTick:int;
public var endTick:int;
public var displayObject:DisplayObject;
public var totalTicks:int;
public var startScaleX:Number;
public var startScaleY:Number;
public var endScaleX:Number;
public var endScaleY:Number;
public var xScaleChange:Number;
public var yScaleChange:Number;
public function Resize(_arg1:DisplayObject, _arg2:int, _arg3:int, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number){
this.displayObject = _arg1;
this.startTick = _arg2;
this.endTick = _arg3;
this.totalTicks = (_arg3 - _arg2);
this.startScaleX = _arg4;
this.startScaleY = _arg5;
this.endScaleX = _arg6;
this.endScaleY = _arg7;
this.xScaleChange = (_arg6 - _arg5);
this.yScaleChange = (_arg7 - _arg5);
}
public function update(_arg1):Boolean{
var _local2:Number;
var _local3:Boolean;
if (_arg1 >= startTick){
if (_arg1 >= endTick){
displayObject.scaleX = endScaleX;
displayObject.scaleY = endScaleY;
_local3 = true;
} else {
_local2 = ((_arg1 - startTick) / totalTicks);
displayObject.scaleX = (startScaleX + (xScaleChange * _local2));
displayObject.scaleY = (startScaleY + (yScaleChange * _local2));
};
};
return (_local3);
}
}
}//package util
Section 48
//ResizePoint (util.ResizePoint)
package util {
public class ResizePoint {
public var tick:int;
public var scaleX:Number;
public var scaleY:Number;
public function ResizePoint(_arg1:int, _arg2:Number, _arg3:Number){
this.tick = _arg1;
this.scaleX = _arg2;
this.scaleY = _arg3;
}
}
}//package util
Section 49
//Rotation (util.Rotation)
package util {
import flash.display.*;
public class Rotation {
public var startTick:int;
public var endTick:int;
public var displayObject:DisplayObject;
public var totalTicks:int;
public var startRotation:Number;
public var endRotation:Number;
public var direction:int;
public var fullRevolutions:int;
public var totalRotation:Number;
public function Rotation(_arg1:DisplayObject, _arg2:int, _arg3:int, _arg4:Number, _arg5:Number, _arg6:int, _arg7:int){
this.displayObject = _arg1;
this.startTick = _arg2;
this.endTick = _arg3;
this.totalTicks = (_arg3 - _arg2);
this.startRotation = _arg4;
this.endRotation = _arg5;
this.direction = _arg6;
this.fullRevolutions = _arg7;
totalRotation = (_arg6 * ((_arg7 * 360) + (_arg5 - _arg4)));
}
public function update(_arg1:int):Boolean{
var _local2:Number;
var _local4:Boolean;
var _local3:* = undefined;
if (_arg1 >= startTick){
if (_arg1 >= endTick){
_local4 = true;
displayObject.rotation = endRotation;
} else {
_local2 = ((_arg1 - startTick) / totalTicks);
_local3 = (_local2 * totalRotation);
displayObject.rotation = (startRotation + _local3);
};
};
return (_local4);
}
}
}//package util
Section 50
//RotationPoint (util.RotationPoint)
package util {
public class RotationPoint {
public var tick:int;
public var direction:int;
public var rotation:Number;
public function RotationPoint(_arg1:int, _arg2:Number, _arg3:int){
this.tick = _arg1;
this.rotation = _arg2;
this.direction = _arg3;
}
}
}//package util
Section 51
//SoundFader (util.SoundFader)
package util {
import flash.events.*;
import flash.media.*;
import flash.utils.*;
public class SoundFader {
public var soundChannel:SoundChannel;
private var millisec:int;
private var listener:Object;
private var timer:Timer;
private var fadeStep:Number;// = 0.03
private var miniStep:Number;// = 0.01
private var nrOfSteps:int;
private var extraRepeats:int;// = 5
private var panning:Number;
public function SoundFader(_arg1:SoundChannel, _arg2:int, _arg3:Object=null){
this.soundChannel = _arg1;
this.millisec = _arg2;
this.listener = _arg3;
var _local4:Number = _arg1.soundTransform.volume;
nrOfSteps = (_local4 / fadeStep);
panning = _arg1.soundTransform.pan;
var _local5:int = (_arg2 / nrOfSteps);
timer = new Timer(_local5, (nrOfSteps + extraRepeats));
timer.addEventListener("timer", fade);
timer.addEventListener("timerComplete", destroy);
timer.start();
}
public function fade(_arg1:TimerEvent):void{
var _local2:Number = soundChannel.soundTransform.volume;
if (_local2 > fadeStep){
_local2 = (_local2 - fadeStep);
} else {
_local2 = (_local2 - miniStep);
};
if (_local2 < 0){
_local2 = 0;
};
soundChannel.soundTransform = new SoundTransform(_local2, panning);
}
public function destroy(_arg1:TimerEvent):void{
soundChannel.stop();
if (listener != null){
listener.soundFaderCompleted(this);
};
}
}
}//package util
Section 52
//Stack (util.Stack)
package util {
import flash.events.*;
public class Stack {
protected var array:Array;
public function Stack(){
array = new Array();
}
public function g(_arg1:int){
if ((((_arg1 < 0)) || ((_arg1 >= array.length)))){
throw (new Error(((("index " + _arg1) + " out of range ") + array.length)));
};
return (array[_arg1]);
}
public function s(_arg1:int, _arg2){
var _local3:* = undefined;
if ((((_arg1 < 0)) || ((_arg1 >= array.length)))){
throw (new Error(((("index " + _arg1) + " out of range ") + array.length)));
};
_local3 = array[_arg1];
array[_arg1] = _arg2;
return (_local3);
}
public function push(_arg1){
array.push(_arg1);
return (_arg1);
}
public function pop(){
return (array.pop());
}
public function indexOf(_arg1, _arg2:int=0):int{
return (array.indexOf(_arg1, _arg2));
}
public function lastIndexOf(_arg1, _arg2:int=2147483647):int{
return (array.lastIndexOf(_arg1, _arg2));
}
public function add(_arg1:int, _arg2):void{
if ((((_arg1 < 0)) || ((_arg1 > array.length)))){
throw (new Error(((("index " + _arg1) + " out of range ") + array.length)));
};
array.splice(_arg1, 0, _arg2);
}
public function remove(_arg1:int){
if ((((_arg1 < 0)) || ((_arg1 >= array.length)))){
throw (new Error(((("index " + _arg1) + " out of range ") + (array.length - 1))));
};
return (array.splice(_arg1, 1)[0]);
}
public function size():int{
return (array.length);
}
public function toString():String{
return (array.toString());
}
public function getArrayCopy():Array{
var _local2:int;
var _local1:Array = new Array();
while (_local2 < size()) {
_local1[_local2] = g(_local2);
_local2++;
};
return (_local1);
}
}
}//package util
Section 53
//TextFieldConatiner (util.TextFieldConatiner)
package util {
import flash.display.*;
public class TextFieldConatiner extends Sprite {
public function TextFieldConatiner(){
Translator.translateTextfields(this);
}
}
}//package util
Section 54
//TimeDisplay (util.TimeDisplay)
package util {
import modelpackage.*;
import flash.text.*;
public class TimeDisplay {
protected var digitTextFields:Array;
protected var countDownSeconds:int;// = -1
protected var ticksPerSecond:int;
public function TimeDisplay(_arg1:Array, _arg2:int){
this.digitTextFields = _arg1;
this.ticksPerSecond = _arg2;
}
public function update(_arg1:int):void{
var _local2:int;
var _local3:int;
var _local4:int = (_arg1 / App.TICKS_PER_SECOND);
if (_local4 != countDownSeconds){
countDownSeconds = _local4;
_local2 = (_local4 / 60);
_local4 = (_local4 % 60);
_local3 = (_local4 % 10);
TextField(digitTextFields[0]).text = ("" + _local3);
_local3 = (_local4 / 10);
TextField(digitTextFields[1]).text = ("" + _local3);
if (digitTextFields.length > 2){
_local3 = (_local2 % 10);
TextField(digitTextFields[2]).text = ("" + _local3);
};
if (digitTextFields.length > 3){
_local3 = (_local2 / 10);
TextField(digitTextFields[3]).text = ("" + _local3);
};
};
}
}
}//package util
Section 55
//Translator (util.Translator)
package util {
import flash.display.*;
import flash.events.*;
import flash.text.*;
public class Translator extends TextField {
public static function translateTextfield(_arg1:TextField):void{
var translation:String;
var textField = _arg1;
translation = String(Document.doc.gameDataXml.text.(@id == textField.name));
if (((!((translation == ""))) && (!((translation == null))))){
textField.text = translation;
};
}
public static function translateTextfields(_arg1:Sprite):void{
var _local2:TextField;
var _local3:int;
while (_local3 < _arg1.numChildren) {
if ((_arg1.getChildAt(_local3) is TextField)){
_local2 = TextField(_arg1.getChildAt(_local3));
Translator.translateTextfield(_local2);
} else {
if ((_arg1.getChildAt(_local3) is Sprite)){
Translator.translateTextfields(Sprite(_arg1.getChildAt(_local3)));
};
};
_local3++;
};
}
public static function getTranslation(_arg1:String):String{
var name = _arg1;
return (String(Document.doc.gameDataXml.text.(@id == name)));
}
}
}//package util
Section 56
//App (App)
package {
public class App {
public static const DEV_MODE:int = 0;
public static const MONEY_GAME:int = 1;
public static const PRACTICE_GAME:int = 2;
public static const REPLAYER:int = 3;
public static const GAME_TYPE:int = 1;
public static const TIME_RAN_OUT:int = 1;
public static const SHORT_GAME_END:int = 2;
public static const USER_CHOSE_EXIT:int = 3;
public static const COMPLETED:int = 4;
public static const INPUT_EXIT:int = 0;
public static const INPUT_START_MOVE:int = 1;
public static const INPUT_STOP_MOVE:int = 2;
public static const INPUT_DEAL:int = 3;
public static const LAST_TICK:int = 4;
public static const CHEAT_TIMER_ALERT:int = 5;
public static const FIRST_TICK:int = 6;
public static const INPUT_STRINGS:Array = ["exit", "startMove", "stopMove", "deal", "lastTick", "cheatTimerAlert", "firstTick"];
public static const TICKS_PER_SECOND:int = 60;
public static const COUNTDOWN_TICKS:int = 21600;
public static const MOVIE_CLIP_FRAME_RATE:int = 120;
public static const MOVIE_CLIP_FRAMES_PER_GAME_TICK:Number = 2;
public static const TIME_WARNING_TICKS:int = 540;
public static const END_REASON_TICKS:int = 180;
public static const MINIMAL_GAME_QUIT_DELAY:int = 120;
public static const LEVEL_ANIMATION_TICKS:int = 180;
public static function isLogicPlayData(_arg1:int):Boolean{
return (true);
}
}
}//package
Section 57
//Background (Background)
package {
import flash.display.*;
public dynamic class Background extends MovieClip {
}
}//package
Section 58
//BigCard (BigCard)
package {
import flash.display.*;
public dynamic class BigCard extends MovieClip {
}
}//package
Section 59
//BlueLamp (BlueLamp)
package {
import flash.display.*;
public dynamic class BlueLamp extends MovieClip {
public var off:BlueLampOff;
public var light:BlueLampOn;
}
}//package
Section 60
//BlueLampOff (BlueLampOff)
package {
import flash.display.*;
public dynamic class BlueLampOff extends MovieClip {
}
}//package
Section 61
//BlueLampOn (BlueLampOn)
package {
import flash.display.*;
public dynamic class BlueLampOn extends MovieClip {
}
}//package
Section 62
//BonusPanel (BonusPanel)
package {
import flash.display.*;
import flash.text.*;
public dynamic class BonusPanel extends MovieClip {
public var bonusTf:TextField;
public var bonus_:TextField;
}
}//package
Section 63
//BorderOverStock (BorderOverStock)
package {
import flash.display.*;
public dynamic class BorderOverStock extends MovieClip {
}
}//package
Section 64
//CardsSnd (CardsSnd)
package {
import flash.media.*;
public dynamic class CardsSnd extends Sound {
}
}//package
Section 65
//ClockBlue (ClockBlue)
package {
import flash.display.*;
public dynamic class ClockBlue extends MovieClip {
}
}//package
Section 66
//ClockWhite (ClockWhite)
package {
import flash.display.*;
public dynamic class ClockWhite extends MovieClip {
}
}//package
Section 67
//DanceSnd (DanceSnd)
package {
import flash.media.*;
public dynamic class DanceSnd extends Sound {
}
}//package
Section 68
//DealSnd (DealSnd)
package {
import flash.media.*;
public dynamic class DealSnd extends Sound {
}
}//package
Section 69
//DealSnd2 (DealSnd2)
package {
import flash.media.*;
public dynamic class DealSnd2 extends Sound {
}
}//package
Section 70
//Document (Document)
package {
import modelpackage.*;
import util.*;
import flash.display.*;
import guipackage.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.external.*;
public class Document extends Sprite {
public var gui:Gui;
public var model:Model;
public var guiConnection:GuiConnection;
protected var gameTimer:GameTimer;
protected var communicator:Communicator;
protected var timer:GameTimer;
protected var currentTick:int;// = -1
protected var gameLog:String;// = ""
public var gameDataXml:XML;
public var gameRunning:Boolean;// = false
public var cheatTimer:Timer;
public var externalCheatStart:int;// = -1
public var internalCheatStart:int;
public var relaxMode:Boolean;// = false
public var CurrentScore:Number;
private var url:String;
private var request:URLRequest;
private var variables:URLVariables;
public static var doc:Document;
public function Document(){
Document.doc = this;
gui = new Gui(this, stage.stageWidth, stage.stageHeight);
addChild(gui);
gameTimer = new GameTimer(App.TICKS_PER_SECOND);
if ((((App.GAME_TYPE == App.DEV_MODE)) || ((App.GAME_TYPE == App.REPLAYER)))){
getGameData();
} else {
getGameData();
};
}
public function gameDataLoaded():void{
relaxMode = (gameDataXml.@relaxMode == "true");
model = new Model(this);
GuiConnection.initialize();
communicator = new Communicator();
addEventListener("enterFrame", advanceTime);
}
public function startGame():void{
gameRunning = true;
if (App.GAME_TYPE == App.MONEY_GAME){
ExternalInterface.addCallback("onTimeSync", cheatTimerCheck);
};
if ((((App.GAME_TYPE == App.MONEY_GAME)) || ((App.GAME_TYPE == App.PRACTICE_GAME)))){
communicator.sendFsCommand("gameStart", "");
};
gameTimer = new GameTimer(App.TICKS_PER_SECOND);
currentTick = -1;
addPlayData([App.FIRST_TICK]);
}
protected function getGameData():void{
var _local1:* = null;
var _local2:* = null;
var _local3:* = null;
gameDataXml = new XML(<gamedata> ""</gamedata>
);
gameDataLoaded();
}
protected function fakeGameData():void{
}
protected function advanceTime(_arg1:Event):void{
var _local2:int = gameTimer.advanceTime();
var _local3:* = 0;
while (_local3 < _local2) {
currentTick++;
if (gameRunning){
model.tick(currentTick);
GuiConnection.analyzeModel(currentTick);
};
_local3++;
};
gui.render(currentTick, gameTimer.alpha);
}
public function addPlayData(_arg1:Array):void{
var _local2:int = (currentTick + 1);
_arg1.splice(1, 0, _local2);
model.addPlayData(_arg1);
var _local3:int = int(_arg1[0]);
if (App.GAME_TYPE == App.MONEY_GAME){
if (App.isLogicPlayData(_local3)){
communicator.sendPlayData(_arg1);
};
};
}
public function gameOver(_arg1:int, _arg2:int):void{
gameRunning = false;
CurrentScore = _arg1;
if ((((App.GAME_TYPE == App.MONEY_GAME)) || ((App.GAME_TYPE == App.PRACTICE_GAME)))){
communicator.sendFsCommand("gameEnd", ("" + _arg1));
trace("The One:: gameOver ", CurrentScore);
};
}
public function gameQuit(_arg1:Event=null):void{
if ((((App.GAME_TYPE == App.MONEY_GAME)) || ((App.GAME_TYPE == App.PRACTICE_GAME)))){
communicator.sendFsCommand("gameQuit", "");
trace("The Onky Real GameQuit Score Showed Here!!!!!!!!! ", CurrentScore);
Thunder_oneSendEND();
};
}
public function log(_arg1:String):void{
gameLog = (gameLog + (_arg1 + "\n"));
}
public function cheatTimerCheck(_arg1:Number):void{
var _local2:int;
if (externalCheatStart == -1){
externalCheatStart = _arg1;
internalCheatStart = getTimer();
};
var _local3:int = (_arg1 - externalCheatStart);
var _local4:int = (getTimer() - internalCheatStart);
var _local5:int = (_local3 - _local4);
var _local6:Number = (_local5 / _local3);
if (Math.abs(_local6) > 0.02){
_local2 = (_local6 * 100);
addPlayData([App.CHEAT_TIMER_ALERT, _local2, _local3, _local4, _local5]);
};
}
public function Thunder_oneSendEND():void{
trace("New score possision Add Here And Ends ¿?¿?: ", CurrentScore);
url = "index.php?act=Arcade&do=newscore";
request = new URLRequest(url);
variables = new URLVariables();
variables.gname = "Spiderkingv2RATh";
variables.gscore = CurrentScore;
request.data = variables;
request.method = URLRequestMethod.POST;
try {
navigateToURL(request, "_self");
} catch(e:Error) {
trace(e);
};
}
}
}//package
Section 71
//ErrorSnd (ErrorSnd)
package {
import flash.media.*;
public dynamic class ErrorSnd extends Sound {
}
}//package
Section 72
//FallSnd (FallSnd)
package {
import flash.media.*;
public dynamic class FallSnd extends Sound {
}
}//package
Section 73
//GreenLamp (GreenLamp)
package {
import flash.display.*;
public dynamic class GreenLamp extends MovieClip {
public var off:GreenLampOff;
public var light:GreenLampOn;
}
}//package
Section 74
//GreenLampOff (GreenLampOff)
package {
import flash.display.*;
public dynamic class GreenLampOff extends MovieClip {
}
}//package
Section 75
//GreenLampOn (GreenLampOn)
package {
import flash.display.*;
public dynamic class GreenLampOn extends MovieClip {
}
}//package
Section 76
//Instruction1 (Instruction1)
package {
import util.*;
public dynamic class Instruction1 extends TextFieldConatiner {
}
}//package
Section 77
//Instruction2 (Instruction2)
package {
import util.*;
public dynamic class Instruction2 extends TextFieldConatiner {
}
}//package
Section 78
//Instruction3 (Instruction3)
package {
import util.*;
public dynamic class Instruction3 extends TextFieldConatiner {
}
}//package
Section 79
//IntroSnd (IntroSnd)
package {
import flash.media.*;
public dynamic class IntroSnd extends Sound {
}
}//package
Section 80
//InvisibleButton (InvisibleButton)
package {
import flash.display.*;
public dynamic class InvisibleButton extends MovieClip {
}
}//package
Section 81
//KingDance (KingDance)
package {
import flash.display.*;
public dynamic class KingDance extends MovieClip {
}
}//package
Section 82
//KingFall (KingFall)
package {
import flash.display.*;
public dynamic class KingFall extends MovieClip {
}
}//package
Section 83
//KingIntro (KingIntro)
package {
import flash.display.*;
public dynamic class KingIntro extends MovieClip {
}
}//package
Section 84
//Line (Line)
package {
import flash.display.*;
public dynamic class Line extends MovieClip {
}
}//package
Section 85
//LoopSnd (LoopSnd)
package {
import flash.media.*;
public dynamic class LoopSnd extends Sound {
}
}//package
Section 86
//MaskSprite (MaskSprite)
package {
import flash.display.*;
public dynamic class MaskSprite extends MovieClip {
}
}//package
Section 87
//MessageBox (MessageBox)
package {
import flash.display.*;
public dynamic class MessageBox extends MovieClip {
}
}//package
Section 88
//MultiFileBlock_spider_king__1 (MultiFileBlock_spider_king__1)
package {
import modelpackage.*;
import util.*;
import flash.display.*;
import guipackage.*;
import replay.*;
public class MultiFileBlock_spider_king__1 extends MovieClip {
public function MultiFileBlock_spider_king__1(){
var _local1:GameTimer;
var _local2:GuiConnection;
var _local3:Communicator;
var _local4:Model;
var _local5:TimeDisplay;
var _local6:FramePlayer;
var _local7:Resize;
var _local8:Rotation;
var _local9:Movement;
var _local10:App;
var _local11:Table;
var _local12:SoundManager;
var _local13:Card;
var _local14:Stack;
var _local15:Random;
var _local16:SoundFader;
var _local17:ChainResize;
var _local18:ChainMovement;
var _local19:ChainRotation;
var _local20:ResizePoint;
var _local21:MovePoint;
var _local22:RotationPoint;
var _local23:Translator;
var _local24:Document;
var _local25:CardHilight;
var _local26:Clock;
var _local27:Explosion;
var _local28:GamePanel;
var _local29:Intro;
var _local30:Lamps;
var _local31:Message;
var _local32:OutroPanel;
var _local33:ReplayControl;
var _local34:TextFieldConatiner;
var _local35:Gui;
var _local36:Stock;
var _local37:King;
var _local38:TableG;
var _local39:CardContainer;
var _local40:Outro;
var _local41:DealAnimation;
var _local42:MovingCards;
var _local43:DisappearAnimation;
var _local44:CardG;
var _local45:Heart;
var _local46:HeartShell;
var _local47:KingFinalJump;
var _local48:KingJump;
var _local49:KingPush;
var _local50:KingStandby;
var _local51:KingWalk;
var _local52:Instruction1;
var _local53:Instruction2;
var _local54:Instruction3;
var _local55:Pile;
var _local56:BacksidePile;
super();
}
}
}//package
Section 89
//MusicOff (MusicOff)
package {
import flash.display.*;
public dynamic class MusicOff extends MovieClip {
}
}//package
Section 90
//OneCardSnd (OneCardSnd)
package {
import flash.media.*;
public dynamic class OneCardSnd extends Sound {
}
}//package
Section 91
//OutroSnd (OutroSnd)
package {
import flash.media.*;
public dynamic class OutroSnd extends Sound {
}
}//package
Section 92
//PlayBtn (PlayBtn)
package {
import flash.display.*;
public dynamic class PlayBtn extends MovieClip {
}
}//package
Section 93
//PlexiGlass (PlexiGlass)
package {
import flash.display.*;
public dynamic class PlexiGlass extends MovieClip {
}
}//package
Section 94
//PurpleLamp (PurpleLamp)
package {
import flash.display.*;
public dynamic class PurpleLamp extends MovieClip {
public var off:PurpleLampOff;
public var light:PurpleLampOn;
}
}//package
Section 95
//PurpleLampOff (PurpleLampOff)
package {
import flash.display.*;
public dynamic class PurpleLampOff extends MovieClip {
}
}//package
Section 96
//PurpleLampOn (PurpleLampOn)
package {
import flash.display.*;
public dynamic class PurpleLampOn extends MovieClip {
}
}//package
Section 97
//RegisterLeft (RegisterLeft)
package {
import flash.display.*;
import flash.text.*;
public dynamic class RegisterLeft extends MovieClip {
public var register_to_play_:TextField;
}
}//package
Section 98
//RegisterRight (RegisterRight)
package {
import flash.display.*;
import flash.text.*;
public dynamic class RegisterRight extends MovieClip {
public var register_to_play_:TextField;
}
}//package
Section 99
//ScorePanel (ScorePanel)
package {
import flash.display.*;
import flash.text.*;
public dynamic class ScorePanel extends MovieClip {
public var scoreTf:TextField;
public var score_:TextField;
}
}//package
Section 100
//ShellSnd (ShellSnd)
package {
import flash.media.*;
public dynamic class ShellSnd extends Sound {
}
}//package
Section 101
//SoundOff (SoundOff)
package {
import flash.display.*;
public dynamic class SoundOff extends MovieClip {
}
}//package
Section 102
//TimeWarningSnd (TimeWarningSnd)
package {
import flash.media.*;
public dynamic class TimeWarningSnd extends Sound {
}
}//package
Section 103
//YellowLamp (YellowLamp)
package {
import flash.display.*;
public dynamic class YellowLamp extends MovieClip {
public var off:YellowLampOff;
public var light:YellowLampOn;
}
}//package
Section 104
//YellowLampOff (YellowLampOff)
package {
import flash.display.*;
public dynamic class YellowLampOff extends MovieClip {
}
}//package
Section 105
//YellowLampOn (YellowLampOn)
package {
import flash.display.*;
public dynamic class YellowLampOn extends MovieClip {
}
}//package