Section 1
//cartoonsmoke3 (classes.cartoonsmoke3)
package classes {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class cartoonsmoke3 extends Sprite {
var Xmovenow:Number;
var obj1:Array;
var obj2:Array;
var obj3:Array;
public var maxdur:Number;// = 20
public var minstep:Number;// = 5
public var maxstep:Number;// = 25
public var minscale:Number;// = 1
public var minrot:Number;// = 0
public var minalpha:Number;// = 1
public var minXpos:Number;// = -25
public var maxXpos:Number;// = 25
var Xposnow:Number;
public var maxscale:Number;// = 1.5
public var swingdouble:Boolean;// = true
var i:uint;// = 0
var j:uint;
public var doublerot:Boolean;// = true
public var mindur:Number;// = 12
public var mindelay:Number;// = 0
public var minstretch:Number;// = 1
var adddups:uint;
public var acceleration:Number;// = 0
var delaynow:uint;
public var minYmove:Number;// = 15
public var maxdelay:Number;// = 4
public var minYpos:Number;// = -25
var swingmovenow:Number;
public var maxalpha:Number;// = 1
public var maxYpos:Number;// = 25
public var maxYmove:Number;// = 150
public var objcolor:Array;
var fr2:Number;
public var maxswingmove:Number;// = 35
var fr:Number;
var Ymovenow:Number;
var oriright:Number;
public var doscalein:Boolean;// = true
var targ4;
public var minXmove:Number;// = 0
var targ1;
var ii:uint;// = 0
var targ2;
var durnow:uint;
public var maxstretch:Number;// = 1
var init:Boolean;// = false
public var maxXmove:Number;// = 0
var colorTransform:ColorTransform;
var scalenow:Number;
public var dupframes:Number;// = 4
public var randur:Number;// = 4
private var parent_item;// = null
public var frscaledown:Number;// = 0
public var mindups:Number;// = 16
var Yposnow:Number;
public var fralphadown:Number;// = 1
public var minswingmove:Number;// = -35
var rotdirnow:Number;
public var maxdups:Number;// = 32
var container1;
var container2;
var container3;
public var clusterspread:Number;// = 4
var ctdup:uint;
public var maxrot:Number;// = 0
public var scaleinstartfr:Number;// = 0.25
public var cluster:Number;// = 8
var orileft:Number;
public function cartoonsmoke3(_arg1):void{
dupframes = 4;
mindups = 16;
maxdups = 32;
objcolor = [0xFFFFFF];
acceleration = 0;
mindur = 12;
maxdur = 20;
mindelay = 0;
maxdelay = 4;
minXpos = -25;
maxXpos = 25;
minYpos = -25;
maxYpos = 25;
minXmove = 0;
maxXmove = 0;
minYmove = 15;
maxYmove = 150;
minswingmove = -35;
maxswingmove = 35;
minstep = 5;
maxstep = 25;
minscale = 1;
maxscale = 1.5;
minstretch = 1;
maxstretch = 1;
minalpha = 1;
maxalpha = 1;
minrot = 0;
maxrot = 0;
doublerot = true;
cluster = 8;
clusterspread = 4;
swingdouble = true;
frscaledown = 0;
fralphadown = 1;
randur = 4;
doscalein = true;
scaleinstartfr = 0.25;
parent_item = null;
i = 0;
ii = 0;
init = false;
container1 = new empty();
container2 = new empty();
container3 = new empty();
obj3 = new Array();
obj2 = new Array();
obj1 = new Array();
super();
cleanup();
addEventListener(Event.ENTER_FRAME, dononstop, false, 0, true);
parent_item = _arg1;
}
public function addflare2(_arg1){
obj2[_arg1] = new smoke2();
container2.addChild(obj2[_arg1]);
colorTransform = obj2[_arg1].obj.obj.transform.colorTransform;
colorTransform.color = objcolor[Math.floor((Math.random() * objcolor.length))];
obj2[_arg1].obj.obj.transform.colorTransform = colorTransform;
}
public function addflare3(_arg1){
obj3[_arg1] = new smoke3();
container3.addChild(obj3[_arg1]);
colorTransform = obj3[_arg1].obj.obj.transform.colorTransform;
colorTransform.color = objcolor[Math.floor((Math.random() * objcolor.length))];
obj3[_arg1].obj.obj.transform.colorTransform = colorTransform;
obj3[_arg1].i = 0;
obj3[_arg1].angle = 0;
obj3[_arg1].step = (minstep + Math.floor((Math.random() * ((maxstep - minstep) + 1))));
obj3[_arg1].sin = 0;
if (((((_arg1 % cluster) == 1)) || ((cluster == 1)))){
durnow = (mindur + Math.floor((Math.random() * ((maxdur - mindur) + 1))));
delaynow = (mindelay + Math.floor((Math.random() * ((maxdelay - mindelay) + 1))));
Xposnow = (minXpos + (Math.random() * (maxXpos - minXpos)));
Yposnow = (minYpos + (Math.random() * (maxYpos - minYpos)));
Xmovenow = (minXmove + (Math.random() * (maxXmove - minXmove)));
Ymovenow = (minYmove + (Math.random() * (maxYmove - minYmove)));
swingmovenow = (minswingmove + (Math.random() * (maxswingmove - minswingmove)));
scalenow = (minscale + (Math.random() * (maxscale - minscale)));
};
obj3[_arg1].dur = (durnow + Math.floor((Math.random() * (randur + 1))));
obj3[_arg1].iii = -(delaynow);
obj3[_arg1].startXpos = ((Xposnow + (Math.random() * clusterspread)) - (Math.random() * clusterspread));
obj3[_arg1].midXpos = ((Xposnow + (Math.random() * clusterspread)) - (Math.random() * clusterspread));
obj3[_arg1].endXpos = ((Xposnow + (Math.random() * clusterspread)) - (Math.random() * clusterspread));
obj3[_arg1].startYpos = ((Yposnow + (Math.random() * clusterspread)) - (Math.random() * clusterspread));
obj3[_arg1].midYpos = ((Yposnow + (Math.random() * clusterspread)) - (Math.random() * clusterspread));
obj3[_arg1].endYpos = ((Yposnow + (Math.random() * clusterspread)) - (Math.random() * clusterspread));
obj3[_arg1].Xmove = Xmovenow;
obj3[_arg1].Ymove = Ymovenow;
obj3[_arg1].swingmove = swingmovenow;
if (swingdouble){
obj3[_arg1].swingmove = (obj3[_arg1].swingmove * ((Math.floor((Math.random() * 2)) * 2) - 1));
};
obj3[_arg1].startXscale = (scalenow * (minstretch + (Math.random() * (maxstretch - minstretch))));
obj3[_arg1].midXscale = (scalenow * (minstretch + (Math.random() * (maxstretch - minstretch))));
obj3[_arg1].endXscale = (scalenow * (minstretch + (Math.random() * (maxstretch - minstretch))));
obj3[_arg1].startYscale = (scalenow * (minstretch + (Math.random() * (maxstretch - minstretch))));
obj3[_arg1].midYscale = (scalenow * (minstretch + (Math.random() * (maxstretch - minstretch))));
obj3[_arg1].endYscale = (scalenow * (minstretch + (Math.random() * (maxstretch - minstretch))));
obj3[_arg1].startrot = (minrot + (Math.random() * (maxrot - minrot)));
obj3[_arg1].midrot = ((obj3[_arg1].startrot + minrot) + (Math.random() * (maxrot - minrot)));
obj3[_arg1].endrot = ((obj3[_arg1].midrot + minrot) + (Math.random() * (maxrot - minrot)));
if (doublerot){
rotdirnow = ((Math.floor((Math.random() * 2)) * 2) - 1);
obj3[_arg1].startrot = (obj3[_arg1].startrot * rotdirnow);
obj3[_arg1].midrot = (obj3[_arg1].midrot * rotdirnow);
obj3[_arg1].endrot = (obj3[_arg1].endrot * rotdirnow);
};
obj3[_arg1].doalpha = (minalpha + (Math.random() * (maxalpha - minalpha)));
obj3[_arg1].alpha = obj3[_arg1].doalpha;
obj3[_arg1].visible = false;
obj3[_arg1].mouseEnabled = false;
obj3[_arg1].mouseChildren = false;
}
public function addflare1(_arg1){
obj1[_arg1] = new smoke1();
container1.addChild(obj1[_arg1]);
colorTransform = obj1[_arg1].obj.obj.transform.colorTransform;
colorTransform.color = objcolor[Math.floor((Math.random() * objcolor.length))];
obj1[_arg1].obj.obj.transform.colorTransform = colorTransform;
}
public function cleanup(){
while (numChildren > 0) {
removeChildAt(0);
};
if (parent_item){
parent_item.removeChild(this);
parent_item = null;
};
}
public function tweendups(){
j = 1;
while (j <= container1.numChildren) {
targ4 = container3.getChildAt((j - 1));
targ2 = container2.getChildAt((j - 1));
targ1 = container1.getChildAt((j - 1));
if (targ4.iii <= 0){
targ4.iii++;
};
if (targ4.iii >= 0){
targ4.i++;
targ4.visible = true;
};
if (targ4.i <= targ4.dur){
targ4.angle = (targ4.angle + targ4.step);
targ4.sin = Math.sin(((Math.PI / 360) * targ4.angle));
if (acceleration == 1){
fr = Math.sin(((Math.PI / 180) * ((targ4.i / targ4.dur) * 90)));
} else {
if (acceleration == 2){
fr = (1 - Math.cos(((Math.PI / 180) * ((targ4.i / targ4.dur) * 90))));
} else {
fr = (targ4.i / targ4.dur);
};
};
if (targ4.i <= Math.floor((targ4.dur / 2))){
fr2 = (targ4.i / Math.floor((targ4.dur / 2)));
targ4.x = (((targ4.startXpos + (fr2 * (targ4.midXpos - targ4.startXpos))) + (fr * targ4.Xmove)) + (targ4.sin * targ4.swingmove));
targ4.y = ((-(targ4.startYpos) - (fr2 * (targ4.midYpos - targ4.startYpos))) - (fr * targ4.Ymove));
targ4.scaleX = (targ4.startXscale + (fr2 * (targ4.midXscale - targ4.startXscale)));
targ4.scaleY = (targ4.startYscale + (fr2 * (targ4.midYscale - targ4.startYscale)));
if (doscalein){
targ4.scaleX = (targ4.scaleX * (scaleinstartfr + (fr2 * (1 - scaleinstartfr))));
targ4.scaleY = (targ4.scaleY * (scaleinstartfr + (fr2 * (1 - scaleinstartfr))));
};
targ4.rotation = (targ4.startrot + (fr2 * (targ4.midrot - targ4.startrot)));
} else {
fr2 = ((targ4.i - Math.floor((targ4.dur / 2))) / Math.ceil((targ4.dur / 2)));
targ4.x = (((targ4.midXpos + (fr2 * (targ4.endXpos - targ4.midXpos))) + (fr * targ4.Xmove)) + (targ4.sin * targ4.swingmove));
targ4.y = ((-(targ4.midYpos) - (fr2 * (targ4.endYpos - targ4.midYpos))) - (fr * targ4.Ymove));
targ4.scaleX = (targ4.midXscale + (fr2 * (targ4.endXscale - targ4.midXscale)));
targ4.scaleY = (targ4.midYscale + (fr2 * (targ4.endYscale - targ4.midYscale)));
targ4.rotation = (targ4.midrot + (fr2 * (targ4.endrot - targ4.midrot)));
};
targ4.scaleX = (targ4.scaleX * (1 - (fr * (1 - frscaledown))));
targ4.scaleY = (targ4.scaleY * (1 - (fr * (1 - frscaledown))));
targ4.alpha = ((1 - (fr * (1 - fralphadown))) * targ4.doalpha);
targ2.x = targ4.x;
targ2.y = targ4.y;
targ2.scaleX = targ4.scaleX;
targ2.scaleY = targ4.scaleY;
targ2.rotation = targ4.rotation;
targ2.alpha = targ4.alpha;
targ1.x = targ4.x;
targ1.y = targ4.y;
targ1.scaleX = targ4.scaleX;
targ1.scaleY = targ4.scaleY;
targ1.rotation = targ4.rotation;
targ1.alpha = targ4.alpha;
} else {
container3.removeChild(targ4);
container2.removeChild(targ2);
container1.removeChild(targ1);
};
if (container1.numChildren == 0){
removeEventListener(Event.ENTER_FRAME, dononstop);
};
j++;
};
}
public function dononstop(_arg1:Event):void{
if (!init){
init = true;
addChild(container3);
addChild(container2);
addChild(container1);
};
i++;
if (i <= dupframes){
adddups = (mindups + Math.floor((Math.random() * ((maxdups - mindups) + 1))));
j = 1;
while (j <= adddups) {
ctdup++;
addflare3(ctdup);
addflare2(ctdup);
addflare1(ctdup);
j++;
};
};
tweendups();
}
}
}//package classes
Section 2
//ads1_Motion_1523 (dc_fla.ads1_Motion_1523)
package dc_fla {
import flash.display.*;
public dynamic class ads1_Motion_1523 extends MovieClip {
public function ads1_Motion_1523(){
addFrameScript(0, frame1, 24, frame25);
}
function frame1(){
stop();
}
function frame25(){
stop();
}
}
}//package dc_fla
Section 3
//ads2_Motion_1517 (dc_fla.ads2_Motion_1517)
package dc_fla {
import flash.display.*;
public dynamic class ads2_Motion_1517 extends MovieClip {
public function ads2_Motion_1517(){
addFrameScript(0, frame1, 24, frame25);
}
function frame1(){
stop();
}
function frame25(){
stop();
}
}
}//package dc_fla
Section 4
//ads3_american_Motion_1658 (dc_fla.ads3_american_Motion_1658)
package dc_fla {
import flash.display.*;
public dynamic class ads3_american_Motion_1658 extends MovieClip {
public function ads3_american_Motion_1658(){
addFrameScript(0, frame1, 24, frame25);
}
function frame1(){
stop();
}
function frame25(){
stop();
}
}
}//package dc_fla
Section 5
//ads3_sushi_Motion_1581 (dc_fla.ads3_sushi_Motion_1581)
package dc_fla {
import flash.display.*;
public dynamic class ads3_sushi_Motion_1581 extends MovieClip {
public function ads3_sushi_Motion_1581(){
addFrameScript(0, frame1, 24, frame25);
}
function frame1(){
stop();
}
function frame25(){
stop();
}
}
}//package dc_fla
Section 6
//ads4_Motion_1565 (dc_fla.ads4_Motion_1565)
package dc_fla {
import flash.display.*;
public dynamic class ads4_Motion_1565 extends MovieClip {
public function ads4_Motion_1565(){
addFrameScript(0, frame1, 24, frame25);
}
function frame1(){
stop();
}
function frame25(){
stop();
}
}
}//package dc_fla
Section 7
//ads5_american_Motion_1614 (dc_fla.ads5_american_Motion_1614)
package dc_fla {
import flash.display.*;
public dynamic class ads5_american_Motion_1614 extends MovieClip {
public function ads5_american_Motion_1614(){
addFrameScript(0, frame1, 24, frame25);
}
function frame1(){
stop();
}
function frame25(){
stop();
}
}
}//package dc_fla
Section 8
//ads5_sushi_Motion_1543 (dc_fla.ads5_sushi_Motion_1543)
package dc_fla {
import flash.display.*;
public dynamic class ads5_sushi_Motion_1543 extends MovieClip {
public function ads5_sushi_Motion_1543(){
addFrameScript(0, frame1, 24, frame25);
}
function frame1(){
stop();
}
function frame25(){
stop();
}
}
}//package dc_fla
Section 9
//advlev1_1524 (dc_fla.advlev1_1524)
package dc_fla {
import flash.display.*;
public dynamic class advlev1_1524 extends MovieClip {
public function advlev1_1524(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package dc_fla
Section 10
//af7_483 (dc_fla.af7_483)
package dc_fla {
import flash.display.*;
public dynamic class af7_483 extends MovieClip {
public function af7_483(){
addFrameScript(16, frame17);
}
function frame17(){
stop();
}
}
}//package dc_fla
Section 11
//AllButtons_114 (dc_fla.AllButtons_114)
package dc_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.filters.*;
import flash.text.*;
import flash.geom.*;
import flash.utils.*;
import game.ui.*;
import flash.ui.*;
import flash.net.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class AllButtons_114 extends MovieClip {
public var general_button5:MenuButton;
public var general_button4:MenuButton;
public var ad_button1:MenuButton;
public var ad_button3:MenuButton;
public var ad_button7:MenuButton;
public var ad_button2:MenuButton;
public var ad_button4:MenuButton;
public var ad_button5:MenuButton;
public var ad_button8:MenuButton;
public var ad_button9:MenuButton;
public var serving_speed_txt:TextField;
public var product_cost_txt:TextField;
public var ad_button10:MenuButton;
public var ad_button11:MenuButton;
public var ad_button12:MenuButton;
public var seat_count_txt:TextField;
public var employees:MovieClip;
public var ad_button6:MenuButton;
public var special_button1:MenuButton;
public var special_button2:MenuButton;
public var special_button3:MenuButton;
public var special_button5:MenuButton;
public var special_button6:MenuButton;
public var special_button4:MenuButton;
public var general_button1:MenuButton;
public var general_button2:MenuButton;
public var general_button6:MenuButton;
public var general_button3:MenuButton;
public function AllButtons_114(){
addFrameScript(0, frame1, 1, frame2);
}
function frame2(){
stop();
}
function frame1(){
stop();
GameStage.welcomeScreen.engineInstance.playWindow.ui.ui_menu.updatePositions();
}
}
}//package dc_fla
Section 12
//BonusAnimation_325 (dc_fla.BonusAnimation_325)
package dc_fla {
import flash.display.*;
public dynamic class BonusAnimation_325 extends MovieClip {
public var inner:MovieClip;
public function BonusAnimation_325(){
addFrameScript(48, frame49);
}
function frame49(){
stop();
visible = false;
}
}
}//package dc_fla
Section 13
//BonusAnimationInner_326 (dc_fla.BonusAnimationInner_326)
package dc_fla {
import flash.display.*;
import flash.text.*;
public dynamic class BonusAnimationInner_326 extends MovieClip {
public var bonus_txt:TextField;
}
}//package dc_fla
Section 14
//cheap_sushi_menu_Motion_1519 (dc_fla.cheap_sushi_menu_Motion_1519)
package dc_fla {
import flash.display.*;
public dynamic class cheap_sushi_menu_Motion_1519 extends MovieClip {
public function cheap_sushi_menu_Motion_1519(){
addFrameScript(0, frame1, 24, frame25);
}
function frame1(){
stop();
}
function frame25(){
stop();
}
}
}//package dc_fla
Section 15
//country_menu_Motion_1608 (dc_fla.country_menu_Motion_1608)
package dc_fla {
import flash.display.*;
public dynamic class country_menu_Motion_1608 extends MovieClip {
public function country_menu_Motion_1608(){
addFrameScript(0, frame1, 24, frame25);
}
function frame1(){
stop();
}
function frame25(){
stop();
}
}
}//package dc_fla
Section 16
//CustomerFace_490 (dc_fla.CustomerFace_490)
package dc_fla {
import flash.display.*;
public dynamic class CustomerFace_490 extends MovieClip {
public function CustomerFace_490(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package dc_fla
Section 17
//decor1_american_Motion_1641 (dc_fla.decor1_american_Motion_1641)
package dc_fla {
import flash.display.*;
public dynamic class decor1_american_Motion_1641 extends MovieClip {
public function decor1_american_Motion_1641(){
addFrameScript(0, frame1, 24, frame25);
}
function frame1(){
stop();
}
function frame25(){
stop();
}
}
}//package dc_fla
Section 18
//decor1_sushi_Motion_1572 (dc_fla.decor1_sushi_Motion_1572)
package dc_fla {
import flash.display.*;
public dynamic class decor1_sushi_Motion_1572 extends MovieClip {
public function decor1_sushi_Motion_1572(){
addFrameScript(0, frame1, 24, frame25);
}
function frame1(){
stop();
}
function frame25(){
stop();
}
}
}//package dc_fla
Section 19
//decor2_american_Motion_1639 (dc_fla.decor2_american_Motion_1639)
package dc_fla {
import flash.display.*;
public dynamic class decor2_american_Motion_1639 extends MovieClip {
public function decor2_american_Motion_1639(){
addFrameScript(0, frame1, 24, frame25);
}
function frame1(){
stop();
}
function frame25(){
stop();
}
}
}//package dc_fla
Section 20
//decor2_sushi_Motion_1568 (dc_fla.decor2_sushi_Motion_1568)
package dc_fla {
import flash.display.*;
public dynamic class decor2_sushi_Motion_1568 extends MovieClip {
public function decor2_sushi_Motion_1568(){
addFrameScript(0, frame1, 24, frame25);
}
function frame1(){
stop();
}
function frame25(){
stop();
}
}
}//package dc_fla
Section 21
//decor3_american_Motion_1628 (dc_fla.decor3_american_Motion_1628)
package dc_fla {
import flash.display.*;
public dynamic class decor3_american_Motion_1628 extends MovieClip {
public function decor3_american_Motion_1628(){
addFrameScript(0, frame1, 24, frame25);
}
function frame1(){
stop();
}
function frame25(){
stop();
}
}
}//package dc_fla
Section 22
//decor3_sushi_Motion_1574 (dc_fla.decor3_sushi_Motion_1574)
package dc_fla {
import flash.display.*;
public dynamic class decor3_sushi_Motion_1574 extends MovieClip {
public function decor3_sushi_Motion_1574(){
addFrameScript(0, frame1, 24, frame25);
}
function frame1(){
stop();
}
function frame25(){
stop();
}
}
}//package dc_fla
Section 23
//decor4_american_Motion_1655 (dc_fla.decor4_american_Motion_1655)
package dc_fla {
import flash.display.*;
public dynamic class decor4_american_Motion_1655 extends MovieClip {
public function decor4_american_Motion_1655(){
addFrameScript(0, frame1, 24, frame25);
}
function frame1(){
stop();
}
function frame25(){
stop();
}
}
}//package dc_fla
Section 24
//decor4_sushi_Motion_1514 (dc_fla.decor4_sushi_Motion_1514)
package dc_fla {
import flash.display.*;
public dynamic class decor4_sushi_Motion_1514 extends MovieClip {
public function decor4_sushi_Motion_1514(){
addFrameScript(0, frame1, 24, frame25);
}
function frame1(){
stop();
}
function frame25(){
stop();
}
}
}//package dc_fla
Section 25
//decor5_american_Motion_1630 (dc_fla.decor5_american_Motion_1630)
package dc_fla {
import flash.display.*;
public dynamic class decor5_american_Motion_1630 extends MovieClip {
public function decor5_american_Motion_1630(){
addFrameScript(0, frame1, 24, frame25);
}
function frame1(){
stop();
}
function frame25(){
stop();
}
}
}//package dc_fla
Section 26
//decor5_sushi_Motion_1576 (dc_fla.decor5_sushi_Motion_1576)
package dc_fla {
import flash.display.*;
public dynamic class decor5_sushi_Motion_1576 extends MovieClip {
public function decor5_sushi_Motion_1576(){
addFrameScript(0, frame1, 24, frame25);
}
function frame1(){
stop();
}
function frame25(){
stop();
}
}
}//package dc_fla
Section 27
//decor6_american_Motion_1636 (dc_fla.decor6_american_Motion_1636)
package dc_fla {
import flash.display.*;
public dynamic class decor6_american_Motion_1636 extends MovieClip {
public function decor6_american_Motion_1636(){
addFrameScript(0, frame1, 24, frame25);
}
function frame1(){
stop();
}
function frame25(){
stop();
}
}
}//package dc_fla
Section 28
//decor6_sushi_Motion_1539 (dc_fla.decor6_sushi_Motion_1539)
package dc_fla {
import flash.display.*;
public dynamic class decor6_sushi_Motion_1539 extends MovieClip {
public function decor6_sushi_Motion_1539(){
addFrameScript(0, frame1, 24, frame25);
}
function frame1(){
stop();
}
function frame25(){
stop();
}
}
}//package dc_fla
Section 29
//decor7_american_Motion_1634 (dc_fla.decor7_american_Motion_1634)
package dc_fla {
import flash.display.*;
public dynamic class decor7_american_Motion_1634 extends MovieClip {
public function decor7_american_Motion_1634(){
addFrameScript(0, frame1, 24, frame25);
}
function frame1(){
stop();
}
function frame25(){
stop();
}
}
}//package dc_fla
Section 30
//decor7_sushi_Motion_1578 (dc_fla.decor7_sushi_Motion_1578)
package dc_fla {
import flash.display.*;
public dynamic class decor7_sushi_Motion_1578 extends MovieClip {
public function decor7_sushi_Motion_1578(){
addFrameScript(0, frame1, 24, frame25);
}
function frame1(){
stop();
}
function frame25(){
stop();
}
}
}//package dc_fla
Section 31
//DeliverySignAmerican_1660 (dc_fla.DeliverySignAmerican_1660)
package dc_fla {
import flash.display.*;
public dynamic class DeliverySignAmerican_1660 extends MovieClip {
public function DeliverySignAmerican_1660(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package dc_fla
Section 32
//DeliverySignSushi_1597 (dc_fla.DeliverySignSushi_1597)
package dc_fla {
import flash.display.*;
public dynamic class DeliverySignSushi_1597 extends MovieClip {
public function DeliverySignSushi_1597(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package dc_fla
Section 33
//eastern_sweeties_Motion_1530 (dc_fla.eastern_sweeties_Motion_1530)
package dc_fla {
import flash.display.*;
public dynamic class eastern_sweeties_Motion_1530 extends MovieClip {
public function eastern_sweeties_Motion_1530(){
addFrameScript(0, frame1, 24, frame25);
}
function frame1(){
stop();
}
function frame25(){
stop();
}
}
}//package dc_fla
Section 34
//Employees_304 (dc_fla.Employees_304)
package dc_fla {
import flash.display.*;
import flash.text.*;
public dynamic class Employees_304 extends MovieClip {
public var cost_txt:TextField;
public var number_txt:TextField;
public var button_back:MovieClip;
}
}//package dc_fla
Section 35
//EnemyLevelGoalBar_324 (dc_fla.EnemyLevelGoalBar_324)
package dc_fla {
import flash.display.*;
import flash.text.*;
public dynamic class EnemyLevelGoalBar_324 extends MovieClip {
public var bar:MovieClip;
public var goal_txt:TextField;
}
}//package dc_fla
Section 36
//ExtraButtons_348 (dc_fla.ExtraButtons_348)
package dc_fla {
import flash.display.*;
public dynamic class ExtraButtons_348 extends MovieClip {
public var news_box:SimpleButton;
public var benches_grey:SimpleButton;
public var ice_cream_grey:SimpleButton;
public var news_box_grey:SimpleButton;
public var ice_cream:SimpleButton;
public var benches:SimpleButton;
}
}//package dc_fla
Section 37
//ExtraItemInner_469 (dc_fla.ExtraItemInner_469)
package dc_fla {
import flash.display.*;
public dynamic class ExtraItemInner_469 extends MovieClip {
public function ExtraItemInner_469(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package dc_fla
Section 38
//fb_head_mc_1740 (dc_fla.fb_head_mc_1740)
package dc_fla {
import flash.display.*;
public dynamic class fb_head_mc_1740 extends MovieClip {
public function fb_head_mc_1740(){
addFrameScript(0, frame1, 12, frame13, 22, frame23);
}
function frame1(){
stop();
}
function frame13(){
stop();
}
function frame23(){
gotoAndStop("turnhead_stop");
}
}
}//package dc_fla
Section 39
//fb_head_mc_60 (dc_fla.fb_head_mc_60)
package dc_fla {
import flash.display.*;
public dynamic class fb_head_mc_60 extends MovieClip {
public function fb_head_mc_60(){
addFrameScript(0, frame1, 12, frame13, 22, frame23);
}
function frame1(){
stop();
}
function frame13(){
stop();
}
function frame23(){
gotoAndStop("turnhead_stop");
}
}
}//package dc_fla
Section 40
//flongabot_1738 (dc_fla.flongabot_1738)
package dc_fla {
import flash.display.*;
public dynamic class flongabot_1738 extends MovieClip {
public var fbHead:MovieClip;
public function flongabot_1738(){
addFrameScript(0, frame1, 75, frame76, 88, frame89, 99, frame100);
}
public function doEndFly(){
this.gotoAndPlay("flying_end");
}
function frame76(){
gotoAndPlay("normal");
}
function frame89(){
gotoAndPlay("flying");
}
public function doNormal(){
this.gotoAndPlay("normal");
}
function frame1(){
}
function frame100(){
gotoAndPlay("normal");
}
public function doTurnhead(){
this.fbHead.gotoAndPlay("turnhead");
}
public function doNormalHead(){
this.fbHead.gotoAndPlay("normal");
}
public function doWink(){
this.fbHead.gotoAndPlay("wink_start");
}
public function doFly(){
this.gotoAndPlay("flying_start");
}
}
}//package dc_fla
Section 41
//flongabot_58 (dc_fla.flongabot_58)
package dc_fla {
import flash.display.*;
public dynamic class flongabot_58 extends MovieClip {
public var fbHead:MovieClip;
public function flongabot_58(){
addFrameScript(0, frame1, 75, frame76, 88, frame89, 99, frame100);
}
public function doEndFly(){
this.gotoAndPlay("flying_end");
}
function frame76(){
gotoAndPlay("normal");
}
function frame89(){
gotoAndPlay("flying");
}
public function doNormal(){
this.gotoAndPlay("normal");
}
function frame1(){
}
function frame100(){
gotoAndPlay("normal");
}
public function doTurnhead(){
this.fbHead.gotoAndPlay("turnhead");
}
public function doNormalHead(){
this.fbHead.gotoAndPlay("normal");
}
public function doWink(){
this.fbHead.gotoAndPlay("wink_start");
}
public function doFly(){
this.gotoAndPlay("flying_start");
}
}
}//package dc_fla
Section 42
//FlongaIntro_1736 (dc_fla.FlongaIntro_1736)
package dc_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.filters.*;
import flash.text.*;
import flash.geom.*;
import flash.utils.*;
import flash.ui.*;
import flash.net.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class FlongaIntro_1736 extends MovieClip {
public var flobot:MovieClip;
public function FlongaIntro_1736(){
addFrameScript(0, frame1, 29, frame30, 62, frame63, 72, frame73, 92, frame93, 200, frame201, 0xFF, frame256);
}
function frame73(){
flobot.doTurnhead();
}
function frame201(){
flobot.doWink();
}
function frame93(){
flobot.doWink();
}
function frame1(){
}
function frame30(){
flobot.doFly();
}
function frame256(){
stop();
GameStage.itself.flongaFinished();
}
function frame63(){
flobot.doEndFly();
}
}
}//package dc_fla
Section 43
//HelloMC_1502 (dc_fla.HelloMC_1502)
package dc_fla {
import flash.display.*;
public dynamic class HelloMC_1502 extends MovieClip {
public var start_button:SimpleButton;
}
}//package dc_fla
Section 44
//hot_cheese_rolls_Motion_1532 (dc_fla.hot_cheese_rolls_Motion_1532)
package dc_fla {
import flash.display.*;
public dynamic class hot_cheese_rolls_Motion_1532 extends MovieClip {
public function hot_cheese_rolls_Motion_1532(){
addFrameScript(0, frame1, 24, frame25);
}
function frame1(){
stop();
}
function frame25(){
stop();
}
}
}//package dc_fla
Section 45
//KaraokeMotion_1541 (dc_fla.KaraokeMotion_1541)
package dc_fla {
import flash.display.*;
public dynamic class KaraokeMotion_1541 extends MovieClip {
public var karaoke:MovieClip;
public function KaraokeMotion_1541(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package dc_fla
Section 46
//king_burgers_header_Motion_1664 (dc_fla.king_burgers_header_Motion_1664)
package dc_fla {
import flash.display.*;
public dynamic class king_burgers_header_Motion_1664 extends MovieClip {
public function king_burgers_header_Motion_1664(){
addFrameScript(0, frame1, 24, frame25);
}
function frame1(){
stop();
}
function frame25(){
stop();
}
}
}//package dc_fla
Section 47
//LeftIcon_320 (dc_fla.LeftIcon_320)
package dc_fla {
import flash.display.*;
public dynamic class LeftIcon_320 extends MovieClip {
public function LeftIcon_320(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package dc_fla
Section 48
//LevelClosedMessageMC_104 (dc_fla.LevelClosedMessageMC_104)
package dc_fla {
import flash.display.*;
import flash.text.*;
public dynamic class LevelClosedMessageMC_104 extends MovieClip {
public var msg:TextField;
}
}//package dc_fla
Section 49
//LevelGoalBar_323 (dc_fla.LevelGoalBar_323)
package dc_fla {
import flash.display.*;
import flash.text.*;
public dynamic class LevelGoalBar_323 extends MovieClip {
public var bar:MovieClip;
public var goal_txt:TextField;
}
}//package dc_fla
Section 50
//luxury_pizza_Motion_1605 (dc_fla.luxury_pizza_Motion_1605)
package dc_fla {
import flash.display.*;
public dynamic class luxury_pizza_Motion_1605 extends MovieClip {
public function luxury_pizza_Motion_1605(){
addFrameScript(0, frame1, 24, frame25);
}
function frame1(){
stop();
}
function frame25(){
stop();
}
}
}//package dc_fla
Section 51
//MenuButtonBackStates_116 (dc_fla.MenuButtonBackStates_116)
package dc_fla {
import flash.display.*;
public dynamic class MenuButtonBackStates_116 extends MovieClip {
public function MenuButtonBackStates_116(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package dc_fla
Section 52
//MenuButtonBackStatesForHire_305 (dc_fla.MenuButtonBackStatesForHire_305)
package dc_fla {
import flash.display.*;
public dynamic class MenuButtonBackStatesForHire_305 extends MovieClip {
public function MenuButtonBackStatesForHire_305(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package dc_fla
Section 53
//OutputMessage_346 (dc_fla.OutputMessage_346)
package dc_fla {
import flash.display.*;
public dynamic class OutputMessage_346 extends MovieClip {
public var msg:MovieClip;
public function OutputMessage_346(){
addFrameScript(34, frame35);
}
function frame35(){
visible = false;
stop();
}
}
}//package dc_fla
Section 54
//OutputMessageInner_347 (dc_fla.OutputMessageInner_347)
package dc_fla {
import flash.display.*;
import flash.text.*;
public dynamic class OutputMessageInner_347 extends MovieClip {
public var msg_txt:TextField;
}
}//package dc_fla
Section 55
//PauseMC_362 (dc_fla.PauseMC_362)
package dc_fla {
import flash.display.*;
public dynamic class PauseMC_362 extends MovieClip {
public function PauseMC_362(){
addFrameScript(9, frame10);
}
function frame10(){
stop();
}
}
}//package dc_fla
Section 56
//pizza_production_Motion_1603 (dc_fla.pizza_production_Motion_1603)
package dc_fla {
import flash.display.*;
public dynamic class pizza_production_Motion_1603 extends MovieClip {
public function pizza_production_Motion_1603(){
addFrameScript(0, frame1, 24, frame25);
}
function frame1(){
stop();
}
function frame25(){
stop();
}
}
}//package dc_fla
Section 57
//PreloaderBibbs_10 (dc_fla.PreloaderBibbs_10)
package dc_fla {
import flash.display.*;
public dynamic class PreloaderBibbs_10 extends MovieClip {
public function PreloaderBibbs_10(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package dc_fla
Section 58
//PreloadingBibb3_9 (dc_fla.PreloadingBibb3_9)
package dc_fla {
import flash.display.*;
public dynamic class PreloadingBibb3_9 extends MovieClip {
public function PreloadingBibb3_9(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package dc_fla
Section 59
//receptionist_american_Motion_1643 (dc_fla.receptionist_american_Motion_1643)
package dc_fla {
import flash.display.*;
public dynamic class receptionist_american_Motion_1643 extends MovieClip {
public function receptionist_american_Motion_1643(){
addFrameScript(0, frame1, 24, frame25);
}
function frame1(){
stop();
}
function frame25(){
stop();
}
}
}//package dc_fla
Section 60
//receptionist_sushi_Motion_1585 (dc_fla.receptionist_sushi_Motion_1585)
package dc_fla {
import flash.display.*;
public dynamic class receptionist_sushi_Motion_1585 extends MovieClip {
public function receptionist_sushi_Motion_1585(){
addFrameScript(0, frame1, 24, frame25);
}
function frame1(){
stop();
}
function frame25(){
stop();
}
}
}//package dc_fla
Section 61
//RepairDialog_331 (dc_fla.RepairDialog_331)
package dc_fla {
import flash.display.*;
import flash.text.*;
public dynamic class RepairDialog_331 extends MovieClip {
public var repair_button:SimpleButton;
public var money_txt:TextField;
}
}//package dc_fla
Section 62
//Resources_317 (dc_fla.Resources_317)
package dc_fla {
import flash.display.*;
import flash.text.*;
public dynamic class Resources_317 extends MovieClip {
public var wave_txt:TextField;
public var left_icon:MovieClip;
public var enemy_goal_bar:MovieClip;
public var right_icon:MovieClip;
public var goal_bar:MovieClip;
}
}//package dc_fla
Section 63
//sale_campaigns_Motion_1534 (dc_fla.sale_campaigns_Motion_1534)
package dc_fla {
import flash.display.*;
public dynamic class sale_campaigns_Motion_1534 extends MovieClip {
public function sale_campaigns_Motion_1534(){
addFrameScript(0, frame1, 24, frame25);
}
function frame1(){
stop();
}
function frame25(){
stop();
}
}
}//package dc_fla
Section 64
//security_system_Motion_1536 (dc_fla.security_system_Motion_1536)
package dc_fla {
import flash.display.*;
public dynamic class security_system_Motion_1536 extends MovieClip {
public function security_system_Motion_1536(){
addFrameScript(0, frame1, 24, frame25);
}
function frame1(){
stop();
}
function frame25(){
stop();
}
}
}//package dc_fla
Section 65
//security_system_Motion_1610 (dc_fla.security_system_Motion_1610)
package dc_fla {
import flash.display.*;
public dynamic class security_system_Motion_1610 extends MovieClip {
public function security_system_Motion_1610(){
addFrameScript(0, frame1, 24, frame25);
}
function frame1(){
stop();
}
function frame25(){
stop();
}
}
}//package dc_fla
Section 66
//SellDialog_328 (dc_fla.SellDialog_328)
package dc_fla {
import flash.display.*;
import flash.text.*;
public dynamic class SellDialog_328 extends MovieClip {
public var money_txt:TextField;
public var sell_button:SimpleButton;
}
}//package dc_fla
Section 67
//ShopSeat_1508 (dc_fla.ShopSeat_1508)
package dc_fla {
import flash.display.*;
public dynamic class ShopSeat_1508 extends MovieClip {
public var fill_square:MovieClip;
public function ShopSeat_1508(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package dc_fla
Section 68
//ShopTooltip_327 (dc_fla.ShopTooltip_327)
package dc_fla {
import flash.display.*;
import flash.text.*;
public dynamic class ShopTooltip_327 extends MovieClip {
public var title_txt:TextField;
public var params_txt:TextField;
public function ShopTooltip_327(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package dc_fla
Section 69
//Sitting_1109 (dc_fla.Sitting_1109)
package dc_fla {
import flash.display.*;
public dynamic class Sitting_1109 extends MovieClip {
public function Sitting_1109(){
addFrameScript(39, frame40);
}
function frame40(){
stop();
}
}
}//package dc_fla
Section 70
//Sitting_1203 (dc_fla.Sitting_1203)
package dc_fla {
import flash.display.*;
public dynamic class Sitting_1203 extends MovieClip {
public function Sitting_1203(){
addFrameScript(39, frame40);
}
function frame40(){
stop();
}
}
}//package dc_fla
Section 71
//Sitting_1284 (dc_fla.Sitting_1284)
package dc_fla {
import flash.display.*;
public dynamic class Sitting_1284 extends MovieClip {
public function Sitting_1284(){
addFrameScript(39, frame40);
}
function frame40(){
stop();
}
}
}//package dc_fla
Section 72
//Sitting_1370 (dc_fla.Sitting_1370)
package dc_fla {
import flash.display.*;
public dynamic class Sitting_1370 extends MovieClip {
public function Sitting_1370(){
addFrameScript(39, frame40);
}
function frame40(){
stop();
}
}
}//package dc_fla
Section 73
//Sitting_1458 (dc_fla.Sitting_1458)
package dc_fla {
import flash.display.*;
public dynamic class Sitting_1458 extends MovieClip {
public function Sitting_1458(){
addFrameScript(39, frame40);
}
function frame40(){
stop();
}
}
}//package dc_fla
Section 74
//Sitting_550 (dc_fla.Sitting_550)
package dc_fla {
import flash.display.*;
public dynamic class Sitting_550 extends MovieClip {
public function Sitting_550(){
addFrameScript(39, frame40);
}
function frame40(){
stop();
}
}
}//package dc_fla
Section 75
//Sitting_652 (dc_fla.Sitting_652)
package dc_fla {
import flash.display.*;
public dynamic class Sitting_652 extends MovieClip {
public function Sitting_652(){
addFrameScript(39, frame40);
}
function frame40(){
stop();
}
}
}//package dc_fla
Section 76
//Sitting_771 (dc_fla.Sitting_771)
package dc_fla {
import flash.display.*;
public dynamic class Sitting_771 extends MovieClip {
public function Sitting_771(){
addFrameScript(39, frame40);
}
function frame40(){
stop();
}
}
}//package dc_fla
Section 77
//Sitting_885 (dc_fla.Sitting_885)
package dc_fla {
import flash.display.*;
public dynamic class Sitting_885 extends MovieClip {
public function Sitting_885(){
addFrameScript(39, frame40);
}
function frame40(){
stop();
}
}
}//package dc_fla
Section 78
//Sitting_989 (dc_fla.Sitting_989)
package dc_fla {
import flash.display.*;
public dynamic class Sitting_989 extends MovieClip {
public function Sitting_989(){
addFrameScript(39, frame40);
}
function frame40(){
stop();
}
}
}//package dc_fla
Section 79
//smokecolorpart_1762 (dc_fla.smokecolorpart_1762)
package dc_fla {
import flash.display.*;
public dynamic class smokecolorpart_1762 extends MovieClip {
public var obj:MovieClip;
}
}//package dc_fla
Section 80
//Sndbibb_474 (dc_fla.Sndbibb_474)
package dc_fla {
import flash.display.*;
public dynamic class Sndbibb_474 extends MovieClip {
public function Sndbibb_474(){
addFrameScript(0, frame1, 18, frame19);
}
function frame1(){
stop();
}
function frame19(){
stop();
}
}
}//package dc_fla
Section 81
//SoundsBibb_467 (dc_fla.SoundsBibb_467)
package dc_fla {
import flash.display.*;
public dynamic class SoundsBibb_467 extends MovieClip {
public function SoundsBibb_467(){
addFrameScript(2, frame3, 5, frame6);
}
function frame3(){
stop();
}
function frame6(){
stop();
}
}
}//package dc_fla
Section 82
//StatCaption_384 (dc_fla.StatCaption_384)
package dc_fla {
import flash.display.*;
public dynamic class StatCaption_384 extends MovieClip {
public var innerc:MovieClip;
}
}//package dc_fla
Section 83
//StatCaptionInner_385 (dc_fla.StatCaptionInner_385)
package dc_fla {
import flash.display.*;
import flash.text.*;
public dynamic class StatCaptionInner_385 extends MovieClip {
public var stat_title:TextField;
}
}//package dc_fla
Section 84
//summer_seats_sushi_Motion_1570 (dc_fla.summer_seats_sushi_Motion_1570)
package dc_fla {
import flash.display.*;
public dynamic class summer_seats_sushi_Motion_1570 extends MovieClip {
public function summer_seats_sushi_Motion_1570(){
addFrameScript(0, frame1, 24, frame25);
}
function frame1(){
stop();
}
function frame25(){
stop();
}
}
}//package dc_fla
Section 85
//SummerSeatsMotion_1626 (dc_fla.SummerSeatsMotion_1626)
package dc_fla {
import flash.display.*;
public dynamic class SummerSeatsMotion_1626 extends MovieClip {
public function SummerSeatsMotion_1626(){
addFrameScript(0, frame1, 24, frame25);
}
function frame1(){
stop();
}
function frame25(){
stop();
}
}
}//package dc_fla
Section 86
//sushi_discounts_Motion_1521 (dc_fla.sushi_discounts_Motion_1521)
package dc_fla {
import flash.display.*;
public dynamic class sushi_discounts_Motion_1521 extends MovieClip {
public function sushi_discounts_Motion_1521(){
addFrameScript(0, frame1, 24, frame25);
}
function frame1(){
stop();
}
function frame25(){
stop();
}
}
}//package dc_fla
Section 87
//Symbol4copy_319 (dc_fla.Symbol4copy_319)
package dc_fla {
import flash.display.*;
public dynamic class Symbol4copy_319 extends MovieClip {
public var inner:MovieClip;
}
}//package dc_fla
Section 88
//TvHallMotion_1612 (dc_fla.TvHallMotion_1612)
package dc_fla {
import flash.display.*;
public dynamic class TvHallMotion_1612 extends MovieClip {
public var tv_hall:MovieClip;
public function TvHallMotion_1612(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package dc_fla
Section 89
//UNDER_CONSTRUCTION_MC_51 (dc_fla.UNDER_CONSTRUCTION_MC_51)
package dc_fla {
import flash.display.*;
public dynamic class UNDER_CONSTRUCTION_MC_51 extends MovieClip {
public function UNDER_CONSTRUCTION_MC_51(){
addFrameScript(34, frame35);
}
function frame35(){
gotoAndPlay(1);
}
}
}//package dc_fla
Section 90
//underground_bar_american_Motion_1632 (dc_fla.underground_bar_american_Motion_1632)
package dc_fla {
import flash.display.*;
public dynamic class underground_bar_american_Motion_1632 extends MovieClip {
public function underground_bar_american_Motion_1632(){
addFrameScript(0, frame1, 24, frame25);
}
function frame1(){
stop();
}
function frame25(){
stop();
}
}
}//package dc_fla
Section 91
//underground_bar_sushi_Motion_1583 (dc_fla.underground_bar_sushi_Motion_1583)
package dc_fla {
import flash.display.*;
public dynamic class underground_bar_sushi_Motion_1583 extends MovieClip {
public function underground_bar_sushi_Motion_1583(){
addFrameScript(0, frame1, 24, frame25);
}
function frame1(){
stop();
}
function frame25(){
stop();
}
}
}//package dc_fla
Section 92
//AnimatedBitmap (fai.common.AnimatedBitmap)
package fai.common {
import flash.display.*;
import flash.geom.*;
public class AnimatedBitmap extends Bitmap {
private var initial_height:int;// = 0
private var point:Point;// = null
private var rect:Rectangle;// = null
private var initial_width:int;// = 0
public var curbuffer:BitmapData;// = null
public var nframes:uint;// = 0
public var framen:uint;// = 0
public function AnimatedBitmap(_arg1:BitmapData, _arg2:int, _arg3:int):void{
nframes = 0;
curbuffer = null;
framen = 0;
point = null;
rect = null;
initial_width = 0;
initial_height = 0;
initial_width = _arg2;
initial_height = _arg3;
super(new BitmapData(_arg2, _arg3, true, 0), "auto", true);
point = new Point(0, 0);
setBuffer(_arg1);
}
public function setBuffer(_arg1:BitmapData):void{
if (((_arg1) && (!((curbuffer == _arg1))))){
curbuffer = _arg1;
nframes = (curbuffer.width / initial_width);
framen = 0;
draw();
};
}
public function setFrame(_arg1:uint):void{
if (_arg1 == framen){
return;
};
framen = _arg1;
draw();
}
private function draw():void{
var _local1:BitmapData;
_local1 = bitmapData;
rect = new Rectangle((framen * initial_width), 0, initial_width, initial_height);
_local1.copyPixels(curbuffer, rect, point);
bitmapData = _local1;
smoothing = true;
}
}
}//package fai.common
Section 93
//Map (fai.common.Map)
package fai.common {
public class Map {
public var values:Array;
protected var index_:int;// = 0
public var keys:Array;
public function Map(){
keys = new Array();
values = new Array();
index_ = 0;
super();
}
public function add(_arg1:Object, _arg2):void{
index_ = 0;
find(_arg1);
keys.splice(index_, 0, _arg1);
values.splice(index_, 0, _arg2);
}
public function empty():Boolean{
return ((keys.length == 0));
}
public function shift(){
var _local1:*;
_local1 = values.shift();
keys.shift();
return (_local1);
}
public function remove(_arg1:Object):void{
if (find(_arg1)){
keys.splice(index_, 1);
values.splice(index_, 1);
};
}
public function size():int{
return (keys.length);
}
public function pop(){
var _local1:*;
_local1 = values.pop();
keys.pop();
return (_local1);
}
public function get(_arg1:Object){
if (!find(_arg1)){
return (null);
};
return (values[index_]);
}
public function getout(_arg1:Object){
var _local2:*;
if (!find(_arg1)){
return (null);
};
_local2 = values[index_];
values.splice(index_, 1);
keys.splice(index_, 1);
return (_local2);
}
public function find(_arg1:Object):Boolean{
var _local2:int;
var _local3:int;
_local2 = 0;
_local3 = (keys.length - 1);
while (_local2 <= _local3) {
index_ = ((_local2 + _local3) >> 1);
if (_arg1 < keys[index_]){
_local3 = (index_ - 1);
} else {
if (_arg1 > keys[index_]){
_local2 = (index_ + 1);
} else {
return (true);
};
};
};
index_ = _local2;
return (false);
}
public function clear():void{
keys.length = 0;
values.length = 0;
index_ = 0;
}
}
}//package fai.common
Section 94
//ObjectList (fai.common.ObjectList)
package fai.common {
import flash.utils.*;
public class ObjectList extends Proxy {
private var objects:Array;
public function ObjectList():void{
objects = [];
super();
}
public function remove(_arg1):void{
var _local2:int;
_local2 = objects.indexOf(_arg1);
if (_local2 >= 0){
delete objects[_local2];
objects.splice(_local2, 1);
};
}
public function get length():uint{
return (objects.length);
}
public function push(_arg1):void{
objects.push(_arg1);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(_arg1){
return (objects[_arg1]);
}
public function clear():void{
if (((objects) && ((objects.length > 0)))){
objects.length = 0;
objects = new Array();
};
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function callProperty(_arg1, ... _args){
if ((objects[_arg1] is Function)){
return (objects[_arg1].apply(null, _args));
};
return (null);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function setProperty(_arg1, _arg2):void{
objects[_arg1] = _arg2;
}
public function hasItem(_arg1):Boolean{
return (!((objects.indexOf(_arg1) == -1)));
}
}
}//package fai.common
Section 95
//Position (fai.common.Position)
package fai.common {
public final class Position {
public var x:int;// = 0
public var y:int;// = 0
public function Position(_arg1:int=0, _arg2:int=0):void{
x = 0;
y = 0;
super();
set(_arg1, _arg2);
}
public function copy(_arg1:Position):void{
x = _arg1.x;
y = _arg1.y;
}
public function set(_arg1:int, _arg2:int):void{
x = _arg1;
y = _arg2;
}
public function isequal(_arg1:Position):Boolean{
return ((((x == _arg1.x)) && ((y == _arg1.y))));
}
public function isSameXY(_arg1:int, _arg2:int):Boolean{
return ((((x == _arg1)) && ((y == _arg2))));
}
}
}//package fai.common
Section 96
//sprintf (fai.common.sprintf)
package fai.common {
public function sprintf(_arg1:String, ... _args):String{
var _local3:String;
var _local4:int;
var _local5:int;
var _local6:String;
var _local7:*;
var _local8:String;
var _local9:Boolean;
var _local10:Boolean;
var _local11:Boolean;
var _local12:Boolean;
var _local13:Boolean;
var _local14:Boolean;
var _local15:Boolean;
var _local16:String;
var _local17:String;
var _local18:Boolean;
var _local19:Boolean;
_local3 = "";
_local4 = _arg1.length;
_local5 = 0;
while (_local5 < _local4) {
_local6 = _arg1.charAt(_local5);
if (_local6 == "%"){
_local9 = false;
_local10 = false;
_local11 = false;
_local12 = false;
_local13 = false;
_local14 = false;
_local15 = false;
_local16 = "";
_local17 = "";
++_local5;
_local6 = _arg1.charAt(_local5);
while (((((((((((((((((((((!((_local6 == "d"))) && (!((_local6 == "i"))))) && (!((_local6 == "o"))))) && (!((_local6 == "u"))))) && (!((_local6 == "x"))))) && (!((_local6 == "X"))))) && (!((_local6 == "f"))))) && (!((_local6 == "F"))))) && (!((_local6 == "c"))))) && (!((_local6 == "s"))))) && (!((_local6 == "%"))))) {
if (!_local10){
if (((!(_local11)) && ((_local6 == "#")))){
_local11 = true;
} else {
if (((!(_local12)) && ((_local6 == "0")))){
_local12 = true;
} else {
if (((!(_local13)) && ((_local6 == "-")))){
_local13 = true;
} else {
if (((!(_local14)) && ((_local6 == " ")))){
_local14 = true;
} else {
if (((!(_local15)) && ((_local6 == "+")))){
_local15 = true;
} else {
_local10 = true;
};
};
};
};
};
};
if (((!(_local9)) && ((_local6 == ".")))){
_local10 = true;
_local9 = true;
++_local5;
_local6 = _arg1.charAt(_local5);
} else {
if (_local10){
if (!_local9){
_local16 = (_local16 + _local6);
} else {
_local17 = (_local17 + _local6);
};
};
++_local5;
_local6 = _arg1.charAt(_local5);
};
};
switch (_local6){
case "d":
case "i":
_local7 = _args.shift();
_local8 = String(Math.abs(int(_local7)));
if (_local17 != ""){
_local8 = leftPad(_local8, int(_local17), "0");
};
if (int(_local7) < 0){
_local8 = ("-" + _local8);
} else {
if (((_local15) && ((int(_local7) >= 0)))){
_local8 = ("+" + _local8);
};
};
if (_local16 != ""){
if (_local13){
_local8 = rightPad(_local8, int(_local16));
} else {
if (((_local12) && ((_local17 == "")))){
_local8 = leftPad(_local8, int(_local16), "0");
} else {
_local8 = leftPad(_local8, int(_local16));
};
};
};
_local3 = (_local3 + _local8);
break;
case "o":
_local7 = _args.shift();
_local8 = uint(_local7).toString(8);
if (((_local11) && (!((_local8 == "0"))))){
_local8 = ("0" + _local8);
};
if (_local17 != ""){
_local8 = leftPad(_local8, int(_local17), "0");
};
if (_local16 != ""){
if (_local13){
_local8 = rightPad(_local8, int(_local16));
} else {
if (((_local12) && ((_local17 == "")))){
_local8 = leftPad(_local8, int(_local16), "0");
} else {
_local8 = leftPad(_local8, int(_local16));
};
};
};
_local3 = (_local3 + _local8);
break;
case "u":
_local7 = _args.shift();
_local8 = uint(_local7).toString(10);
if (_local17 != ""){
_local8 = leftPad(_local8, int(_local17), "0");
};
if (_local16 != ""){
if (_local13){
_local8 = rightPad(_local8, int(_local16));
} else {
if (((_local12) && ((_local17 == "")))){
_local8 = leftPad(_local8, int(_local16), "0");
} else {
_local8 = leftPad(_local8, int(_local16));
};
};
};
_local3 = (_local3 + _local8);
break;
case "X":
_local18 = true;
case "x":
_local7 = _args.shift();
_local8 = uint(_local7).toString(16);
if (_local17 != ""){
_local8 = leftPad(_local8, int(_local17), "0");
};
_local19 = ((_local11) && (!((uint(_local7) == 0))));
if (((((((!((_local16 == ""))) && (!(_local13)))) && (_local12))) && ((_local17 == "")))){
_local8 = leftPad(_local8, (_local19) ? (int(_local16) - 2) : int(_local16), "0");
};
if (_local19){
_local8 = ("0x" + _local8);
};
if (_local16 != ""){
if (_local13){
_local8 = rightPad(_local8, int(_local16));
} else {
_local8 = leftPad(_local8, int(_local16));
};
};
if (_local18){
_local8 = _local8.toUpperCase();
};
_local3 = (_local3 + _local8);
break;
case "f":
case "F":
_local7 = _args.shift();
_local8 = Math.abs(Number(_local7)).toFixed(((_local17)!="") ? int(_local17) : 6);
if (int(_local7) < 0){
_local8 = ("-" + _local8);
} else {
if (((_local15) && ((int(_local7) >= 0)))){
_local8 = ("+" + _local8);
};
};
if (((_local11) && ((_local8.indexOf(".") == -1)))){
_local8 = (_local8 + ".");
};
if (_local16 != ""){
if (_local13){
_local8 = rightPad(_local8, int(_local16));
} else {
if (((_local12) && ((_local17 == "")))){
_local8 = leftPad(_local8, int(_local16), "0");
} else {
_local8 = leftPad(_local8, int(_local16));
};
};
};
_local3 = (_local3 + _local8);
break;
case "c":
_local7 = _args.shift();
_local8 = String.fromCharCode(int(_local7));
if (_local16 != ""){
if (_local13){
_local8 = rightPad(_local8, int(_local16));
} else {
_local8 = leftPad(_local8, int(_local16));
};
};
_local3 = (_local3 + _local8);
break;
case "s":
_local7 = _args.shift();
_local8 = String(_local7);
if (_local17 != ""){
_local8 = _local8.substring(0, int(_local17));
};
if (_local16 != ""){
if (_local13){
_local8 = rightPad(_local8, int(_local16));
} else {
_local8 = leftPad(_local8, int(_local16));
};
};
_local3 = (_local3 + _local8);
break;
case "%":
_local3 = (_local3 + "%");
};
} else {
_local3 = (_local3 + _local6);
};
_local5++;
};
return (_local3);
}
}//package fai.common
private const leftPad:Function = function (_arg1:String, _arg2:int, _arg3:String=" "):String{
var _local4:String;
if (_arg1.length < _arg2){
_local4 = "";
while ((_local4.length + _arg1.length) < _arg2) {
_local4 = (_local4 + _arg3);
};
return ((_local4 + _arg1));
};
return (_arg1);
};
private const rightPad:Function = function (_arg1:String, _arg2:int, _arg3:String=" "):String{
while (_arg1.length < _arg2) {
_arg1 = (_arg1 + _arg3);
};
return (_arg1);
};
Section 97
//Utils (fai.common.Utils)
package fai.common {
import fai.logic.*;
import flash.text.*;
public class Utils {
public static function fitToClip(_arg1, _arg2):void{
var _local3:Number;
_local3 = 0;
if (_arg1.platform.width > _arg1.platform.height){
if (_arg1.platform.width > _arg2.platform.width){
_arg1.scaleY = (_arg1.scaleX = (_arg2.platform.width / _arg1.platform.width));
};
} else {
if (_arg1.platform.height > _arg2.platform.height){
_arg1.scaleY = (_arg1.scaleX = (_arg2.platform.height / _arg1.platform.height));
};
if (_arg1.width > _arg2.width){
_local3 = _arg1.scaleX;
_arg1.scaleX = (_arg1.scaleY = (_local3 * (_arg2.platform.width / _arg1.platform.width)));
};
};
}
public static function distanceCustomer(_arg1, _arg2):Number{
var _local3:Number;
var _local4:Number;
_local3 = (_arg1.getX() - _arg2.x);
_local4 = (_arg1.getY() - _arg2.y);
return (Math.sqrt(((_local3 * _local3) + (_local4 * _local4))));
}
public static function setTextColor(_arg1:TextField, _arg2:int):void{
var _local3:TextFormat;
_local3 = new TextFormat();
_local3.color = _arg2;
_arg1.defaultTextFormat = _local3;
}
public static function distance(_arg1, _arg2):Number{
var _local3:Number;
var _local4:Number;
_local3 = (_arg1.x - _arg2.x);
_local4 = (_arg1.y - _arg2.y);
return (Math.sqrt(((_local3 * _local3) + (_local4 * _local4))));
}
public static function posPlatforms(_arg1, _arg2):void{
var _local3:Number;
var _local4:Number;
if (((!((_arg2.platform.width == _arg1.platform.width))) || (!((_arg2.platform.height == _arg1.platform.height))))){
fitToClip(_arg1, _arg2);
};
_local3 = (_arg2.platform.x - _arg1.platform.x);
_local4 = (_arg2.platform.y - _arg1.platform.y);
_arg1.x = _local3;
_arg1.y = _local4;
}
}
}//package fai.common
Section 98
//BuildingGoal (fai.goals.BuildingGoal)
package fai.goals {
import fai.logic.*;
import fai.ui.*;
import fai.common.*;
import fai.goalsystem.*;
import fai.*;
public class BuildingGoal extends Goal {
private var engine:Engine;// = null
private var max:int;// = 0
private var ticks:int;// = 0
private var shop_item:ShopItem;// = null
public function BuildingGoal(_arg1:Engine, _arg2):void{
engine = null;
shop_item = null;
ticks = 0;
max = 0;
super();
engine = _arg1;
shop_item = _arg2;
shop_item.setLevel(Consts.ShopBuilding);
shop_item.gotoAndStop("building_progress");
shop_item.building_bar.visible = true;
shop_item.reset();
max = (ticks = DataProxy.getShopBuildingTicks(_arg2.shopType));
}
public function advance():void{
if (ticks <= 0){
buildShop();
deactivate();
return;
};
if (shop_item.building_bar){
shop_item.building_bar.bar.scaleX = (1 - (ticks / max));
shop_item.building_bar.percents.text = ((" " + int(((1 - (ticks / max)) * 100))) + "%");
};
ticks--;
}
private function buildShop():void{
engine.playSound(SoundConsts.swish);
shop_item.gotoAndStop("shopping");
shop_item.building_bar.visible = false;
shop_item.setLevel(Consts.ShopLevel1);
shop_item.shoppable = true;
shop_item.setShopIcon(shop_item.resto);
shop_item.updateState();
shop_item.reset();
engine.playWindow.updateResources();
engine.playWindow.generateParticlesOver(shop_item);
if ((((engine.lastLevel.number == 0)) && ((engine.scenario.currentDay == 0)))){
};
if (engine.scenario.currentDay > 0){
engine.scenario.generateCustomersForShop(shop_item);
};
}
}
}//package fai.goals
Section 99
//BuyerGoal (fai.goals.BuyerGoal)
package fai.goals {
import fai.logic.*;
import fai.ui.*;
import fai.common.*;
import fai.goalsystem.*;
import fai.*;
public class BuyerGoal extends Goal {
private var engine:Engine;// = null
private var move_goal:MoveCustomerGoal;// = null
private var extra_using:Boolean;// = false
private var buying_goal:BuyingGoal;// = null
private var check_min_distance:int;// = 55
private var buying:Boolean;// = false
private var extra_goal:ExtraGoal;// = null
private var buyer:Customer;// = null
private var check_pause:int;// = 0
private static const CHECK_PAUSE:int = 5;
public function BuyerGoal(_arg1:Engine, _arg2:Customer):void{
engine = null;
buyer = null;
buying = false;
buying_goal = null;
move_goal = null;
extra_using = false;
extra_goal = null;
check_pause = 0;
check_min_distance = 55;
super();
engine = _arg1;
buyer = _arg2;
engine.playWindow.customersHolder.addChild(buyer.suit);
buyer.parent_dc = engine.playWindow.customersHolder;
engine.customers.add(buyer);
move_goal = new MoveCustomerGoal(engine, _arg2, buyer.road);
if (!buyer.shop.resto.enemy_restaurant){
buyer.was_in_mine = true;
};
}
private function getNearestShop():ShopItem{
var _local1:int;
var _local2:ShopItem;
var _local3:Position;
_local1 = 0;
_local1 = 0;
while (_local1 < engine.shops.size()) {
_local2 = engine.shops.getItem(_local1);
if (((((((_local2) && (_local2.shoppable))) && ((((((_local2.currentLevel == Consts.ShopLevel1)) || ((_local2.currentLevel == Consts.ShopLevel2)))) || ((_local2.currentLevel == Consts.ShopLevel3)))))) && ((buyer.money > 0)))){
_local3 = new Position((_local2.x + (_local2.move_beacon.x * _local2.scaleX)), (_local2.y + (_local2.move_beacon.y * _local2.scaleY)));
if (Utils.distanceCustomer(buyer, _local3) <= check_min_distance){
return (_local2);
};
};
_local1++;
};
return (null);
}
public function advance():void{
if (buying){
if (((buying_goal) && (buying_goal.active))){
return;
};
buying = false;
if (buyer.money <= 0){
buyer.velocity = (buyer.velocity * 1.4);
};
move_goal.reset();
} else {
if (extra_using){
if (((extra_goal) && (extra_goal.active))){
return;
};
extra_using = false;
if (buyer.money <= 0){
buyer.velocity = (buyer.velocity * 1.4);
};
move_goal.reset();
} else {
if (check_pause <= 0){
checkShops();
check_pause = CHECK_PAUSE;
if (buying){
return;
};
} else {
check_pause--;
};
if (move_goal.active){
move_goal.advance();
buyer.extraTicks();
} else {
engine.customerPassed(buyer);
deactivate();
};
};
};
}
private function getNearestExtra():ExtraItem{
var _local1:int;
var _local2:ExtraItem;
var _local3:Position;
_local1 = 0;
_local1 = 0;
while (_local1 < engine.extras.size()) {
_local2 = engine.extras.getItem(_local1);
if (((!(_local2.isAwaiting)) && (!((_local2.currentState == StringConsts.empty))))){
_local3 = new Position(_local2.x, _local2.y);
if (Utils.distanceCustomer(buyer, _local3) <= check_min_distance){
return (_local2);
};
};
_local1++;
};
return (null);
}
private function checkShops():void{
var _local1:ShopItem;
var _local2:ExtraItem;
_local1 = getNearestShop();
if (((_local1) && (!(buyer.hasBuyings(_local1.shopId))))){
if (_local1.shopBar.hasRoom()){
buying = true;
buying_goal = new BuyingGoal(engine, buyer, move_goal, _local1);
engine.goal_system.add(buying_goal);
};
};
if (!buying){
_local2 = getNearestExtra();
if (((((_local2) && (!(buyer.extraUsed(_local2))))) && ((buyer.money > 0)))){
if (_local2.hasRoom()){
extra_using = true;
extra_goal = new ExtraGoal(engine, buyer, move_goal, _local2);
engine.goal_system.add(extra_goal);
};
};
};
}
override public function deactivate():void{
super.deactivate();
if (((buyer) && (engine.playWindow))){
engine.customers.remove(buyer);
buyer.parent_dc.removeChild(buyer.suit);
buyer.parent_dc = null;
if ((((buyer.money > 0)) && (buyer.was_in_mine))){
engine.not_spent = true;
};
if ((((engine.customers.size() == 0)) && ((engine.not_spent == false)))){
engine.playWindow.showBonus((engine.playWindow.my_restaurants.length * 50));
};
engine.playWindow.updateResources();
buyer = null;
};
}
}
}//package fai.goals
Section 100
//BuyingGoal (fai.goals.BuyingGoal)
package fai.goals {
import fai.logic.*;
import fai.common.*;
import fai.*;
public class BuyingGoal extends Goal {
private var engine:Engine;// = null
private var odx:Number;// = 0
private var unloading:Boolean;// = false
private var ody:Number;// = 0
private var move_goal:MoveSimpleGoal;// = null
private var step:int;// = 0
private var road_move_goal:MoveCustomerGoal;// = null
private var was_hungry:Boolean;// = false
private var steps:int;// = 30
private var target_pos:Position;// = null
private var finished:Boolean;// = false
private var buyer:Customer;// = null
private var shop:ShopItem;// = null
private var loading:Boolean;// = false
public function BuyingGoal(_arg1:Engine, _arg2:Customer, _arg3:MoveCustomerGoal, _arg4:ShopItem):void{
engine = null;
buyer = null;
shop = null;
target_pos = null;
odx = 0;
ody = 0;
steps = 30;
step = 0;
loading = false;
unloading = false;
finished = false;
was_hungry = false;
road_move_goal = null;
move_goal = null;
super();
engine = _arg1;
buyer = _arg2;
shop = _arg4;
road_move_goal = _arg3;
move_goal = new MoveSimpleGoal(engine, buyer);
target_pos = new Position((shop.x + (shop.move_beacon.x * shop.scaleX)), (shop.y + (shop.move_beacon.y * shop.scaleY)));
move_goal.moveTo(target_pos);
loading = true;
}
public function advance():void{
if (loading){
go();
return;
};
if (unloading){
go();
return;
};
if (!buyer.buying){
if (finished){
if (was_hungry){
buyer.customer_money.gotoAndStop("money_label");
};
deactivate();
} else {
unload();
};
};
}
private function go():void{
if (move_goal.active){
move_goal.advance();
} else {
if (unloading){
finished = true;
};
if (loading){
tryToLoad();
};
loading = false;
unloading = false;
};
}
private function tryToLoad():void{
var _local1:ShopSeat;
if (((shop) && ((((((shop.currentLevel == Consts.ShopLevel1)) || ((shop.currentLevel == Consts.ShopLevel2)))) || ((shop.currentLevel == Consts.ShopLevel3)))))){
_local1 = shop.shopBar.load(buyer);
if (_local1){
buyer.suit.visible = false;
shop.shopBar.update();
return;
};
};
buyer.customer_money.gotoAndStop("hungry_label");
was_hungry = true;
unload();
}
private function unload():void{
target_pos = road_move_goal.anyNextNodePos();
buyer.suit.visible = true;
loading = false;
unloading = true;
shop.shopBar.update();
move_goal = new MoveSimpleGoal(engine, buyer);
move_goal.moveTo(target_pos);
}
}
}//package fai.goals
Section 101
//CoinGoal (fai.goals.CoinGoal)
package fai.goals {
import fai.logic.*;
import fai.ui.*;
import fai.common.*;
import fai.goalsystem.*;
import fai.*;
public class CoinGoal extends Goal {
private var engine:Engine;// = null
private var coin:CoinMotion;// = null
private var shop;// = null
public function CoinGoal(_arg1:Engine, _arg2):void{
engine = null;
shop = null;
coin = null;
super();
engine = _arg1;
shop = _arg2;
coin = new CoinMotion();
if ((_arg2 is Customer)){
coin.x = ((_arg2.getX() + (Math.random() * 5)) - 5);
coin.y = _arg2.getY();
} else {
coin.x = (shop.x + ((Math.random() * shop.width) / 2));
coin.y = shop.y;
};
if ((((shop is ExtraItem)) && (shop.vice_versa))){
coin.x = (coin.x - 15);
};
engine.playWindow.ui.addChild(coin);
coin.play();
}
override public function deactivate():void{
super.deactivate();
if (((coin) && (engine.playWindow))){
coin.stop();
engine.playWindow.ui.removeChild(coin);
coin = null;
};
}
public function advance():void{
if (coin.finished){
deactivate();
};
}
}
}//package fai.goals
Section 102
//CustomerZIndexGoal (fai.goals.CustomerZIndexGoal)
package fai.goals {
import fai.logic.*;
import fai.ui.*;
import fai.common.*;
import flash.geom.*;
import fai.goalsystem.*;
import fai.*;
public class CustomerZIndexGoal extends Goal {
private var engine:Engine;// = null
private var pause:int;// = 0
private static const PAUSE:int = 5;
public function CustomerZIndexGoal(_arg1:Engine):void{
engine = null;
pause = 0;
super();
engine = _arg1;
}
public function advance():void{
if (pause > 0){
pause--;
return;
};
pause = PAUSE;
checkZIndexes();
}
public function checkZIndexes():void{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:Customer;
var _local7:Customer;
var _local8:int;
var _local9:int;
var _local10:Array;
var _local11:Point;
var _local12:Boolean;
var _local13:IsoBeacon;
_local1 = 0;
_local2 = 0;
_local3 = 0;
_local4 = 0;
_local5 = engine.customers.size();
_local6 = null;
_local7 = null;
_local8 = 0;
_local9 = 0;
_local1 = 0;
while (_local1 < _local5) {
_local6 = engine.customers.getItem(_local1);
if (!_local6.check_zindex){
} else {
_local11 = new Point(_local6.getX(), _local6.getY());
_local12 = false;
_local4 = 0;
while (_local4 < engine.play_window.iso_beacons.length) {
_local13 = engine.play_window.iso_beacons[_local4];
if (hitTestBeacon(_local13, _local11)){
if (_local6.parent_dc != _local13){
moveToBeaconLayer(_local6, _local13);
};
_local12 = true;
break;
};
_local4++;
};
if (((!(_local12)) && (!((_local6.parent_dc == engine.playWindow.customersHolder))))){
moveTocustomersHolder(_local6);
};
_local2 = (_local1 + 1);
while (_local2 < _local5) {
_local7 = engine.customers.getItem(_local2);
if ((((((_local6 == _local7)) || (!(_local7.check_zindex)))) || (!((_local7.parent_dc == _local6.parent_dc))))){
} else {
if ((((_local7.getX() > (_local6.getX() - Consts.SpriteWidth))) && ((_local7.getX() < (_local6.getX() + Consts.SpriteWidth))))){
_local8 = _local6.parent_dc.getChildIndex(_local6.suit);
_local9 = _local6.parent_dc.getChildIndex(_local7.suit);
if ((((((_local6.getY() > _local7.getY())) && ((_local8 < _local9)))) || ((((_local6.getY() < _local7.getY())) && ((_local8 > _local9)))))){
_local6.parent_dc.swapChildren(_local6.suit, _local7.suit);
};
};
};
_local2++;
};
};
_local1++;
};
_local10 = engine.playWindow.getDeliveries();
_local1 = 0;
while (_local1 < _local10.length) {
_local6 = _local10[_local1];
_local11 = new Point(_local6.getX(), _local6.getY());
_local12 = false;
_local4 = 0;
while (_local4 < engine.play_window.iso_beacons.length) {
_local13 = engine.play_window.iso_beacons[_local4];
if (hitTestBeacon(_local13, _local11)){
if (_local6.parent_dc != _local13){
moveToBeaconLayer(_local6, _local13);
};
_local12 = true;
break;
};
_local4++;
};
if (((!(_local12)) && (!((_local6.parent_dc == engine.playWindow.customersHolder))))){
moveTocustomersHolder(_local6);
};
_local1++;
};
}
private function moveToBeaconLayer(_arg1:Customer, _arg2):void{
_arg1.parent_dc.removeChild(_arg1.suit);
if (_arg1.parent_dc != engine.playWindow.customersHolder){
_arg1.suit.x = (_arg1.parent_dc.x + _arg1.suit.x);
_arg1.suit.y = (_arg1.parent_dc.y + _arg1.suit.y);
};
_arg1.suit.x = -((_arg2.x - _arg1.suit.x));
_arg1.suit.y = -((_arg2.y - _arg1.suit.y));
_arg2.addChild(_arg1.suit);
_arg1.parent_dc = _arg2;
}
private function moveTocustomersHolder(_arg1:Customer):void{
_arg1.parent_dc.removeChild(_arg1.suit);
_arg1.suit.x = (_arg1.parent_dc.x + _arg1.suit.x);
_arg1.suit.y = (_arg1.parent_dc.y + _arg1.suit.y);
engine.playWindow.customersHolder.addChild(_arg1.suit);
_arg1.parent_dc = engine.playWindow.customersHolder;
}
private function hitTestBeacon(_arg1, _arg2:Point):Boolean{
return ((((((((_arg2.x > _arg1.x)) && ((_arg2.x < (_arg1.x + _arg1.inner.width))))) && ((_arg2.y > _arg1.y)))) && ((_arg2.y < (_arg1.y + _arg1.inner.height)))));
}
}
}//package fai.goals
Section 103
//DeliveryGoal (fai.goals.DeliveryGoal)
package fai.goals {
import fai.logic.*;
import fai.ui.*;
import fai.common.*;
import fai.goalsystem.*;
import fai.*;
public class DeliveryGoal extends Goal {
private var engine:Engine;// = null
private var move_goal:MoveDeliveryGoal;// = null
private var shop;// = null
public function DeliveryGoal(_arg1:Engine, _arg2):void{
engine = null;
shop = null;
move_goal = null;
super();
engine = _arg1;
shop = _arg2;
move_goal = new MoveDeliveryGoal(engine, shop);
engine.playWindow.updateResources();
}
public function advance():void{
if (move_goal.active){
move_goal.advance();
} else {
deactivate();
};
}
public function get deliveryCustomer():Customer{
return (move_goal.customerInstance);
}
override public function deactivate():void{
super.deactivate();
shop.deliveryFinished();
if (engine.playWindow){
engine.playWindow.updateResources();
};
}
}
}//package fai.goals
Section 104
//ExtraGoal (fai.goals.ExtraGoal)
package fai.goals {
import fai.logic.*;
import fai.ui.*;
import fai.common.*;
import fai.goalsystem.*;
import fai.*;
public class ExtraGoal extends Goal {
private var engine:Engine;// = null
private var unloading:Boolean;// = false
private var loading:Boolean;// = false
private var free_seat_pos:int;// = 0
private var extra:ExtraItem;// = null
private var move_goal:MoveSimpleGoal;// = null
private var extra_steps:int;// = 0
private var init_scale:Number;// = 0
private var road_move_goal:MoveCustomerGoal;// = null
private var target_pos:Position;// = null
private var buyer:Customer;// = null
private var counter:int;// = 0
public function ExtraGoal(_arg1:Engine, _arg2:Customer, _arg3:MoveCustomerGoal, _arg4:ExtraItem):void{
engine = null;
buyer = null;
extra = null;
target_pos = null;
loading = false;
unloading = false;
extra_steps = 0;
counter = 0;
free_seat_pos = 0;
road_move_goal = null;
move_goal = null;
init_scale = 0;
super();
engine = _arg1;
buyer = _arg2;
extra = _arg4;
init_scale = buyer.character.scaleX;
free_seat_pos = extra.loadCustomer(_arg2);
if (-1 == free_seat_pos){
deactivate();
return;
};
extra_steps = DataProxy.getExtraCounterSteps(_arg4.currentState);
road_move_goal = _arg3;
move_goal = new MoveSimpleGoal(engine, buyer);
setTargetPos();
loading = true;
}
private function unload():void{
target_pos = road_move_goal.anyNextNodePos();
buyer.suit.visible = true;
loading = false;
unloading = true;
extra.unloadCustomer(buyer);
buyer.character.scaleX = init_scale;
if (!buyer.check_zindex){
engine.playWindow.ui.removeChild(buyer.suit);
engine.playWindow.ui.customers.addChild(buyer.suit);
buyer.check_zindex = true;
};
move_goal = new MoveSimpleGoal(engine, buyer);
move_goal.moveTo(target_pos);
}
public function advance():void{
if (((((!(unloading)) && (extra))) && ((extra.currentState == StringConsts.empty)))){
if ((((counter > 0)) || (loading))){
counter = 0;
loading = false;
move_goal.deactivate();
unload();
};
return;
};
if (counter > 0){
counter--;
if (counter == 0){
if (extra.currentState == StringConsts.news_box){
dropCoins();
engine.payMoney(-(Consts.NewspaperCost));
} else {
if (extra.currentState == StringConsts.ice_cream){
dropCoins();
engine.payMoney(-(Consts.IcecreamCost));
};
};
unload();
};
return;
};
if (loading){
go();
return;
};
if (unloading){
go();
return;
};
}
private function setTargetPos():void{
var _local1:int;
var _local2:int;
_local1 = 0;
_local2 = 0;
switch (extra.currentState){
case StringConsts.bench:
if (extra.vice_versa){
_local1 = (extra.x - 41);
_local2 = (extra.y + 28);
target_pos = new Position((_local1 + (5 * free_seat_pos)), (_local2 - (3 * free_seat_pos)));
} else {
_local1 = (extra.x + 25);
_local2 = (extra.y + 15);
target_pos = new Position((_local1 + (5 * free_seat_pos)), (_local2 + (3 * free_seat_pos)));
};
break;
case StringConsts.news_box:
case StringConsts.ice_cream:
if (extra.vice_versa){
_local1 = (extra.x - 55);
_local2 = (extra.y + 27);
target_pos = new Position((_local1 + (6 * free_seat_pos)), (_local2 - (5 * free_seat_pos)));
} else {
_local1 = (extra.x + 20);
_local2 = extra.y;
target_pos = new Position((_local1 + (5 * free_seat_pos)), (_local2 + (5 * free_seat_pos)));
};
break;
};
move_goal.moveTo(target_pos);
}
private function go():void{
if (move_goal.active){
move_goal.advance();
} else {
if (unloading){
buyer.addExtra(extra);
deactivate();
};
if (loading){
loadAnimation();
counter = extra_steps;
};
loading = false;
unloading = false;
};
}
private function dropCoins():void{
engine.goal_system.add(new CoinGoal(engine, extra));
}
override public function deactivate():void{
extra = null;
super.deactivate();
}
private function loadAnimation():void{
switch (extra.currentState){
case StringConsts.bench:
buyer.character.gotoAndPlay("sitting");
break;
case StringConsts.news_box:
buyer.character.gotoAndPlay("reading");
break;
case StringConsts.ice_cream:
buyer.character.gotoAndPlay("eating");
break;
};
if (!extra.vice_versa){
buyer.character.scaleX = (-1 * init_scale);
};
}
}
}//package fai.goals
Section 105
//Goal (fai.goals.Goal)
package fai.goals {
public class Goal {
public var priority:int;// = 100
public var active:Boolean;// = true
public function Goal(){
active = true;
priority = 100;
super();
}
public function deactivate():void{
active = false;
}
}
}//package fai.goals
Section 106
//MoveCustomerGoal (fai.goals.MoveCustomerGoal)
package fai.goals {
import fai.logic.*;
import fai.ui.*;
import fai.common.*;
public class MoveCustomerGoal extends Goal {
protected var engine:Engine;// = null
protected var node:RoadPoint;// = null
protected var dx:Number;// = 0
protected var dy:Number;// = 0
protected var road:RoadPath;// = null
protected var road_enum:RoadGraph;// = null
protected var steps:Number;// = 0
protected var buyer:Customer;// = null
protected var simple_move:MoveSimpleGoal;// = null
public function MoveCustomerGoal(_arg1:Engine, _arg2:Customer, _arg3:RoadPath):void{
engine = null;
buyer = null;
road = null;
steps = 0;
dx = 0;
dy = 0;
road_enum = null;
node = null;
simple_move = null;
super();
engine = _arg1;
buyer = _arg2;
road = _arg3;
gotoNext();
}
public function advance():void{
if (simple_move){
simple_move.advance();
if (!simple_move.active){
simple_move = null;
gotoNext();
};
};
}
public function reset():void{
simple_move.deactivate();
simple_move = null;
gotoNext();
advance();
}
public function anyNextNodePos():Position{
var _local1:RoadPoint;
_local1 = road_enum.lookAnyNext();
return (new Position((road.x + _local1.x), (road.y + _local1.y)));
}
protected function gotoNext():void{
var _local1:RoadPoint;
if (!road_enum){
road_enum = new RoadGraph(road);
_local1 = road_enum.getFirst();
buyer.setX((road.x + _local1.x));
buyer.setY((road.y + _local1.y));
};
node = road_enum.getNext();
if (node){
simple_move = new MoveSimpleGoal(engine, buyer);
simple_move.moveToXY((road.x + node.x), (road.y + node.y));
} else {
deactivate();
};
}
}
}//package fai.goals
Section 107
//MoveDeliveryGoal (fai.goals.MoveDeliveryGoal)
package fai.goals {
import fai.logic.*;
import fai.ui.*;
import flash.display.*;
import flash.filters.*;
import fai.common.*;
import fai.goalsystem.*;
import fai.*;
public class MoveDeliveryGoal extends MoveCustomerGoal {
private var man;// = null
private var delivery_shop:ShopItem;// = null
public function MoveDeliveryGoal(_arg1:Engine, _arg2:ShopItem):void{
var _local3:RoadPath;
var _local4:BitmapFilter;
var _local5:Array;
man = null;
delivery_shop = null;
delivery_shop = _arg2;
_local3 = delivery_shop.delivery_road;
if (delivery_shop.shopType == StringConsts.american){
man = new DeliveryAmerican();
} else {
man = new DeliverySushi();
};
man.scaleY = (man.scaleX = 0.65);
buyer = new Customer();
buyer.suit = new Sprite();
buyer.suit.addChild(man);
buyer.character = man;
buyer.velocity = 5;
buyer.setEngine(_arg1);
buyer.setRoad(_local3);
_local4 = DataProxy.getShadowFilter();
_local5 = new Array();
_local5.push(_local4);
buyer.suit.filters = _local5;
_arg1.playWindow.customersHolder.addChild(buyer.suit);
buyer.parent_dc = _arg1.playWindow.customersHolder;
super(_arg1, buyer, _local3);
}
public function get customerInstance():Customer{
return (buyer);
}
protected function receiveMoney():void{
if (delivery_shop.resto.enemy_restaurant){
GameStage.welcomeScreen.engineInstance.payEnemyMoney((1.5 * DataProxy.getCustomerInitialMoney(GameStage.welcomeScreen.engineInstance.scenario.currentDay)));
} else {
GameStage.welcomeScreen.engineInstance.payMoney((-1.5 * DataProxy.getCustomerInitialMoney(GameStage.welcomeScreen.engineInstance.scenario.currentDay)));
};
engine.goal_system.add(new CoinGoal(engine, buyer));
}
override public function deactivate():void{
super.deactivate();
if (buyer){
buyer.parent_dc.removeChild(buyer.suit);
buyer = null;
};
}
override protected function gotoNext():void{
var _local1:RoadPoint;
if (!road_enum){
road_enum = new RoadGraph(road);
_local1 = road_enum.getFirst();
buyer.setX((road.x + _local1.x));
buyer.setY((road.y + _local1.y));
};
if (node){
if (node.scaleX > 1.1){
receiveMoney();
};
};
node = road_enum.getNext();
if (node){
simple_move = new MoveSimpleGoal(engine, buyer);
simple_move.moveToXY((road.x + node.x), (road.y + node.y));
} else {
deactivate();
};
}
}
}//package fai.goals
Section 108
//MoveSimpleGoal (fai.goals.MoveSimpleGoal)
package fai.goals {
import fai.logic.*;
import fai.ui.*;
import fai.common.*;
import fai.goalsystem.*;
import fai.*;
public class MoveSimpleGoal extends Goal {
private var engine:Engine;// = null
private var steps:Number;// = 0
private var target:Position;// = null
private var buyer:Customer;// = null
private var dx:Number;// = 0
private var dy:Number;// = 0
public function MoveSimpleGoal(_arg1:Engine, _arg2:Customer):void{
engine = null;
buyer = null;
steps = 0;
dx = 0;
dy = 0;
target = null;
super();
engine = _arg1;
buyer = _arg2;
}
public function moveToXY(_arg1:int, _arg2:int):void{
var _local3:Number;
var _local4:Number;
var _local5:int;
target = new Position(_arg1, _arg2);
_local3 = (target.x - buyer.getX());
_local4 = (target.y - buyer.getY());
steps = (Math.sqrt(((_local3 * _local3) + (_local4 * _local4))) / buyer.velocity);
_local5 = (-1 * ((Math.atan2(_local4, _local3) / Math.PI) * 180));
setIsoPos(_local5);
dx = (_local3 / steps);
dy = (_local4 / steps);
}
public function advance():void{
if (steps < 1){
buyer.setX((buyer.getX() + (dx * steps)));
buyer.setY((buyer.getY() + (dy * steps)));
steps = 0;
} else {
buyer.setX((buyer.getX() + dx));
buyer.setY((buyer.getY() + dy));
steps--;
};
if (steps <= 0){
deactivate();
};
}
private function setIsoPos(_arg1:int):void{
if ((((_arg1 >= 0)) && ((_arg1 < 90)))){
buyer.character.gotoAndStop("walking_ne");
} else {
if ((((_arg1 >= 90)) && ((_arg1 <= 180)))){
buyer.character.gotoAndStop("walking_nw");
} else {
if ((((_arg1 <= 0)) && ((_arg1 > -90)))){
buyer.character.gotoAndStop("walking_se");
} else {
if ((((_arg1 <= -90)) && ((_arg1 >= -180)))){
buyer.character.gotoAndStop("walking_sw");
};
};
};
};
}
public function moveTo(_arg1:Position):void{
moveToXY(_arg1.x, _arg1.y);
}
}
}//package fai.goals
Section 109
//ParticleGoal (fai.goals.ParticleGoal)
package fai.goals {
import fai.common.*;
public class ParticleGoal extends Goal {
private var odx:Number;// = 0
private var ody:Number;// = 0
private var parent_item;// = null
private var max_steps:Number;// = 0
private var dx:Number;// = 0
private var dy:Number;// = 0
public var velocity:int;// = 10
private var particle;// = null
private var use_alpha:Boolean;// = false
private var steps:Number;// = 0
private var distance:Number;// = 0
private var dest_pos:Position;// = null
public function ParticleGoal(_arg1, _arg2, _arg3:Position, _arg4:Boolean=true, _arg5:int=0):void{
var _local6:Object;
parent_item = null;
dest_pos = null;
dx = 0;
dy = 0;
steps = 0;
velocity = 10;
distance = 0;
odx = 0;
ody = 0;
max_steps = 0;
particle = null;
use_alpha = false;
super();
dest_pos = _arg3;
particle = _arg1;
parent_item = _arg2;
use_alpha = _arg4;
if (_arg5 > 0){
velocity = _arg5;
};
parent_item.addChild(particle);
dx = (dest_pos.x - particle.x);
dy = (dest_pos.y - particle.y);
distance = Math.sqrt(((dx * dx) + (dy * dy)));
steps = (distance / velocity);
_local6 = getNormalOffset(dx, dy, ((Math.random() > 0.5)) ? true : false);
dx = (dx / steps);
dy = (dy / steps);
odx = (((_local6.dx / steps) * Math.random()) / 2);
ody = (((_local6.dy / steps) * Math.random()) / 2);
max_steps = steps;
}
public function advance():void{
var _local1:Number;
if (steps > 0){
_local1 = (((2 * steps) / max_steps) - 1);
if (steps > 1){
particle.x = (particle.x + (dx + (odx * _local1)));
particle.y = (particle.y + (dy + (ody * _local1)));
} else {
particle.x = (particle.x + ((dx + (odx * _local1)) * steps));
particle.y = (particle.y + ((dy + (ody * _local1)) * steps));
};
if (use_alpha){
particle.alpha = (steps / max_steps);
};
steps--;
} else {
deactivate();
};
}
private function getNormalOffset(_arg1:Number, _arg2:Number, _arg3:Boolean):Object{
var _local4:Object;
_local4 = new Object();
if ((((_arg1 <= 0)) && ((_arg2 < 0)))){
if (_arg3){
_local4.dx = _arg2;
_local4.dy = Math.abs(_arg1);
} else {
_local4.dx = Math.abs(_arg2);
_local4.dy = _arg1;
};
} else {
if ((((_arg1 > 0)) && ((_arg2 <= 0)))){
if (_arg3){
_local4.dx = -(Math.abs(_arg2));
_local4.dy = -(Math.abs(_arg1));
} else {
_local4.dx = Math.abs(_arg2);
_local4.dy = Math.abs(_arg1);
};
} else {
if ((((_arg1 >= 0)) && ((_arg2 > 0)))){
if (_arg3){
_local4.dx = Math.abs(_arg2);
_local4.dy = -(Math.abs(_arg1));
} else {
_local4.dx = -(Math.abs(_arg2));
_local4.dy = Math.abs(_arg1);
};
} else {
if ((((_arg1 < 0)) && ((_arg2 >= 0)))){
if (_arg3){
_local4.dx = Math.abs(_arg2);
_local4.dy = Math.abs(_arg1);
} else {
_local4.dx = -(Math.abs(_arg2));
_local4.dy = -(Math.abs(_arg1));
};
};
};
};
};
return (_local4);
}
override public function deactivate():void{
super.deactivate();
parent_item.removeChild(particle);
}
}
}//package fai.goals
Section 110
//SeatsGoal (fai.goals.SeatsGoal)
package fai.goals {
import fai.logic.*;
public class SeatsGoal extends Goal {
private var engine:Engine;// = null
private var loaded:int;// = 0
private var seats:Array;// = null
private var shop:ShopItem;// = null
public function SeatsGoal(_arg1:Engine, _arg2:Array, _arg3:ShopItem):void{
engine = null;
seats = null;
loaded = 0;
shop = null;
super();
engine = _arg1;
seats = _arg2;
shop = _arg3;
}
public function advance():void{
var _local1:ShopSeat;
var _local2:int;
_local1 = null;
_local2 = 0;
_local2 = 0;
while (_local2 < seats.length) {
_local1 = seats[_local2];
if (_local1.loaded){
_local1.percents = (_local1.percents + _local1.velocity);
if (_local1.percents > 100){
unloadSeat(_local1);
};
};
_local2++;
};
}
private function loadSeat(_arg1:ShopSeat):void{
_arg1.loaded = true;
_arg1.percents = 0;
loaded++;
}
private function moneyValue(_arg1:ShopSeat):Number{
return (((_arg1.customer.money > shop.moneyValue)) ? shop.moneyValue : _arg1.customer.money);
}
private function dropCoins():void{
engine.goal_system.add(new CoinGoal(engine, shop));
}
public function get loadedCount():int{
return (loaded);
}
public function loadCustomer(_arg1:Customer):ShopSeat{
var _local2:int;
var _local3:ShopSeat;
if (loaded >= seats.length){
return (null);
};
_local2 = 0;
_local2 = 0;
while (_local2 < seats.length) {
_local3 = seats[_local2];
if (_local3.loaded == false){
loadSeat(_local3);
_local3.customer = _arg1;
_local3.velocity = shop.getShopBuyingTicks();
if (_local3.velocity <= 0){
_local3.velocity = 1;
};
_arg1.buying = true;
return (_local3);
};
_local2++;
};
return (null);
}
public function updateBuyingTicks():void{
var _local1:int;
var _local2:ShopSeat;
_local1 = 0;
_local1 = 0;
while (_local1 < seats.length) {
_local2 = seats[_local1];
_local2.velocity = shop.getShopBuyingTicks();
_local1++;
};
}
override public function deactivate():void{
var _local1:int;
var _local2:ShopSeat;
super.deactivate();
if (loaded > 0){
_local1 = 0;
_local1 = 0;
while (_local1 < seats.length) {
_local2 = seats[_local1];
if (_local2.loaded){
unloadSeat(_local2);
};
_local1++;
};
};
}
private function unloadSeat(_arg1:ShopSeat):void{
var _local2:Number;
var _local3:*;
_arg1.loaded = false;
shop.customerPassed();
_local2 = moneyValue(_arg1);
if (((engine.scenario) && ((engine.scenario.currentDay > 1)))){
};
if (shop.green_steam.visible){
_local2 = (_local2 / 2);
};
_arg1.customer.money = (_arg1.customer.money - _local2);
_arg1.customer.updateMoney();
_arg1.customer.addBuying(shop.shopId);
_arg1.customer.buying = false;
_local3 = _arg1.customer;
_arg1.customer = null;
if (engine.playWindow){
if (engine.playWindow.enemy_restaurants.length > 1){
};
if (shop.shopType != engine.resto_type){
engine.payEnemyMoney(_local2);
} else {
engine.playWindow.stats.served++;
engine.score = (engine.score + (_local2 / 5));
engine.payMoney(-(_local2));
};
engine.playWindow.updateResources();
engine.goal_system.add(new CoinGoal(engine, _local3));
};
loaded--;
}
}
}//package fai.goals
Section 111
//ThiefGoal (fai.goals.ThiefGoal)
package fai.goals {
import fai.logic.*;
public class ThiefGoal extends Goal {
private var engine:Engine;// = null
private var fire_ticks:int;// = 300
private var shop:ShopItem;// = null
public function ThiefGoal(_arg1:Engine, _arg2):void{
engine = null;
shop = null;
fire_ticks = 300;
super();
engine = _arg1;
shop = _arg2;
shop.thief_icon.visible = true;
shop.thief_icon.play();
}
public function advance():void{
if (shop.no_thefts){
hideIcons();
deactivate();
return;
};
if (fire_ticks <= 0){
engine.payMoney((engine.money * (0.3 + (0.3 * Math.random()))));
engine.log("Your restaurant has been robbed.");
shop.shoppable = true;
hideIcons();
deactivate();
return;
};
fire_ticks--;
}
override public function deactivate():void{
super.deactivate();
}
private function hideIcons():void{
shop.thief_icon.visible = false;
shop.thief_icon.stop();
}
}
}//package fai.goals
Section 112
//UpdateStateGoal (fai.goals.UpdateStateGoal)
package fai.goals {
import fai.logic.*;
import fai.ui.*;
import fai.common.*;
import fai.goalsystem.*;
import fai.*;
public class UpdateStateGoal extends Goal {
private var engine:Engine;// = null
private var shop;// = null
private var pause:int;// = 10
public function UpdateStateGoal(_arg1:Engine, _arg2):void{
engine = null;
shop = null;
pause = 10;
super();
engine = _arg1;
shop = _arg2;
if (shop.shopBar){
shop.shopBar.visible = false;
};
}
public function advance():void{
if (pause > 0){
pause--;
} else {
if (shop.shopBar){
shop.shopBar.visible = true;
};
shop.updateState();
deactivate();
};
}
override public function deactivate():void{
super.deactivate();
}
}
}//package fai.goals
Section 113
//UpgradingGoal (fai.goals.UpgradingGoal)
package fai.goals {
import fai.logic.*;
import fai.ui.*;
import fai.common.*;
import fai.goalsystem.*;
import fai.*;
public class UpgradingGoal extends Goal {
private var engine:Engine;// = null
private var max:int;// = 0
private var ticks:int;// = 0
private var save_var_pos:int;// = 0
private var shop_item:ShopItem;// = null
private var current_level:int;// = 0
public function UpgradingGoal(_arg1:Engine, _arg2):void{
engine = null;
shop_item = null;
ticks = 0;
max = 0;
current_level = 0;
save_var_pos = 0;
super();
engine = _arg1;
shop_item = _arg2;
current_level = shop_item.currentLevel;
shop_item.setLevel(Consts.ShopUpgrading);
shop_item.building_bar.visible = true;
max = (ticks = DataProxy.getShopUpgradingTicks(shop_item.shopType, current_level));
}
private function finish():void{
engine.playSound(SoundConsts.build);
shop_item.setLevel((current_level + 1));
shop_item.getShopSprite().play();
shop_item.updateState();
engine.goal_system.add(new UpdateStateGoal(engine, shop_item));
shop_item.reset();
}
public function advance():void{
if (ticks <= 0){
finish();
deactivate();
return;
};
if (shop_item.building_bar){
shop_item.building_bar.bar.scaleX = (1 - (ticks / max));
shop_item.building_bar.percents.text = ((" " + int(((1 - (ticks / max)) * 100))) + "%");
};
ticks--;
}
public function cancel():void{
deactivate();
shop_item.setLevel(current_level);
}
override public function deactivate():void{
super.deactivate();
shop_item.building_bar.visible = false;
shop_item.building_bar.bar.scaleX = 1;
}
}
}//package fai.goals
Section 114
//VParticleEffectGoal (fai.goals.VParticleEffectGoal)
package fai.goals {
import fai.common.*;
import fai.goalsystem.*;
public class VParticleEffectGoal extends Goal {
private var particle_parent;// = null
private var goal_system:GoalSystem;// = null
private var pause:int;// = 0
public function VParticleEffectGoal(_arg1):void{
particle_parent = null;
goal_system = null;
pause = 0;
super();
particle_parent = _arg1;
goal_system = new GoalSystem();
}
public function advance():void{
var _local1:Position;
var _local2:WhiteStar;
var _local3:ParticleGoal;
goal_system.tick();
if (pause > 0){
pause--;
return;
};
_local1 = new Position((20 + ((particle_parent.width / 2) * Math.random())), (0 - (Math.random() * 10)));
_local2 = new WhiteStar();
_local2.x = (20 + ((particle_parent.width / 2) * Math.random()));
_local2.y = (particle_parent.height - 45);
_local3 = new ParticleGoal(_local2, particle_parent, _local1);
goal_system.add(_local3);
}
override public function deactivate():void{
super.deactivate();
goal_system.deactivateAll();
goal_system = null;
particle_parent = null;
}
}
}//package fai.goals
Section 115
//GoalSystem (fai.goalsystem.GoalSystem)
package fai.goalsystem {
import fai.*;
public class GoalSystem {
public var goals:Array;
private var active_count:int;// = 0
private var counter:int;// = 0
public function GoalSystem(){
goals = [];
counter = 0;
active_count = 0;
super();
}
public function add(_arg1):void{
goals.push(_arg1);
}
public function activeCount():int{
return (active_count);
}
public function deactivateAll():void{
var _local1:int;
_local1 = 0;
while (_local1 < goals.length) {
if (goals[_local1].active){
goals[_local1].deactivate();
};
_local1++;
};
goals.length = 0;
}
private function cleanGoals():void{
var _local1:int;
_local1 = 0;
while (_local1 < goals.length) {
if (!goals[_local1].active){
delete goals[_local1];
goals.splice(_local1, 1);
} else {
_local1++;
};
};
}
public function tick():void{
var _local1:uint;
_local1 = 0;
active_count = 0;
while (_local1 < goals.length) {
if (goals[_local1].active){
goals[_local1].advance();
active_count++;
};
_local1++;
};
if (!counter){
cleanGoals();
counter = Consts.GOALSCLEANPAUSE;
} else {
counter--;
};
}
}
}//package fai.goalsystem
Section 116
//AI (fai.logic.AI)
package fai.logic {
import fai.*;
public class AI {
private var engine:Engine;// = null
private var level_number:int;// = 0
private var enemy1:AIHelper;// = null
private var enemy2:AIHelper;// = null
private var current_day:int;// = 0
private var enemy3:AIHelper;// = null
public function AI(_arg1:Engine):void{
engine = null;
level_number = 0;
current_day = 0;
enemy1 = null;
enemy2 = null;
enemy3 = null;
super();
engine = _arg1;
}
public function doAILogic(_arg1:int, _arg2:int):void{
level_number = _arg1;
current_day = _arg2;
switch (level_number){
case 0:
level1AILogic();
break;
case 1:
level2AILogic();
break;
case 2:
level3AILogic();
break;
case 3:
level4AILogic();
break;
case 4:
level5AILogic();
break;
case 5:
level6AILogic();
break;
};
}
private function level5AILogic():void{
var _local1:ShopItem;
var _local2:ShopItem;
_local1 = null;
if (0 == current_day){
enemy1 = new AIHelper(engine, engine.playWindow.enemy_restaurants[0]);
enemy1.skipTick(3);
};
if (17 == current_day){
if (engine.playWindow.for_sale.length > 1){
_local1 = engine.playWindow.for_sale[1];
} else {
if (engine.playWindow.for_sale.length > 0){
_local1 = engine.playWindow.for_sale[0];
};
};
if (_local1){
_local1.startEnemyBuilding();
enemy2 = new AIHelper(engine, _local1);
enemy2.addTicks(5);
enemy2.increaseWorkers();
};
};
if (current_day > 14){
enemy1.nextTick();
};
enemy1.nextTick();
if (19 == current_day){
if (engine.playWindow.for_sale.length > 0){
_local2 = engine.playWindow.for_sale[0];
_local2.startEnemyBuilding();
enemy3 = new AIHelper(engine, _local2);
enemy3.addTicks(5);
enemy3.increaseWorkers();
};
};
if (enemy2){
if (18 == current_day){
enemy2.addTicks(3);
};
if (current_day > 18){
enemy2.nextTick();
};
enemy2.addTicks(2);
};
if (enemy3){
enemy3.addTicks(3);
};
}
private function level4AILogic():void{
var _local1:ShopItem;
var _local2:ShopItem;
_local1 = null;
if (0 == current_day){
enemy1 = new AIHelper(engine, engine.playWindow.enemy_restaurants[0]);
enemy1.skipTick(3);
};
if (19 == current_day){
if (engine.playWindow.for_sale.length > 1){
_local1 = engine.playWindow.for_sale[1];
} else {
if (engine.playWindow.for_sale.length > 0){
_local1 = engine.playWindow.for_sale[0];
};
};
if (_local1){
_local1.startEnemyBuilding();
enemy2 = new AIHelper(engine, _local1);
enemy2.addTicks(4);
enemy2.increaseWorkers();
};
} else {
enemy1.nextTick();
};
if (22 == current_day){
if (engine.playWindow.for_sale.length > 0){
_local2 = engine.playWindow.for_sale[0];
_local2.startEnemyBuilding();
enemy3 = new AIHelper(engine, _local2);
enemy3.addTicks(4);
enemy3.increaseWorkers();
};
};
if (enemy2){
enemy2.addTicks(2);
};
if (enemy3){
enemy3.addTicks(1);
};
if ((((current_day > 9)) && ((current_day < 14)))){
};
}
private function level3AILogic():void{
var _local1:ShopItem;
_local1 = null;
if (0 == current_day){
enemy1 = new AIHelper(engine, engine.playWindow.enemy_restaurants[0]);
enemy1.skipTick(3);
};
enemy1.nextTick();
if (enemy2){
if (current_day < 16){
enemy2.addTicks(1);
};
enemy2.nextTick();
};
if (enemy3){
enemy3.addTicks(2);
};
if ((((current_day > 9)) && ((current_day < 14)))){
};
}
private function level1AILogic():void{
if (!enemy1){
switch (current_day){
case 1:
engine.playWindow.for_sale[0].startEnemyBuilding();
enemy1 = new AIHelper(engine, engine.playWindow.enemy_restaurants[0]);
enemy1.skipTick(3);
engine.log("You got a competitor!");
break;
};
} else {
enemy1.nextTick();
};
}
private function level2AILogic():void{
if (0 == current_day){
enemy1 = new AIHelper(engine, engine.playWindow.enemy_restaurants[0]);
enemy1.skipTick(3);
enemy1.skipTick(4);
};
enemy1.nextTick();
if (current_day > 11){
enemy1.addTicks(2);
};
}
private function level6AILogic():void{
var _local1:ShopItem;
var _local2:ShopItem;
_local1 = null;
if (0 == current_day){
enemy1 = new AIHelper(engine, engine.playWindow.enemy_restaurants[0]);
enemy1.skipTick(3);
};
if (16 == current_day){
if (engine.playWindow.for_sale.length > 1){
_local1 = engine.playWindow.for_sale[1];
} else {
if (engine.playWindow.for_sale.length > 0){
_local1 = engine.playWindow.for_sale[0];
};
};
if (_local1){
_local1.startEnemyBuilding();
enemy2 = new AIHelper(engine, _local1);
enemy2.addTicks(6);
enemy2.increaseWorkers();
};
};
if (current_day > 14){
enemy1.nextTick();
};
if (current_day == 18){
enemy1.nextTick();
};
enemy1.nextTick();
if (19 == current_day){
if (engine.playWindow.for_sale.length > 0){
_local2 = engine.playWindow.for_sale[0];
_local2.startEnemyBuilding();
enemy3 = new AIHelper(engine, _local2);
enemy3.addTicks(5);
enemy3.increaseWorkers();
};
};
if (enemy2){
if (18 == current_day){
enemy2.addTicks(3);
};
if (current_day > 18){
enemy2.nextTick();
};
enemy2.addTicks(2);
};
if (enemy3){
enemy3.addTicks(3);
};
}
}
}//package fai.logic
Section 117
//AIHelper (fai.logic.AIHelper)
package fai.logic {
import fai.*;
public class AIHelper {
private var engine:Engine;// = null
private var skips:Array;
private var ticks:int;// = 0
private var resto;// = null
public function AIHelper(_arg1:Engine, _arg2):void{
engine = null;
ticks = 0;
resto = null;
skips = [6];
super();
engine = _arg1;
resto = _arg2;
}
private function doTickActions():void{
var _local1:*;
_local1 = null;
switch (ticks){
case 0:
_local1 = resto.resto.getUpgrade(StringConsts.ads1);
_local1.execute();
break;
case 1:
_local1 = resto.resto.getUpgrade(StringConsts.ads2);
resto.increaseWorkersCount();
_local1.execute();
break;
case 2:
if (StringConsts.sushi == engine.resto_type){
_local1 = resto.resto.getUpgrade(StringConsts.ads3_american);
_local1.execute();
} else {
_local1 = resto.resto.getUpgrade(StringConsts.ads3_sushi);
_local1.execute();
};
break;
case 3:
_local1 = resto.resto.getUpgrade(StringConsts.ads4);
_local1.execute();
break;
case 4:
resto.increaseWorkersCount();
break;
case 5:
if (StringConsts.sushi == engine.resto_type){
_local1 = resto.resto.getUpgrade(StringConsts.ads5_american);
_local1.execute();
} else {
_local1 = resto.resto.getUpgrade(StringConsts.ads5_sushi);
_local1.execute();
};
break;
case 6:
if (StringConsts.sushi == engine.resto_type){
_local1 = resto.resto.getUpgrade(StringConsts.decor1_american);
_local1.execute();
} else {
_local1 = resto.resto.getUpgrade(StringConsts.decor1_sushi);
_local1.execute();
};
resto.increaseWorkersCount();
break;
case 7:
if (StringConsts.sushi == engine.resto_type){
_local1 = resto.resto.getUpgrade(StringConsts.decor2_american);
_local1.execute();
} else {
_local1 = resto.resto.getUpgrade(StringConsts.decor2_sushi);
_local1.execute();
};
break;
case 8:
if (StringConsts.sushi == engine.resto_type){
_local1 = resto.resto.getUpgrade(StringConsts.decor3_american);
_local1.execute();
} else {
_local1 = resto.resto.getUpgrade(StringConsts.decor3_sushi);
_local1.execute();
};
break;
case 9:
if (StringConsts.sushi == engine.resto_type){
_local1 = resto.resto.getUpgrade(StringConsts.decor4_american);
_local1.execute();
} else {
_local1 = resto.resto.getUpgrade(StringConsts.decor4_sushi);
_local1.execute();
};
break;
case 10:
if (StringConsts.sushi == engine.resto_type){
_local1 = resto.resto.getUpgrade(StringConsts.decor5_american);
_local1.execute();
} else {
_local1 = resto.resto.getUpgrade(StringConsts.decor5_sushi);
_local1.execute();
};
resto.increaseWorkersCount();
break;
case 11:
if (StringConsts.sushi == engine.resto_type){
_local1 = resto.resto.getUpgrade(StringConsts.decor6_american);
_local1.execute();
} else {
_local1 = resto.resto.getUpgrade(StringConsts.decor6_sushi);
_local1.execute();
};
resto.increaseWorkersCount();
break;
case 12:
if (StringConsts.sushi == engine.resto_type){
_local1 = resto.resto.getUpgrade(StringConsts.decor7_american);
_local1.execute();
} else {
_local1 = resto.resto.getUpgrade(StringConsts.decor7_sushi);
_local1.execute();
};
resto.increaseWorkersCount();
break;
case 13:
if (StringConsts.sushi == engine.resto_type){
_local1 = resto.resto.getUpgrade(StringConsts.country_menu);
_local1.execute();
} else {
_local1 = resto.resto.getUpgrade(StringConsts.eastern_sweeties);
_local1.execute();
};
resto.increaseWorkersCount();
break;
case 14:
if (StringConsts.sushi == engine.resto_type){
_local1 = resto.resto.getUpgrade(StringConsts.tv_hall);
increaseWorkers();
_local1.execute();
} else {
_local1 = resto.resto.getUpgrade(StringConsts.hot_cheese_rolls);
_local1.execute();
};
break;
case 15:
if (StringConsts.sushi == engine.resto_type){
_local1 = resto.resto.getUpgrade(StringConsts.pizza_production_str);
_local1.execute();
} else {
_local1 = resto.resto.getUpgrade(StringConsts.cheap_sushi_menu);
_local1.execute();
};
resto.increaseWorkersCount();
break;
case 16:
if (StringConsts.sushi == engine.resto_type){
_local1 = resto.resto.getUpgrade(StringConsts.king_burgers_str);
_local1.execute();
_local1 = resto.resto.getUpgrade(StringConsts.luxury_pizza_str);
_local1.execute();
increaseWorkers();
} else {
_local1 = resto.resto.getUpgrade(StringConsts.sushi_discounts);
_local1.execute();
};
resto.increaseWorkersCount();
break;
case 17:
_local1 = resto.resto.getUpgrade(StringConsts.security_system);
_local1.execute();
resto.increaseWorkersCount();
break;
case 18:
if (engine.lastLevel.number >= 4){
if (StringConsts.sushi == engine.resto_type){
_local1 = resto.resto.getUpgrade(StringConsts.american_delivery);
_local1.execute();
} else {
_local1 = resto.resto.getUpgrade(StringConsts.sushi_delivery);
_local1.execute();
};
};
break;
case 19:
if (StringConsts.sushi == engine.resto_type){
_local1 = resto.resto.getUpgrade(StringConsts.american_summer_seats);
_local1.execute();
} else {
_local1 = resto.resto.getUpgrade(StringConsts.sushi_summer_seats);
_local1.execute();
};
increaseWorkers();
break;
case 20:
if (StringConsts.sushi == engine.resto_type){
_local1 = resto.resto.getUpgrade(StringConsts.underground_bar_american);
_local1.execute();
} else {
_local1 = resto.resto.getUpgrade(StringConsts.underground_bar_sushi);
_local1.execute();
};
increaseWorkers();
increaseWorkers();
break;
case 21:
_local1 = resto.resto.getUpgrade(StringConsts.sale_campaigns);
_local1.execute();
resto.increaseWorkersCount();
break;
case 22:
if (StringConsts.sushi == engine.resto_type){
_local1 = resto.resto.getUpgrade(StringConsts.american_second_floor);
_local1.execute();
} else {
_local1 = resto.resto.getUpgrade(StringConsts.sushi_second_floor);
_local1.execute();
_local1 = resto.resto.getUpgrade(StringConsts.karaoke);
_local1.execute();
};
increaseWorkers();
break;
case 23:
if (StringConsts.sushi == engine.resto_type){
_local1 = resto.resto.getUpgrade(StringConsts.receptionist_american);
_local1.execute();
} else {
_local1 = resto.resto.getUpgrade(StringConsts.receptionist_sushi);
_local1.execute();
};
increaseWorkers();
break;
case 25:
if (StringConsts.sushi == engine.resto_type){
_local1 = resto.resto.getUpgrade(StringConsts.american_third_floor);
_local1.execute();
} else {
_local1 = resto.resto.getUpgrade(StringConsts.sushi_third_floor);
_local1.execute();
};
increaseWorkers();
increaseWorkers();
increaseWorkers();
increaseWorkers();
break;
};
}
public function nextTick():void{
var _local1:int;
_local1 = 0;
_local1 = 0;
while (_local1 < skips.length) {
if (skips[_local1] == ticks){
skips.splice(_local1, 1);
return;
};
_local1++;
};
doTickActions();
ticks++;
}
public function addTicks(_arg1:int):void{
var _local2:int;
_local2 = 0;
_local2 = 0;
while (_local2 < _arg1) {
nextTick();
_local2++;
};
}
public function setResto(_arg1):void{
resto = _arg1;
}
public function increaseWorkers():void{
resto.increaseWorkersCount();
}
public function skipTick(_arg1:int):void{
skips.push(_arg1);
}
}
}//package fai.logic
Section 118
//Buttons (fai.logic.Buttons)
package fai.logic {
import flash.events.*;
import fai.ui.*;
import fai.*;
public class Buttons {
private var buttons:Array;
private var engine:Engine;// = null
private var extras:Array;
public var extras_grey:Array;
public function Buttons(_arg1:Engine):void{
engine = null;
buttons = [];
extras = [];
extras_grey = [];
super();
engine = _arg1;
}
public function buildButtonPressed():void{
}
private function updateExtras():void{
var _local1:Boolean;
var _local2:int;
var _local3:ExtraItem;
if (!engine.upgrades){
return;
};
_local1 = true;
_local2 = 0;
_local2 = 0;
while (_local2 < engine.extras.size()) {
_local3 = engine.extras.getItem(_local2);
if ((((_local3.currentState == StringConsts.empty)) || (_local3.isAwaiting))){
_local1 = false;
break;
};
_local2++;
};
if (_local1){
engine.ui.extra_buttons.news_box.visible = false;
engine.ui.extra_buttons.benches.visible = false;
engine.ui.extra_buttons.ice_cream.visible = false;
} else {
engine.ui.extra_buttons.news_box.visible = (engine.playerMoney >= DataProxy.getExtraBuildCost(StringConsts.news_box));
engine.ui.extra_buttons.benches.visible = (engine.playerMoney >= DataProxy.getExtraBuildCost(StringConsts.bench));
engine.ui.extra_buttons.ice_cream.visible = (engine.playerMoney >= DataProxy.getExtraBuildCost(StringConsts.ice_cream));
};
engine.extras.update();
}
public function getExtraItem(_arg1:int){
return (extras[_arg1]);
}
public function update():void{
var _local1:*;
var _local2:int;
var _local3:*;
updateExtras();
_local1 = null;
_local2 = 0;
_local2 = 0;
while (_local2 < buttons.length) {
_local1 = buttons[_local2];
if (((!(_local1)) || (!(_local1.assigned)))){
_local1.icon_holder.gotoAndStop((_local1.buttonType + "1"));
};
_local2++;
};
_local3 = null;
if (engine.shops.buildingType != ""){
if (engine.shops.awaitBuilding()){
_local3 = getButtonByType(engine.shops.buildingType);
if (_local3){
_local3.gotoAndStop("cancel_action");
_local3.icon_holder.visible = false;
};
};
};
_local2 = 0;
while (_local2 < buttons.length) {
_local1 = buttons[_local2];
if (_local3 != _local1){
updateButtonState(_local1, _local1.assigned);
};
_local2++;
};
}
public function addItem(_arg1):void{
switch (_arg1){
case engine.ui.extra_buttons.benches:
case engine.ui.extra_buttons.news_box:
case engine.ui.extra_buttons.ice_cream:
extras.push(_arg1);
return;
case engine.ui.extra_buttons.benches_grey:
case engine.ui.extra_buttons.news_box_grey:
case engine.ui.extra_buttons.ice_cream_grey:
extras_grey.push(_arg1);
return;
};
_arg1.setEngine(engine);
buttons.push(_arg1);
_arg1.gotoAndStop("enabled");
_arg1.buttonMode = true;
_arg1.icon_holder.visible = true;
_arg1.visible = false;
}
public function hideBuildButtons():void{
}
private function updateButtonCost(_arg1):void{
var _local2:Boolean;
_local2 = true;
_local2 = (DataProxy.getBuildCost(_arg1.buttonType, 0) <= engine.playerMoney);
if (!_local2){
_arg1.gotoAndStop("disabled");
};
}
public function getItem(_arg1:int){
return (buttons[_arg1]);
}
public function size():int{
return (buttons.length);
}
public function getItemByType(_arg1:String){
var _local2:int;
_local2 = 0;
_local2 = 0;
while (_local2 < buttons.length) {
if (buttons[_local2].buttonType == _arg1){
return (buttons[_local2]);
};
_local2++;
};
return (null);
}
public function extraSize():int{
return (extras.length);
}
public function getButtonByType(_arg1:String){
return (null);
}
public function destroy():void{
}
private function updateButtonState(_arg1, _arg2:ShopItem):void{
if (_arg2){
if (_arg2.awaitsBuilding){
_arg1.gotoAndStop("cancel_action");
_arg1.icon_holder.visible = false;
return;
};
if (_arg2.currentLevel == 0){
_arg1.gotoAndStop("enabled");
_arg1.icon_holder.visible = true;
updateButtonCost(_arg1);
return;
};
switch (_arg2.currentLevel){
case Consts.ShopBuilding:
case Consts.ShopUpgrading:
_arg1.gotoAndStop("cancel_action");
_arg1.icon_holder.visible = false;
break;
case Consts.ShopLevel1:
case Consts.ShopLevel2:
_arg1.gotoAndStop("enabled");
_arg1.icon_holder.visible = true;
updateButtonCost(_arg1);
break;
case Consts.ShopLevel3:
_arg1.gotoAndStop("done");
_arg1.icon_holder.visible = true;
updateButtonCost(_arg1);
break;
};
} else {
_arg1.gotoAndStop("enabled");
_arg1.icon_holder.visible = true;
updateButtonCost(_arg1);
};
}
}
}//package fai.logic
Section 119
//Customer (fai.logic.Customer)
package fai.logic {
import fai.ui.*;
import flash.display.*;
import fai.common.*;
import fai.*;
public class Customer {
public var money:Number;// = 0
private var engine:Engine;// = null
public var initial_money:Number;// = 0
public var suit:Sprite;// = null
private var buyings:Array;
private var init_scale:Number;// = 0
public var buying:Boolean;// = false
public var velocity:Number;// = 2
public var customer_money:CustomerMoney;// = null
public var road:RoadPath;// = null
private var extras:Array;
public var was_in_mine:Boolean;// = false
public var character;// = null
public var check_zindex:Boolean;// = true
public var parent_dc;// = null
public var shop;// = null
public function Customer():void{
engine = null;
money = 0;
initial_money = 0;
suit = null;
velocity = 2;
customer_money = null;
character = null;
buying = false;
buyings = [];
extras = [];
init_scale = 0;
check_zindex = true;
parent_dc = null;
was_in_mine = false;
road = null;
shop = null;
super();
}
public function getY():Number{
if (parent_dc == engine.playWindow.levelBack){
return (suit.y);
};
return ((parent_dc.y + suit.y));
}
public function getX():Number{
if (parent_dc == engine.playWindow.levelBack){
return (suit.x);
};
return ((parent_dc.x + suit.x));
}
public function setEngine(_arg1:Engine):void{
engine = _arg1;
}
public function setX(_arg1:Number):void{
if (parent_dc == engine.playWindow.levelBack){
suit.x = _arg1;
} else {
suit.x = -((parent_dc.x - _arg1));
};
}
public function init(_arg1:Number):void{
initial_money = (money = _arg1);
init_scale = customer_money.bar.bar.scaleX;
}
public function addExtra(_arg1:ExtraItem):void{
extras.push([_arg1.currentState, 0]);
}
public function extraTicks():void{
var _local1:int;
var _local2:int;
_local1 = 0;
while (_local1 < extras.length) {
_local2 = extras[_local1][1];
_local2++;
if (_local2 > Consts.ExtraLiveTime){
extras.splice(_local1, 1);
} else {
extras[_local1][1] = _local2;
_local1++;
};
};
}
public function updateMoney():void{
if (money > 0){
customer_money.gotoAndStop("money_label");
} else {
customer_money.gotoAndStop("happy_face");
customer_money.bar.visible = false;
};
customer_money.bar.bar.scaleX = (init_scale * (money / initial_money));
}
public function setRoad(_arg1:RoadPath):void{
road = _arg1;
}
public function hasBuyings(_arg1):Boolean{
var _local2:int;
_local2 = 0;
_local2 = 0;
while (_local2 < buyings.length) {
if (buyings[_local2] == _arg1){
return (true);
};
_local2++;
};
return (false);
}
public function extraUsed(_arg1:ExtraItem):Boolean{
var _local2:int;
_local2 = 0;
_local2 = 0;
while (_local2 < extras.length) {
if (extras[_local2][0] == _arg1.currentState){
return (true);
};
_local2++;
};
return (false);
}
public function setY(_arg1:Number):void{
if (parent_dc == engine.playWindow.levelBack){
suit.y = _arg1;
} else {
suit.y = -((parent_dc.y - _arg1));
};
}
public function addBuying(_arg1):void{
buyings.push(_arg1);
}
}
}//package fai.logic
Section 120
//Customers (fai.logic.Customers)
package fai.logic {
public class Customers {
private var engine:Engine;// = null
private var people:Array;
public function Customers(_arg1:Engine):void{
engine = null;
people = [];
super();
engine = _arg1;
}
public function size():int{
return (people.length);
}
public function getItem(_arg1:int):Customer{
return (people[_arg1]);
}
public function remove(_arg1:Customer):void{
var _local2:int;
_local2 = 0;
_local2 = 0;
while (_local2 < people.length) {
if (people[_local2] == _arg1){
delete people[_local2];
people.splice(_local2, 1);
return;
};
_local2++;
};
}
public function add(_arg1:Customer):void{
people.push(_arg1);
}
public function destroy():void{
if (people){
people.length = 0;
people = null;
};
}
}
}//package fai.logic
Section 121
//DataProxy (fai.logic.DataProxy)
package fai.logic {
import fai.ui.*;
import flash.display.*;
import flash.filters.*;
import fai.common.*;
import game.restaurant.*;
import fai.*;
public class DataProxy {
private var levels:Array;
public function DataProxy():void{
var _local1:Level;
levels = [];
super();
_local1 = new Level(StringConsts.level1);
addLevel(_local1);
_local1 = new Level(StringConsts.level2);
addLevel(_local1);
_local1 = new Level(StringConsts.level3);
addLevel(_local1);
_local1 = new Level(StringConsts.level4);
addLevel(_local1);
_local1 = new Level(StringConsts.level5);
addLevel(_local1);
_local1 = new Level(StringConsts.level6);
addLevel(_local1);
}
public function getLevels():Array{
return (levels);
}
private function addLevel(_arg1:Level):void{
_arg1.number = levels.length;
levels.push(_arg1);
}
public function getLevel(_arg1:int):Level{
return (levels[_arg1]);
}
public static function getExtraBuildCost(_arg1:String):int{
switch (_arg1){
case StringConsts.bench:
return (100);
case StringConsts.news_box:
return (200);
case StringConsts.ice_cream:
return (300);
};
return (0);
}
public static function getIconLabel(_arg1:ShopItem):String{
switch (_arg1.currentLevel){
case 0:
return ((_arg1.shopType + "1"));
case Consts.ShopLevel1:
return ((_arg1.shopType + "2"));
case Consts.ShopLevel2:
return ((_arg1.shopType + "3"));
case Consts.ShopLevel3:
return ((_arg1.shopType + "3"));
};
return ("");
}
public static function createShopBuilding(_arg1:ShopItem){
var _local2:*;
var _local3:ShopBuilding;
_local2 = _arg1.resto;
_local3 = new ShopBuilding(_arg1, _local2);
_local3.stop();
return (_local3);
}
public static function getShopUpgradingTicks(_arg1:String, _arg2:int):int{
return (50);
}
public static function getBuildCost(_arg1:String, _arg2:int):int{
var _local3:int;
_local3 = 100;
return (_local3);
}
public static function getGoodsCost(_arg1:String, _arg2:int):int{
return (50);
}
public static function getShadowFilter():BitmapFilter{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Boolean;
var _local9:Boolean;
var _local10:Number;
_local1 = 0;
_local2 = 45;
_local3 = 1;
_local4 = 1;
_local5 = 1;
_local6 = 1;
_local7 = 0.65;
_local8 = false;
_local9 = false;
_local10 = BitmapFilterQuality.LOW;
return (new DropShadowFilter(_local6, _local2, _local1, _local3, _local4, _local5, _local7, _local10, _local8, _local9));
}
public static function getCustomerInitialMoney(_arg1:int):Number{
switch ((_arg1 - 1)){
case 0:
return (10);
case 1:
return (11.5);
case 2:
return (13.5);
case 3:
return (13.5);
case 4:
return (13.5);
case 5:
return (16);
case 6:
return (19);
case 7:
return (23);
case 8:
return (28);
case 9:
return (34.5);
case 10:
return (35.5);
case 11:
return (44);
case 12:
return (44);
case 13:
return (52);
case 14:
return (59);
case 15:
return (67.5);
case 16:
return (75.5);
case 17:
return (84.5);
case 18:
return (94.5);
case 19:
return (102);
case 20:
return (122);
case 21:
return (140);
case 22:
return (147.5);
case 23:
return (155);
case 24:
return (155);
case 25:
return (159);
};
return (164);
}
public static function getBuyerCount(_arg1:int):int{
var _local2:int;
_local2 = 2;
switch ((_arg1 - 1)){
case 0:
return (5);
case 1:
return (10);
case 2:
return (10);
case 3:
return (15);
case 4:
return (18);
case 5:
return (20);
case 6:
return (23);
};
return (25);
}
public static function getCustomer(_arg1:int):Customer{
var _local2:Customer;
var _local3:*;
var _local4:int;
var _local5:Number;
var _local6:BitmapFilter;
var _local7:Array;
var _local8:CustomerMoney;
_local2 = null;
_local3 = null;
_local4 = (Math.random() * 10.1);
_local5 = 0.5;
switch (_local4){
case 0:
_local3 = new Customer1();
break;
case 1:
_local3 = new Customer2();
break;
case 2:
_local3 = new Customer3();
break;
case 3:
_local3 = new Customer4();
break;
case 4:
_local3 = new Customer5();
break;
case 5:
_local3 = new Customer6();
break;
case 6:
_local3 = new Customer7();
break;
case 7:
_local3 = new Customer8();
break;
case 8:
_local3 = new Customer9();
break;
case 9:
_local3 = new Customer10();
break;
};
if (!_local3){
_local3 = new Customer1();
};
_local3.scaleY = (_local3.scaleX = _local5);
_local2 = new Customer();
_local2.suit = new Sprite();
_local2.suit.addChild(_local3);
_local2.character = _local3;
_local2.velocity = (2.5 + (Math.random() / 2));
_local6 = getShadowFilter();
_local7 = new Array();
_local7.push(_local6);
_local2.suit.filters = _local7;
_local8 = new CustomerMoney();
_local8.x = -15;
_local8.y = (_local2.character.y - 25);
_local2.suit.addChild(_local8);
_local2.customer_money = _local8;
_local2.init(getCustomerInitialMoney(_arg1));
_local2.updateMoney();
return (_local2);
}
public static function showTooltip(_arg1:Engine, _arg2:ShopButton):void{
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:Boolean;
var _local7:String;
_local3 = 0;
_local4 = 0;
_local5 = 0;
_local6 = false;
_arg1.playWindow.ui.shop_tooltip.title_txt.text = _arg2.buttonType;
_local3 = getBuildCost(_arg2.buttonType, 0);
_local4 = getSeatsCount(_arg2.buttonType, 0);
_local5 = getGoodsCost(_arg2.buttonType, 0);
if (!_local6){
_local7 = (("Build Cost: <b><font color=\"#ffffff\" size=\"14\">" + _local3.toString()) + "$</font></b>");
if (_local4 > 0){
_local7 = (_local7 + (("\n<font color=\"#ffffff\">Capacity:</font> <b><font color=\"#00ff00\" size=\"14\">" + _local4.toString()) + "</font></b>"));
};
if (_local5 > 0){
_local7 = (_local7 + (("\n<font color=\"#FFffff\">Goods Cost:</font> <b><font color=\"#FFCC00\" size=\"14\">" + _local5.toString()) + "$</font></b>"));
};
_arg1.playWindow.ui.shop_tooltip.params_txt.text = _local7;
} else {
_arg1.playWindow.ui.shop_tooltip.params_txt.text = "Maximum upgrade level had reached.";
};
}
public static function getShopBuildingTicks(_arg1:String):int{
return (50);
}
public static function getSeatsCount(_arg1:String, _arg2:int):int{
return (8);
}
public static function getLevelBackground(_arg1:int){
switch (_arg1){
case 0:
return (new LevelBack1());
case 1:
return (new LevelBack2());
case 2:
return (new LevelBack3());
case 3:
return (new LevelBack4());
case 4:
return (new LevelBack5());
case 5:
return (new LevelBack6());
};
return (new LevelBack1());
}
public static function getExtraCounterSteps(_arg1:String):int{
switch (_arg1){
case StringConsts.bench:
return (100);
case StringConsts.news_box:
return (200);
case StringConsts.ice_cream:
return (150);
};
return (0);
}
public static function showExtraTooltip(_arg1:Engine, _arg2):void{
var _local3:int;
var _local4:String;
var _local5:String;
_local3 = 0;
_local4 = "";
_local5 = "";
switch (_arg2){
case _arg1.playWindow.ui.extra_buttons.benches:
case _arg1.playWindow.ui.extra_buttons.benches_grey:
_local5 = "Bench";
_local3 = getExtraBuildCost(StringConsts.bench);
_local4 = "Bench slows down customers.";
break;
case _arg1.playWindow.ui.extra_buttons.news_box:
case _arg1.playWindow.ui.extra_buttons.news_box_grey:
_local5 = "Newspaper Box";
_local3 = getExtraBuildCost(StringConsts.news_box);
_local4 = "Allows customers to buy newspapers.";
break;
case _arg1.playWindow.ui.extra_buttons.ice_cream:
case _arg1.playWindow.ui.extra_buttons.ice_cream_grey:
_local5 = "Ice Cream Stand";
_local3 = getExtraBuildCost(StringConsts.ice_cream);
_local4 = "Allows customers to buy ice cream.";
break;
};
_arg1.playWindow.ui.shop_tooltip.title_txt.text = _local5;
_arg1.playWindow.ui.shop_tooltip.params_txt.text = ((("Build Cost: " + _local3.toString()) + "$\n\n") + _local4);
}
}
}//package fai.logic
Section 122
//EnemyRestaurant (fai.logic.EnemyRestaurant)
package fai.logic {
import fai.*;
public class EnemyRestaurant extends ShopItem {
public function EnemyRestaurant():void{
}
private function buildThisShop():void{
setType(((engine.resto_type == StringConsts.american)) ? StringConsts.sushi : StringConsts.american);
gotoAndStop("shopping");
building_bar.visible = false;
setLevel(Consts.ShopLevel1);
shoppable = true;
setShopIcon(resto);
updateState();
reset();
}
override public function initialize(_arg1:Engine):void{
super.initialize(_arg1);
buildThisShop();
}
}
}//package fai.logic
Section 123
//Engine (fai.logic.Engine)
package fai.logic {
import flash.media.*;
import flash.events.*;
import fai.ui.*;
import fai.common.*;
import flash.geom.*;
import fai.goals.*;
import fai.goalsystem.*;
import flash.utils.*;
import fai.*;
public class Engine {
public var buttons:Buttons;// = null
public var not_spent:Boolean;// = false
public var scenario:Scenario;// = null
public var score:int;// = 0
public var events:GameEvents;// = null
public var volume:Number;// = 1
private var game_finished:Boolean;// = false
public var fast_mode:Boolean;// = false
private var money_goal:int;// = 0
private var last_tooltip_button:ShopButton;// = null
public var shops:Shops;// = null
public var money:int;// = 0
private var enemy_money_goal:int;// = 0
private var level_life_points:int;// = 0
public var selected_item;// = null
public var paused:Boolean;// = false
private var last_loaded_level:Level;// = null
public var customers:Customers;// = null
private var game_data:DataProxy;// = null
public var goal_system:GoalSystem;// = null
public var upgrades:Upgrades;// = null
private var global_stage;// = null
public var extras:Extras;// = null
public var resto_type:String;
public var music_channel:SoundChannel;// = null
public var play_window:PlayWindow;// = null
private var vd_timer:Timer;// = null
private var music_sound:Sound;// = null
public var volumeOff:Boolean;// = false
private var build_cost:int;
public function Engine(_arg1):void{
game_data = null;
global_stage = null;
money = 0;
money_goal = 0;
enemy_money_goal = 0;
score = 0;
paused = false;
goal_system = null;
events = null;
play_window = null;
last_loaded_level = null;
volume = 1;
volumeOff = false;
shops = null;
buttons = null;
level_life_points = 0;
scenario = null;
upgrades = null;
extras = null;
customers = null;
not_spent = false;
last_tooltip_button = null;
vd_timer = null;
music_sound = null;
music_channel = null;
game_finished = false;
fast_mode = false;
selected_item = null;
build_cost = MoneyConsts.INITIAL_BUY_FOR;
super();
resto_type = StringConsts.american;
global_stage = _arg1;
game_data = new DataProxy();
}
public function get goalMoney():int{
return (money_goal);
}
public function customerPassed(_arg1:Customer):void{
if (_arg1.money > 0){
if (level_life_points > 0){
level_life_points--;
};
playWindow.updateResources();
};
}
public function log(_arg1:String):void{
playWindow.ui.output_message.msg.msg_txt.text = _arg1;
playWindow.ui.output_message.gotoAndPlay("show_animation");
playWindow.ui.output_message.visible = true;
}
public function playSoundData(_arg1:Sound):void{
var _local2:SoundTransform;
if (((volumeOff) || (!(_arg1)))){
return;
};
_local2 = new SoundTransform();
_local2.volume = volume;
_arg1.play(0, 0, _local2);
}
public function get lastLevel():Level{
return (last_loaded_level);
}
public function gameOver():void{
if (game_finished){
return;
};
game_finished = true;
vd_timer = new Timer(1000, 1);
vd_timer.addEventListener(TimerEvent.TIMER, defeatHandler);
vd_timer.start();
}
public function clearAll():void{
if (!play_window){
return;
};
stopMusic();
events.unregister();
events = null;
shops.destroy();
shops = null;
buttons.destroy();
buttons = null;
scenario = null;
upgrades = null;
customers.destroy();
customers = null;
extras.destroy();
extras = null;
play_window.destroy();
GameStage.play_holder.removeChild(play_window.ui);
play_window = null;
last_tooltip_button = null;
goal_system.deactivateAll();
goal_system = null;
game_finished = false;
paused = false;
}
private function defeatHandler(_arg1:TimerEvent):void{
game_finished = true;
vd_timer.stop();
vd_timer.removeEventListener(TimerEvent.TIMER, defeatHandler);
vd_timer = null;
predeactivateGoals();
if (!paused){
pause();
};
play_window.stats.final_victory.visible = false;
play_window.stats.defeat();
play_window.stats.start();
play_window.stats.visible = true;
}
public function get gameBoard():GameBoard{
if (!play_window){
return (null);
};
return (play_window.gameBoard);
}
public function get levelLifePoints():int{
return (level_life_points);
}
public function getBuildCost():int{
return (build_cost);
}
public function predeactivateGoals():void{
var _local1:int;
var _local2:*;
var _local3:*;
_local1 = 0;
_local1 = 0;
while (_local1 < goal_system.goals.length) {
_local2 = goal_system.goals[_local1];
if ((_local2 is CoinGoal)){
_local2.deactivate();
};
_local1++;
};
_local1 = 0;
while (_local1 < customers.size()) {
_local3 = customers.getItem(_local1);
_local3.character.stop();
_local1++;
};
}
public function get ui(){
return (play_window.ui);
}
public function finalVictory():void{
score = (score + 500000);
play_window.stats.final_victory.visible = true;
}
public function playLevel(_arg1:Level):void{
if (!_arg1){
return;
};
clearAll();
money = _arg1.initial_money;
money_goal = 0;
enemy_money_goal = 0;
score = 0;
level_life_points = 5;
fast_mode = false;
goal_system = new GoalSystem();
events = new GameEvents(this);
shops = new Shops(this);
buttons = new Buttons(this);
extras = new Extras(this);
last_loaded_level = _arg1;
play_window = new PlayWindow(this);
play_window.initialize(_arg1.number);
GameStage.play_holder.addChild(play_window.ui);
scenario = new Scenario(this, _arg1);
upgrades = new Upgrades(this);
customers = new Customers(this);
goal_system.add(new CustomerZIndexGoal(this));
events.register();
play_window.updateAll();
music_sound = new Sound_level_music();
playMusic();
}
public function switchSound(_arg1:Boolean):void{
volumeOff = !(_arg1);
if (volumeOff){
stopMusic();
GameStage.welcomeScreen.levelSelection.stopMusic();
} else {
playMusic();
};
}
public function victory():void{
if (game_finished){
return;
};
game_finished = true;
vd_timer = new Timer(1000, 1);
vd_timer.addEventListener(TimerEvent.TIMER, victoryHandler);
vd_timer.start();
}
public function playSound(_arg1:int):void{
switch (_arg1){
case SoundConsts.swish_swish:
playSoundData(new Sound_swish());
break;
case SoundConsts.swish:
playSoundData(new Sound_build());
break;
case SoundConsts.click:
playSoundData(new Sound_click());
break;
case SoundConsts.coins:
playSoundData(new Sound_coins());
break;
case SoundConsts.new_day:
playSoundData(new Sound_newday());
break;
case SoundConsts.robbery:
playSoundData(new Sound_robbery());
break;
case SoundConsts.sell:
playSoundData(new Sound_sell());
break;
case SoundConsts.clean_alarm:
playSoundData(new Sound_clean_sound());
break;
case SoundConsts.game_over:
playSoundData(new Sound_game_over());
break;
case SoundConsts.on_upgrade_over:
playSoundData(new Sound_on_upgrade_over());
break;
};
}
public function get gameData():DataProxy{
return (game_data);
}
public function stopMusic():void{
if (music_channel){
music_channel.stop();
music_channel = null;
};
}
public function showTooltip(_arg1):void{
if (((!(_arg1)) || ((_arg1 is ShopButton)))){
if (_arg1){
last_tooltip_button = _arg1;
DataProxy.showTooltip(this, _arg1);
};
} else {
DataProxy.showExtraTooltip(this, _arg1);
};
}
public function applyUpgrade(_arg1:String, _arg2:ShopItem):void{
switch (_arg1){
case StringConsts.american_second_floor:
case StringConsts.sushi_second_floor:
_arg2.addToMoneyValue(6);
_arg2.addMoreSeats(10);
break;
case StringConsts.sushi_third_floor:
case StringConsts.american_third_floor:
_arg2.addToMoneyValue(12);
_arg2.addMoreSeats(10);
break;
case StringConsts.american_summer_seats:
case StringConsts.sushi_summer_seats:
_arg2.addToMoneyValue(8);
_arg2.addMoreSeats(5);
break;
case StringConsts.security_system:
_arg2.no_thefts = true;
break;
case StringConsts.receptionist_american:
case StringConsts.receptionist_sushi:
_arg2.addToMoneyValue(8.5);
break;
case StringConsts.underground_bar_sushi:
case StringConsts.underground_bar_american:
_arg2.addMoreSeats(6);
_arg2.addToMoneyValue(9);
break;
case StringConsts.sushi_delivery:
case StringConsts.american_delivery:
_arg2.deliveryOn();
if (scenario.currentDay > 0){
_arg2.startDelivery();
};
break;
case StringConsts.tv_hall:
_arg2.addMoreSeats(2);
_arg2.addToMoneyValue(9);
break;
case StringConsts.pizza_production:
_arg2.addMoreSeats(2);
_arg2.addToMoneyValue(7);
break;
case StringConsts.luxury_pizza:
_arg2.addToMoneyValue(9);
break;
case StringConsts.country_menu:
_arg2.addToMoneyValue(8.5);
_arg2.addMoreSeats(3);
break;
case StringConsts.king_burgers:
_arg2.addToMoneyValue(9.5);
_arg2.addMoreSeats(2);
break;
case StringConsts.sale_campaigns:
_arg2.addToMoneyValue(7.5);
_arg2.addMoreSeats(1);
break;
case StringConsts.cheap_sushi_menu:
_arg2.addToMoneyValue(7);
_arg2.addMoreSeats(3);
break;
case StringConsts.karaoke:
_arg2.addMoreSeats(3);
_arg2.addToMoneyValue(9);
break;
case StringConsts.eastern_sweeties:
_arg2.addToMoneyValue(10);
break;
case StringConsts.hot_cheese_rolls:
_arg2.addToMoneyValue(9);
_arg2.addMoreSeats(2);
break;
case StringConsts.sushi_discounts:
_arg2.addToMoneyValue(8);
_arg2.addMoreSeats(1);
break;
case StringConsts.ads1:
_arg2.addToMoneyValue(1.5);
break;
case StringConsts.ads2:
_arg2.addToMoneyValue(2);
break;
case StringConsts.ads3_american:
case StringConsts.ads3_sushi:
_arg2.addToMoneyValue(2.5);
_arg2.addMoreSeats(1);
break;
case StringConsts.ads4:
_arg2.addToMoneyValue(3.5);
break;
case StringConsts.ads5_sushi:
case StringConsts.ads5_american:
_arg2.addToMoneyValue(4);
_arg2.addMoreSeats(1);
break;
case StringConsts.decor1_sushi:
case StringConsts.decor1_american:
_arg2.addToMoneyValue(5);
break;
case StringConsts.decor2_sushi:
case StringConsts.decor2_american:
_arg2.addToMoneyValue(7);
break;
case StringConsts.decor3_sushi:
case StringConsts.decor3_american:
_arg2.addToMoneyValue(7);
_arg2.addMoreSeats(2);
break;
case StringConsts.decor4_sushi:
case StringConsts.decor4_american:
_arg2.addToMoneyValue(8);
break;
case StringConsts.decor5_sushi:
case StringConsts.decor5_american:
_arg2.addToMoneyValue(9);
_arg2.addMoreSeats(3);
break;
case StringConsts.decor6_sushi:
case StringConsts.decor6_american:
_arg2.addToMoneyValue(10);
break;
case StringConsts.decor7_sushi:
case StringConsts.decor7_american:
_arg2.addToMoneyValue(11);
_arg2.addMoreSeats(3);
break;
};
if (_arg2.shopType == resto_type){
_arg2.updateRepairState();
playWindow.updateResources();
};
}
public function playMusic():void{
var _local1:SoundTransform;
stopMusic();
if (((!(volumeOff)) && (music_sound))){
_local1 = new SoundTransform();
_local1.volume = volume;
music_channel = music_sound.play(0, 25, _local1);
};
}
public function get enemyGoalMoney():int{
return (enemy_money_goal);
}
private function victoryHandler(_arg1:TimerEvent):void{
var _local2:LevelSelection;
vd_timer.stop();
vd_timer.removeEventListener(TimerEvent.TIMER, victoryHandler);
vd_timer = null;
predeactivateGoals();
game_finished = true;
if (!paused){
pause();
};
_local2 = GameStage.welcomeScreen.levelSelection;
play_window.stats.final_victory.visible = false;
if (lastLevel.number == (gameData.getLevels().length - 1)){
finalVictory();
};
if (_local2.current_level == lastLevel.number){
_local2.current_level++;
_local2.saveLevels();
};
play_window.stats.victory();
play_window.stats.start();
play_window.stats.visible = true;
}
public function get playerMoney():int{
return (money);
}
public function payEnemyMoney(_arg1:int):void{
enemy_money_goal = (enemy_money_goal + Math.abs(_arg1));
playWindow.updateAll();
}
public function get playWindow():PlayWindow{
return (play_window);
}
public function hideEverythingOpened():void{
buttons.hideBuildButtons();
shops.hideBuildingIcons();
shops.hideMenus();
if (extras.isAwaiting){
extras.cancelSketchyState();
};
playWindow.ui.sell_dialog.visible = false;
}
public function returnMoney(_arg1:int):void{
playWindow.stats.spent = (playWindow.stats.spent - Math.abs(_arg1));
money = (money + _arg1);
playWindow.updateAll();
}
public function pause():void{
if (!paused){
stopMusic();
play_window.ui.pause_mc.visible = true;
play_window.ui.pause_mc.gotoAndPlay("pause");
events.unregister();
setCustomersVisible(false);
} else {
playMusic();
play_window.ui.pause_mc.stop();
play_window.ui.pause_mc.visible = false;
events.register();
setCustomersVisible(true);
};
paused = !(paused);
}
private function setCustomersVisible(_arg1:Boolean):void{
var _local2:int;
var _local3:*;
_local2 = 0;
_local2 = 0;
while (_local2 < customers.size()) {
_local3 = customers.getItem(_local2);
if (!_local3.buying){
_local3.suit.visible = _arg1;
};
_local2++;
};
}
public function payMoney(_arg1:int):void{
if (_arg1 < 0){
playSound(SoundConsts.coins);
money_goal = (money_goal + Math.abs(_arg1));
playWindow.stats.earned = (playWindow.stats.earned + Math.abs(_arg1));
} else {
playWindow.stats.spent = (playWindow.stats.spent + Math.abs(_arg1));
};
money = (money - _arg1);
playWindow.updateAll();
}
}
}//package fai.logic
Section 124
//Extras (fai.logic.Extras)
package fai.logic {
import fai.ui.*;
import fai.*;
public class Extras {
private var engine:Engine;// = null
private var extras:Array;
private var await_type:String;
private var awaits:Boolean;// = false
public function Extras(_arg1:Engine):void{
engine = null;
extras = [];
awaits = false;
super();
engine = _arg1;
}
public function extraIceCream():void{
if (engine.playerMoney < DataProxy.getExtraBuildCost(StringConsts.ice_cream)){
engine.log(StringConsts.not_enough_money);
return;
};
showSketchyState(StringConsts.ice_cream);
}
public function size():int{
return (extras.length);
}
public function destroy():void{
if (extras){
extras.length = 0;
extras = null;
};
}
public function setAwaiting(_arg1:Boolean):void{
awaits = _arg1;
}
public function getItem(_arg1:int){
return (extras[_arg1]);
}
public function addItem(_arg1):void{
extras.push(_arg1);
_arg1.visible = false;
}
public function extraBenches():void{
if (engine.playerMoney < DataProxy.getExtraBuildCost(StringConsts.bench)){
engine.log(StringConsts.not_enough_money);
return;
};
showSketchyState(StringConsts.bench);
}
public function get isAwaiting():Boolean{
return (awaits);
}
public function extraNewsBox():void{
if (engine.playerMoney < DataProxy.getExtraBuildCost(StringConsts.news_box)){
engine.log(StringConsts.not_enough_money);
return;
};
showSketchyState(StringConsts.news_box);
}
public function update():void{
if (((awaits) && ((engine.playerMoney < DataProxy.getExtraBuildCost(await_type))))){
cancelSketchyState();
};
}
private function showSketchyState(_arg1:String):void{
var _local2:int;
var _local3:Boolean;
var _local4:ExtraItem;
if (((awaits) && ((await_type == _arg1)))){
cancelSketchyState();
return;
};
_local2 = 0;
_local3 = false;
_local2 = 0;
while (_local2 < extras.length) {
_local4 = extras[_local2];
if ((((_local4.currentState == StringConsts.empty)) || (extras[_local2].isAwaiting))){
_local4.setCurrentState(_arg1);
_local4.setAwaiting(true);
_local4.setSketchyState();
_local4.visible = true;
_local3 = true;
};
_local2++;
};
if (_local3){
awaits = true;
await_type = _arg1;
engine.shops.hideBuildingIcons();
};
}
public function cancelSketchyState():void{
var _local1:int;
var _local2:ExtraItem;
awaits = false;
_local1 = 0;
_local1 = 0;
while (_local1 < extras.length) {
_local2 = extras[_local1];
if (_local2.isAwaiting){
_local2.setCurrentState(StringConsts.empty);
_local2.setAwaiting(false);
_local2.visible = false;
};
_local1++;
};
}
public function extraClick(_arg1):void{
if ((_arg1 is ExtraItem)){
if (_arg1.isAwaiting){
if (engine.playerMoney < DataProxy.getExtraBuildCost(_arg1.currentState)){
engine.log(StringConsts.not_enough_money);
return;
};
setAwaiting(false);
engine.payMoney(DataProxy.getExtraBuildCost(_arg1.currentState));
_arg1.setAwaiting(false);
_arg1.setNormalState();
engine.score = (engine.score + DataProxy.getExtraBuildCost(_arg1.currentState));
engine.playWindow.updateAll();
engine.playWindow.generateParticlesOver(_arg1);
cancelSketchyState();
} else {
engine.playWindow.ui.sell_dialog.x = ((_arg1.x + _arg1.width) - engine.playWindow.ui.sell_dialog.width);
engine.playWindow.ui.sell_dialog.y = ((_arg1.y + (_arg1.height / 2)) - engine.playWindow.ui.sell_dialog.height);
if (engine.playWindow.ui.sell_dialog.x < 0){
engine.playWindow.ui.sell_dialog.x = 0;
};
if (engine.playWindow.ui.sell_dialog.x > (Consts.ScreenWidth - engine.playWindow.ui.sell_dialog.width)){
engine.playWindow.ui.sell_dialog.x = ((Consts.ScreenWidth - engine.playWindow.ui.sell_dialog.width) - 5);
};
if ((engine.playWindow.ui.sell_dialog.y - engine.playWindow.ui.sell_dialog.height) < 0){
engine.playWindow.ui.sell_dialog.y = (engine.playWindow.ui.sell_dialog.height + 5);
};
if ((engine.playWindow.ui.sell_dialog.y + engine.playWindow.ui.sell_dialog.height) > Consts.ScreenHeight){
engine.playWindow.ui.sell_dialog.y = ((Consts.ScreenHeight - engine.playWindow.ui.sell_dialog.height) - 5);
};
engine.playWindow.ui.sell_dialog.visible = true;
engine.playWindow.ui.sell_dialog.money_txt.text = ((DataProxy.getExtraBuildCost(_arg1.currentState) * Consts.SellDownturn).toString() + "$");
if (!_arg1.vice_versa){
engine.playWindow.ui.sell_dialog.x = (engine.playWindow.ui.sell_dialog.x + (engine.playWindow.ui.sell_dialog.width / 2));
};
engine.selected_item = _arg1;
};
};
}
}
}//package fai.logic
Section 125
//GameBoard (fai.logic.GameBoard)
package fai.logic {
import flash.display.*;
public class GameBoard extends Sprite {
private var engine:Engine;// = null
public function GameBoard(_arg1:Engine):void{
engine = null;
super();
}
}
}//package fai.logic
Section 126
//GameEvents (fai.logic.GameEvents)
package fai.logic {
import flash.events.*;
import fai.ui.*;
import fai.*;
import game.ui.*;
import flash.ui.*;
public class GameEvents {
private var engine:Engine;// = null
private var scenario_pause:int;// = 0
public function GameEvents(_arg1:Engine):void{
engine = null;
scenario_pause = 0;
super();
engine = _arg1;
}
private function overShopHandler(_arg1:MouseEvent):void{
_arg1.currentTarget.setSelectedState(true);
}
private function modeChangeButtonHandler(_arg1:MouseEvent):void{
engine.fast_mode = !(engine.fast_mode);
engine.playWindow.ui.fast_mode_button.visible = !(engine.fast_mode);
engine.playWindow.ui.slow_mode_button.visible = engine.fast_mode;
_arg1.stopPropagation();
}
private function outShopHandler(_arg1:MouseEvent):void{
if (engine.playWindow.current_resto != _arg1.currentTarget){
if (((!(_arg1.currentTarget.resto)) || (!(_arg1.currentTarget.resto.enemy_restaurant)))){
_arg1.currentTarget.setSelectedState(false);
};
};
}
private function extraButtonHandler(_arg1:MouseEvent):void{
engine.playSound(SoundConsts.click);
switch (_arg1.currentTarget){
case engine.playWindow.ui.extra_buttons.benches:
engine.extras.extraBenches();
break;
case engine.playWindow.ui.extra_buttons.news_box:
engine.extras.extraNewsBox();
break;
case engine.playWindow.ui.extra_buttons.ice_cream:
engine.extras.extraIceCream();
break;
};
_arg1.stopPropagation();
}
private function onKeyDown(_arg1:KeyboardEvent):void{
if (Keyboard.F9 == _arg1.keyCode){
};
}
private function shopButtonOutHandler(_arg1:MouseEvent):void{
engine.playWindow.ui.shop_tooltip.visible = false;
}
private function clickShopUpgradeHandler(_arg1:MouseEvent):void{
var _local2:ShopItem;
if (((engine.selected_item) && ((engine.selected_item is ShopItem)))){
engine.playSound(SoundConsts.click);
_local2 = engine.selected_item;
if (_local2.currentLevel < Consts.ShopLevel3){
if (engine.playerMoney < DataProxy.getBuildCost(_local2.shopType, (_local2.currentLevel + 1))){
engine.log(StringConsts.not_enough_money);
} else {
_local2.startUpgrading();
};
};
engine.hideEverythingOpened();
};
_arg1.stopPropagation();
}
private function buyButtonHandler(_arg1:MouseEvent):void{
if (engine.money < engine.getBuildCost()){
engine.log(StringConsts.not_enough_money);
return;
};
Events.onBuyRestaurant.fire(engine.playWindow.current_resto);
}
private function clickShopHandler(_arg1:MouseEvent):void{
if ((_arg1.currentTarget is ShopItem)){
if (((!((_arg1.currentTarget.shopType == engine.resto_type))) && (!((_arg1.currentTarget.currentLevel == 0))))){
return;
};
if (engine.playWindow.current_resto){
engine.playWindow.current_resto.setSelectedState(false);
};
engine.playWindow.current_resto = _arg1.currentTarget;
engine.playWindow.current_resto.setSelectedState(true);
engine.ui.buy_button.x = (engine.playWindow.current_resto.x - (engine.ui.buy_button.width / 2));
engine.ui.buy_button.y = (engine.playWindow.current_resto.y - engine.ui.buy_button.height);
engine.playWindow.ui.clean_dialog.x = (engine.playWindow.current_resto.x - (engine.playWindow.ui.clean_dialog.width / 2));
engine.playWindow.ui.clean_dialog.y = (engine.playWindow.current_resto.y - engine.playWindow.ui.clean_dialog.height);
engine.playWindow.current_resto.updateRepairState();
engine.playWindow.updateAll();
};
_arg1.stopPropagation();
}
private function playWindowMenuHandler(_arg1:MouseEvent):void{
engine.playSound(SoundConsts.click);
engine.pause();
engine.play_window.ui.visible = false;
GameStage.welcomeScreen.showWelcome();
_arg1.stopPropagation();
}
private function employeeOverHandler(_arg1:MouseEvent):void{
if (((!(engine.playWindow.current_resto)) || ((engine.money < engine.playWindow.current_resto.hireCost())))){
engine.ui.ui_menu.all_buttons.employees.button_back.gotoAndStop("grey_highlighted_state");
} else {
engine.ui.ui_menu.all_buttons.employees.button_back.gotoAndStop("highlighted_state");
};
}
private function playWindowPauseHandler(_arg1:MouseEvent):void{
engine.playSound(SoundConsts.click);
engine.pause();
_arg1.stopPropagation();
}
private function extraBuildButtonHandler(_arg1:MouseEvent):void{
engine.playSound(SoundConsts.click);
engine.ui.extra_buttons.visible = !(engine.ui.extra_buttons.visible);
if (engine.ui.extra_buttons.visible){
engine.hideEverythingOpened();
engine.ui.extra_buttons.visible = true;
};
_arg1.stopPropagation();
}
private function soundOnHandler(_arg1:MouseEvent):void{
engine.switchSound(true);
engine.playWindow.ui.mute_button.visible = true;
engine.playWindow.ui.sound_button.visible = false;
_arg1.stopPropagation();
}
public function tick(_arg1:Event):void{
var _local2:int;
var _local3:int;
_local2 = 1;
if (engine.fast_mode){
_local2 = 9;
} else {
_local2 = 2;
};
_local3 = 0;
_local3 = 0;
while (_local3 < _local2) {
engine.goal_system.tick();
engine.scenario.generate();
if (scenario_pause == 20){
engine.scenario.think();
scenario_pause = 0;
};
scenario_pause++;
_local3++;
};
}
private function nextDayButtonHandler(_arg1:MouseEvent):void{
if (((engine.playWindow.next_day_blocked) || (engine.playWindow.hasDelivery()))){
return;
};
engine.playWindow.ui.click_next_day_button.visible = false;
engine.playSound(SoundConsts.new_day);
engine.scenario.nextDay();
_arg1.stopPropagation();
}
private function unregisterShops():void{
var _local1:int;
_local1 = 0;
_local1 = 0;
while (_local1 < engine.shops.size()) {
engine.shops.getItem(_local1).removeEventListener(MouseEvent.MOUSE_DOWN, clickShopHandler);
engine.shops.getItem(_local1).removeEventListener(MouseEvent.MOUSE_OVER, overShopHandler);
engine.shops.getItem(_local1).removeEventListener(MouseEvent.MOUSE_OUT, outShopHandler);
_local1++;
};
}
private function soundMuteHandler(_arg1:MouseEvent):void{
engine.switchSound(false);
engine.playWindow.ui.mute_button.visible = false;
engine.playWindow.ui.sound_button.visible = true;
_arg1.stopPropagation();
}
public function register():void{
var _local1:int;
var _local2:*;
GameStage.main_stage.addEventListener(Event.ENTER_FRAME, tick);
GameStage.main_stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
registerShops();
_local1 = 0;
_local2 = null;
_local1 = 0;
while (_local1 < engine.buttons.size()) {
_local2 = engine.buttons.getItem(_local1);
_local2.addEventListener(MouseEvent.MOUSE_DOWN, shopButtonHandler);
_local2.addEventListener(MouseEvent.MOUSE_OVER, shopButtonOverHandler);
_local2.addEventListener(MouseEvent.MOUSE_OUT, shopButtonOutHandler);
_local2.buttonMode = true;
_local2.mouseChildren = false;
_local1++;
};
engine.ui.buy_button.addEventListener(MouseEvent.MOUSE_DOWN, buyButtonHandler);
_local1 = 0;
while (_local1 < engine.extras.size()) {
_local2 = engine.extras.getItem(_local1);
_local2.addEventListener(MouseEvent.MOUSE_DOWN, extraItemHandler);
_local2.buttonMode = true;
_local2.mouseChildren = false;
_local1++;
};
_local1 = 0;
while (_local1 < engine.buttons.extraSize()) {
_local2 = engine.buttons.getExtraItem(_local1);
_local2.addEventListener(MouseEvent.MOUSE_DOWN, extraButtonHandler);
_local2.addEventListener(MouseEvent.MOUSE_OVER, shopButtonOverHandler);
_local2.addEventListener(MouseEvent.MOUSE_OUT, shopButtonOutHandler);
_local1++;
};
_local1 = 0;
while (_local1 < engine.buttons.extraSize()) {
_local2 = engine.buttons.extras_grey[_local1];
_local2.addEventListener(MouseEvent.MOUSE_OVER, shopButtonOverHandler);
_local2.addEventListener(MouseEvent.MOUSE_OUT, shopButtonOutHandler);
_local1++;
};
engine.playWindow.ui.sell_dialog.sell_button.addEventListener(MouseEvent.MOUSE_DOWN, clickShopSellHandler);
engine.playWindow.ui.sell_dialog.money_txt.addEventListener(MouseEvent.MOUSE_DOWN, clickShopSellHandler);
engine.playWindow.ui.clean_dialog.repair_button.addEventListener(MouseEvent.MOUSE_DOWN, clickShopRepairHandler);
engine.playWindow.ui.clean_dialog.money_txt.addEventListener(MouseEvent.MOUSE_DOWN, clickShopRepairHandler);
engine.ui.ui_menu.all_buttons.employees.addEventListener(MouseEvent.MOUSE_DOWN, employeeClickHandler);
engine.ui.ui_menu.all_buttons.employees.addEventListener(MouseEvent.MOUSE_OVER, employeeOverHandler);
engine.ui.ui_menu.all_buttons.employees.addEventListener(MouseEvent.MOUSE_OUT, employeeOutHandler);
engine.ui.ui_menu.all_buttons.employees.buttonMode = true;
engine.ui.ui_menu.all_buttons.employees.mouseChildren = false;
engine.playWindow.ui.addEventListener(MouseEvent.MOUSE_DOWN, clickBackHandler);
engine.playWindow.ui.next_day_button.addEventListener(MouseEvent.MOUSE_DOWN, nextDayButtonHandler);
engine.playWindow.ui.menu_button.addEventListener(MouseEvent.MOUSE_DOWN, playWindowMenuHandler);
engine.playWindow.ui.pause_button.addEventListener(MouseEvent.MOUSE_DOWN, playWindowPauseHandler);
engine.playWindow.ui.mute_button.addEventListener(MouseEvent.MOUSE_DOWN, soundMuteHandler);
engine.playWindow.ui.sound_button.addEventListener(MouseEvent.MOUSE_DOWN, soundOnHandler);
engine.playWindow.ui.click_next_day_button.addEventListener(MouseEvent.MOUSE_DOWN, nextDayButtonHandler);
engine.playWindow.ui.fast_mode_button.addEventListener(MouseEvent.MOUSE_DOWN, modeChangeButtonHandler);
engine.playWindow.ui.slow_mode_button.addEventListener(MouseEvent.MOUSE_DOWN, modeChangeButtonHandler);
}
private function registerShops():void{
var _local1:int;
_local1 = 0;
_local1 = 0;
while (_local1 < engine.shops.size()) {
engine.shops.getItem(_local1).addEventListener(MouseEvent.MOUSE_DOWN, clickShopHandler);
engine.shops.getItem(_local1).addEventListener(MouseEvent.MOUSE_OVER, overShopHandler);
engine.shops.getItem(_local1).addEventListener(MouseEvent.MOUSE_OUT, outShopHandler);
_local1++;
};
}
public function employeeOutHandler(_arg1:MouseEvent):void{
if (((!(engine.playWindow.current_resto)) || ((engine.money < engine.playWindow.current_resto.hireCost())))){
engine.ui.ui_menu.all_buttons.employees.button_back.gotoAndStop("grey_state");
} else {
engine.ui.ui_menu.all_buttons.employees.button_back.gotoAndStop("normal_state");
};
}
private function shopButtonOverHandler(_arg1:MouseEvent):void{
engine.showTooltip(_arg1.currentTarget);
engine.playWindow.ui.shop_tooltip.visible = true;
}
private function employeeClickHandler(_arg1:MouseEvent):void{
if (!engine.playWindow.current_resto){
return;
};
if (engine.money < engine.playWindow.current_resto.hireCost()){
engine.log(StringConsts.not_enough_money);
return;
};
engine.payMoney(engine.playWindow.current_resto.hireCost());
engine.playWindow.current_resto.increaseWorkersCount();
engine.playWindow.updateResources();
engine.playSound(SoundConsts.click);
engine.playSound(SoundConsts.on_upgrade_over);
}
private function buildButtonHandler(_arg1:MouseEvent):void{
engine.playSound(SoundConsts.click);
engine.buttons.update();
engine.buttons.buildButtonPressed();
engine.ui.extra_buttons.visible = false;
_arg1.stopPropagation();
}
private function clickShopSellHandler(_arg1:MouseEvent):void{
if ((engine.selected_item is ShopItem)){
engine.selected_item.sell();
engine.playSound(SoundConsts.sell);
} else {
if ((engine.selected_item is ExtraItem)){
engine.selected_item.sell();
engine.playSound(SoundConsts.sell);
};
};
engine.hideEverythingOpened();
_arg1.stopPropagation();
}
private function extraItemHandler(_arg1:MouseEvent):void{
engine.playSound(SoundConsts.click);
engine.extras.extraClick(_arg1.currentTarget);
_arg1.stopPropagation();
}
private function shopButtonHandler(_arg1:MouseEvent):void{
_arg1.stopPropagation();
}
private function clickBackHandler(_arg1:MouseEvent):void{
engine.hideEverythingOpened();
}
public function unregister():void{
var _local1:int;
var _local2:*;
GameStage.main_stage.removeEventListener(Event.ENTER_FRAME, tick);
GameStage.main_stage.removeEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
unregisterShops();
_local1 = 0;
_local2 = null;
_local1 = 0;
while (_local1 < engine.buttons.size()) {
_local2 = engine.buttons.getItem(_local1);
_local2.removeEventListener(MouseEvent.MOUSE_DOWN, shopButtonHandler);
_local2.removeEventListener(MouseEvent.MOUSE_OVER, shopButtonOverHandler);
_local2.removeEventListener(MouseEvent.MOUSE_OUT, shopButtonOutHandler);
_local1++;
};
engine.ui.buy_button.addEventListener(MouseEvent.MOUSE_DOWN, buyButtonHandler);
engine.playWindow.ui.removeEventListener(MouseEvent.MOUSE_DOWN, clickBackHandler);
_local1 = 0;
while (_local1 < engine.extras.size()) {
_local2 = engine.extras.getItem(_local1);
_local2.removeEventListener(MouseEvent.MOUSE_DOWN, extraItemHandler);
_local1++;
};
_local1 = 0;
while (_local1 < engine.buttons.extraSize()) {
_local2 = engine.buttons.getExtraItem(_local1);
_local2.removeEventListener(MouseEvent.MOUSE_DOWN, extraButtonHandler);
_local2.removeEventListener(MouseEvent.MOUSE_OVER, shopButtonOverHandler);
_local2.removeEventListener(MouseEvent.MOUSE_OUT, shopButtonOutHandler);
_local1++;
};
engine.playWindow.ui.sell_dialog.sell_button.removeEventListener(MouseEvent.MOUSE_DOWN, clickShopSellHandler);
engine.playWindow.ui.clean_dialog.repair_button.removeEventListener(MouseEvent.MOUSE_DOWN, clickShopRepairHandler);
engine.playWindow.ui.sell_dialog.money_txt.removeEventListener(MouseEvent.MOUSE_DOWN, clickShopSellHandler);
engine.playWindow.ui.clean_dialog.money_txt.removeEventListener(MouseEvent.MOUSE_DOWN, clickShopRepairHandler);
engine.ui.ui_menu.all_buttons.employees.removeEventListener(MouseEvent.MOUSE_DOWN, employeeClickHandler);
engine.ui.ui_menu.all_buttons.employees.removeEventListener(MouseEvent.MOUSE_OVER, employeeOverHandler);
engine.ui.ui_menu.all_buttons.employees.removeEventListener(MouseEvent.MOUSE_OUT, employeeOutHandler);
engine.playWindow.ui.next_day_button.removeEventListener(MouseEvent.MOUSE_DOWN, nextDayButtonHandler);
engine.playWindow.ui.menu_button.removeEventListener(MouseEvent.MOUSE_DOWN, playWindowMenuHandler);
engine.playWindow.ui.pause_button.removeEventListener(MouseEvent.MOUSE_DOWN, playWindowPauseHandler);
engine.playWindow.ui.pause_mc.removeEventListener(MouseEvent.MOUSE_DOWN, playWindowPauseHandler);
engine.playWindow.ui.mute_button.removeEventListener(MouseEvent.MOUSE_DOWN, soundMuteHandler);
engine.playWindow.ui.sound_button.removeEventListener(MouseEvent.MOUSE_DOWN, soundOnHandler);
engine.playWindow.ui.click_next_day_button.removeEventListener(MouseEvent.MOUSE_DOWN, nextDayButtonHandler);
engine.playWindow.ui.fast_mode_button.removeEventListener(MouseEvent.MOUSE_DOWN, modeChangeButtonHandler);
engine.playWindow.ui.slow_mode_button.removeEventListener(MouseEvent.MOUSE_DOWN, modeChangeButtonHandler);
}
private function clickShopRepairHandler(_arg1:MouseEvent):void{
var _local2:Number;
engine.playSound(SoundConsts.click);
if ((engine.playWindow.current_resto is ShopItem)){
_local2 = engine.playWindow.current_resto.getRepairCost();
if (engine.playerMoney < _local2){
engine.log(StringConsts.not_enough_money);
} else {
engine.playWindow.current_resto.repair();
engine.payMoney(_local2);
engine.playSound(SoundConsts.swish_swish);
};
};
engine.hideEverythingOpened();
_arg1.stopPropagation();
}
}
}//package fai.logic
Section 127
//Level (fai.logic.Level)
package fai.logic {
import fai.*;
public class Level {
public var initial_money:int;// = 0
public var number:int;// = 0
public var days:int;// = 0
public var money_goal:int;// = 0
public var type:String;
public var description:String;
public function Level(_arg1:String):void{
number = 0;
days = 0;
initial_money = 0;
money_goal = 0;
super();
type = _arg1;
initial_money = 50;
description = "";
switch (type){
case StringConsts.level1:
days = 8;
initial_money = 50;
money_goal = 2500;
break;
case StringConsts.level2:
days = 15;
money_goal = 11000;
break;
case StringConsts.level3:
days = 18;
money_goal = 25500;
break;
case StringConsts.level4:
days = 20;
money_goal = 28000;
break;
case StringConsts.level5:
days = 22;
money_goal = 53000;
break;
case StringConsts.level6:
days = 25;
money_goal = 100000;
break;
};
}
public function copy(_arg1:Level):void{
type = _arg1.type;
description = _arg1.description;
days = _arg1.days;
initial_money = _arg1.initial_money;
money_goal = _arg1.money_goal;
}
}
}//package fai.logic
Section 128
//MyRestaurant (fai.logic.MyRestaurant)
package fai.logic {
import fai.*;
public class MyRestaurant extends ShopItem {
public function MyRestaurant():void{
}
private function buildThisShop():void{
setType(engine.resto_type);
gotoAndStop("shopping");
building_bar.visible = false;
setLevel(Consts.ShopLevel1);
shoppable = true;
setShopIcon(resto);
updateState();
reset();
}
override public function initialize(_arg1:Engine):void{
super.initialize(_arg1);
buildThisShop();
}
}
}//package fai.logic
Section 129
//PlayWindow (fai.logic.PlayWindow)
package fai.logic {
import flash.events.*;
import fai.ui.*;
import flash.display.*;
import fai.common.*;
import game.restaurant.*;
import fai.*;
import game.ui.*;
import game.errors.*;
import classes.*;
import game.*;
public class PlayWindow {
private var game_ui:PlayWindowUI;// = null
public var next_day_blocked:Boolean;// = false
public var enemy_restaurants:ObjectList;
public var stats:Statistics;// = null
private var initial_enemy_bar_scale:Number;// = 0
public var build_buttons:Array;// = null
private var shop_items:Array;// = null
private var engine:Engine;// = null
public var my_restaurants:ObjectList;
private var shop_index:int;// = 0
public var roads:Array;// = null
public var current_resto;// = null
public var game_board:GameBoard;// = null
private var level_back;// = null
private var initial_bar_scale:Number;// = 0
public var iso_beacons:Array;
public var for_sale:ObjectList;
public function PlayWindow(_arg1:Engine):void{
engine = null;
game_board = null;
game_ui = null;
shop_items = null;
build_buttons = null;
roads = null;
initial_bar_scale = 0;
initial_enemy_bar_scale = 0;
stats = null;
shop_index = 0;
level_back = null;
iso_beacons = [];
next_day_blocked = false;
my_restaurants = new ObjectList();
enemy_restaurants = new ObjectList();
for_sale = new ObjectList();
current_resto = null;
super();
engine = _arg1;
}
public function destroy():void{
if (game_ui.tutorial_mc){
game_ui.tutorial_mc.destroy();
game_ui.tutorial_mc = null;
};
game_ui.pause_mc.removeEventListener(MouseEvent.MOUSE_DOWN, unpauseHandler);
stats.destroy();
Events.onBuyRestaurant.remove(onBuyRestaurant);
Events.onBeforeUpgrade.remove(onBeforeUpgrade);
Events.onLevelUpgrade.remove(onLevelUpgrade);
Events.onSimpleShowUpgrade.remove(onSimpleShowUpgrade);
Events.onSignboardUpgrade.remove(onSignboardUpgrade);
game_ui.ui_menu.destroy();
}
public function show():void{
ui.visible = true;
}
private function unpauseHandler(_arg1:MouseEvent):void{
engine.pause();
}
public function getDeliveries():Array{
var _local1:Array;
var _local2:int;
var _local3:ShopItem;
_local1 = new Array();
_local2 = 0;
_local2 = 0;
while (_local2 < shop_items.length) {
_local3 = engine.shops.getItem(_local2);
if (((_local3.deliveryGoal) && (_local3.deliveryGoal.deliveryCustomer))){
_local1.push(_local3.deliveryGoal.deliveryCustomer);
};
_local2++;
};
return (_local1);
}
public function initialize(_arg1:int):void{
var _local2:Array;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:Boolean;
var _local7:*;
var _local8:*;
game_ui = new PlayWindowUI();
shop_items = new Array();
roads = new Array();
level_back = DataProxy.getLevelBackground(_arg1);
game_ui.back_holder.addChild(level_back);
_local2 = [];
_local3 = 0;
_local4 = level_back.numChildren;
switch (_arg1){
case 0:
level_back.shop1.road = level_back.road1;
level_back.shop2.road = level_back.road2;
level_back.shop1.delivery_road = level_back.delivery_road1;
break;
case 1:
level_back.shop1.road = level_back.road1;
level_back.shop2.road = level_back.road2;
level_back.shop3.road = level_back.road3;
level_back.shop2.delivery_road = level_back.delivery_road2;
level_back.shop3.delivery_road = level_back.delivery_road3;
break;
case 2:
level_back.shop1.road = level_back.road1;
level_back.shop2.road = level_back.road2;
level_back.shop3.road = level_back.road3;
level_back.shop4.road = level_back.road4;
level_back.shop1.delivery_road = level_back.delivery_road1;
level_back.shop4.delivery_road = level_back.delivery_road4;
level_back.shop3.delivery_road = level_back.delivery_road3;
break;
case 3:
level_back.shop1.road = level_back.road1;
level_back.shop2.road = level_back.road2;
level_back.shop3.road = level_back.road3;
level_back.shop4.road = level_back.road4;
level_back.shop1.delivery_road = level_back.delivery_road1;
level_back.shop4.delivery_road = level_back.delivery_road4;
level_back.shop2.delivery_road = level_back.delivery_road2;
break;
case 4:
case 5:
level_back.shop1.road = level_back.road1;
level_back.shop2.road = level_back.road2;
level_back.shop4.road = level_back.road4;
level_back.shop5.road = level_back.road5;
level_back.shop5.delivery_road = level_back.delivery_road5;
level_back.shop1.delivery_road = level_back.delivery_road1;
level_back.shop4.delivery_road = level_back.delivery_road4;
level_back.shop2.delivery_road = level_back.delivery_road2;
break;
};
_local3 = 0;
while (_local3 < _local4) {
_local7 = level_back.getChildAt(_local3);
if ((_local7 is ShopItem)){
shop_items.push(_local7);
} else {
if ((_local7 is RoadPath)){
_local7.initialize();
_local7.visible = false;
roads.push(_local7);
} else {
if ((_local7 is Delivery)){
_local2.push(_local7);
_local7.gotoAndStop("start_frame");
_local7.visible = false;
} else {
if ((_local7 is ExtraItem)){
if (_local7.scaleX < 1){
_local7.vice_versa = true;
};
engine.extras.addItem(_local7);
_local7.setEngine(engine);
} else {
if ((_local7 is IsoBeacon)){
iso_beacons.push(_local7);
_local7.inner.visible = false;
};
};
};
};
};
_local3++;
};
initializeButtons();
_local5 = 0;
_local6 = false;
_local3 = 0;
while (_local3 < shop_items.length) {
engine.shops.addItem(shop_items[_local3]);
engine.shops.getItem(_local3).initialize(engine);
_local8 = shop_items[_local3];
if ((((_local8 is MyRestaurant)) && (!(_local6)))){
current_resto = _local8;
current_resto.setSelectedState(true);
engine.playWindow.ui.clean_dialog.x = (engine.playWindow.current_resto.x - (engine.playWindow.ui.clean_dialog.width / 2));
engine.playWindow.ui.clean_dialog.y = (engine.playWindow.current_resto.y - engine.playWindow.ui.clean_dialog.height);
_local6 = true;
my_restaurants.push(_local8);
} else {
if ((_local8 is EnemyRestaurant)){
enemy_restaurants.push(_local8);
_local8.resto.enemy_restaurant = true;
} else {
for_sale.push(_local8);
};
};
_local3++;
};
initial_bar_scale = game_ui.resources.goal_bar.bar.scaleX;
initial_enemy_bar_scale = game_ui.resources.goal_bar.bar.scaleX;
game_ui.shop_tooltip.visible = false;
game_ui.shop_tooltip.stop();
game_ui.output_message.visible = false;
game_ui.bonus_animation.visible = false;
game_ui.pause_mc.stop();
game_ui.pause_mc.buttonMode = true;
game_ui.pause_mc.mouseChildren = false;
game_ui.pause_mc.visible = false;
stats = new Statistics();
stats.setEngine(engine);
stats.visible = false;
game_ui.addChild(stats);
game_ui.pause_mc.addEventListener(MouseEvent.MOUSE_DOWN, unpauseHandler);
ui.sound_button.visible = false;
game_ui.tutorial_mc.init(engine);
if (engine.lastLevel.number > 0){
game_ui.removeChild(game_ui.tutorial_mc);
game_ui.tutorial_mc.destroy();
game_ui.tutorial_mc = null;
} else {
game_ui.tutorial_mc.stop();
game_ui.tutorial_mc.visible = true;
};
ui.click_next_day_button.visible = false;
ui.slow_mode_button.visible = false;
ui.sell_dialog.visible = false;
ui.clean_dialog.visible = false;
engine.buttons.update();
game_ui.resources.left_icon.inner.gotoAndStop(engine.resto_type);
game_ui.resources.right_icon.inner.gotoAndStop(((engine.resto_type == StringConsts.sushi)) ? StringConsts.american : StringConsts.sushi);
Events.onBuyRestaurant.add(onBuyRestaurant);
Events.onBeforeUpgrade.add(onBeforeUpgrade);
Events.onLevelUpgrade.add(onLevelUpgrade);
Events.onSimpleShowUpgrade.add(onSimpleShowUpgrade);
Events.onSignboardUpgrade.add(onSignboardUpgrade);
game_ui.buy_button.visible = false;
}
public function get ui(){
return (game_ui);
}
public function updateAll():void{
engine.buttons.update();
updateResources();
if (current_resto){
game_ui.ui_menu.update(current_resto, engine.money);
};
}
public function getRoadCount():int{
var _local1:int;
var _local2:int;
_local1 = 0;
_local2 = 0;
while (_local2 < shop_items.length) {
if (shop_items[_local2].currentLevel == Consts.ShopLevel1){
_local1++;
};
_local2++;
};
return (_local1);
}
public function get levelBack(){
return (level_back);
}
public function get gameBoard():GameBoard{
return (game_board);
}
public function deliveriesGo():void{
var _local1:int;
_local1 = 0;
_local1 = 0;
while (_local1 < shop_items.length) {
engine.shops.getItem(_local1).startDelivery();
_local1++;
};
}
public function showBonus(_arg1:int):void{
ui.bonus_animation.visible = true;
ui.bonus_animation.inner.bonus_txt.text = (("Bonus: " + _arg1.toString()) + "$");
ui.bonus_animation.gotoAndPlay("start_animation");
stats.bonus = (stats.bonus + _arg1);
engine.payMoney(-(_arg1));
if (enemy_restaurants.length > 0){
engine.payEnemyMoney(_arg1);
};
}
public function getNextRoad():RoadPath{
var _local1:ShopItem;
if (shop_index >= shop_items.length){
shop_index = 0;
};
_local1 = shop_items[shop_index];
shop_index++;
if (_local1.currentLevel == Consts.ShopLevel1){
return (_local1.road);
};
return (getNextRoad());
}
public function hasDelivery():Boolean{
var _local1:int;
_local1 = 0;
_local1 = 0;
while (_local1 < shop_items.length) {
if (engine.shops.getItem(_local1).hasDeliveryOn()){
return (true);
};
_local1++;
};
return (false);
}
private function onSignboardUpgrade(_arg1, _arg2:String){
_arg1.resto.upgradeHeader(_arg2);
game_ui.ui_menu.updateAllUpgradesStatus(engine.money);
engine.applyUpgrade(_arg2, _arg1);
}
private function onSimpleShowUpgrade(_arg1, _arg2:String):void{
_arg1.resto.showUpgrade(_arg2);
game_ui.ui_menu.updateAllUpgradesStatus(engine.money);
engine.applyUpgrade(_arg2, _arg1);
if ((((((engine.lastLevel.number == 0)) && ((engine.scenario.currentDay == 0)))) && ((_arg2 == StringConsts.ads1)))){
engine.playWindow.ui.click_next_day_button.visible = true;
};
}
public function generateParticlesOver(_arg1){
var _local2:cartoonsmoke3;
_local2 = new cartoonsmoke3(game_ui);
_local2.x = _arg1.x;
_local2.y = _arg1.y;
if ((_arg1 is ExtraItem)){
if (_arg1.vice_versa){
_local2.x = (_local2.x - 35);
} else {
_local2.x = (_local2.x + 35);
};
};
game_ui.addChild(_local2);
}
private function onBuyRestaurant(_arg1, _arg2:Object){
_arg1.handleClick();
}
private function initializeButtons():void{
engine.buttons.addItem(game_ui.extra_buttons.benches);
engine.buttons.addItem(game_ui.extra_buttons.news_box);
engine.buttons.addItem(game_ui.extra_buttons.ice_cream);
engine.buttons.addItem(game_ui.extra_buttons.benches_grey);
engine.buttons.addItem(game_ui.extra_buttons.news_box_grey);
engine.buttons.addItem(game_ui.extra_buttons.ice_cream_grey);
}
public function updateResources():void{
var _local1:Number;
var _local2:Number;
if (!engine.scenario){
return;
};
game_ui.ui_menu.money_txt.text = engine.playerMoney.toString();
_local1 = ((engine.goalMoney / engine.lastLevel.money_goal) * 100);
_local2 = ((engine.enemyGoalMoney / engine.lastLevel.money_goal) * 100);
game_ui.resources.goal_bar.goal_txt.text = (sprintf("%.2f", _local1) + "%");
game_ui.resources.enemy_goal_bar.goal_txt.text = (sprintf("%.2f", _local2) + "%");
if (_local1 <= 100){
game_ui.resources.goal_bar.bar.scaleX = ((engine.goalMoney / engine.lastLevel.money_goal) * initial_bar_scale);
} else {
game_ui.resources.goal_bar.bar.scaleX = initial_bar_scale;
};
if (_local2 <= 100){
game_ui.resources.enemy_goal_bar.bar.scaleX = ((engine.enemyGoalMoney / engine.lastLevel.money_goal) * initial_enemy_bar_scale);
} else {
game_ui.resources.enemy_goal_bar.bar.scaleX = initial_enemy_bar_scale;
};
game_ui.resources.wave_txt.text = ((engine.scenario.currentDay.toString() + "/") + engine.lastLevel.days.toString());
next_day_blocked = ((((!((engine.customers.size() == 0))) || (!(engine.scenario.isBuyerQueueEmpty())))) || (hasDelivery()));
if (next_day_blocked){
engine.playWindow.ui.next_day_button.alpha = 0.5;
} else {
updateCleans();
engine.playWindow.ui.next_day_button.alpha = 1;
};
engine.playWindow.ui.clean_dialog.visible = current_resto.green_steam.visible;
if (current_resto){
game_ui.ui_menu.all_buttons.employees.number_txt.text = current_resto.workers.toString();
game_ui.ui_menu.all_buttons.employees.cost_txt.text = current_resto.hireCost().toString();
engine.events.employeeOutHandler(null);
game_ui.ui_menu.all_buttons.seat_count_txt.text = current_resto.shopBar.shopCapacity.toString();
game_ui.ui_menu.all_buttons.product_cost_txt.text = (sprintf("%.2f", current_resto.moneyValue) + " $");
game_ui.ui_menu.all_buttons.serving_speed_txt.text = current_resto.servingSpeed();
game_ui.ui_menu.exclamation.visible = (current_resto.servingSpeed() == "Slow");
};
}
public function get customersHolder(){
return (ui.customers);
}
public function get shopItems():Array{
return (shop_items);
}
private function updateCleans():void{
var _local1:int;
_local1 = 0;
while (_local1 < my_restaurants.length) {
my_restaurants[_local1].updateClean();
_local1++;
};
}
private function onLevelUpgrade(_arg1, _arg2:int):void{
_arg1.resto.setLevel(_arg2);
game_ui.ui_menu.updateAllUpgradesStatus(engine.money);
if (engine.resto_type == StringConsts.american){
if (2 == _arg2){
engine.applyUpgrade(StringConsts.american_second_floor, _arg1);
} else {
if (3 == _arg2){
engine.applyUpgrade(StringConsts.american_third_floor, _arg1);
};
};
} else {
if (2 == _arg2){
engine.applyUpgrade(StringConsts.sushi_second_floor, _arg1);
} else {
if (3 == _arg2){
engine.applyUpgrade(StringConsts.sushi_third_floor, _arg1);
};
};
};
generateParticlesOver(_arg1);
}
private function onBeforeUpgrade(_arg1, _arg2:int):void{
if (!_arg1.shopBar.isFree()){
throw (new ShopIsFullError());
};
if (engine.money >= _arg2){
engine.payMoney(_arg2);
} else {
engine.log(StringConsts.not_enough_money);
throw (new NotEnoughMoneyError());
};
updateResources();
}
}
}//package fai.logic
Section 130
//RoadGraph (fai.logic.RoadGraph)
package fai.logic {
import fai.ui.*;
public class RoadGraph {
private var road:RoadPath;// = null
private var counter:int;// = 0
public function RoadGraph(_arg1:RoadPath):void{
road = null;
counter = 0;
super();
road = _arg1;
}
public function lookAnyNext():RoadPoint{
if (counter >= road.points.size()){
return (road.points.values[(road.points.size() - 1)]);
};
return (road.points.values[counter]);
}
public function getNext():RoadPoint{
if ((counter + 1) >= road.points.size()){
return (null);
};
counter++;
return (road.points.values[counter]);
}
public function getFirst():RoadPoint{
counter = 0;
return (road.firstNode());
}
}
}//package fai.logic
Section 131
//Scenario (fai.logic.Scenario)
package fai.logic {
import fai.goals.*;
import fai.*;
public class Scenario {
private var engine:Engine;// = null
private var buyer_queue:Array;
private var level:Level;// = null
private var generate_pause:int;// = 0
private var current_day:int;// = 0
private var ai:AI;// = null
private static const GENERATE_PAUSE:int = 19;
public function Scenario(_arg1:Engine, _arg2:Level):void{
engine = null;
buyer_queue = [];
level = null;
current_day = 0;
generate_pause = 0;
ai = null;
super();
engine = _arg1;
level = _arg2;
ai = new AI(engine);
}
private function generateCustomers():void{
var _local1:int;
var _local2:Array;
_local1 = 0;
_local2 = engine.playWindow.shopItems;
_local1 = 0;
while (_local1 < _local2.length) {
if (_local2[_local1].currentLevel == Consts.ShopLevel1){
generateCustomersForShop(_local2[_local1]);
};
_local1++;
};
}
public function get currentDay():int{
return (current_day);
}
private function victoryCondition():Boolean{
return ((((engine.goalMoney >= level.money_goal)) || (((((((isBuyerQueueEmpty()) && ((engine.customers.size() == 0)))) && ((current_day >= level.days)))) && ((engine.goalMoney > engine.enemyGoalMoney))))));
}
public function think():void{
if (victoryCondition()){
engine.victory();
return;
};
if (gameOverCondition()){
engine.gameOver();
return;
};
}
public function isBuyerQueueEmpty():Boolean{
var _local1:int;
_local1 = 0;
_local1 = 0;
while (_local1 < buyer_queue.length) {
if (buyer_queue[_local1].length > 0){
return (false);
};
_local1++;
};
return (true);
}
private function gameOverCondition():Boolean{
return ((((engine.enemyGoalMoney >= level.money_goal)) || (((((((isBuyerQueueEmpty()) && ((engine.customers.size() == 0)))) && ((current_day >= level.days)))) && ((engine.goalMoney < level.money_goal))))));
}
public function generate():void{
var _local1:int;
var _local2:Array;
var _local3:Customer;
var _local4:BuyerGoal;
if (generate_pause > 0){
generate_pause--;
return;
};
generate_pause = GENERATE_PAUSE;
if (!isBuyerQueueEmpty()){
_local1 = 0;
_local1 = 0;
while (_local1 < buyer_queue.length) {
_local2 = buyer_queue[_local1];
if (_local2.length > 0){
_local3 = _local2.shift();
_local4 = new BuyerGoal(engine, _local3);
engine.goal_system.add(_local4);
};
_local1++;
};
};
}
public function nextDay():void{
if (current_day >= level.days){
return;
};
ai.doAILogic(level.number, current_day);
engine.not_spent = false;
current_day++;
generateCustomers();
engine.upgrades.nextDay();
engine.playWindow.updateResources();
engine.playWindow.deliveriesGo();
engine.playWindow.next_day_blocked = true;
engine.playWindow.ui.next_day_button.alpha = 0.5;
}
public function generateCustomersForShop(_arg1:ShopItem):void{
var _local2:int;
var _local3:Customer;
var _local4:int;
var _local5:Array;
_local2 = DataProxy.getBuyerCount(current_day);
if (((_arg1.resto) && ((_arg1.shopType == engine.resto_type)))){
if (((_arg1.resto.isUpgradeDone(StringConsts.american_summer_seats)) || (_arg1.resto.isUpgradeDone(StringConsts.sushi_summer_seats)))){
_local2 = (_local2 + 5);
};
if (((_arg1.resto.isUpgradeDone(StringConsts.underground_bar_american)) || (_arg1.resto.isUpgradeDone(StringConsts.underground_bar_sushi)))){
_local2 = (_local2 + 6);
};
if (((_arg1.resto.isUpgradeDone(StringConsts.american_second_floor)) || (_arg1.resto.isUpgradeDone(StringConsts.sushi_second_floor)))){
_local2 = (_local2 + 10);
};
if (((_arg1.resto.isUpgradeDone(StringConsts.american_third_floor)) || (_arg1.resto.isUpgradeDone(StringConsts.sushi_third_floor)))){
_local2 = (_local2 + 10);
};
};
_local3 = null;
_local4 = 0;
_local5 = new Array();
buyer_queue.push(_local5);
_local4 = 0;
while (_local4 < _local2) {
_local3 = DataProxy.getCustomer(current_day);
_local3.setEngine(engine);
_local3.setRoad(_arg1.road);
_local3.shop = _arg1;
_local5.push(_local3);
_local4++;
};
}
}
}//package fai.logic
Section 132
//ShopItem (fai.logic.ShopItem)
package fai.logic {
import fai.ui.*;
import flash.display.*;
import flash.filters.*;
import flash.text.*;
import fai.common.*;
import fai.goals.*;
import game.restaurant.*;
import fai.*;
public class ShopItem extends MovieClip {
public var building_bar:MovieClip;
protected var delivery_on:Boolean;// = false
protected var buying_ticks:Number;// = 1
protected var color_matrix:Array;// = null
protected var shop_sprite;// = null
protected var customer_bar:ShopCustomerBar;// = null
protected var engine:Engine;// = null
public var hammer_icon:MovieClip;
private var serving_speed:String;// = "-"
public var health:Number;// = 100
protected var seat_count:int;// = 0
private var delivery_goal:DeliveryGoal;// = null
protected var current_employee_cost:int;// = 50
public var show_clean:Boolean;// = false
public var move_beacon:Sprite;
public var shoppable:Boolean;// = true
public var platform:MovieClip;
public var delivery_road;// = null
public var price_txt:TextField;
public var workers:int;// = 0
protected var awaits_building:Boolean;// = false
public var green_steam:MovieClip;
public var resto;// = null
public var road;// = null
protected var building_icon;// = null
protected var money_value:Number;// = 10
protected var type:String;
public var thief_icon:MovieClip;
protected var number:int;// = 0
public var initial_building:MovieClip;
protected var particles_goal;// = null
protected var level:int;// = 0
public var selected_red_platform:MovieClip;
public var no_thefts:Boolean;// = false
public var selected_platform:MovieClip;
protected var upgrading_goal:UpgradingGoal;// = null
protected var building_goal:BuildingGoal;// = null
public var busy:Boolean;// = false
public function ShopItem():void{
engine = null;
level = 0;
building_icon = null;
color_matrix = null;
number = 0;
particles_goal = null;
awaits_building = false;
building_goal = null;
upgrading_goal = null;
shop_sprite = null;
customer_bar = null;
money_value = 10;
shoppable = true;
health = 100;
busy = false;
resto = null;
workers = 0;
current_employee_cost = 50;
seat_count = 0;
no_thefts = false;
buying_ticks = 1;
delivery_on = false;
show_clean = false;
serving_speed = "-";
road = null;
delivery_road = null;
delivery_goal = null;
super();
move_beacon.visible = false;
hammer_icon.visible = false;
hammer_icon.stop();
thief_icon.visible = false;
thief_icon.stop();
green_steam.visible = false;
green_steam.stop();
if (selected_red_platform){
selected_red_platform.visible = false;
};
setSelectedState(false);
if (price_txt){
price_txt.text = (("Buy: " + MoneyConsts.INITIAL_BUY_FOR.toString()) + "$");
};
}
protected function recalcBuyingTicks():void{
serving_speed = "Slow";
buying_ticks = (4 / seat_count);
if (seat_count <= 5){
if (workers > 3){
buying_ticks = 2;
serving_speed = "Super Fast";
} else {
if (workers > 2){
buying_ticks = 1.5;
serving_speed = "Very Fast";
} else {
if (workers > 1){
buying_ticks = 1.1;
serving_speed = "Fast";
} else {
serving_speed = "Slow";
buying_ticks = 0.7;
};
};
};
} else {
if (seat_count <= 9){
buying_ticks = 0.5;
if (workers > 4){
buying_ticks = 1.1;
serving_speed = "Super Fast";
} else {
if (workers > 3){
buying_ticks = 0.9;
serving_speed = "Very Fast";
} else {
if (workers > 2){
buying_ticks = 0.7;
serving_speed = "Fast";
} else {
if (workers < 3){
serving_speed = "Slow";
buying_ticks = 0.44;
};
};
};
};
} else {
if (seat_count <= 12){
if (workers > 7){
buying_ticks = 1.15;
serving_speed = "Super Fast";
} else {
if (workers > 6){
buying_ticks = 0.75;
serving_speed = "Very Fast";
} else {
if (workers > 5){
buying_ticks = 0.55;
serving_speed = "Fast";
} else {
if (workers > 4){
buying_ticks = 0.43;
serving_speed = "Average";
} else {
serving_speed = "Slow";
buying_ticks = 0.3;
};
};
};
};
} else {
if (seat_count < 20){
if (workers > 8){
buying_ticks = 1;
serving_speed = "Super Fast";
} else {
if (workers > 7){
buying_ticks = 0.5;
serving_speed = "Very Fast";
} else {
if (workers > 6){
buying_ticks = 0.35;
serving_speed = "Fast";
} else {
if (workers > 5){
buying_ticks = 0.25;
serving_speed = "Average";
} else {
serving_speed = "Slow";
buying_ticks = 0.18;
};
};
};
};
} else {
if (seat_count <= 22){
if (workers > 9){
buying_ticks = 1;
serving_speed = "Super Fast";
} else {
if (workers > 8){
buying_ticks = 0.4;
serving_speed = "Very Fast";
} else {
if (workers > 7){
buying_ticks = 0.3;
serving_speed = "Fast";
} else {
if (workers > 6){
buying_ticks = 0.21;
serving_speed = "Average";
} else {
serving_speed = "Slow";
buying_ticks = 0.15;
};
};
};
};
} else {
if (seat_count <= 26){
if (workers > 10){
buying_ticks = 0.7;
serving_speed = "Super Fast";
} else {
if (workers > 9){
buying_ticks = 0.37;
serving_speed = "Very Fast";
} else {
if (workers > 8){
buying_ticks = 0.25;
serving_speed = "Fast";
} else {
if (workers > 7){
buying_ticks = 0.15;
serving_speed = "Average";
} else {
serving_speed = "Slow";
buying_ticks = 0.1;
};
};
};
};
} else {
if (seat_count <= 29){
if (workers > 11){
buying_ticks = 0.7;
serving_speed = "Super Fast";
} else {
if (workers > 10){
buying_ticks = 0.27;
serving_speed = "Very Fast";
} else {
if (workers > 9){
buying_ticks = 0.21;
serving_speed = "Fast";
} else {
if (workers > 8){
buying_ticks = 0.16;
serving_speed = "Average";
} else {
serving_speed = "Slow";
buying_ticks = 0.11;
};
};
};
};
} else {
if (seat_count <= 36){
if (workers > 13){
buying_ticks = 0.5;
serving_speed = "Super Fast";
} else {
if (workers > 12){
buying_ticks = 0.2;
serving_speed = "Very Fast";
} else {
if (workers > 11){
buying_ticks = 0.15;
serving_speed = "Fast";
} else {
if (workers > 10){
buying_ticks = 0.12;
serving_speed = "Average";
} else {
serving_speed = "Slow";
buying_ticks = 0.1;
};
};
};
};
} else {
if (seat_count <= 46){
if (workers > 15){
buying_ticks = 0.4;
serving_speed = "Super Fast";
} else {
if (workers > 14){
buying_ticks = 0.19;
serving_speed = "Very Fast";
} else {
if (workers > 13){
buying_ticks = 0.12;
serving_speed = "Fast";
} else {
if (workers > 12){
buying_ticks = 0.1;
serving_speed = "Average";
} else {
serving_speed = "Slow";
buying_ticks = 0.09;
};
};
};
};
} else {
if (workers > 20){
buying_ticks = 0.4;
serving_speed = "Super Fast";
} else {
if (workers > 19){
buying_ticks = 0.15;
serving_speed = "Very Fast";
} else {
if (workers > 18){
buying_ticks = 0.1;
serving_speed = "Fast";
} else {
if (workers > 17){
buying_ticks = 0.09;
serving_speed = "Average";
} else {
serving_speed = "Slow";
buying_ticks = 0.07;
};
};
};
};
};
};
};
};
};
};
};
};
};
if (((engine) && (engine.scenario))){
};
customer_bar.updateBuyingTicks();
}
public function hideBuildingState():void{
awaits_building = false;
stopParticles();
if (building_icon){
removeChild(building_icon);
building_icon = null;
};
}
public function isUpgradeDone(_arg1:String):Boolean{
if (!resto){
return (false);
};
return (resto.isUpgradeDone(_arg1));
}
public function get itemNumber():int{
return (number);
}
public function handleClick():void{
if (0 == currentLevel){
setType(engine.resto_type);
engine.shops.hideBuildingIcons();
visible = true;
startBuilding();
};
}
public function setLevel(_arg1:int):void{
if (level != _arg1){
level = _arg1;
engine.playWindow.updateAll();
};
}
public function startDelivery():void{
if (((delivery_on) && (!(delivery_goal)))){
delivery_goal = new DeliveryGoal(engine, this);
engine.goal_system.add(delivery_goal);
};
}
public function updateRepairState():void{
if (health < 20){
show_clean = true;
} else {
hammer_icon.stop();
hammer_icon.visible = false;
green_steam.stop();
green_steam.visible = false;
};
}
public function startParticles():void{
stopParticles();
particles_goal = new VParticleEffectGoal(this);
engine.goal_system.add(particles_goal);
}
public function deliveryFinished():void{
delivery_goal = null;
}
public function setNumber(_arg1:int):void{
number = _arg1;
}
public function get moneyValue():Number{
return (money_value);
}
public function addToMoneyValue(_arg1:Number):void{
money_value = (money_value + _arg1);
}
public function cancel():void{
if (underBuilding()){
building_goal.deactivate();
building_goal = null;
visible = false;
gotoAndStop("building_state");
building_bar.bar.scaleX = 1;
engine.returnMoney(DataProxy.getBuildCost(type, 0));
type = "";
awaits_building = false;
setLevel(0);
level = 0;
} else {
if (underUpgrading()){
upgrading_goal.cancel();
upgrading_goal = null;
engine.returnMoney(DataProxy.getBuildCost(type, (level + 1)));
};
};
}
public function increaseWorkersCount():void{
workers++;
if (workers == 1){
current_employee_cost = 50;
} else {
current_employee_cost = (current_employee_cost + 50);
};
recalcBuyingTicks();
}
public function get shopId(){
return (this);
}
public function setType(_arg1:String):void{
type = _arg1;
if (!resto){
if (StringConsts.american == type){
resto = new AmericanRestaurant();
resto.setShopParentForAll(this);
} else {
resto = new SushiRestaurant();
resto.setShopParentForAll(this);
};
};
if (engine.resto_type != type){
if (selected_red_platform){
selected_red_platform.visible = true;
selected_platform.visible = false;
} else {
setSelectedState(true);
};
};
}
protected function trySpecialCase():void{
var _local1:Number;
if (health > 35){
return;
};
_local1 = Math.random();
if (engine.scenario.currentDay > 6){
if (((((!(no_thefts)) && ((_local1 < 0.01)))) && (!(thief_icon.visible)))){
engine.goal_system.add(new ThiefGoal(engine, this));
engine.playSound(SoundConsts.robbery);
};
};
}
public function stopParticles():void{
if (particles_goal){
particles_goal.deactivate();
particles_goal = null;
};
}
public function hireCost():int{
return (current_employee_cost);
}
public function doSellLogic():void{
setLevel(0);
setShopIcon(null);
customer_bar.visible = false;
customer_bar.destroy();
hammer_icon.visible = false;
hammer_icon.stop();
green_steam.stop();
green_steam.visible = false;
visible = false;
}
public function deliveryOn():void{
delivery_on = true;
}
public function get shopHealth():int{
return (health);
}
public function getRepairCost():Number{
return ((MoneyConsts.CLEAN_COST * seat_count));
}
public function updateClean():void{
if (!show_clean){
return;
};
if (false == hammer_icon.visible){
engine.playSound(SoundConsts.clean_alarm);
};
hammer_icon.play();
hammer_icon.visible = true;
green_steam.play();
green_steam.visible = true;
if (engine.playWindow.current_resto == this){
engine.playWindow.ui.clean_dialog.money_txt.text = (getRepairCost().toString() + "$");
};
}
public function startEnemyBuilding():void{
if (engine.playWindow.current_resto == this){
setSelectedState(false);
if (engine.playWindow.my_restaurants.length > 0){
engine.playWindow.current_resto = engine.playWindow.my_restaurants[0];
engine.playWindow.current_resto.setSelectedState(true);
engine.playWindow.current_resto.updateRepairState();
engine.playWindow.updateAll();
} else {
engine.playWindow.current_resto = null;
};
};
setType(((engine.resto_type == StringConsts.american)) ? StringConsts.sushi : StringConsts.american);
engine.shops.hideBuildingIcons();
visible = true;
engine.playWindow.for_sale.remove(this);
engine.playWindow.enemy_restaurants.push(this);
resto.enemy_restaurant = true;
building_goal = new BuildingGoal(engine, this);
engine.goal_system.add(building_goal);
}
public function setShopIcon(_arg1):void{
if (shop_sprite){
removeChild(shop_sprite);
shop_sprite = null;
};
if (_arg1){
shop_sprite = _arg1;
Utils.posPlatforms(shop_sprite, this);
addChild(shop_sprite);
swapChildren(customer_bar, shop_sprite);
removeChild(hammer_icon);
hammer_icon.visible = false;
addChild(hammer_icon);
removeChild(thief_icon);
thief_icon.visible = false;
addChild(thief_icon);
updateRepairState();
platform.visible = false;
};
}
public function hasDeliveryOn():Boolean{
return (((delivery_goal) && (delivery_goal.active)));
}
public function addMoreSeats(_arg1:int):void{
seat_count = (seat_count + _arg1);
customer_bar.create(seat_count);
customer_bar.x = building_bar.x;
customer_bar.y = building_bar.y;
if (((shop_sprite) && ((getChildIndex(customer_bar) < getChildIndex(shop_sprite))))){
swapChildren(customer_bar, shop_sprite);
};
recalcBuyingTicks();
}
public function getShopBuyingTicks():Number{
return (buying_ticks);
}
public function get deliveryGoal():DeliveryGoal{
return (delivery_goal);
}
public function startBuilding():void{
engine.payMoney(engine.getBuildCost());
engine.playWindow.for_sale.remove(this);
engine.playWindow.my_restaurants.push(this);
building_goal = new BuildingGoal(engine, this);
engine.goal_system.add(building_goal);
}
public function get shopBar():ShopCustomerBar{
return (customer_bar);
}
public function updateState():void{
customer_bar.destroy();
if (((shoppable) && (shop_sprite))){
addMoreSeats(MoneyConsts.INITIAL_SEATS);
increaseWorkersCount();
money_value = MoneyConsts.INITIAL_MONEY_VALUE;
if (initial_building){
initial_building.visible = false;
};
};
engine.showTooltip(null);
}
public function get shopType():String{
return (type);
}
public function setUpgradingState():void{
setLevel(Consts.ShopUpgrading);
}
public function reset():void{
busy = false;
thief_icon.stop();
thief_icon.visible = false;
repair();
}
public function getShopSprite(){
return (shop_sprite);
}
public function setBuildingState(_arg1:String):void{
}
public function setSelectedState(_arg1:Boolean):void{
if (((selected_red_platform) && (selected_red_platform.visible))){
return;
};
selected_platform.visible = _arg1;
}
public function sell():void{
engine.returnMoney(getSellCost());
doSellLogic();
}
public function get currentLevel():int{
return (level);
}
public function initialize(_arg1:Engine):void{
engine = _arg1;
customer_bar = new ShopCustomerBar();
customer_bar.assign(engine, this);
customer_bar.visible = false;
addChild(customer_bar);
building_bar.visible = false;
stop();
buttonMode = true;
mouseChildren = false;
}
public function servingSpeed():String{
return (serving_speed);
}
public function repair():void{
health = 100;
show_clean = false;
updateRepairState();
}
public function startUpgrading():void{
if (!customer_bar.wereCreated()){
return;
};
if (!customer_bar.isFree()){
engine.log("You can't upgrade the shop when the customers are shopping.");
return;
};
engine.payMoney(DataProxy.getBuildCost(type, (level + 1)));
upgrading_goal = new UpgradingGoal(engine, this);
engine.goal_system.add(upgrading_goal);
}
public function get awaitsBuilding():Boolean{
return (awaits_building);
}
public function underBuilding():Boolean{
return (((building_goal) && (building_goal.active)));
}
public function getSellCost():Number{
var _local1:Number;
_local1 = (DataProxy.getBuildCost(type, level) * Consts.SellDownturn);
_local1 = (_local1 * (health / 100));
return (_local1);
}
public function underUpgrading():Boolean{
return (((upgrading_goal) && (upgrading_goal.active)));
}
public function customerPassed():void{
if (((!(engine.playWindow)) || (!((type == engine.resto_type))))){
return;
};
health = (health - Consts.ShopHealthPortion);
if (health < 1){
health = 1;
};
updateRepairState();
if (shoppable){
trySpecialCase();
};
}
public function showMenu(_arg1:Boolean):void{
if (_arg1){
startParticles();
} else {
stopParticles();
};
if (_arg1){
};
engine.playWindow.ui.sell_dialog.visible = _arg1;
if (health < 30){
engine.playWindow.ui.repair_dialog.visible = _arg1;
} else {
engine.playWindow.ui.repair_dialog.visible = false;
};
engine.playWindow.ui.repair_dialog.money_txt.text = (getRepairCost().toString() + "$");
engine.playWindow.ui.sell_dialog.money_txt.text = (getSellCost().toString() + "$");
}
}
}//package fai.logic
Section 133
//Shops (fai.logic.Shops)
package fai.logic {
import flash.events.*;
public class Shops {
private var engine:Engine;// = null
private var building_type:String;
private var shops:Array;
public function Shops(_arg1:Engine):void{
engine = null;
shops = [];
super();
engine = _arg1;
}
public function size():int{
return (shops.length);
}
public function getItem(_arg1:int):ShopItem{
return (shops[_arg1]);
}
public function hideBuildingIcons():void{
}
public function get buildingType():String{
return (building_type);
}
public function showBuildingIcons(_arg1:String):void{
}
public function awaitBuilding():Boolean{
return (false);
}
public function getItemByType(_arg1:String):ShopItem{
var _local2:int;
_local2 = 0;
_local2 = 0;
while (_local2 < shops.length) {
if (shops[_local2].shopType == _arg1){
return (shops[_local2]);
};
_local2++;
};
return (null);
}
public function addItem(_arg1:ShopItem):void{
_arg1.setNumber(shops.length);
shops.push(_arg1);
}
public function hideMenus():void{
}
public function hasType(_arg1:String):Boolean{
var _local2:int;
_local2 = 0;
_local2 = 0;
while (_local2 < shops.length) {
if (((((!((shops[_local2] == null))) && ((shops[_local2].currentLevel > 0)))) && ((shops[_local2].shopType == _arg1)))){
return (true);
};
_local2++;
};
return (false);
}
public function destroy():void{
}
}
}//package fai.logic
Section 134
//ShopSeat (fai.logic.ShopSeat)
package fai.logic {
public class ShopSeat {
public var loaded:Boolean;// = false
public var percents:Number;// = 0
public var velocity:Number;// = 1
public var customer:Customer;// = null
public function ShopSeat():void{
loaded = false;
percents = 0;
velocity = 1;
customer = null;
super();
}
}
}//package fai.logic
Section 135
//Upgrades (fai.logic.Upgrades)
package fai.logic {
import fai.*;
public class Upgrades {
public var bus_stop:Boolean;// = false
private var engine:Engine;// = null
private var bus_loops:int;// = 0
public function Upgrades(_arg1:Engine):void{
bus_stop = false;
bus_loops = 0;
engine = null;
super();
engine = _arg1;
}
public function addBusLoop():void{
bus_loops++;
}
public function upgradeBusStop():void{
if (bus_stop){
return;
};
bus_stop = true;
engine.playWindow.ui.bus_stop.gotoAndPlay("start_animation");
engine.playWindow.ui.bus_stop_sign.gotoAndPlay("start_animation");
if (engine.scenario.currentDay > 0){
addBusLoop();
};
}
public function carsStopped():void{
if (bus_loops == 0){
return;
};
engine.playWindow.ui.car_motion.stop();
engine.playWindow.ui.bus_clip.gotoAndPlay("start_animation");
}
public function decBusLoop():void{
bus_loops--;
}
public function busWent():Boolean{
if (((!(bus_stop)) || ((bus_loops == 0)))){
return (true);
};
return (false);
}
public function nextDay():void{
if (bus_stop){
addBusLoop();
};
}
}
}//package fai.logic
Section 136
//CoinMotion (fai.ui.CoinMotion)
package fai.ui {
import flash.display.*;
public class CoinMotion extends MovieClip {
public var finished:Boolean;// = false
public function CoinMotion():void{
finished = false;
super();
addFrameScript(31, frame32);
}
function frame32(){
finished = true;
}
}
}//package fai.ui
Section 137
//CustomersBar (fai.ui.CustomersBar)
package fai.ui {
import flash.display.*;
public dynamic class CustomersBar extends Sprite {
public var bar:MovieClip;
}
}//package fai.ui
Section 138
//Delivery (fai.ui.Delivery)
package fai.ui {
import fai.logic.*;
import flash.display.*;
import fai.common.*;
import fai.goals.*;
import fai.*;
public dynamic class Delivery extends MovieClip {
private var delivery_started:Boolean;// = false
private var parent_item;// = null
public var dboy:MovieClip;
public function Delivery():void{
parent_item = null;
delivery_started = false;
super();
}
public function getMoney():void{
GameStage.welcomeScreen.engineInstance.payMoney(-(DataProxy.getCustomerInitialMoney(GameStage.welcomeScreen.engineInstance.scenario.currentDay)));
}
public function startDelivery():void{
if (!delivery_started){
gotoAndPlay("start_delivery");
delivery_started = true;
visible = true;
};
}
public function deliveryFinished():void{
delivery_started = false;
if (parent_item){
parent_item.deliveryFinished();
};
}
public function isOn():Boolean{
return (delivery_started);
}
public function setParent(_arg1):void{
parent_item = _arg1;
}
}
}//package fai.ui
Section 139
//ExtraItem (fai.ui.ExtraItem)
package fai.ui {
import fai.logic.*;
import flash.display.*;
import fai.*;
public class ExtraItem extends MovieClip {
private var loaded:int;// = 0
private var seats:Array;
private var seats_length:int;// = 0
private var current_state:String;
private var engine:Engine;// = null
public var vice_versa:Boolean;// = false
private var awaits:Boolean;// = false
public var inner_extra:MovieClip;
public function ExtraItem():void{
var _local1:int;
engine = null;
awaits = false;
loaded = 0;
seats = [];
seats_length = 0;
vice_versa = false;
super();
addFrameScript(0, frame1, 1, frame2);
current_state = StringConsts.empty;
seats.length = 10;
_local1 = 0;
_local1 = 0;
while (_local1 < seats.length) {
seats[_local1] = null;
_local1++;
};
}
public function loadCustomer(_arg1:Customer):int{
var _local2:int;
if (hasRoom()){
_local2 = 0;
_local2 = 0;
while (_local2 < seats_length) {
if (seats[_local2] == null){
seats[_local2] = _arg1;
loaded++;
return ((_local2 + 1));
};
_local2++;
};
};
return (-1);
}
public function setCurrentState(_arg1:String):void{
current_state = _arg1;
correctState();
}
public function get isAwaiting():Boolean{
return (awaits);
}
public function setEngine(_arg1:Engine):void{
engine = _arg1;
}
public function setAwaiting(_arg1:Boolean):void{
awaits = _arg1;
}
public function correctState():void{
switch (current_state){
case StringConsts.bench:
inner_extra.gotoAndStop(StringConsts.bench);
seats_length = Consts.BenchSpace;
break;
case StringConsts.news_box:
inner_extra.gotoAndStop(StringConsts.news_box);
seats_length = Consts.NewsBoxSpace;
break;
case StringConsts.ice_cream:
inner_extra.gotoAndStop(StringConsts.ice_cream);
seats_length = Consts.IceCreamSpace;
break;
};
}
public function sell():void{
engine.returnMoney((DataProxy.getExtraBuildCost(current_state) * Consts.SellDownturn));
visible = false;
current_state = StringConsts.empty;
}
function frame1(){
stop();
correctState();
}
public function setNormalState():void{
gotoAndStop("normal");
correctState();
}
function frame2(){
correctState();
}
public function get currentState():String{
return (current_state);
}
public function hasRoom():Boolean{
switch (current_state){
case StringConsts.bench:
if (loaded >= Consts.BenchSpace){
return (false);
};
break;
case StringConsts.news_box:
if (loaded >= Consts.NewsBoxSpace){
return (false);
};
break;
case StringConsts.ice_cream:
if (loaded >= Consts.IceCreamSpace){
return (false);
};
break;
};
return (true);
}
public function setSketchyState():void{
gotoAndStop("sketchy");
correctState();
}
public function unloadCustomer(_arg1:Customer):void{
var _local2:int;
if (loaded > 0){
_local2 = 0;
_local2 = 0;
while (_local2 < seats_length) {
if (seats[_local2] == _arg1){
seats[_local2] = null;
loaded--;
return;
};
_local2++;
};
};
}
}
}//package fai.ui
Section 140
//LevelButton (fai.ui.LevelButton)
package fai.ui {
import fai.logic.*;
import flash.display.*;
import flash.filters.*;
public class LevelButton extends MovieClip {
public var filter_back:MovieClip;
private var engine:Engine;// = null
private var level_id:int;// = 0
public var red_back:MovieClip;
public var won_back:MovieClip;
public function LevelButton():void{
engine = null;
level_id = 0;
super();
}
public function select(_arg1:Boolean):void{
var _local2:BitmapFilter;
var _local3:Array;
if (_arg1){
_local2 = getBitmapFilter();
_local3 = new Array();
_local3.push(_local2);
filter_back.filters = _local3;
} else {
filter_back.filters = new Array();
};
}
public function levelClosed():void{
clear();
red_back.visible = true;
won_back.visible = false;
}
public function levelCurrent():void{
clear();
red_back.visible = true;
won_back.visible = false;
startAnimation();
}
public function levelWon():void{
clear();
won_back.visible = true;
red_back.visible = false;
}
public function initialize(_arg1:Engine, _arg2:int):void{
engine = _arg1;
level_id = _arg2;
buttonMode = true;
mouseChildren = false;
}
public function clear():void{
stopAnimation();
}
public function stopAnimation():void{
}
public function startAnimation():void{
stopAnimation();
}
public function get levelId():int{
return (level_id);
}
private function getBitmapFilter():BitmapFilter{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Boolean;
var _local7:Boolean;
var _local8:Number;
_local1 = 9540095;
_local2 = 1;
_local3 = 35;
_local4 = 35;
_local5 = 3;
_local6 = false;
_local7 = false;
_local8 = BitmapFilterQuality.HIGH;
return (new GlowFilter(_local1, _local2, _local3, _local4, _local5, _local8, _local6, _local7));
}
}
}//package fai.ui
Section 141
//LevelInfoPanel (fai.ui.LevelInfoPanel)
package fai.ui {
import fai.logic.*;
import flash.display.*;
import flash.text.*;
public class LevelInfoPanel extends MovieClip {
public var resume_game_button:SimpleButton;
public var title:TextField;
public var desc:TextField;
public var days_txt:TextField;
public var play_button:SimpleButton;
public var goal_amount_txt:TextField;
public function showLevelInfo(_arg1:Level):void{
if (_arg1){
title.text = _arg1.type;
days_txt.text = _arg1.days.toString();
};
}
}
}//package fai.ui
Section 142
//LevelSelection (fai.ui.LevelSelection)
package fai.ui {
import fai.logic.*;
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.text.*;
import fai.common.*;
import flash.utils.*;
import fai.*;
import flash.net.*;
public class LevelSelection extends Sprite {
private var level_msg_timer:Timer;// = null
public var level3_front:MovieClip;
public var instructions_button:SimpleButton;
public var sound_control:MovieClip;
public var level5_back:MovieClip;
public var current_level:int;// = 0
public var dedegames_button:SimpleButton;
public var level4_type_button:MovieClip;
private var engine:Engine;// = null
public var level2_back:MovieClip;
public var level6_type_button:MovieClip;
private var music_sound:Sound;// = null
public var level2_type_button:MovieClip;
public var level4_front:MovieClip;
public var level_info:MovieClip;
private var hello_closed:Boolean;// = false
public var level4_back:MovieClip;
public var level1_front:MovieClip;
public var level_msg:MovieClip;
public var level5_front:MovieClip;
public var level1_back:MovieClip;
public var level1_type_button:MovieClip;
public var level5_type_button:MovieClip;
public var level3_type_button:MovieClip;
public var level6_back:MovieClip;
private var level_array:Array;
public var music_channel:SoundChannel;// = null
public var level6_front:MovieClip;
public var main_menu_button:SimpleButton;
public var level3_back:MovieClip;
public var level2_front:MovieClip;
public function LevelSelection():void{
engine = null;
current_level = 0;
level_array = [];
level_msg_timer = null;
hello_closed = false;
music_sound = null;
music_channel = null;
super();
}
private function resumeGameClickHandler(_arg1:MouseEvent):void{
visible = false;
stopMusic();
engine.playSound(SoundConsts.click);
engine.play_window.show();
engine.pause();
}
public function loadLevels():void{
var _local1:*;
_local1 = SharedObject.getLocal(("restowars_3" + engine.resto_type), "/");
current_level = _local1.data.current_level;
}
public function initializeLevelButtons(_arg1:Array):void{
var _local2:int;
_local2 = 0;
_local2 = 0;
while (_local2 < level_array.length) {
level_array[_local2][0].addEventListener(MouseEvent.MOUSE_DOWN, levelClickHandler);
level_array[_local2][0].buttonMode = true;
level_array[_local2][0].mouseChildren = false;
level_array[_local2][2].addEventListener(MouseEvent.MOUSE_DOWN, levelClickHandler);
level_array[_local2][2].buttonMode = true;
level_array[_local2][2].mouseChildren = false;
_local2++;
};
}
public function stopMusic():void{
if (music_channel){
music_channel.stop();
music_channel = null;
};
}
public function saveLevels():void{
var _local1:*;
_local1 = SharedObject.getLocal(("restowars_3" + engine.resto_type), "/");
_local1.data.current_level = current_level;
_local1.flush();
}
private function playNextClickHanler(_arg1:MouseEvent):void{
hello_closed = true;
engine.playSound(SoundConsts.click);
playLevel(current_level);
}
public function clear():void{
}
public function updateLevels():void{
var _local1:int;
_local1 = 0;
_local1 = 0;
while (_local1 < level_array.length) {
if (_local1 < current_level){
level_array[_local1][0].visible = true;
level_array[_local1][1].visible = false;
} else {
if (_local1 == current_level){
level_array[_local1][0].visible = true;
level_array[_local1][1].visible = true;
} else {
level_array[_local1][0].visible = false;
level_array[_local1][1].visible = false;
};
};
_local1++;
};
}
private function mainMenuClickHandler(_arg1:MouseEvent):void{
stopMusic();
GameStage.welcomeScreen.showWelcome();
}
private function levelClickHandler(_arg1:MouseEvent):void{
var _local2:int;
_local2 = 0;
switch (_arg1.currentTarget){
case level_array[0][0]:
case level_array[0][2]:
_local2 = 0;
break;
case level_array[1][0]:
case level_array[1][2]:
_local2 = 1;
break;
case level_array[2][0]:
case level_array[2][2]:
_local2 = 2;
break;
case level_array[3][0]:
case level_array[3][2]:
_local2 = 3;
break;
case level_array[4][0]:
case level_array[4][2]:
_local2 = 4;
break;
case level_array[5][0]:
case level_array[5][2]:
_local2 = 5;
break;
};
engine.playSound(SoundConsts.click);
if (_local2 <= current_level){
playLevel(_local2);
} else {
showLevelMessage();
};
}
private function showLevelMessage():void{
level_msg_timer.stop();
level_msg.msg.text = (("Level " + (current_level + 1).toString()) + " wasn't completed");
level_msg.visible = true;
level_msg_timer.start();
}
public function setLevel(_arg1:int):void{
var _local2:Level;
_local2 = engine.gameData.getLevel(_arg1);
level_info.showLevelInfo(_local2);
current_level = _arg1;
}
public function initialize(_arg1:Engine):void{
var _local2:Array;
engine = _arg1;
level_info.play_button.addEventListener(MouseEvent.MOUSE_DOWN, playNextClickHanler);
level_info.resume_game_button.visible = false;
main_menu_button.addEventListener(MouseEvent.MOUSE_DOWN, mainMenuClickHandler);
level_msg_timer = new Timer(1000, 0);
level_msg_timer.addEventListener(TimerEvent.TIMER, levelMsgTimer);
level_msg_timer.stop();
level_msg.visible = false;
level_msg.stop();
level_array = [[level1_back, level1_front, level1_type_button], [level2_back, level2_front, level2_type_button], [level3_back, level3_front, level3_type_button], [level4_back, level4_front, level4_type_button], [level5_back, level5_front, level5_type_button], [level6_back, level6_front, level6_type_button]];
music_sound = new Sound_music();
sound_control.setEngine(engine);
_local2 = engine.gameData.getLevels();
initializeLevelButtons(_local2);
setLevel(0);
loadLevels();
updateLevels();
dedegames_button.addEventListener(MouseEvent.MOUSE_DOWN, GameStage.sponsorClick);
}
private function playLevel(_arg1:int):void{
hello_closed = true;
visible = false;
stopMusic();
if (_arg1 < engine.gameData.getLevels().length){
engine.playLevel(engine.gameData.getLevel(_arg1));
} else {
engine.playLevel(engine.gameData.getLevel((engine.gameData.getLevels().length - 1)));
};
}
private function levelOverHandler(_arg1:MouseEvent):void{
if ((_arg1.currentTarget is LevelButton)){
_arg1.currentTarget.select(true);
};
}
private function levelOutHandler(_arg1:MouseEvent):void{
if ((_arg1.currentTarget is LevelButton)){
_arg1.currentTarget.select(false);
};
}
private function startHelloHandler(_arg1:MouseEvent):void{
engine.playSound(SoundConsts.click);
hello_closed = true;
}
public function playMusic():void{
var _local1:SoundTransform;
stopMusic();
if (((!(engine.volumeOff)) && (music_sound))){
_local1 = new SoundTransform();
_local1.volume = engine.volume;
music_channel = music_sound.play(0, 99999, _local1);
};
}
private function instructionsHandler(_arg1:MouseEvent):void{
}
private function levelMsgTimer(_arg1:TimerEvent):void{
level_msg.visible = false;
}
public function show():void{
if (engine.playWindow != null){
};
updateLevels();
saveLevels();
setLevel(current_level);
playMusic();
visible = true;
}
}
}//package fai.ui
Section 143
//RoadPath (fai.ui.RoadPath)
package fai.ui {
import fai.logic.*;
import flash.display.*;
import fai.common.*;
import fai.*;
public dynamic class RoadPath extends MovieClip {
public var points:Map;// = null
public function RoadPath():void{
points = null;
super();
}
public function initialize():void{
var _local1:int;
var _local2:int;
var _local3:*;
points = new Map();
_local1 = numChildren;
_local2 = 0;
_local2 = 0;
while (_local2 < _local1) {
_local3 = getChildAt(_local2);
if ((_local3 is RoadPoint)){
points.add(_local3.name, _local3);
};
_local2++;
};
}
public function firstNode():RoadPoint{
return (points.values[0]);
}
}
}//package fai.ui
Section 144
//ShopBuilding (fai.ui.ShopBuilding)
package fai.ui {
import fai.logic.*;
import flash.display.*;
import fai.*;
public class ShopBuilding extends MovieClip {
public var shop_holder:MovieClip;
private var shop_sprite;// = null
private var parent_item:ShopItem;// = null
public function ShopBuilding(_arg1:ShopItem, _arg2):void{
shop_sprite = null;
parent_item = null;
super();
addFrameScript(29, frame30);
shop_sprite = _arg2;
parent_item = _arg1;
if (shop_holder){
shop_sprite.x = (-(shop_sprite.width) / 2);
shop_holder.addChild(shop_sprite);
};
}
function frame30(){
stop();
finish();
}
public function finish():void{
shop_sprite.x = 3;
shop_sprite.y = ((parent_item.height - shop_sprite.height) + 20);
parent_item.setShopIcon(shop_sprite);
parent_item.setLevel(Consts.ShopLevel1);
parent_item.updateState();
}
}
}//package fai.ui
Section 145
//ShopButton (fai.ui.ShopButton)
package fai.ui {
import fai.logic.*;
import flash.display.*;
public class ShopButton extends MovieClip {
public var button_stars:MovieClip;
public var icon_holder:MovieClip;
private var engine:Engine;// = null
private var type:String;
public function ShopButton():void{
engine = null;
super();
}
public function setEngine(_arg1:Engine):void{
engine = _arg1;
}
public function updateButton(_arg1, _arg2):void{
}
public function get buttonType():String{
return (type);
}
public function setType(_arg1:String):void{
type = _arg1;
}
}
}//package fai.ui
Section 146
//ShopCustomerBar (fai.ui.ShopCustomerBar)
package fai.ui {
import fai.logic.*;
import flash.display.*;
import flash.text.*;
import fai.goals.*;
public class ShopCustomerBar extends Sprite {
private var shop_capacity:int;// = 0
private var seats:Array;// = null
public var bar:MovieClip;
private var engine:Engine;// = null
public var count_txt:TextField;
private var initial_scale:Number;// = 0
private var seats_goal:SeatsGoal;// = null
private var shop:ShopItem;// = null
public function ShopCustomerBar():void{
engine = null;
seats_goal = null;
shop = null;
seats = null;
shop_capacity = 0;
initial_scale = 0;
super();
initial_scale = bar.scaleX;
}
public function create(_arg1:int):void{
var _local2:int;
destroy();
seats = new Array();
shop_capacity = _arg1;
_local2 = 0;
_local2 = 0;
while (_local2 < shop_capacity) {
seats.push(new ShopSeat());
_local2++;
};
seats_goal = new SeatsGoal(engine, seats, shop);
engine.goal_system.add(seats_goal);
visible = true;
bar.visible = false;
update();
}
public function wereCreated():Boolean{
return (!((seats_goal == null)));
}
public function hasRoom():Boolean{
if (!seats_goal){
return (false);
};
return ((seats_goal.loadedCount < shop_capacity));
}
public function updateBuyingTicks():void{
if (seats_goal){
seats_goal.updateBuyingTicks();
};
}
public function isFree():Boolean{
if (!seats_goal){
return (true);
};
return ((seats_goal.loadedCount == 0));
}
public function update():void{
if (seats_goal){
count_txt.text = ((seats_goal.loadedCount.toString() + "/") + shop_capacity.toString());
if (seats_goal.loadedCount){
bar.visible = true;
bar.scaleX = ((seats_goal.loadedCount / shop_capacity) * initial_scale);
} else {
bar.visible = false;
};
};
}
public function get shopCapacity():int{
return (shop_capacity);
}
public function load(_arg1:Customer):ShopSeat{
return (seats_goal.loadCustomer(_arg1));
}
public function assign(_arg1:Engine, _arg2:ShopItem):void{
engine = _arg1;
shop = _arg2;
}
public function destroy():void{
if (seats_goal){
seats_goal.deactivate();
seats_goal = null;
};
if (seats){
seats.length = 0;
seats = null;
};
}
}
}//package fai.ui
Section 147
//SideChoosing (fai.ui.SideChoosing)
package fai.ui {
import fai.logic.*;
import flash.events.*;
import flash.display.*;
import fai.*;
public class SideChoosing extends MovieClip {
public var american_button:SimpleButton;
private var welcome:WelcomeScreen;// = null
private var engine:Engine;// = null
public var sushi_button:SimpleButton;
public function SideChoosing():void{
engine = null;
welcome = null;
super();
}
public function initialize(_arg1:Engine, _arg2:WelcomeScreen):void{
engine = _arg1;
welcome = _arg2;
sushi_button.addEventListener(MouseEvent.MOUSE_DOWN, sushiClickHandler);
american_button.addEventListener(MouseEvent.MOUSE_DOWN, americanClickHandler);
}
public function clear():void{
sushi_button.removeEventListener(MouseEvent.MOUSE_DOWN, sushiClickHandler);
american_button.removeEventListener(MouseEvent.MOUSE_DOWN, americanClickHandler);
}
private function sushiClickHandler(_arg1:MouseEvent):void{
engine.playSound(SoundConsts.click);
engine.resto_type = StringConsts.sushi;
visible = false;
welcome.levelSelection.loadLevels();
welcome.showLevelSelection();
}
private function americanClickHandler(_arg1:MouseEvent):void{
engine.playSound(SoundConsts.click);
engine.resto_type = StringConsts.american;
visible = false;
welcome.levelSelection.loadLevels();
welcome.showLevelSelection();
}
}
}//package fai.ui
Section 148
//SoundControlMC (fai.ui.SoundControlMC)
package fai.ui {
import fai.logic.*;
import flash.media.*;
import fl.controls.*;
import flash.display.*;
import flash.text.*;
import fai.common.*;
import fl.events.*;
public class SoundControlMC extends MovieClip {
private var sound_slider:Slider;// = null
public var engine:Engine;// = null
public function SoundControlMC():void{
engine = null;
sound_slider = null;
super();
sound_slider = new Slider();
sound_slider.liveDragging = true;
sound_slider.setSize(100, 0);
sound_slider.maximum = 100;
sound_slider.minimum = 0;
sound_slider.tickInterval = 5;
sound_slider.addEventListener(SliderEvent.CHANGE, musicChange);
sound_slider.x = 60;
sound_slider.y = -10;
addChild(sound_slider);
sound_slider.value = 100;
}
public function destroy():void{
sound_slider.removeEventListener(SliderEvent.CHANGE, musicChange);
removeChild(sound_slider);
sound_slider = null;
}
private function musicChange(_arg1:SliderEvent):void{
var _local2:SoundTransform;
engine.volume = (sound_slider.value / 100);
if (GameStage.welcomeScreen.levelSelection.music_channel){
_local2 = GameStage.welcomeScreen.levelSelection.music_channel.soundTransform;
_local2.volume = engine.volume;
GameStage.welcomeScreen.levelSelection.music_channel.soundTransform = _local2;
};
}
public function setEngine(_arg1:Engine):void{
engine = _arg1;
sound_slider.value = (engine.volume * 100);
}
}
}//package fai.ui
Section 149
//Statistics (fai.ui.Statistics)
package fai.ui {
import fai.logic.*;
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.text.*;
import fai.common.*;
import flash.utils.*;
import fai.*;
public class Statistics extends Sprite {
public var dede_games:SimpleButton;
private var initial_bar_scale:Number;// = 0
public var goal_bar:MovieClip;
public var stat_caption:MovieClip;
public var bonus:int;// = 0
private var replay_music_count:int;// = 1
public var spent_txt:TextField;
private var initial_enemy_bar_scale:Number;// = 0
public var served:int;// = 0
public var built_txt:TextField;
public var score_txt:TextField;
private var engine:Engine;// = null
public var bonus_txt:TextField;
public var final_victory:MovieClip;
public var spent:int;// = 0
private var music_sound:Sound;// = null
public var earned:int;// = 0
private var score:int;// = 0
public var enemy_resto:MovieClip;
public var earned_txt:TextField;
private var counterTimer:Timer;// = null
public var enemy_goal_bar:MovieClip;
public var happy_smileys:MovieClip;
public var my_resto:MovieClip;
public var continue_button:SimpleButton;
public var music_channel:SoundChannel;// = null
private var back:AnimatedBitmap;// = null
public function Statistics():void{
earned = 0;
spent = 0;
served = 0;
bonus = 0;
score = 0;
engine = null;
counterTimer = null;
back = null;
music_sound = null;
music_channel = null;
replay_music_count = 1;
initial_bar_scale = 0;
initial_enemy_bar_scale = 0;
super();
initial_bar_scale = goal_bar.bar.scaleX;
initial_enemy_bar_scale = goal_bar.bar.scaleX;
}
private function counter(_arg1, _arg2:int):int{
var _local3:int;
if (_arg2 > 0){
_local3 = ((_arg2 > 30)) ? (_arg2 / 30) : _arg2;
_arg1.text = (int(_arg1.text) + _local3).toString();
return (_local3);
};
return (0);
}
public function victory():void{
stat_caption.innerc.stat_title.text = "Well Done!";
continue_button.visible = true;
happy_smileys.visible = true;
music_sound = new Sound_victory();
}
public function setEngine(_arg1:Engine):void{
engine = _arg1;
continue_button.addEventListener(MouseEvent.MOUSE_DOWN, showLevels);
final_victory.addEventListener(MouseEvent.MOUSE_DOWN, clickFinalDialogHandler);
dede_games.addEventListener(MouseEvent.MOUSE_DOWN, GameStage.sponsorClick);
happy_smileys.visible = false;
}
public function stopMusic():void{
if (music_channel){
music_channel.stop();
music_channel = null;
};
}
public function start():void{
var _local1:Number;
var _local2:Number;
playMusic();
earned_txt.text = "0";
spent_txt.text = "0";
built_txt.text = "0";
bonus_txt.text = "0";
score_txt.text = "0";
score = engine.score;
my_resto.gotoAndStop(engine.resto_type);
enemy_resto.gotoAndStop(((engine.resto_type == StringConsts.sushi)) ? StringConsts.american : StringConsts.sushi);
_local1 = ((engine.goalMoney / engine.lastLevel.money_goal) * 100);
_local2 = ((engine.enemyGoalMoney / engine.lastLevel.money_goal) * 100);
goal_bar.goal_txt.text = (sprintf("%.2f", _local1) + "%");
enemy_goal_bar.goal_txt.text = (sprintf("%.2f", _local2) + "%");
if (_local1 <= 100){
goal_bar.bar.scaleX = ((engine.goalMoney / engine.lastLevel.money_goal) * initial_bar_scale);
} else {
goal_bar.bar.scaleX = initial_bar_scale;
};
if (_local2 <= 100){
enemy_goal_bar.bar.scaleX = ((engine.enemyGoalMoney / engine.lastLevel.money_goal) * initial_enemy_bar_scale);
} else {
enemy_goal_bar.bar.scaleX = initial_enemy_bar_scale;
};
counterTimer = new Timer(30, 0);
counterTimer.addEventListener(TimerEvent.TIMER, counterTick);
counterTimer.start();
}
public function playMusic():void{
var _local1:SoundTransform;
stopMusic();
if (((!(engine.volumeOff)) && (music_sound))){
_local1 = new SoundTransform();
_local1.volume = engine.volume;
music_channel = music_sound.play(0, replay_music_count, _local1);
};
}
public function defeat():void{
stat_caption.innerc.stat_title.text = "Failed. Try Again!";
happy_smileys.visible = false;
music_sound = new Sound_game_over();
}
private function counterTick(_arg1:TimerEvent):void{
earned = (earned - counter(earned_txt, earned));
spent = (spent - counter(spent_txt, spent));
served = (served - counter(built_txt, served));
bonus = (bonus - counter(bonus_txt, bonus));
score = (score - counter(score_txt, score));
if (((((earned + spent) + served) + bonus) + score) == 0){
counterTimer.stop();
counterTimer.removeEventListener(TimerEvent.TIMER, counterTick);
counterTimer = null;
};
}
private function clickFinalDialogHandler(_arg1:MouseEvent):void{
final_victory.visible = false;
}
private function playAgain(_arg1:MouseEvent):void{
visible = false;
engine.playSound(SoundConsts.click);
engine.playLevel(engine.lastLevel);
}
private function mainMenu(_arg1:MouseEvent):void{
visible = false;
engine.playSound(SoundConsts.click);
engine.clearAll();
GameStage.welcomeScreen.showWelcome();
}
private function showLevels(_arg1:MouseEvent):void{
visible = false;
engine.playSound(SoundConsts.click);
engine.clearAll();
if (engine.lastLevel.number >= (engine.gameData.getLevels().length - 1)){
GameStage.welcomeScreen.showWelcome();
} else {
GameStage.welcomeScreen.showLevelSelection();
};
}
public function destroy():void{
if (counterTimer){
counterTimer.stop();
counterTimer.removeEventListener(TimerEvent.TIMER, counterTick);
counterTimer = null;
};
stopMusic();
dede_games.removeEventListener(MouseEvent.MOUSE_DOWN, GameStage.sponsorClick);
continue_button.removeEventListener(MouseEvent.MOUSE_DOWN, showLevels);
final_victory.removeEventListener(MouseEvent.MOUSE_DOWN, clickFinalDialogHandler);
}
}
}//package fai.ui
Section 150
//TutorialMC (fai.ui.TutorialMC)
package fai.ui {
import fai.logic.*;
import flash.events.*;
import flash.display.*;
import fai.*;
public class TutorialMC extends MovieClip {
public var next_button:SimpleButton;
public var close_button:SimpleButton;
private var engine:Engine;// = null
public var page1:MovieClip;
public var current_page:String;// = "page1"
public function TutorialMC():void{
engine = null;
current_page = "page1";
super();
addFrameScript(0, frame1);
}
public function destroy():void{
next_button.removeEventListener(MouseEvent.MOUSE_DOWN, continueClick);
close_button.removeEventListener(MouseEvent.MOUSE_DOWN, skipClick);
}
public function init(_arg1:Engine):void{
engine = _arg1;
next_button.addEventListener(MouseEvent.MOUSE_DOWN, continueClick);
close_button.addEventListener(MouseEvent.MOUSE_DOWN, skipClick);
}
private function continueClick(_arg1:MouseEvent):void{
engine.playSound(SoundConsts.click);
switch (current_page){
case "page1":
gotoPage("page2");
break;
case "page2":
gotoPage("page3");
break;
case "page3":
gotoPage("page4");
break;
default:
gotoPage("page1");
break;
};
}
private function skipClick(_arg1:MouseEvent):void{
engine.playSound(SoundConsts.click);
hideTutorial();
}
function frame1(){
stop();
}
public function showTutorial():void{
gotoPage("page1");
visible = true;
}
public function gotoPage(_arg1:String):void{
current_page = _arg1;
gotoAndStop(_arg1);
}
private function hideTutorial():void{
destroy();
visible = false;
}
}
}//package fai.ui
Section 151
//WelcomeScreen (fai.ui.WelcomeScreen)
package fai.ui {
import fai.logic.*;
import flash.events.*;
import flash.display.*;
import flash.text.*;
import fai.*;
public dynamic class WelcomeScreen extends MovieClip {
private var side_choosing:SideChoosing;// = null
public var resume_game_button:SimpleButton;
public var more_games_button:SimpleButton;
public var start_pizza_game_button:SimpleButton;
private var engine:Engine;// = null
public var medium_quality_button:SimpleButton;
public var quality_clip:MovieClip;
private var level_selection:LevelSelection;// = null
public var high_quality_button:SimpleButton;
public var low_quality_button:SimpleButton;
private var initialized:Boolean;// = false
public function WelcomeScreen():void{
level_selection = null;
side_choosing = null;
engine = null;
initialized = false;
super();
}
public function get engineInstance():Engine{
return (engine);
}
private function startPizzaHandler(_arg1:MouseEvent):void{
engine.playSound(SoundConsts.click);
engine.resto_type = StringConsts.american;
showSideChoosing();
}
private function resumeHandler(_arg1:MouseEvent):void{
engine.playSound(SoundConsts.click);
engine.play_window.show();
engine.pause();
}
public function get levelSelection():LevelSelection{
return (level_selection);
}
public function initialize():void{
low_quality_button.addEventListener(MouseEvent.MOUSE_DOWN, qualityChangeHandler);
medium_quality_button.addEventListener(MouseEvent.MOUSE_DOWN, qualityChangeHandler);
high_quality_button.addEventListener(MouseEvent.MOUSE_DOWN, qualityChangeHandler);
start_pizza_game_button.addEventListener(MouseEvent.MOUSE_DOWN, startPizzaHandler);
resume_game_button.addEventListener(MouseEvent.MOUSE_DOWN, resumeHandler);
more_games_button.addEventListener(MouseEvent.MOUSE_DOWN, GameStage.sponsorClick);
quality_clip.gotoAndStop(GameStage.itself.stage.quality.toLowerCase());
GameStage.play_holder = new Sprite();
addChild(GameStage.play_holder);
engine = new Engine(GameStage.main_stage);
level_selection = new LevelSelection();
level_selection.initialize(engine);
level_selection.visible = false;
GameStage.play_holder.addChild(level_selection);
side_choosing = new SideChoosing();
side_choosing.initialize(engine, this);
side_choosing.visible = false;
GameStage.play_holder.addChild(side_choosing);
resume_game_button.visible = false;
}
public function clear():void{
start_pizza_game_button.removeEventListener(MouseEvent.MOUSE_DOWN, startPizzaHandler);
resume_game_button.addEventListener(MouseEvent.MOUSE_DOWN, resumeHandler);
more_games_button.removeEventListener(MouseEvent.MOUSE_DOWN, GameStage.sponsorClick);
low_quality_button.removeEventListener(MouseEvent.MOUSE_DOWN, qualityChangeHandler);
medium_quality_button.removeEventListener(MouseEvent.MOUSE_DOWN, qualityChangeHandler);
high_quality_button.removeEventListener(MouseEvent.MOUSE_DOWN, qualityChangeHandler);
if (engine){
level_selection.stopMusic();
removeChild(GameStage.play_holder);
engine.clearAll();
engine = null;
};
}
public function showSideChoosing():void{
if (!side_choosing){
return;
};
side_choosing.visible = true;
}
private function qualityChangeHandler(_arg1:MouseEvent):void{
switch (_arg1.currentTarget){
case low_quality_button:
GameStage.itself.stage.quality = "low";
break;
case medium_quality_button:
GameStage.itself.stage.quality = "medium";
break;
case high_quality_button:
GameStage.itself.stage.quality = "high";
break;
};
quality_clip.gotoAndStop(GameStage.itself.stage.quality.toLowerCase());
}
public function showLevelSelection():void{
if (!level_selection){
return;
};
level_selection.show();
}
private function hsHandler(_arg1:MouseEvent):void{
engine.playSound(SoundConsts.click);
}
public function showWelcome():void{
visible = true;
level_selection.visible = false;
side_choosing.visible = false;
resume_game_button.visible = !((engine.playWindow == null));
}
private function instructionsHandler(_arg1:MouseEvent):void{
}
}
}//package fai.ui
Section 152
//Consts (fai.Consts)
package fai {
public class Consts {
public static const NewsBoxSpace:int = 5;
public static const DELIVERY_MONEY:int = 50;
public static const CustomerWalkRange:int = 25;
public static const ScreenWidth:int = 700;
public static const MusicBoxSpace:int = 5;
public static const Left:uint = 0;
public static const SellDownturn:Number = 0.8;
public static const Top:uint = 2;
public static const Down:uint = 3;
public static const BusPeopleCount:int = 10;
public static const CustomerShopEnteringLine:int = 275;
public static const ScreenHeight:int = 525;
public static const BenchSpace:int = 3;
public static const SpriteWidth:int = 20;
public static const ShopLevel1:int = 1;
public static const IcecreamCost:int = 25;
public static const ShopLevel3:int = 3;
public static const NewspaperCost:int = 35;
public static const ExtraLiveTime:int = 800;
public static const ShopLevel2:int = 2;
public static const SpriteHeight:int = 35;
public static const GOALSCLEANPAUSE:uint = 10;
public static const IceCreamSpace:int = 5;
public static const ShopBuilding:int = 4;
public static const ShopUpgrading:int = 5;
public static const ShopHealthPortion:Number = 1.2;
public static const CustomerWalkLine:int = 290;
public static const Right:uint = 1;
}
}//package fai
Section 153
//MoneyConsts (fai.MoneyConsts)
package fai {
public class MoneyConsts {
public static const second_floor:int = 7500;
public static const decor5_sushi:int = 1400;
public static const ads1:int = 50;
public static const ads4:int = 200;
public static const decor7_sushi:int = 2300;
public static const security_system:int = 450;
public static const decor3_sushi:int = 850;
public static const ads2:int = 100;
public static const decor5_american:int = 1400;
public static const ads5_american:int = 300;
public static const CLEAN_COST:int = 25;
public static const eastern_sweeties:int = 1100;
public static const decor1_american:int = 400;
public static const decor6_american:int = 1900;
public static const decor2_american:int = 600;
public static const INITIAL_SEATS:int = 5;
public static const underground_bar:int = 5000;
public static const INITIAL_BUY_FOR:int = 3000;
public static const decor4_sushi:int = 1100;
public static const third_floor:int = 15000;
public static const decor6_sushi:int = 1900;
public static const decor2_sushi:int = 600;
public static const decor7_american:int = 2300;
public static const pizza_production:int = 1750;
public static const decor3_american:int = 850;
public static const luxury_pizza:int = 3500;
public static const ads5_sushi:int = 300;
public static const receptionist:int = 1000;
public static const cheap_sushi_menu:int = 2700;
public static const tv_hall:int = 1200;
public static const INITIAL_MONEY_VALUE:int = 10;
public static const hot_cheese_rolls:int = 1500;
public static const ads3_american:int = 150;
public static const karaoke:int = 2500;
public static const sushi_discounts:int = 1850;
public static const sale_campaigns:int = 4500;
public static const decor4_american:int = 1100;
public static const delivery:int = 2000;
public static const king_burgers:int = 1950;
public static const country_menu:int = 900;
public static const ads3_sushi:int = 150;
public static const summer_seats:int = 2500;
public static const decor1_sushi:int = 400;
}
}//package fai
Section 154
//SoundConsts (fai.SoundConsts)
package fai {
public final class SoundConsts {
public static var game_over:int = 2;
public static var swish:int = 11;
public static var click:int = 3;
public static var swish_swish:int = 12;
public static var build:int = 1;
public static var robbery:int = 6;
public static var coins:int = 4;
public static var victory:int = 0;
public static var on_upgrade_over:int = 7;
public static var sell:int = 10;
public static var clean_alarm:int = 9;
public static var new_day:int = 5;
}
}//package fai
Section 155
//StringConsts (fai.StringConsts)
package fai {
public class StringConsts {
public static const decor3_sushi:String = "decor3_sushi";
public static const decor7_sushi:String = "decor7_sushi";
public static const underground_bar_sushi:String = "underground_bar_sushi";
public static const decor5_american:String = "decor5_american";
public static const sushi:String = "Sushi";
public static const security_system:String = "security_system";
public static const not_enough_money:String = "You don't have enough money.";
public static const american:String = "American";
public static const level1:String = "Tutorial Level";
public static const level2:String = "Level 1";
public static const level3:String = "Level 2";
public static const level4:String = "Level 3";
public static const level5:String = "Level 4";
public static const level6:String = "Level 5";
public static const american_delivery:String = "delivery_american";
public static const receptionist_sushi:String = "receptionist_sushi";
public static const bench:String = "Benches";
public static const american_summer_seats:String = "summer_seats_american";
public static const american_second_floor:String = "american_second_floor";
public static const pizza_production_str:String = "pizza_production";
public static const decor6_american:String = "decor6_american";
public static const luxury_pizza_str:String = "luxury_pizza";
public static const decor4_sushi:String = "decor4_sushi";
public static const decor7_american:String = "decor7_american";
public static const empty:String = "Empty";
public static const ads3_sushi:String = "ads3_sushi";
public static const news_box:String = "News Box";
public static const sushi_discounts:String = "sushi_discounts";
public static const country_menu:String = "country_menu";
public static const sale_campaigns:String = "sale_campaigns";
public static const king_burgers_str:String = "king_burgers";
public static const ads3_american:String = "ads3_american";
public static const decor1_sushi:String = "decor1_sushi";
public static const sushi_delivery:String = "delivery_sushi";
public static const ads2:String = "ads2";
public static const decor5_sushi:String = "decor5_sushi";
public static const receptionist_american:String = "receptionist_american";
public static const sushi_third_floor:String = "sushi_third_floor";
public static const ads1:String = "ads1";
public static const eastern_sweeties:String = "eastern_sweeties";
public static const sushi_summer_seats:String = "summer_seats_sushi";
public static const sushi_second_floor:String = "sushi_second_floor";
public static const american_third_floor:String = "american_third_floor";
public static const ads5_american:String = "ads5_american";
public static const ads4:String = "ads4";
public static const shop_isnt_empty:String = "You can't upgrade the restaurant when the customers are inside.";
public static const decor1_american:String = "decor1_american";
public static const decor2_american:String = "decor2_american";
public static const underground_bar_american:String = "underground_bar_american";
public static const decor2_sushi:String = "decor2_sushi";
public static const decor6_sushi:String = "decor6_sushi";
public static const ice_cream:String = "Ice Cream";
public static const decor3_american:String = "decor3_american";
public static const tv_hall:String = "tv_hall";
public static const pizza_production:String = "pizza_header";
public static const ads5_sushi:String = "ads5_sushi";
public static const cheap_sushi_menu:String = "cheap_sushi_menu";
public static const luxury_pizza:String = "luxury_pizza_header";
public static const karaoke:String = "karaoke";
public static const hot_cheese_rolls:String = "hot_cheese_rolls";
public static const decor4_american:String = "decor4_american";
public static const king_burgers:String = "king_burgers_header";
}
}//package fai
Section 156
//BaseButton (fl.controls.BaseButton)
package fl.controls {
import flash.events.*;
import flash.display.*;
import fl.core.*;
import fl.events.*;
import flash.utils.*;
public class BaseButton extends UIComponent {
protected var _selected:Boolean;// = false
private var unlockedMouseState:String;
protected var pressTimer:Timer;
protected var mouseState:String;
protected var background:DisplayObject;
private var _mouseStateLocked:Boolean;// = false
protected var _autoRepeat:Boolean;// = false
private static var defaultStyles:Object = {upSkin:"Button_upSkin", downSkin:"Button_downSkin", overSkin:"Button_overSkin", disabledSkin:"Button_disabledSkin", selectedDisabledSkin:"Button_selectedDisabledSkin", selectedUpSkin:"Button_selectedUpSkin", selectedDownSkin:"Button_selectedDownSkin", selectedOverSkin:"Button_selectedOverSkin", focusRectSkin:null, focusRectPadding:null, repeatDelay:500, repeatInterval:35};
public function BaseButton(){
_selected = false;
_autoRepeat = false;
_mouseStateLocked = false;
super();
buttonMode = true;
mouseChildren = false;
useHandCursor = false;
setupMouseEvents();
setMouseState("up");
pressTimer = new Timer(1, 0);
pressTimer.addEventListener(TimerEvent.TIMER, buttonDown, false, 0, true);
}
protected function endPress():void{
pressTimer.reset();
}
public function set mouseStateLocked(_arg1:Boolean):void{
_mouseStateLocked = _arg1;
if (_arg1 == false){
setMouseState(unlockedMouseState);
} else {
unlockedMouseState = mouseState;
};
}
public function get autoRepeat():Boolean{
return (_autoRepeat);
}
public function set autoRepeat(_arg1:Boolean):void{
_autoRepeat = _arg1;
}
override public function set enabled(_arg1:Boolean):void{
super.enabled = _arg1;
mouseEnabled = _arg1;
}
public function get selected():Boolean{
return (_selected);
}
protected function mouseEventHandler(_arg1:MouseEvent):void{
if (_arg1.type == MouseEvent.MOUSE_DOWN){
setMouseState("down");
startPress();
} else {
if ((((_arg1.type == MouseEvent.ROLL_OVER)) || ((_arg1.type == MouseEvent.MOUSE_UP)))){
setMouseState("over");
endPress();
} else {
if (_arg1.type == MouseEvent.ROLL_OUT){
setMouseState("up");
endPress();
};
};
};
}
public function setMouseState(_arg1:String):void{
if (_mouseStateLocked){
unlockedMouseState = _arg1;
return;
};
if (mouseState == _arg1){
return;
};
mouseState = _arg1;
invalidate(InvalidationType.STATE);
}
protected function startPress():void{
if (_autoRepeat){
pressTimer.delay = Number(getStyleValue("repeatDelay"));
pressTimer.start();
};
dispatchEvent(new ComponentEvent(ComponentEvent.BUTTON_DOWN, true));
}
protected function buttonDown(_arg1:TimerEvent):void{
if (!_autoRepeat){
endPress();
return;
};
if (pressTimer.currentCount == 1){
pressTimer.delay = Number(getStyleValue("repeatInterval"));
};
dispatchEvent(new ComponentEvent(ComponentEvent.BUTTON_DOWN, true));
}
public function set selected(_arg1:Boolean):void{
if (_selected == _arg1){
return;
};
_selected = _arg1;
invalidate(InvalidationType.STATE);
}
override public function get enabled():Boolean{
return (super.enabled);
}
override protected function draw():void{
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
drawBackground();
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE)){
drawLayout();
};
super.draw();
}
protected function setupMouseEvents():void{
addEventListener(MouseEvent.ROLL_OVER, mouseEventHandler, false, 0, true);
addEventListener(MouseEvent.MOUSE_DOWN, mouseEventHandler, false, 0, true);
addEventListener(MouseEvent.MOUSE_UP, mouseEventHandler, false, 0, true);
addEventListener(MouseEvent.ROLL_OUT, mouseEventHandler, false, 0, true);
}
protected function drawLayout():void{
background.width = width;
background.height = height;
}
protected function drawBackground():void{
var _local1:String;
var _local2:DisplayObject;
_local1 = (enabled) ? mouseState : "disabled";
if (selected){
_local1 = (("selected" + _local1.substr(0, 1).toUpperCase()) + _local1.substr(1));
};
_local1 = (_local1 + "Skin");
_local2 = background;
background = getDisplayObjectInstance(getStyleValue(_local1));
addChildAt(background, 0);
if (((!((_local2 == null))) && (!((_local2 == background))))){
removeChild(_local2);
};
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//package fl.controls
Section 157
//Button (fl.controls.Button)
package fl.controls {
import flash.display.*;
import fl.core.*;
import fl.managers.*;
public class Button extends LabelButton implements IFocusManagerComponent {
protected var emphasizedBorder:DisplayObject;
protected var _emphasized:Boolean;// = false
private static var defaultStyles:Object = {emphasizedSkin:"Button_emphasizedSkin", emphasizedPadding:2};
public static var createAccessibilityImplementation:Function;
public function Button(){
_emphasized = false;
super();
}
override public function drawFocus(_arg1:Boolean):void{
var _local2:Number;
var _local3:*;
super.drawFocus(_arg1);
if (_arg1){
_local2 = Number(getStyleValue("emphasizedPadding"));
if ((((_local2 < 0)) || (!(_emphasized)))){
_local2 = 0;
};
_local3 = getStyleValue("focusRectPadding");
_local3 = ((_local3)==null) ? 2 : _local3;
_local3 = (_local3 + _local2);
uiFocusRect.x = -(_local3);
uiFocusRect.y = -(_local3);
uiFocusRect.width = (width + (_local3 * 2));
uiFocusRect.height = (height + (_local3 * 2));
};
}
public function set emphasized(_arg1:Boolean):void{
_emphasized = _arg1;
invalidate(InvalidationType.STYLES);
}
override protected function draw():void{
if (((isInvalid(InvalidationType.STYLES)) || (isInvalid(InvalidationType.SIZE)))){
drawEmphasized();
};
super.draw();
if (emphasizedBorder != null){
setChildIndex(emphasizedBorder, (numChildren - 1));
};
}
public function get emphasized():Boolean{
return (_emphasized);
}
override protected function initializeAccessibility():void{
if (Button.createAccessibilityImplementation != null){
Button.createAccessibilityImplementation(this);
};
}
protected function drawEmphasized():void{
var _local1:Object;
var _local2:Number;
if (emphasizedBorder != null){
removeChild(emphasizedBorder);
};
emphasizedBorder = null;
if (!_emphasized){
return;
};
_local1 = getStyleValue("emphasizedSkin");
if (_local1 != null){
emphasizedBorder = getDisplayObjectInstance(_local1);
};
if (emphasizedBorder != null){
addChildAt(emphasizedBorder, 0);
_local2 = Number(getStyleValue("emphasizedPadding"));
emphasizedBorder.x = (emphasizedBorder.y = -(_local2));
emphasizedBorder.width = (width + (_local2 * 2));
emphasizedBorder.height = (height + (_local2 * 2));
};
}
public static function getStyleDefinition():Object{
return (UIComponent.mergeStyles(LabelButton.getStyleDefinition(), defaultStyles));
}
}
}//package fl.controls
Section 158
//ButtonLabelPlacement (fl.controls.ButtonLabelPlacement)
package fl.controls {
public class ButtonLabelPlacement {
public static const TOP:String = "top";
public static const LEFT:String = "left";
public static const BOTTOM:String = "bottom";
public static const RIGHT:String = "right";
}
}//package fl.controls
Section 159
//LabelButton (fl.controls.LabelButton)
package fl.controls {
import flash.events.*;
import flash.display.*;
import fl.core.*;
import flash.text.*;
import fl.managers.*;
import fl.events.*;
import flash.ui.*;
public class LabelButton extends BaseButton implements IFocusManagerComponent {
protected var _labelPlacement:String;// = "right"
protected var _toggle:Boolean;// = false
protected var icon:DisplayObject;
protected var oldMouseState:String;
protected var mode:String;// = "center"
public var textField:TextField;
protected var _label:String;// = "Label"
private static var defaultStyles:Object = {icon:null, upIcon:null, downIcon:null, overIcon:null, disabledIcon:null, selectedDisabledIcon:null, selectedUpIcon:null, selectedDownIcon:null, selectedOverIcon:null, textFormat:null, disabledTextFormat:null, textPadding:5, embedFonts:false};
public static var createAccessibilityImplementation:Function;
public function LabelButton(){
_labelPlacement = ButtonLabelPlacement.RIGHT;
_toggle = false;
_label = "Label";
mode = "center";
super();
}
protected function toggleSelected(_arg1:MouseEvent):void{
selected = !(selected);
dispatchEvent(new Event(Event.CHANGE, true));
}
public function get labelPlacement():String{
return (_labelPlacement);
}
override protected function keyDownHandler(_arg1:KeyboardEvent):void{
if (!enabled){
return;
};
if (_arg1.keyCode == Keyboard.SPACE){
if (oldMouseState == null){
oldMouseState = mouseState;
};
setMouseState("down");
startPress();
};
}
protected function setEmbedFont(){
var _local1:Object;
_local1 = getStyleValue("embedFonts");
if (_local1 != null){
textField.embedFonts = _local1;
};
}
override protected function keyUpHandler(_arg1:KeyboardEvent):void{
if (!enabled){
return;
};
if (_arg1.keyCode == Keyboard.SPACE){
setMouseState(oldMouseState);
oldMouseState = null;
endPress();
dispatchEvent(new MouseEvent(MouseEvent.CLICK));
};
}
override public function get selected():Boolean{
return ((_toggle) ? _selected : false);
}
public function set labelPlacement(_arg1:String):void{
_labelPlacement = _arg1;
invalidate(InvalidationType.SIZE);
}
public function set toggle(_arg1:Boolean):void{
if (((!(_arg1)) && (super.selected))){
selected = false;
};
_toggle = _arg1;
if (_toggle){
addEventListener(MouseEvent.CLICK, toggleSelected, false, 0, true);
} else {
removeEventListener(MouseEvent.CLICK, toggleSelected);
};
invalidate(InvalidationType.STATE);
}
public function get label():String{
return (_label);
}
override public function set selected(_arg1:Boolean):void{
_selected = _arg1;
if (_toggle){
invalidate(InvalidationType.STATE);
};
}
override protected function draw():void{
if (textField.text != _label){
label = _label;
};
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
drawBackground();
drawIcon();
drawTextFormat();
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE)){
drawLayout();
};
if (isInvalid(InvalidationType.SIZE, InvalidationType.STYLES)){
if (((isFocused) && (focusManager.showFocusIndicator))){
drawFocus(true);
};
};
validate();
}
public function get toggle():Boolean{
return (_toggle);
}
override protected function configUI():void{
super.configUI();
textField = new TextField();
textField.type = TextFieldType.DYNAMIC;
textField.selectable = false;
addChild(textField);
}
override protected function drawLayout():void{
var _local1:Number;
var _local2:String;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local1 = Number(getStyleValue("textPadding"));
_local2 = ((((icon == null)) && ((mode == "center")))) ? ButtonLabelPlacement.TOP : _labelPlacement;
textField.height = (textField.textHeight + 4);
_local3 = (textField.textWidth + 4);
_local4 = (textField.textHeight + 4);
_local5 = ((icon)==null) ? 0 : (icon.width + _local1);
_local6 = ((icon)==null) ? 0 : (icon.height + _local1);
textField.visible = (label.length > 0);
if (icon != null){
icon.x = Math.round(((width - icon.width) / 2));
icon.y = Math.round(((height - icon.height) / 2));
};
if (textField.visible == false){
textField.width = 0;
textField.height = 0;
} else {
if ((((_local2 == ButtonLabelPlacement.BOTTOM)) || ((_local2 == ButtonLabelPlacement.TOP)))){
_local7 = Math.max(0, Math.min(_local3, (width - (2 * _local1))));
if ((height - 2) > _local4){
_local8 = _local4;
} else {
_local8 = (height - 2);
};
_local3 = _local7;
textField.width = _local3;
_local4 = _local8;
textField.height = _local4;
textField.x = Math.round(((width - _local3) / 2));
textField.y = Math.round(((((height - textField.height) - _local6) / 2) + ((_local2)==ButtonLabelPlacement.BOTTOM) ? _local6 : 0));
if (icon != null){
icon.y = Math.round(((_local2)==ButtonLabelPlacement.BOTTOM) ? (textField.y - _local6) : ((textField.y + textField.height) + _local1));
};
} else {
_local7 = Math.max(0, Math.min(_local3, ((width - _local5) - (2 * _local1))));
_local3 = _local7;
textField.width = _local3;
textField.x = Math.round(((((width - _local3) - _local5) / 2) + ((_local2)!=ButtonLabelPlacement.LEFT) ? _local5 : 0));
textField.y = Math.round(((height - textField.height) / 2));
if (icon != null){
icon.x = Math.round(((_local2)!=ButtonLabelPlacement.LEFT) ? (textField.x - _local5) : ((textField.x + _local3) + _local1));
};
};
};
super.drawLayout();
}
override protected function initializeAccessibility():void{
if (LabelButton.createAccessibilityImplementation != null){
LabelButton.createAccessibilityImplementation(this);
};
}
protected function drawIcon():void{
var _local1:DisplayObject;
var _local2:String;
var _local3:Object;
_local1 = icon;
_local2 = (enabled) ? mouseState : "disabled";
if (selected){
_local2 = (("selected" + _local2.substr(0, 1).toUpperCase()) + _local2.substr(1));
};
_local2 = (_local2 + "Icon");
_local3 = getStyleValue(_local2);
if (_local3 == null){
_local3 = getStyleValue("icon");
};
if (_local3 != null){
icon = getDisplayObjectInstance(_local3);
};
if (icon != null){
addChildAt(icon, 1);
};
if (((!((_local1 == null))) && (!((_local1 == icon))))){
removeChild(_local1);
};
}
public function set label(_arg1:String):void{
_label = _arg1;
if (textField.text != _label){
textField.text = _label;
dispatchEvent(new ComponentEvent(ComponentEvent.LABEL_CHANGE));
};
invalidate(InvalidationType.SIZE);
invalidate(InvalidationType.STYLES);
}
protected function drawTextFormat():void{
var _local1:Object;
var _local2:TextFormat;
var _local3:TextFormat;
_local1 = UIComponent.getStyleDefinition();
_local2 = (enabled) ? (_local1.defaultTextFormat as TextFormat) : (_local1.defaultDisabledTextFormat as TextFormat);
textField.setTextFormat(_local2);
_local3 = (getStyleValue((enabled) ? "textFormat" : "disabledTextFormat") as TextFormat);
if (_local3 != null){
textField.setTextFormat(_local3);
} else {
_local3 = _local2;
};
textField.defaultTextFormat = _local3;
setEmbedFont();
}
public static function getStyleDefinition():Object{
return (mergeStyles(defaultStyles, BaseButton.getStyleDefinition()));
}
}
}//package fl.controls
Section 160
//Slider (fl.controls.Slider)
package fl.controls {
import flash.events.*;
import flash.display.*;
import fl.core.*;
import fl.managers.*;
import fl.events.*;
import flash.ui.*;
public class Slider extends UIComponent implements IFocusManagerComponent {
protected var _direction:String;
protected var _liveDragging:Boolean;// = false
protected var _value:Number;// = 0
protected var _snapInterval:Number;// = 0
protected var _minimum:Number;// = 0
protected var _maximum:Number;// = 10
protected var track:BaseButton;
protected var _tickInterval:Number;// = 0
protected var tickContainer:Sprite;
protected var thumb:BaseButton;
protected static const TICK_STYLES:Object = {upSkin:"tickSkin"};
protected static const TRACK_STYLES:Object = {upSkin:"sliderTrackSkin", overSkin:"sliderTrackSkin", downSkin:"sliderTrackSkin", disabledSkin:"sliderTrackDisabledSkin"};
protected static const THUMB_STYLES:Object = {upSkin:"thumbUpSkin", overSkin:"thumbOverSkin", downSkin:"thumbDownSkin", disabledSkin:"thumbDisabledSkin"};
protected static var defaultStyles:Object = {thumbUpSkin:"SliderThumb_upSkin", thumbOverSkin:"SliderThumb_overSkin", thumbDownSkin:"SliderThumb_downSkin", thumbDisabledSkin:"SliderThumb_disabledSkin", sliderTrackSkin:"SliderTrack_skin", sliderTrackDisabledSkin:"SliderTrack_disabledSkin", tickSkin:"SliderTick_skin", focusRectSkin:null, focusRectPadding:null};
public function Slider(){
_direction = SliderDirection.HORIZONTAL;
_minimum = 0;
_maximum = 10;
_value = 0;
_tickInterval = 0;
_snapInterval = 0;
_liveDragging = false;
super();
setStyles();
}
public function get minimum():Number{
return (_minimum);
}
public function set minimum(_arg1:Number):void{
_minimum = _arg1;
this.value = Math.max(_arg1, this.value);
invalidate(InvalidationType.DATA);
}
public function get maximum():Number{
return (_maximum);
}
protected function positionThumb():void{
thumb.x = ((((_direction)==SliderDirection.VERTICAL) ? ((maximum - minimum) - value) : (value - minimum) / (maximum - minimum)) * _width);
}
protected function clearTicks():void{
if (((!(tickContainer)) || (!(tickContainer.parent)))){
return;
};
removeChild(tickContainer);
}
protected function onTrackClick(_arg1:MouseEvent):void{
calculateValue(track.mouseX, InteractionInputType.MOUSE, SliderEventClickTarget.TRACK);
if (!liveDragging){
dispatchEvent(new SliderEvent(SliderEvent.CHANGE, value, SliderEventClickTarget.TRACK, InteractionInputType.MOUSE));
};
}
public function set maximum(_arg1:Number):void{
_maximum = _arg1;
this.value = Math.min(_arg1, this.value);
invalidate(InvalidationType.DATA);
}
public function get liveDragging():Boolean{
return (_liveDragging);
}
protected function doDrag(_arg1:MouseEvent):void{
var _local2:Number;
var _local3:Number;
_local2 = (_width / snapInterval);
_local3 = track.mouseX;
calculateValue(_local3, InteractionInputType.MOUSE, SliderEventClickTarget.THUMB);
dispatchEvent(new SliderEvent(SliderEvent.THUMB_DRAG, value, SliderEventClickTarget.THUMB, InteractionInputType.MOUSE));
}
override protected function keyDownHandler(_arg1:KeyboardEvent):void{
var _local2:uint;
var _local3:Number;
var _local4:Boolean;
if (!enabled){
return;
};
_local2 = ((snapInterval)>0) ? snapInterval : 1;
_local4 = (direction == SliderDirection.HORIZONTAL);
if ((((((_arg1.keyCode == Keyboard.DOWN)) && (!(_local4)))) || ((((_arg1.keyCode == Keyboard.LEFT)) && (_local4))))){
_local3 = (value - _local2);
} else {
if ((((((_arg1.keyCode == Keyboard.UP)) && (!(_local4)))) || ((((_arg1.keyCode == Keyboard.RIGHT)) && (_local4))))){
_local3 = (value + _local2);
} else {
if ((((((_arg1.keyCode == Keyboard.PAGE_DOWN)) && (!(_local4)))) || ((((_arg1.keyCode == Keyboard.HOME)) && (_local4))))){
_local3 = minimum;
} else {
if ((((((_arg1.keyCode == Keyboard.PAGE_UP)) && (!(_local4)))) || ((((_arg1.keyCode == Keyboard.END)) && (_local4))))){
_local3 = maximum;
};
};
};
};
if (!isNaN(_local3)){
_arg1.stopPropagation();
doSetValue(_local3, InteractionInputType.KEYBOARD, null, _arg1.keyCode);
};
}
override public function set enabled(_arg1:Boolean):void{
if (enabled == _arg1){
return;
};
super.enabled = _arg1;
track.enabled = (thumb.enabled = _arg1);
}
protected function thumbPressHandler(_arg1:MouseEvent):void{
stage.addEventListener(MouseEvent.MOUSE_MOVE, doDrag, false, 0, true);
stage.addEventListener(MouseEvent.MOUSE_UP, thumbReleaseHandler, false, 0, true);
dispatchEvent(new SliderEvent(SliderEvent.THUMB_PRESS, value, InteractionInputType.MOUSE, SliderEventClickTarget.THUMB));
}
public function get snapInterval():Number{
return (_snapInterval);
}
protected function thumbReleaseHandler(_arg1:MouseEvent):void{
stage.removeEventListener(MouseEvent.MOUSE_MOVE, doDrag);
stage.removeEventListener(MouseEvent.MOUSE_UP, thumbReleaseHandler);
dispatchEvent(new SliderEvent(SliderEvent.THUMB_RELEASE, value, InteractionInputType.MOUSE, SliderEventClickTarget.THUMB));
dispatchEvent(new SliderEvent(SliderEvent.CHANGE, value, SliderEventClickTarget.THUMB, InteractionInputType.MOUSE));
}
public function set liveDragging(_arg1:Boolean):void{
_liveDragging = _arg1;
}
public function set value(_arg1:Number):void{
doSetValue(_arg1);
}
public function set direction(_arg1:String):void{
var _local2:Boolean;
_direction = _arg1;
_local2 = (_direction == SliderDirection.VERTICAL);
if (isLivePreview){
if (_local2){
setScaleY(-1);
y = track.height;
} else {
setScaleY(1);
y = 0;
};
positionThumb();
return;
};
if (((_local2) && (componentInspectorSetting))){
if ((rotation % 90) == 0){
setScaleY(-1);
};
};
if (!componentInspectorSetting){
rotation = (_local2) ? 90 : 0;
};
}
public function set tickInterval(_arg1:Number):void{
_tickInterval = _arg1;
invalidate(InvalidationType.SIZE);
}
override public function get enabled():Boolean{
return (super.enabled);
}
override protected function draw():void{
if (isInvalid(InvalidationType.STYLES)){
setStyles();
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE)){
track.setSize(_width, track.height);
track.drawNow();
thumb.drawNow();
};
if (tickInterval > 0){
drawTicks();
} else {
clearTicks();
};
positionThumb();
super.draw();
}
override protected function configUI():void{
super.configUI();
thumb = new BaseButton();
thumb.setSize(13, 13);
thumb.autoRepeat = false;
addChild(thumb);
thumb.addEventListener(MouseEvent.MOUSE_DOWN, thumbPressHandler, false, 0, true);
track = new BaseButton();
track.move(0, 0);
track.setSize(80, 4);
track.autoRepeat = false;
track.useHandCursor = false;
track.addEventListener(MouseEvent.CLICK, onTrackClick, false, 0, true);
addChildAt(track, 0);
}
public function set snapInterval(_arg1:Number):void{
_snapInterval = _arg1;
}
public function get value():Number{
return (_value);
}
public function get direction():String{
return (_direction);
}
public function get tickInterval():Number{
return (_tickInterval);
}
override public function setSize(_arg1:Number, _arg2:Number):void{
if ((((_direction == SliderDirection.VERTICAL)) && (!(isLivePreview)))){
super.setSize(_arg2, _arg1);
} else {
super.setSize(_arg1, _arg2);
};
invalidate(InvalidationType.SIZE);
}
protected function drawTicks():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:uint;
var _local5:DisplayObject;
clearTicks();
tickContainer = new Sprite();
_local1 = ((maximum)<1) ? (tickInterval / 100) : tickInterval;
_local2 = ((maximum - minimum) / _local1);
_local3 = (_width / _local2);
_local4 = 0;
while (_local4 <= _local2) {
_local5 = getDisplayObjectInstance(getStyleValue("tickSkin"));
_local5.x = (_local3 * _local4);
_local5.y = ((track.y - _local5.height) - 2);
tickContainer.addChild(_local5);
_local4++;
};
addChild(tickContainer);
}
protected function calculateValue(_arg1:Number, _arg2:String, _arg3:String, _arg4:int=undefined):void{
var _local5:Number;
_local5 = ((_arg1 / _width) * (maximum - minimum));
if (_direction == SliderDirection.VERTICAL){
_local5 = (maximum - _local5);
} else {
_local5 = (minimum + _local5);
};
doSetValue(_local5, _arg2, _arg3, _arg4);
}
protected function getPrecision(_arg1:Number):Number{
var _local2:String;
_local2 = _arg1.toString();
if (_local2.indexOf(".") == -1){
return (0);
};
return (_local2.split(".").pop().length);
}
protected function doSetValue(_arg1:Number, _arg2:String=null, _arg3:String=null, _arg4:int=undefined):void{
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
_local5 = _value;
if (((!((_snapInterval == 0))) && (!((_snapInterval == 1))))){
_local6 = Math.pow(10, getPrecision(snapInterval));
_local7 = (_snapInterval * _local6);
_local8 = Math.round((_arg1 * _local6));
_local9 = (Math.round((_local8 / _local7)) * _local7);
_arg1 = (_local9 / _local6);
_value = Math.max(minimum, Math.min(maximum, _arg1));
} else {
_value = Math.max(minimum, Math.min(maximum, Math.round(_arg1)));
};
if (((!((_local5 == _value))) && (((((liveDragging) && (!((_arg3 == null))))) || ((_arg2 == InteractionInputType.KEYBOARD)))))){
dispatchEvent(new SliderEvent(SliderEvent.CHANGE, value, _arg3, _arg2, _arg4));
};
positionThumb();
}
protected function setStyles():void{
copyStylesToChild(thumb, THUMB_STYLES);
copyStylesToChild(track, TRACK_STYLES);
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//package fl.controls
Section 161
//SliderDirection (fl.controls.SliderDirection)
package fl.controls {
public class SliderDirection {
public static var HORIZONTAL:String = "horizontal";
public static var VERTICAL:String = "vertical";
}
}//package fl.controls
Section 162
//ComponentShim (fl.core.ComponentShim)
package fl.core {
import flash.display.*;
public dynamic class ComponentShim extends MovieClip {
}
}//package fl.core
Section 163
//InvalidationType (fl.core.InvalidationType)
package fl.core {
public class InvalidationType {
public static const SIZE:String = "size";
public static const ALL:String = "all";
public static const DATA:String = "data";
public static const SCROLL:String = "scroll";
public static const STATE:String = "state";
public static const STYLES:String = "styles";
public static const SELECTED:String = "selected";
public static const RENDERER_STYLES:String = "rendererStyles";
}
}//package fl.core
Section 164
//UIComponent (fl.core.UIComponent)
package fl.core {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import fl.managers.*;
import fl.events.*;
import flash.utils.*;
import flash.system.*;
public class UIComponent extends Sprite {
protected var _enabled:Boolean;// = true
private var _mouseFocusEnabled:Boolean;// = true
protected var startHeight:Number;
protected var _height:Number;
protected var _oldIMEMode:String;// = null
protected var startWidth:Number;
public var focusTarget:IFocusManagerComponent;
protected var errorCaught:Boolean;// = false
protected var uiFocusRect:DisplayObject;
protected var _width:Number;
public var version:String;// = "3.0.0.15"
protected var isFocused:Boolean;// = false
protected var callLaterMethods:Dictionary;
private var _focusEnabled:Boolean;// = true
private var tempText:TextField;
protected var invalidateFlag:Boolean;// = false
protected var _inspector:Boolean;// = false
protected var sharedStyles:Object;
protected var invalidHash:Object;
protected var isLivePreview:Boolean;// = false
protected var _imeMode:String;// = null
protected var instanceStyles:Object;
protected var _x:Number;
protected var _y:Number;
public static var inCallLaterPhase:Boolean = false;
private static var defaultStyles:Object = {focusRectSkin:"focusRectSkin", focusRectPadding:2, textFormat:new TextFormat("_sans", 11, 0, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), disabledTextFormat:new TextFormat("_sans", 11, 0x999999, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), defaultTextFormat:new TextFormat("_sans", 11, 0, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), defaultDisabledTextFormat:new TextFormat("_sans", 11, 0x999999, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0)};
public static var createAccessibilityImplementation:Function;
private static var focusManagers:Dictionary = new Dictionary(false);
public function UIComponent(){
version = "3.0.0.15";
isLivePreview = false;
invalidateFlag = false;
_enabled = true;
isFocused = false;
_focusEnabled = true;
_mouseFocusEnabled = true;
_imeMode = null;
_oldIMEMode = null;
errorCaught = false;
_inspector = false;
super();
instanceStyles = {};
sharedStyles = {};
invalidHash = {};
callLaterMethods = new Dictionary();
StyleManager.registerInstance(this);
configUI();
invalidate(InvalidationType.ALL);
tabEnabled = (this is IFocusManagerComponent);
focusRect = false;
if (tabEnabled){
addEventListener(FocusEvent.FOCUS_IN, focusInHandler);
addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler);
addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
addEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
};
initializeFocusManager();
addEventListener(Event.ENTER_FRAME, hookAccessibility, false, 0, true);
}
public function drawFocus(_arg1:Boolean):void{
var _local2:Number;
isFocused = _arg1;
if (((!((uiFocusRect == null))) && (contains(uiFocusRect)))){
removeChild(uiFocusRect);
uiFocusRect = null;
};
if (_arg1){
uiFocusRect = (getDisplayObjectInstance(getStyleValue("focusRectSkin")) as Sprite);
if (uiFocusRect == null){
return;
};
_local2 = Number(getStyleValue("focusRectPadding"));
uiFocusRect.x = -(_local2);
uiFocusRect.y = -(_local2);
uiFocusRect.width = (width + (_local2 * 2));
uiFocusRect.height = (height + (_local2 * 2));
addChildAt(uiFocusRect, 0);
};
}
private function callLaterDispatcher(_arg1:Event):void{
var _local2:Dictionary;
var _local3:Object;
if (_arg1.type == Event.ADDED_TO_STAGE){
removeEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher);
stage.addEventListener(Event.RENDER, callLaterDispatcher, false, 0, true);
stage.invalidate();
return;
};
_arg1.target.removeEventListener(Event.RENDER, callLaterDispatcher);
if (stage == null){
addEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher, false, 0, true);
return;
};
inCallLaterPhase = true;
_local2 = callLaterMethods;
for (_local3 in _local2) {
_local3();
delete _local2[_local3];
};
inCallLaterPhase = false;
}
private function addedHandler(_arg1:Event):void{
removeEventListener("addedToStage", addedHandler);
initializeFocusManager();
}
protected function getStyleValue(_arg1:String):Object{
return (((instanceStyles[_arg1])==null) ? sharedStyles[_arg1] : instanceStyles[_arg1]);
}
protected function isOurFocus(_arg1:DisplayObject):Boolean{
return ((_arg1 == this));
}
override public function get scaleX():Number{
return ((width / startWidth));
}
override public function get scaleY():Number{
return ((height / startHeight));
}
override public function set height(_arg1:Number):void{
if (_height == _arg1){
return;
};
setSize(width, _arg1);
}
protected function keyDownHandler(_arg1:KeyboardEvent):void{
}
protected function focusInHandler(_arg1:FocusEvent):void{
var _local2:IFocusManager;
if (isOurFocus((_arg1.target as DisplayObject))){
_local2 = focusManager;
if (((_local2) && (_local2.showFocusIndicator))){
drawFocus(true);
isFocused = true;
};
};
}
public function setStyle(_arg1:String, _arg2:Object):void{
if ((((instanceStyles[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){
return;
};
instanceStyles[_arg1] = _arg2;
invalidate(InvalidationType.STYLES);
}
override public function get visible():Boolean{
return (super.visible);
}
public function get componentInspectorSetting():Boolean{
return (_inspector);
}
override public function get x():Number{
return ((isNaN(_x)) ? super.x : _x);
}
override public function get y():Number{
return ((isNaN(_y)) ? super.y : _y);
}
protected function setIMEMode(_arg1:Boolean){
var enabled = _arg1;
if (_imeMode != null){
if (enabled){
IME.enabled = true;
_oldIMEMode = IME.conversionMode;
try {
if (((!(errorCaught)) && (!((IME.conversionMode == IMEConversionMode.UNKNOWN))))){
IME.conversionMode = _imeMode;
};
errorCaught = false;
} catch(e:Error) {
errorCaught = true;
throw (new Error(("IME mode not supported: " + _imeMode)));
};
} else {
if (((!((IME.conversionMode == IMEConversionMode.UNKNOWN))) && (!((_oldIMEMode == IMEConversionMode.UNKNOWN))))){
IME.conversionMode = _oldIMEMode;
};
IME.enabled = false;
};
};
}
public function set enabled(_arg1:Boolean):void{
if (_arg1 == _enabled){
return;
};
_enabled = _arg1;
invalidate(InvalidationType.STATE);
}
public function setSharedStyle(_arg1:String, _arg2:Object):void{
if ((((sharedStyles[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){
return;
};
sharedStyles[_arg1] = _arg2;
if (instanceStyles[_arg1] == null){
invalidate(InvalidationType.STYLES);
};
}
protected function keyUpHandler(_arg1:KeyboardEvent):void{
}
public function set focusEnabled(_arg1:Boolean):void{
_focusEnabled = _arg1;
}
override public function set scaleX(_arg1:Number):void{
setSize((startWidth * _arg1), height);
}
public function get mouseFocusEnabled():Boolean{
return (_mouseFocusEnabled);
}
override public function set scaleY(_arg1:Number):void{
setSize(width, (startHeight * _arg1));
}
protected function getDisplayObjectInstance(_arg1:Object):DisplayObject{
var classDef:Object;
var skin = _arg1;
classDef = null;
if ((skin is Class)){
return ((new (skin) as DisplayObject));
};
if ((skin is DisplayObject)){
(skin as DisplayObject).x = 0;
(skin as DisplayObject).y = 0;
return ((skin as DisplayObject));
};
try {
classDef = getDefinitionByName(skin.toString());
} catch(e:Error) {
try {
classDef = (loaderInfo.applicationDomain.getDefinition(skin.toString()) as Object);
} catch(e:Error) {
};
};
if (classDef == null){
return (null);
};
return ((new (classDef) as DisplayObject));
}
protected function copyStylesToChild(_arg1:UIComponent, _arg2:Object):void{
var _local3:String;
for (_local3 in _arg2) {
_arg1.setStyle(_local3, getStyleValue(_arg2[_local3]));
};
}
protected function beforeComponentParameters():void{
}
protected function callLater(_arg1:Function):void{
if (inCallLaterPhase){
return;
};
callLaterMethods[_arg1] = true;
if (stage != null){
stage.addEventListener(Event.RENDER, callLaterDispatcher, false, 0, true);
stage.invalidate();
} else {
addEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher, false, 0, true);
};
}
protected function createFocusManager():void{
if (focusManagers[stage] == null){
focusManagers[stage] = new FocusManager(stage);
};
}
override public function set visible(_arg1:Boolean):void{
var _local2:String;
if (super.visible == _arg1){
return;
};
super.visible = _arg1;
_local2 = (_arg1) ? ComponentEvent.SHOW : ComponentEvent.HIDE;
dispatchEvent(new ComponentEvent(_local2, true));
}
protected function hookAccessibility(_arg1:Event):void{
removeEventListener(Event.ENTER_FRAME, hookAccessibility);
initializeAccessibility();
}
public function set componentInspectorSetting(_arg1:Boolean):void{
_inspector = _arg1;
if (_inspector){
beforeComponentParameters();
} else {
afterComponentParameters();
};
}
override public function set x(_arg1:Number):void{
move(_arg1, _y);
}
public function drawNow():void{
draw();
}
override public function set y(_arg1:Number):void{
move(_x, _arg1);
}
protected function checkLivePreview():Boolean{
var className:String;
if (parent == null){
return (false);
};
try {
className = getQualifiedClassName(parent);
} catch(e:Error) {
};
return ((className == "fl.livepreview::LivePreviewParent"));
}
protected function focusOutHandler(_arg1:FocusEvent):void{
if (isOurFocus((_arg1.target as DisplayObject))){
drawFocus(false);
isFocused = false;
};
}
public function set mouseFocusEnabled(_arg1:Boolean):void{
_mouseFocusEnabled = _arg1;
}
public function getFocus():InteractiveObject{
if (stage){
return (stage.focus);
};
return (null);
}
protected function validate():void{
invalidHash = {};
}
override public function get height():Number{
return (_height);
}
public function invalidate(_arg1:String="all", _arg2:Boolean=true):void{
invalidHash[_arg1] = true;
if (_arg2){
this.callLater(draw);
};
}
public function get enabled():Boolean{
return (_enabled);
}
protected function getScaleX():Number{
return (super.scaleX);
}
protected function getScaleY():Number{
return (super.scaleY);
}
public function get focusEnabled():Boolean{
return (_focusEnabled);
}
protected function afterComponentParameters():void{
}
protected function draw():void{
if (isInvalid(InvalidationType.SIZE, InvalidationType.STYLES)){
if (((isFocused) && (focusManager.showFocusIndicator))){
drawFocus(true);
};
};
validate();
}
protected function configUI():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
isLivePreview = checkLivePreview();
_local1 = rotation;
rotation = 0;
_local2 = super.width;
_local3 = super.height;
var _local4 = 1;
super.scaleY = _local4;
super.scaleX = _local4;
setSize(_local2, _local3);
move(super.x, super.y);
rotation = _local1;
startWidth = _local2;
startHeight = _local3;
if (numChildren > 0){
removeChildAt(0);
};
}
protected function setScaleX(_arg1:Number):void{
super.scaleX = _arg1;
}
protected function setScaleY(_arg1:Number):void{
super.scaleY = _arg1;
}
private function initializeFocusManager():void{
if (stage == null){
addEventListener(Event.ADDED_TO_STAGE, addedHandler, false, 0, true);
} else {
createFocusManager();
};
}
public function set focusManager(_arg1:IFocusManager):void{
UIComponent.focusManagers[this] = _arg1;
}
public function clearStyle(_arg1:String):void{
setStyle(_arg1, null);
}
protected function isInvalid(_arg1:String, ... _args):Boolean{
if (((invalidHash[_arg1]) || (invalidHash[InvalidationType.ALL]))){
return (true);
};
while (_args.length > 0) {
if (invalidHash[_args.pop()]){
return (true);
};
};
return (false);
}
public function setSize(_arg1:Number, _arg2:Number):void{
_width = _arg1;
_height = _arg2;
invalidate(InvalidationType.SIZE);
dispatchEvent(new ComponentEvent(ComponentEvent.RESIZE, false));
}
override public function set width(_arg1:Number):void{
if (_width == _arg1){
return;
};
setSize(_arg1, height);
}
public function setFocus():void{
if (stage){
stage.focus = this;
};
}
protected function initializeAccessibility():void{
if (UIComponent.createAccessibilityImplementation != null){
UIComponent.createAccessibilityImplementation(this);
};
}
public function get focusManager():IFocusManager{
var _local1:DisplayObject;
_local1 = this;
while (_local1) {
if (UIComponent.focusManagers[_local1] != null){
return (IFocusManager(UIComponent.focusManagers[_local1]));
};
_local1 = _local1.parent;
};
return (null);
}
override public function get width():Number{
return (_width);
}
public function move(_arg1:Number, _arg2:Number):void{
_x = _arg1;
_y = _arg2;
super.x = Math.round(_arg1);
super.y = Math.round(_arg2);
dispatchEvent(new ComponentEvent(ComponentEvent.MOVE));
}
public function validateNow():void{
invalidate(InvalidationType.ALL, false);
draw();
}
public function getStyle(_arg1:String):Object{
return (instanceStyles[_arg1]);
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
public static function mergeStyles(... _args):Object{
var _local2:Object;
var _local3:uint;
var _local4:uint;
var _local5:Object;
var _local6:String;
_local2 = {};
_local3 = _args.length;
_local4 = 0;
while (_local4 < _local3) {
_local5 = _args[_local4];
for (_local6 in _local5) {
if (_local2[_local6] != null){
} else {
_local2[_local6] = _args[_local4][_local6];
};
};
_local4++;
};
return (_local2);
}
}
}//package fl.core
Section 165
//ComponentEvent (fl.events.ComponentEvent)
package fl.events {
import flash.events.*;
public class ComponentEvent extends Event {
public static const HIDE:String = "hide";
public static const BUTTON_DOWN:String = "buttonDown";
public static const MOVE:String = "move";
public static const RESIZE:String = "resize";
public static const ENTER:String = "enter";
public static const LABEL_CHANGE:String = "labelChange";
public static const SHOW:String = "show";
public function ComponentEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
override public function toString():String{
return (formatToString("ComponentEvent", "type", "bubbles", "cancelable"));
}
override public function clone():Event{
return (new ComponentEvent(type, bubbles, cancelable));
}
}
}//package fl.events
Section 166
//InteractionInputType (fl.events.InteractionInputType)
package fl.events {
public class InteractionInputType {
public static const MOUSE:String = "mouse";
public static const KEYBOARD:String = "keyboard";
}
}//package fl.events
Section 167
//SliderEvent (fl.events.SliderEvent)
package fl.events {
import flash.events.*;
public class SliderEvent extends Event {
protected var _triggerEvent:String;
protected var _keyCode:Number;
protected var _value:Number;
protected var _clickTarget:String;
public static const CHANGE:String = "change";
public static const THUMB_PRESS:String = "thumbPress";
public static const THUMB_DRAG:String = "thumbDrag";
public static const THUMB_RELEASE:String = "thumbRelease";
public function SliderEvent(_arg1:String, _arg2:Number, _arg3:String, _arg4:String, _arg5:int=0){
_value = _arg2;
_keyCode = _arg5;
_triggerEvent = _arg4;
_clickTarget = _arg3;
super(_arg1);
}
public function get clickTarget():String{
return (_clickTarget);
}
override public function clone():Event{
return (new SliderEvent(type, _value, _clickTarget, _triggerEvent, _keyCode));
}
override public function toString():String{
return (formatToString("SliderEvent", "type", "value", "bubbles", "cancelable", "keyCode", "triggerEvent", "clickTarget"));
}
public function get triggerEvent():String{
return (_triggerEvent);
}
public function get value():Number{
return (_value);
}
public function get keyCode():Number{
return (_keyCode);
}
}
}//package fl.events
Section 168
//SliderEventClickTarget (fl.events.SliderEventClickTarget)
package fl.events {
public class SliderEventClickTarget {
public static const TRACK:String = "track";
public static const THUMB:String = "thumb";
}
}//package fl.events
Section 169
//FocusManager (fl.managers.FocusManager)
package fl.managers {
import flash.events.*;
import fl.controls.*;
import flash.display.*;
import fl.core.*;
import flash.text.*;
import flash.utils.*;
import flash.ui.*;
public class FocusManager implements IFocusManager {
private var focusableObjects:Dictionary;
private var _showFocusIndicator:Boolean;// = true
private var defButton:Button;
private var focusableCandidates:Array;
private var _form:DisplayObjectContainer;
private var _defaultButtonEnabled:Boolean;// = true
private var activated:Boolean;// = false
private var _defaultButton:Button;
private var calculateCandidates:Boolean;// = true
private var lastFocus:InteractiveObject;
private var lastAction:String;
public function FocusManager(_arg1:DisplayObjectContainer){
activated = false;
calculateCandidates = true;
_showFocusIndicator = true;
_defaultButtonEnabled = true;
super();
focusableObjects = new Dictionary(true);
if (_arg1 != null){
_form = _arg1;
addFocusables(DisplayObject(_arg1));
_arg1.addEventListener(Event.ADDED, addedHandler);
_arg1.addEventListener(Event.REMOVED, removedHandler);
activate();
};
}
public function get showFocusIndicator():Boolean{
return (_showFocusIndicator);
}
private function getIndexOfNextObject(_arg1:int, _arg2:Boolean, _arg3:Boolean, _arg4:String):int{
var _local5:int;
var _local6:int;
var _local7:DisplayObject;
var _local8:IFocusManagerGroup;
var _local9:int;
var _local10:DisplayObject;
var _local11:IFocusManagerGroup;
_local5 = focusableCandidates.length;
_local6 = _arg1;
while (true) {
if (_arg2){
_arg1--;
} else {
_arg1++;
};
if (_arg3){
if (((_arg2) && ((_arg1 < 0)))){
break;
};
if (((!(_arg2)) && ((_arg1 == _local5)))){
break;
};
} else {
_arg1 = ((_arg1 + _local5) % _local5);
if (_local6 == _arg1){
break;
};
};
if (isValidFocusCandidate(focusableCandidates[_arg1], _arg4)){
_local7 = DisplayObject(findFocusManagerComponent(focusableCandidates[_arg1]));
if ((_local7 is IFocusManagerGroup)){
_local8 = IFocusManagerGroup(_local7);
_local9 = 0;
while (_local9 < focusableCandidates.length) {
_local10 = focusableCandidates[_local9];
if ((_local10 is IFocusManagerGroup)){
_local11 = IFocusManagerGroup(_local10);
if ((((_local11.groupName == _local8.groupName)) && (_local11.selected))){
_arg1 = _local9;
break;
};
};
_local9++;
};
};
return (_arg1);
};
};
return (_arg1);
}
public function set form(_arg1:DisplayObjectContainer):void{
_form = _arg1;
}
private function addFocusables(_arg1:DisplayObject, _arg2:Boolean=false):void{
var focusable:IFocusManagerComponent;
var io:InteractiveObject;
var doc:DisplayObjectContainer;
var i:int;
var child:DisplayObject;
var o = _arg1;
var skipTopLevel = _arg2;
if (!skipTopLevel){
if ((o is IFocusManagerComponent)){
focusable = IFocusManagerComponent(o);
if (focusable.focusEnabled){
if (((focusable.tabEnabled) && (isTabVisible(o)))){
focusableObjects[o] = true;
calculateCandidates = true;
};
o.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
o.addEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler);
};
} else {
if ((o is InteractiveObject)){
io = (o as InteractiveObject);
if (((((io) && (io.tabEnabled))) && ((findFocusManagerComponent(io) == io)))){
focusableObjects[io] = true;
calculateCandidates = true;
};
io.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
io.addEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler);
};
};
};
if ((o is DisplayObjectContainer)){
doc = DisplayObjectContainer(o);
o.addEventListener(Event.TAB_CHILDREN_CHANGE, tabChildrenChangeHandler);
if ((((((doc is Stage)) || ((doc.parent is Stage)))) || (doc.tabChildren))){
i = 0;
while (i < doc.numChildren) {
try {
child = doc.getChildAt(i);
if (child != null){
addFocusables(doc.getChildAt(i));
};
} catch(error:SecurityError) {
};
i = (i + 1);
};
};
};
}
private function getChildIndex(_arg1:DisplayObjectContainer, _arg2:DisplayObject):int{
return (_arg1.getChildIndex(_arg2));
}
private function mouseFocusChangeHandler(_arg1:FocusEvent):void{
if ((_arg1.relatedObject is TextField)){
return;
};
_arg1.preventDefault();
}
private function focusOutHandler(_arg1:FocusEvent):void{
var _local2:InteractiveObject;
_local2 = (_arg1.target as InteractiveObject);
}
private function isValidFocusCandidate(_arg1:DisplayObject, _arg2:String):Boolean{
var _local3:IFocusManagerGroup;
if (!isEnabledAndVisible(_arg1)){
return (false);
};
if ((_arg1 is IFocusManagerGroup)){
_local3 = IFocusManagerGroup(_arg1);
if (_arg2 == _local3.groupName){
return (false);
};
};
return (true);
}
public function findFocusManagerComponent(_arg1:InteractiveObject):InteractiveObject{
var _local2:InteractiveObject;
_local2 = _arg1;
while (_arg1) {
if ((((_arg1 is IFocusManagerComponent)) && (IFocusManagerComponent(_arg1).focusEnabled))){
return (_arg1);
};
_arg1 = _arg1.parent;
};
return (_local2);
}
private function sortFocusableObjectsTabIndex():void{
var _local1:Object;
var _local2:InteractiveObject;
focusableCandidates = [];
for (_local1 in focusableObjects) {
_local2 = InteractiveObject(_local1);
if (((_local2.tabIndex) && (!(isNaN(Number(_local2.tabIndex)))))){
focusableCandidates.push(_local2);
};
};
focusableCandidates.sort(sortByTabIndex);
}
private function removeFocusables(_arg1:DisplayObject):void{
var _local2:Object;
var _local3:DisplayObject;
if ((_arg1 is DisplayObjectContainer)){
_arg1.removeEventListener(Event.TAB_CHILDREN_CHANGE, tabChildrenChangeHandler);
_arg1.removeEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler);
for (_local2 in focusableObjects) {
_local3 = DisplayObject(_local2);
if (DisplayObjectContainer(_arg1).contains(_local3)){
if (_local3 == lastFocus){
lastFocus = null;
};
_local3.removeEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
delete focusableObjects[_local2];
calculateCandidates = true;
};
};
};
}
private function addedHandler(_arg1:Event):void{
var _local2:DisplayObject;
_local2 = DisplayObject(_arg1.target);
if (_local2.stage){
addFocusables(DisplayObject(_arg1.target));
};
}
private function getTopLevelFocusTarget(_arg1:InteractiveObject):InteractiveObject{
while (_arg1 != InteractiveObject(form)) {
if ((((((((_arg1 is IFocusManagerComponent)) && (IFocusManagerComponent(_arg1).focusEnabled))) && (IFocusManagerComponent(_arg1).mouseFocusEnabled))) && (UIComponent(_arg1).enabled))){
return (_arg1);
};
_arg1 = _arg1.parent;
if (_arg1 == null){
break;
};
};
return (null);
}
private function tabChildrenChangeHandler(_arg1:Event):void{
var _local2:DisplayObjectContainer;
if (_arg1.target != _arg1.currentTarget){
return;
};
calculateCandidates = true;
_local2 = DisplayObjectContainer(_arg1.target);
if (_local2.tabChildren){
addFocusables(_local2, true);
} else {
removeFocusables(_local2);
};
}
public function sendDefaultButtonEvent():void{
defButton.dispatchEvent(new MouseEvent(MouseEvent.CLICK));
}
public function getFocus():InteractiveObject{
var _local1:InteractiveObject;
_local1 = form.stage.focus;
return (findFocusManagerComponent(_local1));
}
private function isEnabledAndVisible(_arg1:DisplayObject):Boolean{
var _local2:DisplayObjectContainer;
var _local3:TextField;
var _local4:SimpleButton;
_local2 = DisplayObject(form).parent;
while (_arg1 != _local2) {
if ((_arg1 is UIComponent)){
if (!UIComponent(_arg1).enabled){
return (false);
};
} else {
if ((_arg1 is TextField)){
_local3 = TextField(_arg1);
if ((((_local3.type == TextFieldType.DYNAMIC)) || (!(_local3.selectable)))){
return (false);
};
} else {
if ((_arg1 is SimpleButton)){
_local4 = SimpleButton(_arg1);
if (!_local4.enabled){
return (false);
};
};
};
};
if (!_arg1.visible){
return (false);
};
_arg1 = _arg1.parent;
};
return (true);
}
public function set defaultButton(_arg1:Button):void{
var _local2:Button;
_local2 = (_arg1) ? Button(_arg1) : null;
if (_local2 != _defaultButton){
if (_defaultButton){
_defaultButton.emphasized = false;
};
if (defButton){
defButton.emphasized = false;
};
_defaultButton = _local2;
defButton = _local2;
if (_local2){
_local2.emphasized = true;
};
};
}
private function deactivateHandler(_arg1:Event):void{
var _local2:InteractiveObject;
_local2 = InteractiveObject(_arg1.target);
}
public function setFocus(_arg1:InteractiveObject):void{
if ((_arg1 is IFocusManagerComponent)){
IFocusManagerComponent(_arg1).setFocus();
} else {
form.stage.focus = _arg1;
};
}
private function setFocusToNextObject(_arg1:FocusEvent):void{
var _local2:InteractiveObject;
if (!hasFocusableObjects()){
return;
};
_local2 = getNextFocusManagerComponent(_arg1.shiftKey);
if (_local2){
setFocus(_local2);
};
}
private function hasFocusableObjects():Boolean{
var _local1:Object;
for (_local1 in focusableObjects) {
return (true);
};
return (false);
}
private function tabIndexChangeHandler(_arg1:Event):void{
calculateCandidates = true;
}
private function sortFocusableObjects():void{
var _local1:Object;
var _local2:InteractiveObject;
focusableCandidates = [];
for (_local1 in focusableObjects) {
_local2 = InteractiveObject(_local1);
if (((((_local2.tabIndex) && (!(isNaN(Number(_local2.tabIndex)))))) && ((_local2.tabIndex > 0)))){
sortFocusableObjectsTabIndex();
return;
};
focusableCandidates.push(_local2);
};
focusableCandidates.sort(sortByDepth);
}
private function keyFocusChangeHandler(_arg1:FocusEvent):void{
showFocusIndicator = true;
if ((((((_arg1.keyCode == Keyboard.TAB)) || ((_arg1.keyCode == 0)))) && (!(_arg1.isDefaultPrevented())))){
setFocusToNextObject(_arg1);
_arg1.preventDefault();
};
}
private function getIndexOfFocusedObject(_arg1:DisplayObject):int{
var _local2:int;
var _local3:int;
_local2 = focusableCandidates.length;
_local3 = 0;
_local3 = 0;
while (_local3 < _local2) {
if (focusableCandidates[_local3] == _arg1){
return (_local3);
};
_local3++;
};
return (-1);
}
public function hideFocus():void{
}
private function removedHandler(_arg1:Event):void{
var _local2:int;
var _local3:DisplayObject;
var _local4:InteractiveObject;
_local3 = DisplayObject(_arg1.target);
if ((((_local3 is IFocusManagerComponent)) && ((focusableObjects[_local3] == true)))){
if (_local3 == lastFocus){
IFocusManagerComponent(lastFocus).drawFocus(false);
lastFocus = null;
};
_local3.removeEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
delete focusableObjects[_local3];
calculateCandidates = true;
} else {
if ((((_local3 is InteractiveObject)) && ((focusableObjects[_local3] == true)))){
_local4 = (_local3 as InteractiveObject);
if (_local4){
if (_local4 == lastFocus){
lastFocus = null;
};
delete focusableObjects[_local4];
calculateCandidates = true;
};
_local3.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
};
};
removeFocusables(_local3);
}
private function sortByDepth(_arg1:InteractiveObject, _arg2:InteractiveObject):Number{
var _local3:String;
var _local4:String;
var _local5:int;
var _local6:String;
var _local7:String;
var _local8:String;
var _local9:DisplayObject;
var _local10:DisplayObject;
_local3 = "";
_local4 = "";
_local8 = "0000";
_local9 = DisplayObject(_arg1);
_local10 = DisplayObject(_arg2);
while (((!((_local9 == DisplayObject(form)))) && (_local9.parent))) {
_local5 = getChildIndex(_local9.parent, _local9);
_local6 = _local5.toString(16);
if (_local6.length < 4){
_local7 = (_local8.substring(0, (4 - _local6.length)) + _local6);
};
_local3 = (_local7 + _local3);
_local9 = _local9.parent;
};
while (((!((_local10 == DisplayObject(form)))) && (_local10.parent))) {
_local5 = getChildIndex(_local10.parent, _local10);
_local6 = _local5.toString(16);
if (_local6.length < 4){
_local7 = (_local8.substring(0, (4 - _local6.length)) + _local6);
};
_local4 = (_local7 + _local4);
_local10 = _local10.parent;
};
return (((_local3 > _local4)) ? 1 : ((_local3 < _local4)) ? -1 : 0);
}
public function get defaultButton():Button{
return (_defaultButton);
}
private function activateHandler(_arg1:Event):void{
var _local2:InteractiveObject;
_local2 = InteractiveObject(_arg1.target);
if (lastFocus){
if ((lastFocus is IFocusManagerComponent)){
IFocusManagerComponent(lastFocus).setFocus();
} else {
form.stage.focus = lastFocus;
};
};
lastAction = "ACTIVATE";
}
public function showFocus():void{
}
public function set defaultButtonEnabled(_arg1:Boolean):void{
_defaultButtonEnabled = _arg1;
}
public function getNextFocusManagerComponent(_arg1:Boolean=false):InteractiveObject{
var _local2:DisplayObject;
var _local3:String;
var _local4:int;
var _local5:Boolean;
var _local6:int;
var _local7:int;
var _local8:IFocusManagerGroup;
if (!hasFocusableObjects()){
return (null);
};
if (calculateCandidates){
sortFocusableObjects();
calculateCandidates = false;
};
_local2 = form.stage.focus;
_local2 = DisplayObject(findFocusManagerComponent(InteractiveObject(_local2)));
_local3 = "";
if ((_local2 is IFocusManagerGroup)){
_local8 = IFocusManagerGroup(_local2);
_local3 = _local8.groupName;
};
_local4 = getIndexOfFocusedObject(_local2);
_local5 = false;
_local6 = _local4;
if (_local4 == -1){
if (_arg1){
_local4 = focusableCandidates.length;
};
_local5 = true;
};
_local7 = getIndexOfNextObject(_local4, _arg1, _local5, _local3);
return (findFocusManagerComponent(focusableCandidates[_local7]));
}
private function mouseDownHandler(_arg1:MouseEvent):void{
var _local2:InteractiveObject;
if (_arg1.isDefaultPrevented()){
return;
};
_local2 = getTopLevelFocusTarget(InteractiveObject(_arg1.target));
if (!_local2){
return;
};
showFocusIndicator = false;
if (((((!((_local2 == lastFocus))) || ((lastAction == "ACTIVATE")))) && (!((_local2 is TextField))))){
setFocus(_local2);
};
lastAction = "MOUSEDOWN";
}
private function isTabVisible(_arg1:DisplayObject):Boolean{
var _local2:DisplayObjectContainer;
_local2 = _arg1.parent;
while (((((_local2) && (!((_local2 is Stage))))) && (!(((_local2.parent) && ((_local2.parent is Stage))))))) {
if (!_local2.tabChildren){
return (false);
};
_local2 = _local2.parent;
};
return (true);
}
public function get nextTabIndex():int{
return (0);
}
private function keyDownHandler(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.TAB){
lastAction = "KEY";
if (calculateCandidates){
sortFocusableObjects();
calculateCandidates = false;
};
};
if (((((((defaultButtonEnabled) && ((_arg1.keyCode == Keyboard.ENTER)))) && (defaultButton))) && (defButton.enabled))){
sendDefaultButtonEvent();
};
}
private function focusInHandler(_arg1:FocusEvent):void{
var _local2:InteractiveObject;
var _local3:Button;
_local2 = InteractiveObject(_arg1.target);
if (form.contains(_local2)){
lastFocus = findFocusManagerComponent(InteractiveObject(_local2));
if ((lastFocus is Button)){
_local3 = Button(lastFocus);
if (defButton){
defButton.emphasized = false;
defButton = _local3;
_local3.emphasized = true;
};
} else {
if (((defButton) && (!((defButton == _defaultButton))))){
defButton.emphasized = false;
defButton = _defaultButton;
_defaultButton.emphasized = true;
};
};
};
}
private function tabEnabledChangeHandler(_arg1:Event):void{
var _local2:InteractiveObject;
var _local3:Boolean;
calculateCandidates = true;
_local2 = InteractiveObject(_arg1.target);
_local3 = (focusableObjects[_local2] == true);
if (_local2.tabEnabled){
if (((!(_local3)) && (isTabVisible(_local2)))){
if (!(_local2 is IFocusManagerComponent)){
_local2.focusRect = false;
};
focusableObjects[_local2] = true;
};
} else {
if (_local3){
delete focusableObjects[_local2];
};
};
}
public function set showFocusIndicator(_arg1:Boolean):void{
_showFocusIndicator = _arg1;
}
public function get form():DisplayObjectContainer{
return (_form);
}
private function sortByTabIndex(_arg1:InteractiveObject, _arg2:InteractiveObject):int{
return (((_arg1.tabIndex > _arg2.tabIndex)) ? 1 : ((_arg1.tabIndex < _arg2.tabIndex)) ? -1 : sortByDepth(_arg1, _arg2));
}
public function activate():void{
if (activated){
return;
};
form.stage.addEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, mouseFocusChangeHandler, false, 0, true);
form.stage.addEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler, false, 0, true);
form.addEventListener(FocusEvent.FOCUS_IN, focusInHandler, true);
form.addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler, true);
form.stage.addEventListener(Event.ACTIVATE, activateHandler, false, 0, true);
form.stage.addEventListener(Event.DEACTIVATE, deactivateHandler, false, 0, true);
form.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
form.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler, true);
activated = true;
if (lastFocus){
setFocus(lastFocus);
};
}
public function deactivate():void{
form.stage.removeEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, mouseFocusChangeHandler);
form.stage.removeEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler);
form.removeEventListener(FocusEvent.FOCUS_IN, focusInHandler, true);
form.removeEventListener(FocusEvent.FOCUS_OUT, focusOutHandler, true);
form.stage.removeEventListener(Event.ACTIVATE, activateHandler);
form.stage.removeEventListener(Event.DEACTIVATE, deactivateHandler);
form.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
form.removeEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler, true);
activated = false;
}
public function get defaultButtonEnabled():Boolean{
return (_defaultButtonEnabled);
}
}
}//package fl.managers
Section 170
//IFocusManager (fl.managers.IFocusManager)
package fl.managers {
import fl.controls.*;
import flash.display.*;
public interface IFocusManager {
function getFocus():InteractiveObject;
function deactivate():void;
function set defaultButton(_arg1:Button):void;
function set showFocusIndicator(_arg1:Boolean):void;
function get defaultButtonEnabled():Boolean;
function get nextTabIndex():int;
function get defaultButton():Button;
function get showFocusIndicator():Boolean;
function setFocus(_arg1:InteractiveObject):void;
function activate():void;
function showFocus():void;
function set defaultButtonEnabled(_arg1:Boolean):void;
function hideFocus():void;
function findFocusManagerComponent(_arg1:InteractiveObject):InteractiveObject;
function getNextFocusManagerComponent(_arg1:Boolean=false):InteractiveObject;
}
}//package fl.managers
Section 171
//IFocusManagerComponent (fl.managers.IFocusManagerComponent)
package fl.managers {
public interface IFocusManagerComponent {
function set focusEnabled(_arg1:Boolean):void;
function drawFocus(_arg1:Boolean):void;
function setFocus():void;
function get focusEnabled():Boolean;
function get tabEnabled():Boolean;
function get tabIndex():int;
function get mouseFocusEnabled():Boolean;
}
}//package fl.managers
Section 172
//IFocusManagerGroup (fl.managers.IFocusManagerGroup)
package fl.managers {
public interface IFocusManagerGroup {
function set groupName(_arg1:String):void;
function set selected(_arg1:Boolean):void;
function get groupName():String;
function get selected():Boolean;
}
}//package fl.managers
Section 173
//StyleManager (fl.managers.StyleManager)
package fl.managers {
import fl.core.*;
import flash.text.*;
import flash.utils.*;
public class StyleManager {
private var globalStyles:Object;
private var classToDefaultStylesDict:Dictionary;
private var styleToClassesHash:Object;
private var classToStylesDict:Dictionary;
private var classToInstancesDict:Dictionary;
private static var _instance:StyleManager;
public function StyleManager(){
styleToClassesHash = {};
classToInstancesDict = new Dictionary(true);
classToStylesDict = new Dictionary(true);
classToDefaultStylesDict = new Dictionary(true);
globalStyles = UIComponent.getStyleDefinition();
}
public static function clearComponentStyle(_arg1:Object, _arg2:String):void{
var _local3:Class;
var _local4:Object;
_local3 = getClassDef(_arg1);
_local4 = getInstance().classToStylesDict[_local3];
if (((!((_local4 == null))) && (!((_local4[_arg2] == null))))){
delete _local4[_arg2];
invalidateComponentStyle(_local3, _arg2);
};
}
private static function getClassDef(_arg1:Object):Class{
var component = _arg1;
if ((component is Class)){
return ((component as Class));
};
try {
return ((getDefinitionByName(getQualifiedClassName(component)) as Class));
} catch(e:Error) {
if ((component is UIComponent)){
try {
return ((component.loaderInfo.applicationDomain.getDefinition(getQualifiedClassName(component)) as Class));
} catch(e:Error) {
};
};
};
return (null);
}
public static function clearStyle(_arg1:String):void{
setStyle(_arg1, null);
}
public static function setComponentStyle(_arg1:Object, _arg2:String, _arg3:Object):void{
var _local4:Class;
var _local5:Object;
_local4 = getClassDef(_arg1);
_local5 = getInstance().classToStylesDict[_local4];
if (_local5 == null){
_local5 = (getInstance().classToStylesDict[_local4] = {});
};
if (_local5 == _arg3){
return;
};
_local5[_arg2] = _arg3;
invalidateComponentStyle(_local4, _arg2);
}
private static function setSharedStyles(_arg1:UIComponent):void{
var _local2:StyleManager;
var _local3:Class;
var _local4:Object;
var _local5:String;
_local2 = getInstance();
_local3 = getClassDef(_arg1);
_local4 = _local2.classToDefaultStylesDict[_local3];
for (_local5 in _local4) {
_arg1.setSharedStyle(_local5, getSharedStyle(_arg1, _local5));
};
}
public static function getComponentStyle(_arg1:Object, _arg2:String):Object{
var _local3:Class;
var _local4:Object;
_local3 = getClassDef(_arg1);
_local4 = getInstance().classToStylesDict[_local3];
return (((_local4)==null) ? null : _local4[_arg2]);
}
private static function getInstance(){
if (_instance == null){
_instance = new (StyleManager);
};
return (_instance);
}
private static function invalidateComponentStyle(_arg1:Class, _arg2:String):void{
var _local3:Dictionary;
var _local4:Object;
var _local5:UIComponent;
_local3 = getInstance().classToInstancesDict[_arg1];
if (_local3 == null){
return;
};
for (_local4 in _local3) {
_local5 = (_local4 as UIComponent);
if (_local5 == null){
} else {
_local5.setSharedStyle(_arg2, getSharedStyle(_local5, _arg2));
};
};
}
private static function invalidateStyle(_arg1:String):void{
var _local2:Dictionary;
var _local3:Object;
_local2 = getInstance().styleToClassesHash[_arg1];
if (_local2 == null){
return;
};
for (_local3 in _local2) {
invalidateComponentStyle(Class(_local3), _arg1);
};
}
public static function registerInstance(_arg1:UIComponent):void{
var inst:StyleManager;
var classDef:Class;
var target:Class;
var defaultStyles:Object;
var styleToClasses:Object;
var n:String;
var instance = _arg1;
inst = getInstance();
classDef = getClassDef(instance);
if (classDef == null){
return;
};
if (inst.classToInstancesDict[classDef] == null){
inst.classToInstancesDict[classDef] = new Dictionary(true);
target = classDef;
while (defaultStyles == null) {
if (target["getStyleDefinition"] != null){
defaultStyles = target["getStyleDefinition"]();
break;
};
try {
target = (instance.loaderInfo.applicationDomain.getDefinition(getQualifiedSuperclassName(target)) as Class);
} catch(err:Error) {
try {
target = (getDefinitionByName(getQualifiedSuperclassName(target)) as Class);
} catch(e:Error) {
defaultStyles = UIComponent.getStyleDefinition();
break;
};
};
};
styleToClasses = inst.styleToClassesHash;
for (n in defaultStyles) {
if (styleToClasses[n] == null){
styleToClasses[n] = new Dictionary(true);
};
styleToClasses[n][classDef] = true;
};
inst.classToDefaultStylesDict[classDef] = defaultStyles;
inst.classToStylesDict[classDef] = {};
};
inst.classToInstancesDict[classDef][instance] = true;
setSharedStyles(instance);
}
public static function getStyle(_arg1:String):Object{
return (getInstance().globalStyles[_arg1]);
}
private static function getSharedStyle(_arg1:UIComponent, _arg2:String):Object{
var _local3:Class;
var _local4:StyleManager;
var _local5:Object;
_local3 = getClassDef(_arg1);
_local4 = getInstance();
_local5 = _local4.classToStylesDict[_local3][_arg2];
if (_local5 != null){
return (_local5);
};
_local5 = _local4.globalStyles[_arg2];
if (_local5 != null){
return (_local5);
};
return (_local4.classToDefaultStylesDict[_local3][_arg2]);
}
public static function setStyle(_arg1:String, _arg2:Object):void{
var _local3:Object;
_local3 = getInstance().globalStyles;
if ((((_local3[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){
return;
};
_local3[_arg1] = _arg2;
invalidateStyle(_arg1);
}
}
}//package fl.managers
Section 174
//NotEnoughMoneyError (game.errors.NotEnoughMoneyError)
package game.errors {
public class NotEnoughMoneyError extends Error {
public function NotEnoughMoneyError(){
super("Error! Not Enough Money");
}
}
}//package game.errors
Section 175
//ShopIsFullError (game.errors.ShopIsFullError)
package game.errors {
import fai.*;
public class ShopIsFullError extends Error {
public function ShopIsFullError(){
super(StringConsts.shop_isnt_empty);
}
}
}//package game.errors
Section 176
//AmericanRestaurant (game.restaurant.AmericanRestaurant)
package game.restaurant {
import flash.display.*;
import game.upgrades.*;
import fai.*;
public class AmericanRestaurant extends BaseRestaurant {
public var delivery_american:MovieClip;
public var security_system:MovieClip;
public var decor5_american:MovieClip;
public var decor7_american:MovieClip;
public var country_menu:MovieClip;
public var platform:MovieClip;
public var receptionist_american:MovieClip;
private var currentHouseHeader;// = "no_header"
public var underground_bar_american:MovieClip;
public var decor2_american:MovieClip;
public var summer_seats_american:MovieClip;
public var decor4_american:MovieClip;
public var house:MovieClip;
public var decor6_american:MovieClip;
public var ads3_american:MovieClip;
public var sale_campaigns:MovieClip;
public var ads1:MovieClip;
public var ads4:MovieClip;
public var ads2:MovieClip;
public var ads5_american:MovieClip;
public var decor1_american:MovieClip;
public var decor3_american:MovieClip;
public var tv_hall:MovieClip;
public function AmericanRestaurant():void{
currentHouseHeader = "no_header";
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3);
buttonMode = true;
mouseChildren = false;
}
override protected function createGeneralUpgrades():void{
generalUpgrades = new Array(new LevelUpgrade(MoneyConsts.second_floor, MoneyConsts.third_floor, "american_second_floor", "american_third_floor"), new SimpleShowUpgrade(MoneyConsts.summer_seats, "summer_seats_american"), new SimpleShowUpgrade(MoneyConsts.security_system, "security_system"), new SimpleShowUpgrade(MoneyConsts.receptionist, "receptionist_american"), new SimpleShowUpgrade(MoneyConsts.underground_bar, "underground_bar_american"), new SimpleShowUpgrade(MoneyConsts.delivery, "delivery_american"));
}
function frame3(){
updateHouse();
}
function frame1(){
updateHouse();
}
function frame2(){
updateHouse();
}
override protected function createSpecialUpgrades():void{
specialUpgrades = new Array(new SimpleShowUpgrade(MoneyConsts.tv_hall, "tv_hall"), new SignboardUpgrade(MoneyConsts.pizza_production, "pizza_header", "pizza_production"), new SignboardUpgrade(MoneyConsts.luxury_pizza, "luxury_pizza_header", "luxury_pizza"), new SimpleShowUpgrade(MoneyConsts.country_menu, "country_menu"), new SignboardUpgrade(MoneyConsts.king_burgers, "king_burgers_header", "king_burgers"), new SimpleShowUpgrade(MoneyConsts.sale_campaigns, "sale_campaigns"));
}
override protected function createAdvDecorUpgrades():void{
advdecorUpgrades = new Array(new SimpleShowUpgrade(MoneyConsts.ads1, "ads1"), new SimpleShowUpgrade(MoneyConsts.ads2, "ads2"), new SimpleShowUpgrade(MoneyConsts.ads3_american, "ads3_american"), new SimpleShowUpgrade(MoneyConsts.ads4, "ads4"), new SimpleShowUpgrade(MoneyConsts.ads5_american, "ads5_american"), new SimpleShowUpgrade(MoneyConsts.decor1_american, "decor1_american"), new SimpleShowUpgrade(MoneyConsts.decor2_american, "decor2_american"), new SimpleShowUpgrade(MoneyConsts.decor3_american, "decor3_american"), new SimpleShowUpgrade(MoneyConsts.decor4_american, "decor4_american"), new SimpleShowUpgrade(MoneyConsts.decor5_american, "decor5_american"), new SimpleShowUpgrade(MoneyConsts.decor6_american, "decor6_american"), new SimpleShowUpgrade(MoneyConsts.decor7_american, "decor7_american"));
}
override public function upgradeHeader(_arg1:String):void{
house.gotoAndStop(_arg1);
currentHouseHeader = _arg1;
}
private function updateHouse():void{
house.gotoAndStop(currentHouseHeader);
}
override protected function setAllUpgradeToInvisible():void{
summer_seats_american.visible = false;
security_system.visible = false;
receptionist_american.visible = false;
underground_bar_american.visible = false;
tv_hall.visible = false;
house.gotoAndStop(currentHouseHeader);
country_menu.visible = false;
sale_campaigns.visible = false;
delivery_american.visible = false;
ads1.visible = false;
ads2.visible = false;
ads3_american.visible = false;
ads4.visible = false;
ads5_american.visible = false;
decor1_american.visible = false;
decor2_american.visible = false;
decor3_american.visible = false;
decor4_american.visible = false;
decor5_american.visible = false;
decor6_american.visible = false;
decor7_american.visible = false;
}
}
}//package game.restaurant
Section 177
//BaseRestaurant (game.restaurant.BaseRestaurant)
package game.restaurant {
import flash.display.*;
import game.upgrades.*;
import fai.*;
public class BaseRestaurant extends MovieClip {
public var enemy_restaurant:Boolean;// = false
protected var advdecorUpgrades:Array;
protected var currentLevel:int;
protected var specialUpgrades:Array;
protected var generalUpgrades:Array;
public function BaseRestaurant(){
generalUpgrades = [];
specialUpgrades = [];
advdecorUpgrades = [];
enemy_restaurant = false;
super();
visible = true;
setAllUpgradeToInvisible();
createGeneralUpgrades();
createSpecialUpgrades();
createAdvDecorUpgrades();
setLevel(1);
buttonMode = true;
mouseChildren = false;
}
public function setShopParentForAll(_arg1):void{
setShopParent(_arg1, generalUpgrades);
setShopParent(_arg1, specialUpgrades);
setShopParent(_arg1, advdecorUpgrades);
}
protected function setAllUpgradeToInvisible():void{
}
private function getUpgradeByName(_arg1:String, _arg2:Array):BaseUpgradeCommand{
var _local3:BaseUpgradeCommand;
for each (_local3 in _arg2) {
if (_local3.initialMenuFrame == _arg1){
return (_local3);
};
if ((((((StringConsts.american_second_floor == _arg1)) || ((StringConsts.american_third_floor == _arg1)))) && ((_local3.initialMenuFrame == StringConsts.american_third_floor)))){
return (_local3);
};
if ((((((StringConsts.sushi_second_floor == _arg1)) || ((StringConsts.sushi_third_floor == _arg1)))) && ((_local3.initialMenuFrame == StringConsts.sushi_third_floor)))){
return (_local3);
};
};
return (null);
}
public function getAdvDecorUpgrade(_arg1:int):BaseUpgradeCommand{
return (advdecorUpgrades[_arg1]);
}
public function getGeneralUpgrade(_arg1:int):BaseUpgradeCommand{
return (generalUpgrades[_arg1]);
}
protected function createSpecialUpgrades():void{
}
public function getGeneralUpgradeByName(_arg1:String):BaseUpgradeCommand{
return (getUpgradeByName(_arg1, generalUpgrades));
}
public function getSpecialUpgrade(_arg1:uint):BaseUpgradeCommand{
return (specialUpgrades[_arg1]);
}
public function isUpgradeDone(_arg1:String):Boolean{
var _local2:*;
_local2 = getGeneralUpgradeByName(_arg1);
if (null != _local2){
if ((_local2 is LevelUpgrade)){
if (StringConsts.american == GameStage.welcomeScreen.engineInstance.resto_type){
if ((((StringConsts.american_second_floor == _arg1)) && ((_local2.currentLevel >= 2)))){
return (true);
};
if ((((StringConsts.american_third_floor == _arg1)) && ((3 == _local2.currentLevel)))){
return (true);
};
return (false);
} else {
if ((((StringConsts.sushi_second_floor == _arg1)) && ((_local2.currentLevel >= 2)))){
return (true);
};
if ((((StringConsts.sushi_third_floor == _arg1)) && ((3 == _local2.currentLevel)))){
return (true);
};
return (false);
};
};
return (_local2.isAlreadyUpgraded);
};
_local2 = getSpecialUpgradeByName(_arg1);
if (null != _local2){
return (_local2.isAlreadyUpgraded);
};
_local2 = getAdvDecorUpgradeByName(_arg1);
if (null != _local2){
return (_local2.isAlreadyUpgraded);
};
return (false);
}
protected function createGeneralUpgrades():void{
}
public function showUpgrade(_arg1:String):void{
var _local2:MovieClip;
_local2 = this[_arg1];
_local2.visible = true;
_local2.play();
}
public function setLevel(_arg1:int):void{
currentLevel = _arg1;
gotoAndStop(("level" + _arg1.toString()));
}
public function getSpecialUpgradeByName(_arg1:String):BaseUpgradeCommand{
return (getUpgradeByName(_arg1, specialUpgrades));
}
protected function createAdvDecorUpgrades():void{
}
private function setShopParent(_arg1, _arg2:Array):void{
var _local3:BaseUpgradeCommand;
for each (_local3 in _arg2) {
_local3.parent_shop = _arg1;
};
}
public function getAdvDecorUpgradeByName(_arg1:String):BaseUpgradeCommand{
return (getUpgradeByName(_arg1, advdecorUpgrades));
}
public function upgradeHeader(_arg1:String):void{
}
public function getUpgrade(_arg1:String){
var _local2:*;
_local2 = getGeneralUpgradeByName(_arg1);
if (null != _local2){
return (_local2);
};
_local2 = getSpecialUpgradeByName(_arg1);
if (null != _local2){
return (_local2);
};
_local2 = getAdvDecorUpgradeByName(_arg1);
if (null != _local2){
return (_local2);
};
return (null);
}
}
}//package game.restaurant
Section 178
//SushiRestaurant (game.restaurant.SushiRestaurant)
package game.restaurant {
import flash.display.*;
import game.upgrades.*;
import fai.*;
public class SushiRestaurant extends BaseRestaurant {
public var decor7_sushi:MovieClip;
public var underground_bar_sushi:MovieClip;
public var security_system:MovieClip;
public var summer_seats_sushi:MovieClip;
public var sushi_discounts:MovieClip;
public var decor4_sushi:MovieClip;
public var platform:MovieClip;
public var decor1_sushi:MovieClip;
public var decor6_sushi:MovieClip;
public var hot_cheese_rolls:MovieClip;
public var decor3_sushi:MovieClip;
public var delivery_sushi:MovieClip;
public var receptionist_sushi:MovieClip;
public var ads3_sushi:MovieClip;
public var sale_campaigns:MovieClip;
public var ads1:MovieClip;
public var eastern_sweeties:MovieClip;
public var decor5_sushi:MovieClip;
public var ads4:MovieClip;
public var ads2:MovieClip;
public var decor2_sushi:MovieClip;
public var ads5_sushi:MovieClip;
public var cheap_sushi_menu:MovieClip;
public var karaoke:MovieClip;
public function SushiRestaurant():void{
buttonMode = true;
mouseChildren = false;
}
override protected function createGeneralUpgrades():void{
generalUpgrades = new Array(new LevelUpgrade(MoneyConsts.second_floor, MoneyConsts.third_floor, "sushi_second_floor", "sushi_third_floor"), new SimpleShowUpgrade(MoneyConsts.summer_seats, "summer_seats_sushi"), new SimpleShowUpgrade(MoneyConsts.security_system, "security_system"), new SimpleShowUpgrade(MoneyConsts.receptionist, "receptionist_sushi"), new SimpleShowUpgrade(MoneyConsts.underground_bar, "underground_bar_sushi"), new SimpleShowUpgrade(MoneyConsts.delivery, "delivery_sushi"));
}
override protected function createSpecialUpgrades():void{
specialUpgrades = new Array(new SimpleShowUpgrade(MoneyConsts.cheap_sushi_menu, "cheap_sushi_menu"), new SimpleShowUpgrade(MoneyConsts.karaoke, "karaoke"), new SimpleShowUpgrade(MoneyConsts.eastern_sweeties, "eastern_sweeties"), new SimpleShowUpgrade(MoneyConsts.hot_cheese_rolls, "hot_cheese_rolls"), new SimpleShowUpgrade(MoneyConsts.sushi_discounts, "sushi_discounts"), new SimpleShowUpgrade(MoneyConsts.sale_campaigns, "sale_campaigns"));
}
override protected function createAdvDecorUpgrades():void{
advdecorUpgrades = new Array(new SimpleShowUpgrade(MoneyConsts.ads1, "ads1"), new SimpleShowUpgrade(MoneyConsts.ads2, "ads2"), new SimpleShowUpgrade(MoneyConsts.ads3_sushi, "ads3_sushi"), new SimpleShowUpgrade(MoneyConsts.ads4, "ads4"), new SimpleShowUpgrade(MoneyConsts.ads5_sushi, "ads5_sushi"), new SimpleShowUpgrade(MoneyConsts.decor1_sushi, "decor1_sushi"), new SimpleShowUpgrade(MoneyConsts.decor2_sushi, "decor2_sushi"), new SimpleShowUpgrade(MoneyConsts.decor3_sushi, "decor3_sushi"), new SimpleShowUpgrade(MoneyConsts.decor4_sushi, "decor4_sushi"), new SimpleShowUpgrade(MoneyConsts.decor5_sushi, "decor5_sushi"), new SimpleShowUpgrade(MoneyConsts.decor6_sushi, "decor6_sushi"), new SimpleShowUpgrade(MoneyConsts.decor7_sushi, "decor7_sushi"));
}
override protected function setAllUpgradeToInvisible():void{
summer_seats_sushi.visible = false;
security_system.visible = false;
receptionist_sushi.visible = false;
underground_bar_sushi.visible = false;
delivery_sushi.visible = false;
cheap_sushi_menu.visible = false;
karaoke.visible = false;
eastern_sweeties.visible = false;
hot_cheese_rolls.visible = false;
sushi_discounts.visible = false;
sale_campaigns.visible = false;
ads1.visible = false;
ads2.visible = false;
ads3_sushi.visible = false;
ads4.visible = false;
ads5_sushi.visible = false;
decor1_sushi.visible = false;
decor2_sushi.visible = false;
decor3_sushi.visible = false;
decor4_sushi.visible = false;
decor5_sushi.visible = false;
decor6_sushi.visible = false;
decor7_sushi.visible = false;
}
}
}//package game.restaurant
Section 179
//Events (game.ui.Events)
package game.ui {
public class Events {
public static const onBuyRestaurant:Observer = new Observer("onBuyRestaurant");
public static const onLevelUpgrade:Observer = new Observer("onUpgradeRestaurantLevel");
public static const onSignboardUpgrade:Observer = new Observer("onHouseHeaderUpgrade");
public static const onSimpleShowUpgrade:Observer = new Observer("onSimpleShowUpgrade");
public static const onBeforeUpgrade:Observer = new Observer("onTryToUpgrade");
}
}//package game.ui
Section 180
//MenuButton (game.ui.MenuButton)
package game.ui {
import fai.logic.*;
import flash.events.*;
import flash.display.*;
import flash.text.*;
import game.upgrades.*;
import fai.*;
public class MenuButton extends MovieClip {
public var cost_txt:TextField;
private var _command;
public var completed_tick:MovieClip;
public var not_enough_money:MovieClip;
public var ui_menu;// = null
public var locked:MovieClip;
private var engine:Engine;// = null
public var button_back:MovieClip;
public function MenuButton(){
ui_menu = null;
engine = null;
super();
addFrameScript(0, frame1);
buttonMode = true;
mouseChildren = false;
addEventListener(MouseEvent.MOUSE_DOWN, onClick);
addEventListener(MouseEvent.MOUSE_OVER, onMouseOverHandler);
addEventListener(MouseEvent.MOUSE_OUT, onMouseOutHandler);
button_back.gotoAndStop("normal_state");
engine = GameStage.welcomeScreen.engineInstance;
cacheAsBitmap = true;
}
public function destroy():void{
removeEventListener(MouseEvent.MOUSE_DOWN, onClick);
removeEventListener(MouseEvent.MOUSE_OVER, onMouseOverHandler);
removeEventListener(MouseEvent.MOUSE_OUT, onMouseOutHandler);
}
public function lockButton():void{
not_enough_money.visible = false;
completed_tick.visible = false;
locked.visible = true;
setGreyState();
}
public function updateStatus(_arg1:int):void{
var _local2:*;
not_enough_money.visible = false;
completed_tick.visible = false;
_local2 = GameStage.welcomeScreen.engineInstance.playWindow.current_resto;
switch (_command.initialMenuFrame){
case "luxury_pizza":
_command.upgrade_available = _local2.isUpgradeDone("pizza_production");
break;
case StringConsts.karaoke:
_command.upgrade_available = _local2.isUpgradeDone(StringConsts.sushi_second_floor);
break;
};
locked.visible = !(_command.upgrade_available);
if (locked.visible){
setGreyState();
} else {
button_back.gotoAndStop("normal_state");
};
if (_command.isAlreadyUpgraded){
completed_tick.visible = true;
} else {
if (_arg1 >= _command.cost){
not_enough_money.visible = false;
} else {
not_enough_money.visible = true;
setGreyState();
};
};
}
public function get command():BaseUpgradeCommand{
return (_command);
}
function frame1(){
stop();
}
private function showTooltip():void{
engine.playWindow.ui.shop_tooltip.title_txt.text = _command.getTitle();
engine.playWindow.ui.shop_tooltip.params_txt.text = ((_command.getDescription() + "\n\nBuild Cost: ") + _command.cost.toString());
}
public function setGreyState():void{
button_back.gotoAndStop("grey_state");
}
private function onMouseOutHandler(_arg1:MouseEvent):void{
if (((not_enough_money.visible) || (locked.visible))){
button_back.gotoAndStop("grey_state");
} else {
button_back.gotoAndStop("normal_state");
};
engine.playWindow.ui.shop_tooltip.visible = false;
}
public function set command(_arg1:BaseUpgradeCommand){
_command = _arg1;
gotoAndStop(_command.initialMenuFrame);
_command.onNeedUpdateButtonFrame = updateButtonFrame;
if ((_command is LevelUpgrade)){
_command.associated_button = this;
};
cost_txt.text = _command.cost.toString();
}
private function updateButtonFrame(_arg1:String):void{
gotoAndStop(_arg1);
}
private function onClick(_arg1:MouseEvent):void{
if (((!(ui_menu)) || (ui_menu.menu_locked))){
return;
};
engine.playSound(SoundConsts.on_upgrade_over);
if (((((!((_command == null))) && (!(_command.isAlreadyUpgraded)))) && (_command.upgrade_available))){
completed_tick.visible = _command.execute();
engine.playSound(SoundConsts.swish);
};
_arg1.stopPropagation();
}
private function onMouseOverHandler(_arg1:MouseEvent):void{
if (((not_enough_money.visible) || (locked.visible))){
button_back.gotoAndStop("grey_highlighted_state");
} else {
button_back.gotoAndStop("highlighted_state");
};
showTooltip();
engine.playWindow.ui.shop_tooltip.visible = true;
}
}
}//package game.ui
Section 181
//Observer (game.ui.Observer)
package game.ui {
public class Observer {
private var name:String;
private var listeners:Array;
public function Observer(_arg1:String){
listeners = [];
super();
this.name = _arg1;
}
public function remove(_arg1:Function):void{
var _local2:Array;
var _local3:Function;
_local2 = listeners;
listeners = new Array();
for each (_local3 in _local2) {
if (_arg1 != _local3){
listeners.push(_local2[_local2.indexOf(_arg1)]);
};
};
}
public function add(_arg1:Function):void{
listeners.push(_arg1);
}
public function fire(_arg1, _arg2:Object=null):void{
var _local3:Function;
for each (_local3 in listeners) {
_local3(_arg1, _arg2);
};
}
}
}//package game.ui
Section 182
//UIMenu (game.ui.UIMenu)
package game.ui {
import flash.display.*;
import flash.text.*;
import game.restaurant.*;
import fai.*;
public class UIMenu extends MovieClip {
public var all_buttons:MovieClip;
public var buy_button:SimpleButton;
private var source:Object;
public var exclamation:MovieClip;
public var money_txt:TextField;
public var generalButtons:Array;
public var specialButtons:Array;
public var advdecorButtons:Array;
public var menu_locked:Boolean;// = true
public function UIMenu(){
menu_locked = true;
super();
createGeneralButtons(6);
createSpecialButtons(6);
createAdvDecorButtons(12);
setAllMenuVisible(false);
}
public function destroy():void{
var _local1:MenuButton;
for each (_local1 in generalButtons) {
_local1.destroy();
};
for each (_local1 in specialButtons) {
_local1.destroy();
};
for each (_local1 in advdecorButtons) {
_local1.destroy();
};
}
private function createAdvDecorButtons(_arg1:int):void{
advdecorButtons = [all_buttons.ad_button1, all_buttons.ad_button2, all_buttons.ad_button3, all_buttons.ad_button4, all_buttons.ad_button5, all_buttons.ad_button6, all_buttons.ad_button7, all_buttons.ad_button8, all_buttons.ad_button9, all_buttons.ad_button10, all_buttons.ad_button11, all_buttons.ad_button12];
}
private function updateSpecialMenu(_arg1:BaseRestaurant):void{
var _local2:int;
_local2 = 0;
while (_local2 < specialButtons.length) {
if (_arg1){
(specialButtons[_local2] as MenuButton).command = _arg1.getSpecialUpgrade(_local2);
} else {
specialButtons[_local2].lockButton();
};
specialButtons[_local2].ui_menu = this;
_local2++;
};
}
private function updateAdvDecorMenu(_arg1:BaseRestaurant):void{
var _local2:int;
_local2 = 0;
while (_local2 < advdecorButtons.length) {
if (_arg1){
(advdecorButtons[_local2] as MenuButton).command = _arg1.getAdvDecorUpgrade(_local2);
} else {
advdecorButtons[_local2].lockButton();
};
advdecorButtons[_local2].ui_menu = this;
_local2++;
};
}
private function createGeneralButtons(_arg1:int):void{
generalButtons = [all_buttons.general_button1, all_buttons.general_button2, all_buttons.general_button3, all_buttons.general_button4, all_buttons.general_button5, all_buttons.general_button6];
}
public function updatePositions():void{
if (GameStage.welcomeScreen.engineInstance.resto_type == StringConsts.sushi){
all_buttons.general_button4.x = 341.1;
all_buttons.general_button4.y = 37.6;
all_buttons.ad_button9.x = 379;
all_buttons.ad_button9.y = 37.6;
all_buttons.special_button3.x = 416.4;
all_buttons.special_button3.y = 37.6;
all_buttons.ad_button10.x = 0;
all_buttons.ad_button10.y = 84.4;
all_buttons.special_button4.x = 37.3;
all_buttons.special_button4.y = 84.5;
all_buttons.special_button5.x = 75.7;
all_buttons.special_button5.y = 84.5;
all_buttons.general_button6.x = 151.1;
all_buttons.general_button6.y = 84.4;
all_buttons.ad_button12.x = 188.8;
all_buttons.ad_button12.y = 84.4;
all_buttons.special_button2.x = 226.9;
all_buttons.special_button2.y = 84.7;
all_buttons.special_button1.x = 302.1;
all_buttons.special_button1.y = 84.1;
};
}
private function createSpecialButtons(_arg1:int):void{
specialButtons = [all_buttons.special_button1, all_buttons.special_button2, all_buttons.special_button3, all_buttons.special_button4, all_buttons.special_button5, all_buttons.special_button6];
}
private function setAllMenuVisible(_arg1:Boolean):void{
if (_arg1){
all_buttons.gotoAndStop("unlocked_state");
menu_locked = false;
} else {
all_buttons.gotoAndStop("locked_state");
menu_locked = true;
};
}
public function update(_arg1, _arg2:int):void{
if (_arg1.currentLevel == 0){
GameStage.welcomeScreen.engineInstance.playWindow.ui.buy_button.visible = true;
setAllMenuVisible(false);
updateGeneralMenu(_arg1.resto);
updateSpecialMenu(_arg1.resto);
updateAdvDecorMenu(_arg1.resto);
} else {
GameStage.welcomeScreen.engineInstance.playWindow.ui.buy_button.visible = false;
updateGeneralMenu(_arg1.resto);
updateSpecialMenu(_arg1.resto);
updateAdvDecorMenu(_arg1.resto);
updateAllUpgradesStatus(_arg2);
setAllMenuVisible(true);
};
this.source = _arg1;
}
private function updateUpgradesStatus(_arg1:int, _arg2:Array):void{
var _local3:MenuButton;
for each (_local3 in _arg2) {
_local3.updateStatus(_arg1);
};
}
private function updateGeneralMenu(_arg1:BaseRestaurant):void{
var _local2:int;
_local2 = 0;
while (_local2 < generalButtons.length) {
if (_arg1){
(generalButtons[_local2] as MenuButton).command = _arg1.getGeneralUpgrade(_local2);
} else {
generalButtons[_local2].lockButton();
};
generalButtons[_local2].ui_menu = this;
_local2++;
};
}
public function updateAllUpgradesStatus(_arg1:int):void{
updateUpgradesStatus(_arg1, generalButtons);
updateUpgradesStatus(_arg1, specialButtons);
updateUpgradesStatus(_arg1, advdecorButtons);
}
}
}//package game.ui
Section 183
//BaseUpgradeCommand (game.upgrades.BaseUpgradeCommand)
package game.upgrades {
import fai.common.*;
import fai.*;
import game.ui.*;
import game.errors.*;
public class BaseUpgradeCommand {
public var onNeedUpdateButtonFrame:Function;
public var upgrade_available:Boolean;// = true
public var initialMenuFrame:String;
public var parent_shop;// = null
public var cost:int;// = 0
public var isAlreadyUpgraded:Boolean;// = false
public function BaseUpgradeCommand(_arg1:int, _arg2:String){
cost = 0;
isAlreadyUpgraded = false;
upgrade_available = true;
parent_shop = null;
onNeedUpdateButtonFrame = function (_arg1:String){
};
super();
this.cost = _arg1;
this.initialMenuFrame = _arg2;
}
public function getTitle():String{
var _local1:String;
_local1 = initialMenuFrame;
switch (initialMenuFrame){
case StringConsts.american_second_floor:
return ("Build Second Floor");
case StringConsts.american_third_floor:
return ("Build Third Floor");
case StringConsts.sushi_second_floor:
return ("Build Second Floor");
case StringConsts.sushi_third_floor:
return ("Build Third Floor");
case StringConsts.american_summer_seats:
return ("Summer Seats");
case StringConsts.sushi_summer_seats:
return ("Summer Seats");
case StringConsts.security_system:
return ("Security System");
case StringConsts.receptionist_sushi:
return ("Reception");
case StringConsts.receptionist_american:
return ("Reception");
case StringConsts.underground_bar_sushi:
return ("Underground Bar");
case StringConsts.underground_bar_american:
return ("Underground Bar");
case StringConsts.sushi_delivery:
return ("Food Delivery");
case StringConsts.american_delivery:
return ("Food Delivery");
case StringConsts.tv_hall:
return ("TV Hall");
case "pizza_production":
case StringConsts.pizza_production:
return ("Pizza Production");
case "luxury_pizza":
case StringConsts.luxury_pizza:
return ("Luxury Pizza");
case StringConsts.country_menu:
return ("Country Menu");
case "king_burgers":
case StringConsts.king_burgers:
return ("King Burgers");
case StringConsts.sale_campaigns:
return ("Sale Campaigns");
case StringConsts.ads3_american:
return ("Menu Signboard");
case StringConsts.ads5_american:
return ("Live Singer");
case StringConsts.decor1_american:
return ("Bushes");
case StringConsts.decor2_american:
return ("Entrance");
case StringConsts.decor3_american:
return ("The Carpet");
case StringConsts.decor4_american:
return ("Lanterns");
case StringConsts.decor5_american:
return ("Flowers");
case StringConsts.decor6_american:
return ("Umbrellas");
case StringConsts.decor7_american:
return ("Fountain");
case StringConsts.ads1:
return ("Balloons");
case StringConsts.ads2:
return ("Neon Lights");
case StringConsts.ads4:
return ("Music");
case StringConsts.cheap_sushi_menu:
return ("Cheap Sushi Menus");
case StringConsts.karaoke:
return ("Karaoke");
case StringConsts.eastern_sweeties:
return ("Eastern Sweeties");
case StringConsts.hot_cheese_rolls:
return ("Hot Cheese Rolls");
case StringConsts.sushi_discounts:
return ("Sushi Discounts");
case StringConsts.ads3_sushi:
return ("Menu Signboard");
case StringConsts.ads5_sushi:
return ("Live Singers");
case StringConsts.decor1_sushi:
return ("Entrance");
case StringConsts.decor2_sushi:
return ("The Road");
case StringConsts.decor3_sushi:
return ("Bonsai");
case StringConsts.decor4_sushi:
return ("Lanterns");
case StringConsts.decor5_sushi:
return ("Little Fountain");
case StringConsts.decor6_sushi:
return ("Fan");
case StringConsts.decor7_sushi:
return ("Flowerbeds");
};
return (_local1);
}
public function execute():Boolean{
if (parent_shop.resto.enemy_restaurant){
return (true);
};
if (!isAlreadyUpgraded){
try {
Events.onBeforeUpgrade.fire(parent_shop, cost);
} catch(e:NotEnoughMoneyError) {
return (false);
} catch(e:ShopIsFullError) {
GameStage.welcomeScreen.engineInstance.log(StringConsts.shop_isnt_empty);
return (false);
};
isAlreadyUpgraded = true;
};
return (true);
}
public function getDescription():String{
var _local1:String;
_local1 = initialMenuFrame;
switch (initialMenuFrame){
case StringConsts.sushi_second_floor:
case StringConsts.american_second_floor:
return ("Increases revenue by 6$\nAdds 10 more seats");
case StringConsts.sushi_third_floor:
case StringConsts.american_third_floor:
return ("Increases revenue by 12$\nAdds 10 more seats");
case StringConsts.american_summer_seats:
return ("Increases revenue by 8$\nAdds 5 more seats");
case StringConsts.sushi_summer_seats:
return ("Increases revenue by 8$\nAdds 5 more seats");
case StringConsts.security_system:
return ("Prevents your restaurant from being robbed");
case StringConsts.receptionist_american:
case StringConsts.receptionist_sushi:
return ("Increases revenue by 8.5$");
case StringConsts.underground_bar_american:
case StringConsts.underground_bar_sushi:
return ("Increases revenue by 9$\nAdds 6 more seats");
case StringConsts.american_delivery:
case StringConsts.sushi_delivery:
return ("Adds food delivery revenue to your business");
case StringConsts.tv_hall:
return ("Increases revenue by 9$\nAdds 2 more seats");
case "pizza_production":
case StringConsts.pizza_production:
return ("Increases revenue by 7$\nAdds 2 more seats");
case "luxury_pizza":
case StringConsts.luxury_pizza:
return ("Increases revenue by 9$ per customer");
case StringConsts.country_menu:
return ("Increases revenue by 8.5$\nAdds 3 more seats");
case "king_burgers":
case StringConsts.king_burgers:
return ("Increases revenue by 9.5$\nAdds 2 more seats");
case StringConsts.sale_campaigns:
return ("Increases revenue by 7.5$\nAdds 1 more seat");
case StringConsts.cheap_sushi_menu:
return ("Increases revenue by 7$\nAdds 3 more seats");
case StringConsts.karaoke:
return ("Increases revenue by 9$\nAdds 3 more seats");
case StringConsts.eastern_sweeties:
return ("Increases revenue by 10$");
case StringConsts.hot_cheese_rolls:
return ("Increases revenue by 9$\nAdds 2 more seats");
case StringConsts.sushi_discounts:
return ("Increases revenue by 8$\nAdds 1 more seats");
case StringConsts.ads1:
return ("Increases revenue by 1.5$");
case StringConsts.ads2:
return ("Increases revenue by 2$");
case StringConsts.ads3_sushi:
case StringConsts.ads3_american:
return ("Increases revenue by 2.5$\nAdds 1 more seat");
case StringConsts.ads4:
return ("Increases revenue by 3.5$");
case StringConsts.ads5_sushi:
case StringConsts.ads5_american:
return ("Increases revenue by 4$\nAdds 1 more seat");
case StringConsts.decor1_american:
case StringConsts.decor1_sushi:
return ("Increases revenue by 5$");
case StringConsts.decor2_american:
case StringConsts.decor2_sushi:
return ("Increases revenue by 7$");
case StringConsts.decor3_american:
case StringConsts.decor3_sushi:
return ("Increases revenue by 7$\nAdds 2 more seats");
case StringConsts.decor4_american:
case StringConsts.decor4_sushi:
return ("Increases revenue by 8$");
case StringConsts.decor5_american:
case StringConsts.decor5_sushi:
return ("Increases revenue by 9$\nAdds 3 more seats");
case StringConsts.decor6_american:
case StringConsts.decor6_sushi:
return ("Increases revenue by 10$");
case StringConsts.decor7_american:
case StringConsts.decor7_sushi:
return ("Increases revenue by 11$\nAdds 3 more seats");
};
return (_local1);
}
}
}//package game.upgrades
Section 184
//LevelUpgrade (game.upgrades.LevelUpgrade)
package game.upgrades {
import fai.*;
import game.ui.*;
public class LevelUpgrade extends BaseUpgradeCommand {
public var currentLevel;// = 1
public var associated_button;// = null
private var nextLevelFrame;
public var third_cost:int;// = 0
public var second_cost:int;// = 0
public function LevelUpgrade(_arg1:int, _arg2:int, _arg3:String, _arg4:String):void{
currentLevel = 1;
second_cost = 0;
third_cost = 0;
associated_button = null;
super(_arg1, _arg3);
second_cost = _arg1;
third_cost = _arg2;
this.nextLevelFrame = _arg4;
}
private function upgradeToLevel2():void{
initialMenuFrame = nextLevelFrame;
onNeedUpdateButtonFrame(nextLevelFrame);
currentLevel = 2;
isAlreadyUpgraded = false;
Events.onLevelUpgrade.fire(parent_shop, 2);
}
private function upgradeToLevel3():void{
currentLevel = 3;
isAlreadyUpgraded = true;
Events.onLevelUpgrade.fire(parent_shop, 3);
}
override public function execute():Boolean{
if (super.execute()){
if (1 == currentLevel){
GameStage.welcomeScreen.engineInstance.playSound(SoundConsts.swish);
upgradeToLevel2();
if (associated_button){
associated_button.cost_txt.text = third_cost.toString();
cost = third_cost;
};
return (false);
} else {
if (2 == currentLevel){
GameStage.welcomeScreen.engineInstance.playSound(SoundConsts.swish);
upgradeToLevel3();
if (associated_button){
associated_button.cost_txt.text = third_cost.toString();
};
return (true);
};
};
};
return (false);
}
}
}//package game.upgrades
Section 185
//SignboardUpgrade (game.upgrades.SignboardUpgrade)
package game.upgrades {
import game.ui.*;
public class SignboardUpgrade extends BaseUpgradeCommand {
private var targetFrame:String;
public function SignboardUpgrade(_arg1:int, _arg2:String, _arg3:String):void{
super(_arg1, _arg3);
this.targetFrame = _arg2;
}
override public function execute():Boolean{
if (!upgrade_available){
return (false);
};
if (super.execute()){
Events.onSignboardUpgrade.fire(parent_shop, targetFrame);
return (true);
};
return (false);
}
}
}//package game.upgrades
Section 186
//SimpleShowUpgrade (game.upgrades.SimpleShowUpgrade)
package game.upgrades {
import game.ui.*;
public class SimpleShowUpgrade extends BaseUpgradeCommand {
private var target:String;
public function SimpleShowUpgrade(_arg1:int, _arg2:String):void{
super(_arg1, _arg2);
this.target = _arg2;
}
override public function execute():Boolean{
if (super.execute()){
Events.onSimpleShowUpgrade.fire(parent_shop, target);
return (true);
};
return (false);
}
}
}//package game.upgrades
Section 187
//BlueStar (BlueStar)
package {
import flash.display.*;
public dynamic class BlueStar extends Sprite {
}
}//package
Section 188
//BuildingProgressBar (BuildingProgressBar)
package {
import flash.display.*;
import flash.text.*;
public dynamic class BuildingProgressBar extends MovieClip {
public var bar:MovieClip;
public var percents:TextField;
}
}//package
Section 189
//Customer1 (Customer1)
package {
import flash.display.*;
public dynamic class Customer1 extends MovieClip {
public function Customer1(){
addFrameScript(0, frame1, 10, frame11, 12, frame13, 14, frame15, 16, frame17);
}
function frame15(){
stop();
}
function frame1(){
stop();
}
function frame13(){
stop();
}
function frame17(){
stop();
}
function frame11(){
stop();
}
}
}//package
Section 190
//Customer10 (Customer10)
package {
import flash.display.*;
public dynamic class Customer10 extends MovieClip {
public function Customer10(){
addFrameScript(0, frame1, 9, frame10, 11, frame12, 13, frame14, 15, frame16);
}
function frame10(){
stop();
}
function frame14(){
stop();
}
function frame12(){
stop();
}
function frame16(){
stop();
}
function frame1(){
stop();
}
}
}//package
Section 191
//Customer2 (Customer2)
package {
import flash.display.*;
public dynamic class Customer2 extends MovieClip {
public function Customer2(){
addFrameScript(0, frame1, 10, frame11, 12, frame13, 14, frame15, 16, frame17);
}
function frame15(){
stop();
}
function frame1(){
stop();
}
function frame13(){
stop();
}
function frame17(){
stop();
}
function frame11(){
stop();
}
}
}//package
Section 192
//Customer3 (Customer3)
package {
import flash.display.*;
public dynamic class Customer3 extends MovieClip {
public function Customer3(){
addFrameScript(0, frame1, 10, frame11, 12, frame13, 14, frame15, 16, frame17);
}
function frame15(){
stop();
}
function frame1(){
stop();
}
function frame13(){
stop();
}
function frame17(){
stop();
}
function frame11(){
stop();
}
}
}//package
Section 193
//Customer4 (Customer4)
package {
import flash.display.*;
public dynamic class Customer4 extends MovieClip {
public function Customer4(){
addFrameScript(0, frame1, 10, frame11, 12, frame13, 14, frame15, 16, frame17);
}
function frame15(){
stop();
}
function frame1(){
stop();
}
function frame13(){
stop();
}
function frame17(){
stop();
}
function frame11(){
stop();
}
}
}//package
Section 194
//Customer5 (Customer5)
package {
import flash.display.*;
public dynamic class Customer5 extends MovieClip {
public function Customer5(){
addFrameScript(0, frame1, 10, frame11, 12, frame13, 14, frame15, 16, frame17);
}
function frame15(){
stop();
}
function frame1(){
stop();
}
function frame13(){
stop();
}
function frame17(){
stop();
}
function frame11(){
stop();
}
}
}//package
Section 195
//Customer6 (Customer6)
package {
import flash.display.*;
public dynamic class Customer6 extends MovieClip {
public function Customer6(){
addFrameScript(0, frame1, 10, frame11, 12, frame13, 14, frame15, 16, frame17);
}
function frame15(){
stop();
}
function frame1(){
stop();
}
function frame13(){
stop();
}
function frame17(){
stop();
}
function frame11(){
stop();
}
}
}//package
Section 196
//Customer7 (Customer7)
package {
import flash.display.*;
public dynamic class Customer7 extends MovieClip {
public function Customer7(){
addFrameScript(0, frame1, 9, frame10, 11, frame12, 13, frame14, 15, frame16);
}
function frame10(){
stop();
}
function frame14(){
stop();
}
function frame12(){
stop();
}
function frame16(){
stop();
}
function frame1(){
stop();
}
}
}//package
Section 197
//Customer8 (Customer8)
package {
import flash.display.*;
public dynamic class Customer8 extends MovieClip {
public function Customer8(){
addFrameScript(0, frame1, 9, frame10, 11, frame12, 13, frame14, 15, frame16);
}
function frame10(){
stop();
}
function frame14(){
stop();
}
function frame12(){
stop();
}
function frame16(){
stop();
}
function frame1(){
stop();
}
}
}//package
Section 198
//Customer9 (Customer9)
package {
import flash.display.*;
public dynamic class Customer9 extends MovieClip {
public function Customer9(){
addFrameScript(0, frame1, 9, frame10, 11, frame12, 13, frame14, 15, frame16);
}
function frame10(){
stop();
}
function frame14(){
stop();
}
function frame12(){
stop();
}
function frame16(){
stop();
}
function frame1(){
stop();
}
}
}//package
Section 199
//CustomerMoney (CustomerMoney)
package {
import fai.ui.*;
import flash.display.*;
public dynamic class CustomerMoney extends MovieClip {
public var bar:CustomersBar;
public function CustomerMoney(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 200
//CustomerStar (CustomerStar)
package {
import flash.display.*;
public dynamic class CustomerStar extends MovieClip {
}
}//package
Section 201
//DeliveryAmerican (DeliveryAmerican)
package {
import flash.display.*;
public dynamic class DeliveryAmerican extends MovieClip {
public function DeliveryAmerican(){
addFrameScript(0, frame1, 9, frame10, 11, frame12, 13, frame14, 15, frame16);
}
function frame10(){
stop();
}
function frame14(){
stop();
}
function frame12(){
stop();
}
function frame16(){
stop();
}
function frame1(){
stop();
}
}
}//package
Section 202
//DeliveryRoadPath0 (DeliveryRoadPath0)
package {
import fai.ui.*;
public dynamic class DeliveryRoadPath0 extends RoadPath {
}
}//package
Section 203
//DeliveryRoadPath1 (DeliveryRoadPath1)
package {
import fai.ui.*;
public dynamic class DeliveryRoadPath1 extends RoadPath {
}
}//package
Section 204
//DeliveryRoadPath2 (DeliveryRoadPath2)
package {
import fai.ui.*;
public dynamic class DeliveryRoadPath2 extends RoadPath {
}
}//package
Section 205
//DeliveryRoadPath30 (DeliveryRoadPath30)
package {
import fai.ui.*;
public dynamic class DeliveryRoadPath30 extends RoadPath {
}
}//package
Section 206
//DeliveryRoadPath31 (DeliveryRoadPath31)
package {
import fai.ui.*;
public dynamic class DeliveryRoadPath31 extends RoadPath {
}
}//package
Section 207
//DeliveryRoadPath32 (DeliveryRoadPath32)
package {
import fai.ui.*;
public dynamic class DeliveryRoadPath32 extends RoadPath {
}
}//package
Section 208
//DeliveryRoadPath40 (DeliveryRoadPath40)
package {
import fai.ui.*;
public dynamic class DeliveryRoadPath40 extends RoadPath {
}
}//package
Section 209
//DeliveryRoadPath41 (DeliveryRoadPath41)
package {
import fai.ui.*;
public dynamic class DeliveryRoadPath41 extends RoadPath {
}
}//package
Section 210
//DeliveryRoadPath42 (DeliveryRoadPath42)
package {
import fai.ui.*;
public dynamic class DeliveryRoadPath42 extends RoadPath {
}
}//package
Section 211
//DeliveryRoadPath50 (DeliveryRoadPath50)
package {
import fai.ui.*;
public dynamic class DeliveryRoadPath50 extends RoadPath {
}
}//package
Section 212
//DeliveryRoadPath50copy (DeliveryRoadPath50copy)
package {
import fai.ui.*;
public dynamic class DeliveryRoadPath50copy extends RoadPath {
}
}//package
Section 213
//DeliveryRoadPath51 (DeliveryRoadPath51)
package {
import fai.ui.*;
public dynamic class DeliveryRoadPath51 extends RoadPath {
}
}//package
Section 214
//DeliveryRoadPath52 (DeliveryRoadPath52)
package {
import fai.ui.*;
public dynamic class DeliveryRoadPath52 extends RoadPath {
}
}//package
Section 215
//DeliveryRoadPath53 (DeliveryRoadPath53)
package {
import fai.ui.*;
public dynamic class DeliveryRoadPath53 extends RoadPath {
}
}//package
Section 216
//DeliveryRoadPath61 (DeliveryRoadPath61)
package {
import fai.ui.*;
public dynamic class DeliveryRoadPath61 extends RoadPath {
}
}//package
Section 217
//DeliveryRoadPath62 (DeliveryRoadPath62)
package {
import fai.ui.*;
public dynamic class DeliveryRoadPath62 extends RoadPath {
}
}//package
Section 218
//DeliveryRoadPath63 (DeliveryRoadPath63)
package {
import fai.ui.*;
public dynamic class DeliveryRoadPath63 extends RoadPath {
}
}//package
Section 219
//DeliverySushi (DeliverySushi)
package {
import flash.display.*;
public dynamic class DeliverySushi extends MovieClip {
public function DeliverySushi(){
addFrameScript(0, frame1, 9, frame10, 11, frame12, 13, frame14, 15, frame16);
}
function frame10(){
stop();
}
function frame14(){
stop();
}
function frame12(){
stop();
}
function frame16(){
stop();
}
function frame1(){
stop();
}
}
}//package
Section 220
//empty (empty)
package {
import flash.display.*;
public dynamic class empty extends MovieClip {
}
}//package
Section 221
//EnemyRestaurant (EnemyRestaurant)
package {
import fai.logic.*;
public dynamic class EnemyRestaurant extends EnemyRestaurant {
public function EnemyRestaurant(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 222
//focusRectSkin (focusRectSkin)
package {
import flash.display.*;
public dynamic class focusRectSkin extends MovieClip {
}
}//package
Section 223
//ForSale (ForSale)
package {
import fai.logic.*;
public dynamic class ForSale extends ShopItem {
public function ForSale(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
function frame3(){
stop();
}
function frame2(){
stop();
}
function frame1(){
stop();
}
}
}//package
Section 224
//GameStage (GameStage)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
import flash.ui.*;
public class GameStage extends MovieClip {
public var sponsor_games:SimpleButton;
private var atimer:Timer;// = null
public var wscreen:MovieClip;
public var loadingMC:MovieClip;
private var initialized:Boolean;// = false
public var flonga_clip:MovieClip;
private static var linkTimer:Timer = null;
private static var goto_window:String;
private static var goto_url:String;
private static var link1Timer:Timer = null;
public static var play_holder = null;
public static var main_stage = null;
public static var welcomeScreen;
public static var itself = null;
public function GameStage():void{
initialized = false;
atimer = null;
super();
addFrameScript(0, frame1, 4, frame5);
Security.allowDomain("*");
itself = this;
}
public function progressUpdate(_arg1:Event):void{
var _local2:Number;
_local2 = Math.round(((this.loaderInfo.bytesLoaded / this.loaderInfo.bytesTotal) * 100));
if ((loadingMC is MovieClip)){
loadingMC.progress_mc.gotoAndStop(_local2);
loadingMC.loaded_txt.text = (("Loading: " + _local2.toString()) + "%");
};
if (!!((this.loaderInfo.bytesLoaded == this.loaderInfo.bytesTotal))){
loadingMC.removeEventListener(Event.ENTER_FRAME, progressUpdate);
loadingMC.progress_mc.stop();
loadingMC.progress_mc.visible = false;
removeChild(loadingMC);
loadingMC = null;
gotoAndStop(5);
};
}
private function handleUnload(_arg1:Event):void{
welcomeScreen.clear();
}
public function flongaFinished():void{
flonga_clip.visible = false;
this.removeChild(flonga_clip);
}
function frame1(){
loadingMC.addEventListener(Event.ENTER_FRAME, progressUpdate);
sponsor_games.addEventListener(MouseEvent.MOUSE_DOWN, sponsorClick);
stop();
if (initialized){
loadingMC.removeEventListener(Event.ENTER_FRAME, progressUpdate);
sponsor_games.removeEventListener(MouseEvent.MOUSE_DOWN, sponsorClick);
gotoAndStop(5);
};
}
function frame5(){
flonga_clip.addEventListener(MouseEvent.MOUSE_DOWN, sponsorClick);
flonga_clip.visible = false;
this.initTheGame();
stop();
}
public function loadEnded():void{
wscreen.loadEnded();
}
public function initTheGame():void{
var _local1:ContextMenu;
if (initialized){
return;
};
main_stage = this.stage;
welcomeScreen = wscreen;
_local1 = new ContextMenu();
_local1.hideBuiltInItems();
contextMenu = _local1;
initialized = true;
wscreen.initialize();
root.loaderInfo.addEventListener(Event.UNLOAD, handleUnload);
}
public static function sponsorClick(_arg1:MouseEvent):void{
var urlRequest:URLRequest;
var evt = _arg1;
try {
urlRequest = new URLRequest("http://www.flonga.com/");
navigateToURL(urlRequest, "_blank");
} catch(e:Error) {
};
}
}
}//package
Section 225
//IsoBeacon (IsoBeacon)
package {
import flash.display.*;
public dynamic class IsoBeacon extends MovieClip {
public var inner:MovieClip;
}
}//package
Section 226
//LevelBack1 (LevelBack1)
package {
import flash.display.*;
public dynamic class LevelBack1 extends MovieClip {
public var delivery_road1:DeliveryRoadPath0;
public var shop2:ForSale;
public var road2:RoadPath1_2;
public var road1:RoadPath1;
public var shop1:MyRestaurant;
}
}//package
Section 227
//LevelBack2 (LevelBack2)
package {
import flash.display.*;
public dynamic class LevelBack2 extends MovieClip {
public var shop3:ForSale;
public var delivery_road3:DeliveryRoadPath2;
public var shop2:MyRestaurant;
public var delivery_road2:DeliveryRoadPath1;
public var road2:RoadPath21;
public var road3:RoadPath22;
public var road1:RoadPath2;
public var shop1:EnemyRestaurant;
}
}//package
Section 228
//LevelBack3 (LevelBack3)
package {
import flash.display.*;
public dynamic class LevelBack3 extends MovieClip {
public var shop3:ForSale;
public var shop4:MyRestaurant;
public var delivery_road1:DeliveryRoadPath31;
public var delivery_road3:DeliveryRoadPath32;
public var delivery_road4:DeliveryRoadPath30;
public var shop2:EnemyRestaurant;
public var road2:RoadPath33;
public var road3:RoadPath31;
public var road4:RoadPath23;
public var road1:RoadPath32;
public var shop1:ForSale;
}
}//package
Section 229
//LevelBack4 (LevelBack4)
package {
import flash.display.*;
public dynamic class LevelBack4 extends MovieClip {
public var shop3:EnemyRestaurant;
public var shop4:MyRestaurant;
public var delivery_road1:DeliveryRoadPath42;
public var delivery_road4:DeliveryRoadPath40;
public var shop2:ForSale;
public var delivery_road2:DeliveryRoadPath41;
public var road2:RoadPath4;
public var road3:RoadPath43;
public var road4:RoadPath44;
public var road1:RoadPath41;
public var shop1:ForSale;
}
}//package
Section 230
//LevelBack5 (LevelBack5)
package {
import flash.display.*;
public dynamic class LevelBack5 extends MovieClip {
public var shop4:ForSale;
public var delivery_road1:DeliveryRoadPath53;
public var delivery_road4:DeliveryRoadPath51;
public var shop2:MyRestaurant;
public var delivery_road2:DeliveryRoadPath52;
public var road2:RoadPath51;
public var shop5:ForSale;
public var road4:RoadPath53;
public var road5:RoadPath54;
public var road1:RoadPath5;
public var delivery_road5:DeliveryRoadPath50;
public var shop1:EnemyRestaurant;
}
}//package
Section 231
//LevelBack6 (LevelBack6)
package {
import flash.display.*;
public dynamic class LevelBack6 extends MovieClip {
public var shop4:ForSale;
public var delivery_road1:DeliveryRoadPath50copy;
public var delivery_road4:DeliveryRoadPath63;
public var shop2:EnemyRestaurant;
public var delivery_road2:DeliveryRoadPath61;
public var road2:RoadPath62;
public var shop5:ForSale;
public var road3:RoadPath61;
public var road4:RoadPath63;
public var road5:RoadPath64;
public var road1:RoadPath6;
public var delivery_road5:DeliveryRoadPath62;
public var shop1:MyRestaurant;
}
}//package
Section 232
//LoadingMC (LoadingMC)
package {
import flash.display.*;
import flash.text.*;
public dynamic class LoadingMC extends MovieClip {
public var loaded_txt:TextField;
public var error_txt:TextField;
public var progress_mc:MovieClip;
}
}//package
Section 233
//MyRestaurant (MyRestaurant)
package {
import fai.logic.*;
public dynamic class MyRestaurant extends MyRestaurant {
public function MyRestaurant(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 234
//PlayWindowUI (PlayWindowUI)
package {
import fai.ui.*;
import flash.display.*;
import game.ui.*;
public dynamic class PlayWindowUI extends MovieClip {
public var next_day_button:SimpleButton;
public var back_holder:MovieClip;
public var buy_button:SimpleButton;
public var fast_mode_button:SimpleButton;
public var slow_mode_button:SimpleButton;
public var menu_button:SimpleButton;
public var tutorial_mc:TutorialMC;
public var resources:MovieClip;
public var mute_button:SimpleButton;
public var ui_menu:UIMenu;
public var clean_dialog:MovieClip;
public var sound_button:SimpleButton;
public var extra_buttons:MovieClip;
public var bonus_animation:MovieClip;
public var customers:MovieClip;
public var pause_mc:MovieClip;
public var click_next_day_button:SimpleButton;
public var shop_tooltip:MovieClip;
public var extra_holder:MovieClip;
public var pause_button:SimpleButton;
public var output_message:MovieClip;
public var sell_dialog:MovieClip;
public var background_holder:MovieClip;
}
}//package
Section 235
//RoadPath1 (RoadPath1)
package {
import fai.ui.*;
public dynamic class RoadPath1 extends RoadPath {
}
}//package
Section 236
//RoadPath1_2 (RoadPath1_2)
package {
import fai.ui.*;
public dynamic class RoadPath1_2 extends RoadPath {
}
}//package
Section 237
//RoadPath2 (RoadPath2)
package {
import fai.ui.*;
public dynamic class RoadPath2 extends RoadPath {
}
}//package
Section 238
//RoadPath21 (RoadPath21)
package {
import fai.ui.*;
public dynamic class RoadPath21 extends RoadPath {
}
}//package
Section 239
//RoadPath22 (RoadPath22)
package {
import fai.ui.*;
public dynamic class RoadPath22 extends RoadPath {
}
}//package
Section 240
//RoadPath23 (RoadPath23)
package {
import fai.ui.*;
public dynamic class RoadPath23 extends RoadPath {
}
}//package
Section 241
//RoadPath31 (RoadPath31)
package {
import fai.ui.*;
public dynamic class RoadPath31 extends RoadPath {
}
}//package
Section 242
//RoadPath32 (RoadPath32)
package {
import fai.ui.*;
public dynamic class RoadPath32 extends RoadPath {
}
}//package
Section 243
//RoadPath33 (RoadPath33)
package {
import fai.ui.*;
public dynamic class RoadPath33 extends RoadPath {
}
}//package
Section 244
//RoadPath4 (RoadPath4)
package {
import fai.ui.*;
public dynamic class RoadPath4 extends RoadPath {
}
}//package
Section 245
//RoadPath41 (RoadPath41)
package {
import fai.ui.*;
public dynamic class RoadPath41 extends RoadPath {
}
}//package
Section 246
//RoadPath43 (RoadPath43)
package {
import fai.ui.*;
public dynamic class RoadPath43 extends RoadPath {
}
}//package
Section 247
//RoadPath44 (RoadPath44)
package {
import fai.ui.*;
public dynamic class RoadPath44 extends RoadPath {
}
}//package
Section 248
//RoadPath5 (RoadPath5)
package {
import fai.ui.*;
public dynamic class RoadPath5 extends RoadPath {
}
}//package
Section 249
//RoadPath51 (RoadPath51)
package {
import fai.ui.*;
public dynamic class RoadPath51 extends RoadPath {
}
}//package
Section 250
//RoadPath52 (RoadPath52)
package {
import fai.ui.*;
public dynamic class RoadPath52 extends RoadPath {
}
}//package
Section 251
//RoadPath53 (RoadPath53)
package {
import fai.ui.*;
public dynamic class RoadPath53 extends RoadPath {
}
}//package
Section 252
//RoadPath54 (RoadPath54)
package {
import fai.ui.*;
public dynamic class RoadPath54 extends RoadPath {
}
}//package
Section 253
//RoadPath6 (RoadPath6)
package {
import fai.ui.*;
public dynamic class RoadPath6 extends RoadPath {
}
}//package
Section 254
//RoadPath61 (RoadPath61)
package {
import fai.ui.*;
public dynamic class RoadPath61 extends RoadPath {
}
}//package
Section 255
//RoadPath62 (RoadPath62)
package {
import fai.ui.*;
public dynamic class RoadPath62 extends RoadPath {
}
}//package
Section 256
//RoadPath63 (RoadPath63)
package {
import fai.ui.*;
public dynamic class RoadPath63 extends RoadPath {
}
}//package
Section 257
//RoadPath64 (RoadPath64)
package {
import fai.ui.*;
public dynamic class RoadPath64 extends RoadPath {
}
}//package
Section 258
//RoadPoint (RoadPoint)
package {
import flash.display.*;
public dynamic class RoadPoint extends Sprite {
}
}//package
Section 259
//SliderThumb_disabledSkin (SliderThumb_disabledSkin)
package {
import flash.display.*;
public dynamic class SliderThumb_disabledSkin extends MovieClip {
}
}//package
Section 260
//SliderThumb_downSkin (SliderThumb_downSkin)
package {
import flash.display.*;
public dynamic class SliderThumb_downSkin extends MovieClip {
}
}//package
Section 261
//SliderThumb_overSkin (SliderThumb_overSkin)
package {
import flash.display.*;
public dynamic class SliderThumb_overSkin extends MovieClip {
}
}//package
Section 262
//SliderThumb_upSkin (SliderThumb_upSkin)
package {
import flash.display.*;
public dynamic class SliderThumb_upSkin extends MovieClip {
}
}//package
Section 263
//SliderTick_skin (SliderTick_skin)
package {
import flash.display.*;
public dynamic class SliderTick_skin extends MovieClip {
}
}//package
Section 264
//SliderTrack_disabledSkin (SliderTrack_disabledSkin)
package {
import flash.display.*;
public dynamic class SliderTrack_disabledSkin extends MovieClip {
}
}//package
Section 265
//SliderTrack_skin (SliderTrack_skin)
package {
import flash.display.*;
public dynamic class SliderTrack_skin extends MovieClip {
}
}//package
Section 266
//smoke1 (smoke1)
package {
import flash.display.*;
public dynamic class smoke1 extends MovieClip {
public var obj:MovieClip;
}
}//package
Section 267
//smoke2 (smoke2)
package {
import flash.display.*;
public dynamic class smoke2 extends MovieClip {
public var obj:MovieClip;
}
}//package
Section 268
//smoke3 (smoke3)
package {
import flash.display.*;
public dynamic class smoke3 extends MovieClip {
public var obj:MovieClip;
}
}//package
Section 269
//smoke4 (smoke4)
package {
import flash.display.*;
public dynamic class smoke4 extends MovieClip {
public var obj:MovieClip;
}
}//package
Section 270
//Sound_build (Sound_build)
package {
import flash.media.*;
public dynamic class Sound_build extends Sound {
}
}//package
Section 271
//Sound_clean_sound (Sound_clean_sound)
package {
import flash.media.*;
public dynamic class Sound_clean_sound extends Sound {
}
}//package
Section 272
//Sound_click (Sound_click)
package {
import flash.media.*;
public dynamic class Sound_click extends Sound {
}
}//package
Section 273
//Sound_coins (Sound_coins)
package {
import flash.media.*;
public dynamic class Sound_coins extends Sound {
}
}//package
Section 274
//Sound_game_over (Sound_game_over)
package {
import flash.media.*;
public dynamic class Sound_game_over extends Sound {
}
}//package
Section 275
//Sound_level_music (Sound_level_music)
package {
import flash.media.*;
public dynamic class Sound_level_music extends Sound {
}
}//package
Section 276
//Sound_music (Sound_music)
package {
import flash.media.*;
public dynamic class Sound_music extends Sound {
}
}//package
Section 277
//Sound_newday (Sound_newday)
package {
import flash.media.*;
public dynamic class Sound_newday extends Sound {
}
}//package
Section 278
//Sound_on_upgrade_over (Sound_on_upgrade_over)
package {
import flash.media.*;
public dynamic class Sound_on_upgrade_over extends Sound {
}
}//package
Section 279
//Sound_robbery (Sound_robbery)
package {
import flash.media.*;
public dynamic class Sound_robbery extends Sound {
}
}//package
Section 280
//Sound_sell (Sound_sell)
package {
import flash.media.*;
public dynamic class Sound_sell extends Sound {
}
}//package
Section 281
//Sound_swish (Sound_swish)
package {
import flash.media.*;
public dynamic class Sound_swish extends Sound {
}
}//package
Section 282
//Sound_victory (Sound_victory)
package {
import flash.media.*;
public dynamic class Sound_victory extends Sound {
}
}//package
Section 283
//Star (Star)
package {
import flash.display.*;
public dynamic class Star extends MovieClip {
}
}//package
Section 284
//WhiteStar (WhiteStar)
package {
import flash.display.*;
public dynamic class WhiteStar extends MovieClip {
}
}//package