Advertisement
Guest User

For MadkaT

a guest
Jul 14th, 2016
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.72 KB | None | 0 0
  1. local steps, song, meter, difficulty
  2. local glowDiff = 14
  3.  
  4. t[#t+1] = LoadActor( "dummy" )..{
  5.     InitCommand=function(self) self:diffusealpha(0) end,
  6.     OnCommand=function(self)
  7.         self:Center()
  8.             :FullScreen()
  9.             :blend("BlendMode_Add")
  10.     end,
  11.     GlowCommand=function(self)
  12.         self:diffuseshift()
  13.             :effectcolor1(0,0,0,0)
  14.             :effectcolor2(1,1,1,1)
  15.             :effectperiod(2)
  16.     end,
  17.     HideCommand=function(self)
  18.         self:linear(1)
  19.             :diffusealpha(0)
  20.     end,
  21.     CurrentSongChangedMessageCommand=function(self) self:queuecommand("Set") end,
  22.     ChangeStepsMessageCommand=function(self) self:queuecommand("Set") end
  23.    
  24.    
  25.     SetCommand=function(self)
  26.        
  27.         -- reset these values now, each time SetCommand() is called
  28.         steps, meter, difficulty = nil, nil, nil
  29.         song = GAMESTATE:GetCurrentSong()
  30.        
  31.         if song then
  32.            
  33.             -- we need to check the current steps of any human players
  34.             -- maybe only P1 is joined, maybe only P2 is joined, maybe both
  35.             for player in ivalues(GAMESTATE:GetHumanPlayers()) do
  36.                
  37.                 -- get the current steps for this player
  38.                 steps = GAMESTATE:GetCurrentSteps(player)
  39.                
  40.                 -- get the meter of this player's steps
  41.                 meter = steps:GetMeter()
  42.                
  43.                 -- Use Enum's reverse lookup functionality to find difficulty by index
  44.                 -- Beginner is 0, Easy is 1, Medium is 2, Hard is 3, Challenge is 4, and Edit is 5
  45.                 difficulty = Difficulty:Reverse()[steps:GetDifficulty()]
  46.                
  47.                 if meter >= glowDiff and difficulty >= 3 then
  48.                     -- the conditions have been met, so
  49.                     -- queue a Glow and return out of this function now
  50.                     self:queuecommand("Glow")
  51.                     return
  52.                 end
  53.             end
  54.         end
  55.        
  56.         -- if we get this far, then neither player's steps met conditions for glow
  57.         self:queuecommand("Hide")
  58.     end
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement