Advertisement
Jousway

RB Down Receptor.lua

Jul 16th, 2018
314
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.25 KB | None | 0 0
  1. local sButton = Var "Button";
  2. local sPlayer = Var "Player";
  3.  
  4. local Position = {
  5.     --dance
  6.     Up = {2.5,0},
  7.     Down = {-2.5,0},
  8.     Left = {-7.5,-5.5},
  9.     Right = {7.5,-5.5},
  10.     --pump
  11.     DownLeft = {-7.5,-5.5},
  12.     DownRight = {7.5,-5.5},
  13.     UpLeft = {-2.5,0},
  14.     UpRight = {2.5,0},
  15.     Center = {0,0},
  16. };
  17.  
  18. local Colour2 = {
  19.     --dance
  20.     Up = "#0000FF",
  21.     Down = "#FFFF00",
  22.     Left = "#FF0000",
  23.     Right = "#00FF00",
  24.     --pump
  25.     DownLeft = "#FF0000",
  26.     DownRight = "#00FF00",
  27.     UpLeft = "#FFFF00",
  28.     UpRight = "#0000FF",
  29.     Center = "#FFA500",
  30. };
  31.  
  32. local Colour = {
  33.     --dance
  34.     Up = "Blue",
  35.     Down = "Yellow",
  36.     Left = "Red",
  37.     Right = "Green",
  38.     --pump
  39.     DownLeft = "Red",
  40.     DownRight = "Green",
  41.     UpLeft = "Yellow",
  42.     UpRight = "Blue",
  43.     Center = nil,
  44. };
  45.  
  46. local RotSide = {
  47.     [1] = 0,
  48.     [2] = 180,
  49. };
  50.  
  51. local Location = {};
  52. local rBack = {};
  53.  
  54. if GAMESTATE:GetCurrentGame():GetName() == "dance" then
  55.     if string.find(GAMESTATE:GetCurrentStyle(pn):GetStepsType() ,"Double") then
  56.         Location = {
  57.             --dance
  58.             [1] = 224,
  59.             [2] = 128,
  60.             [3] = 128,
  61.             [4] = 128,
  62.             [5] = -128,
  63.             [6] = -128,
  64.             [7] = -128,
  65.             [8] = -128,
  66.         };
  67.         rBack = {
  68.             [1] = {0.8,256},
  69.             [2] = {0,0},
  70.             [3] = {0,0},
  71.             [4] = {0,0},
  72.             [5] = {0,0},
  73.             [6] = {0,0},
  74.             [7] = {0,0},
  75.             [8] = {0,0},
  76.         };
  77.     else
  78.         Location = {
  79.             --dance
  80.             [1] = 0,
  81.             [2] = 0,
  82.             [3] = 0,
  83.             [4] = 0,
  84.         };
  85.         rBack = {
  86.             [1] = {0.8,64},
  87.             [2] = {0.8,64},
  88.             [3] = {0.8,64},
  89.             [4] = {0.8,64},
  90.         };
  91.     end
  92. else
  93.     Location = {
  94.         --pump
  95.         [1] = 0,
  96.         [2] = 16,
  97.         [3] = 0,
  98.         [4] = -16,
  99.         [5] = 0,
  100.     };
  101.     rBack = {
  102.         [1] = {0.8,64},
  103.         [2] = {0.8,64},
  104.         [3] = {0,0},
  105.         [4] = {0.8,64},
  106.         [5] = {0.8,64},
  107.     };
  108. end;
  109.  
  110. if rButton then
  111.     if rButton[sPlayer] then
  112.         rButton[sPlayer] = rButton[sPlayer] + 1;
  113.     else
  114.         rButton = {};
  115.         rButton[sPlayer] = 1;
  116.     end;
  117. else
  118.     rButton = {};
  119.     rButton[sPlayer] = 1;
  120. end;
  121.  
  122. local t = Def.ActorFrame {};
  123.  
  124. if sButton == "Center" or (rButton[sPlayer] == 1 and string.find(GAMESTATE:GetCurrentStyle(pn):GetStepsType() ,"Double") )then
  125.     t = Def.ActorFrame {
  126.         Def.Quad {
  127.             InitCommand=cmd(diffuse,color("0,0,0,0.4");diffusealpha,rBack[rButton[sPlayer]][1];scaletoclipped,rBack[rButton[sPlayer]][2],9001);
  128.         };
  129.     };
  130. else
  131.     t = Def.ActorFrame {
  132.         InitCommand=cmd(sleep,0.1;queuecommand,"Reset");
  133.         ResetCommand=function(self)
  134.             rButton[sPlayer] = 0;
  135.         end;
  136.         Def.Quad {
  137.             InitCommand=cmd(diffuse,color("0,0,0,0.4");diffusealpha,rBack[rButton[sPlayer]][1];scaletoclipped,rBack[rButton[sPlayer]][2],9001);
  138.         };
  139.         Def.ActorFrame {
  140.             OnCommand=cmd(rotationx,90;rotationz,Position[sButton][1];z,Position[sButton][2]);
  141.             Def.Model {
  142.                 Meshes=NOTESKIN:GetPath("","Tex/_Receptor "..Colour[sButton]);
  143.                 Materials=NOTESKIN:GetPath("","Tex/_Receptor "..Colour[sButton]);
  144.                 Bones=NOTESKIN:GetPath("","Tex/_Receptor "..Colour[sButton]);
  145.                 PressCommand=cmd(stoptweening;bounceend,0.05;y,-6;bounceend,0.05;y,0);
  146.             };
  147.         };
  148.         --LoadFont("Common Normal") .. { Text=rButton[sPlayer] };
  149.     };
  150. end;
  151.  
  152. local play = 1;
  153. t[#t+1] = Def.ActorFrame {
  154.     OnCommand=function()
  155.         local getc = SCREENMAN:GetTopScreen():GetChild("Player"..ToEnumShortString(sPlayer)):GetChild("NoteField"):get_column_actors()
  156.         for i2 in pairs(getc) do
  157.             getc[i2]:x(Location[i2]);
  158.             getc[i2]:rotationx(-60)
  159.         end;
  160.     end;
  161.     W1Command=cmd(queuecommand,"Move");
  162.     W2Command=cmd(queuecommand,"Move");
  163.     W3Command=cmd(queuecommand,"Move");
  164.     MoveCommand=function(self)
  165.         play = play + 1
  166.         if play > 15 then play = 1; end;
  167.     end;
  168. };
  169.  
  170. if sButton == "Center" or (rButton[sPlayer] == 1 and string.find(GAMESTATE:GetCurrentStyle(pn):GetStepsType() ,"Double") )then
  171. else
  172.     for i=1,2 do
  173.         for i2=1,15 do
  174.             t[#t+1] = Def.ActorFrame {
  175.                 OnCommand=cmd(rotationx,90;rotationz,Position[sButton][1];z,Position[sButton][2]);
  176.                 Def.Model {
  177.                     Meshes=NOTESKIN:GetPath("","Tex/_Explosion Side");
  178.                     Materials=NOTESKIN:GetPath("","Tex/_Explosion Side");
  179.                     Bones=NOTESKIN:GetPath("","Tex/_Explosion Side");
  180.                     InitCommand=cmd(diffusealpha,0;rotationy,RotSide[i]);
  181.                     W1Command=cmd(queuecommand,"Move");
  182.                     W2Command=cmd(queuecommand,"Move");
  183.                     W3Command=cmd(queuecommand,"Move");
  184.                     W4Command=cmd(diffusealpha,0);
  185.                     W5Command=cmd(diffusealpha,0);
  186.                     MoveCommand=function(self)
  187.                     if play == i2 then
  188.                         self:finishtweening();
  189.                             self:diffusealpha(1);
  190.                             self:rotationz(15*math.random(0,6));
  191.                             self:z(0);
  192.                             self:linear(1);
  193.                             self:rotationz(15*math.random(0,6));
  194.                             self:z(45*math.random(6,12));
  195.                             self:linear(0.1);
  196.                             self:diffusealpha(0);
  197.                         end;
  198.                     end;
  199.                 };
  200.                
  201.             };
  202.             t[#t+1] = LoadActor (NOTESKIN:GetPath( "_Hold", "Explosion Part" ))..{
  203.                 InitCommand=cmd(diffuse,color(Colour2[sButton]);diffusealpha,0);
  204.                 W1Command=cmd(queuecommand,"Move");
  205.                 W2Command=cmd(queuecommand,"Move");
  206.                 W3Command=cmd(queuecommand,"Move");
  207.                 W4Command=cmd(diffusealpha,0);
  208.                 W5Command=cmd(diffusealpha,0);
  209.                 MoveCommand=function(self)
  210.                     if play == i2 then
  211.                         self:finishtweening();
  212.                         self:diffusealpha(1);
  213.                         self:x(5*math.random(-4,4));
  214.                         self:y(0);
  215.                         self:bounceend(1);
  216.                         self:x(5*math.random(-4,4));
  217.                         self:y(45*math.random(6,12));
  218.                         self:diffusealpha(0);
  219.                     end;
  220.                 end;
  221.             };
  222.         end;
  223.     end;
  224. end;
  225.  
  226. return t;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement