home *** CD-ROM | disk | FTP | other *** search
- package Code.LOGIC.OBJECTS.ACTORS
- {
- import Code.LOGIC.OBJECTS.ACTORS.BLOB._la458;
- import Code.LOGIC.OBJECTS.ACTORS.INTERFACES._mk516;
- import Code.LOGIC.OBJECTS.ACTORS.RECTS._hk305;
- import Code.LOGIC.OBJECTS.GRAPHICS._kg83;
- import Code.LOGIC._cd449;
- import Code.org.cove.ape._be271;
- import Code.org.cove.ape._ci18;
- import Code.org.cove.ape._hu144;
- import Code.org.cove.ape._rv416;
- import flash.geom.Point;
-
- public class _uy463 extends _la458 implements _mk516
- {
-
- public static const stGuard:int = 102;
-
- public static const stPatrol:int = 101;
-
-
- private var distance:int;
-
- private var water:_hk305;
-
- private var picture:_kg83;
-
- private var _dm39:int;
-
- private var direction:int;
-
- private var force:_be271;
-
- public function _uy463(param1:Object)
- {
- param1.radius = 25;
- super(param1);
- this.force = new _be271();
- this.picture = new _kg83();
- this.picture.right();
- this._mb474(picture);
- this._my161 = _rs323;
- if(param1.State == stGuard)
- {
- distance = param1.distance;
- }
- State = param1.State;
- initalState = state;
- }
-
- public static function _lu255() : Object
- {
- var _loc1_:Object = null;
- return {
- "toolClass":_uy463,
- "name":"fish",
- "params":{
- "_tp253":0,
- "states":[["patrol",stPatrol],["guard",stGuard,[["distance",150]]]]
- }
- };
- }
-
- override public function _nu27(param1:_hk305) : void
- {
- water = param1;
- }
-
- override public function _eu538() : Object
- {
- var _loc1_:Object = null;
- _loc1_ = new Object();
- _loc1_.prClass = "TFish";
- _loc1_.x = initalCoords.x;
- _loc1_.y = initalCoords.y;
- _loc1_._tp253 = _tp253;
- _loc1_.State = initalState;
- if(state == stGuard)
- {
- _loc1_.distance = distance;
- }
- return _loc1_;
- }
-
- override public function _ur45() : Object
- {
- var _loc1_:Object = null;
- _loc1_ = _lu255();
- _loc1_.params._tp253 = _tp253;
- _loc1_.params.x = initalCoords.x;
- _loc1_.params.y = initalCoords.y;
- _loc1_.params.State = initalState;
- if(state == stGuard)
- {
- _loc1_.params.distance = distance;
- }
- return _loc1_;
- }
-
- override public function update(param1:Number) : void
- {
- var _loc2_:Point = null;
- var _loc3_:_be271 = null;
- super.update(param1);
- switch(state)
- {
- case stGuard:
- force.x = direction * 2;
- _ev130(force);
- if(Math.abs(_rx33.x) > 4)
- {
- _loc3_ = new _be271(_rx33.x > 0 ? 4 : -4,_rx33.y);
- _rx33 = _loc3_;
- }
- if(++_dm39 >= distance)
- {
- direction *= -1;
- _dm39 = 0;
- }
- if(_rx33.x > 1 && picture.orientation == _kg83.LEFT)
- {
- picture.right();
- }
- else if(_rx33.x < 1 && picture.orientation == _kg83.RIGHT)
- {
- picture.left();
- }
- break;
- case stPatrol:
- if(!water)
- {
- return;
- }
- _loc2_ = new Point(_cd449.BLOB._ej28 - _ej28,_cd449.BLOB._th99 - _th99);
- if(_loc2_.length > 400)
- {
- break;
- }
- _loc2_.normalize(2.5);
- force.x = _loc2_.x;
- if(_th99 < water._th99 - water.height / 2 + 3 * radius && _loc2_.y < 0)
- {
- _loc2_.y = 0.2;
- }
- force.y = _loc2_.y;
- _ev130(force);
- if(_rx33.x > 1 && picture.orientation == _kg83.LEFT)
- {
- picture.right();
- }
- else if(_rx33.x < 1 && picture.orientation == _kg83.RIGHT)
- {
- picture.left();
- }
- break;
- }
- water = null;
- }
-
- public function _rs323(param1:_hu144, param2:_hu144) : void
- {
- if(param2 is _rv416 && !(param2 is _ci18))
- {
- direction *= -1;
- }
- }
-
- override public function set State(param1:int) : void
- {
- super.State = param1;
- switch(state)
- {
- case stGuard:
- direction = 1;
- _dm39 = 0;
- }
- }
- }
- }
-