SHARE
TWEET

open my glows

a guest Jul 12th, 2019 108 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function SetGlows()
  2. {
  3.    for(var _loc8_ in Players)
  4.    {
  5.       if(Players[_loc8_].Namecolor)
  6.       {
  7.          var _loc2_ = INTERFACE.nicknames_mc["p" + _loc8_].name_txt;
  8.          _loc2_.textColor = Players[_loc8_].Namecolor;
  9.       }
  10.       if(Players[_loc8_].Nameglow)
  11.       {
  12.          _loc2_ = INTERFACE.nicknames_mc["p" + _loc8_];
  13.          var _loc1_ = new flash.filters.DropShadowFilter(0,0,Players[_loc8_].Nameglow,10,1.7,1.7,15,3);
  14.          _loc2_.name_txt.filters = [_loc1_];
  15.       }
  16.       if(Players[_loc8_].Size != "" && Players[_loc8_].Size != 1)
  17.       {
  18.          ENGINE.room_mc.load_mc["p" + _loc8_]._yscale = int(Players[_loc8_].Size);
  19.          ENGINE.room_mc.load_mc["p" + _loc8_]._xscale = int(Players[_loc8_].Size);
  20.       }
  21.       if(Players[_loc8_].BubbleColor)
  22.       {
  23.          var _loc3_ = INTERFACE.BALLOONS["p" + _loc8_];
  24.          var _loc6_ = new Color(_loc3_.balloon_mc);
  25.          _loc6_.setRGB(Players[_loc8_].BubbleColor);
  26.          var _loc7_ = new Color(_loc3_.pointer_mc);
  27.          _loc7_.setRGB(Players[_loc8_].BubbleColor);
  28.       }
  29.       if(Players[_loc8_].BubbleGlow)
  30.       {
  31.          var _loc4_ = INTERFACE.BALLOONS["p" + _loc8_];
  32.          _loc1_ = new flash.filters.DropShadowFilter(0,0,Players[_loc8_].BubbleGlow,10,1.7,1.7,15,3);
  33.          _loc4_.balloon_mc.filters = [_loc1_];
  34.          _loc4_.pointer_mc.filters = [_loc1_];
  35.       }
  36.       if(Players[_loc8_].BubbleTextColor)
  37.       {
  38.          var _loc5_ = INTERFACE.BALLOONS["p" + _loc8_];
  39.          _loc5_.message_txt.textColor = Players[_loc8_].BubbleTextColor;
  40.       }
  41.    }
  42. }
  43. function UpdatePlayer(PlayerArray)
  44. {
  45.    Players[PlayerArray[0]] = {Nameglow:PlayerArray[17],Namecolor:PlayerArray[18],BubbleColor:PlayerArray[19],BubbleTextColor:PlayerArray[20],Speed:PlayerArray[21],Mood:PlayerArray[22],BubbleGlow:PlayerArray[23],MoodGlow:PlayerArray[24],MoodColor:PlayerArray[25],Walls:PlayerArray[26],Size:PlayerArray[27]};
  46. }
  47. function OpenGlows()
  48. {
  49.    _global.handleJoinRoom = function(obj)
  50.    {
  51.       for(var _loc2_ in obj)
  52.       {
  53.          PlayerArray = obj[_loc2_].split("|");
  54.          UpdatePlayer(PlayerArray);
  55.       }
  56.    };
  57.    AIRTOWER.addListener("jr",_global.handleJoinRoom);
  58.    _global.handleAddPlayer = function(obj)
  59.    {
  60.       Player = obj.shift();
  61.       PlayerArray = Player.split("|");
  62.       UpdatePlayer(PlayerArray);
  63.       SetGlows();
  64.    };
  65.    AIRTOWER.addListener("ap",_global.handleAddPlayer);
  66.    _global.handleUpdatePlayer = function(obj)
  67.    {
  68.       v = obj.shift();
  69.       Player = obj.shift();
  70.       PlayerArray = Player.split("|");
  71.       UpdatePlayer(PlayerArray);
  72.       SetGlows();
  73.    };
  74.    AIRTOWER.addListener("up",_global.handleUpdatePlayer);
  75.    _global.showEmoteBalloon = function(obj)
  76.    {
  77.       obj.shift();
  78.       id = obj[0];
  79.       color = Players[id].BubbleColor;
  80.       glow = Players[id].BubbleGlow;
  81.       if(color)
  82.       {
  83.          var _loc2_ = new Color(INTERFACE.balloons_mc["p" + id].balloon_mc);
  84.          var _loc5_ = new Color(INTERFACE.balloons_mc["p" + id].pointer_mc);
  85.          _loc2_.setRGB(color);
  86.          _loc5_.setRGB(color);
  87.       }
  88.       if(glow)
  89.       {
  90.          var _loc1_ = new flash.filters.DropShadowFilter(0,0,glow,20,5,5,15,3);
  91.          var _loc3_ = INTERFACE.balloons_mc["p" + id].balloon_mc;
  92.          var _loc4_ = INTERFACE.balloons_mc["p" + id].pointer_mc;
  93.          _loc3_.filters = [_loc1_];
  94.          _loc4_.filters = [_loc1_];
  95.       }
  96.    };
  97.    AIRTOWER.addListener("se",_global.showEmoteBalloon);
  98. }
  99. var INTERFACE = _global.getCurrentInterface();
  100. var ENGINE = _global.getCurrentEngine();
  101. var SHELL = _global.getCurrentShell();
  102. var AIRTOWER = _global.getCurrentAirtower();
  103. var Players = {};
  104.  
  105. ENGINE.onPlayerLoadStart = function(event)
  106. {
  107.    SetGlows();
  108.    event.target._visible = false;
  109. };
  110. INTERFACE.updatePlayerWidgetO = INTERFACE.updatePlayerWidget;
  111. INTERFACE.updatePlayerWidget = function()
  112. {
  113.    INTERFACE.updatePlayerWidgetO();
  114.    var mP = INTERFACE.getActivePlayerId() == SHELL.getMyPlayerId();
  115.    var player_ob = INTERFACE.getPlayerObject(INTERFACE.getActivePlayerId());
  116.    var glow = new flash.filters.DropShadowFilter(0,0,Players[player_ob.player_id].MoodGlow,10,1.7,1.7,15,3);
  117.    var tF = new TextFormat();
  118.    tF.font = "Burbank Small Medium";
  119.    tF.size = 12;
  120.    tF.align = "center";
  121.    tF.color = Players[player_ob.player_id].MoodColor;
  122.    INTERFACE.PLAYER_WIDGET.art_mc.createTextField("pMood_txt",2,10,230,203,16);
  123.    INTERFACE.PLAYER_WIDGET.art_mc.pMood_txt.text = Players[player_ob.player_id].Mood;
  124.    INTERFACE.PLAYER_WIDGET.art_mc.pMood_txt.selectable = mP;
  125.    INTERFACE.PLAYER_WIDGET.art_mc.pMood_txt.setTextFormat(tF);
  126.    INTERFACE.PLAYER_WIDGET.art_mc.pMood_txt.filters = [glow];
  127.    if(mP)
  128.    {
  129.       INTERFACE.PLAYER_WIDGET.art_mc.pMood_txt.type = "input";
  130.       INTERFACE.PLAYER_WIDGET.art_mc.pMood_txt.onKillFocus = function()
  131.       {
  132.          if(this.text == " " || this.text == "")
  133.          {
  134.             this.text = "DEFAULT MOOD CAN CHANGE";
  135.          }
  136.          var newMood = this.text;
  137.          Players[player_ob.player_id].Mood = newMood;
  138.          with(_level0.CLIENT.PENGUIN.AIRTOWER)
  139.          {
  140.             send(PLAY_EXT,"iCP#umo",[newMood],"str",-1)
  141.            
  142.          };
  143.       };
  144.    }
  145. };
  146. INTERFACE.showBalloon2 = INTERFACE.showBalloon;
  147. INTERFACE.showBalloon = function(player_id, msg)
  148. {
  149.    var _loc1_ = INTERFACE.showBalloon2(player_id,msg);
  150.    var _loc3_ = INTERFACE.getPlayerObject(player_id);
  151.    SetGlows();
  152.    return _loc1_;
  153. };
  154. ENGINE.randomizeNearPosition = function(player, x, y, range)
  155. {
  156.    player.x = x;
  157.    player.y = y;
  158.    return true;
  159. };
  160. ENGINE.movePlayer = function(player_id, target_x, target_y, is_trigger, frame)
  161. {
  162.    var _loc4_ = ENGINE.getRoomMovieClip();
  163.    if(is_trigger == undefined)
  164.    {
  165.       is_trigger = true;
  166.    }
  167.    var mc = ENGINE.getPlayerMovieClip(player_id);
  168.    var start_x = Math.round(mc._x);
  169.    var start_y = Math.round(mc._y);
  170.    if(mc.is_reading)
  171.    {
  172.       ENGINE.removePlayerBook(player_id);
  173.    }
  174.    if(!mc.is_ready)
  175.    {
  176.       ENGINE.updatePlayerPosition(player_id,target_x,target_y);
  177.    }
  178.    else
  179.    {
  180.       var _loc2_ = ENGINE.findDistance(start_x,start_y,target_x,target_y);
  181.       if(_loc4_.ease_method == "easeInOutQuad")
  182.       {
  183.          var easeFunction = ENGINE.mathEaseInOutQuad;
  184.       }
  185.       else
  186.       {
  187.          var easeFunction = ENGINE.mathLinearTween;
  188.       }
  189.       var _loc3_ = ENGINE.findAngle(start_x,start_y,target_x,target_y);
  190.       var d = ENGINE.findDirection(_loc3_);
  191.       var duration = _loc2_ / 4;
  192.       if(Players[player_id].Speed)
  193.       {
  194.          var duration = _loc2_ / Players[player_id].Speed;
  195.       }
  196.       var change_x = target_x - start_x;
  197.       var change_y = target_y - start_y;
  198.       mc.is_moving = true;
  199.       ENGINE.updatePlayerFrame(player_id,d + 8);
  200.       var t = 0;
  201.       mc.onEnterFrame = function()
  202.       {
  203.          t++;
  204.          if(t < duration)
  205.          {
  206.             x = easeFunction(t,start_x,change_x,duration);
  207.             y = easeFunction(t,start_y,change_y,duration);
  208.             ENGINE.updatePlayerPosition(player_id,x,y);
  209.          }
  210.          else
  211.          {
  212.             mc.is_moving = false;
  213.             ENGINE.updatePlayerPosition(player_id,target_x,target_y);
  214.             ENGINE.updatePlayerFrame(player_id,d);
  215.             ENGINE.SHELL.sendPlayerMoveDone(player_id);
  216.             this.onEnterFrame = null;
  217.             delete this.onEnterFrame;
  218.             if(ENGINE.SHELL.isMyPlayer(player_id))
  219.             {
  220.                ENGINE.playerMoved.dispatch();
  221.                ENGINE.setPlayerAction("wait");
  222.                if(is_trigger && ENGINE.isMouseActive())
  223.                {
  224.                   ENGINE.checkTrigger(mc);
  225.                   ENGINE.checkFieldOpTriggered(mc);
  226.                }
  227.                if(frame != undefined)
  228.                {
  229.                   ENGINE.sendPlayerFrame(frame);
  230.                }
  231.             }
  232.          }
  233.       };
  234.    }
  235. };
  236. ENGINE.findPlayerPath = function(player_id, x, y)
  237. {
  238.    var _loc13_ = ENGINE.getPlayerMovieClip(player_id);
  239.    var _loc7_ = ENGINE.getRoomBlockMovieClip();
  240.    var _loc15_ = ENGINE.getValidXPosition(x);
  241.    var _loc14_ = ENGINE.getValidYPosition(y);
  242.    var _loc12_ = Math.round(_loc13_._x);
  243.    var _loc10_ = Math.round(_loc13_._y);
  244.    var _loc16_ = ENGINE.findDistance(_loc12_,_loc10_,_loc15_,_loc14_);
  245.    var _loc3_ = Math.round(_loc16_);
  246.    var _loc8_ = (_loc15_ - _loc12_) / _loc3_;
  247.    var _loc9_ = (_loc14_ - _loc10_) / _loc3_;
  248.    var _loc5_ = _loc12_;
  249.    var _loc4_ = _loc10_;
  250.    var _loc6_ = new Object();
  251.    _loc6_.x = _loc12_;
  252.    _loc6_.y = _loc10_;
  253.    var _loc17_ = _loc7_.hitTest(_loc12_,_loc10_,true);
  254.    while(_loc3_ > 0)
  255.    {
  256.       _loc5_ = _loc5_ + _loc8_;
  257.       _loc4_ = _loc4_ + _loc9_;
  258.       var _loc1_ = Math.round(_loc5_);
  259.       var _loc2_ = Math.round(_loc4_);
  260.       if(Players[player_id].Walls != 1)
  261.       {
  262.          if(_loc7_.hitTest(_loc1_,_loc2_,true))
  263.          {
  264.             break;
  265.          }
  266.       }
  267.       _loc6_.x = _loc1_;
  268.       _loc6_.y = _loc2_;
  269.       _loc3_ = _loc3_ - 1;
  270.    }
  271.    return _loc6_;
  272. };
  273. SHELL.getPlayerHexFromId = function(id)
  274. {
  275.    if(id < 50 || !isNaN(_loc2.colour_id))
  276.    {
  277.       var _loc1_ = SHELL.getPlayerColoursObject();
  278.       if(_loc1_[id] != undefined)
  279.       {
  280.          return _loc1_[id];
  281.       }
  282.       return _loc1_[0];
  283.    }
  284.    return id;
  285. };
  286. SHELL.getMyPlayerHex = function()
  287. {
  288.    var _loc1_ = SHELL.getMyPlayerObject();
  289.    var _loc2_ = SHELL.getPlayerColoursObject();
  290.    if(_loc1_.colour_id < 50 || isNaN(_loc1_.colour_id))
  291.    {
  292.       return _loc1_.colour_id;
  293.    }
  294.    if(_loc2_[_loc1_.colour_id] != undefined)
  295.    {
  296.       return _loc2_[_loc1_.colour_id];
  297.    }
  298.    return _loc2_[0];
  299. };
  300. SHELL.handleSendUpdatePlayerColour = function(obj)
  301. {
  302.    var _loc5_ = obj.shift();
  303.    var _loc2_ = Number(obj[0]);
  304.    var _loc3_ = Number(obj[1]);
  305.    if(SHELL.isMyPlayer(_loc2_))
  306.    {
  307.       SHELL.setMyPlayerHexById(_loc3_);
  308.    }
  309.    var _loc1_ = SHELL.getPlayerObjectFromRoomById(_loc2_);
  310.    if(_loc1_ != undefined)
  311.    {
  312.       _loc1_.colour_id = _loc3_;
  313.       _loc1_.frame_hack = SHELL.buildFrameHacksString(_loc1_);
  314.       SHELL.updateListeners(SHELL.UPDATE_PLAYER,_loc1_);
  315.       if(SHELL.isMyPlayer(_loc2_))
  316.       {
  317.          SHELL.com.clubpenguin.login.LocalData.saveRoomPlayerObject(_loc1_);
  318.       }
  319.    }
  320.    else
  321.    {
  322.       SHELL.$e("[shell] handleSendUpdatePlayerColour() -> Could not find player in room! player_id:" + _loc2_);
  323.    }
  324. };
  325. SHELL.setMyPlayerHexById = function(id)
  326. {
  327.    var _loc1_ = SHELL.getMyPlayerObject();
  328.    var _loc3_ = _loc1_.colour_id;
  329.    _loc1_.colour_id = id;
  330.    if(SHELL.player_colours[_loc1_.colour_id] != undefined)
  331.    {
  332.       return SHELL.player_colours[_loc1_.colour_id];
  333.    }
  334.    return id;
  335. };
  336. OpenGlows();
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