home *** CD-ROM | disk | FTP | other *** search
- package RES.OBJECTS
- {
- import ENGINE.CORE.OGlobal;
- import ENGINE.DISPLAY.OBitmap;
- import ENGINE.DISPLAY.ODisplay;
- import ENGINE.DISPLAY.OSprite;
- import flash.display.*;
- import flash.events.*;
- import flash.geom.*;
-
- public class OBubble extends OSprite
- {
-
- public static const stHide:int = 5;
-
- public static const stMove:int = 10;
-
- public static const stInvisible:int = 0;
-
- public static var iColorsCount:int = 7;
-
- public static const stFlyOut:int = 11;
-
- public static const stBeforeShow:int = 1;
-
- public static const stBeforeBang:int = 7;
-
- public static var iCIndexes:Array = [0,60,120,180,240,300,-1];
-
- public static const stBeforeFirework:int = 6;
-
- public static const stNormal:int = 3;
-
- public static const stBeforeHide:int = 4;
-
- public static const stBeforeMove:int = 9;
-
- public static const stBang:int = 8;
-
- public static const stShow:int = 2;
-
-
- private var iDAlpha:Number;
-
- private var iSRadius:Number;
-
- private var iType:int;
-
- private var iRadius:Number;
-
- private var iBMS:OBitmap;
-
- private var iBM:OBitmap;
-
- private var iDRadius:Number;
-
- private var iVel:Point;
-
- private var iBMA:Array;
-
- private var iState:int = 0;
-
- private var iERadius:Number;
-
- private var iBMSA:Array;
-
- private var iBaseP:Point;
-
- private var iDelta:Number;
-
- private var iCInd:int;
-
- public function OBubble(param1:Number = 15, param2:int = 0, param3:Number = 0, param4:Number = 0)
- {
- iState = 0;
- super();
- this.iBMA = ClusterzL.iCache.GetItem("Bubble");
- this.iBMSA = ClusterzL.iCache.GetItem("Shadow");
- this.iBMS = new OBitmap();
- this.addChild(this.iBMS);
- this.iBM = new OBitmap();
- this.iBMS.Pos(5,5);
- this.addChild(this.iBM);
- this.iCInd = param2;
- this.prRadius = param1;
- this.iBaseP = new Point(param3,param4);
- this.Pos(param3,param4);
- }
-
- public static function MakeBubble(param1:Array) : OBitmap
- {
- var _loc2_:Sprite = null;
- var _loc3_:DisplayObject = null;
- var _loc4_:Array = null;
- var _loc5_:Number = NaN;
- var _loc6_:Number = NaN;
- _loc2_ = new (ClusterzL.OBubbleC as Class)();
- _loc5_ = param1[1] / 91;
- _loc6_ = param1[2] * OGlobal.Scale;
- _loc3_ = _loc2_.getChildAt(0);
- (_loc4_ = _loc3_.filters)[0].color = ODisplay.HSBToRGB(iCIndexes[param1[3]],1,0.84);
- _loc4_[0].blurX *= _loc6_;
- _loc4_[0].blurY *= _loc6_;
- _loc4_[0].distance *= _loc6_;
- _loc3_.filters = _loc4_;
- _loc3_ = _loc2_.getChildAt(1);
- (_loc4_ = _loc3_.filters)[0].color = ODisplay.HSBToRGB(iCIndexes[param1[3]],0.42,1);
- _loc4_[0].blurX *= _loc6_;
- _loc4_[0].blurY *= _loc6_;
- _loc4_[0].distance *= _loc6_;
- _loc3_.filters = _loc4_;
- _loc3_ = _loc2_.getChildAt(2);
- (_loc4_ = _loc3_.filters)[0].color = ODisplay.HSBToRGB(iCIndexes[param1[3]],0.33,1);
- _loc4_[0].blurX *= _loc6_;
- _loc4_[0].blurY *= _loc6_;
- _loc4_[0].distance *= _loc6_;
- _loc3_.filters = _loc4_;
- _loc3_ = _loc2_.getChildAt(4);
- (_loc4_ = _loc3_.filters)[0].highlightColor = ODisplay.HSBToRGB(iCIndexes[param1[3]],0.16,1);
- _loc4_[0].blurX *= _loc6_;
- _loc4_[0].blurY *= _loc6_;
- _loc4_[0].distance *= _loc6_;
- _loc3_.filters = _loc4_;
- return OBitmap.MakeTmp(_loc2_,_loc5_,0,0,2);
- }
-
- public static function MakeShadow(param1:Array) : OBitmap
- {
- var _loc2_:Sprite = null;
- var _loc3_:DisplayObject = null;
- var _loc4_:Array = null;
- var _loc5_:Number = NaN;
- _loc2_ = new (ClusterzL.OBubbleShadowC as Class)();
- _loc5_ = param1[1] / 91;
- _loc3_ = _loc2_.getChildAt(0);
- (_loc4_ = _loc3_.filters)[0].color = ODisplay.HSBToRGB(iCIndexes[param1[3]],1,0.33);
- _loc4_[0].alpha = 0.33;
- _loc3_.filters = _loc4_;
- return OBitmap.MakeTmp(_loc2_,_loc5_,0,0,4);
- }
-
- public static function MakeFireworkBubble(param1:Number, param2:Number, param3:Number, param4:Number, param5:int, param6:Number, param7:Number, param8:Number, param9:Number) : OBubble
- {
- var _loc10_:OBubble = null;
- (_loc10_ = new OBubble(param1,param5,param6,param7)).iSRadius = param1;
- _loc10_.iERadius = param2;
- _loc10_.iDRadius = param3;
- _loc10_.iDAlpha = param4;
- _loc10_.iVel = new Point(param8,param9);
- _loc10_.State = stBeforeFirework;
- return _loc10_;
- }
-
- public function get prDAlpha() : Number
- {
- return this.iDAlpha;
- }
-
- public function set prDAlpha(param1:Number) : void
- {
- this.iDAlpha = param1;
- }
-
- public function get prRadius() : Number
- {
- return this.iRadius;
- }
-
- public function get prVel() : Point
- {
- return this.iVel;
- }
-
- public function set prCInd(param1:int) : void
- {
- this.iCInd = param1;
- if(this.iCInd < 0)
- {
- this.State = stInvisible;
- }
- else
- {
- this.State = stNormal;
- this.prRadius = this.iRadius;
- }
- }
-
- public function get prType() : int
- {
- return this.iType;
- }
-
- public function get State() : int
- {
- return this.iState;
- }
-
- public function get prBasePoint() : Point
- {
- return this.iBaseP;
- }
-
- public function set prVel(param1:Point) : void
- {
- this.iVel = param1;
- }
-
- public function set prRadius(param1:Number) : void
- {
- var _loc2_:int = 0;
- this.iRadius = param1;
- if(this.iRadius < 2)
- {
- this.iRadius = 2;
- }
- if(this.iCInd < 0)
- {
- return;
- }
- _loc2_ = Math.round(this.iRadius * 2 - 4) * iColorsCount + this.iCInd;
- this.iBM.Init(this.iBMA[_loc2_].prOBM);
- this.iBMS.Init(this.iBMSA[_loc2_].prOBM);
- }
-
- override public function Free() : void
- {
- this.iBMA = null;
- this.iBMSA = null;
- this.iBM = null;
- this.iBMS = null;
- super.Free();
- }
-
- public function InitHide(param1:int, param2:Number, param3:Number, param4:Number, param5:int) : void
- {
- this.iDelta = param1;
- this.iSRadius = param2;
- this.iERadius = param3;
- this.iDRadius = (param3 - param2) / param5;
- this.iDAlpha = (1 - param4) / param5;
- this.prRadius = param2;
- this.alpha = 1;
- if(param1)
- {
- this.State = stBeforeHide;
- }
- else
- {
- this.State = stHide;
- }
- }
-
- public function set prDelta(param1:int) : void
- {
- this.iDelta = param1;
- }
-
- public function InitShow(param1:int, param2:Number, param3:Number, param4:Number, param5:int) : void
- {
- this.iDelta = param1;
- this.iSRadius = param2;
- this.iERadius = param3;
- this.iDRadius = (param3 - param2) / param5;
- this.iDAlpha = (1 - param4) / param5;
- this.prRadius = param2;
- this.alpha = param4;
- if(param1)
- {
- this.State = stBeforeShow;
- }
- else
- {
- this.State = stShow;
- }
- }
-
- public function set prBasePoint(param1:Point) : void
- {
- this.iBaseP = param1;
- }
-
- public function set prType(param1:int) : void
- {
- this.iType = param1;
- }
-
- public function OnEnterFrame(param1:Event) : void
- {
- switch(this.iState)
- {
- case stBeforeShow:
- if(this.iDelta-- <= 0)
- {
- this.State = stShow;
- }
- break;
- case stShow:
- this.prRadius += this.iDRadius;
- this.alpha += this.iDAlpha;
- if(this.iDRadius >= 0 && this.iRadius >= this.iERadius || this.iDRadius < 0 && this.iRadius <= this.iERadius)
- {
- this.prRadius = this.iERadius;
- this.State = stNormal;
- }
- break;
- case stBeforeHide:
- if(this.iDelta-- <= 0)
- {
- this.State = stHide;
- }
- break;
- case stHide:
- this.prRadius += this.iDRadius;
- this.alpha -= this.iDAlpha;
- if(this.iDRadius >= 0 && this.iRadius >= this.iERadius || this.iDRadius < 0 && this.iRadius <= this.iERadius)
- {
- this.prRadius = this.iSRadius;
- this.alpha = 1;
- this.State = stInvisible;
- }
- break;
- case stBeforeFirework:
- this.Move(this.iVel.x,this.iVel.y);
- this.prRadius += this.iDRadius;
- this.alpha += this.iDAlpha;
- if(this.iDRadius >= 0 && this.iRadius >= this.iERadius || this.iDRadius < 0 && this.iRadius <= this.iERadius)
- {
- this.State = stBang;
- }
- break;
- case stBeforeBang:
- if(this.iDelta-- <= 0)
- {
- this.State = stBang;
- }
- break;
- case stBeforeMove:
- if(this.iDelta-- <= 0)
- {
- this.State = stMove;
- }
- break;
- case stMove:
- this.Move(this.iVel.x,this.iVel.y);
- this.alpha -= this.iDAlpha;
- if(this.alpha <= 0)
- {
- this.Pos(this.iBaseP.x,this.iBaseP.y);
- this.alpha = 1;
- this.prCInd = -1;
- }
- break;
- case stFlyOut:
- if(this.iDelta-- <= 0)
- {
- this.State = stBang;
- }
- }
- }
-
- public function get prDelta() : int
- {
- return this.iDelta;
- }
-
- public function get prCInd() : int
- {
- return this.iCInd;
- }
-
- public function set State(param1:int) : void
- {
- this.iState = param1;
- switch(this.iState)
- {
- case stInvisible:
- this.prVisible = false;
- break;
- case stBeforeShow:
- this.prVisible = false;
- break;
- case stShow:
- this.prVisible = true;
- break;
- case stBang:
- this.prVisible = false;
- break;
- case stNormal:
- this.prVisible = true;
- }
- }
- }
- }
-