Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local steps, song, meter, difficulty
- local glowDiff = 14
- t[#t+1] = LoadActor( "dummy" )..{
- InitCommand=function(self) self:diffusealpha(0) end,
- OnCommand=function(self)
- self:Center()
- :FullScreen()
- :blend("BlendMode_Add")
- end,
- GlowCommand=function(self)
- self:diffuseshift()
- :effectcolor1(0,0,0,0)
- :effectcolor2(1,1,1,1)
- :effectperiod(2)
- end,
- HideCommand=function(self)
- self:linear(1)
- :diffusealpha(0)
- end,
- CurrentSongChangedMessageCommand=function(self) self:queuecommand("Set") end,
- ChangeStepsMessageCommand=function(self) self:queuecommand("Set") end
- SetCommand=function(self)
- -- reset these values now, each time SetCommand() is called
- steps, meter, difficulty = nil, nil, nil
- song = GAMESTATE:GetCurrentSong()
- if song then
- -- we need to check the current steps of any human players
- -- maybe only P1 is joined, maybe only P2 is joined, maybe both
- for player in ivalues(GAMESTATE:GetHumanPlayers()) do
- -- get the current steps for this player
- steps = GAMESTATE:GetCurrentSteps(player)
- -- get the meter of this player's steps
- meter = steps:GetMeter()
- -- Use Enum's reverse lookup functionality to find difficulty by index
- -- Beginner is 0, Easy is 1, Medium is 2, Hard is 3, Challenge is 4, and Edit is 5
- difficulty = Difficulty:Reverse()[steps:GetDifficulty()]
- if meter >= glowDiff and difficulty >= 3 then
- -- the conditions have been met, so
- -- queue a Glow and return out of this function now
- self:queuecommand("Glow")
- return
- end
- end
- end
- -- if we get this far, then neither player's steps met conditions for glow
- self:queuecommand("Hide")
- end
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement