local poptions = {GAMESTATE:GetPlayerState(0):GetPlayerOptions('ModsLevel_Song'),GAMESTATE:GetPlayerState(1):GetPlayerOptions('ModsLevel_Song')}
--local cond_f_result= FUCK_EXE
local cond_f_result= true

local function optional_actor(cond, actor)
	if cond then return actor end
	return Def.Actor{}
end

--These variables help with making things look nice regardless of resolution! -Kid
local tang_sdwidth_ratio = (480*(SCREEN_WIDTH/SCREEN_HEIGHT))/640
local tang_width_ratio = SCREEN_WIDTH/640
local tang_height_ratio = SCREEN_HEIGHT/480
tang_specialcrop = ((SCREEN_WIDTH - (SCREEN_HEIGHT*(4/3)))/2)/SCREEN_WIDTH
--I'll be amazed and/or impressed if you can get this ratio to be out of range. -Kid
if tang_specialcrop < -1 or tang_specialcrop > 1 then tang_specialcrop = 0 end

local tang_logden = math.log(0.5)--We're gonna do some logarithms to get what we want. -Kid

--This gives me functions that return the vertex tables for the ActorMultiVertexes. -Kid
LoadActor("3dwacky-lua.lua")
LoadActor("distort-lua.lua")
LoadActor("tang_twisty-lua.lua")
return Def.ActorFrame{
  Name= "actor_g",
  InitCommand= function(self)

sw = SCREEN_WIDTH
sh = SCREEN_HEIGHT

if not aftNumber then
aftNumber=1
else
aftNumber=aftNumber+1
end

	songName = GAMESTATE:GetCurrentSong():GetSongDir();

end,
  optional_actor(cond_f_result,
  Def.ActorFrame{
    Name= "actor_h",
    OnCommand= function(self)
	if not string.find(string.lower(PREFSMAN:GetPreference('VideoRenderers')), 'opengl')
	or string.find(string.lower(PREFSMAN:GetPreference('VideoRenderers')), 'd3d')
	and string.find(string.lower(PREFSMAN:GetPreference('VideoRenderers')), 'opengl')
	and string.find(string.lower(PREFSMAN:GetPreference('VideoRenderers')), 'd3d') <
	string.find(string.lower(PREFSMAN:GetPreference('VideoRenderers')), 'opengl') then
		SCREENMAN:SystemMessage('D3D Video Renderer detected. Expect textures to fail.');
	end
end,
    Def.Quad{
      Name= "actor_i",
      InitCommand= cmd(visible,false),
      OnCommand= cmd(sleep,1000),
    },
    LoadActor('modhelpers.lua') .. {
      Name= "actor_j",
      File= "modhelpers.lua",
    },
    Def.Quad{
      Name= "actor_k",
      InitCommand= cmd(visible,false),
      OnCommand= function(self)
			fgcurcommand = 1;

---------------------------------------------------------------------------------------
----------------------DON'T TOUCH IT KIDDO---------------------------------------------
---------------------------------------------------------------------------------------

			function list_compare(a,b)
				return a < b
			end

			checked = false;

			---------------------------------------------------------
			---------DOCUMENTATION-----------------------------------
			---------------------------------------------------------

			--function perframe( beat, endBeat )
				--return true if the current beat is between 'beat' and 'endBeat'

			--function mod_shader(beat,key,which)
				--turn on shader key at specified beat (up to 10 keys available, defined by 'which' = 0-9

			--function mod_insert(beat,len,mod,len_or_end,pn)
				--insert mod into beat mods table
			--function mod_insert2(time,len,mod,len_or_end,pn)
				--insert mod into time mods table

			--function mod_message(beat,msg,persistent)
				--insert something into the actions table.
				--msg can also be a function. If string, a message gets broadcast at that beat
				--if 'persistent' is true, message will run even if editor starts at a beat past it

			--function mod_blacklist(t,n)
				--check if number n occurs in table t
				--useful for doing 'every beat EXCEPT the contents of t'

			--function simple_m0d(beat,strength,mult,mod)
			--function simple_m0d2(beat,strength,mult,mod,pn)
			--function simple_m0d3(beat,strength,duration,bpm,mod,pn)
				--activate mods at specific beat but also deactivate them

			--function mod_wiggle(beat,num,div,amt,speed,mod,pn,first)
				--alternates a mod back and forth before resetting to 0

			--function mod_spring(beat,strength,num,mod,pn)
				--like mod_wiggle, but springier

			--function mod_springt(time,strength,dur,mod,pn)
				--time-based per-frame alternating mod that decreases based on how much time is left.
					--think doorstopper

			--function mod_springt2(time,strength,dur,mod,pn)
				--time-based per-frame alternating mod

			--function mod_spring_adjustable(beat,strength,num,period,mod,pn, first)
				--it's not very good

			--function mod_beat(beat,strength,pn)
				--turns on beat for the beat specified, at the desired strength

			--function switcheroo_add(beat,which,speed,len,pn)
				--adds a column swap at the desired beat
			--[[	switcheroos = {normal = {0,0}, ldur = {0,0}, reset = {0,0},
					flip = {100,0}, rudl = {100,0}, invert = {0,100}, dlru = {0,100},
					ludr = {25,-75}, rdul = {75,75}, drlu = {25,125}, ulrd = {75,-125}, urld = {100,-100}}
			]]



			---------------------------------------------------------
			---------DOCUMENTATION-----------------------------------
			---------------------------------------------------------

			function rotatePlayers(spd,xrot,yrot,zrot)
				if SCREENMAN:GetTopScreen():GetChild('PlayerP1') then
					P1:linear(spd)
					P1:rotationx(xrot)
					P1:rotationy(yrot)
					P1:rotationz(zrot)
				end

				if SCREENMAN:GetTopScreen():GetChild('PlayerP2') then
					P2:linear(spd)
					P2:rotationx(xrot)
					P2:rotationy(yrot)
					P2:rotationz(zrot)
				end

			end

			function hideNotefields(hideval)--Use booleans. -Kid
				if SCREENMAN:GetTopScreen():GetChild('PlayerP1') then
					SCREENMAN:GetTopScreen():GetChild('PlayerP1'):GetChild('NoteField'):visible(not hideval)
				end

				if SCREENMAN:GetTopScreen():GetChild('PlayerP2') then
					SCREENMAN:GetTopScreen():GetChild('PlayerP2'):GetChild('NoteField'):visible(not hideval)
				end

			end


			init_modsp1 = '2x';
			init_modsp2 = '2x';

			mod_plr = {nil, nil};--Ensure it works when only one player exists. -Kid

			mod_firstSeenBeat = GAMESTATE:GetSongBeat();

---------------------------------------------------------------------------------------
----------------------END DON'T TOUCH IT KIDDO-----------------------------------------
---------------------------------------------------------------------------------------





			--beat based mods
			--{beat_start, beat_end, mods, len_or_end, player_number}
			mods = {
				{0,9999,'*1000 -1000 cover,*5 2.5x,*2000 dizzyholds','end'},
				--{20,9999,'*1000 -1000 cover,*2 0 distant,*2000 50 zigzag,*100 spiralhold','end'},
				--{0,9999,'*5 2.5x,*100 300 bumpy,*1 0 bumpyperiod,*100 100 bumpyx,*1000 -10 bumpyxperiod,spiralholds','end'},
				--{0,9999,'*5 2.5x,*200 200 zigzag,*200 200 bumpyx,*2000 50 bumpyxperiod,*200 200 distant','end'},

				--{40,1,'*200 300 pulse','len'},
				--{40.2,2,'*5 0 pulse','len'},

				{323,349,'*.5 50 wave, *0.1 10 tornado','end'},
				{349,456,'*.7 120 wave,*0.1 10 brake, *0.15 25 tornado','end'},

				--Tiny is calculated differently between nITG and SM5. As a result, the magnitude
				--and rate must be recalculated to maintain the time it takes to go the distance. -Kid

				--Main changes:
				--*50  -100 tiny -> *29.25   -58.5 tiny (original distance of 1.0)
				--*17     0 tiny -> *9.945     0.0 tiny (original distance of 1.0)
				--*15     0 tiny -> *8.775     0.0 tiny (original distance of 1.0)
				--*50  -150 tiny -> *26.9    -80.7 tiny (original distance of 1.5)
				--*10  -150 tiny -> *5.38    -80.7 tiny (original distance of 1.5)
				--*10     0 tiny -> *5.38      0.0 tiny (original distance of 1.5)
				--*9.5    0 tiny -> *5.111     0.0 tiny (original distance of 1.5)
				--*7.5    0 tiny -> *4.035     0.0 tiny (original distance of 1.5)
				--*10  -200 tiny -> *5      -100.0 tiny (original distance of 2.0)
				--*10     0 tiny -> *5         0.0 tiny (original distance of 2.0)
				--*100 -300 tiny -> *44.067 -132.2 tiny (original distance of 3.0)
				--*0.3 -300 tiny -> *0.1322 -132.2 tiny (original distance of 3.0)
				--*6      0 tiny -> *2.644     0.0 tiny (original distance of 3.0)
				--*200 -400 tiny -> *79.25  -158.5 tiny (original distance of 4.0)
				--*100 -400 tiny -> *39.625 -158.5 tiny (original distance of 4.0)
				--*40  -400 tiny -> *15.8   -158.5 tiny (original distance of 4.0)
				--*40     0 tiny -> *15.85     0.0 tiny (original distance of 4.0)
				--*20     0 tiny -> *7.925     0.0 tiny (original distance of 4.0)
				--*16     0 tiny -> *6.34      0.0 tiny (original distance of 4.0)
				--*15     0 tiny -> *5.94      0.0 tiny (original distance of 4.0)
				--*100 -500 tiny -> *36.14  -180.7 tiny (original distance of 5.0)
				--*30     0 tiny -> *10.842    0.0 tiny (original distance of 5.0)

				{0.005,0.5,'*792.5 -158.5 tiny','len'},-- *2000 -> *792.5 -Kid
				{0.20,0.5,'*5.94 0 tiny','len'},

				{0.50-0.05,0.5,'*15.8 -158.5 tiny','len'},
				{0.70,0.5,'*5.94 0 tiny','len'},

				{0.50-0.05,0.5,'*15.8 -158.5 tiny','len'},
				{0.70,0.5,'*5.94 0 tiny','len'},

				--MoveX/Y mods start at 1. -Kid
				{1.00-0.1,0.5,'*15 100 movex1,*15 100 movey2,*15 -100 movey3,*15 -100 movex4','len'},
				{1.50-0.1,0.5,'*15 0 movex1,*15 0 movey2,*15 0 movey3,*15 0 movex4','len'},

				{1.75-0.05,0.5,'*15.8 -158.5 tiny','len'},
				{2.00-0.05,0.5,'*7.925 0 tiny','len'},
				{2.00-0.05,1,'*30 630 confusionoffset','len'},

				{2.50-0.05,1,'*40000 no confusionoffset','len'},
				{2.50-0.05,0.5,'*15.8 -158.5 tiny','len'},
				{2.70-0.05,0.5,'*5.94 0 tiny,*10000 no confusionoffset','len'},

				--MoveX/Y mods start at 1. -Kid
				{3.00-0.1,0.5,'*15 100 movex1,*15 100 movey2,*15 -100 movey3,*15 -100 movex4','len'},
				{3.50-0.1,0.5,'*15 0 movex1,*15 0 movey2,*15 0 movey3,*15 0 movex4','len'},

				{3.75-0.05,0.5,'*15.8 -158.5 tiny','len'},
				{3.90-0.05,0.5,'*5.94 0 tiny','len'},

				{4.25-0.05,0.5,'*15.8 -158.5 tiny','len'},
				{4.45-0.05,0.5,'*5.94 0 tiny','len'},

				----

				{5+0.00,0.5,'*15.8 -158.5 tiny','len'},
				{5+0.20,0.5,'*5.94 0 tiny','len'},

				{5+0.50-0.05,0.5,'*15.8 -158.5 tiny','len'},
				{5+0.70,0.5,'*5.94 0 tiny','len'},

				{5+0.50-0.05,0.5,'*15.8 -158.5 tiny','len'},
				{5+0.70,0.5,'*5.94 0 tiny','len'},

				--MoveX/Y mods start at 1. -Kid
				{5+1.00-0.1,0.5,'*15 100 movex1,*15 100 movey2,*15 -100 movey3,*15 -100 movex4','len'},
				{5+1.50-0.1,0.5,'*15 0 movex1,*15 0 movey2,*15 0 movey3,*15 0 movex4','len'},

				{5+1.75-0.05,0.5,'*15.8 -158.5 tiny','len'},
				{5+2.00-0.05,0.5,'*7.925 0 tiny','len'},
				{5+2.00-0.05,1,'*30 630 confusionoffset','len'},

				{5+2.50-0.05,1,'*40000 no confusionoffset','len'},
				{5+2.50-0.05,0.5,'*15.8 -158.5 tiny','len'},
				{5+2.70-0.05,0.5,'*5.94 0 tiny,*200000 no confusionoffset','len'},

				--MoveX/Y mods start at 1. -Kid
				{5+3.00-0.1,0.5,'*15 100 movex1,*15 100 movey2,*15 -100 movey3,*15 -100 movex4','len'},
				{5+3.50-0.1,0.5,'*15 0 movex1,*15 0 movey2,*15 0 movey3,*15 0 movex4','len'},

				{5+3.75-0.05,0.5,'*15.8 -158.5 tiny','len'},
				{5+3.90-0.05,0.5,'*5.94 0 tiny','len'},

				{5+4.25-0.05,0.5,'*15.8 -158.5 tiny','len'},
				{5+4.45-0.05,0.5,'*5.94 0 tiny','len'},

				{7.30,3,'*100 stealth','len'},
				{7.40,3,'*1000 0.3x,*20000 2500 boost,*2 50 stealth,*200 30 shrinklinear','len'},
				{7.80,3,'*1000 0.3x,*1 stealth','len'},
				{9.00,4,'*1000 2.5x,*200000 no boost,*2000 no shrinklinear,*2000 no stealth','len'},
				----
				{10+0.00,0.5,'*15.8 -158.5 tiny','len'},
				{10+0.20,0.5,'*5.94 0 tiny','len'},

				{10+0.50-0.05,0.5,'*15.8 -158.5 tiny','len'},
				{10+0.70,0.5,'*5.94 0 tiny','len'},

				{10+0.50-0.05,0.5,'*15.8 -158.5 tiny','len'},
				{10+0.70,0.5,'*5.94 0 tiny','len'},

				--MoveX/Y mods start at 1. -Kid
				{10+1.00-0.1,0.5,'*15 100 movex1,*15 100 movey2,*15 -100 movey3,*15 -100 movex4','len'},
				{10+1.50-0.1,0.5,'*15 0 movex1,*15 0 movey2,*15 0 movey3,*15 0 movex4','len'},

				{10+1.75-0.05,0.5,'*15.8 -158.5 tiny','len'},
				{10+2.00-0.05,0.5,'*7.925 0 tiny','len'},
				{10+2.00-0.05,1,'*30 630 confusionoffset','len'},

				{10+2.50-0.05,1,'*40000 no confusionoffset','len'},
				{10+2.50-0.05,0.5,'*15.8 -158.5 tiny','len'},
				{10+2.70-0.05,0.5,'*5.94 0 tiny,*200000 no confusionoffset','len'},

				--MoveX/Y mods start at 1. -Kid
				{10+3.00-0.1,0.5,'*15 100 movex1,*15 100 movey2,*15 -100 movey3,*15 -100 movex4','len'},
				{10+3.50-0.1,0.5,'*15 0 movex1,*15 0 movey2,*15 0 movey3,*15 0 movex4','len'},

				{10+3.75-0.05,0.5,'*15.8 -158.5 tiny','len'},
				{10+3.90-0.05,0.5,'*5.94 0 tiny','len'},

				{10+4.25-0.05,0.5,'*15.8 -158.5 tiny','len'},
				{10+4.45-0.05,0.5,'*5.94 0 tiny','len'},
				----
				{15+0.00,0.5,'*15.8 -158.5 tiny','len'},
				{15+0.20,0.5,'*5.94 0 tiny','len'},

				{15+0.50-0.05,0.5,'*15.8 -158.5 tiny','len'},
				{15+0.70,0.5,'*5.94 0 tiny','len'},

				{15+0.50-0.05,0.5,'*15.8 -158.5 tiny','len'},
				{15+0.70,0.5,'*5.94 0 tiny','len'},

				--MoveX/Y mods start at 1. -Kid
				{15+1.00-0.1,0.5,'*15 100 movex1,*15 100 movey2,*15 -100 movey3,*15 -100 movex4','len'},
				{15+1.50-0.1,0.5,'*15 0 movex1,*15 0 movey2,*15 0 movey3,*15 0 movex4','len'},

				{15+1.75-0.05,0.5,'*15.8 -158.5 tiny','len'},
				{15+2.00-0.05,0.5,'*7.925 0 tiny','len'},
				{15+2.00-0.05,1,'*30 630 confusionoffset','len'},

				{15+2.50-0.05,1,'*40000 no confusionoffset','len'},
				{15+2.50-0.05,0.5,'*15.8 -158.5 tiny','len'},
				{15+2.70-0.05,0.5,'*5.94 0 tiny,*200000 no confusionoffset','len'},

				--MoveX/Y mods start at 1. -Kid
				{15+3.00-0.1,0.5,'*15 100 movex1,*15 100 movey2,*15 -100 movey3,*15 -100 movex4','len'},
				{15+3.50-0.1,0.5,'*15 0 movex1,*15 0 movey2,*15 0 movey3,*15 0 movex4','len'},

				{15+3.75-0.05,0.5,'*15.8 -158.5 tiny','len'},
				{15+3.90-0.05,0.5,'*5.94 0 tiny','len'},

				{15+4.25-0.05,0.5,'*15.8 -158.5 tiny','len'},
				{15+4.45-0.05,0.5,'*5.94 0 tiny','len'},

				--{20.00,10,'*100 50 tanbumpyxperiod','len'},
				--{20.00,1,'*100 -50 tanbumpyx','len'},
				--{21.00,1,'*100 0 tanbumpyx','len'},

				--{20.00,10,'*100 50 zigzagperiod','len'},
				--{20.00,1,'*100 200 zigzag','len'},

				{20.00,5,'*10 155 confusionoffset,*5.38 -80.7 tiny,*200 dizzyholds','len'},

				{23.50,50+3,'*10000 1000% Sudden, *10000 200% SuddenOffset','end'},--Deal with Reverse. -Kid
				{50+3,0.100,'*10000 no Sudden, *10000 no SuddenOffset','len'},--Don't keep it on forever. -Kid

				--Column-Reverse mods start at 1. -Kid
				{23.750,3,'*5 reverse1,*5 reverse2','len'},
				{24.250,3,'*5 reverse3,*5 reverse4','len'},
				{24.750,3,'*5 0 reverse1,*5 0 reverse2,*5 0 reverse3,*5 0 reverse4','len'},

				{20.00,5,'*10 155 confusionoffset,*5.38 -80.7 tiny,*200 dizzyholds','len'},
				--{21.00,5,'*10 -100 confusionyoffset','len'},
				--{22.10,2,'*10 0 dizzy','len'},
				{25.00,3,'*10 0 confusionoffset,*5.38 0 tiny,*200 dizzyholds','len'},

				--Column-Reverse mods start at 1. -Kid
				{28.750,3,'*5 reverse4,*5 reverse2','len'},
				{29.250,3,'*5 reverse1,*5 reverse3','len'},
				{29.750,3,'*5 0 reverse1,*5 0 reverse2,*5 0 reverse3,*5 0 reverse4','len'},

				{30.00,5,'*10 155 confusionoffset,*5.38 -80.7 tiny,*200 dizzyholds','len'},

				--Column-Reverse mods start at 1. -Kid
				{33.750,3,'*5 reverse1,*5 reverse4','len'},
				{34.250,3,'*5 reverse3,*5 reverse2','len'},
				{34.750,3,'*5 0 reverse1,*5 0 reverse2,*5 0 reverse3,*5 0 reverse4','len'},

				{35.00,3,'*10 0 confusionoffset,*5.38 0 tiny,*200 dizzyholds','len'},

				{37.50,4,'*90000 10000 drunkspeed','len'},
				{37.50,1,'*1 drunk,*2 50 stealth','len'},

				--Column-Reverse mods start at 1. -Kid
				{38.750,3,'*5 reverse1,*5 reverse4','len'},
				{39.250,3,'*5 reverse3,*5 reverse2','len'},
				{39.750,3,'*5 0 reverse1,*5 0 reverse2,*5 0 reverse3,*5 0 reverse4','len'},

				{41.000,4,'*5 -100 tiny','len'},

				--Column-Reverse mods start at 1. -Kid
				{43.750,3,'*5 reverse2,*5 reverse3','len'},
				{44.250,3,'*5 reverse1,*5 reverse4','len'},
				{44.750,3,'*5 0 reverse1,*5 0 reverse2,*5 0 reverse3,*5 0 reverse4','len'},

				{46.000,4,'*5 0 tiny','len'},
				{45.000,12,'*0.2 -1000000 confusion','len'},

				--Column-Reverse mods start at 1. -Kid
				{48.750,3,'*5 reverse3,*5 reverse4','len'},
				{49.250,3,'*5 reverse1,*5 reverse2','len'},
				{49.750,3,'*5 0 reverse1,*5 0 reverse2,*5 0 reverse3,*5 0 reverse4','len'},

				{49.50,1,'*200 50 stealth,*20000 2000 dizzy','len'},
				{49.80,1,'*200 0 stealth,*20000 0 dizzy','len'},

				{55,3,'*5000 no confusion','len'},

				{52.50,2.5,'*1.5 100 stealth,*99999 no drunkspeed','len'},
				{53.50,30,'*1 1.5x,*2000 sudden,*2000 50 suddenoffset','len'},

				{54.50,92,'*90000 10000 drunkspeed','end'},
				{55.00-0.1,1,'*1 drunk','len'},

				{55.00,1,'*79.25 -158.5 tiny,*200 no stealth','len'},
				{55.10,1,'*7.925 0 tiny','len'},

				{55.75,1,'*79.25 -158.5 tiny','len'},
				{55.85,1,'*7.925 0 tiny','len'},

				{56.50,1,'*79.25 -158.5 tiny','len'},
				{56.60,1,'*7.925 0 tiny','len'},

				{57.00,1,'*79.25 -158.5 tiny','len'},
				{57.10,1,'*7.925 0 tiny','len'},

				--

				{59.50,1,'*200 50 stealth,*20000 2000 dizzy','len'},
				{59.80,1,'*200 0 stealth,*20000 0 dizzy','len'},

				{65.00-0.1,1,'*1 drunk','len'},

				{69.50,1,'*200 50 stealth,*20000 2000 dizzy','len'},
				{69.80,1,'*200 0 stealth,*20000 0 dizzy','len'},


				{75.00-0.1,1,'*1 drunk','len'},


				{79.50,1,'*200 50 stealth,*20000 2000 dizzy','len'},
				{79.80,1,'*200 0 stealth,*20000 0 dizzy','len'},

				{53.50+30,95.00,'*10000 1000% Sudden, *10000 160% SuddenOffset','end'},--Makes it so arrows don't overlap. -Kid
				{95.00,0.100,'*10000 no Sudden, *10000 no SuddenOffset','len'},--But turn it off afterward. -Kid
				{143,149,'*10000 1000% Sudden, *10000 160% SuddenOffset','end'},--One last run of Sudden. -Kid
				{148.4,149,'*10000 1000% Sudden, *1.3 -200% SuddenOffset','end'},--One last run of Sudden. -Kid
				{149,0.100,'*10000 no Sudden, *10000 no SuddenOffset','len'},--And we're done. -Kid.

				{85.00-0.1,1,'*1 drunk','len'},
				{85.000,12,'*0.1 -1000000 confusion,*1000 dizzyholds,*1 0 tandrunk','len'},

				{89.50,1,'*200 50 stealth,*20000 2000 dizzy','len'},
				{89.80,1,'*200 0 stealth,*20000 0 dizzy','len'},



				--[[{57.50,5,'*30 750 movey2,*1000 no movey1','len'},
				--]]
				{64.00,1,'*10 flip,*20 30 stealth','len'},
				{64.50,1,'*10 0 flip,*20 no stealth','len'},
				{94,1,'*20 invert,*999999 no drunkspeed','len'},
				{94.5,1,'*20 no invert','len'},

				{84.00,1,'*10 flip,*20 30 stealth','len'},
				{84.50,1,'*10 0 flip,*20 no stealth','len'},

				{95,149,'0.1 bumpy','end'},
				{95,5,'*10000 no confusion','len'},
				{301,349,'0.1 bumpy','end'},

				{143,6,'*0.3 200 mini, *0.075 50 reverse','len'},
				{149,0.5,'*100000 no mini, *100000 no reverse','len'},
				--{149,5,'*100000 1x','len'},

				{117-.05,0.5,'*10 invert','len'},
				{117.5-(1/192)-.05,0.5,'*10 no invert','len'},
				{118-(2/192)-.05,0.5,'*10 flip','len'},
				{118.5-(3/192)-.05,0.5,'*10 no flip','len'},

				{141-.05,0.5,'*10 invert','len'},
				{141.5-(1/192)-.05,0.5,'*10 no invert','len'},
				{142-(2/192)-.05,0.5,'*10 flip','len'},
				{142.5-(3/192)-.05,0.5,'*10 no flip','len'},

				--{161,50,'*1 20 tandrunk','len'},

				--[[
				{165.0,5,'*10 300 movey3,*2 dark,*100 stealth','len'},
				{165.1,5,'*4 300 movey0','len'},
				{165.2,5,'*7 300 movey1','len'},
				{165.3,5,'*11 300 movey2','len'},
				{167.0,5,'*100 0 movey0,*100 0 movey1,*100 0 movey2,*100 0 movey3,*2 no dark,*5 no stealth','len'},
				--]]

				{300,349,'*11 10 stealth','end'},

				{323-.05,0.5,'*10 invert','len'},
				{323.5-(1/192)-.05,0.5,'*10 no invert','len'},
				{324-(2/192)-.05,0.5,'*10 flip','len'},
				{324.5-(3/192)-.05,0.5,'*10 no flip','len'},

				{347-.05,0.5,'*10 invert','len'},
				{347.5-(1/192)-.05,0.5,'*10 no invert','len'},
				{348-(2/192)-.05,0.5,'*10 flip','len'},
				{348.5-(3/192)-.05,0.5,'*10 no flip','len'},

				{389,100,'*4 1.4x','len'},
				{478,100,'*0.1322 -132.2 tiny','len'},



				{325,200,'*0.05 5 flip, *0.5 1.7x','len'},

			}
			--fuck=SCREENMAN:GetTopScreen():GetChild('PlayerP1'):GetChild('NoteField')
			--[[
			for i=0,15 do
				table.insert(mods,{(3*i)+96.5-.05,0.5,'*10 flip','len'});
				table.insert(mods,{(3*i)+97-.05,0.5,'*10 no flip','len'});
			end
			]]



			for i=0,4*5,4 do
				table.insert(mods,{213.0+i,0.5,'*100 100 mini','len'})
				table.insert(mods,{213.1+i,1,'*4 0 mini','len'})

				table.insert(mods,{214.0+i,0.5,'*400 300 drunk,*44.067 -132.2 tiny','len'})
				table.insert(mods,{214.2+i,2,'*6 0 drunk,*2.644 no tiny','len'})

				table.insert(mods,{215.5+i,0.5,'*100 100 mini','len'})
				table.insert(mods,{215.6+i,1,'*4 0 mini','len'})
				table.insert(mods,{216.0+i,0.5,'*400 -300 drunk,*44.067 -132.2 tiny','len'})
				table.insert(mods,{216.2+i,2,'*6 0 drunk,*2.644 no tiny','len'})

				table.insert(mods,{32+213.0+i,0.5,'*100 100 mini','len'})
				table.insert(mods,{32+213.1+i,1,'*4 0 mini','len'})

				table.insert(mods,{32+214.0+i,0.5,'*400 300 drunk,*44.067 -132.2 tiny','len'})
				table.insert(mods,{32+214.2+i,2,'*6 0 drunk,*2.644 no tiny','len'})

				table.insert(mods,{32+215.5+i,0.5,'*100 100 mini','len'})
				table.insert(mods,{32+215.6+i,1,'*4 0 mini','len'})
				table.insert(mods,{32+216.0+i,0.5,'*400 -300 drunk,*44.067 -132.2 tiny','len'})
				table.insert(mods,{32+216.2+i,2,'*6 0 drunk,*2.644 no tiny','len'})
			end

			for i=0,3,1 do
				table.insert(mods,{237.0+i,0.5,'*39.625 -158.5 tiny','len'})
				table.insert(mods,{237.1+i,1,'*6.34 0 tiny','len'})

				table.insert(mods,{241.0+i,0.5,'*100 100 mini','len'})
				table.insert(mods,{241.1+i,1,'*4 0 mini','len'})

				table.insert(mods,{241.5+i,0.5,'*40 1000 tipsy','len'})
				table.insert(mods,{241.75+i,0.5,'*40 0 tipsy','len'})

				table.insert(mods,{32+237.0+i,0.5,'*39.625 -158.5 tiny','len'})
				table.insert(mods,{32+237.1+i,1,'*6.34 0 tiny','len'})

				table.insert(mods,{32+241.0+i,0.5,'*100 100 mini','len'})
				table.insert(mods,{32+241.1+i,1,'*4 0 mini','len'})

				table.insert(mods,{32+241.5+i,0.5,'*40 1000 tipsy','len'})
				table.insert(mods,{32+241.75+i,0.5,'*40 0 tipsy','len'})

				if i<3 then
				table.insert(mods,{277.0+i,0.5,'*400 50 stealth,*36.14 -180.7 tiny','len'})
				table.insert(mods,{277.2+i,0.5,'*1 0 stealth,*10.842 no tiny','len'})

				table.insert(mods,{280+i,0.5,'*100 100 mini','len'})
				table.insert(mods,{280.1+i,1,'*4 0 mini','len'})

				table.insert(mods,{280.5+i,0.5,'*40 1000 tipsy','len'})
				table.insert(mods,{280.75+i,0.5,'*40 0 tipsy','len'})



				table.insert(mods,{283.0+i,0.5,'*400 50 stealth,*36.14 -180.7 tiny','len'})
				table.insert(mods,{283.2+i,0.5,'*1 0 stealth,*10.842 no tiny','len'})

				table.insert(mods,{286+i,0.5,'*100 100 mini','len'})
				table.insert(mods,{286.1+i,1,'*4 0 mini','len'})

				table.insert(mods,{286.5+i,0.5,'*40 1000 tipsy','len'})
				table.insert(mods,{286.75+i,0.5,'*40 0 tipsy','len'})



				table.insert(mods,{289.0+i,0.5,'*400 50 stealth,*36.14 -180.7 tiny','len'})
				table.insert(mods,{289.2+i,0.5,'*1 0 stealth,*10.842 no tiny','len'})

				table.insert(mods,{292+i,0.5,'*100 100 mini','len'})
				table.insert(mods,{292.1+i,1,'*4 0 mini','len'})

				table.insert(mods,{292.5+i,0.5,'*40 1000 tipsy','len'})
				table.insert(mods,{292.75+i,0.5,'*40 0 tipsy','len'})



				table.insert(mods,{295.0+i,0.5,'*400 50 stealth,*36.14 -180.7 tiny','len'})
				table.insert(mods,{295.2+i,0.5,'*1 0 stealth,*10.842 no tiny','len'})

				table.insert(mods,{298+i,0.5,'*100 100 mini','len'})
				table.insert(mods,{298.1+i,1,'*4 0 mini','len'})

				table.insert(mods,{298.5+i,0.5,'*40 1000 tipsy','len'})
				table.insert(mods,{298.75+i,0.5,'*40 0 tipsy','len'})

				end

			end

			--mod_spring_adjustable(beat,strength,num,period,mod,pn)
			--mod_spring_adjustable(95,800,24,0.75,'bumpy');

			--function mod_wiggle(beat,num,div,amt,mod,pn,first)
			--mod_wiggle(95,150,2,100,'expand');

			for i=0,7 do
				mod_spring_adjustable(95+(6*i),200,8,0.75,'tipsy');
				mod_spring_adjustable(97+(6*i),200,8,0.5,'drunk');
				simple_m0d(99+(6*i),600*tang_sdwidth_ratio,0.8,'bumpy');--Scale Bumpy. -Kid
			end

			table.insert(mods,{117,4,'*1000 0.1 bumpy','len'});
			table.insert(mods,{141,4,'*1000 0.1 bumpy','len'});

			for i=1,6 do
				table.insert(mods,{i*2.5+55.00,1,'*79.25 -158.5 tiny','len'})
				table.insert(mods,{i*2.5+55.10,1,'*7.925 0 tiny','len'})

				table.insert(mods,{i*2.5+55.75,1,'*79.25 -158.5 tiny','len'})
				table.insert(mods,{i*2.5+55.85,1,'*7.925 0 tiny','len'})

				table.insert(mods,{i*2.5+56.50,1,'*79.25 -158.5 tiny','len'})
				table.insert(mods,{i*2.5+56.60,1,'*7.925 0 tiny','len'})

				table.insert(mods,{i*2.5+57.00,1,'*79.25 -158.5 tiny','len'})
				table.insert(mods,{i*2.5+57.10,1,'*7.925 0 tiny','len'})

				if i==6 then
				table.insert(mods,{72.00,1,'*79.25 -158.5 tiny','len'})
				table.insert(mods,{72.10,1,'*7.925 0 tiny','len'})

				table.insert(mods,{72.50,1,'*79.25 -158.5 tiny','len'})
				table.insert(mods,{72.60,1,'*7.925 0 tiny','len'})

				table.insert(mods,{73.25,1,'*79.25 -158.5 tiny','len'})
				table.insert(mods,{73.35,1,'*7.925 0 tiny','len'})

				table.insert(mods,{74.00,1,'*79.25 -158.5 tiny','len'})
				table.insert(mods,{74.10,1,'*15.85 0 tiny','len'})
				table.insert(mods,{74.25,1,'*79.25 -158.5 tiny','len'})
				table.insert(mods,{74.35,1,'*15.85 0 tiny','len'})
				table.insert(mods,{74.50,1,'*79.25 -158.5 tiny','len'})
				table.insert(mods,{74.60,1,'*15.85 0 tiny','len'})
				table.insert(mods,{74.75,1,'*79.25 -158.5 tiny','len'})
				table.insert(mods,{74.85,1,'*15.85 0 tiny','len'})
				end
			end

			for i=8,14 do
				table.insert(mods,{i*2.5+55.00,1,'*79.25 -158.5 tiny','len'})
				table.insert(mods,{i*2.5+55.10,1,'*7.925 0 tiny','len'})

				table.insert(mods,{i*2.5+55.75,1,'*79.25 -158.5 tiny','len'})
				table.insert(mods,{i*2.5+55.85,1,'*7.925 0 tiny','len'})

				table.insert(mods,{i*2.5+56.50,1,'*79.25 -158.5 tiny','len'})
				table.insert(mods,{i*2.5+56.60,1,'*7.925 0 tiny','len'})

				table.insert(mods,{i*2.5+57.00,1,'*79.25 -158.5 tiny','len'})
				table.insert(mods,{i*2.5+57.10,1,'*7.925 0 tiny','len'})




			end



			for i=0,5*7,5 do

				table.insert(mods,{i+349.00-.0,1,'*500 50 stealth','len'})
				table.insert(mods,{i+349.20-.0,1,'*1 0 stealth','len'})

				table.insert(mods,{i+349.00-.1,0.5,'*26.9 -80.7 tiny','len'})
				table.insert(mods,{i+349.10-.0,0.5,'*4.035 0 tiny','len'})

				table.insert(mods,{i+349.75-.1,0.5,'*26.9 -80.7 tiny','len'})
				table.insert(mods,{i+349.85-.0,0.5,'*4.035 0 tiny','len'})

				table.insert(mods,{i+350.50-.1,0.5,'*29.25 -58.5 tiny','len'})
				table.insert(mods,{i+350.60-.0,0.5,'*8.775 0 tiny','len'})
				table.insert(mods,{i+351.00-.1,0.5,'*29.25 -58.5 tiny','len'})
				table.insert(mods,{i+351.10-.0,0.5,'*8.775 0 tiny','len'})

				table.insert(mods,{i+351.50-.1,0.5,'*26.9 -80.7 tiny','len'})
				table.insert(mods,{i+351.60-.0,0.5,'*4.035 0 tiny','len'})

				table.insert(mods,{i+352.25-.1,0.5,'*26.9 -80.7 tiny','len'})
				table.insert(mods,{i+352.35-.0,0.5,'*4.035 0 tiny','len'})

				table.insert(mods,{i+353.00-.1,0.5,'*29.25 -58.5 tiny','len'})
				table.insert(mods,{i+353.00-.0,0.5,'*8.775 0 tiny','len'})
				table.insert(mods,{i+353.50-.1,0.5,'*29.25 -58.5 tiny','len'})
				table.insert(mods,{i+353.60-.0,0.5,'*8.775 0 tiny','len'})


				table.insert(mods,{i+389.00-.0,1,'*500 50 stealth','len'})
				table.insert(mods,{i+389.20-.0,1,'*2 0 stealth','len'})

				table.insert(mods,{i+389.00-.1,0.5,'*26.9 -80.7 tiny','len'})
				table.insert(mods,{i+389.10-.0,0.5,'*5.111 0 tiny','len'})

				table.insert(mods,{i+389.75-.1,0.5,'*26.9 -80.7 tiny','len'})
				table.insert(mods,{i+389.85-.0,0.5,'*5.111 0 tiny','len'})

				table.insert(mods,{i+390.50-.1,0.5,'*29.25 -58.5 tiny','len'})
				table.insert(mods,{i+390.60-.0,0.5,'*9.945 0 tiny','len'})
				table.insert(mods,{i+391.00-.1,0.5,'*29.25 -58.5 tiny','len'})
				table.insert(mods,{i+391.10-.0,0.5,'*9.945 0 tiny','len'})

				table.insert(mods,{i+391.50-.1,0.5,'*26.9 -80.7 tiny','len'})
				table.insert(mods,{i+391.60-.0,0.5,'*5.111 0 tiny','len'})

				table.insert(mods,{i+392.25-.1,0.5,'*26.9 -80.7 tiny','len'})
				table.insert(mods,{i+392.35-.0,0.5,'*5.111 0 tiny','len'})

				table.insert(mods,{i+393.00-.1,0.5,'*29.25 -58.5 tiny','len'})
				table.insert(mods,{i+393.00-.0,0.5,'*9.945 0 tiny','len'})
				table.insert(mods,{i+393.50-.1,0.5,'*29.25 -58.5 tiny','len'})
				table.insert(mods,{i+393.60-.0,0.5,'*9.945 0 tiny','len'})

			end

			for i=0,4,2 do

				--Scale Bumpy. -Kid
				table.insert(mods,{i+468,0.5,'*500 50 stealth,*'..100*tang_sdwidth_ratio..' '..300*tang_sdwidth_ratio..' bumpy','len'})
				table.insert(mods,{i+468.2,1,'*5 0 stealth,*'..15*tang_sdwidth_ratio..' no bumpy','len'})

				table.insert(mods,{i+468.625,0.5,'*500 300 drunk','len'})
				table.insert(mods,{i+468.725,1,'*20 0 drunk','len'})

				table.insert(mods,{i+469.250,0.5,'*500 -300 drunk','len'})
				table.insert(mods,{i+469.350,1,'*20 0 drunk','len'})

				table.insert(mods,{i+469.625,0.5,'*500 300 tipsy','len'})
				table.insert(mods,{i+469.725,1,'*20 0 tipsy','len'})

			end

				--Replaced with perframe function. I'm not gonna deal with this. -Kid
				--table.insert(mods,{92.00+.5,1,'*200 -800 tiny','len'})
				--table.insert(mods,{92.10+.5,1,'*30 200 tiny','len'})

				--table.insert(mods,{92.75+.5,1,'*200 -800 tiny','len'})
				--table.insert(mods,{92.85+.5,1,'*30 200 tiny','len'})

				--table.insert(mods,{93.50+.5,1,'*200 -800 tiny','len'})
				--table.insert(mods,{93.60+.5,1,'*40 200 tiny','len'})

				--table.insert(mods,{94.00+.5,1,'*200 -800 tiny','len'})
				--table.insert(mods,{94.10+.5,1,'*40 0 tiny','len'})

			--mod_wiggle(95,8,1/6,1000,'dizzy');
			--function mod_wiggle(beat,num,div,amt,speed,mod,pn,first)
			mod_wiggle(119,4,1/6,1000,2,'dizzy');

			for i=0,7 do
				mod_wiggle(161+(16*i),8,2,100+(10*i),1,'wave');
			end

			for i=0,2 do
				--mod_wiggle(280+(6*i),6,2,100,'wave');
				mod_wiggle(280+(6*i),6,2,100,1,'boost');
			end

			--for i=0,3 do
			--table.insert(mods,{161,300,'*10000 -100 translatez'..i..'','end'})
			--end

			for i=0,7 do
				mod_spring_adjustable(301+(6*i),200,8,0.75,'tipsy');
				mod_spring_adjustable(303+(6*i),200,8,0.5,'drunk');
				simple_m0d(305+(6*i),600*tang_sdwidth_ratio,0.8,'bumpy');--Scale bumpy. -Kid
			end



			--switcheroo_add(beat,which,speed,len,pn)
			switcheroo_add(151,'flip',2.5,6)
			switcheroo_add(155,'normal',2.5,6)



			switcheroo_add(16+151,'urld',2.5,6)
			switcheroo_add(16+155,'normal',2.5,6)





			switcheroo_add(32+151,'flip',2.5,6)
			switcheroo_add(32+155,'normal',2.5,6)





			switcheroo_add(32+16+151,'urld',2.5,6)
			switcheroo_add(32+16+155,'normal',2.5,6)






			switcheroo_add(64+161-.1,'rdul',10,2)
			switcheroo_add(64+162-.1,'rudl',10,2)
			switcheroo_add(64+163-.1,'ludr',10,2)
			switcheroo_add(64+164-.1,'normal',10,2)

			switcheroo_add(64+32+161-.1,'ldur',10,2)
			switcheroo_add(64+32+162-.1,'rudl',10,2)
			switcheroo_add(64+32+163-.1,'rdul',10,2)
			switcheroo_add(64+32+164-.1,'normal',10,2)




			table.insert(mods,{323,4,'*1000 0.1 bumpy','len'});
			table.insert(mods,{347,4,'*1000 0.1 bumpy','len'});

			--time based mods
			mod_time = 0;
			--{time_start, time_end, mods, len_or_end, player_number}
			mods2 = {
			--{0,200,'3x','end',1},
			}

			--SCREAMING GUMBALL / timed message broadcaster
			--they no longer have to be in order, because they're sorted now
			curmessage = 1;
			--{beat,message,persists}
			mod_messages = {
			{161,'DoDistortBounce'},
			{177,'DoDistortBounce'},
			{193,'DoDistortBounce'},
			{209,'DoDistortBounce'},
			}

			curaction = 1;
			--{beat,message,persists}
			mod_actions = {

				{0.1,function()

					MESSAGEMAN:Broadcast('MakeProxy');
					MESSAGEMAN:Broadcast("ProxyThis")

					if P1 then
					P1:visible(true)
					P1WRAP:zoomz(4)--Here's the abuse. -Kid
					P1:x(SCREEN_CENTER_X-160*tang_width_ratio)--Scale positions. -Kid
					P1:rotationx(0)
					P1:GetChild('NoteField'):visible(true)
					end

					if P2 then
					P2:visible(true)
					P2WRAP:zoomz(4)
					P2:x(SCREEN_CENTER_X+160*tang_width_ratio)--Set P2's position. -Kid
					P2:rotationx(0)
					P2:GetChild('NoteField'):visible(true)
					end
					for i=1,6 do
					_G['P1proxy'..7-i]:visible(false)
					_G['P2proxy'..7-i]:visible(false)
					_G['P1proxyp'..7-i]:visible(false)--Included proxies in AFT. -Kid
					_G['P2proxyp'..7-i]:visible(false)
					end
				end,true},

				{5,function()

				P1origX=P1 and P1:GetX() or SCREEN_CENTER_X - 160*tang_width_ratio--Do not break if only two players exist. -Kid
				P1origY=P1 and P1:GetY() or SCREEN_CENTER_Y
				P2origX=P2 and P2:GetX() or SCREEN_CENTER_X + 160*tang_width_ratio
				P2origY=P2 and P2:GetY() or SCREEN_CENTER_Y

					tang_blurry:visible(false)
					tang_blurry:zoom(1.005)
					tang_blurry:diffusealpha(1)
					tang_blurry:SetTexture(ball_tex:GetTexture());

					tang_blurryprox:visible(false)--Included proxies in AFT. -Kid
					tang_blurryprox:diffusealpha(1)



				for i=1,4 do
					--_G['P1proxy'..i]:z(50-50*i)
					--_G['P1proxy'..i]:zoom(1+0.05*i-0.05)
					--_G['P1proxy'..i]:wag()
					--_G['P1proxy'..i]:addy(10*i)
					--_G['P1proxy'..i]:visible(false)
					--_G['P1proxy'..i]:effectmagnitude(30,0,0)
					--_G['P1proxy'..i]:effectoffset(0.1*i-0.1)

				end

					--_G['P1proxy5']:visible(false)
					--_G['P1proxy6']:visible(false)

					--_G['P1proxy5']:rotationx(-50)
					--_G['P1proxy6']:rotationx(-50)

				--for i=1,P1:GetNumChildren() do
				--P1:GetChild('NoteField'):visible(true)
				--Trace( 'Actor ass has '..P1:GetChild('NoteField'):GetNumChildren()..' children');
				--end
				end,true},

				{21,function()
					rotatePlayers(0.1,0,50,0)
				end},

				{26,function()
					rotatePlayers(0.1,0,0,0)
				end},

				{31,function()
					rotatePlayers(0.1,0,-50,0)
				end},

				{36,function()
					rotatePlayers(0.1,0,0,0)
				end},

				{40,function()
					for pn=1,2 do
						local a = _G['P'..pn]
						if a then
							a:GetChild('NoteField'):visible(false)
						end
					end

					tang_blurry:visible(true)
					tang_blurry:diffusealpha(1)

					tang_blurryprox:visible(true)
					tang_blurryprox:diffusealpha(1)

					for i=1,1 do
					_G['P1proxy'..7-i]:sleep(0.06*i-0.059)
					_G['P1proxy'..7-i]:decelerate(0.4)
					_G['P1proxy'..7-i]:zoom(0.6*tang_height_ratio)--Scale zoom. -Kid
					_G['P1proxy'..7-i]:rotationz(36)
					_G['P1proxy'..7-i]:visible(true)

					_G['P2proxy'..7-i]:sleep(0.06*i-0.059)
					_G['P2proxy'..7-i]:decelerate(0.4)
					_G['P2proxy'..7-i]:zoom(0.6*tang_height_ratio)
					_G['P2proxy'..7-i]:rotationz(36)
					_G['P2proxy'..7-i]:visible(true)

					_G['P1proxyp'..7-i]:visible(true)--Included proxies in AFT. -Kid
					_G['P2proxyp'..7-i]:visible(true)
					end

				end},

				{41,function()
					tang_blurry:linear(1)
					tang_blurry:diffusealpha(0)
					tang_blurryprox:linear(1)--Included proxies in AFT. -Kid
					tang_blurryprox:diffusealpha(0)
				end},


				{45,function()
					for i=1,1 do
					_G['P1proxy'..7-i]:sleep(0.06*i-0.059)
					_G['P1proxy'..7-i]:decelerate(0.4)
					_G['P1proxy'..7-i]:zoom(tang_height_ratio)--Scaled zoom. -Kid
					_G['P1proxy'..7-i]:rotationz(0)

					_G['P2proxy'..7-i]:sleep(0.06*i-0.059)
					_G['P2proxy'..7-i]:decelerate(0.4)
					_G['P2proxy'..7-i]:zoom(tang_height_ratio)
					_G['P2proxy'..7-i]:rotationz(0)
					end

					tang_blurry:visible(true)
					tang_blurry:diffusealpha(1)

					tang_blurryprox:visible(true)--Included proxies in AFT. -Kid
					tang_blurryprox:diffusealpha(1)
				end},

				{46,function()
					tang_blurry:linear(1)
					tang_blurry:diffusealpha(0)
					tang_blurryprox:linear(1)--Included proxies in AFT. -Kid
					tang_blurryprox:diffusealpha(0)
				end},

				{47.5,function()
					for pn=1,2 do
						local a = _G['P'..pn]
						if a then
							a:GetChild('NoteField'):visible(true)
						end
					end
					for i=1,6 do
					_G['P1proxy'..7-i]:visible(false)
					_G['P2proxy'..7-i]:visible(false)
					_G['P1proxyp'..7-i]:visible(false)--Included proxies in AFT. -Kid
					_G['P2proxyp'..7-i]:visible(false)
					end

				end},

				{55,function()

				--[[
				use this if -1000 flip is used
					P1proxy1:x(SCREEN_CENTER_X-160+1920)
					P1proxy2:visible(true)
					P1proxy2:x(SCREEN_CENTER_X-160+640)
					P1proxy3:visible(true)
					P1proxy3:x(SCREEN_CENTER_X-160-640)
					P1proxy4:visible(true)
					P1proxy4:x(SCREEN_CENTER_X-160-1920)

					P1proxy5:visible(true)
					P1proxy5:x(SCREEN_CENTER_X-160+1920)
					P1proxy5:y(SCREEN_CENTER_Y-480)

					P1proxy1:decelerate(0.2)
					P1proxy1:y(SCREEN_CENTER_Y+480)
					P1proxy5:decelerate(0.2)
					P1proxy5:y(SCREEN_CENTER_Y)
					--]]

					--Added the proxy proxies. -Kid
					P1proxy1:visible(true)
					P1proxyp1:visible(true)
					P1proxy1:x(SCREEN_CENTER_X-160*tang_width_ratio)--Scale positions. -Kid
					P1proxy1:y(SCREEN_CENTER_Y)
					P1proxy2:visible(true)
					P1proxyp2:visible(true)
					P1proxy2:x(SCREEN_CENTER_X-160*tang_width_ratio)
					P1proxy2:y(SCREEN_CENTER_Y-SCREEN_HEIGHT)
					P1proxy3:visible(true)
					P1proxyp3:visible(true)
					P1proxy3:x(SCREEN_CENTER_X-160*tang_width_ratio)
					P1proxy3:y(SCREEN_CENTER_Y+SCREEN_HEIGHT)

					P2proxy1:visible(true)
					P2proxyp1:visible(true)
					P2proxy1:x(SCREEN_CENTER_X+160*tang_width_ratio)
					P2proxy1:y(SCREEN_CENTER_Y)
					P2proxy2:visible(true)
					P2proxyp2:visible(true)
					P2proxy2:x(SCREEN_CENTER_X+160*tang_width_ratio)
					P2proxy2:y(SCREEN_CENTER_Y-SCREEN_HEIGHT)
					P2proxy3:visible(true)
					P2proxyp3:visible(true)
					P2proxy3:x(SCREEN_CENTER_X+160*tang_width_ratio)
					P2proxy3:y(SCREEN_CENTER_Y+SCREEN_HEIGHT)

					hideNotefields(true)--Use booleans. -Kid

					tang_blurry:linear(1)
					tang_blurry:diffusealpha(1)
					tang_blurryprox:linear(1)
					tang_blurryprox:diffusealpha(1)


					for i=1,6 do

						for j=1,2 do
						_G['P1proxy'..i]:linear(2)
						_G['P1proxy'..i]:addy(SCREEN_HEIGHT)--Scale movement. -Kid
						_G['P1proxy'..i]:sleep(0)
						_G['P1proxy'..i]:addy(-SCREEN_HEIGHT)

						_G['P2proxy'..i]:linear(2)
						_G['P2proxy'..i]:addy(SCREEN_HEIGHT)
						_G['P2proxy'..i]:sleep(0)
						_G['P2proxy'..i]:addy(-SCREEN_HEIGHT)
						end

					end
				end},
				{65,function()

				tang_blurry:linear(0.1)
				tang_blurry:zoom(1-0.01)

				for i=1,6 do

					for j=1,2 do
					_G['P1proxy'..i]:linear(2)
					_G['P1proxy'..i]:addy(SCREEN_HEIGHT)--Scale movement. -Kid
					_G['P1proxy'..i]:sleep(0)
					_G['P1proxy'..i]:addy(-SCREEN_HEIGHT)

					_G['P2proxy'..i]:linear(2)
					_G['P2proxy'..i]:addy(SCREEN_HEIGHT)
					_G['P2proxy'..i]:sleep(0)
					_G['P2proxy'..i]:addy(-SCREEN_HEIGHT)
					end

				end

				end},
				{75,function()


				tang_blurry:linear(0.1)
				tang_blurry:zoom(1.015)

				for i=1,6 do

					for j=1,2 do
					_G['P1proxy'..i]:linear(2)
					_G['P1proxy'..i]:addy(SCREEN_HEIGHT)--Scale movement. -Kid
					_G['P1proxy'..i]:sleep(0)
					_G['P1proxy'..i]:addy(-SCREEN_HEIGHT)

					_G['P2proxy'..i]:linear(2)
					_G['P2proxy'..i]:addy(SCREEN_HEIGHT)
					_G['P2proxy'..i]:sleep(0)
					_G['P2proxy'..i]:addy(-SCREEN_HEIGHT)
					end

				end

				end},
				{85,function()

				tang_blurry:linear(0.1)
				tang_blurry:zoom(1-0.02)
				for i=1,6 do

					for j=1,2 do
					_G['P1proxy'..i]:linear(2)
					_G['P1proxy'..i]:addy(SCREEN_HEIGHT)--Scale movement. -Kid
					_G['P1proxy'..i]:sleep(0)
					_G['P1proxy'..i]:addy(-SCREEN_HEIGHT)

					_G['P2proxy'..i]:linear(2)
					_G['P2proxy'..i]:addy(SCREEN_HEIGHT)
					_G['P2proxy'..i]:sleep(0)
					_G['P2proxy'..i]:addy(-SCREEN_HEIGHT)
					end

				end

				end},
				{92.00+.5,function()--Begin special tiny shenanigans. -Kid
					tang_auxtiny:linear(1/25):aux(-8)
				end},
				{92.10+.5,function()--I won't let it go into infinity. -Kid
					tang_auxtiny:stoptweening():linear(1/3):aux(1.9999999999999)
				end},
				{92.75+.5,function()
					tang_auxtiny:stoptweening():linear(1/20):aux(-8)
				end},
				{92.85+.5,function()--I won't let it go into infinity. -Kid
					tang_auxtiny:stoptweening():linear(1/3):aux(1.9999999999999)
				end},
				{93.50+.5,function()
					tang_auxtiny:stoptweening():linear(1/20):aux(-8)
				end},
				{93.60+.5,function()--I won't let it go into infinity. -Kid
					tang_auxtiny:stoptweening():linear(1/4):aux(1.9999999999999)
				end},
				{94.00+.5,function()
					tang_auxtiny:stoptweening():linear(1/20):aux(-8)
				end},
				{94.10+.5,function()--End special tiny shenanigans. -Kid
					tang_auxtiny:stoptweening():linear(1/5):aux(0)
				end},
				{94.95,function()
					screen:addx(SCREEN_CENTER_X);
					screen:addy(SCREEN_CENTER_Y);
					if P1 then P1:addx(-SCREEN_CENTER_X) end
					if P1 then P1:addy(-SCREEN_CENTER_Y) end
					if P2 then P2:addx(-SCREEN_CENTER_X) end
					if P2 then P2:addy(-SCREEN_CENTER_Y) end
					if tang_p1prox then tang_p1prox:addx(SCREEN_CENTER_X) end--Doing this ensures the intended effect actually works. -Kid
					if tang_p1prox then tang_p1prox:addy(SCREEN_CENTER_Y) end
					if tang_p2prox then tang_p2prox:addx(SCREEN_CENTER_X) end
					if tang_p2prox then tang_p2prox:addy(SCREEN_CENTER_Y) end
					SongBackground:addx(-SCREEN_CENTER_X);
					SongBackground:addy(-SCREEN_CENTER_Y);
					SongForeground:addx(-SCREEN_CENTER_X);
					SongForeground:addy(-SCREEN_CENTER_Y);

					hideNotefields(false)
					--P1:zoomz(1)

					for pn=1,2 do--Make it normal. -Kid
						local a = _G['P'..pn..'WRAP']
						if a then
							a:zoomz(1)
						end
					end

					tang_blurry:linear(0.5)
					tang_blurry:diffusealpha(0)

					tang_blurryprox:linear(0.5)
					tang_blurryprox:diffusealpha(0)

					for i=1,6 do
					_G['P1proxy'..7-i]:visible(false)
					_G['P2proxy'..7-i]:visible(false)
					_G['P1proxyp'..7-i]:visible(false)--Included proxies in AFT. -Kid
					_G['P2proxyp'..7-i]:visible(false)
					end


				end},

				{143,function()
					screen:decelerate(120/150);
					screen:zoom(0.9);
					screen:zoomz(1);--Keep the zoomz. -Kid
					screen:rotationz(-30);
					local m = 1;
					for pn=1,2 do
						if pn == 2 then m = -1 end
						if _G['P'..pn] then
							_G['P'..pn]:decelerate(45/150);
							_G['P'..pn]:x(0+(m*SCREEN_WIDTH/4));
							_G['P'..pn]:decelerate(45/150);
							_G['P'..pn]:x(0+(-m*SCREEN_WIDTH/4));
							_G['P'..pn]:decelerate(30/150);
							_G['P'..pn]:x(0+(m*SCREEN_WIDTH/4));
							_G['P'..pn]:decelerate(30/150);
							_G['P'..pn]:x(0+(-m*SCREEN_WIDTH/4));
							_G['jud'..pn]:zoom(1):sleep(20);--Keep consistent zoom. -Kid
							_G['com'..pn]:zoom(1):sleep(20);--Keep consistent zoom. -Kid
						end
					end

					tang_bgCover:visible(true)
					tang_bgCover:zoomx(SCREEN_WIDTH*4)
					tang_bgCover:zoomy(SCREEN_HEIGHT*4)
					tang_bgCover:diffusealpha(0)
					tang_bgCover:x(SCREEN_CENTER_X)
					tang_bgCover:y(SCREEN_CENTER_Y)
					tang_bgCover:linear(3)
					tang_bgCover:diffusealpha(1)

				end},
				{145.5,function()
					screen:decelerate(120/150);
					screen:zoom(0.8);
					screen:zoomz(1);--Keep the zoomz. -Kid
					screen:rotationz(30);


					local m = 1;
					for pn=1,2 do
						if pn == 2 then m = -1 end
						if _G['P'..pn] then
							_G['P'..pn]:decelerate(45/150);
							_G['P'..pn]:x(0+(m*SCREEN_WIDTH/4));
							_G['P'..pn]:decelerate(45/150);
							_G['P'..pn]:x(0+(-m*SCREEN_WIDTH/4));
							_G['P'..pn]:decelerate(30/150);
							_G['P'..pn]:x(0+(m*SCREEN_WIDTH/4));
							_G['P'..pn]:decelerate(30/150);
							_G['P'..pn]:x(0+(-m*SCREEN_WIDTH/4));
						end
					end
				end},
				{148,function()
					screen:decelerate(120/150);
					screen:zoom(1);
					screen:rotationz(0);
					screen:rotationx(0);
					for n=0,7 do
						local m = 1;
						for pn=1,2 do
							if pn == 2 then m = -1 end
							if _G['P'..pn] then
								_G['P'..pn]:decelerate(45/150);
								_G['P'..pn]:x(0+(m*SCREEN_WIDTH/4));
								_G['P'..pn]:decelerate(45/150);
								_G['P'..pn]:x(0+(-m*SCREEN_WIDTH/4));
							end
						end
					end

					--[[
					red_fg:linear(5);
					red_fg:diffusealpha(0);
					blue_bg:linear(5);
					blue_bg:diffusealpha(0);
					]]
				end},


				{149,function()
					screen:x(0);
					screen:y(0);
					screen:rotationx(0);
					screen:rotationz(0);
					screen:zoom(1);--Scale positions. -Kid
					if P1 then P1:x(SCREEN_CENTER_X-160*tang_width_ratio) end
					if P1 then P1:y(SCREEN_CENTER_Y):visible(false) end--Hided the player because they somehow show up during the crazy 3d section. -Kid
					if P2 then P2:x(SCREEN_CENTER_X+160*tang_width_ratio) end
					if P2 then P2:y(SCREEN_CENTER_Y):visible(false) end
					if tang_p1prox then tang_p1prox:x(0) end--Then reset the position. -Kid
					if tang_p1prox then tang_p1prox:y(0) end
					if tang_p2prox then tang_p2prox:x(0) end
					if tang_p2prox then tang_p2prox:y(0) end
					SongBackground:x(0);
					SongBackground:y(0);
					SongForeground:x(0);
					SongForeground:y(0);
					tang_blurry:visible(true)
					tang_blurry:zoom(1.005)
					--tang_blurry:blend('InvertDest')
					tang_blurry:diffusealpha(1)
					tang_blurry:SetTexture(ball_tex:GetTexture());
					tang_plane:visible(true)
					tang_plane2:visible(true)
					--tang_plane:playanimation('default',0)
					tang_blurryprox:visible(true)--Included proxies in AFT. -Kid
					tang_blurryprox:diffusealpha(1)
					tang_planep:visible(true)
					tang_plane2p:visible(true)
				end},

				{150,function()
					screen:x(0);
					screen:y(0);
					screen:rotationx(0);
					screen:rotationz(0);
					screen:zoom(1);
					if P1 then P1:x(P1origX) end
					if P1 then P1:y(P1origY) end
					if P2 then P2:x(P2origX) end
					if P2 then P2:y(P1origY) end
					SongBackground:x(0);
					SongBackground:y(0);
					SongForeground:x(0);
					SongForeground:y(0);

					tang_bgCover:visible(true)
					tang_bgCover:zoomx(SCREEN_WIDTH*4)
					tang_bgCover:zoomy(SCREEN_HEIGHT*4)
					tang_bgCover:x(SCREEN_CENTER_X)
					tang_bgCover:y(SCREEN_CENTER_Y)
					tang_bgCover:diffusealpha(1)
				end,true},

				{151,function()


					for pn=1,2 do
						local a = _G['P'..pn]
						local d = 1; if pn==2 then d = -1 end
						if a then
							a:stoptweening()
							a:linear(0.4)
							a:x(SCREEN_CENTER_X)
							a:zoomx(3*tang_height_ratio)--Scale zoom. -Kid
						end
						local b = _G['jud'..pn]
						local c = _G['com'..pn]
						if b then
							b:stoptweening()
							b:linear(0.4)
							b:basezoomx(0.7)
							b:x(-90*d*tang_sdwidth_ratio):sleep(150)--Scale positioning. -Kid
						end
						if c then
							--Deal with Lambda's old combo tweens. -Kid
							c:stoptweening():skewy(0)
							c:linear(0.4)
							c:basezoomx(0.7)
							c:x(-90*d*tang_sdwidth_ratio):sleep(150)--And hold position. -Kid
						end
					end

				end,true},

				{155,function()


					for pn=1,2 do
						local a = _G['P'..pn]
						if a then
							a:stoptweening()
							a:linear(0.4)
							a:x(SCREEN_CENTER_X-220*math.min(tang_width_ratio,tang_height_ratio))--Scale movement and zoom. -Kid
							a:zoomx(tang_height_ratio)
						end
					end

				end,true},

				{157,function()
					SongBackground:x(0);
					SongBackground:y(0);
					SongForeground:x(0);
					SongForeground:y(0);
					for pn=1,2 do
						local a = _G['P'..pn]
						if a then
							a:stoptweening()
							a:linear(2)
							a:zoomy(1.8000*tang_height_ratio)--Scale zooms. -Kid
							a:zoomx(tang_height_ratio)
							a:skewx(-2)
							a:x(SCREEN_CENTER_X)
						end
					end

				end,true},

				{161,function()

					tang_bgCover:visible(true)
					tang_bgCover:zoomx(SCREEN_WIDTH*3)
					tang_bgCover:zoomy(SCREEN_HEIGHT*3)
					tang_bgCover:diffusealpha(1)


					for pn=1,2 do
						local a = _G['P'..pn]
						if a then
							a:sleep(0)
							a:zoomy(1.8000*tang_height_ratio)--Scale zooms. -Kid
							a:zoomx(tang_height_ratio)
							a:skewx(-2)
						end
					end

					tang_plane:visible(true)
					tang_planep:visible(true)
					--tang_plane:playanimation('default',1.69)
				end,true},



				{165,function()
					tang_plane:visible(true)
					tang_planep:visible(true)
					--tang_plane:playanimation('default',0)

					for pn=1,2 do
						local a = _G['P'..pn]
						if a then
							a:spring(0.5)
							a:zoomy(tang_height_ratio)--Scale zooms. -Kid
							a:zoomx(tang_height_ratio)
							a:skewx(0)
						end
					end
				end,true},

				{167,function()


					for pn=1,2 do
						local a = _G['P'..pn]
						if a then
							a:stoptweening()
							a:linear(0.4)
							a:x(SCREEN_CENTER_X)
							a:zoomx(3*tang_height_ratio)--Scale zoom. -Kid
						end
					end

				end,true},

				{171,function()


					for pn=1,2 do
						local a = _G['P'..pn]
						if a then
							a:stoptweening()
							a:linear(0.4)--Scale movment and zoom. -Kid
							a:x(SCREEN_CENTER_X+200*math.min(tang_width_ratio,tang_height_ratio))
							a:zoomx(tang_height_ratio)
						end
					end

				end,true},

				{173,function()
					SongBackground:x(0);
					SongBackground:y(0);
					SongForeground:x(0);
					SongForeground:y(0);
					for pn=1,2 do
						local a = _G['P'..pn]
						if a then
							a:stoptweening()
							a:linear(2)
							a:zoomy(1.8000*tang_height_ratio)--Scale zooms. -Kid
							a:zoomx(tang_height_ratio)
							a:skewx(2)
							a:x(SCREEN_CENTER_X)
						end
					end

				end,true},

				{177,function()

					tang_bgCover:visible(true)
					tang_bgCover:zoomx(SCREEN_WIDTH*3)
					tang_bgCover:zoomy(SCREEN_HEIGHT*3)
					tang_bgCover:diffusealpha(1)


					for pn=1,2 do
						local a = _G['P'..pn]
						if a then
							a:sleep(0)
							a:zoomy(1.8000*tang_height_ratio)--Scale zooms. -Kid
							a:zoomx(tang_height_ratio)
							a:skewx(2)
						end
					end

					tang_plane:visible(true)
					tang_planep:visible(true)
					--tang_plane:playanimation('default',1.69)
				end,true},

				{181,function()
					tang_plane:visible(true)
					tang_planep:visible(true)
					--tang_plane:playanimation('default',0)

					for pn=1,2 do
						local a = _G['P'..pn]
						if a then
							a:spring(0.5)
							a:zoomy(tang_height_ratio)--Scale zooms. -Kid
							a:zoomx(tang_height_ratio)
							a:skewx(0)
						end
					end
				end,true},

				{183,function()


					for pn=1,2 do
						local a = _G['P'..pn]
						if a then
							a:stoptweening()
							a:linear(0.4)
							a:x(SCREEN_CENTER_X)
							a:zoomx(3*tang_height_ratio)--Scale zoom. -Kid
						end
					end

				end,true},

				{187,function()


					for pn=1,2 do
						local a = _G['P'..pn]
						if a then
							a:stoptweening()
							a:linear(0.4)--Scale movement and zoom. -Kid
							a:x(SCREEN_CENTER_X-220*math.min(tang_width_ratio,tang_height_ratio))
							a:zoomx(tang_height_ratio)
						end
					end

				end,true},


				{189,function()
					SongBackground:x(0);
					SongBackground:y(0);
					SongForeground:x(0);
					SongForeground:y(0);
					for pn=1,2 do
						local a = _G['P'..pn]
						if a then
							a:stoptweening()
							a:linear(2)
							a:zoomy(1.8000*tang_height_ratio)--Scale zooms. -Kid
							a:zoomx(tang_height_ratio)
							a:skewx(-2)
							a:x(SCREEN_CENTER_X)
						end
					end

				end,true},

				{193,function()

					tang_bgCover:visible(true)
					tang_bgCover:zoomx(SCREEN_WIDTH*3)
					tang_bgCover:zoomy(SCREEN_HEIGHT*3)
					tang_bgCover:diffusealpha(1)


					for pn=1,2 do
						local a = _G['P'..pn]
						if a then
							a:sleep(0)
							a:zoomy(1.8000*tang_height_ratio)--Scale zooms. -Kid
							a:zoomx(tang_height_ratio)
							a:skewx(-2)
						end
					end

					tang_plane:visible(true)
					tang_planep:visible(true)
					--tang_plane:playanimation('default',1.69)
				end,true},

				{197,function()
					tang_plane:visible(true)
					tang_planep:visible(true)
					--tang_plane:playanimation('default',0)

					for pn=1,2 do
						local a = _G['P'..pn]
						if a then
							a:spring(0.5)
							a:zoomy(tang_height_ratio)--Scale zooms. -Kid
							a:zoomx(tang_height_ratio)
							a:skewx(0)
						end
					end
				end,true},

				{199,function()


					for pn=1,2 do
						local a = _G['P'..pn]
						if a then
							a:stoptweening()
							a:linear(0.4)
							a:x(SCREEN_CENTER_X)
							a:zoomx(3*tang_height_ratio)--Scale zoom.-Kid
						end
					end

				end,true},

				{203,function()


					for pn=1,2 do
						local a = _G['P'..pn]
						if a then
							a:stoptweening()
							a:linear(0.4)--Scale pos and zoom. -Kid
							a:x(SCREEN_CENTER_X+220*math.min(tang_width_ratio,tang_height_ratio))
							a:zoomx(tang_height_ratio)
						end
					end

				end,true},

				{205,function()
					SongBackground:x(0);
					SongBackground:y(0);
					SongForeground:x(0);
					SongForeground:y(0);
					for pn=1,2 do
						local a = _G['P'..pn]
						if a then
							a:stoptweening()
							a:linear(2)
							a:zoomy(1.8000*tang_height_ratio)--Scale zooms. -Kid
							a:zoomx(tang_height_ratio)
							a:skewx(2)
							a:x(SCREEN_CENTER_X)
						end
					end

				end,true},

				{209,function()

					tang_bgCover:visible(true)
					tang_bgCover:zoomx(SCREEN_WIDTH*3)
					tang_bgCover:zoomy(SCREEN_HEIGHT*3)
					tang_bgCover:diffusealpha(1)


					for pn=1,2 do
						local a = _G['P'..pn]
						if a then
							a:sleep(0)
							a:zoomy(1.8000*tang_height_ratio)--Scale zooms. -Kid
							a:zoomx(tang_height_ratio)
							a:skewx(2)
						end
					end

					tang_plane:visible(true)
					tang_planep:visible(true)
					--tang_plane:playanimation('default',1.69)
				end,true},

				{213,function()
					tang_plane:visible(false)
					tang_planep:visible(false)
					--tang_plane:playanimation('default',0)
					tang_blurry:visible(true)
					tang_blurry:zoom(1.005)
					tang_blurry:wag()
					tang_blurry:effectmagnitude(0,0,-0.2)--Inverted magnitude because of the original negative basezoomy. -Kid
					tang_blurry:effectclock('bgm')
					tang_blurry:effectperiod(8)


					--tang_blurry:rotationz(0.5)
					--tang_blurry:blend('InvertDest')
					tang_blurry:diffusealpha(1)
					tang_blurry:SetTexture(ball_tex:GetTexture())
					tang_plane2:visible(true)
					tang_plane2:linear(0.5)
					tang_plane2:zoomx(0.6)
					tang_plane2:zoomy(0.6)
					tang_plane2:x(SCREEN_CENTER_X)
					tang_plane2:y(SCREEN_CENTER_Y)

					tang_plane2:cropbottom(0)--Swapped bottom and top because of the original basezoomy. -Kid
					tang_plane2:cropleft(0.26*(1+tang_specialcrop))--Take aspect into account. -Kid
					tang_plane2:cropright(0.26*(1+tang_specialcrop))
					tang_plane2:croptop(0.1)

					tang_plane2:fadetop(0.13)
					tang_plane2:fadebottom(0.0)
					tang_plane2:fadeleft(0.4*(1+tang_specialcrop))
					tang_plane2:faderight(0.4*(1+tang_specialcrop))
					tang_plane2:bob()
					tang_plane2:effectmagnitude(0,0,0)
					tang_plane2:effectclock('bgm')
					tang_plane2:effectperiod(8)

					for pn=1,2 do
						local a = _G['P'..pn]
						if a then
							a:spring(0.5)
							a:zoomy(tang_height_ratio)--Scale zooms. -Kid
							a:zoomx(tang_height_ratio)
							a:skewx(0)
						end
					end
				end,true},

				{277,function()
					tang_plane:visible(false)
					--tang_plane:playanimation('default',0)--Probably not needed. -Kid
					tang_blurry:visible(true)
					tang_blurry:zoom(1.005)
					tang_blurry:wag()
					tang_blurry:effectmagnitude(0,0,-0.4)--Inverted magnitude because of the original negative basezoomy. -Kid
					tang_blurry:effectclock('bgm')
					tang_blurry:effectperiod(8)
				end},

				{298,function()
					tang_plane2:spring(1)
					tang_plane2:zoom(0.8)--Scaled pos. -Kid
					tang_plane2:y(SCREEN_CENTER_Y+50*tang_height_ratio)
				end},

				{300,function()
					--screen:addx(SCREEN_CENTER_X);
					--screen:addy(SCREEN_CENTER_Y);
					--if P1 then P1:addx(-SCREEN_CENTER_X) end
					--if P1 then P1:addy(-SCREEN_CENTER_Y) end
					--if P2 then P2:addx(-SCREEN_CENTER_X) end
					--if P2 then P2:addy(-SCREEN_CENTER_Y) end
					--SongBackground:addx(-SCREEN_CENTER_X);
					---SongBackground:addy(-SCREEN_CENTER_Y);
					---SongForeground:addx(-SCREEN_CENTER_X);
					---SongForeground:addy(-SCREEN_CENTER_Y);
				end},

				{325,function()
					tang_blurry:zoom(1.005)
					tang_blurry:spin()
					tang_blurry:effectmagnitude(0,0,-0.5)--Inverted magnitude because of the original negative basezoomy. -Kid
					tang_blurry:effectclock('bgm')
					tang_blurry:effectperiod(8)
				end},

				{349,function()
					--screen:addx(-SCREEN_CENTER_X);
					--screen:addy(-SCREEN_CENTER_Y);
					--screen:rotationx(0);
					--screen:rotationz(0);
					--if P1 then P1:addx(SCREEN_CENTER_X) end
					--if P1 then P1:addy(SCREEN_CENTER_Y) end
					--if P2 then P2:addx(SCREEN_CENTER_X) end
					--if P2 then P2:addy(SCREEN_CENTER_Y) end
					--SongBackground:addx(SCREEN_CENTER_X);
					--SongBackground:addy(SCREEN_CENTER_Y);
					--SongForeground:addx(SCREEN_CENTER_X);
					--SongForeground:addy(SCREEN_CENTER_Y);
					tang_blurry:stopeffect()
					tang_blurry:rotationz(-10)--Inverted magnitude because of the original negative basezoomy. -Kid
					tang_plane2:rotationz(23)--Inverted magnitude because of the original negative basezoomy. -Kid
					tang_plane2:rotationx(0)
					tang_plane2:rotationy(0)
					tang_plane2:zoomx(0.6)
					tang_plane2:zoomy(0.6)
					tang_plane2:x(SCREEN_CENTER_X)
					tang_plane2:y(SCREEN_CENTER_Y)
					tang_plane2:cropleft(0.21*(1+tang_specialcrop))
					tang_plane2:cropright(0.21*(1+tang_specialcrop))
				end},

				{353-.1,function()
					--tang_blurry:rotationz(10)
					tang_blurry:rotationz(-15)--Inverted magnitude because of the original negative basezoomy. -Kid

					tang_plane2:spring(0.5)
					tang_plane2:rotationz(33)--Inverted magnitude because of the original negative basezoomy. -Kid
					tang_plane2:zoom(0.6)--Scaled pos. -Kid
					tang_plane2:y(SCREEN_CENTER_Y+50*tang_height_ratio)
					tang_plane2:y(SCREEN_CENTER_Y)
				end},

				{358-.1,function()
					--tang_blurry:rotationz(10)
					tang_blurry:rotationz(-20)--Inverted magnitude because of the original negative basezoomy. -Kid

					tang_plane2:spring(0.5)
					tang_plane2:rotationz(23)--Inverted magnitude because of the original negative basezoomy. -Kid
					tang_plane2:zoom(0.6)--Scaled pos. -Kid
					tang_plane2:y(SCREEN_CENTER_Y+60*tang_height_ratio)
					tang_plane2:x(SCREEN_CENTER_X)
				end},

				{363-.1,function()
					--tang_blurry:rotationz(10)
					tang_blurry:rotationz(-25)--Inverted magnitude because of the original negative basezoomy. -Kid

					tang_plane2:spring(0.5)
					tang_plane2:rotationz(33)--Inverted magnitude because of the original negative basezoomy. -Kid
					tang_plane2:zoom(0.6)--Scaled pos. -Kid
					tang_plane2:y(SCREEN_CENTER_Y+70*tang_height_ratio)
					tang_plane2:x(SCREEN_CENTER_X)
				end},

				{368-.1,function()
					--tang_blurry:rotationz(10)
					tang_blurry:rotationz(-20)--Inverted magnitude because of the original negative basezoomy. -Kid

					tang_plane2:spring(0.5)
					tang_plane2:rotationz(23)--Inverted magnitude because of the original negative basezoomy. -Kid
					tang_plane2:zoom(0.6)--Scaled pos. -Kid
					tang_plane2:y(SCREEN_CENTER_Y+80*tang_height_ratio)
					tang_plane2:x(SCREEN_CENTER_X)

					tang_fQuad:visible(true)
					tang_fQuad:diffusealpha(1)
					tang_fQuad:linear(1)
					tang_fQuad:diffuse(1,1,1,1)

					tang_wacky:visible(true)
					tang_wacky:diffusealpha(1)
					tang_wacky_wrap:zoomy(0.45*tang_height_ratio*-1)--Scale zoom, use wrapperstate. -Kid
					tang_wacky_wrap:zoomx(0.45*tang_width_ratio)--Added zoomx. -Kid
					tang_wacky_wrap:zoomz(tang_height_ratio)--Added zoomx. -Kid
				end},

				{373-.1,function()
					--tang_blurry:rotationz(10)
					tang_blurry:rotationz(-15)--Inverted magnitude because of the original negative basezoomy. -Kid

					tang_plane2:spring(0.5)
					tang_plane2:rotationz(33)--Inverted magnitude because of the original negative basezoomy. -Kid
					tang_plane2:zoom(0.6)--Scaled pos. -Kid
					tang_plane2:y(SCREEN_CENTER_Y+70*tang_height_ratio)
					tang_plane2:x(SCREEN_CENTER_X)
				end},

				{378-.1,function()
					--tang_blurry:rotationz(10)
					tang_blurry:rotationz(-10)--Inverted magnitude because of the original negative basezoomy. -Kid

					tang_plane2:spring(0.5)
					tang_plane2:rotationz(23)--Inverted magnitude because of the original negative basezoomy. -Kid
					tang_plane2:zoom(0.8)--Scaled pos. -Kid
					tang_plane2:y(SCREEN_CENTER_Y+60*tang_height_ratio)
					tang_plane2:x(SCREEN_CENTER_X)

					tang_wacky:decelerate(0.5)
					tang_wacky:rotationy(-90)
				end},

				{383-.1,function()
					--tang_blurry:rotationz(10)
					tang_blurry:rotationz(-5)--Inverted magnitude because of the original negative basezoomy. -Kid

					tang_plane2:spring(0.5)
					tang_plane2:rotationz(33)--Inverted magnitude because of the original negative basezoomy. -Kid
					tang_plane2:zoom(0.8)--Scaled pos. -Kid
					tang_plane2:y(SCREEN_CENTER_Y+50*tang_height_ratio)
					tang_plane2:x(SCREEN_CENTER_X)

					tang_wacky:decelerate(0.5)
					tang_wacky:rotationy(-180)
				end},


				{1*5+383-.1,function()
					--tang_blurry:rotationz(10)
					tang_blurry:rotationz(-10)--Inverted magnitude because of the original negative basezoomy. -Kid

					tang_plane2:spring(0.5)
					tang_plane2:rotationz(23)--Inverted magnitude because of the original negative basezoomy. -Kid
					tang_plane2:zoom(0.8)--Scaled pos. -Kid
					tang_plane2:y(SCREEN_CENTER_Y+60*tang_height_ratio)
					tang_plane2:x(SCREEN_CENTER_X)

					tang_wacky:decelerate(0.5)
					tang_wacky:rotationy(-90)
				end},

				{2*5+383-.1,function()
					--tang_blurry:rotationz(10)
					tang_blurry:rotationz(-15)--Inverted magnitude because of the original negative basezoomy. -Kid

					tang_plane2:spring(0.5)
					tang_plane2:rotationz(33)--Inverted magnitude because of the original negative basezoomy. -Kid
					tang_plane2:zoom(0.8)--Scaled pos. -Kid
					tang_plane2:y(SCREEN_CENTER_Y+70*tang_height_ratio)
					tang_plane2:x(SCREEN_CENTER_X)

					tang_wacky:decelerate(0.35)
					tang_wacky:rotationy(-180)
				end},

				{3*5+383-.1,function()
					--tang_blurry:rotationz(10)
					tang_blurry:rotationz(-20)--Inverted magnitude because of the original negative basezoomy. -Kid

					tang_plane2:spring(0.5)
					tang_plane2:rotationz(23)--Inverted magnitude because of the original negative basezoomy. -Kid
					tang_plane2:zoom(0.9)--Scaled pos. -Kid
					tang_plane2:y(SCREEN_CENTER_Y+80*tang_height_ratio)
					tang_plane2:x(SCREEN_CENTER_X)

					tang_wacky:decelerate(0.35)
					tang_wacky:rotationy(-90)
				end},

				{4*5+383-.1,function()
					--tang_blurry:rotationz(10)
					tang_blurry:rotationz(-25)--Inverted magnitude because of the original negative basezoomy. -Kid

					tang_plane2:spring(0.5)
					tang_plane2:rotationz(33)--Inverted magnitude because of the original negative basezoomy. -Kid
					tang_plane2:zoom(0.9)--Scaled pos. -Kid
					tang_plane2:y(SCREEN_CENTER_Y+70*tang_height_ratio)
					tang_plane2:x(SCREEN_CENTER_X)

					tang_wacky:decelerate(0.35)
					tang_wacky:rotationy(-180)
				end},

				{5*5+383-.1,function()
					--tang_blurry:rotationz(10)
					tang_blurry:rotationz(-20)--Inverted magnitude because of the original negative basezoomy. -Kid

					tang_plane2:spring(0.5)
					tang_plane2:rotationz(23)--Inverted magnitude because of the original negative basezoomy. -Kid
					tang_plane2:zoom(0.9)--Scaled pos. -Kid
					tang_plane2:y(SCREEN_CENTER_Y+60*tang_height_ratio)
					tang_plane2:x(SCREEN_CENTER_X)

					tang_wacky:decelerate(0.35)
					tang_wacky:rotationy(-90)
				end},

				{6*5+383-.1,function()
					--tang_blurry:rotationz(10)
					tang_blurry:rotationz(-15)--Inverted magnitude because of the original negative basezoomy. -Kid

					tang_plane2:spring(0.5)
					tang_plane2:rotationz(33)--Inverted magnitude because of the original negative basezoomy. -Kid
					tang_plane2:zoom(0.9)--Scaled pos. -Kid
					tang_plane2:y(SCREEN_CENTER_Y+50*tang_height_ratio)
					tang_plane2:x(SCREEN_CENTER_X)

					tang_wacky:decelerate(0.35)
					tang_wacky:rotationy(-180)
				end},

				{7*5+383-.1,function()
					--tang_blurry:rotationz(10)
					tang_blurry:rotationz(-10)--Inverted magnitude because of the original negative basezoomy. -Kid

					tang_plane2:spring(0.5)
					tang_plane2:rotationz(23)--Inverted magnitude because of the original negative basezoomy. -Kid
					tang_plane2:zoom(0.9)--Scaled pos. -Kid
					tang_plane2:y(SCREEN_CENTER_Y+60*tang_height_ratio)
					tang_plane2:x(SCREEN_CENTER_X)

					tang_wacky:decelerate(0.5)
					tang_wacky:rotationy(-90)

				end},

				{8*5+383-.1,function()
					--tang_blurry:rotationz(10)
					tang_blurry:rotationz(-5)--Inverted magnitude because of the original negative basezoomy. -Kid

					tang_plane2:spring(0.5)
					tang_plane2:rotationz(33)--Inverted magnitude because of the original negative basezoomy. -Kid
					tang_plane2:zoom(0.9)--Scaled pos. -Kid
					tang_plane2:y(SCREEN_CENTER_Y+70*tang_height_ratio)
					tang_plane2:x(SCREEN_CENTER_X)

					tang_wacky:decelerate(0.35)
					tang_wacky:rotationy(0)
				end},

				{9*5+383-.1,function()
					--tang_blurry:rotationz(10)
					tang_blurry:rotationz(-5)--Inverted magnitude because of the original negative basezoomy. -Kid

					tang_plane2:spring(0.5)
					tang_plane2:rotationz(23)--Inverted magnitude because of the original negative basezoomy. -Kid
					tang_plane2:zoom(0.9)--Scaled pos. -Kid
					tang_plane2:y(SCREEN_CENTER_Y+60*tang_height_ratio)
					tang_plane2:x(SCREEN_CENTER_X)

					tang_wacky:decelerate(0.2)
					tang_wacky:rotationy(90)
				end},

				{429.15-.1,function()
					--tang_blurry:rotationz(10)
					tang_blurry:rotationz(-5)--Inverted magnitude because of the original negative basezoomy. -Kid

					tang_plane2:zoom(0.9)--Scale position. -Kid
					tang_plane2:y(SCREEN_CENTER_Y+70*tang_height_ratio)
					tang_plane2:x(SCREEN_CENTER_X)

					tang_wacky:stoptweening()
					tang_wacky:decelerate(0.2)
					tang_wacky:rotationy(180)
				end},

				{432.5-.1,function()
					--tang_blurry:rotationz(10)
					tang_blurry:rotationz(-5)--Inverted magnitude because of the original negative basezoomy. -Kid

					tang_plane2:zoom(0.9)--Scaled pos. -Kid
					tang_plane2:y(SCREEN_CENTER_Y+70*tang_height_ratio)
					tang_plane2:x(SCREEN_CENTER_X)

					tang_wacky:rotationy(-90)
					tang_wacky:decelerate(0.2)
					tang_wacky:rotationy(0)
				end},

				{436-.1,function()
					--tang_blurry:rotationz(10)
					tang_blurry:rotationz(-5)--Inverted magnitude because of the original negative basezoomy. -Kid

					tang_plane2:zoom(0.9)--Scaled pos. -Kid
					tang_plane2:y(SCREEN_CENTER_Y+70*tang_height_ratio)
					tang_plane2:x(SCREEN_CENTER_X)

					tang_wacky:rotationy(0)
					tang_wacky:decelerate(0.2)
					tang_wacky:rotationy(90)
				end},

				{437-.1,function()
					--tang_blurry:rotationz(10)
					tang_blurry:rotationz(-5)--Inverted magnitude because of the original negative basezoomy. -Kid

					tang_plane2:zoom(0.9)--Scaled pos. -Kid
					tang_plane2:y(SCREEN_CENTER_Y+70*tang_height_ratio)
					tang_plane2:x(SCREEN_CENTER_X)

					tang_wacky:decelerate(0.2)
					tang_wacky:rotationy(180)
				end},

				{440.5-.1,function()
					--tang_blurry:rotationz(10)
					tang_blurry:rotationz(-5)--Inverted magnitude because of the original negative basezoomy. -Kid

					tang_plane2:zoom(0.9)--Scaled pos. -Kid
					tang_plane2:y(SCREEN_CENTER_Y+70*tang_height_ratio)
					tang_plane2:x(SCREEN_CENTER_X)

					tang_wacky:rotationy(-90)
					tang_wacky:decelerate(0.2)
					tang_wacky:rotationy(0)
				end},

				{444-.1,function()
					--tang_blurry:rotationz(10)
					tang_blurry:rotationz(-5)--Inverted magnitude because of the original negative basezoomy. -Kid

					tang_plane2:zoom(0.9)--Scaled pos. -Kid
					tang_plane2:y(SCREEN_CENTER_Y+70*tang_height_ratio)
					tang_plane2:x(SCREEN_CENTER_X)

					tang_wacky:decelerate(0.15)
					tang_wacky:rotationy(90)
				end},

				{445-.1,function()
					--tang_blurry:rotationz(10)
					tang_blurry:rotationz(-5)--Inverted magnitude because of the original negative basezoomy. -Kid

					tang_plane2:zoom(0.9)--Scaled pos. -Kid
					tang_plane2:y(SCREEN_CENTER_Y+70*tang_height_ratio)
					tang_plane2:x(SCREEN_CENTER_X)

					tang_wacky:decelerate(0.15)
					tang_wacky:rotationy(180)
				end},

				{449-.1,function()
					--tang_blurry:rotationz(10)
					tang_blurry:rotationz(-5)--Inverted magnitude because of the original negative basezoomy. -Kid

					tang_plane2:zoom(0.9)--Scaled pos. -Kid
					tang_plane2:y(SCREEN_CENTER_Y+70*tang_height_ratio)
					tang_plane2:x(SCREEN_CENTER_X)

					tang_wacky:visible(false)
					tang_twisty:visible(true)
					tang_twisty:rotationy(0)
					--tang_wacky:rotationy(180)
				end},

				{450-.1,function()
					--tang_blurry:rotationz(10)
					tang_blurry:rotationz(-5)--Inverted magnitude because of the original negative basezoomy. -Kid

					tang_plane2:zoom(0.9)--Scaled pos. -Kid
					tang_plane2:y(SCREEN_CENTER_Y+70*tang_height_ratio)
					tang_plane2:x(SCREEN_CENTER_X)

					tang_wacky:visible(true)
					tang_twisty:visible(false)
					tang_twisty:rotationy(45)
					--tang_wacky:rotationy(180)
				end},

				{451-.1,function()
					--tang_blurry:rotationz(10)
					tang_blurry:rotationz(-5)--Inverted magnitude because of the original negative basezoomy. -Kid

					tang_plane2:zoom(0.9)--Scaled pos. -Kid
					tang_plane2:y(SCREEN_CENTER_Y+70*tang_height_ratio)
					tang_plane2:x(SCREEN_CENTER_X)

					tang_wacky:visible(false)
					tang_twisty:visible(true)
					tang_twisty:rotationy(0)
					--tang_wacky:rotationy(180)
				end},

				{452.5-.1,function()
					--tang_blurry:rotationz(10)
					tang_blurry:rotationz(-5)--Inverted magnitude because of the original negative basezoomy. -Kid

					tang_plane2:zoom(0.9)--Scaled pos. -Kid
					tang_plane2:y(SCREEN_CENTER_Y+70*tang_height_ratio)
					tang_plane2:x(SCREEN_CENTER_X)

					tang_wacky:visible(true)
					tang_twisty:visible(false)
					tang_twisty:rotationy(0)
					--tang_wacky:rotationy(180)
				end},

				{455.25-.1,function()
					--tang_blurry:rotationz(10)
					tang_blurry:rotationz(-5)--Inverted magnitude because of the original negative basezoomy. -Kid

					tang_plane2:zoom(0.9)--Scaled pos. -Kid
					tang_plane2:y(SCREEN_CENTER_Y+70*tang_height_ratio)
					tang_plane2:x(SCREEN_CENTER_X)

					tang_wacky:visible(false)
					tang_twisty:visible(true)
					tang_twisty:rotationy(0)
					--tang_wacky:rotationy(180)
				end},

				{456.25-.1,function()
					--tang_blurry:rotationz(10)
					tang_blurry:rotationz(-5)--Inverted magnitude because of the original negative basezoomy. -Kid

					tang_plane2:zoom(0.9)--Scaled pos. -Kid
					tang_plane2:y(SCREEN_CENTER_Y+70*tang_height_ratio)
					tang_plane2:x(SCREEN_CENTER_X)

					tang_wacky:visible(false)
					tang_twisty:decelerate(0.1)
					tang_twisty:rotationy(45)
					--tang_wacky:rotationy(180)
				end},

				{457.25-.1,function()
					--tang_blurry:rotationz(10)
					tang_blurry:rotationz(-5)--Inverted magnitude because of the original negative basezoomy. -Kid

					tang_plane2:zoom(0.9)--Scaled pos. -Kid
					tang_plane2:y(SCREEN_CENTER_Y+70*tang_height_ratio)
					tang_plane2:x(SCREEN_CENTER_X)

					tang_wacky:visible(false)
					tang_twisty:linear(0.1)
					tang_twisty:rotationy(90)
					--tang_wacky:rotationy(180)
				end},

				{458.5-.1,function()
					--tang_blurry:rotationz(10)
					tang_blurry:rotationz(-5)--Inverted magnitude because of the original negative basezoomy. -Kid

					tang_plane2:zoom(0.9)--Scaled pos. -Kid
					tang_plane2:y(SCREEN_CENTER_Y+70*tang_height_ratio)
					tang_plane2:x(SCREEN_CENTER_X)

					tang_wacky:visible(false)
					tang_twisty:linear(0.1)
					tang_twisty:rotationy(90+45)
					--tang_wacky:rotationy(180)
				end},

				{459.5-.1,function()
					--tang_blurry:rotationz(10)
					tang_blurry:rotationz(-5)--Inverted magnitude because of the original negative basezoomy. -Kid

					tang_plane2:zoom(0.9)--Scaled pos. -Kid
					tang_plane2:y(SCREEN_CENTER_Y+70*tang_height_ratio)
					tang_plane2:x(SCREEN_CENTER_X)

					tang_wacky:visible(false)
					tang_twisty:linear(0.1)
					tang_twisty:rotationy(180)
					--tang_wacky:rotationy(180)
				end},

				{461.0-.1,function()
					--tang_blurry:rotationz(10)
					tang_blurry:rotationz(-5)--Inverted magnitude because of the original negative basezoomy. -Kid

					tang_plane2:zoom(0.9)--Scaled pos. -Kid
					tang_plane2:y(SCREEN_CENTER_Y+70*tang_height_ratio)
					tang_plane2:x(SCREEN_CENTER_X)

					tang_twisty:rotationy(0)
					tang_twisty:linear(0.1)
					tang_twisty:rotationy(45)
					--tang_wacky:rotationy(180)
				end},

				{462.750-.1,function()
					--tang_blurry:rotationz(10)
					tang_blurry:rotationz(-5)--Inverted magnitude because of the original negative basezoomy. -Kid

					tang_plane2:zoom(0.9)--Scaled pos. -Kid
					tang_plane2:y(SCREEN_CENTER_Y+70*tang_height_ratio)
					tang_plane2:x(SCREEN_CENTER_X)

					tang_twisty:linear(0.1)
					tang_twisty:rotationy(90)
					--tang_wacky:rotationy(180)
				end},

				{465.250-.1,function()
					--tang_blurry:rotationz(10)
					tang_blurry:rotationz(-5)--Inverted magnitude because of the original negative basezoomy. -Kid

					tang_plane2:zoom(0.9)--Scaled pos. -Kid
					tang_plane2:y(SCREEN_CENTER_Y+70*tang_height_ratio)
					tang_plane2:x(SCREEN_CENTER_X)

					tang_twisty:visible(false)
					tang_wacky:visible(true)
					tang_wacky:rotationy(0)
					--tang_wacky:rotationy(180)
				end},

				{474.0-.1,function()
					--tang_blurry:rotationz(10)
					tang_blurry:rotationz(-5)--Inverted magnitude because of the original negative basezoomy. -Kid

					tang_plane2:zoom(0.9)--Scaled pos. -Kid
					tang_plane2:y(SCREEN_CENTER_Y+70*tang_height_ratio)
					tang_plane2:x(SCREEN_CENTER_X)

					tang_wacky:visible(false)
					tang_twisty:visible(true)
					tang_twisty:rotationy(45)
					tang_twisty_wrap:linear(5)
					tang_twisty_wrap:zoomx(0.5*tang_width_ratio)--Turned zoom into zoomx/y, and scaled. -Kid
					tang_twisty_wrap:zoomy(0.5*tang_height_ratio*-1)
					--tang_wacky:rotationy(180)

					tang_vibber:accelerate(90/52);
					tang_vibber:x(40);
					tang_vibber:linear(30/52);
					tang_vibber:x(0);

				end},

				{478,function()
					tang_vibber:accelerate(90/23.333);
					tang_vibber:y(40);
					tang_vibber:linear(30/23.333);
					tang_vibber:y(0);
				end},

				{486.0-.1,function()
					--tang_blurry:rotationz(10)
					tang_blurry:rotationz(-5)--Inverted magnitude because of the original negative basezoomy. -Kid

					tang_plane2:stoptweening()
					tang_plane2:linear(5)
					tang_plane2:zoomx(0.9)
					tang_plane2:zoomy(10)
					tang_plane2:rotationz(0)--Scaled pos. -Kid
					tang_plane2:y(SCREEN_CENTER_Y+800*tang_height_ratio)
					tang_plane2:x(SCREEN_CENTER_X)

					tang_twisty_wrap:linear(4)
					tang_twisty_wrap:zoomx(0)
					tang_twisty_wrap:zoomy(0)
					tang_twisty_wrap:zoomz(2*tang_height_ratio)--Scaled zoom. -Kid

				end},
			}

			local fluct = 1;
			for i=0,7 do
				table.insert(mod_actions,{95+(6*i),function()
					screen:spring(120/150);
					screen:rotationz((3+(2*i))*fluct);
					screen:sleep(120/150);
					screen:spring(120/150);
					screen:rotationx((3+(2*i))*-fluct);
					fluct=fluct*-1;

					for pn=1,2 do
						local a = _G['P'..pn]
						local d = 1
						if pn == 2 then d = -1 end
						if a then
							a:decelerate(.4)
							a:addx(120*d*tang_width_ratio)--Scale movement. -Kid
							a:accelerate(.6)
							a:addx(-120*d*tang_width_ratio)
						end
					end

				end});



				--mod_shader(95+6*i,53)
				--mod_shader(97+6*i,54)
				--mod_shader(99+6*i,55)
			end

			for i=0,7 do
				table.insert(mod_actions,{301+(6*i),function()
					--[[
					screen:spring(120/160);
					screen:rotationz((5+(2.5*i))*fluct);
					screen:sleep(120/160);
					screen:spring(120/160);
					screen:rotationx((5+(2.5*i))*-fluct);
					 --]]
							tang_plane2:spring(120/160);
							tang_plane2:rotationz((5+(2.5*i))*fluct*-1);--Inverted magnitude because of the original negative basezoomy. -Kid
							tang_plane2:sleep(120/160);
							tang_plane2:spring(120/160);
							tang_plane2:rotationx((5+(2.5*i))*-fluct*-1);--Inverted magnitude because of the original negative basezoomy. -Kid

					fluct=fluct*-1;



				end});

				--[[if i<4 then
				mod_shader(301+6*i,53)
				mod_shader(303+6*i,54)
				mod_shader(305+6*i,55)
				end]]
			end

			for i=0,15 do
				table.insert(mod_actions,{96.5+(3*i),function()
					--red_fg:ztestmode('writeonpass');
				end});
				table.insert(mod_actions,{97+(3*i),function()
					--red_fg:ztestmode('writeonfail');
				end});
			end


---------------------------------------------------------------------------------------
----------------------DON'T TOUCH IT KIDDO---------------------------------------------
---------------------------------------------------------------------------------------

			function modtable_compare(a,b)
				return a[1] < b[1]
			end

			if table.getn(mod_messages) > 1 then
				table.sort(mod_messages, modtable_compare)
			end

			if table.getn(mod_actions) > 1 then
				table.sort(mod_actions, modtable_compare)
			end

			self:queuecommand('Update');

---------------------------------------------------------------------------------------
----------------------END DON'T TOUCH IT KIDDO-----------------------------------------
---------------------------------------------------------------------------------------

		end,
      UpdateCommand= function(self)
--SCREENMAN:SystemMessage("P1: "..GAMESTATE:GetPlayerState(0):GetPlayerOptionsString('ModsLevel_Song').."\nP2: "..GAMESTATE:GetPlayerState(1):GetPlayerOptionsString('ModsLevel_Song').."\nBeat: "..GAMESTATE:GetSongBeat().."\nSong Position: "..GAMESTATE:GetSongPosition():GetMusicSeconds());
			if GAMESTATE:GetSongBeat()>=0 and not checked then

				----------------------
				-- grab everything? --
				----------------------
				if SCREENMAN:GetTopScreen():GetChild('LifeP1') then LifeP1 = SCREENMAN:GetTopScreen():GetChild('LifeP1') end
				if SCREENMAN:GetTopScreen():GetChild('LifeP2') then LifeP2 = SCREENMAN:GetTopScreen():GetChild('LifeP2') end
				if SCREENMAN:GetTopScreen():GetChild('ScoreP1') then ScoreP1 = SCREENMAN:GetTopScreen():GetChild('ScoreP1') end
				if SCREENMAN:GetTopScreen():GetChild('ScoreP2') then ScoreP2 = SCREENMAN:GetTopScreen():GetChild('ScoreP2') end
				if SCREENMAN:GetTopScreen():GetChild('BPMDisplay') then BPMDisplay = SCREENMAN:GetTopScreen():GetChild('BPMDisplay') end
				if SCREENMAN:GetTopScreen():GetChild('LifeFrame') then LifeFrame = SCREENMAN:GetTopScreen():GetChild('LifeFrame') end
				if SCREENMAN:GetTopScreen():GetChild('ScoreFrame') then ScoreFrame = SCREENMAN:GetTopScreen():GetChild('ScoreFrame') end
				if SCREENMAN:GetTopScreen():GetChild('Lyrics') then Lyrics = SCREENMAN:GetTopScreen():GetChild('Lyrics') end
				if SCREENMAN:GetTopScreen():GetChild('SongForeground') then SongForeground = SCREENMAN:GetTopScreen():GetChild('SongForeground') end
				if SCREENMAN:GetTopScreen():GetChild('SongBackground') then SongBackground = SCREENMAN:GetTopScreen():GetChild('SongBackground') end
				if SCREENMAN:GetTopScreen():GetChild('Overlay') then Overlay = SCREENMAN:GetTopScreen():GetChild('Overlay') end
				if SCREENMAN:GetTopScreen():GetChild('Underlay') then Underlay = SCREENMAN:GetTopScreen():GetChild('Underlay') end

				--------------------------
				-- hide everything? y/n --
				--------------------------
				mod_hideall = true;
				if mod_hideall == true then
					if LifeFrame then LifeFrame:visible(true) end
					--I won't let this break if only one player exists.
					if SCREENMAN:GetTopScreen():GetChild('LifeP1') then SCREENMAN:GetTopScreen():GetChild('LifeP1'):visible(false) end
					if SCREENMAN:GetTopScreen():GetChild('LifeP2') then SCREENMAN:GetTopScreen():GetChild('LifeP2'):visible(false) end
					if SCREENMAN:GetTopScreen():GetChild('ScoreP1') then SCREENMAN:GetTopScreen():GetChild('ScoreP1'):visible(false) end
					if SCREENMAN:GetTopScreen():GetChild('ScoreP2') then SCREENMAN:GetTopScreen():GetChild('ScoreP2'):visible(false) end
					if SCREENMAN:GetTopScreen():GetChild('BPMDisplay') then SCREENMAN:GetTopScreen():GetChild('BPMDisplay'):visible(false) end
					if Overlay then Overlay:visible(false) end
					if Underlay then Underlay:visible(false) end
					if ScoreFrame then ScoreFrame:visible(false) end
					--Some times, we need extra precautions. Not every theme has these.
					if SCREENMAN:GetTopScreen():GetChild('SongMeterDisplayP1') then SCREENMAN:GetTopScreen():GetChild("SongMeterDisplayP1"):visible(false) end
					if SCREENMAN:GetTopScreen():GetChild('SongMeterDisplayP2') then SCREENMAN:GetTopScreen():GetChild("SongMeterDisplayP2"):visible(false) end
					if SCREENMAN:GetTopScreen():GetChild('StepsDisplayP1') then SCREENMAN:GetTopScreen():GetChild('StepsDisplayP1'):visible(false) end
					if SCREENMAN:GetTopScreen():GetChild('StepsDisplayP2') then SCREENMAN:GetTopScreen():GetChild('StepsDisplayP2'):visible(false) end
					if SCREENMAN:GetTopScreen():GetChild('StageDisplay') then
					SCREENMAN:GetTopScreen():GetChild('StageDisplay'):visible(false) end
					if SCREENMAN:GetTopScreen():GetChild('SongTitle') then
					SCREENMAN:GetTopScreen():GetChild('SongTitle'):visible(false) end
					--Old Lambda-specific things. -Kid
					if SCREENMAN:GetTopScreen():GetChild('LifeMeterBarP1') then
					SCREENMAN:GetTopScreen():GetChild('LifeMeterBarP1'):visible(false) end
					if SCREENMAN:GetTopScreen():GetChild('LifeMeterBarP2') then
					SCREENMAN:GetTopScreen():GetChild('LifeMeterBarP2'):visible(false) end
				end

				mod_plr[1] = SCREENMAN:GetTopScreen():GetChild('PlayerP1');
				mod_plr[2] = SCREENMAN:GetTopScreen():GetChild('PlayerP2');

				for i,v in pairs(mod_plr) do
					if SCREENMAN:GetTopScreen():GetChild('PlayerOptionsP'..i) then
						--_G['init_modsp'..i] = SCREENMAN:GetTopScreen():GetChild('PlayerOptionsP'..i):GetText();
					end
				end

				P1 = SCREENMAN:GetTopScreen():GetChild('PlayerP1');
				P2 = SCREENMAN:GetTopScreen():GetChild('PlayerP2');
				if P1 then
					jud1 = P1:GetChild('Judgment');
					com1 = P1:GetChild('Combo');
					P1:x(SCREEN_CENTER_X-160*tang_width_ratio)--Scale position. -Kid
					P1:visible(true)
					P1WRAP = P1:AddWrapperState()--Here comes some abuse. -Kid
				end
				if P2 then
					jud2 = P2:GetChild('Judgment');
					com2 = P2:GetChild('Combo');
					P2:x(SCREEN_CENTER_X+160*tang_width_ratio)--Scale position. -Kid
					P2:visible(true)
					P2WRAP = P2:AddWrapperState()--Here comes some abuse. -Kid
				end
				--aliases for old times sake

				screen = SCREENMAN:GetTopScreen();
				checked = true;
			end

---------------------------------------------------------------------------------------
----------------------TOUCH THIS-------------------------------------------------------
---------------------------------------------------------------------------------------


			local beat = GAMESTATE:GetSongBeat()

			if beat > 368 then
				tang_vibcontainer:effectmagnitude( tang_vibber:GetX(),tang_vibber:GetY(),tang_vibber:GetZ() );
			end

---------------------------------------------------------------------------------------
----------------------DON'T TOUCH IT KIDDO---------------------------------------------
---------------------------------------------------------------------------------------

			disable = false;
			if disable ~= true and checked then

				-----------------------
				-- Player mod resets --
				-----------------------
				if beat > mod_firstSeenBeat+0.1 then -- performance coding!! --
					for i=1,2 do
						--GAMESTATE:ApplyGameCommand('mod,clearall',i)
						poptions[i]:FromString('clearall')
						if _G['init_modsp'..i] then
							--GAMESTATE:ApplyGameCommand('mod,'.._G['init_modsp'..i],i)
							poptions[i]:FromString(_G['init_modsp'..i])
						end
					end
				end

				------------------------------------------------------------------------------
				-- custom mod reader by TaroNuke edited by WinDEU and re-stolen by TaroNuke --
				------------------------------------------------------------------------------
				if beat > mod_firstSeenBeat+0.1 then -- performance coding!! --
					for i,v in pairs(mods) do
						if v and table.getn(v) > 3 and v[1] and v[2] and v[3] and v[4] then
							if beat >=v[1] then
								if (v[4] == 'len' and beat <=v[1]+v[2]) or (v[4] == 'end' and beat <=v[2]) then
									if table.getn(v) == 5 then
										--GAMESTATE:ApplyGameCommand('mod,'..v[3],v[5]);
										poptions[v[5]]:FromString(v[3])
									else
										--GAMESTATE:ApplyGameCommand('mod,'..v[3]);
										for i=1,2 do
											poptions[i]:FromString(v[3])
										end
									end
								end
							end
						else
							v[1] = 0;
							v[2] = 0;
							v[3] = '';
							v[4] = 'error';
							SCREENMAN:SystemMessage('Bad mod in beat-based table (line '..i..')');
						end
					end
				end

				-----------------------------------------------------------------------------------------------------
				-- WinDEU's time-based len/end version of the #swag custom mod reader #teamproofofconcept (c) 2015 --
				-----------------------------------------------------------------------------------------------------
				if beat > mod_firstSeenBeat+0.1 then -- performance coding!! --
					for i,v in pairs(mods2) do
						if v and table.getn(v) > 3 and v[1] and v[2] and v[3] and v[4] then
							if mod_time >=v[1] then
								if (v[4] == 'len' and mod_time <=v[1]+v[2]) or (v[4] == 'end' and mod_time <=v[2]) then
									if table.getn(v) == 5 then
										--GAMESTATE:ApplyGameCommand('mod,'..v[3],v[5]);
										poptions[v[5]]:FromString(v[3])
									else
										--GAMESTATE:ApplyGameCommand('mod,'..v[3]);
										for i=1,2 do
											poptions[i]:FromString(v[3])
										end
									end
								end
							end
						else
							v[1] = 0;
							v[2] = 0;
							v[3] = 'error';
							v[4] = 'error';
							SCREENMAN:SystemMessage('Bad mod in time-based table (line '..i..')');
						end
					end
				end

				-----------------------
				-- SCREAMING GUMBALL --
				-----------------------
				if beat > mod_firstSeenBeat+0.1 then -- performance coding!! --
					while curmessage<=table.getn(mod_messages) and GAMESTATE:GetSongBeat()>=mod_messages[curmessage][1] do
						if not mod_messages[curmessage][3] and GAMESTATE:GetSongBeat()>=mod_messages[curmessage][1]+5 then
							curmessage = curmessage+1;
						else
							MESSAGEMAN:Broadcast(mod_messages[curmessage][2]);
							curmessage = curmessage+1;
						end
					end
				end

				---------------------------------------
				-- ACTION RPGS AINT GOT SHIT ON THIS --
				---------------------------------------
				if beat > mod_firstSeenBeat+0.1 then -- performance coding!! --
					while curaction<=table.getn(mod_actions) and GAMESTATE:GetSongBeat()>=mod_actions[curaction][1] do
						if not mod_actions[curaction][3] and GAMESTATE:GetSongBeat()>=mod_actions[curaction][1]+5 then
							curaction = curaction+1;
						else
							mod_actions[curaction][2]()
							curaction = curaction+1;
						end
					end
				end

			end

			--Because we have to deal with Tiny in positive form, and zoom there goes to zero (!!!), we have to resort to perframe. -Kid
			if perframe(92.00+.5,94.10+.5+1) then
				local tang_specialtiny = math.log(1-(tang_auxtiny:getaux()*0.5))/tang_logden
				poptions[1]:Tiny1(tang_specialtiny,10000,true):Tiny2(tang_specialtiny,10000,true):Tiny3(tang_specialtiny,10000,true):Tiny4(tang_specialtiny,10000)
				poptions[2]:Tiny1(tang_specialtiny,10000,true):Tiny2(tang_specialtiny,10000,true):Tiny3(tang_specialtiny,10000,true):Tiny4(tang_specialtiny,10000)
			end

			--This is to replicate the playanimation that got used on the model. -Kid
			if perframe(160,166) or perframe(176,182) or perframe(192,198) or perframe(208,214) then
				tang_plane:SetVertices(tang_GetDistortVerts())
			end

			self:sleep(0.02);
			self:queuecommand('Update');

---------------------------------------------------------------------------------------
----------------------END DON'T TOUCH IT KIDDO-----------------------------------------
---------------------------------------------------------------------------------------

		end,
    },
    Def.Quad{--Here's the other part of our perframe Tiny madness. -Kid
      Name= "actor_m",
      OnCommand= function(self)
		tang_auxtiny=self
		self:aux(0)
		self:visible(false)
      end,
    },
    Def.Quad{--Helps to replicate what the model animation did. -Kid
      Name= "actor_m",
      OnCommand= function(self)
		tang_distortaux=self
		self:aux(0)
		self:visible(false)
      end,
      --This is my attempt at recreating the model animation. It's not perfect, but I think it's not that bad of a reproduction. -Kid
      DoDistortBounceMessageCommand= cmd(aux,0;bounceend,(1/30)*9;aux,50;bounceend,(1/30)*3;aux,40;bounceend,(1/30)*9;aux,-10;bounceend,(1/30)*3;aux,0;bounceend,(1/30)*9;aux,-50;bounceend,(1/30)*3;aux,-40;bounceend,(1/30)*9;aux,10;bounceend,(1/30)*3;aux,0;sleep,(1/30)*6),
    },
    Def.ActorFrame{
      Name= "actor_l",
      OnCommand= cmd(fov,20),
      Def.Sprite{
        Name= "actor_m",
        OnCommand= function(self)
		testsprite=self
		self:sleep(0)
		self:visible(false)
		end,
        Texture= "colorasriel.png",
      },
    },
    Def.BitmapText{
      Name= "actor_n",
      Font= "Common Normal",
      OnCommand= cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;effectclock,"music";playcommand,"SetTime";visible,false),
      SetTimeCommand= function(self) self:settext(self:GetSecsIntoEffect()); mod_time = tonumber(self:GetText()); self:sleep(0.02); self:queuecommand('SetTime'); end,
      Text= "test",
    },
    Def.ActorFrame{
      Name= "actor_o",
      OnCommand= cmd(fov,50*tang_sdwidth_ratio),--Scaled fov. -Kid
      Def.Sprite{
        Name= "actor_p",
        OnCommand= function(self)
			--self:SetTexture(ball_tex:GetTexture());
			tang_blurry=self
			self:rotationz(0)
			self:visible(false)
			self:x(SCREEN_CENTER_X)--Scale positions. -Kid
			self:y(SCREEN_CENTER_Y)
			self:zoomx(0)
			self:zoomy(0)
			--self:basezoomy(-1);
			self:customtexturerect(0,0,tang_aft_width_ratio,tang_aft_height_ratio)
			self:sleep(1);
			--self:queuecommand('blood_does');


			end,
        Texture= "white",
        blood_doesCommand= function(self)
				self:SetTexture(ball_tex:GetTexture());
				self:visible(false)
				--self:decelerate(5)
				self:zoom(1.01)
				--self:rotationx(10)
				self:diffusealpha(0.9)
			end,
      },
      Def.ActorProxy{
        Name= "actor_q",
        MakeProxyMessageCommand= function(self)
				if P1 then self:SetTarget(P1:GetChild('NoteField')); end
				--self:SetTarget(com1);
				P1proxy1=self
				self:zoom(tang_height_ratio);--Scaled zoom. -Kid
				self:x(SCREEN_CENTER_X-160*tang_width_ratio);--Scaled position. -Kid
				self:y(SCREEN_CENTER_Y);
				self:visible(true)
			end,
        OnCommand= cmd(sleep,0.1),
      },
      Def.ActorProxy{
        Name= "actor_r",
        MakeProxyMessageCommand= function(self)
				if P1 then self:SetTarget(P1:GetChild('NoteField')); end
				--self:SetTarget(com1);
				P1proxy2=self
				self:zoom(tang_height_ratio);--Scaled zoom. -Kid
				self:x(SCREEN_CENTER_X-160*tang_width_ratio);--Scaled position. -Kid
				self:y(SCREEN_CENTER_Y);
				self:visible(false)
			end,
        OnCommand= cmd(sleep,0.1),
      },
      Def.ActorProxy{
        Name= "actor_s",
        MakeProxyMessageCommand= function(self)
				if P1 then self:SetTarget(P1:GetChild('NoteField')); end
				--self:SetTarget(com1);
				P1proxy3=self
				self:zoom(tang_height_ratio);--Scaled zoom. -Kid
				self:x(SCREEN_CENTER_X-160*tang_width_ratio);--Scaled position. -Kid
				self:y(SCREEN_CENTER_Y);
				self:visible(false)
			end,
        OnCommand= cmd(sleep,0.1),
      },
      Def.ActorProxy{
        Name= "actor_t",
        MakeProxyMessageCommand= function(self)
				if P1 then self:SetTarget(P1:GetChild('NoteField')); end
				--self:SetTarget(com1);
				P1proxy4=self
				self:zoom(tang_height_ratio);--Scaled zoom. -Kid
				self:x(SCREEN_CENTER_X-160*tang_width_ratio);--Scaled position. -Kid
				self:y(SCREEN_CENTER_Y);
				self:visible(false)
			end,
        OnCommand= cmd(sleep,0.1),
      },
      Def.ActorProxy{
        Name= "actor_u",
        MakeProxyMessageCommand= function(self)
				if P1 then self:SetTarget(P1:GetChild('NoteField')); end
				--self:SetTarget(com1);
				P1proxy5=self
				self:zoom(tang_height_ratio);--Scaled zoom. -Kid
				self:x(SCREEN_CENTER_X-160*tang_width_ratio);--Scaled position. -Kid
				self:y(SCREEN_CENTER_Y);
				self:visible(false)
			end,
        OnCommand= cmd(sleep,0.1),
      },
      Def.ActorProxy{
        Name= "actor_v",
        MakeProxyMessageCommand= function(self)
				if P1 then self:SetTarget(P1:GetChild('NoteField')); end
				--self:SetTarget(com1);
				P1proxy6=self
				self:zoom(tang_height_ratio);--Scaled zoom. -Kid
				self:x(SCREEN_CENTER_X-160*tang_width_ratio);--Scaled position. -Kid
				self:y(SCREEN_CENTER_Y);
				self:visible(false)
			end,
        OnCommand= cmd(sleep,0.1),
      },
      Def.ActorProxy{
        Name= "actor_w",
        MakeProxyMessageCommand= function(self)
				if P2 then self:SetTarget(P2:GetChild('NoteField')); end
				--self:SetTarget(com1);
				P2proxy1=self
				self:zoom(tang_height_ratio);--Scaled zoom. -Kid
				self:x(SCREEN_CENTER_X+160*tang_width_ratio);--Scaled position. -Kid
				self:y(SCREEN_CENTER_Y);
				self:visible(true)
			end,
        OnCommand= cmd(sleep,0.1),
      },
      Def.ActorProxy{
        Name= "actor_x",
        MakeProxyMessageCommand= function(self)
				if P2 then self:SetTarget(P2:GetChild('NoteField')); end
				--self:SetTarget(com1);
				P2proxy2=self
				self:zoom(tang_height_ratio);--Scaled zoom. -Kid
				self:x(SCREEN_CENTER_X+160*tang_width_ratio);--Scaled position. -Kid
				self:y(SCREEN_CENTER_Y);
				self:visible(false)
			end,
        OnCommand= cmd(sleep,0.1),
      },
      Def.ActorProxy{
        Name= "actor_y",
        MakeProxyMessageCommand= function(self)--Target P2's notefield. -Kid
				if P2 then self:SetTarget(P2:GetChild('NoteField')); end
				--self:SetTarget(com1);
				P2proxy3=self
				self:zoom(tang_height_ratio);--Scaled zoom. -Kid
				self:x(SCREEN_CENTER_X+160*tang_width_ratio);--Scaled position. -Kid
				self:y(SCREEN_CENTER_Y);
				self:visible(false)
			end,
        OnCommand= cmd(sleep,0.1),
      },
      Def.ActorProxy{
        Name= "actor_z",
        MakeProxyMessageCommand= function(self)--Target P2's notefield. -Kid
				if P2 then self:SetTarget(P2:GetChild('NoteField')); end
				--self:SetTarget(com1);
				P2proxy4=self
				self:zoom(tang_height_ratio);--Scaled zoom. -Kid
				self:x(SCREEN_CENTER_X+160*tang_width_ratio);--Scaled position. -Kid
				self:y(SCREEN_CENTER_Y);
				self:visible(false)
			end,
        OnCommand= cmd(sleep,0.1),
      },
      Def.ActorProxy{
        Name= "actor_A",
        MakeProxyMessageCommand= function(self)--Target P2 completely. -Kid
				if P2 then self:SetTarget(P2:GetChild('NoteField')); end
				--self:SetTarget(com1);
				P2proxy5=self
				self:zoom(tang_height_ratio);--Scaled zoom. -Kid
				self:x(SCREEN_CENTER_X+160*tang_width_ratio);--Scaled position. -Kid
				self:y(SCREEN_CENTER_Y);
				self:visible(false)
			end,
        OnCommand= cmd(sleep,0.1),
      },
      Def.ActorProxy{
        Name= "actor_B",
        MakeProxyMessageCommand= function(self)--Target P2's notefield. -Kid
				if P2 then self:SetTarget(P2:GetChild('NoteField')); end
				--self:SetTarget(com1);
				P2proxy6=self
				self:zoom(tang_height_ratio);--Scaled zoom. -Kid
				self:x(SCREEN_CENTER_X+160*tang_width_ratio);--Scaled position. -Kid
				self:y(SCREEN_CENTER_Y);
				self:visible(false)
			end,
        OnCommand= cmd(sleep,0.1),
      },
      --To Recreate how nITG does AFTS, we need our own AFT. I'll call it screen_aft. -Kid
      Def.ActorFrameTexture{
        Name= "actor_wab",
        InitCommand= function(self)

			self:SetTextureName( 'tang_screen_aft' )
			self:SetWidth( SCREEN_WIDTH );
			self:SetHeight( SCREEN_HEIGHT );
			self:EnableDepthBuffer( true );
			self:EnableAlphaBuffer( true );
			self:EnableFloat( false );
			self:EnablePreserveTexture( false );

			self:visible(true);

			self:Create();

			tang_screen_aft = self;
		end,
-- 		Def.Quad{
-- 		  Name= "BACKING_QUAD",
-- 		  OnCommand= cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;zoomto,SCREEN_WIDTH,SCREEN_HEIGHT;diffuse,0,0,0,1),
--         },
		Def.ActorProxy{
		  Name= "MAIN_BG",
		  ProxyThisMessageCommand= function(self)
			if tang_bgcontainer then
				self:SetTarget(tang_bgcontainer):visible(true)
			end
		  end,
        },
		Def.ActorProxy{
		  Name= "MAIN_P1",
		  ProxyThisMessageCommand= function(self)
			tang_p1prox = self
			if P1 then
				self:SetTarget(P1):visible(true)
			end
		  end,
        },
		Def.ActorProxy{
		  Name= "MAIN_P2",
		  ProxyThisMessageCommand= function(self)
			tang_p2prox = self
			if P2 then
				self:SetTarget(P2):visible(true)
			end
		  end,
        },
      },
      Def.ActorFrameTexture{
        Name= "actor_C",
        InitCommand= function(self)

				--SCREENMAN:GetTopScreen():zoom(0.125);
				--SCREENMAN:GetTopScreen():x(200);

				--test_p1:zoom(1);

				--self:SetTextureName( 'Output'..aftNumber )
				self:SetWidth( SCREEN_WIDTH );
				self:SetHeight( SCREEN_HEIGHT );
				self:EnableDepthBuffer( false );
				self:EnableAlphaBuffer( false );
				self:EnableFloat( false );
				self:EnablePreserveTexture( true );

				self:visible(true);
				self:rotationz(20);

				self:Create();

				--self:Draw()

				test_tex = self;

				--By the very nature of the AFT, we need to make ratios for any sprites that wish to use this aft. -Kid
				tang_aft_height_ratio = SCREEN_HEIGHT / test_tex:GetTexture():GetTextureHeight()
				tang_aft_width_ratio = (SCREEN_HEIGHT * (SCREEN_WIDTH/SCREEN_HEIGHT) ) / test_tex:GetTexture():GetTextureWidth()
		end,
		Def.Sprite{
			ProxyThisMessageCommand= function(self)
				self:SetTexture(tang_screen_aft:GetTexture()):Center()
			end,
		},
      },
      Def.ActorFrameTexture{
        Name= "actor_C",
        InitCommand= function(self)

				--SCREENMAN:GetTopScreen():zoom(0.125);
				--SCREENMAN:GetTopScreen():x(200);

				--test_p1:zoom(1);

				--self:SetTextureName( 'Output'..aftNumber )
				self:SetWidth( SCREEN_WIDTH );
				self:SetHeight( SCREEN_HEIGHT );
				self:EnableDepthBuffer( false );
				self:EnableAlphaBuffer( false );
				self:EnableFloat( false );
				self:EnablePreserveTexture( true );

				self:visible(true);
				self:rotationz(20);

				self:Create();

				--self:Draw()

				test_tex2 = self;--You'd think this isn't necessarry, but it is. -Kid
		end,
		Def.Sprite{
			ProxyThisMessageCommand= function(self)
				self:SetTexture(tang_screen_aft:GetTexture()):Center()
			end,
		},
		Def.ActorProxy{
		  ProxyThisMessageCommand= function(self)
			tang_blurryprox=self
			if tang_blurry then
				self:SetTarget(tang_blurry):visible(true)
			end
		  end,
        },
      },--Replaced Model with ActorMultiVertex. -Kid
      Def.ActorMultiVertex{
        Name= "actor_D",
        OnCommand= function(self)
				tang_plane=self;
				self:visible(false);
				self:z(0);
				self:zoomx(0.5*tang_height_ratio);--Scale zooms. -Kid
				self:zoomy(0.5*tang_height_ratio);
				self:diffusealpha(1);
				self:rotationx(0);
				self:x(SCREEN_CENTER_X+0);
				self:y(SCREEN_CENTER_Y-0);
				self:sleep(1);
				--self:wag();
				self:effectmagnitude(20,2,2);
				self:effectclock('bgm');
				self:effectperiod(10);
				self:queuecommand('blood_do');
			end,
        blood_doCommand= function(self)
				--Make it so it actually draws the triangles. -Kid
				self:SetDrawState({Mode='DrawMode_Triangles', First= 1, Num= -1})
				--Have the AMV take shape. -Kid
				self:SetVertices(tang_GetDistortVerts());
				--Add in the AFT. -Kid
				self:SetTexture(test_tex:GetTexture());
			end,
      },
      Def.Sprite{
        Name= "actor_E",
        OnCommand= function(self)
			--self:SetTexture(ball_tex:GetTexture());
			tang_plane2=self
			self:rotationz(0)
			self:visible(false)
			self:x(SCREEN_CENTER_X+0)--Scale positions. -Kid
			self:y(SCREEN_CENTER_Y+60*tang_height_ratio)
			self:zoomx(0.6)
			self:zoomy(0.6)
			self:cropbottom(0.85)--Originally used a *-1 base zoomy, so I have to flip this to use bottom instead of top. -Kid
			self:fadebottom(0.02)
			self:cropleft(math.max(tang_specialcrop,0));--Added cropleft/right to take aspect into account. -Kid
			self:cropright(math.max(tang_specialcrop,0));
			self:customtexturerect(0,0,tang_aft_width_ratio,tang_aft_height_ratio)
			self:sleep(1);
			self:queuecommand('blood_does');


			end,
        Texture= "white",
        blood_doesCommand= function(self)
				self:SetTexture(test_tex:GetTexture());
				self:visible(false)
				--self:decelerate(5)
				self:zoomx(0.5)
				self:zoomy(0.8)
				--self:rotationx(10)
				self:diffusealpha(1)
			end,
      },
      Def.ActorFrameTexture{
        Name= "actor_F",
        InitCommand= function(self)

				--SCREENMAN:GetTopScreen():zoom(0.125);
				--SCREENMAN:GetTopScreen():x(200);

				--test_p1:zoom(1);

				--self:SetTextureName( 'Output'..aftNumber )
				self:SetWidth( SCREEN_WIDTH );
				self:SetHeight( SCREEN_HEIGHT );
				self:EnableDepthBuffer( false );
				self:EnableAlphaBuffer( false );
				self:EnableFloat( false );
				self:EnablePreserveTexture( true );

				--self:x(SCREEN_CENTER_X)
				--self:y(SCREEN_CENTER_Y)

				self:visible(true);
				self:rotationz(20);

				self:Create();

				--self:Draw()

				ball_tex = self;

		end,
		Def.Sprite{
		  ProxyThisMessageCommand= function(self)
			self:SetTexture(test_tex2:GetTexture()):Center()
		  end,
        },
        --Ah yes, my favorite past-time! Proxying proxies. -Kid
		Def.ActorProxy{
		  ProxyThisMessageCommand= function(self)
			P1proxyp1 = self
			if P1proxy1 then
				self:SetTarget(P1proxy1):visible(true)
			end
		  end,
        },
		Def.ActorProxy{
		  ProxyThisMessageCommand= function(self)
			P1proxyp2 = self
			if P1proxy2 then
				self:SetTarget(P1proxy2):visible(false)
			end
		  end,
        },
		Def.ActorProxy{
		  ProxyThisMessageCommand= function(self)
			P1proxyp3 = self
			if P1proxy3 then
				self:SetTarget(P1proxy3):visible(false)
			end
		  end,
        },
		Def.ActorProxy{
		  ProxyThisMessageCommand= function(self)
			P1proxyp4 = self
			if P1proxy4 then
				self:SetTarget(P1proxy4):visible(false)
			end
		  end,
        },
		Def.ActorProxy{
		  ProxyThisMessageCommand= function(self)
			P1proxyp5 = self
			if P1proxy5 then
				self:SetTarget(P1proxy5):visible(false)
			end
		  end,
        },
		Def.ActorProxy{
		  ProxyThisMessageCommand= function(self)
			P1proxyp6 = self
			if P1proxy6 then
				self:SetTarget(P1proxy6):visible(false)
			end
		  end,
        },
		Def.ActorProxy{
		  ProxyThisMessageCommand= function(self)
			P2proxyp1 = self
			if P2proxy1 then
				self:SetTarget(P2proxy1):visible(true)
			end
		  end,
        },
		Def.ActorProxy{
		  ProxyThisMessageCommand= function(self)
			P2proxyp2 = self
			if P2proxy2 then
				self:SetTarget(P2proxy2):visible(false)
			end
		  end,
        },
		Def.ActorProxy{
		  ProxyThisMessageCommand= function(self)
			P2proxyp3 = self
			if P2proxy3 then
				self:SetTarget(P2proxy3):visible(false)
			end
		  end,
        },
		Def.ActorProxy{
		  ProxyThisMessageCommand= function(self)
			P2proxyp4 = self
			if P2proxy4 then
				self:SetTarget(P2proxy4):visible(false)
			end
		  end,
        },
		Def.ActorProxy{
		  ProxyThisMessageCommand= function(self)
			P2proxyp5 = self
			if P2proxy5 then
				self:SetTarget(P2proxy5):visible(false)
			end
		  end,
        },
		Def.ActorProxy{
		  ProxyThisMessageCommand= function(self)
			P2proxyp6 = self
			if P2proxy6 then
				self:SetTarget(P2proxy6):visible(false)
			end
		  end,
        },
        --And now, back to your regularly scheduled proxies. -Kid
		Def.ActorProxy{
		  ProxyThisMessageCommand= function(self)
			tang_planep = self
			if tang_plane then
				self:SetTarget(tang_plane):visible(false)
			end
		  end,
        },
		Def.ActorProxy{
		  ProxyThisMessageCommand= function(self)
			tang_plane2p = self
			if tang_plane2 then
				self:SetTarget(tang_plane2):visible(false)
			end
		  end,
        },
      },
      Def.ActorFrameTexture{
        Name= "actor_bb",
        InitCommand= function(self)

				--SCREENMAN:GetTopScreen():zoom(0.125);
				--SCREENMAN:GetTopScreen():x(200);

				--test_p1:zoom(1);

				--self:SetTextureName( 'Output'..aftNumber )
				self:SetWidth( SCREEN_WIDTH );
				self:SetHeight( SCREEN_HEIGHT );
				self:EnableDepthBuffer( false );
				self:EnableAlphaBuffer( false );
				self:EnableFloat( false );
				self:EnablePreserveTexture( true );

				--self:x(SCREEN_CENTER_X)
				--self:y(SCREEN_CENTER_Y)

				self:visible(true);
				self:rotationz(20);

				self:Create();

				--self:Draw()

				everything_tex = self;

			end,
		Def.Sprite{
		  ProxyThisMessageCommand= function(self)
			self:SetTexture(ball_tex:GetTexture()):Center()
		  end,
        },
      },
      Def.Model{
        Name= "actor_cb",
        Bones= "harzaMesh.txt",
        Materials= "harzaMesh.txt",
        Meshes= "harzaMesh.txt",
        OnCommand= function(self)
			tang_fQuad=self
			self:x(SCREEN_CENTER_X)
			self:y(SCREEN_CENTER_Y)
			self:zoomx(tang_width_ratio)--Scale zooms. -Kid
			self:zoomy(tang_height_ratio)
			self:diffuse(0,0,0,0)
			end,
      },
      Def.Quad{
        Name= "actor_db",
        InitCommand= function(self) tang_vibber = self end,
        OnCommand= cmd(visible,false),
      },
      Def.ActorFrame{
        Name= "actor_eb",
        InitCommand= function(self) tang_vibcontainer=self end,
        OnCommand= cmd(vibrate;effectmagnitude,0,0,0),
        --Replaced Model with ActorMultiVertex. -Kid
        Def.ActorMultiVertex{
          Name= "actor_fb",
          OnCommand= function(self)
				tang_wacky=self;
				self:cullmode('CullMode_Back')--This way, we don't have triangle hell. -Kid
				tang_wacky_wrap=self:AddWrapperState();--Because some zoom abuse is gonna happen. -Kid
				self:visible(false);
				tang_wacky_wrap:z(10*tang_width_ratio);--Scale positioning and zooms. -Kid
				tang_wacky_wrap:zoomx(0.5*tang_width_ratio);
				tang_wacky_wrap:zoomy(0.5*tang_height_ratio*-1);
				tang_wacky_wrap:zoomz(tang_height_ratio);--Added zoomz. -Kid
				self:diffusealpha(1);
				self:rotationx(0);
				self:rotationy(-180);
				tang_wacky_wrap:x(SCREEN_CENTER_X+0);
				tang_wacky_wrap:y(SCREEN_CENTER_Y+0);
				self:sleep(1);
				self:wag();
				self:effectmagnitude(-1*20,0,0);--Because of the *-1 zoomy. -Kid
				self:effectclock('bgm');
				self:effectperiod(10);
				self:queuecommand('blood_does');
			end,
          blood_doesCommand= function(self)
				--Make it so it actually draws the triangles. -Kid
				self:SetDrawState({Mode='DrawMode_Triangles', First= 1, Num= -1})
				--Have the AMV take shape. -Kid
				self:SetVertices(tang_Get3dwackyVerts());
				--Add in the AFT. -Kid
				self:SetTexture(everything_tex:GetTexture());
				self:visible(false)
			end,
        },
        --Replaced Model with ActorMultiVertex. -Kid
        Def.ActorMultiVertex{
          Name= "actor_gb",
          OnCommand= function(self)
				tang_twisty=self;
				self:cullmode('CullMode_Back')--This way, we don't have triangle hell. -Kid
				tang_twisty_wrap=self:AddWrapperState();--Because some zoom abuse is gonna happen. -Kid
				self:visible(false);
				tang_twisty_wrap:z(10*tang_width_ratio);--Scale positions and zooms. -Kid
				tang_twisty_wrap:zoomx(0.45*tang_width_ratio);
				tang_twisty_wrap:zoomy(0.45*tang_height_ratio*-1);
				tang_twisty_wrap:zoomz(tang_height_ratio);--Added zoomz. -Kid
				self:diffusealpha(1);
				self:rotationx(0);
				self:rotationy(0);
				tang_twisty_wrap:x(SCREEN_CENTER_X+0);
				tang_twisty_wrap:y(SCREEN_CENTER_Y+0);
				self:sleep(1);
				self:wag();
				self:effectmagnitude(-1*20,0,0);--Because of the *-1 zoomy. -Kid
				self:effectclock('bgm');
				self:effectperiod(10);
				self:queuecommand('blood_does');
			end,
          blood_doesCommand= function(self)
				--Make it so it actually draws the triangles. -Kid
				self:SetDrawState({Mode='DrawMode_Triangles', First= 1, Num= -1})
				--Have the AMV take shape. -Kid
				self:SetVertices(tang_GetTwistyVerts());
				--Add in the AFT. -Kid
				self:SetTexture(everything_tex:GetTexture());
				self:visible(false)
			end,
        },
      },
    },
  }),
}
