ZeroIP

Satisfracture Chart Code

Sep 23rd, 2021 (edited)
1,029
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.13 KB | None | 0 0
  1. function start (song)
  2. end
  3.  
  4. function update (elapsed)
  5.  
  6.     local currentBeat = (songPos / 1000)*(bpm/60)
  7.     hudX = getHudX()
  8.     hudY = getHudY()
  9.    
  10.     if sway then
  11.         camHudAngle = 5 * math.sin(currentBeat * 0.504)
  12.     end
  13.    
  14.     if quickdraw then
  15.         for i=0,7 do
  16.             setActorX(_G['defaultStrum'..i..'X'] + 32 * math.sin((currentBeat + i*2) * math.pi), i)
  17.             setActorY(_G['defaultStrum'..i..'Y'], i)
  18.         end
  19.     end
  20.  
  21.     if quickdraw2 then
  22.         for i=0,7 do
  23.             setActorX(_G['defaultStrum'..i..'X'], i)
  24.             setActorY(_G['defaultStrum'..i..'Y'] + 16 * math.sin((currentBeat + i*2) * math.pi), i)
  25.         end
  26.     end
  27.    
  28.     if quickdraw3 then
  29.         for i=0,3 do
  30.             setActorX(_G['defaultStrum'..i..'X'] + 32 * math.sin((currentBeat + i*2) * math.pi) + 700, i)
  31.             setActorY(_G['defaultStrum'..i..'Y'], i)
  32.         end
  33.         for i=4,7 do
  34.             setActorX(_G['defaultStrum'..i..'X'] + 32 * math.sin((currentBeat + i*2) * math.pi) - 550, i)
  35.             setActorY(_G['defaultStrum'..i..'Y'], i)
  36.         end
  37.     end
  38.    
  39.     if quickdraw4 then
  40.         for i=0,3 do
  41.             setActorX(_G['defaultStrum'..i..'X'] + 700, i)
  42.             setActorY(_G['defaultStrum'..i..'Y'], i)
  43.         end
  44.         for i=4,7 do
  45.             setActorX(_G['defaultStrum'..i..'X'] - 550, i)
  46.             setActorY(_G['defaultStrum'..i..'Y'] + 16 * math.sin((currentBeat + i) * math.pi), i)
  47.         end
  48.     end
  49.  
  50.     if crisscross then
  51.         for i=0,3 do
  52.             setActorX(_G['defaultStrum'..i..'X'] + 300 * math.sin(currentBeat * 0.503) + 350, i)
  53.         end
  54.         for i=4,7 do
  55.             setActorX(_G['defaultStrum'..i..'X'] - 300 * math.sin(currentBeat * 0.503) - 275, i)
  56.         end
  57.     end
  58.    
  59.     if crisscross2 then
  60.         for i=0,3 do
  61.             setActorX(_G['defaultStrum'..i..'X'] + 300 * math.sin(currentBeat * 0.504) + 350, i)
  62.             setActorY(_G['defaultStrum'..i..'Y'] + 16 * math.cos((currentBeat + i*5) * math.pi), i)
  63.         end
  64.         for i=4,7 do
  65.             setActorX(_G['defaultStrum'..i..'X'] - 300 * math.sin(currentBeat * 0.504) - 275, i)
  66.             setActorY(_G['defaultStrum'..i..'Y'] + 16 * math.cos((currentBeat + i*5) * math.pi), i)
  67.         end
  68.     end
  69.    
  70.     if speedy then
  71.         for i=0,7 do
  72.             setActorY(_G['defaultStrum'..i..'Y'] + 16 * math.cos(currentBeat + i), i)
  73.         end
  74.     end
  75. end
  76.  
  77. function beatHit (beat)
  78. end
  79.  
  80. function stepHit (step)
  81.  
  82.     -- Separate these by ranges instead of on certain steps
  83.     -- This is so that when steps are missed from lag, the effect still goes through
  84.    
  85.     -- fix for placement desync due to possible lag
  86.     if (step >= 578 and step < 600) or (step >= 706 and step < 760) and (step >= 840 and step < 896) or (step >= 1030 and step < 1144) then
  87.         for i=0,7 do
  88.             setActorX(_G['defaultStrum'..i..'X'],i)
  89.             setActorAngle(0, i)
  90.         end
  91.     end
  92.    
  93.    
  94.     -- "ENOUGH"
  95.     if step == 176 then
  96.         for i=0,3 do
  97.             tweenFadeOut(i, 0, 0.4)
  98.         end
  99.     end
  100.     if step == 188 then
  101.         showOnlyStrums = true
  102.     end
  103.     if step == 192 then
  104.         for i=0,7 do
  105.             tweenFadeIn(i, 1, 0.01)
  106.             showOnlyStrums = false
  107.         end
  108.     end
  109.    
  110.     -- Fade Out note timing
  111.     if step == 1120 then
  112.         for i=0,3 do
  113.             tweenFadeOut(i, 0, 1)
  114.         end
  115.     end
  116.     if step == 1146 then
  117.         tweenFadeOut(5, 0, 0.2)
  118.     end
  119.     if step == 1148 then
  120.         tweenFadeOut(6, 0, 0.2)
  121.     end
  122.     if step == 1150 then
  123.         tweenFadeOut(7, 0, 0.2)
  124.     end
  125.     if step == 1152 then
  126.         tweenFadeOut(4, 0, 3)
  127.         tweenPosXAngle(4, 600, 0, 2, 'setDefault')
  128.     end
  129.  
  130.  
  131.     -- Sway hud timing
  132.     if not sway and (step >= 192 and step < 320) or (step >= 448 and step < 576) or (step >= 832 and step < 1024) then
  133.         sway = true
  134.     elseif sway and (step >= 320 and step < 448) or (step >= 576 and step < 832) or (step >= 1024) then
  135.         sway = false
  136.         camHudAngle = 0
  137.     end
  138.    
  139.    
  140.     -- Quickdraw note timing
  141.     if not quickdraw and (step >= 320 and step < 448) then
  142.         quickdraw = true
  143.     elseif quickdraw and (step >= 448) then
  144.         quickdraw = false
  145.     end
  146.    
  147.     if not quickdraw2 and (step >= 448 and step < 576) then
  148.         quickdraw2 = true
  149.     elseif quickdraw2 and (step >= 576) then
  150.         quickdraw2 = false
  151.     end
  152.    
  153.     if not quickdraw3 and (step >= 960 and step < 992) then
  154.         quickdraw3 = true
  155.     elseif quickdraw3 and (step >= 992) then
  156.         quickdraw3 = false
  157.     end
  158.    
  159.     if not quickdraw4 and (step >= 992 and step < 1024) then
  160.         quickdraw4 = true
  161.     elseif quickdraw4 and (step >= 1024)  then
  162.         quickdraw4 = false
  163.     end
  164.    
  165.    
  166.     --Criss-Cross note timing
  167.     if (step >= 640 and step < 704) or (step >= 832 and step < 960) then
  168.         for i=0,3 do
  169.             tweenFadeOut(i, 0.3, 0.4)
  170.         end
  171.     end
  172.     if (step >= 704 and step < 832) or (step >= 960 and step < 1024) then
  173.         for i=0,3 do
  174.             tweenFadeIn(i, 1, 0.4)
  175.         end
  176.     end
  177.    
  178.     if not crisscross and (step >= 640 and step < 704) then
  179.         crisscross = true
  180.     elseif crisscross and (step >= 704 and step < 832) then
  181.         crisscross = false
  182.     end
  183.     if not crisscross2 and (step >= 832 and step < 960) then
  184.         crisscross2 = true
  185.     elseif crisscross2 and (step >= 960) then
  186.         crisscross2 = false
  187.     end
  188.  
  189.    
  190.    
  191.     -- Speedy note timing
  192.     if not speedy and (step >= 768 and step < 832) then
  193.         speedy = true
  194.     elseif speedy and (step >= 832) then
  195.         speedy = false
  196.     end
  197.    
  198.     -- spin transitions
  199.     if (step == 576) or (step == 704) or (step == 1024) then
  200.         for i=0,7 do
  201.             tweenPosXAngle(i, _G['defaultStrum'..i..'X'], getActorAngle(i) + 360, 0.2, 'setDefault')
  202.             setActorY(_G['defaultStrum'..i..'Y'] + 10, i)
  203.         end
  204.     end
  205. end
Add Comment
Please, Sign In to add comment