SHARE
TWEET

Untitled

New1235888 Oct 12th, 2019 114 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //overides
  2. class com.clubpenguin.world.rooms.aliens.AlienAbduction_EngineOverrides
  3. {
  4.    static var CLASS_NAME = "AlienAbduction_EngineOverrides";
  5.    var _overrides = com.clubpenguin.world.rooms.aliens.AlienAbduction_EngineOverrides;
  6.    function AlienAbduction_EngineOverrides()
  7.    {
  8.    }
  9.    function init(abductedPlayer)
  10.    {
  11.       if(this.isInit)
  12.       {
  13.          return undefined;
  14.       }
  15.       this.isInit = true;
  16.       if(abductedPlayer)
  17.       {
  18.          com.clubpenguin.world.rooms.aliens.AlienAbduction_EngineOverrides._abductedPlayerID = abductedPlayer;
  19.       }
  20.       this.defaultMovePlayer = _global.getCurrentEngine().movePlayer;
  21.       this.defaultSendPlayerMove = _global.getCurrentEngine().sendPlayerMove;
  22.       this.defaultUpdatePlayerPosition = _global.getCurrentEngine().updatePlayerPosition;
  23.       this.defaultUpdatePlayerFrame = _global.getCurrentEngine().updatePlayerPosition;
  24.    }
  25.    function sendPlayerMove(x, y, is_trigger, frame)
  26.    {
  27.       var _loc2_ = _global.getCurrentShell();
  28.       var _loc3_ = _global.getCurrentEngine();
  29.       var _loc4_ = _global.getCurrentShell().getMyPlayerId();
  30.       if(_loc4_ == com.clubpenguin.world.rooms.aliens.AlienAbduction_EngineOverrides._abductedPlayerID)
  31.       {
  32.          return undefined;
  33.       }
  34.       if(!_loc3_.isMovementEnabled())
  35.       {
  36.          return undefined;
  37.       }
  38.       if(_loc2_._localLoginServerData.autoLogin)
  39.       {
  40.          _loc2_.sendAS2Clicked(_loc3_.MOVE_CLICKED);
  41.       }
  42.       _loc4_ = _loc2_.getMyPlayerId();
  43.       var _loc7_ = _loc3_.getPlayerMovieClip(_loc4_);
  44.       if(_loc2_.isPlayerJumping(_loc4_) || _loc2_.localPlayerIsJumping)
  45.       {
  46.          return undefined;
  47.       }
  48.       if(_loc2_.isPlayerJumping(_loc4_) || _loc2_.localPlayerIsJumping)
  49.       {
  50.          return undefined;
  51.       }
  52.       var _loc9_ = Math.round(_loc7_._x);
  53.       var _loc8_ = Math.round(_loc7_._y);
  54.       var _loc11_ = _loc3_.findPlayerPath(_loc4_,x,y);
  55.       var _loc5_ = _loc11_.x;
  56.       var _loc6_ = _loc11_.y;
  57.       var _loc10_ = _loc3_.findDistance(_loc9_,_loc8_,_loc5_,_loc6_);
  58.       if(_loc10_ > 10)
  59.       {
  60.          _loc3_.setPlayerAction("move");
  61.          _loc3_.movePlayer(_loc4_,_loc5_,_loc6_,is_trigger,frame);
  62.          _loc2_.sendPlayerMove(_loc5_,_loc6_);
  63.       }
  64.       else if(frame != undefined)
  65.       {
  66.          _loc2_.sendPlayerFrame(frame);
  67.       }
  68.    }
  69.    function movePlayer(player_id, target_x, target_y, is_trigger, frame)
  70.    {
  71.       var SHELL = _global.getCurrentShell();
  72.       var ENGINE = _global.getCurrentEngine();
  73.       if(player_id == com.clubpenguin.world.rooms.aliens.AlienAbduction_EngineOverrides._abductedPlayerID)
  74.       {
  75.          var _loc2_ = _global.getCurrentEngine().getPlayerMovieClip(player_id);
  76.          var _loc12_ = _loc2_._x;
  77.          var _loc11_ = _loc2_._y;
  78.          _loc2_._x = _loc12_;
  79.          _loc2_._y = _loc11_;
  80.          return undefined;
  81.       }
  82.       if(SHELL.isPlayerJumping(player_id))
  83.       {
  84.          return undefined;
  85.       }
  86.       var mc = ENGINE.getPlayerMovieClip(player_id);
  87.       var _loc4_ = SHELL.getPlayerObjectById(player_id);
  88.       _loc4_.hasNotMovedSince = -1;
  89.       mc.cacheAsBitmap = false;
  90.       mc.debug_mc.clear();
  91.       if(!mc.is_ready)
  92.       {
  93.          ENGINE.updatePlayerPosition(player_id,target_x,target_y);
  94.          return undefined;
  95.       }
  96.       var start_x = Math.round(mc._x);
  97.       var start_y = Math.round(mc._y);
  98.       var _loc6_ = ENGINE.findDistance(start_x,start_y,target_x,target_y);
  99.       if(_global.getCurrentShell().playerModel.isPlayerStealthModerator() && _global.getCurrentShell().playerModel.isMyPlayer(player_id))
  100.       {
  101.          var duration = _loc6_ / 32;
  102.       }
  103.       else
  104.       {
  105.          var duration = _loc6_ / 4 * (100 / _loc4_.avatarVO.attributes.spriteSpeed);
  106.       }
  107.       var _loc13_ = ENGINE.findAngle(start_x,start_y,target_x,target_y);
  108.       var d = ENGINE.findDirection(_loc13_);
  109.       var change_x = target_x - start_x;
  110.       var change_y = target_y - start_y;
  111.       if(is_trigger == undefined)
  112.       {
  113.          is_trigger = true;
  114.       }
  115.       var _loc7_ = ENGINE.getRoomMovieClip();
  116.       var easeFunction = _loc7_.easeMethod;
  117.       if(easeFunction == undefined)
  118.       {
  119.          easeFunction = ENGINE.mathLinearTween;
  120.       }
  121.       if(_loc4_.avatarVO.attributes.isFloating)
  122.       {
  123.          easeFunction = ENGINE.mathEaseFloat;
  124.       }
  125.       var _loc14_ = mc.is_moving;
  126.       mc.is_moving = true;
  127.       mc.lastMoveDirection = d;
  128.       var _loc3_ = undefined;
  129.       if(easeFunction == ENGINE.mathEaseFloat)
  130.       {
  131.          _loc3_ = d;
  132.       }
  133.       else
  134.       {
  135.          _loc3_ = d + ENGINE.MAX_STANDING_FRAME;
  136.          if(_loc7_.invertedPenguins)
  137.          {
  138.             _loc3_ = _loc3_ + 4;
  139.             if(_loc3_ > ENGINE.MAX_WALKING_FRAME)
  140.             {
  141.                var _loc10_ = ENGINE.MAX_STANDING_FRAME + (_loc3_ - ENGINE.MAX_WALKING_FRAME);
  142.                _loc3_ = _loc10_;
  143.             }
  144.          }
  145.       }
  146.       ENGINE.updatePlayerFrame(player_id,_loc3_);
  147.       var t = 0;
  148.       ENGINE.movingPlayers["p" + player_id] = mc;
  149.       mc.updateMCPosition = function()
  150.       {
  151.          t++;
  152.          if(mc.is_moving && t < duration && (mc.frame >= ENGINE.MIN_WALKING_FRAME && mc.frame <= ENGINE.MAX_WALKING_FRAME || easeFunction == ENGINE.mathEaseFloat))
  153.          {
  154.             var _loc3_ = undefined;
  155.             var _loc2_ = undefined;
  156.             if(easeFunction == ENGINE.mathEaseFloat)
  157.             {
  158.                var _loc1_ = easeFunction(t,start_x,target_x,start_y,target_y,duration);
  159.                _loc3_ = _loc1_.x;
  160.                _loc2_ = _loc1_.y;
  161.             }
  162.             else
  163.             {
  164.                _loc3_ = Math.round(easeFunction(t,start_x,change_x,duration));
  165.                _loc2_ = Math.round(easeFunction(t,start_y,change_y,duration));
  166.             }
  167.             ENGINE.updatePlayerPosition(player_id,_loc3_,_loc2_);
  168.          }
  169.          else if(mc.is_moving && t >= duration)
  170.          {
  171.             mc.is_moving = false;
  172.             ENGINE.updatePlayerFrame(player_id,d);
  173.             SHELL.sendPlayerMoveDone(player_id);
  174.             delete ENGINE.movingPlayers["p" + player_id];
  175.             if(SHELL.isMyPlayer(player_id))
  176.             {
  177.                var _loc4_ = false;
  178.                ENGINE.playerMoved.dispatch();
  179.                ENGINE.setPlayerAction("wait");
  180.                if(is_trigger && ENGINE.isMouseActive())
  181.                {
  182.                   ENGINE.checkTrigger(mc);
  183.                }
  184.                if(frame != undefined)
  185.                {
  186.                   ENGINE.sendPlayerFrame(frame);
  187.                }
  188.             }
  189.          }
  190.       };
  191.       if(!_loc14_)
  192.       {
  193.          SHELL.updateListeners(SHELL.PLAYER_MOVE_START,_loc4_);
  194.       }
  195.    }
  196.    function updatePlayerPosition(player_id, x, y, ignoreBlockLayer)
  197.    {
  198.       var _loc9_ = _global.getCurrentShell();
  199.       var _loc4_ = _global.getCurrentEngine();
  200.       if(player_id == com.clubpenguin.world.rooms.aliens.AlienAbduction_EngineOverrides._abductedPlayerID)
  201.       {
  202.          var _loc8_ = _global.getCurrentEngine().getPlayerMovieClip(player_id);
  203.          var _loc14_ = _loc8_._x;
  204.          var _loc13_ = _loc8_._y;
  205.          _loc8_._x = _loc14_;
  206.          _loc8_._y = _loc13_;
  207.          return undefined;
  208.       }
  209.       var _loc3_ = _loc4_.getPlayerMovieClip(player_id);
  210.       var _loc11_ = _loc4_.getBalloonMovieClip(player_id);
  211.       var _loc10_ = _loc4_.getNicknameMovieClip(player_id);
  212.       var _loc7_ = _loc9_.getPlayerObjectById(player_id);
  213.       if(ignoreBlockLayer == undefined || !ignoreBlockLayer)
  214.       {
  215.          x = _loc4_.getValidXPosition(x);
  216.          y = _loc4_.getValidYPosition(y);
  217.       }
  218.       _loc3_._x = x;
  219.       _loc3_._y = y;
  220.       _loc11_._x = x + _loc7_.avatarVO.speechBubbleOffsetX;
  221.       _loc11_._y = y + _loc7_.avatarVO.speechBubbleOffsetY;
  222.       if(_loc3_.scaleTopOffsetY != undefined)
  223.       {
  224.          _loc11_._y = _loc11_._y + _loc3_.scaleTopOffsetY;
  225.       }
  226.       _loc10_._x = x;
  227.       _loc10_._y = y + _loc7_.avatarVO.nicknameOffsetY;
  228.       if(_loc3_.scaleBottomOffsetY != undefined)
  229.       {
  230.          _loc10_._y = _loc10_._y + _loc3_.scaleBottomOffsetY;
  231.       }
  232.       _loc4_.updatePlayerDepth(_loc3_,_loc3_.depth_id);
  233.       if(_loc9_.isMyPlayer(player_id))
  234.       {
  235.          _loc4_.player_x = x;
  236.          _loc4_.player_y = y;
  237.          var _loc12_ = _loc9_.getMyPlayerObject();
  238.          _loc12_.x = x;
  239.          _loc12_.y = y;
  240.       }
  241.       _loc7_.x = x;
  242.       _loc7_.y = y;
  243.    }
  244. }
  245.  
  246. //main
  247. class com.clubpenguin.world.rooms.aliens.AlienAbduction
  248. {
  249.    function AlienAbduction()
  250.    {
  251.       this._engine = _global.getCurrentEngine();
  252.    }
  253.    function activate_EngineOverrides()
  254.    {
  255.       this._engine.movePlayer = com.clubpenguin.util.Delegate.create(this._engine,this._engineOverrides.movePlayer);
  256.       this._engine.sendPlayerMove = com.clubpenguin.util.Delegate.create(this._engine,this._engineOverrides.sendPlayerMove);
  257.       this._engine.updatePlayerPosition = com.clubpenguin.util.Delegate.create(this._engine,this._engineOverrides.updatePlayerPosition);
  258.       if(_global.getCurrentShell().isMyPlayer(this._player_id))
  259.       {
  260.          this._engine.sendPlayerMove(this._penguin_mc._x,this._penguin_mc._y);
  261.          this._engine.movePlayer(this._player_id,this._penguin_mc._x,this._penguin_mc._y);
  262.       }
  263.    }
  264.    function deactivateEngineOverrides()
  265.    {
  266.       this._engine.movePlayer = com.clubpenguin.util.Delegate.create(this._engine,this._engineOverrides.defaultMovePlayer);
  267.       this._engine.sendPlayerMove = com.clubpenguin.util.Delegate.create(this._engine,this._engineOverrides.defaultSendPlayerMove);
  268.       this._engine.updatePlayerPosition = com.clubpenguin.util.Delegate.create(this._engine,this._engineOverrides.defaultUpdatePlayerPosition);
  269.    }
  270.    function abductPlayer(player_id, roomMC, _this)
  271.    {
  272.       this._player_id = player_id;
  273.       this._roomMC = roomMC;
  274.       this._previousRoomId = _global.getCurrentShell().getCurrentRoomId();
  275.       this._penguin_mc = this._engine.getPlayerMovieClip(this._player_id);
  276.       this._this = _this;
  277.       this._engineOverrides = new com.clubpenguin.world.rooms.aliens.AlienAbduction_EngineOverrides();
  278.       this._engineOverrides.init(player_id);
  279.       this.activate_EngineOverrides();
  280.       this.startBeam();
  281.    }
  282.    function startBeam()
  283.    {
  284.       var _loc2_ = this._penguin_mc._y / 2;
  285.       this._roomMC.tractorBeam_mc.gotoAndPlay(2);
  286.       com.greensock.TweenMax.to(this._penguin_mc,3.46,{_y:_loc2_,_rotation:-30,delay:0.7,ease:com.greensock.easing.Sine.easeIn,onComplete:this.tween1Complete,onCompleteParams:[this._penguin_mc],onCompleteScope:this});
  287.       setTimeout(com.clubpenguin.util.Delegate.create(this,this.changeColor),300);
  288.       this._abductionComplete = setTimeout(com.clubpenguin.util.Delegate.create(this,this.abductionViewingComplete),4000);
  289.    }
  290.    function tween1Complete(player)
  291.    {
  292.       com.greensock.TweenMax.to(player,0.5,{_y:-50,_rotation:-30,delay:0,ease:com.greensock.easing.Back.easeIn,onComplete:this.tween2Complete,onCompleteScope:this});
  293.    }
  294.    function tween2Complete()
  295.    {
  296.       this.deactivateEngineOverrides();
  297.       this._this.abductedPlayerGoToUFO(this._player_id);
  298.    }
  299.    function changeColor()
  300.    {
  301.       var _loc3_ = new flash.geom.ColorTransform(1,1,1,1,0,55,0,0);
  302.       var _loc2_ = new flash.geom.Transform(this._penguin_mc);
  303.       _loc2_.colorTransform = _loc3_;
  304.    }
  305.    function abductionViewingComplete()
  306.    {
  307.       this.deactivateEngineOverrides();
  308.    }
  309.    function clean()
  310.    {
  311.       clearTimeout(this._abductionComplete);
  312.    }
  313. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top