-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSet Camera Bop.lua
52 lines (46 loc) · 1.16 KB
/
Set Camera Bop.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
local camBop = false
local camBopType = 1
local camBopMult = {0.015, 0.03}
function onEvent(n, v1, v2)
if n == 'Set Camera Bop' then
if not camBop then
camBop = true
setProperty('camZoomingMult', 0)
elseif camBop and (tostring(v2) == '' or tonumber(v2) == 0) then
camBop = false
camBopType = 1
end
if v1 ~= '' then
camBopMult = split(v1, ',')
else
camBopMult = {0.015, 0.03}
end
if v2 ~= '' then
camBopType = tonumber(v2)
end
end
end
function onBeatHit()
local camBops = {
[1] = function()
setProperty('camGame.zoom', getProperty('camGame.zoom') + tonumber(camBopMult[1]))
setProperty('camHUD.zoom', getProperty('camHUD.zoom') + tonumber(camBopMult[2]))
end,
[2] = function()
if curBeat % 2 == 0 then
setProperty('camGame.zoom', getProperty('camGame.zoom') + tonumber(camBopMult[1]))
setProperty('camHUD.zoom', getProperty('camHUD.zoom') + tonumber(camBopMult[2]))
end
end
}
if camBop then
camBops[camBopType]()
end
end
function split(s, delimiter)
result = {};
for match in (s..delimiter):gmatch("(.-)"..delimiter) do
table.insert(result, tostring(match));
end
return result;
end