--An input handler, taken from TaroNuke's Spider Dance file, modified to suit what I need in the current file.
local InputHandler = function( event )
	-- if (somehow) there's no event, bail
	if not event then return end
	if event.type == "InputEventType_FirstPress" then
		
		if event.button == "Left" and event.PlayerNumber == PLAYER_1 then
			mawaru_keys[6-5] = 1
			MESSAGEMAN:Broadcast('StepLeftP1')
		end
		if event.button == "Down" and event.PlayerNumber == PLAYER_1 then
			mawaru_keys[7-5] = 1
			MESSAGEMAN:Broadcast('StepDownP1')
		end
		if event.button == "Up" and event.PlayerNumber == PLAYER_1 then
			mawaru_keys[8-5] = 1
			MESSAGEMAN:Broadcast('StepUpP1')
		end
		if event.button == "Right" and event.PlayerNumber == PLAYER_1 then
			mawaru_keys[9-5] = 1
			MESSAGEMAN:Broadcast('StepRightP1')
		end
		if event.button == "Left" and event.PlayerNumber == PLAYER_2 then
			mawaru_keys[6-1] = 1
			MESSAGEMAN:Broadcast('StepLeftP2')
		end
		if event.button == "Down" and event.PlayerNumber == PLAYER_2 then
			mawaru_keys[7-1] = 1
			MESSAGEMAN:Broadcast('StepDownP2')
		end
		if event.button == "Up" and event.PlayerNumber == PLAYER_2 then
			mawaru_keys[8-1] = 1
			MESSAGEMAN:Broadcast('StepUpP2')
		end
		if event.button == "Right" and event.PlayerNumber == PLAYER_2 then
			mawaru_keys[9-1] = 1
			MESSAGEMAN:Broadcast('StepRightP2')
		end
		
	end
	
	if event.type == "InputEventType_Release" then
		
		if event.button == "Left" and event.PlayerNumber == PLAYER_1 then
			mawaru_keys[6-5] = 0
		end
		if event.button == "Down" and event.PlayerNumber == PLAYER_1 then
			mawaru_keys[7-5] = 0
		end
		if event.button == "Up" and event.PlayerNumber == PLAYER_1 then
			mawaru_keys[8-5] = 0
		end
		if event.button == "Right" and event.PlayerNumber == PLAYER_1 then
			mawaru_keys[9-5] = 0
		end
		if event.button == "Left" and event.PlayerNumber == PLAYER_2 then
			mawaru_keys[6-1] = 0
		end
		if event.button == "Down" and event.PlayerNumber == PLAYER_2 then
			mawaru_keys[7-1] = 0
		end
		if event.button == "Up" and event.PlayerNumber == PLAYER_2 then
			mawaru_keys[8-1] = 0
		end
		if event.button == "Right" and event.PlayerNumber == PLAYER_2 then
			mawaru_keys[9-1] = 0
		end
		
	end

end
--TaroNuke's Mod system. Taken from Puuro's 'Hopes And Dreams' file.
--Because I don't know how to program a mods system, and I don't want to right now.
LoadActor("mods-taro.lua") --Load another lua file.
local cond_wp_result= GAMESTATE:IsHumanPlayer(0)

local cond_xp_result= GAMESTATE:IsHumanPlayer(1)

local cond_up_result= GAMESTATE:IsPlayerEnabled(PLAYER_1)

local cond_vp_result= GAMESTATE:IsPlayerEnabled(PLAYER_2)

local function optional_actor(cond, actor)
	if cond then return actor end
	return Def.Actor{}
end
local function diff_to_number(difficult)--Low-grade code for compatibility reasons. -Kid
    if difficult == 'Difficulty_Beginner' then return 0
    elseif difficult == 'Difficulty_Easy' then return 1
    elseif difficult == 'Difficulty_Medium' then return 2
    elseif difficult == 'Difficulty_Hard' then return 3
    elseif difficult == 'Difficulty_Challenge' then return 4
    elseif difficult == 'Difficulty_Edit' then return 5
    end
end
--Enclosed all queuemessage arguments. -Kid
return Def.ActorFrame{
  Name= "actor_yp",
  InitCommand= function(self)

	songName = GAMESTATE:GetCurrentSong():GetSongDir();
	
	sw = SCREEN_WIDTH
	sh = SCREEN_HEIGHT --shortcuts
	
	mawaru_sscore = {0,0}
	
end,
  OnCommand= function(self)
	
	judchild1 = nil
	judchild2 = nil
	for i=1,2 do
	    if SCREENMAN:GetTopScreen():GetChild('PlayerP'..i) then
		if SCREENMAN:GetTopScreen():GetChild('PlayerP'..i):GetChild('Judgment'):GetChild('Judgment') then
		    _G['judchild'..i] = SCREENMAN:GetTopScreen():GetChild('PlayerP'..i):GetChild('Judgment'):GetChild('Judgment')
		    --5.1/5.2's default theme.
		elseif SCREENMAN:GetTopScreen():GetChild('PlayerP'..i):GetChild('Judgment'):GetChild('JudgmentWithOffsets') then
		    --For those using Simply Love
		    _G['judchild'..i] = SCREENMAN:GetTopScreen():GetChild('PlayerP'..i):GetChild('Judgment'):GetChild('JudgmentWithOffsets')
		elseif SCREENMAN:GetTopScreen():GetChild('PlayerP'..i):GetChild('Judgment'):GetChild('') then--OH BOY. -Kid
		    --Ensure we don't break just by looking... -Kid
		    if SCREENMAN:GetTopScreen():GetChild('PlayerP'..i):GetChild('Judgment'):GetChild(''):GetChild('Judgment') then
		    _G['judchild'..i] = SCREENMAN:GetTopScreen():GetChild('PlayerP'..i):GetChild('Judgment'):GetChild(''):GetChild('Judgment')
		    else _G['judchild'..i] = SCREENMAN:GetTopScreen():GetChild('PlayerP'..i):GetChild('Judgment'):GetChild('') end
		    --5.0's default theme does something really silly with player judgments! -Kid
		end
		if (not _G['judchild'..i].Load) then--Did we do it right? -Kid
		    _G['judchild'..i]=nil--set it to not exist if we can't use it. -Kid
		    SCREENMAN:SystemMessage("Warning! Judgment font can't be changed!")
		end
	    else
		_G['judchild'..i]=nil
		
		
	    end
	end
	
	function Sound(str)
		local met = GAMESTATE:GetCurrentSong():GetSongDir();
		SOUND:PlayOnce(met..'lua/sounds/'..str..'.ogg');
	end
	
	function mawaru_shuffle(t)
		local n = table.getn(t)
	 
		while n >= 2 do
			-- n is now the last pertinent index
			local k = math.random(n) -- 1 <= k <= n
			-- Quick swap
			t[n], t[k] = t[k], t[n]
			n = n - 1
		end
	 
		return t
	end
	
	mawaru_editor = false;
	mawaru_divine = false;
	mawaru_god = false;
	for pn=1,2 do
		if GAMESTATE:PlayerIsUsingModifier(pn-1,'DivinEntity') then
			mawaru_divine = true;
		end
		if GAMESTATE:PlayerIsUsingModifier(pn-1,'cel-cmd') or GAMESTATE:PlayerIsUsingModifier(pn-1,',metal-cmd')
		or GAMESTATE:PlayerIsUsingModifier(pn-1,'cel-cmd-notweens') or GAMESTATE:PlayerIsUsingModifier(pn-1,',metal-cmd-notweens') then
			mawaru_god = true;
		end
	end
	
	mawaru_4bl = 240/115;
	
	mawaru_score = {0,0}
	mawaru_misc_score = {0,0}
	mawaru_nue_scoreb = {0,0}
	mawaru_sf_scoreb = {0,0}
	
	mawaru_lives_saved = {0,0}
	mawaru_lives_bonus = {0,0}
	
	mawaru_stretchers = {}
	
	function GoodSound()
		Sound('good')
		local rng = math.random(1,100)
		if rng < 80 then
			Sound('wurtz/good'..math.random(1,3))
		else
			Sound('wurtz/good'..math.random(1,5))
		end
	end
	function BadSound()
		Sound('wrong');
		Sound('bad_voice_'..math.random(1,3))
	end
	
	function mawaru_hittest(ax,ay,aw,ah,bx,by,bw,bh)
				
		if ax-(aw/2) > bx+(bw/2) then return false end
		if ax+(aw/2) < bx-(bw/2) then return false end
		if ay-(ah/2) > by+(bh/2) then return false end
		if ay+(ah/2) < by-(bh/2) then return false end
		
		return true;
		
	end
	
	function mawaru_clamp(val, min, max)
		local ret = val
		if ret < min then ret = min end
		if ret > max then ret = max end
		return ret
	end
	
	mawaru_nickplaying = false
	srt8_samiplaying = false
	
	mawaru_game_timer = 9999;
	
	mawaru_reisen_rng = math.random(0,1);
	mawaru_ecfa_rng = math.random(1,3);
	if not FUCK_EXE then
		mawaru_ecfa_rng = 2;
	end
	mawaru_ecfa_rngt = {'a','b','c'}

	mawaru_games = {{0,0,0,0,0,0},{0,0,0,0,0,0}}
	mawaru_gamestate = 0;
	mawaru_curgame = 0;

	mawaru_keys = {0,0,0,0,0,0,0,0}
	mawaru_held = {0,0,0,0,0,0,0,0}
	
	mawaru_title_let = {}
	
	mawaru_title_order = {0,1,2,1,3,4,5,6,7,4,8,1,9,10,3,0}
	
	mawaru_flip_patient = 2-.1;
	mawaru_patient_flipper = 1;
	mawaru_patients = {}
	
	function mawaru_spawn_title()
		local offs = 0;
		for i=1,16 do
			local a = mawaru_title_let[i]
			
			if i == 7 or i==16 then offs = 0 end
			
			if a then
				a:visible(true);
				a:diffusealpha(0);
				a:animate(0);
				--a:zoom(0);
				a:setstate(mawaru_title_order[i])
				a:skewx(-0.1);
				if i < 7 then
					a:x(160+36*(i-1))
					a:y(143)
				elseif i < 16 then
					a:x(186+36*(i-7))
					a:y(214)
				else
					a:x(464);
					a:y(303);
				end
				
				local l = mawaru_title_order[i]
				
				if i == 1 or l == 2 or l == 7 then
					local mod = 6
					offs = offs+mod;
					a:addx(-mod/2);
				end
				if l == 6 or l == 8 or l == 9 then
					local mod = -14
					offs = offs+mod;
					a:addx(-mod/2);
				end
				
				a:addx(offs);
				a:addy(-60);
				
				if i < 7 then
					
				elseif i < 16 then
					a:sleep(0.2);
				else
					a:sleep(0.8);
				end
				
				a:sleep(0.04*i);
				a:bounceend(0.3);
				a:diffusealpha(2);
				if i == 16 then
					a:zoom(1.5);
				else
					a:zoom(1.3);
				end
			end
		end
	end

	-- kobe!!
	local RATES = {'0.3','0.4','0.5','0.6','0.7','0.8','0.9','1.1','1.2','1.3','1.4','1.5','1.6','1.7','1.8','1.9','2.0'};
	RATEMOD = 1;
	for i = 1, table.getn(RATES) do
		if GAMESTATE:PlayerIsUsingModifier(0,RATES[i]..'xmusic') or GAMESTATE:PlayerIsUsingModifier(1,RATES[i]..'xmusic') then
			RATEMOD = RATES[i];
		end
	end
	
	mawaru_reverse = {0,0}
	
	for pn=0,1 do
		if GAMESTATE:PlayerIsUsingModifier(pn,'reverse') then
			mawaru_reverse[pn+1] = 100;
		end
	end

	mawaru_difficulty = {-1,-1}
	
	mawaru_speedmod = {2.5,2.5}
	
	function mawaru_round(num)
		return math.floor((num * 100) + 0.5) / 100
	end
	
	if GAMESTATE:IsPlayerEnabled(PLAYER_1) then
		mawaru_difficulty[1] = diff_to_number(GAMESTATE:GetCurrentSteps(PLAYER_1):GetDifficulty())
		for i=0, 10, 0.01 do
			if GAMESTATE:PlayerIsUsingModifier(0,mawaru_round(i)..'x') then mawaru_speedmod[1] = i; break; end
		end
	end
	if GAMESTATE:IsPlayerEnabled(PLAYER_2) then
		mawaru_difficulty[2] = diff_to_number(GAMESTATE:GetCurrentSteps(PLAYER_2):GetDifficulty())
		for i=0, 10, 0.01 do
			if GAMESTATE:PlayerIsUsingModifier(1,mawaru_round(i)..'x') then mawaru_speedmod[2] = i; break; end
		end
	end
	
	if mawaru_difficulty[1] > -1 and mawaru_difficulty[2] < 0 then
		mawaru_maxdifficulty = mawaru_difficulty[1]
		mawaru_mindifficulty = mawaru_difficulty[1]
	elseif mawaru_difficulty[2] > -1 and mawaru_difficulty[1] < 0 then
		mawaru_maxdifficulty = mawaru_difficulty[2]
		mawaru_mindifficulty = mawaru_difficulty[2]
	elseif mawaru_difficulty[1] > -1 and mawaru_difficulty[2] > -1 then
		mawaru_maxdifficulty = math.max(mawaru_difficulty[1], mawaru_difficulty[2]);
		mawaru_mindifficulty = math.min(mawaru_difficulty[1], mawaru_difficulty[2]);
	else
		mawaru_maxdifficulty = 3
		mawaru_mindifficulty = 3
	end
	
end,
  Def.Quad{
    Name= "actor_zp",
    InitCommand= cmd(visible,false),
    OnCommand= cmd(sleep,1000),
  },
  Def.Quad{
    Name= "actor_Ap",
    InitCommand= function(self)
		
			checked = false;
		
			
			
---------------------------------------------------------------------------------------
----------------------Some lazy mod helpers--------------------------------------------
---------------------------------------------------------------------------------------
			
			--laziness
			
			function perframe( beat, endBeat )
				if not endBeat then endBeat = beat+1 end
				local cur = GAMESTATE:GetSongBeat();
				if cur>=beat and cur<endBeat then return true end
				return false
			end
			
--how can I make simple m0d?
--this will instantly turn a mod on to max and then quickly turn it off with the specified parapapyrusers
--it's a simple mod

function simple_m0d(beat,strength,mult,mod,pn)
	if not strength then strength = 400 end
	if not mult then mult = 1 end
	if not mod then mod = 'drunk' end
	
	local alive = math.max(2*mult*math.abs(strength)/100,0.25)
	
	table.insert(mods,{beat,'*100000 '..strength..' '..mod,pn});
	table.insert(mods,{beat+.1,'*'..((1/mult)*math.abs(strength)/100)..' no '..mod,pn});
end
			
--alternates a mod back and forth before resetting to 0
--beat,num,div,amt,mod,pn
function mod_wiggle(beat,num,div,spd,amt,mod,pn,first)
	local fluct = 1
	for i=0,(num-1) do
		b = beat+(i/div)
		local m = 1
		if i==0 and not first then m = 0.5 end
		table.insert(mods,{b,'*'..math.abs(spd*m*amt/10)..' '..(amt*fluct)..' '..mod..'',pn});
		fluct = fluct*-1;
	end
	table.insert(mods,{beat+(num/div),'*'..math.abs(amt/20)..' no '..mod..'',pn});
end

function mod_insert(s,m,pn)
	table.insert(mods,{s,m,pn})
end

function mod_beat2(b,e,amt)
	mod_insert(b-.5,'*10000 '..amt..' beat');
	mod_insert(e-.5,'*10000 no beat');
end

			
			mod_firstSeenBeat = GAMESTATE:GetSongBeat(); --necessary to prevent long freezes
			
			
			
			
			
			
			
			
			
			
			
---------------------------------------------------------------------------------------
----------------------Begin tables 'n stuff--------------------------------------------
---------------------------------------------------------------------------------------
			
--lua course :D
curmod = 1;
--{beat,mod,player}
mods = {
{61,'*10000 stealth, *10000 100 beat'},
{86,'*10000 no stealth, *10000 no beat'},

{140,'*10000 stealth, *10000 dark'},
{164,'*10000 no stealth, *10000 no dark'},

{424,'*1000 beat'},
{464,'*1000 no beat'},

{464,'*1000 stealth, *1000 -150 centered'},
{504,'*1000 no stealth, *1000 no centered'},

}
			
			
			
			--this is both a message broadcaster and a function runner
			--if you put {beat,'String'}, then 'String' is broadcast as a message on that beat
			--if you put {beat,function() somecode end}, then function() is run at that beat
			--see example on beat 32
			
			mawaru_closetime = 0.8;
			mawaru_opentime = 0.8;
			
			mawaru_tvshrinktime = 0.4;
			mawaru_tvgrowtime = 0.8;
			mawaru_aya_ontime = 0.5;
			
			mawaru_bpm = 115;
			
			curaction = 1;
			--{beat,thing,persists}
			mod_actions = {
			
				{7,function()
					mawaru_spawn_title();					
				end},
				
				{7,function()
					for i=1,8 do
						mawaru_patients[i]:visible(false);
					end
				end,true},
			
				{7,'LightUp'},
				{7,function()--Just make it consistent from the start.
					for pn=1,2 do
						local a = _G['P'..pn]
						local d = 0.25; if pn == 2 then d = 0.75 end
						if a then
							a:x(SCREEN_WIDTH*d)
						end
						local j = _G['judchild'..pn]
						if j then
							j:Load(songName..'lua/jud/itg 2x6.png')
						end
					end
				end},
				{12,'Subtitle'},
				{15.5,'SubOff',true},
				{15.5,'StaticOn'},
				{16,'StaticOff'},
				{16,function()
					MESSAGEMAN:Broadcast('DoHospital');
					mawaru_outerbg:visible(true);
				end},
				{16,function()
					mawaru_innerbg:visible(true);
					mawaru_innerbg2:visible(true);
				end,true},
				{16,function()
					mawaru_colorant:accelerate(8*60/115);
					mawaru_colorant:x(0.05);
					
					if not GAMESTATE:IsPlayerEnabled(PLAYER_1) then
						mawaru_lightmask1:visible(false)
						mawaru_lightshine1:visible(false)
						mawaru_lightbulb1:setstate(1);
					end
					if not GAMESTATE:IsPlayerEnabled(PLAYER_2) then
						mawaru_lightmask2:visible(false)
						mawaru_lightshine2:visible(false)
						mawaru_lightbulb2:setstate(1);
					end
					
				end,true},
				{25,function()
					for pn=1,2 do
						local d = 320; if pn==2 then d=-320 end
						if GAMESTATE:IsPlayerEnabled(pn-1) then
							mawaru_stretchers[pn]:accelerate(0.4)
							mawaru_stretchers[pn]:addx(-d)
							mawaru_stretchers[pn]:queuecommand('NextPatient');
							mawaru_stretchers[pn]:sleep(0.3);
							mawaru_stretchers[pn]:decelerate(0.4)
							mawaru_stretchers[pn]:addx(d)
						end
					end
				end},
				{32,'Close'},
				{34,'Text1On'},
				{38,'Text1Off'},
				{37.5,'Open'},
				
				{58,'Text2On'},
				{58,function() --Make the playfields line up with the file's arrows. -Kid
					if GAMESTATE:IsHumanPlayer(0) then
						P1:x(SCREEN_CENTER_X-160*(SCREEN_WIDTH/640)):zoomx(SCREEN_WIDTH/640)
					end
					if GAMESTATE:IsHumanPlayer(1) then
						P2:x(SCREEN_CENTER_X+160*(SCREEN_WIDTH/640)):zoomx(SCREEN_WIDTH/640)
					end
				end},
				{62,'Text2Off'},
				
				{55,'Close'},
				{61.5,'Open'},
				{61.5,function() MESSAGEMAN:Broadcast('ShowGame1'); mawaru_gamestate = 1; mawaru_curgame = 1; end},
				
				{75,function()
					for pn=1,2 do
						local d = 1 if pn==2 then d = -1 end
						_G['mawaru_nue_fp_sinewavep'..pn]:decelerate(30/115);
						_G['mawaru_nue_fp_sinewavep'..pn]:x(32*d);
						_G['mawaru_nue_fp_sinewavep'..pn]:decelerate(60/115);
						_G['mawaru_nue_fp_sinewavep'..pn]:x(-40*d);
						_G['mawaru_nue_fp_sinewavep'..pn]:decelerate(60/115);
						_G['mawaru_nue_fp_sinewavep'..pn]:x(50*d);
						_G['mawaru_nue_fp_sinewavep'..pn]:decelerate(60/115);
						_G['mawaru_nue_fp_sinewavep'..pn]:x(-60*d);
						_G['mawaru_nue_fp_sinewavep'..pn]:decelerate(30/115);
						_G['mawaru_nue_fp_sinewavep'..pn]:x(70*d);
						_G['mawaru_nue_fp_sinewavep'..pn]:decelerate(60/115);
						_G['mawaru_nue_fp_sinewavep'..pn]:x(-80*d);
					end
				end},
				
				{79.5,'ReturnInnerBG'},
				
				{80,function()
					local anywon = false;
					for pn=1,2 do
						if mawaru_nue_score[pn] == mawaru_nue_numhidden[ mawaru_difficulty[pn]+1 ] then
							mawaru_nue_scoreb[pn] = mawaru_nue_score[pn]*2 + 1
							anywon = true
							MESSAGEMAN:Broadcast('MawaRightLowP'..pn);
						else
							mawaru_nue_scoreb[pn] = mawaru_nue_score[pn]*2
							MESSAGEMAN:Broadcast('MawaWrongLowP'..pn);
						end
						mawaru_score[pn] = mawaru_score[pn]+mawaru_nue_scoreb[pn]
					end
					if anywon then
						GoodSound()
					else
						BadSound()
					end
				end},
				
				{83,function() mawaru_gamestate = 0; mawaru_curgame = 0; end},
				
				{82,'Text3On'},
				{82,function() --Revert playfields to normal. -Kid
					if GAMESTATE:IsHumanPlayer(0) then
						P1:x(SCREEN_WIDTH*0.25):zoomx(1)
					end
					if GAMESTATE:IsHumanPlayer(1) then
						P2:x(SCREEN_WIDTH*0.75):zoomx(1)
					end
				end},
				{88,'Text3Small'},
				
				{88,function() mawaru_game_timer = 104 end},
				
				{83,'AyaOn'},
				{86,'TVGrow'},
				{85,'HideGame1'},
				
				--{87,'Open'},
				{87,function() MESSAGEMAN:Broadcast('ShowGame2'); mawaru_gamestate = 1; mawaru_curgame = 2; end},
				
				{102,'Text3Off'},
				{104,'TVShrink'},
				{104,function() mawaru_gamestate = 0; mawaru_curgame = 0; end},
				
				{106,'HideGame2'},
				
				{108,'SpeedUp1'},
				{108,function()
					for pn=1,2 do
						if GAMESTATE:IsPlayerEnabled(pn-1) then
							_G['mawaru_lightshine'..pn]:linear(240/120);
							_G['mawaru_lightshine'..pn]:diffuse(.5,1,1,.3);
						end
					end
					mawaru_darkness:linear(120/240);
					mawaru_darkness:glow(0,1,1,.1);
				end},
				{109,function() mawaru_bpm = 120; MESSAGEMAN:Broadcast('UpdateBPM'); end},
				{110,function() mawaru_bpm = 125; MESSAGEMAN:Broadcast('UpdateBPM'); end},
				{111,function() mawaru_bpm = 130; MESSAGEMAN:Broadcast('UpdateBPM'); end},
				{112,function() mawaru_bpm = 135; MESSAGEMAN:Broadcast('UpdateBPM');
					mawaru_closetime = 0.8*(115/135);
					mawaru_opentime = 0.8*(115/135);
					
					mawaru_tvshrinktime = 0.4*(115/135);
					mawaru_tvgrowtime = 0.8*(115/135);
					mawaru_aya_ontime = 0.5*(115/135);
					
					mawaru_4bl = 240/135;
				end,true},
				
				{104,function()
					for pn=1,2 do
						MESSAGEMAN:Broadcast('MawaBodyScoreP'..pn);
						mawaru_score[pn] = mawaru_score[pn]+mawaru_body_score[pn]
						mawaru_lives_saved[pn] = mawaru_lives_saved[pn]+1
					end
					GoodSound()
				end},
				{108,function()
				
					for pn=1,2 do
						local d = 320; if pn==2 then d=-320 end
						if GAMESTATE:IsPlayerEnabled(pn-1) then
							mawaru_stretchers[pn]:queuecommand('PatientEnd');
							MESSAGEMAN:Broadcast('JumpPatientP'..pn);
							MESSAGEMAN:Broadcast('JumpPatient1P'..pn);
							
						end
					end
				
					for pn=1,2 do
						local d = 320; if pn==2 then d=-320 end
						if GAMESTATE:IsPlayerEnabled(pn-1) then
							mawaru_stretchers[pn]:accelerate(0.3)
							mawaru_stretchers[pn]:addx(-d)
							mawaru_stretchers[pn]:queuecommand('NextPatient');
							mawaru_stretchers[pn]:sleep(0.2);
							mawaru_stretchers[pn]:decelerate(0.3)
							mawaru_stretchers[pn]:addx(d)
						end
					end
				end},
				
				{113,'Close'},
				{113,'Text4On'},
				{118,'Text4Off'},
				{117.5,'Open'},
				
				{138,'Text5On'},
				{138,function() --Make the playfields line up with the file's arrows. -Kid
					if GAMESTATE:IsHumanPlayer(0) then
						P1:x(SCREEN_CENTER_X-160*(SCREEN_WIDTH/640)):zoomx(SCREEN_WIDTH/640)
					end
					if GAMESTATE:IsHumanPlayer(1) then
						P2:x(SCREEN_CENTER_X+160*(SCREEN_WIDTH/640)):zoomx(SCREEN_WIDTH/640)
					end
				end},
				{142,'Text5Small'},
				
				{152,'Text5Off'},
				
				{136,'Close'},
				{141,'Open'},
				{141.5,function() MESSAGEMAN:Broadcast('ShowGame3'); mawaru_gamestate = 1; mawaru_curgame = 3; end},
				
				
				
				{160,'ReturnInnerBG'},
				{160,function() mawaru_gamestate = 0; mawaru_curgame = 0; end},
				
				{162,'Text6On'},
				{162,function() --Revert playfields to normal. -Kid
					if GAMESTATE:IsHumanPlayer(0) then
						P1:x(SCREEN_WIDTH*0.25):zoomx(1)
					end
					if GAMESTATE:IsHumanPlayer(1) then
						P2:x(SCREEN_WIDTH*0.75):zoomx(1)
					end
				end},
				{168,'Text6Small'},
				
				{163,'AyaOn'},
				{166,'TVGrow'},
				{165,'HideGame3'},
				
				{167,function() mawaru_gamestate = 1; mawaru_curgame = 4; end},
				{167.1,function() MESSAGEMAN:Broadcast('ShowGame4'); end},
				
				{168,function() mawaru_game_timer = 184 end},
				
				{182,'Text6Off'},
				{183,'TVShrink'},
				{183,function() mawaru_gamestate = 0; mawaru_curgame = 0; end},
				{186,'HideGame4'},
				
				{184,function()
					local anywon = false;
					for pn=1,2 do
						if mawaru_operation_won[pn] == 1 then
							mawaru_lives_saved[pn] = mawaru_lives_saved[pn]+1
							mawaru_lives_bonus[pn] = mawaru_lives_bonus[pn]+5;
							mawaru_score[pn] = mawaru_score[pn]+5;
							anywon = true
							MESSAGEMAN:Broadcast('MawaRightP'..pn);
						else
							mawaru_turnofflight(pn)
							MESSAGEMAN:Broadcast('MawaWrongP'..pn);
						end
					end
					if anywon then
						GoodSound()
					else
						BadSound()
					end
				end},
				{192,function()
				
					for pn=1,2 do
						local d = 320; if pn==2 then d=-320 end
						if GAMESTATE:IsPlayerEnabled(pn-1) then
							mawaru_stretchers[pn]:queuecommand('PatientEnd');
							if mawaru_operation_won[pn] ~= 1 then
								MESSAGEMAN:Broadcast('KillPatientP'..pn);
								MESSAGEMAN:Broadcast('KillPatient2P'..pn);
							else
								MESSAGEMAN:Broadcast('JumpPatientP'..pn);
								MESSAGEMAN:Broadcast('JumpPatient2P'..pn);
							end
						end
					end
				
					for pn=1,2 do
						local d = 320; if pn==2 then d=-320 end
						if GAMESTATE:IsPlayerEnabled(pn-1) then
							mawaru_stretchers[pn]:accelerate(0.3)
							mawaru_stretchers[pn]:addx(-d)
							mawaru_stretchers[pn]:queuecommand('NextPatient');
							mawaru_stretchers[pn]:sleep(0.2);
							mawaru_stretchers[pn]:decelerate(0.3)
							mawaru_stretchers[pn]:addx(d)
						end
					end
				end},
				
				{191,'SpeedUp2'},
				{192,function() mawaru_bpm = 155; MESSAGEMAN:Broadcast('UpdateBPM');
					mawaru_closetime = 0.8*(115/155);
					mawaru_opentime = 0.8*(115/155);
					
					mawaru_tvshrinktime = 0.4*(115/155);
					mawaru_tvgrowtime = 0.8*(115/155);
					mawaru_aya_ontime = 0.5*(115/155);
					
					for pn=1,2 do
						if GAMESTATE:IsPlayerEnabled(pn-1) then
							_G['mawaru_lightshine'..pn]:linear(0.5);
							_G['mawaru_lightshine'..pn]:diffuse(.5,.5,1,.6);
						end
					end
					mawaru_darkness:linear(0.5);
					mawaru_darkness:glow(.3,.3,1,.2);
					
					mawaru_4bl = 240/155;
					
				end,true},
				
				{200,'Close'},
				{202,'Text7On'},
				{206,'Text7Off'},
				{205.5,'Open'},
				
				{206,function()
					if judchild1 then
						judchild1:Load(songName..'lua/jud/meu 1x6.png');
					end
					if judchild2 then
						judchild2:Load(songName..'lua/jud/meu 1x6.png');
					end
				end},
				
				{211,'ToshiUp'},
				{215,'ToshiUp'},
				{223,'KaedeUp'},
				--{223,'ToshiUp'},
				
				{204,'ShowGame5'},
				
				{224.5,'ReturnInnerBG'},
				
				{226,'Text8On'},
				{232,'Text8Small'},
				
				{228,'HideGame5'},
				
				{228,function()
					local ass = {'techno 2x6.png','ddr 1x6.png','piu 1x6.png'};
					for pn=1,2 do
						local rng = math.random(1,3)
						if _G['judchild'..pn] then
							--_G['P'..pn]:GetChild('Judgment'):GetChild(''):Load(songName..'lua/jud/'..ass[rng]);
							_G['judchild'..pn]:Load(songName..'lua/jud/itg 2x6.png');
						end
					end
				end},
				
				{232,function() mawaru_game_timer = 264 end},
				
				{227,'AyaOn'},
				{230,'TVGrow'},
				
				--{87,'Open'},
				{231,function() MESSAGEMAN:Broadcast('ShowGame6'); mawaru_gamestate = 1; mawaru_curgame = 6; end},
				
				{261,'Text8Off'},
				{264,'TVShrink2'},
				{264,function() mawaru_gamestate = 0; mawaru_curgame = 0; end},
				{268,'HideGame6'},
				{264,function()
					for pn=1,2 do
						MESSAGEMAN:Broadcast('MawaBlombyScoreP'..pn);
						mawaru_score[pn] = mawaru_score[pn]+mawaru_blomby_score[pn]
					end
					GoodSound()
				end},
				
				{269,'TVGrow'},
				
				{266,'Text10On'},
				{272,'Text10Small'},
				
				--{87,'Open'},
				{271,function() MESSAGEMAN:Broadcast('ShowGame7');mawaru_gamestate = 1; mawaru_curgame = 7; end},
				{272,function() mawaru_game_timer = 288 end},
				{284,'Text10Off'},
				{288,'TVShrink'},
				{288,function() mawaru_gamestate = 0; mawaru_curgame = 0; end},
				{292,'HideGame7'},
				
				
				
				{288,function()
					local anywon = false;
					for pn=1,2 do
						if not mawaru_sbahj_dead[pn] then
							mawaru_lives_saved[pn] = mawaru_lives_saved[pn]+1
							mawaru_lives_bonus[pn] = mawaru_lives_bonus[pn]+5;
							mawaru_score[pn] = mawaru_score[pn]+5;
							anywon = true
							MESSAGEMAN:Broadcast('MawaRightP'..pn);
						else
							mawaru_turnofflight(pn)
							MESSAGEMAN:Broadcast('MawaWrongP'..pn);
						end
					end
					if anywon then
						GoodSound()
					else
						BadSound()
					end
				end},
				{292,function()
				
					for pn=1,2 do
						local d = 320; if pn==2 then d=-320 end
						if GAMESTATE:IsPlayerEnabled(pn-1) then
							mawaru_stretchers[pn]:queuecommand('PatientEnd');
							if mawaru_sbahj_dead[pn] then
								MESSAGEMAN:Broadcast('KillPatientP'..pn);
								MESSAGEMAN:Broadcast('KillPatient3P'..pn);
							else
								MESSAGEMAN:Broadcast('JumpPatientP'..pn);
								MESSAGEMAN:Broadcast('JumpPatient3P'..pn);
							end
						end
					end
				
					for pn=1,2 do
						local d = 320; if pn==2 then d=-320 end
						if GAMESTATE:IsPlayerEnabled(pn-1) then
							mawaru_stretchers[pn]:accelerate(0.3)
							mawaru_stretchers[pn]:addx(-d)
							mawaru_stretchers[pn]:queuecommand('NextPatient');
							mawaru_stretchers[pn]:sleep(0.2);
							mawaru_stretchers[pn]:decelerate(0.3)
							mawaru_stretchers[pn]:addx(d)
						end
					end
				end},
				
				
				
				{293,'SpeedUp3',true},
				{294,function() mawaru_bpm = 165; MESSAGEMAN:Broadcast('UpdateBPM'); end},
				{295,function() mawaru_bpm = 175; MESSAGEMAN:Broadcast('UpdateBPM');
					mawaru_closetime = 0.8*(115/175);
					mawaru_opentime = 0.8*(115/175);
					
					mawaru_tvshrinktime = 0.4*(115/175);
					mawaru_tvgrowtime = 0.8*(115/175);
					mawaru_aya_ontime = 0.5*(115/175);
					
					for pn=1,2 do
						if GAMESTATE:IsPlayerEnabled(pn-1) then
							_G['mawaru_lightshine'..pn]:linear(0.5);
							_G['mawaru_lightshine'..pn]:diffuse(.5,0,1,.6);
						end
					end
					mawaru_darkness:linear(0.5);
					mawaru_darkness:glow(.6,0,1,.3);
					
					mawaru_4bl = 240/175;
					
				end,true},
				
				{298,'Close'},
				{298,'Text11On'},
				{303,'Text11Off'},
				{302,'Open'},
				{302,'ShowGame8'},
				
				{323.2,function() Sound('PESKY BEE'); end},
				{320,function()
					for pn=1,2 do
						local a = _G['P'..pn]
						if a then
							a:z(1)
						end
					end
				end},
				
				{323,function()
					for pn=1,2 do
						local a = _G['P'..pn]
						if a then
							a:x(SCREEN_WIDTH*(377/640));
							a:y(SCREEN_WIDTH*(295/640));
							a:zoom(0.3);
						end
					end
				end},
				{323.9,function()
					for pn=1,2 do
						local a = _G['P'..pn]
						if a then
							a:rotationx(-60);
							a:rotationy(30);
							a:rotationz(30);
							a:zoom(0);
							--GAMESTATE:ApplyGameCommand('mod,*1000 40 flip, *1000 200 drunk, *1000 200 tipsy, *1000 centered',pn)
							taronuke_mods('*1000 40 flip, *1000 200 drunk, *1000 200 tipsy, *1000 centered',pn)
						end
					end
				end},
				{326,function()
					for pn=1,2 do
						local a = _G['P'..pn]
						if a then
							a:zoom(0.3);
						end
					end
				end},
				{326.8,function()
					for pn=1,2 do
						local a = _G['P'..pn]
						if a then
							a:zoom(0);
						end
					end
				end},
				
				{328,function()
					for pn=1,2 do
						local a = _G['P'..pn]
						if a then
							a:z(-1)
						end
					end
				end},
				
				{340,function()
					for pn=1,2 do
						local a = _G['P'..pn]
						local d = 0.25; if pn == 2 then d = 0.75 end
						if a then
							a:rotationx(0);
							a:rotationy(0);
							a:rotationz(0);
							a:zoom(1);
							a:x(SCREEN_WIDTH*d)
							a:y(SCREEN_HEIGHT/2);
							--GAMESTATE:ApplyGameCommand('mod,*1000 no flip, *1000 no drunk, *1000 no tipsy, *1000 no centered',pn)
							taronuke_mods('*1000 no flip, *1000 no drunk, *1000 no tipsy, *1000 no centered',pn)
						end
					end
				end},
				
				{330,'ReturnInnerBG'},
				{339,'Close'},
				{340,'Text12On'},
				{340,'HideGame8'},
				
				{341,function()--JudgeWindowAdd -> TimingWindowAdd. -Kid
					mawaru_chike_recordedJWA = PREFSMAN:GetPreference('TimingWindowAdd');
				end},
				{342,function()--JudgeWindowAdd -> TimingWindowAdd. -Kid
					PREFSMAN:SetPreference('TimingWindowAdd',0.005)
					--fantastic window 0.0215 -> 0.0265
				end},
				
				{345,'Open'},
				{346,'Text12Small'},
				{345,function() MESSAGEMAN:Broadcast('ShowGame9'); mawaru_gamestate = 1; mawaru_curgame = 9; end},
				--{348,function() mawaru_game_timer = 384 end},
				
				{380,'Text12Off'},
				{384,'ReturnInnerBG'},
				{388,'HideGame9'},
				{388,function() mawaru_gamestate = 0; mawaru_curgame = 0;
					for pn=1,2 do
						local a = _G['P'..pn]
						if a then
							a:zoom(1);
						end
					end
					if FUCK_EXE then
						GAMESTATE:ReloadSteps()
					end--JudgeWindowAdd -> TimingWindowAdd. -Kid
					PREFSMAN:SetPreference('TimingWindowAdd',mawaru_chike_recordedJWA)
				end},
				
				{384,function()
					local anywon = false;
					for pn=1,2 do
						if mawaru_chike_lives[pn] > 0 then
							mawaru_score[pn] = mawaru_score[pn]+5;
							mawaru_misc_score[pn] = mawaru_misc_score[pn]+5;
							anywon = true
							MESSAGEMAN:Broadcast('MawaRightP'..pn);
						else
							mawaru_turnofflight(pn)
							MESSAGEMAN:Broadcast('MawaWrongP'..pn);
						end
					end
					if anywon then
						MESSAGEMAN:Broadcast('Neutral');
						GoodSound()
					else
						BadSound()
					end
				end},
				
				
				{392,'AyaOn'},
				{393,'Text13On'},
				{397,'TVGrow'},
				{398,'ShowGame10'},
				{400,'Text13Small'},
				
				--{87,'Open'},
				{400,function() MESSAGEMAN:Broadcast('ShowGame10'); mawaru_gamestate = 1; mawaru_curgame = 10; end},
				{400,function() mawaru_game_timer = 417 end},
				
				{412,'Text13Off'},
				--{416,'TVShrink'},
				{415.5,'TVShrinkInstant'},
				{415.5,'StaticOn'},
				{416,'StaticOff'},
				{415.5,function() mawaru_gamestate = 0; mawaru_curgame = 0; end},
				{420,'HideGame10'},
				
				{416,'SpeedUp4',true},
				{416,function() mawaru_bpm = 195; MESSAGEMAN:Broadcast('UpdateBPM');
					mawaru_closetime = 0.8*(115/195);
					mawaru_opentime = 0.8*(115/195);
					
					mawaru_tvshrinktime = 0.4*(115/195);
					mawaru_tvgrowtime = 0.8*(115/195);
					mawaru_aya_ontime = 0.5*(115/195);
					
					for pn=1,2 do
						if GAMESTATE:IsPlayerEnabled(pn-1) then
							_G['mawaru_lightshine'..pn]:diffuse(1,0,0,.4);
						end
					end
					mawaru_darkness:linear(0);
					mawaru_darkness:glow(0.4,0,0,.4);
					
					mawaru_4bl = 240/195;
					
				end,true},
				
				{416,function()
					local anywon = false;
					for pn=1,2 do
						if not mawaru_anders_dead[pn] then
							mawaru_lives_saved[pn] = mawaru_lives_saved[pn]+1
							mawaru_lives_bonus[pn] = mawaru_lives_bonus[pn]+5;
							mawaru_score[pn] = mawaru_score[pn]+5;
							anywon = true
							MESSAGEMAN:Broadcast('MawaRightP'..pn);
						else
							mawaru_turnofflight(pn)
							MESSAGEMAN:Broadcast('MawaWrongP'..pn);
						end
					end
					if anywon then
						GoodSound()
					else
						BadSound()
					end
				end},
				{416,function()
				
					for pn=1,2 do
						local d = 320; if pn==2 then d=-320 end
						if GAMESTATE:IsPlayerEnabled(pn-1) then
							mawaru_stretchers[pn]:queuecommand('PatientEnd');
							if mawaru_anders_dead[pn] then
								MESSAGEMAN:Broadcast('KillPatientP'..pn);
								MESSAGEMAN:Broadcast('KillPatient4P'..pn);
							else
								MESSAGEMAN:Broadcast('JumpPatientP'..pn);
								MESSAGEMAN:Broadcast('JumpPatient4P'..pn);
							end
						end
					end
				
					for pn=1,2 do
						local d = 320; if pn==2 then d=-320 end
						if GAMESTATE:IsPlayerEnabled(pn-1) then
							mawaru_stretchers[pn]:accelerate(0.3)
							mawaru_stretchers[pn]:addx(-d)
							mawaru_stretchers[pn]:queuecommand('NextPatient');
							mawaru_stretchers[pn]:sleep(0.2);
							mawaru_stretchers[pn]:decelerate(0.3)
							mawaru_stretchers[pn]:addx(d)
						end
					end
				end},
				
				{423,'Text14On'},
				{424,'Close'},
				{427,'Text14Off'},
				{426.5,'ShowGame11'},
				{426.5,'Open'},
				
				{424,'ShowGame11'},
				
				{424,function()
					for pn=1,2 do
						if _G['P'..pn] then
							_G['P'..pn]:bounce();
							_G['P'..pn]:effectclock('bgm');
							_G['P'..pn]:effectperiod(1);
							_G['P'..pn]:effectmagnitude(0,-50,0);
							_G['P'..pn]:addy(50);
						end
					end
				end},
				{464,function()
					for pn=1,2 do
						if _G['P'..pn] then
							_G['P'..pn]:stopeffect();
							_G['P'..pn]:y(SCREEN_CENTER_Y);
							--_G['P'..pn]:zoom(0);
						end
					end
				end},
				
				{428,'Verse1a'},
				{432-.4,'NyanNyanNyan'},
				{436-.4,'Verse1b'},
				{440-.4,'Verse1c'},
				
				{444,'Verse1a'},
				{448-.4,'NyanNyanNyan2'},
				{452-.4,'Verse1b'},
				--{456,'4Neko'},
				--moved to BGCHANGE as 'effect4'
				
				{459,function() mawaru_bpm = 200; MESSAGEMAN:Broadcast('UpdateBPM');
					mawaru_closetime = 0.8*(115/200);
					mawaru_opentime = 0.8*(115/200);
					
					mawaru_tvshrinktime = 0.4*(115/200);
					mawaru_tvgrowtime = 0.8*(115/200);
					mawaru_aya_ontime = 0.5*(115/200);
					
					mawaru_4bl = 240/200;
				end},
				
				{464,'HideGame11'},
				
				{460,'Close'},
				{461,'Text15On'},
				{464,function() MESSAGEMAN:Broadcast('ShowGame12'); mawaru_gamestate = 1; mawaru_curgame = 12; end},
				{466,'Text15Small'},
				{464,'Open'},
				{492,'Text15Off'},
				
				{467.7,function()
					for pn=1,2 do
						local d = -100; if pn == 2 then d = 100 end
						local a = _G['P'..pn]
						if a then
							a:addx(d);
							a:z(1)
						end
					end
				end},
				
				{500,function()
					for pn=1,2 do
						local a = _G['P'..pn]
						local d = 0.25; if pn == 2 then d = 0.75 end
						if a then
							a:x(SCREEN_WIDTH*d);
							a:z(-1)
						end
					end
				end},
				
				{500,'ReturnInnerBG'},
				
				{503,'AyaOn'},
				{504,'Text16On'},
				{506,'TVGrow'},
				{504,'HideGame12'},
				
				{504,function()
					for pn=1,2 do
						if _G['P'..pn] then
							_G['P'..pn]:zoom(1);
						end
					end
				end},
				
				{508,'Text16Small'},
				
				--{87,'Open'},
				{506,function() MESSAGEMAN:Broadcast('ShowGame13'); mawaru_gamestate = 1; mawaru_curgame = 13; end},
				{508,function() mawaru_game_timer = 539 end},
				
				{532,'Text16Off'},
				
				{539,'TVShrinkInstant',true},
				{539,'StaticOn'},
				{540,'StaticOff',true},
				{540,'SpeedUp5',true},
				{540,function() mawaru_bpm = 200; MESSAGEMAN:Broadcast('UpdateBPM');
					mawaru_closetime = 0.8*(115/200);
					mawaru_opentime = 0.8*(115/200);
					
					mawaru_tvshrinktime = 0.4*(115/200);
					mawaru_tvgrowtime = 0.8*(115/200);
					mawaru_aya_ontime = 0.5*(115/200);
					
					for pn=1,2 do
						if GAMESTATE:IsPlayerEnabled(pn-1) then
							_G['mawaru_lightshine'..pn]:diffuse(1,0,0,.7);
						end
					end
					mawaru_darkness:linear(0);
					mawaru_darkness:glow(0.3,0,0,.5);
					
				end,true},
				
				{540,function()
					
					local trng = math.random(0,1)
					
					if mawaru_nickplaying then trng = 0 end
					
					if trng == 0 then
						Sound('chancetime')
						MESSAGEMAN:Broadcast('ChanceTime');
					else
						Sound('suddendeath')
						MESSAGEMAN:Broadcast('SuddenDeath');
					end
					
				end,true},
				
				{541,'HideGame13'},
				
				{551,'AyaOn',true},
				{550,'Text16bOn'},
				{556,'Text16bSmall'},
				{553,'TVGrow',true},
				{554,function() MESSAGEMAN:Broadcast('ShowGame14'); mawaru_gamestate = 1; mawaru_curgame = 14; end},
				
				{571,'Text16bOffInstant'},
				{571,'StaticOn'},
				{572,'StaticOff'},
				{572,function() MESSAGEMAN:Broadcast('ShowGame15'); mawaru_gamestate = 1; mawaru_curgame = 15; end},
				{572,'HideGame14'},
				
				{572,function()
					local anywon = false;
					for pn=1,2 do
						if mawaru_mmm_lives[pn] > 0 then
							mawaru_score[pn] = mawaru_score[pn]+mawaru_mmm_score[pn]
							anywon = true
						end
					end
					if anywon then
						GoodSound()
					else
						BadSound()
					end
				end},
				
				{603.5,'StaticOn'},
				{604,'StaticOff'},
				{604,function() MESSAGEMAN:Broadcast('ShowGame16'); mawaru_gamestate = 1; mawaru_curgame = 16; end},
				{604,'HideGame15'},
				
				{604,function()
					local anywon = false;
					for pn=1,2 do
						mawaru_score[pn] = mawaru_score[pn]+mawaru_lisa_scoreb[pn]
					end
				end},
				
				{635.4,function() mawaru_gamestate = 0; mawaru_curgame = 0; end},
				{635.5,'BlackOn'},
				{636,'BlackOff'},
				{636,function() MESSAGEMAN:Broadcast('ShowGame17'); mawaru_gamestate = 1; mawaru_curgame = 17; end},
				{636,'HideGame16'},
				
				{636,function()
					local anywon = false;
					for pn=1,2 do
						mawaru_score[pn] = mawaru_score[pn]+_G['mawaru_code_codedp'..pn]
						mawaru_sf_scoreb[pn] = _G['mawaru_code_codedp'..pn]
					end
				end},
				
				{651.5,'BlackOn'},
				{652,'BlackOff'},
				{652,function() MESSAGEMAN:Broadcast('ShowGame18'); mawaru_gamestate = 1; mawaru_curgame = 18; end},
				{652,'HideGame17'},
				
				{652,function()
					local anywon = false;
					for pn=1,2 do
						if not mawaru_sans_dead[pn] then
							mawaru_score[pn] = mawaru_score[pn]+5
							mawaru_misc_score[pn] = mawaru_misc_score[pn]+5
							anywon = true
						end
					end
				end},
				
				{667,'StaticOn'},
				{666.9,function() mawaru_gamestate = 0; mawaru_curgame = 0; end},
				{667,'HideGame18'},
				{668,'StaticOff'},
				{668,'ResetColor',true},
				{667.9,'TVShrinkInstant'},
				
				{668,'Text22On'},
				{676,'Text23On'},
				
				{684,'Text22Off'},
				{684,'Text23Off'},
				
				{698,'NoBarOn'},
				{700,'NoBarOff'},
				{700,'MoveInnerBGFast'},
				{700,function() MESSAGEMAN:Broadcast('ShowGame19'); mawaru_gamestate = 1; mawaru_curgame = 19; end},
				
				{708,'RotateLastGame'},
				{716,'FinaleStart'},
				
				{776,'FinalTextOff'},
				
				{804,'DisplayFinalScores'},
				{800,function()
					
					for pn=1,2 do
						mawaru_score[pn] = mawaru_score[pn]+(mawaru_finale_score[pn]*20);
					end
					
					if FUCK_EXE and STATSMAN:GetCurStageStats() then
						for pn = 1,2 do
							if GAMESTATE:IsPlayerEnabled(pn-1) then
								mawaru_score[pn] = math.floor(mawaru_score[pn])
								_G['uksrt_p'..pn..'bonus'] = mawaru_score[pn]
								_G['uksrt_p'..pn..'moneyscore'] = mawaru_score[pn]
								local poss = STATSMAN:GetCurStageStats():GetPlayerStageStats(pn-1):GetPossibleDancePoints()
								local act = STATSMAN:GetCurStageStats():GetPlayerStageStats(pn-1):GetActualDancePoints()
								local bonus = mawaru_score[pn]*(poss/100)
								if not string.find(string.lower(THEME:GetCurThemeName()), 'simply love') then
									STATSMAN:GetCurStageStats():GetPlayerStageStats(pn-1):SetActualDancePoints(act+bonus);
								end
							end
						end
					end
					
				end},
				
			}
			
			for i=208,220,2 do
				table.insert(mod_actions,{i,function()
					mawaru_nayoto_1:setstate(math.random(0,3))
					mawaru_nayoto_1:decelerate(40/155);
					mawaru_nayoto_1:addx(480)
					mawaru_nayoto_1:accelerate(40/155);
					mawaru_nayoto_1:addx(-480)
				end})
				table.insert(mod_actions,{i+1,function()
					mawaru_nayoto_2:setstate(math.random(0,3))
					mawaru_nayoto_2:decelerate(40/155);
					mawaru_nayoto_2:addx(-480)
					mawaru_nayoto_2:accelerate(40/155);
					mawaru_nayoto_2:addx(480)
				end})
			end
			
			
			
			
			
			
			
			
			
			
---------------------------------------------------------------------------------------
----------------------Sort the actions table-------------------------------------------
---------------------------------------------------------------------------------------
			
			function modtable_compare(a,b)
				return a[1] < b[1]
			end
			
			if table.getn(mods) > 1 then
				table.sort(mods, modtable_compare)
			end
			
			if table.getn(mod_actions) > 1 then
				table.sort(mod_actions, modtable_compare)
			end
			
			self:queuecommand('Update');
			
		end,
    OnCommand= cmd(visible,false),
    UpdateCommand= function(self)

			if GAMESTATE:GetSongBeat()>=0 and not checked then
				SCREENMAN:GetTopScreen():AddInputCallback( InputHandler )--The fun begins. -Kid
				----------------------
				-- 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(false) end
					if LifeP1 then LifeP1:visible(false) end
					if LifeP2 then LifeP2:visible(false) end
					--[[
					if ScoreP1 then ScoreP1:visible(false) end
					if ScoreP2 then ScoreP2:visible(false) end
					]]
					if ScoreP1 then ScoreP1:zoom(0) end
					if ScoreP2 then ScoreP2:zoom(0) end
					if SCREENMAN:GetTopScreen():GetChild('BPMDisplay') then 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
					--Hide more things. -Kid
					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
				end

				P1 = SCREENMAN:GetTopScreen():GetChild('PlayerP1');
				P2 = SCREENMAN:GetTopScreen():GetChild('PlayerP2');
				--aliases for old times sake
				
				if P1 then
					P1:z(-1);
					jud1 = P1:GetChild('Judgment');
					com1 = P1:GetChild('Combo');
					if SCREENMAN:GetTopScreen():GetChild("SongMeterDisplayP1") then SCREENMAN:GetTopScreen():GetChild("SongMeterDisplayP1"):smooth(0.5):zoom(0) end
					if SCREENMAN:GetTopScreen():GetChild("StepsDisplayP1") then SCREENMAN:GetTopScreen():GetChild("StepsDisplayP1"):smooth(0.5):zoom(0) end
				end
				if P2 then
					P2:z(-1);
					jud2 = P2:GetChild('Judgment');
					com2 = P2:GetChild('Combo');
					if SCREENMAN:GetTopScreen():GetChild("SongMeterDisplayP2") then SCREENMAN:GetTopScreen():GetChild("SongMeterDisplayP2"):smooth(0.5):zoom(0) end
					if SCREENMAN:GetTopScreen():GetChild("StepsDisplayP2") then SCREENMAN:GetTopScreen():GetChild("StepsDisplayP2"):smooth(0.5):zoom(0) end
				end
				
				screen = SCREENMAN:GetTopScreen();
				screen:SetDrawByZPosition(true);
				SongBackground:z(-2);--Temp disable. -Kid
				checked = true;
				
			end

			local beat = GAMESTATE:GetSongBeat()
			
---------------------------------------------------------------------------------------
----------------------Begin table handlers---------------------------------------------
---------------------------------------------------------------------------------------

			if beat>16 and beat<24 then
				--effectcolor1,1.03,.97,1,1;effectcolor2,.97,1.03,1,1;
				mawaru_building:effectcolor1(1+mawaru_colorant:GetX(),1-mawaru_colorant:GetX(),1,1)
				mawaru_building:effectcolor2(1-mawaru_colorant:GetX(),1+mawaru_colorant:GetX(),1,1)
			end
			
			if beat>mod_firstSeenBeat+1 and beat>mawaru_flip_patient then
				if beat < mawaru_flip_patient+2 then
					for i=1,8 do
						local d = 1;
						if i > 4 then d = -1 end
						mawaru_patients[i]:zoom(.8);
						mawaru_patients[i]:zoomx(.8*d*mawaru_patient_flipper);
					end
					mawaru_patient_flipper = mawaru_patient_flipper*-1;
				end
				mawaru_flip_patient = mawaru_flip_patient+2
			end
			
			if mawaru_game_timer < 1000 then
				if mawaru_game_timer-math.ceil(beat-.06) <= 0 then
					mawaru_game_timer = 9999;
					MESSAGEMAN:Broadcast('TimeUp');
					mawaru_bomb_flame:visible(false);
					mawaru_bomb_fuse:visible(false);
					mawaru_bomb_main:visible(false);
				else
					local tr = mawaru_game_timer-math.ceil(beat-.06)
					if beat > 350 then tr = mawaru_game_timer-(math.ceil(math.ceil(beat/2)*2-0.06)) end
					mawaru_bomb_fuse:visible(true);
					if beat > 350 then
						mawaru_bomb_fuse:setstate(mawaru_clamp(tr/2-0.5,0,9))
					else
						mawaru_bomb_fuse:setstate(mawaru_clamp(tr-1,0,9))
					end
					mawaru_bomb_main:visible(true);
					mawaru_bomb_flame:visible(true);
					if beat < 350 then
						if tr == 1 then
							mawaru_bomb_flame:x(104)
							mawaru_bomb_flame:y(438)
							mawaru_bomb_flame:rotationz(90);
						else
							mawaru_bomb_flame:x(143+(tr-2)*64)
							mawaru_bomb_flame:y(445)
							mawaru_bomb_flame:rotationz(0);
						end
					else
						--Trace(tr);
						if tr == 1 then
							mawaru_bomb_flame:x(104)
							mawaru_bomb_flame:y(438)
							mawaru_bomb_flame:rotationz(90);
						else
							mawaru_bomb_flame:x(143+(tr/2-1.5)*64)
							mawaru_bomb_flame:y(445)
							mawaru_bomb_flame:rotationz(0);
						end
					end
				end
			end
			
			if beat > mod_firstSeenBeat+1 and beat < 799 then
				if GAMESTATE:IsHumanPlayer(PLAYER_1) then
					--local mawaru_scoreP1s = SCREENMAN:GetTopScreen():GetChild('ScoreP1'):GetChild('ScoreDisplayPercentage Percent'):GetChild('PercentP1'):GetText();
					local mawaru_scoreP1s = STATSMAN:GetCurStageStats():GetPlayerStageStats(0):GetPercentDancePoints() * 100;--Get p1's score percent. -Kid
					mawaru_scoreP1s = string.format("%.2f", mawaru_scoreP1s)--Round to two decimal places. -Kid
					mawaru_sscore[1] = tonumber(string.sub(mawaru_scoreP1s,1,string.len(mawaru_scoreP1s) ) * 1);
				end
				if GAMESTATE:IsHumanPlayer(PLAYER_2) then
					--local mawaru_scoreP2s = SCREENMAN:GetTopScreen():GetChild('ScoreP2'):GetChild('ScoreDisplayPercentage Percent'):GetChild('PercentP2'):GetText();
					local mawaru_scoreP2s = STATSMAN:GetCurStageStats():GetPlayerStageStats(1):GetPercentDancePoints() * 100;--Get p1's score percent. -Kid
					mawaru_scoreP2s = string.format("%.2f", mawaru_scoreP2s)--Round to two decimal places. -Kid
					mawaru_sscore[2] = tonumber(string.sub(mawaru_scoreP2s,1,string.len(mawaru_scoreP2s) ) * 1);
				end
			end
			
			disable = false;
			if disable ~= true and checked then
				
				--custom mod reader (c) 2015 #taronuke #yolo #swag #swag #amazon.co.jp #teamproofofconcept #swag
				if beat > mod_firstSeenBeat+0.1 then -- performance coding!! --
					while curmod<=table.getn(mods) and GAMESTATE:GetSongBeat()>=mods[curmod][1] do
						if table.getn(mods[curmod]) == 3 then
							--GAMESTATE:ApplyGameCommand('mod,'..mods[curmod][2],mods[curmod][3]);
							taronuke_mods(mods[curmod][2],mods[curmod][3])
						else
							--GAMESTATE:ApplyGameCommand('mod,'..mods[curmod][2]);
							for i=1,2 do
							    taronuke_mods(mods[curmod][2],i)
							end
						end
						curmod = curmod+1;
					end
				end
				
				--------------------
				-- Perframe stuff --
				--------------------
				
				---------------------------------------
				-- 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 mod_actions[curaction][3] or GAMESTATE:GetSongBeat() < mod_actions[curaction][1]+2 then
							if type(mod_actions[curaction][2]) == 'function' then
								mod_actions[curaction][2]()
							elseif type(mod_actions[curaction][2]) == 'string' then
								MESSAGEMAN:Broadcast(mod_actions[curaction][2]);
							end
						end
						curaction = curaction+1;
					end
				end
				
			end
			
			self:sleep(0.02);
			self:queuecommand('Update');

---------------------------------------------------------------------------------------
----------------------END DON'T TOUCH IT KIDDO-----------------------------------------
---------------------------------------------------------------------------------------
			
		end,
  },
  Def.Quad{
    Name= "actor_Bp",
    OnCommand= cmd(visible,false),
  },
  Def.ActorFrame{
    Name= "actor_Cp",--This zoomx & zoomy results in having to reverse-convert a whole bunch of positions. -Kid
    OnCommand= cmd(zoomx,SCREEN_WIDTH/640;zoomy,SCREEN_HEIGHT/480;fov,80),
    LoadActor('nue') .. {
      Name= "actor_Dp",
      File= "nue",
      HideGame1MessageCommand= cmd(visible,false),
      OnCommand= cmd(visible,false),
      ShowGame1MessageCommand= cmd(visible,true;playcommand,"Start"),
    },
    LoadActor('body') .. {
      Name= "actor_Ep",
      File= "body",
      HideGame2MessageCommand= cmd(visible,false),
      OnCommand= cmd(visible,false),
      ShowGame2MessageCommand= cmd(visible,true;playcommand,"Start"),
    },
    LoadActor('reisen') .. {
      Name= "actor_Fp",
      File= "reisen",
      HideGame3MessageCommand= cmd(visible,false),
      OnCommand= cmd(visible,false),
      ShowGame3MessageCommand= cmd(visible,true;playcommand,"Start"),
    },
    LoadActor('operation') .. {
      Name= "actor_aq",
      File= "operation",
      HideGame4MessageCommand= cmd(visible,false),
      OnCommand= cmd(visible,false),
      ShowGame4MessageCommand= cmd(visible,true;playcommand,"Start"),
    },
    LoadActor('nayoto') .. {
      Name= "actor_bq",
      File= "nayoto",
      HideGame5MessageCommand= cmd(visible,false),
      OnCommand= cmd(visible,false),
      ShowGame5MessageCommand= cmd(visible,true;playcommand,"Start"),
    },
    LoadActor('blomby') .. {
      Name= "actor_cq",
      File= "blomby",
      HideGame6MessageCommand= cmd(visible,false),
      OnCommand= cmd(visible,false),
      ShowGame6MessageCommand= cmd(visible,true;playcommand,"Start"),
    },
    LoadActor('sbahj') .. {
      Name= "actor_dq",
      File= "sbahj",
      HideGame7MessageCommand= cmd(visible,false),
      OnCommand= cmd(visible,false),
      ShowGame7MessageCommand= cmd(visible,true;playcommand,"Start"),
    },
    LoadActor('bee') .. {
      Name= "actor_eq",
      File= "bee",
      HideGame8MessageCommand= cmd(visible,false),
      OnCommand= cmd(visible,false),
      ShowGame8MessageCommand= cmd(visible,true;playcommand,"Start"),
    },
    LoadActor('chike') .. {
      Name= "actor_fq",
      File= "chike",
      HideGame9MessageCommand= cmd(visible,false),
      OnCommand= cmd(visible,false),
      ShowGame9MessageCommand= cmd(visible,true;playcommand,"Start"),
    },
    LoadActor('anders') .. {
      Name= "actor_gq",
      File= "anders",
      HideGame10MessageCommand= cmd(visible,false),
      OnCommand= cmd(visible,false),
      ShowGame10MessageCommand= cmd(visible,true;playcommand,"Start"),
    },
    LoadActor('neko') .. {
      Name= "actor_hq",
      File= "neko",
      HideGame11MessageCommand= cmd(visible,false),
      OnCommand= cmd(visible,false),
      ShowGame11MessageCommand= cmd(visible,true;playcommand,"Start"),
    },
    LoadActor('glados') .. {
      Name= "actor_iq",
      File= "glados",
      HideGame12MessageCommand= cmd(visible,false),
      OnCommand= cmd(visible,false),
      ShowGame12MessageCommand= cmd(visible,true;playcommand,"Start"),
    },
    LoadActor('lineac') .. {
      Name= "actor_jq",
      File= "lineac",
      HideGame13MessageCommand= cmd(visible,false),
      OnCommand= cmd(visible,false),
      ShowGame13MessageCommand= cmd(visible,true;playcommand,"Start"),
    },
    LoadActor('mmm') .. {
      Name= "actor_kq",
      File= "mmm",
      HideGame14MessageCommand= cmd(visible,false),
      OnCommand= cmd(visible,false),
      ShowGame14MessageCommand= cmd(visible,true;playcommand,"Start"),
    },
    LoadActor('lisa') .. {
      Name= "actor_lq",
      File= "lisa",
      HideGame15MessageCommand= cmd(visible,false),
      OnCommand= cmd(visible,false),
      ShowGame15MessageCommand= cmd(visible,true;playcommand,"Start"),
    },
    LoadActor('sf') .. {
      Name= "actor_mq",
      File= "sf",
      HideGame16MessageCommand= cmd(visible,false),
      OnCommand= cmd(visible,false),
      ShowGame16MessageCommand= cmd(visible,true;playcommand,"Start"),
    },
    LoadActor('sans') .. {
      Name= "actor_nq",
      File= "sans",
      HideGame17MessageCommand= cmd(visible,false),
      OnCommand= cmd(visible,false),
      ShowGame17MessageCommand= cmd(visible,true;playcommand,"Start"),
    },
    LoadActor('limit') .. {
      Name= "actor_oq",
      File= "limit",
      HideGame18MessageCommand= cmd(visible,false),
      OnCommand= cmd(visible,false),
      ShowGame18MessageCommand= cmd(visible,true;playcommand,"Start"),
    },
    LoadActor('finale') .. {
      Name= "actor_pq",
      File= "finale",
      HideGame19MessageCommand= cmd(visible,false),
      OnCommand= cmd(visible,false),
      ShowGame19MessageCommand= cmd(visible,true;playcommand,"Start"),
    },
    --For each hospital and patient part, Unconverted x & y pos. -Kid
    Def.ActorFrame{
      Name= "actor_qq",
      HideInnerBGMessageCommand= cmd(visible,false),
      InitCommand= function(self) mawaru_innerbg=self end,
      MoveInnerBGFastMessageCommand= cmd(y,480),
      MoveInnerBGMessageCommand= cmd(decelerate,mawaru_opentime;y,480),
      OnCommand= cmd(visible,false),
      ReturnInnerBGFastMessageCommand= cmd(playcommand,"NFace";y,0),
      ReturnInnerBGMessageCommand= cmd(playcommand,"NFace";decelerate,mawaru_closetime;y,0),
      ShowInnerBGMessageCommand= cmd(visible,true),
      Def.Sprite{
        Name= "actor_rq",
        OnCommand= cmd(x,320;y,240),
        ResetColorMessageCommand= cmd(diffuse,color('1,1,1,1')),
        SpeedUp4MessageCommand= cmd(diffuse,color('1,.4,.4,1')),
        SpeedUp5MessageCommand= cmd(diffuse,color('1,0,0,1')),
        Texture= "bg.png",
      },
      Def.Sprite{
        Name= "actor_sq",
        NFaceCommand= cmd(animate,0;setstate,math.random(0,7);visible,true),
        OnCommand= cmd(x,330;y,96;visible,false),
        ResetColorMessageCommand= cmd(diffuse,color('1,1,1,1')),
        SpeedUp4MessageCommand= cmd(diffuse,color('1,.4,.4,1')),
        SpeedUp5MessageCommand= cmd(diffuse,color('1,0,0,1')),
        Texture= "memes/meme 2x4.png",
      },
      Def.ActorFrame{
        Name= "actor_tq",
        OnCommand= cmd(x,286;y,226;
			pulse;effectoffset,0.05;effectclock,"bgm";effectperiod,1;effectmagnitude,1,1,1;effectcolor1,color('1.03,.97,1,1');effectcolor2,color('.97,1.03,1,1')),
        SpeedUp1MessageCommand= cmd(playcommand,"Spd1";decelerate,30/115;addy,-60;accelerate,30/115;addy,60;
									decelerate,30/120;addy,-60;accelerate,30/120;addy,60;
									decelerate,30/125;addy,-60;accelerate,30/125;addy,60;
									decelerate,30/130;addy,-60;accelerate,30/130;addy,60),
        SpeedUp2MessageCommand= cmd(playcommand,"Spd2";decelerate,30/155;addy,-60;accelerate,30/155;addy,60),
        SpeedUp3MessageCommand= cmd(playcommand,"Spd3";decelerate,30/155;addy,-60;accelerate,30/155;addy,60;
									decelerate,30/160;addy,-60;accelerate,30/165;addy,60;
									decelerate,30/175;addy,-60;accelerate,30/175;addy,60),
        SpeedUp4MessageCommand= cmd(playcommand,"Spd4"),
        SpeedUp5MessageCommand= cmd(playcommand,"Spd5"),
        Def.Sprite{
          Name= "actor_uq",
          Frames= {
            {Frame= 3, Delay= 0.0625},
            {Frame= 4, Delay= 0.0625},
            {Frame= 5, Delay= 0.0625},
            {Frame= 6, Delay= 0.0625},
            {Frame= 7, Delay= 0.0625},
            {Frame= 8, Delay= 0.0625},
            {Frame= 9, Delay= 0.0625},
            {Frame= 10, Delay= 0.0625},
            {Frame= 11, Delay= 0.0625},
            {Frame= 12, Delay= 0.0625},
            {Frame= 13, Delay= 0.0625},
            {Frame= 14, Delay= 0.0625},
            {Frame= 15, Delay= 0.0625},
            {Frame= 0, Delay= 0.0625},
            {Frame= 1, Delay= 0.0625},
            {Frame= 2, Delay= 0.0625},
        },
          OnCommand= cmd(effectclock,"bgm";x,21;y,-32;zoom,0.7;rotationy,-19;rotationx,19;diffuse,color('0,1,0,1')),
          Spd1Command= cmd(bounceend,30/115;diffuse,color('0,1,0.25,1');sleep,30/115;
							bounceend,30/120;diffuse,color('0,1,0.5,1');sleep,30/120;
							bounceend,30/125;diffuse,color('0,1,0.75,1');sleep,30/125;
							bounceend,30/130;diffuse,color('0,1,1,1');sleep,30/130),
          Spd2Command= cmd(linear,0.5;diffuse,color('0,0,1,1')),
          Spd3Command= cmd(linear,0.5;diffuse,color('.6,0,1,1')),
          Spd4Command= cmd(diffuse,color('1,0,0,1')),
          Spd5Command= cmd(diffuse,color('1,0,0,1')),
          Texture= "./_pulse 4x4.png",
        },
        Def.Sprite{
          Name= "actor_vq",
          OnCommand= cmd(y,-30),
          Texture= "hrm.png",
        },
        Def.Sprite{
          Name= "actor_wq",
          OnCommand= cmd(blend,"BlendMode_NoEffect";zwrite,1;y,-30),
          Texture= "hrm_mask.png",
        },
        Def.BitmapText{
          Name= "actor_xq",
          Font= "_eurostile outline",
          OnCommand= cmd(shadowlength,0;zoom,0.44;y,14;x,30;rotationy,-19;rotationx,19;rotationz,-4),
          Text= "115bpm",
          UpdateBPMMessageCommand= function(self)
					self:finishtweening(); self:settext(mawaru_bpm..'bpm'); self:zoom(1.2*0.44); self:linear(0.2); self:zoom(1*0.44)
				end,
        },
      },
      optional_actor(cond_up_result,
      Def.Sprite{
        Name= "actor_yq",
        MawaRightP1MessageCommand= cmd(setstate,1),
        MawaWrongP1MessageCommand= cmd(stopeffect;setstate,2),
        NFaceCommand= cmd(effectoffset,0.3;setstate,0;--effectdelay -> effect_hold_at_full -Kid
			pulse;effectclock,"bgm";effectperiod,0.6;effect_hold_at_full,0.4;effectmagnitude,1,1,1;effectcolor2,color('1.01,.99,1,1');effectcolor1,color('.99,1,1,1')),
        OnCommand= cmd(vertalign,bottom;animate,0;x,91;y,384;effectoffset,0.3;
			pulse;effectclock,"bgm";effectperiod,0.6;effect_hold_at_full,0.4;effectmagnitude,1,1,1;effectcolor2,color('1.01,.99,1,1');effectcolor1,color('.99,1,1,1')),
        ResetColorMessageCommand= cmd(diffuse,color('1,1,1,1')),
        SpeedUp4MessageCommand= cmd(diffuse,color('1,.4,.4,1')),
        SpeedUp5MessageCommand= cmd(diffuse,color('1,0,0,1')),
        Texture= "darren 3x1.png",
      }),
      optional_actor(cond_up_result,
      Def.Sprite{
        Name= "actor_zq",--effectdelay -> effect_hold_at_full -Kid
        OnCommand= cmd(vertalign,bottom;x,208;y,384;effectoffset,0.3;
			pulse;effectclock,"bgm";effectperiod,0.6;effect_hold_at_full,0.4;effectmagnitude,1,1,1;effectcolor2,color('1.01,.99,1,1');effectcolor1,color('.99,1,1,1')),
        ResetColorMessageCommand= cmd(diffuse,color('1,1,1,1')),
        SpeedUp4MessageCommand= cmd(diffuse,color('1,.4,.4,1')),
        SpeedUp5MessageCommand= cmd(diffuse,color('1,0,0,1')),
        Texture= "chan_bode.png",
      }),
      optional_actor(cond_up_result,
      Def.Sprite{
        Name= "actor_Aq",
        MawaRightP1MessageCommand= cmd(setstate,1),
        MawaWrongP1MessageCommand= cmd(setstate,2),
        NFaceCommand= cmd(setstate,0),--effectdelay -> effect_hold_at_full -Kid
        OnCommand= cmd(animate,0;x,203;y,146;bounce;effectclock,"bgm";effectperiod,0.6;effect_hold_at_full,0.4;effectoffset,0.3;effectmagnitude,0,6,0),
        ResetColorMessageCommand= cmd(diffuse,color('1,1,1,1')),
        SpeedUp4MessageCommand= cmd(diffuse,color('1,.4,.4,1')),
        SpeedUp5MessageCommand= cmd(diffuse,color('1,0,0,1')),
        Texture= "chan_head 3x1.png",
      }),
      optional_actor(cond_vp_result,
      Def.Sprite{
        Name= "actor_Bq",
        MawaRightP2MessageCommand= cmd(setstate,1),
        MawaWrongP2MessageCommand= cmd(stopeffect;setstate,2),
        NFaceCommand= cmd(effectoffset,0.3;setstate,0;--effectdelay -> effect_hold_at_full -Kid
			pulse;effectclock,"bgm";effectperiod,0.6;effect_hold_at_full,0.4;effectmagnitude,1,1,1;effectcolor2,color('1.01,.99,1,1');effectcolor1,color('.99,1,1,1')),
        OnCommand= cmd(vertalign,bottom;animate,0;x,568;y,400;effectoffset,0.3;
			pulse;effectclock,"bgm";effectperiod,0.6;effect_hold_at_full,0.4;effectmagnitude,1,1,1;effectcolor2,color('1.01,.99,1,1');effectcolor1,color('.99,1,1,1')),
        ResetColorMessageCommand= cmd(diffuse,color('1,1,1,1')),
        SpeedUp4MessageCommand= cmd(diffuse,color('1,.4,.4,1')),
        SpeedUp5MessageCommand= cmd(diffuse,color('1,0,0,1')),
        Texture= "laer 3x1.png",
      }),
      optional_actor(cond_vp_result,
      Def.Sprite{
        Name= "actor_Cq",--effectdelay -> effect_hold_at_full -Kid
        OnCommand= cmd(vertalign,bottom;x,466;y,399;effectoffset,0.3;
			pulse;effectclock,"bgm";effectperiod,0.6;effect_hold_at_full,0.4;effectmagnitude,1,1,1;effectcolor2,color('1.01,.99,1,1');effectcolor1,color('.99,1,1,1')),
        ResetColorMessageCommand= cmd(diffuse,color('1,1,1,1')),
        SpeedUp4MessageCommand= cmd(diffuse,color('1,.4,.4,1')),
        SpeedUp5MessageCommand= cmd(diffuse,color('1,0,0,1')),
        Texture= "ashe_bode.png",
      }),
      optional_actor(cond_vp_result,
      Def.Sprite{
        Name= "actor_Dq",
        MawaRightP2MessageCommand= cmd(setstate,1),
        MawaWrongP2MessageCommand= cmd(setstate,2),
        NFaceCommand= cmd(setstate,0),--effectdelay -> effect_hold_at_full -Kid
        OnCommand= cmd(animate,0;x,462;y,158;bounce;effectclock,"bgm";effectperiod,0.6;effect_hold_at_full,0.4;effectoffset,0.3;effectmagnitude,0,6,0),
        ResetColorMessageCommand= cmd(diffuse,color('1,1,1,1')),
        SpeedUp4MessageCommand= cmd(diffuse,color('1,.4,.4,1')),
        SpeedUp5MessageCommand= cmd(diffuse,color('1,0,0,1')),
        Texture= "ashe_head 3x1.png",
      }),
      optional_actor(cond_up_result,
      Def.ActorFrame{
        Name= "actor_Eq",
        OnCommand= cmd(x,170;y,335;basezoomx,-1;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_stretchers,self) end,
        Def.Sprite{
          Name= "actor_Fq",
          OnCommand= cmd(animate,0;setstate,0),
          ResetColorMessageCommand= cmd(diffuse,color('1,1,1,1')),
          SpeedUp4MessageCommand= cmd(diffuse,color('1,.4,.4,1')),
          SpeedUp5MessageCommand= cmd(diffuse,color('1,0,0,1')),
          Texture= "stretcher 1x2.png",
        },
        Def.Sprite{
          Name= "actor_ar",
          NextPatientCommand= cmd(visible,true),
          OnCommand= cmd(visible,false;y,-35;x,-20;zoomx,-1),
          PatientEndCommand= cmd(visible,false),
          Texture= "patients/sheet.png",
        },
        Def.Sprite{
          Name= "actor_br",
          NextPatientCommand= function(self)
					if GAMESTATE:GetSongBeat() < 74 then
						self:setstate(2);
					elseif GAMESTATE:GetSongBeat() < 158 then
						self:setstate(5);
					elseif GAMESTATE:GetSongBeat() < 270 then
						self:setstate(11);
					elseif GAMESTATE:GetSongBeat() < 368 then
						self:setstate(8);
					else
						self:basezoomx(0);
					end
					self:visible(true);
				end,
          OnCommand= cmd(visible,false;zoom,0.8;animate,0;setstate,2;y,-43;x,45;rotationz,85),
          PatientEndCommand= cmd(visible,false),
          Texture= "patients/_misc 6x4.png",
        },
        Def.Sprite{
          Name= "actor_cr",
          OnCommand= cmd(),
          ResetColorMessageCommand= cmd(diffuse,color('1,1,1,1')),
          SpeedUp4MessageCommand= cmd(diffuse,color('1,.4,.4,1')),
          SpeedUp5MessageCommand= cmd(diffuse,color('1,0,0,1')),
          Texture= "stretcher_bar.png",
        },
      }),
      optional_actor(cond_vp_result,
      Def.ActorFrame{
        Name= "actor_dr",
        OnCommand= cmd(x,470;y,350;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_stretchers,self) end,
        Def.Sprite{
          Name= "actor_er",
          OnCommand= cmd(animate,0;setstate,1),
          ResetColorMessageCommand= cmd(diffuse,color('1,1,1,1')),
          SpeedUp4MessageCommand= cmd(diffuse,color('1,.4,.4,1')),
          SpeedUp5MessageCommand= cmd(diffuse,color('1,0,0,1')),
          Texture= "stretcher 1x2.png",
        },
        Def.Sprite{
          Name= "actor_fr",
          NextPatientCommand= cmd(visible,true),
          OnCommand= cmd(visible,false;y,-35;x,-20;zoomx,-1),
          PatientEndCommand= cmd(visible,false),
          Texture= "patients/sheet.png",
        },
        Def.Sprite{
          Name= "actor_gr",
          NextPatientCommand= function(self)
					if GAMESTATE:GetSongBeat() < 74 then
						self:setstate(20);
					elseif GAMESTATE:GetSongBeat() < 158 then
						self:setstate(14);
					elseif GAMESTATE:GetSongBeat() < 270 then
						self:setstate(17);
					elseif GAMESTATE:GetSongBeat() < 368 then
						self:setstate(23);
					else
						self:basezoomx(0);
					end
					self:visible(true);
				end,
          OnCommand= cmd(visible,false;zoom,0.8;animate,0;setstate,2;y,-43;x,45;rotationz,85),
          PatientEndCommand= cmd(visible,false),
          Texture= "patients/_misc 6x4.png",
        },
        Def.Sprite{
          Name= "actor_hr",
          OnCommand= cmd(),
          ResetColorMessageCommand= cmd(diffuse,color('1,1,1,1')),
          SpeedUp4MessageCommand= cmd(diffuse,color('1,.4,.4,1')),
          SpeedUp5MessageCommand= cmd(diffuse,color('1,0,0,1')),
          Texture= "stretcher_bar.png",
        },
      }),
      Def.ActorFrame{
        Name= "actor_ir",
        JumpPatientP1MessageCommand= cmd(decelerate,0.3;addy,-150;accelerate,0.3;addy,150),
        Def.Sprite{
          Name= "actor_jr",
          JumpPatient1P1MessageCommand= cmd(stopeffect;diffuse,color('1,1,1,1');setstate,0;x,170;y,250;linear,0.6;x,40;y,375;sleep,0;diffusealpha,0;
				queuemessage,"ShowPatient1P1"),
          JumpPatient2P1MessageCommand= cmd(stopeffect;diffuse,color('1,1,1,1');setstate,3;x,170;y,250;linear,0.6;x,120;y,375;sleep,0;diffusealpha,0;
				queuemessage,"ShowPatient2P1"),
          JumpPatient3P1MessageCommand= cmd(stopeffect;diffuse,color('1,1,1,1');setstate,9;x,170;y,250;linear,0.6;x,200;y,375;sleep,0;diffusealpha,0;
				queuemessage,"ShowPatient3P1"),
          JumpPatient4P1MessageCommand= cmd(stopeffect;diffuse,color('1,1,1,1');setstate,6;x,170;y,250;linear,0.6;x,280;y,375;sleep,0;diffusealpha,0;
				queuemessage,"ShowPatient4P1"),
          KillPatient2P1MessageCommand= cmd(bob;effectperiod,1.2;effectmagnitude,16,0,0;setstate,4;
												diffuse,1,1,1,.5;x,170;y,250;linear,0.8;addy,-60;linear,0.8;addy,-60;diffusealpha,0),
          KillPatient3P1MessageCommand= cmd(bob;effectperiod,1.2;effectmagnitude,16,0,0;setstate,10;
												diffuse,1,1,1,.5;x,170;y,250;linear,0.8;addy,-60;linear,0.8;addy,-60;diffusealpha,0),
          KillPatient4P1MessageCommand= cmd(bob;effectperiod,1.2;effectmagnitude,16,0,0;setstate,7;
												diffuse,1,1,1,.5;x,170;y,250;linear,0.8;addy,-60;linear,0.8;addy,-60;diffusealpha,0),
          OnCommand= cmd(animate,0;zoom,0.8;diffusealpha,0),
          Texture= "patients/_misc 6x4.png",
        },
      },
      Def.ActorFrame{
        Name= "actor_kr",
        JumpPatientP2MessageCommand= cmd(decelerate,0.3;addy,-150;accelerate,0.3;addy,150),
        Def.Sprite{
          Name= "actor_lr",
          JumpPatient1P2MessageCommand= cmd(stopeffect;diffuse,color('1,1,1,1');setstate,18;x,470;y,250;linear,0.6;x,640-40;y,375;sleep,0;diffusealpha,0;
				queuemessage,"ShowPatient1P2"),
          JumpPatient2P2MessageCommand= cmd(stopeffect;diffuse,color('1,1,1,1');setstate,12;x,470;y,250;linear,0.6;x,640-120;y,375;sleep,0;diffusealpha,0;
				queuemessage,"ShowPatient2P2"),
          JumpPatient3P2MessageCommand= cmd(stopeffect;diffuse,color('1,1,1,1');setstate,15;x,470;y,250;linear,0.6;x,640-200;y,375;sleep,0;diffusealpha,0;
				queuemessage,"ShowPatient3P2"),
          JumpPatient4P2MessageCommand= cmd(stopeffect;diffuse,color('1,1,1,1');setstate,21;x,470;y,250;linear,0.6;x,640-280;y,375;sleep,0;diffusealpha,0;
				queuemessage,"ShowPatient4P2"),
          KillPatient2P2MessageCommand= cmd(bob;effectperiod,1.2;effectmagnitude,16,0,0;setstate,13;
												diffuse,1,1,1,.5;x,470;y,250;linear,0.8;addy,-60;linear,0.8;addy,-60;diffusealpha,0),
          KillPatient3P2MessageCommand= cmd(bob;effectperiod,1.2;effectmagnitude,16,0,0;setstate,16;
												diffuse,1,1,1,.5;x,470;y,250;linear,0.8;addy,-60;linear,0.8;addy,-60;diffusealpha,0),
          KillPatient4P2MessageCommand= cmd(bob;effectperiod,1.2;effectmagnitude,16,0,0;setstate,22;
												diffuse,1,1,1,.5;x,470;y,250;linear,0.8;addy,-100;linear,0.5;addy,-100;diffusealpha,0),
          OnCommand= cmd(animate,0;zoom,0.8;diffusealpha,0),
          Texture= "patients/_misc 6x4.png",
        },
      },
      Def.Sprite{
        Name= "actor_mr",
        Frames= {
          {Frame= 1, Delay= 0.4},
          {Frame= 0, Delay= 0.5},
          {Frame= 1, Delay= 0.1},
      },
        OnCommand= cmd(x,40;y,375;effectclock,"bgm";effectoffset,0.1;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_patients,self) end,
        ShowPatient1P1MessageCommand= cmd(visible,true),
        Texture= "patients/_dance 6x3.png",
      },
      Def.Sprite{
        Name= "actor_nr",
        Frames= {
          {Frame= 3, Delay= 0.4},
          {Frame= 2, Delay= 0.5},
          {Frame= 3, Delay= 0.1},
      },
        OnCommand= cmd(x,120;y,375;effectclock,"bgm";effectoffset,0.1;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_patients,self) end,
        ShowPatient2P1MessageCommand= cmd(visible,true),
        Texture= "patients/_dance 6x3.png",
      },
      Def.Sprite{
        Name= "actor_or",
        Frames= {
          {Frame= 7, Delay= 0.4},
          {Frame= 6, Delay= 0.5},
          {Frame= 7, Delay= 0.1},
      },
        OnCommand= cmd(x,200;y,375;effectclock,"bgm";effectoffset,0.1;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_patients,self) end,
        ShowPatient3P1MessageCommand= cmd(visible,true),
        Texture= "patients/_dance 6x3.png",
      },
      Def.Sprite{
        Name= "actor_pr",
        Frames= {
          {Frame= 5, Delay= 0.4},
          {Frame= 4, Delay= 0.5},
          {Frame= 5, Delay= 0.1},
      },
        OnCommand= cmd(x,280;y,375;effectclock,"bgm";effectoffset,0.1;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_patients,self) end,
        ShowPatient4P1MessageCommand= cmd(visible,true),
        Texture= "patients/_dance 6x3.png",
      },
      Def.Sprite{
        Name= "actor_qr",
        Frames= {
          {Frame= 13, Delay= 0.4},
          {Frame= 12, Delay= 0.5},
          {Frame= 13, Delay= 0.1},
      },
        OnCommand= cmd(x,640-40;y,375;effectclock,"bgm";effectoffset,0.1;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_patients,self) end,
        ShowPatient1P2MessageCommand= cmd(visible,true),
        Texture= "patients/_dance 6x3.png",
      },
      Def.Sprite{
        Name= "actor_rr",
        Frames= {
          {Frame= 9, Delay= 0.4},
          {Frame= 8, Delay= 0.5},
          {Frame= 9, Delay= 0.1},
      },
        OnCommand= cmd(x,640-120;y,375;effectclock,"bgm";effectoffset,0.1;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_patients,self) end,
        ShowPatient2P2MessageCommand= cmd(visible,true),
        Texture= "patients/_dance 6x3.png",
      },
      Def.Sprite{
        Name= "actor_sr",
        Frames= {
          {Frame= 11, Delay= 0.4},
          {Frame= 10, Delay= 0.5},
          {Frame= 11, Delay= 0.1},
      },
        OnCommand= cmd(x,640-200;y,375;effectclock,"bgm";effectoffset,0.1;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_patients,self) end,
        ShowPatient3P2MessageCommand= cmd(visible,true),
        Texture= "patients/_dance 6x3.png",
      },
      Def.Sprite{
        Name= "actor_tr",
        Frames= {
          {Frame= 15, Delay= 0.4},
          {Frame= 14, Delay= 0.5},
          {Frame= 15, Delay= 0.1},
      },
        OnCommand= cmd(x,640-280;y,375;effectclock,"bgm";effectoffset,0.1;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_patients,self) end,
        ShowPatient4P2MessageCommand= cmd(visible,true),
        Texture= "patients/_dance 6x3.png",
      },
    },
    --For all lamps and lightbulbs, Unconverted x & y pos. -Kid
    Def.ActorFrame{
      Name= "actor_ur",
      HideInnerBGMessageCommand= cmd(visible,false),
      InitCommand= function(self) mawaru_innerbg2=self end,
      MoveInnerBGFastMessageCommand= cmd(y,480),
      MoveInnerBGMessageCommand= cmd(decelerate,mawaru_opentime;y,480),
      OnCommand= cmd(visible,false),
      ReturnInnerBGFastMessageCommand= cmd(y,0),
      ReturnInnerBGMessageCommand= cmd(decelerate,mawaru_closetime;y,0),
      ShowInnerBGMessageCommand= cmd(visible,true),
      Def.ActorFrame{
        Name= "actor_vr",
        OnCommand= cmd(x,160;y,-36;wag;effectmagnitude,0,0,4;effectperiod,2;effectclock,"bgm";effectoffset,0.05),
        Def.Sprite{
          Name= "actor_wr",
          InitCommand= function(self) mawaru_lightmask1 = self end,
          OnCommand= cmd(vertalign,top;rotationz,0;blend,"BlendMode_NoEffect";zwrite,1;croptop,0.15;zoom,1.1;zoomx,1.5),
          Texture= "spot_tex1.png",
        },
        Def.Sprite{
          Name= "actor_xr",
          InitCommand= function(self) mawaru_lightshine1 = self end,
          OnCommand= cmd(vertalign,top;rotationz,0;fadebottom,1;zoom,1.1;zoomx,1.5;croptop,0.15;cropbottom,0;diffusealpha,0.3),
          Texture= "spot_tex1.png",
        },
        Def.Sprite{
          Name= "actor_yr",
          InitCommand= function(self) mawaru_lightbulb1 = self end,
          OnCommand= cmd(animate,0;y,40;croptop,0.48),
          Texture= "bulb 2x1.png",
        },
      },
      Def.ActorFrame{
        Name= "actor_zr",
        OnCommand= cmd(x,480;y,-36;wag;effectmagnitude,0,0,4;effectperiod,2;effectoffset,1;effectclock,"bgm";effectoffset,0.05),
        Def.Sprite{
          Name= "actor_Ar",
          InitCommand= function(self) mawaru_lightmask2 = self end,
          OnCommand= cmd(vertalign,top;rotationz,0;blend,"BlendMode_NoEffect";zwrite,1;croptop,0.15;zoom,1.1;zoomx,1.5),
          Texture= "spot_tex1.png",
        },
        Def.Sprite{
          Name= "actor_Br",
          InitCommand= function(self) mawaru_lightshine2 = self end,
          OnCommand= cmd(vertalign,top;rotationz,0;fadebottom,1;zoom,1.1;zoomx,1.5;croptop,0.15;cropbottom,0;diffusealpha,0.3),
          Texture= "spot_tex1.png",
        },
        Def.Sprite{
          Name= "actor_Cr",
          InitCommand= function(self) mawaru_lightbulb2 = self end,
          OnCommand= cmd(animate,0;y,40;croptop,0.48),
          Texture= "bulb 2x1.png",
        },
      },
      Def.Quad{
        Name= "actor_Dr",
        OnCommand= function(self)
					mawaru_darkness = self;
					self:x(320)
					self:y(240)
					self:diffuse(0,0,0,0.3)
					self:zoomto(640,480)
					self:ztest(1)
					self:ztestmode('writeonpass')
				end,
      },
    },
    --For all ayaze parts, Unconverted x & y pos. -Kid
    Def.Sprite{
      Name= "actor_Er",
      Frames= {
        {Frame= 0, Delay= 0.08},
        {Frame= 1, Delay= 0.08},
        {Frame= 2, Delay= 0.08},
        {Frame= 3, Delay= 0.08},
        {Frame= 4, Delay= 0.08},
        {Frame= 5, Delay= 0.08},
    },
      AyaOnMessageCommand= cmd(diffusealpha,1;x,608+512;linear,mawaru_aya_ontime;x,608;sleep,0;diffusealpha,0),
      OnCommand= cmd(x,608+512;y,291),
      ResetColorMessageCommand= cmd(diffuse,color('1,1,1,1')),
      SpeedUp4MessageCommand= cmd(diffuse,color('1,.4,.4,1')),
      SpeedUp5MessageCommand= cmd(diffuse,color('1,0,0,1')),
      TVGrowMessageCommand= cmd(sleep,mawaru_tvgrowtime;queuemessage,"MoveInnerBGFast";diffusealpha,1;x,608+512),
      TVShrinkInstantMessageCommand= cmd(x,608;diffusealpha,0;sleep,0;diffusealpha,1;accelerate,0;addx,-1000;sleep,0;x,608+512),
      TVShrinkMessageCommand= cmd(x,608;diffusealpha,0;sleep,mawaru_tvshrinktime;diffusealpha,1;accelerate,1;addx,-1000;sleep,0;x,608+512),
      Texture= "./_aya_run 3x2.png",
    },
    Def.Sprite{
      Name= "actor_Fr",
      AyaOnMessageCommand= cmd(sleep,mawaru_aya_ontime;diffusealpha,1),
      OnCommand= cmd(x,608;y,291;diffusealpha,0),
      ResetColorMessageCommand= cmd(diffuse,color('1,1,1,0')),
      SpeedUp4MessageCommand= cmd(diffuse,color('1,.4,.4,0')),
      SpeedUp5MessageCommand= cmd(diffuse,color('1,0,0,0')),
      TVGrowMessageCommand= cmd(sleep,mawaru_tvgrowtime;diffusealpha,0),
      TVShrink2MessageCommand= cmd(sleep,mawaru_tvshrinktime/2;diffusealpha,1),
      TVShrinkInstantMessageCommand= cmd(diffusealpha,0),
      TVShrinkMessageCommand= cmd(sleep,mawaru_tvshrinktime/2;diffusealpha,1;sleep,mawaru_tvshrinktime/2;diffusealpha,0),
      Texture= "aya_stand.png",
    },
    --For all tv parts: unconverted x & y pos. -Kid
    Def.ActorFrame{
      Name= "actor_as",
      AyaOnMessageCommand= cmd(linear,mawaru_aya_ontime;addx,-512),
      OnCommand= cmd(x,320+512;y,288),
      TVGrowMessageCommand= cmd(playcommand,"Grow";linear,mawaru_tvgrowtime;zoom,2.65;y,288+92),
      TVShrink2MessageCommand= cmd(playcommand,"Shrink";sleep,mawaru_tvshrinktime/2;queuemessage,"ReturnInnerBGFast";
		linear,mawaru_tvshrinktime/2;zoom,1;y,288),
      TVShrinkInstantMessageCommand= cmd(playcommand,"ShrinkI";sleep,0;queuemessage,"ReturnInnerBGFast";
		linear,0;zoom,1;y,288;accelerate,0;addx,-1000;sleep,0;x,320+512),
      TVShrinkMessageCommand= cmd(playcommand,"Shrink";sleep,mawaru_tvshrinktime/2;queuemessage,"ReturnInnerBGFast";
		linear,mawaru_tvshrinktime/2;zoom,1;y,288;accelerate,1;addx,-1000;sleep,0;x,320+512),
      Def.Sprite{
        Name= "actor_bs",
        Frames= {
          {Frame= 0, Delay= 0.0333},
          {Frame= 1, Delay= 0.0333},
          {Frame= 2, Delay= 0.0333},
          {Frame= 3, Delay= 0.0333},
      },
        GrowCommand= cmd(sleep,mawaru_tvgrowtime+0.1;linear,0.3;diffusealpha,0),
        OnCommand= cmd(x,1;y,-54;zoomto,256,192),
        ShrinkCommand= cmd(linear,mawaru_tvshrinktime/2;diffusealpha,1),
        ShrinkICommand= cmd(linear,0;diffusealpha,1),
        Texture= "./_static 4x1.png",
      },
      Def.Sprite{
        Name= "actor_cs",
        OnCommand= cmd(x,1),
        ResetColorMessageCommand= cmd(diffuse,color('1,1,1,1')),
        SpeedUp4MessageCommand= cmd(diffuse,color('1,.4,.4,1')),
        SpeedUp5MessageCommand= cmd(diffuse,color('1,0,0,1')),
        Texture= "tv.png",
      },
    },
    --For all outside parts, Unconverted x & y pos. -Kid
    Def.ActorFrame{
      Name= "actor_ds",
      InitCommand= function(self) mawaru_outerbg=self end,
      OnCommand= cmd(visible,false),
      Def.Sprite{
        Name= "actor_es",
        DoHospitalMessageCommand= cmd(linear,7*60/115;linear,60/115;diffusealpha,0),
        OnCommand= cmd(x,320;y,240),
        Texture= "outersky.png",
      },
      Def.Sprite{
        Name= "actor_fs",
        DoHospitalMessageCommand= cmd(linear,7*60/115;zoom,1.1;decelerate,60/115;zoom,1.6;diffusealpha,0),
        OnCommand= cmd(x,320;y,240),
        Texture= "outerbg.png",
      },
      Def.ActorFrame{
        Name= "actor_gs",
        DoHospitalMessageCommand= cmd(playcommand,"Fade";linear,7*60/115;addy,12;zoom,1.15;decelerate,60/115;addy,40;zoom,1.8),
        InitCommand= function(self) mawaru_building=self end,
        OnCommand= cmd(x,323;y,358;pulse;effectoffset,0.05;effectclock,"bgm";effectperiod,1;effectmagnitude,1,1,1;
			effectcolor1,1,1,1,1;effectcolor2,color('1,1,1,1')),
        Def.Sprite{
          Name= "actor_hs",
          FadeCommand= cmd(sleep,7*60/115;linear,60/115;diffusealpha,0),
          OnCommand= cmd(y,-204),
          Texture= "hospital.png",
        },
      },
      Def.Sprite{
        Name= "actor_is",
        DoHospitalMessageCommand= cmd(linear,7*60/115;zoom,1.1;decelerate,60/115;zoom,1.6;diffusealpha,0),
        OnCommand= cmd(x,320;y,240),
        Texture= "outerfg.png",
      },
    },
    --For all title card parts, unconverted x & y pos. -Kid
    Def.ActorFrame{
      Name= "actor_js",
      OnCommand= cmd(fov,80),
      SubOffMessageCommand= cmd(visible,false),
      Def.Sprite{
        Name= "actor_ks",
        LightUpMessageCommand= cmd(linear,0.4;diffuse,color('1,1,1,1')),
        OnCommand= cmd(x,320;y,240;diffuse,color('0,0,0,1')),
        Texture= "introbg.png",
      },
      Def.Sprite{
        Name= "actor_ls",
        Frames= {
          {Frame= 3, Delay= 0.0625},
          {Frame= 4, Delay= 0.0625},
          {Frame= 5, Delay= 0.0625},
          {Frame= 6, Delay= 0.0625},
          {Frame= 7, Delay= 0.0625},
          {Frame= 8, Delay= 0.0625},
          {Frame= 9, Delay= 0.0625},
          {Frame= 10, Delay= 0.0625},
          {Frame= 11, Delay= 0.0625},
          {Frame= 12, Delay= 0.0625},
          {Frame= 13, Delay= 0.0625},
          {Frame= 14, Delay= 0.0625},
          {Frame= 15, Delay= 0.0625},
          {Frame= 0, Delay= 0.0625},
          {Frame= 1, Delay= 0.0625},
          {Frame= 2, Delay= 0.0625},
      },--Did a *(SCREEN_WIDTH/640) -Kid
        OnCommand= cmd(effectclock,"bgm";x,45+21;y,224-2;zoom,0.5*(SCREEN_WIDTH/640);skewx,-0.4;rotationy,-40;rotationx,-10;rotationz,-30;diffuse,color('0,1,.7,1')),
        Texture= "./_pulse 4x4.png",
      },
      Def.Sprite{
        Name= "actor_ms",
        LightUpMessageCommand= cmd(linear,0.4;diffuse,color('1,1,1,1')),
        OnCommand= cmd(x,45;y,224;diffuse,color('0,0,0,1')),
        Texture= "intro_hrm.png",
      },
      Def.Sprite{
        Name= "actor_ns",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_title_let,self) end,
        Texture= "text/letters 4x3.png",
      },
      Def.Sprite{
        Name= "actor_os",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_title_let,self) end,
        Texture= "text/letters 4x3.png",
      },
      Def.Sprite{
        Name= "actor_ps",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_title_let,self) end,
        Texture= "text/letters 4x3.png",
      },
      Def.Sprite{
        Name= "actor_qs",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_title_let,self) end,
        Texture= "text/letters 4x3.png",
      },
      Def.Sprite{
        Name= "actor_rs",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_title_let,self) end,
        Texture= "text/letters 4x3.png",
      },
      Def.Sprite{
        Name= "actor_ss",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_title_let,self) end,
        Texture= "text/letters 4x3.png",
      },
      Def.Sprite{
        Name= "actor_ts",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_title_let,self) end,
        Texture= "text/letters 4x3.png",
      },
      Def.Sprite{
        Name= "actor_us",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_title_let,self) end,
        Texture= "text/letters 4x3.png",
      },
      Def.Sprite{
        Name= "actor_vs",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_title_let,self) end,
        Texture= "text/letters 4x3.png",
      },
      Def.Sprite{
        Name= "actor_ws",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_title_let,self) end,
        Texture= "text/letters 4x3.png",
      },
      Def.Sprite{
        Name= "actor_xs",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_title_let,self) end,
        Texture= "text/letters 4x3.png",
      },
      Def.Sprite{
        Name= "actor_ys",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_title_let,self) end,
        Texture= "text/letters 4x3.png",
      },
      Def.Sprite{
        Name= "actor_zs",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_title_let,self) end,
        Texture= "text/letters 4x3.png",
      },
      Def.Sprite{
        Name= "actor_As",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_title_let,self) end,
        Texture= "text/letters 4x3.png",
      },
      Def.Sprite{
        Name= "actor_Bs",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_title_let,self) end,
        Texture= "text/letters 4x3.png",
      },
      Def.Sprite{
        Name= "actor_Cs",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_title_let,self) end,
        Texture= "text/2016.png",
      },
    },

    --For all curtain parts (and some other elements): unconverted x & y pos. -Kid
    Def.ActorFrame{
      Name= "actor_Et",
      InitCommand= function(self) mawaru_curtain=self end,
      OnCommand= cmd(visible,true),
      Def.Sprite{
        Name= "actor_Ft",
        CloseMessageCommand= cmd(skewx,-0.2;linear,mawaru_closetime*0.5;x,320-190;spring,mawaru_closetime*1;skewx,0;queuemessage,"ReturnInnerBGFast"),
        InstaCloseMessageCommand= cmd(finishtweening;skewx,0;x,320-190),
        InstaOpenMessageCommand= cmd(x,320-190-450),
        OnCommand= cmd(vertalign,top;y,-20;x,320-190-450),
        OpenMessageCommand= cmd(stoptweening;linear,mawaru_opentime*0.15;addx,-50;skewx,0.1;
				queuemessage,"MoveInnerBGFast";linear,mawaru_opentime*0.4;x,320-190-450),
        Texture= "curtainl.png",
      },
      Def.Sprite{
        Name= "actor_au",
        CloseMessageCommand= cmd(skewx,0.2;linear,mawaru_closetime*0.5;x,320+190;spring,mawaru_closetime*1;skewx,0),
        InstaCloseMessageCommand= cmd(finishtweening;skewx,0;x,320+190),
        InstaOpenMessageCommand= cmd(x,320+190+450),
        OnCommand= cmd(vertalign,top;y,-20;x,320+190+450),
        OpenMessageCommand= cmd(stoptweening;linear,mawaru_opentime*0.15;addx,50;skewx,-0.1;linear,mawaru_opentime*0.4;x,320+190+450),
        Texture= "curtainr.png",
      },
      Def.Sprite{
        Name= "actor_bu",
        CloseMessageCommand= cmd(linear,mawaru_closetime*0.5;diffusealpha,1),
        InstaCloseMessageCommand= cmd(finishtweening;x,320;diffusealpha,1),
        InstaOpenMessageCommand= cmd(finishtweening;x,320;diffusealpha,0),
        OnCommand= cmd(x,320;y,240-200;diffusealpha,0),
        OpenMessageCommand= cmd(stoptweening;sleep,mawaru_opentime*0.5;linear,mawaru_opentime;diffusealpha,0),
        Texture= "curtaintop.png",
      },
      Def.Sprite{
        Name= "actor_cu",
        CloseMessageCommand= cmd(sleep,mawaru_closetime*1.5;bounceend,mawaru_closetime*0.3;y,48),
        InstaCloseMessageCommand= cmd(finishtweening;y,48),
        InstaOpenMessageCommand= cmd(finishtweening;y,-48),
        OnCommand= cmd(y,-48;x,320),
        OpenMessageCommand= cmd(stoptweening;bouncebegin,mawaru_opentime*0.5;y,-48),
        Texture= "ui_operation.png",
      },
      --All text#.png moved to be after the curtains so they render on top. -Kid
      --For all text#, Unconverted and backwards-converted x & y pos. -Kid
    Def.Sprite{
      Name= "actor_Ds",
      InitCommand= cmd(zoom,1.5;diffusealpha,0;vibrate;effectmagnitude,2,2,0),
      Text1OffInstantMessageCommand= cmd(finishtweening;linear,0;diffusealpha,0),
      Text1OffMessageCommand= cmd(linear,1;diffusealpha,0),
      Text1OnMessageCommand= cmd(finishtweening;x,320;y,240;zoom,1.5;diffusealpha,0;linear,0.4;zoom,1;diffusealpha,1),
      Text1SmallMessageCommand= cmd(linear,0.5;y,100;zoom,0.5),
      Texture= "text/text1.png",--Accidentally got expanded to text19. -Kid
    },
    Def.Sprite{
      Name= "actor_Es",
      InitCommand= cmd(zoom,1.5;diffusealpha,0;vibrate;effectmagnitude,2,2,0),
      Text2OffInstantMessageCommand= cmd(finishtweening;linear,0;diffusealpha,0),
      Text2OffMessageCommand= cmd(linear,1;diffusealpha,0),
      Text2OnMessageCommand= cmd(finishtweening;x,320;y,240;zoom,1.5;diffusealpha,0;linear,0.4;zoom,1;diffusealpha,1),
      Text2SmallMessageCommand= cmd(linear,0.5;y,100;zoom,0.5),
      Texture= "text/text2.png",--Accidentally got expanded to text21. -Kid
    },
    Def.Sprite{
      Name= "actor_Fs",
      InitCommand= cmd(zoom,1.5;diffusealpha,0;vibrate;effectmagnitude,2,2,0),
      Text3OffInstantMessageCommand= cmd(finishtweening;linear,0;diffusealpha,0),
      Text3OffMessageCommand= cmd(linear,1;diffusealpha,0),
      Text3OnMessageCommand= cmd(finishtweening;x,320;y,240;zoom,1.5;diffusealpha,0;linear,0.4;zoom,1;diffusealpha,1),
      Text3SmallMessageCommand= cmd(linear,0.5;y,100;zoom,0.5),
      Texture= "text/text3.png",
    },
    Def.ActorFrame{
      Name= "actor_at",
      OnCommand= cmd(vibrate;effectmagnitude,2,2,0),
      Def.Sprite{
        Name= "actor_bt",
        InitCommand= cmd(zoom,1.5;diffusealpha,0;rainbow;effectperiod,1.2),
        Text3OffInstantMessageCommand= cmd(finishtweening;linear,0;diffusealpha,0),
        Text3OffMessageCommand= cmd(linear,1;diffusealpha,0),
        Text3OnMessageCommand= cmd(finishtweening;x,320;y,240;zoom,1.5;diffusealpha,0;linear,0.4;zoom,1;diffusealpha,1),
        Text3SmallMessageCommand= cmd(linear,0.5;y,100;zoom,0.5),
        Texture= "text/chekpoint.png",
      },
    },
    Def.Sprite{
      Name= "actor_ct",
      InitCommand= cmd(zoom,1.5;diffusealpha,0;vibrate;effectmagnitude,2,2,0),
      Text4OffInstantMessageCommand= cmd(finishtweening;linear,0;diffusealpha,0),
      Text4OffMessageCommand= cmd(linear,1;diffusealpha,0),
      Text4OnMessageCommand= cmd(finishtweening;x,320;y,240;zoom,1.5;diffusealpha,0;linear,0.4;zoom,1;diffusealpha,1),
      Text4SmallMessageCommand= cmd(linear,0.5;y,100;zoom,0.5),
      Texture= "text/text4.png",
    },
    Def.ActorFrame{
      Name= "actor_dt",
      OnCommand= cmd(zoom,1.5;vibrate;effectmagnitude,2,2,0;x,320;y,240),
      Text5OffInstantMessageCommand= cmd(visible,false),
      Text5OffMessageCommand= cmd(playcommand,"FadeOut"),
      Text5OnMessageCommand= cmd(playcommand,"FadeIn";zoom,1.5;linear,0.4;zoom,1),
      Text5SmallMessageCommand= cmd(linear,0.5;y,240;zoom,0.5),
      Def.Sprite{
        Name= "actor_et",
        FadeInCommand= cmd(linear,0.4;diffusealpha,1),
        FadeOutCommand= cmd(linear,1;diffusealpha,0),
        InitCommand= cmd(diffusealpha,0),
        Texture= "text/text5.png",
      },
      Def.Sprite{
        Name= "actor_ft",
        FadeInCommand= function(self)
					self:setstate(mawaru_reisen_rng);
					self:linear(0.4);
					self:diffusealpha(1);
				end,
        FadeOutCommand= cmd(linear,1;diffusealpha,0),
        InitCommand= cmd(diffusealpha,0),
        OnCommand= cmd(animate,0;x,85;y,-20),
        Texture= "text/hit 2x1.png",
      },
    },
    Def.Sprite{
      Name= "actor_gt",
      InitCommand= cmd(zoom,1.5;diffusealpha,0;vibrate;effectmagnitude,2,2,0),
      Text6OffInstantMessageCommand= cmd(finishtweening;linear,0;diffusealpha,0),
      Text6OffMessageCommand= cmd(linear,1;diffusealpha,0),
      Text6OnMessageCommand= cmd(finishtweening;x,320;y,240;zoom,1.5;diffusealpha,0;linear,0.4;zoom,1;diffusealpha,1),
      Text6SmallMessageCommand= cmd(linear,0.5;y,100;zoom,0.5),
      Texture= "text/text6.png",
    },
    Def.Sprite{
      Name= "actor_ht",
      InitCommand= cmd(zoom,1.5;diffusealpha,0;vibrate;effectmagnitude,2,2,0),
      Text7OffInstantMessageCommand= cmd(finishtweening;linear,0;diffusealpha,0),
      Text7OffMessageCommand= cmd(linear,1;diffusealpha,0),
      Text7OnMessageCommand= cmd(finishtweening;x,320;y,240;zoom,1.5;diffusealpha,0;linear,0.4;zoom,1;diffusealpha,1),
      Text7SmallMessageCommand= cmd(linear,0.5;y,100;zoom,0.5),
      Texture= "text/text7.png",
    },
    Def.Quad{
      Name= "actor_it",
      InitCommand= cmd(visible,false),
      Text8OffMessageCommand= function(self) if mawaru_nickplaying then MESSAGEMAN:Broadcast('Text9aOff'); else
				MESSAGEMAN:Broadcast('Text9bOff'); end end,
      Text8OnMessageCommand= function(self) if mawaru_nickplaying then MESSAGEMAN:Broadcast('Text9aOn'); else
				MESSAGEMAN:Broadcast('Text9bOn'); end end,
      Text8SmallMessageCommand= function(self) if mawaru_nickplaying then MESSAGEMAN:Broadcast('Text9aSmall'); else
				MESSAGEMAN:Broadcast('Text9bSmall'); end end,
    },
    Def.Sprite{
      Name= "actor_jt",
      InitCommand= cmd(zoom,1.5;diffusealpha,0;vibrate;effectmagnitude,2,2,0),
      Text9aOffInstantMessageCommand= cmd(finishtweening;linear,0;diffusealpha,0),
      Text9aOffMessageCommand= cmd(linear,1;diffusealpha,0),
      Text9aOnMessageCommand= cmd(finishtweening;x,320;y,240;zoom,1.5;diffusealpha,0;linear,0.4;zoom,1;diffusealpha,1),
      Text9aSmallMessageCommand= cmd(linear,0.5;y,180;zoom,0.5),
      Texture= "text/text8.png",
    },
    Def.Sprite{
      Name= "actor_kt",
      InitCommand= cmd(zoom,1.5;diffusealpha,0;vibrate;effectmagnitude,2,2,0),
      Text9bOffInstantMessageCommand= cmd(finishtweening;linear,0;diffusealpha,0),
      Text9bOffMessageCommand= cmd(linear,1;diffusealpha,0),
      Text9bOnMessageCommand= cmd(finishtweening;x,320;y,240;zoom,1.5;diffusealpha,0;linear,0.4;zoom,1;diffusealpha,1),
      Text9bSmallMessageCommand= cmd(linear,0.5;y,180;zoom,0.5),
      Texture= "text/text9.png",
    },
    Def.Sprite{
      Name= "actor_lt",
      InitCommand= cmd(zoom,1.5;diffusealpha,0;vibrate;effectmagnitude,2,2,0),
      Text10OffInstantMessageCommand= cmd(finishtweening;linear,0;diffusealpha,0),
      Text10OffMessageCommand= cmd(linear,1;diffusealpha,0),
      Text10OnMessageCommand= cmd(finishtweening;x,320;y,240;zoom,1.5;diffusealpha,0;linear,0.4;zoom,1;diffusealpha,1),
      Text10SmallMessageCommand= cmd(linear,0.5;y,180;zoom,0.5),
      Texture= "text/text10.png",
    },
    Def.Sprite{
      Name= "actor_mt",
      InitCommand= cmd(zoom,1.5;diffusealpha,0;vibrate;effectmagnitude,2,2,0),
      Text11OffInstantMessageCommand= cmd(finishtweening;linear,0;diffusealpha,0),
      Text11OffMessageCommand= cmd(linear,1;diffusealpha,0),
      Text11OnMessageCommand= cmd(finishtweening;x,320;y,240;zoom,1.5;diffusealpha,0;linear,0.4;zoom,1;diffusealpha,1),
      Text11SmallMessageCommand= cmd(linear,0.5;y,100;zoom,0.5),
      Texture= "text/text11.png",
    },
    Def.Quad{
      Name= "actor_nt",
      InitCommand= cmd(visible,false),
      Text12OffInstantMessageCommand= function(self) MESSAGEMAN:Broadcast('Text12'..mawaru_ecfa_rngt[mawaru_ecfa_rng]..'OffInstant') end,
      Text12OffMessageCommand= function(self) MESSAGEMAN:Broadcast('Text12'..mawaru_ecfa_rngt[mawaru_ecfa_rng]..'Off') end,
      Text12OnMessageCommand= function(self) MESSAGEMAN:Broadcast('Text12'..mawaru_ecfa_rngt[mawaru_ecfa_rng]..'On') end,
      Text12SmallMessageCommand= function(self) MESSAGEMAN:Broadcast('Text12'..mawaru_ecfa_rngt[mawaru_ecfa_rng]..'Small') end,
    },
    Def.Sprite{
      Name= "actor_ot",
      InitCommand= cmd(zoom,1.5;diffusealpha,0;vibrate;effectmagnitude,2,2,0),
      Text12aOffInstantMessageCommand= cmd(finishtweening;linear,0;diffusealpha,0),
      Text12aOffMessageCommand= cmd(linear,1;diffusealpha,0),
      Text12aOnMessageCommand= cmd(finishtweening;x,320;y,240;zoom,1.5;diffusealpha,0;linear,0.4;zoom,1;diffusealpha,1),
      Text12aSmallMessageCommand= cmd(linear,0.5;y,160;zoom,0.5;diffusealpha,0.5),
      Texture= "text/text12a.png",
    },
    Def.Sprite{
      Name= "actor_pt",
      InitCommand= cmd(zoom,1.5;diffusealpha,0;vibrate;effectmagnitude,2,2,0),
      Text12bOffInstantMessageCommand= cmd(finishtweening;linear,0;diffusealpha,0),
      Text12bOffMessageCommand= cmd(linear,1;diffusealpha,0),
      Text12bOnMessageCommand= cmd(finishtweening;x,320;y,240;zoom,1.5;diffusealpha,0;linear,0.4;zoom,1;diffusealpha,1),
      Text12bSmallMessageCommand= cmd(linear,0.5;y,160;zoom,0.5;diffusealpha,0.5),
      Texture= "text/text12b.png",
    },
    Def.Sprite{
      Name= "actor_qt",
      InitCommand= cmd(zoom,1.5;diffusealpha,0;vibrate;effectmagnitude,2,2,0),
      Text12cOffInstantMessageCommand= cmd(finishtweening;linear,0;diffusealpha,0),
      Text12cOffMessageCommand= cmd(linear,1;diffusealpha,0),
      Text12cOnMessageCommand= cmd(finishtweening;x,320;y,240;zoom,1.5;diffusealpha,0;linear,0.4;zoom,1;diffusealpha,1),
      Text12cSmallMessageCommand= cmd(linear,0.5;y,160;zoom,0.5;diffusealpha,0.5),
      Texture= "text/text12c.png",
    },
    Def.Sprite{
      Name= "actor_rt",
      NeutralMessageCommand= cmd(x,320;y,240;diffusealpha,0.4;accelerate,1.5;diffusealpha,0),
      OnCommand= cmd(diffusealpha,0),
      Texture= "neutral.png",
    },
    Def.Sprite{
      Name= "actor_st",
      InitCommand= cmd(zoom,1.5;diffusealpha,0;vibrate;effectmagnitude,2,2,0),
      Text13OffInstantMessageCommand= cmd(finishtweening;linear,0;diffusealpha,0),
      Text13OffMessageCommand= cmd(linear,1;diffusealpha,0),
      Text13OnMessageCommand= cmd(finishtweening;x,320;y,240;zoom,1.5;diffusealpha,0;linear,0.4;zoom,1;diffusealpha,1),
      Text13SmallMessageCommand= cmd(linear,0.5;y,240;zoom,0.5;diffusealpha,0.5),
      Texture= "text/text13.png",
    },
    Def.Sprite{
      Name= "actor_tt",
      InitCommand= cmd(zoom,1.5;diffusealpha,0;vibrate;effectmagnitude,2,2,0),
      Text14OffInstantMessageCommand= cmd(finishtweening;linear,0;diffusealpha,0),
      Text14OffMessageCommand= cmd(linear,1;diffusealpha,0),
      Text14OnMessageCommand= cmd(finishtweening;x,320;y,240;zoom,1.5;diffusealpha,0;linear,0.4;zoom,1;diffusealpha,1),
      Text14SmallMessageCommand= cmd(linear,0.5;y,100;zoom,0.5),
      Texture= "text/text14.png",
    },
    Def.Sprite{
      Name= "actor_ut",
      InitCommand= cmd(zoom,1.5;diffusealpha,0;vibrate;effectmagnitude,2,2,0),
      Text15OffInstantMessageCommand= cmd(finishtweening;linear,0;diffusealpha,0),
      Text15OffMessageCommand= cmd(linear,1;diffusealpha,0),
      Text15OnMessageCommand= cmd(finishtweening;x,320;y,240;zoom,1.5;diffusealpha,0;linear,0.4;zoom,1;diffusealpha,1),
      Text15SmallMessageCommand= cmd(linear,0.5;y,100;zoom,0.5),
      Texture= "text/text15.png",
    },
    Def.Sprite{
      Name= "actor_vt",
      InitCommand= cmd(zoom,1.5;diffusealpha,0;vibrate;effectmagnitude,2,2,0),
      Text16OffInstantMessageCommand= cmd(finishtweening;linear,0;diffusealpha,0),
      Text16OffMessageCommand= cmd(linear,1;diffusealpha,0),
      Text16OnMessageCommand= cmd(finishtweening;x,320;y,240;zoom,1.5;diffusealpha,0;linear,0.4;zoom,1;diffusealpha,1),
      Text16SmallMessageCommand= cmd(linear,0.5;y,100;zoom,0.5),
      Texture= "text/text16.png",--Accidentally got expanded to text16b. -Kid
    },
    Def.Sprite{
      Name= "actor_wt",
      InitCommand= cmd(zoom,1.5;diffusealpha,0;vibrate;effectmagnitude,2,2,0),
      Text16bOffInstantMessageCommand= cmd(finishtweening;linear,0;diffusealpha,0),
      Text16bOffMessageCommand= cmd(linear,1;diffusealpha,0),
      Text16bOnMessageCommand= cmd(finishtweening;x,320;y,240;zoom,1.5;diffusealpha,0;linear,0.4;zoom,1;diffusealpha,1),
      Text16bSmallMessageCommand= cmd(linear,0.5;y,100;zoom,0.5),
      Texture= "text/text16b.png",
    },
    Def.Sprite{
      Name= "actor_xt",
      InitCommand= cmd(zoom,1.5;diffusealpha,0;vibrate;effectmagnitude,2,2,0),
      Text17OffInstantMessageCommand= cmd(finishtweening;linear,0;diffusealpha,0),
      Text17OffMessageCommand= cmd(linear,1;diffusealpha,0),
      Text17OnMessageCommand= cmd(finishtweening;x,320;y,240;zoom,1.5;diffusealpha,0;linear,0.4;zoom,1;diffusealpha,1),
      Text17SmallMessageCommand= cmd(linear,0.5;y,100;zoom,0.5),
      Texture= "text/text17.png",
    },
    Def.Sprite{
      Name= "actor_yt",
      InitCommand= cmd(zoom,1.5;diffusealpha,0;vibrate;effectmagnitude,2,2,0),
      Text18OffInstantMessageCommand= cmd(finishtweening;linear,0;diffusealpha,0),
      Text18OffMessageCommand= cmd(linear,1;diffusealpha,0),
      Text18OnMessageCommand= cmd(finishtweening;x,320;y,240;zoom,1.5;diffusealpha,0;linear,0.4;zoom,1;diffusealpha,1),
      Text18SmallMessageCommand= cmd(linear,0.5;y,100;zoom,0.5),
      Texture= "text/text18.png",
    },
    Def.Sprite{
      Name= "actor_zt",
      InitCommand= cmd(zoom,1.5;diffusealpha,0;vibrate;effectmagnitude,2,2,0),
      Text19OffInstantMessageCommand= cmd(finishtweening;linear,0;diffusealpha,0),
      Text19OffMessageCommand= cmd(linear,1;diffusealpha,0),
      Text19OnMessageCommand= cmd(finishtweening;x,320;y,240;zoom,1.5;diffusealpha,0;linear,0.4;zoom,1;diffusealpha,1),
      Text19SmallMessageCommand= cmd(linear,0.5;y,100;zoom,0.5),
      Texture= "text/text19.png",
    },
    Def.Sprite{
      Name= "actor_At",
      InitCommand= cmd(zoom,1.5;diffusealpha,0;vibrate;effectmagnitude,2,2,0),
      Text20OffInstantMessageCommand= cmd(finishtweening;linear,0;diffusealpha,0),
      Text20OffMessageCommand= cmd(linear,1;diffusealpha,0),
      Text20OnMessageCommand= cmd(finishtweening;x,320;y,240;zoom,1.5;diffusealpha,0;linear,0.4;zoom,1;diffusealpha,1),
      Text20SmallMessageCommand= cmd(linear,0.5;y,100;zoom,0.5),
      Texture= "text/text20.png",
    },
    Def.Sprite{
      Name= "actor_Bt",
      InitCommand= cmd(zoom,1.5;diffusealpha,0;vibrate;effectmagnitude,2,2,0),
      Text21OffInstantMessageCommand= cmd(finishtweening;linear,0;diffusealpha,0),
      Text21OffMessageCommand= cmd(linear,1;diffusealpha,0),
      Text21OnMessageCommand= cmd(finishtweening;x,320;y,240;zoom,1.5;diffusealpha,0;linear,0.4;zoom,1;diffusealpha,1),
      Text21SmallMessageCommand= cmd(linear,0.5;y,100;zoom,0.5),
      Texture= "text/text21.png",
    },
    Def.Sprite{
      Name= "actor_Ct",
      InitCommand= cmd(zoom,1.5;diffusealpha,0;vibrate;effectmagnitude,2,2,0),
      Text22OffInstantMessageCommand= cmd(finishtweening;linear,0;diffusealpha,0),
      Text22OffMessageCommand= cmd(linear,1;diffusealpha,0),
      Text22OnMessageCommand= cmd(finishtweening;x,320;y,240;zoom,1.5;diffusealpha,0;linear,0.4;zoom,1;diffusealpha,1),
      Text22SmallMessageCommand= cmd(linear,0.5;y,100;zoom,0.5),
      Texture= "text/boss1.png",
    },
    Def.Sprite{
      Name= "actor_Dt",
      InitCommand= cmd(zoom,1.5;diffusealpha,0;vibrate;effectmagnitude,2,2,0),
      Text23OffInstantMessageCommand= cmd(finishtweening;linear,0;diffusealpha,0),
      Text23OffMessageCommand= cmd(linear,1;diffusealpha,0),
      Text23OnMessageCommand= cmd(finishtweening;x,320;y,240+80;zoom,1;diffusealpha,0;linear,0.4;zoom,.6;diffusealpha,.5),
      Text23SmallMessageCommand= cmd(linear,0.5;y,100;zoom,0.5),
      Texture= "text/boss2.png",
    },
      Def.Sprite{
        Name= "actor_du",
        InitCommand= function(self) mawaru_bomb_fuse = self end,
        OnCommand= cmd(visible,false;x,320;y,432),
        Texture= "fuse 1x10.png",
      },
      Def.Sprite{
        Name= "actor_eu",
        InitCommand= function(self) mawaru_bomb_flame = self end,
        OnCommand= cmd(visible,false;x,320;y,432),
        Texture= "flame 2x1.png",
      },
      Def.Sprite{
        Name= "actor_fu",
        InitCommand= function(self) mawaru_bomb_main = self end,
        OnCommand= cmd(visible,false;x,48;y,432;pulse;effectclock,"bgm";effectperiod,1;effectmagnitude,1,1.05,1),
        Texture= "bomb.png",
      },
      Def.Sprite{
        Name= "actor_gu",
        Frames= {
          {Frame= 0, Delay= 0.04},
          {Frame= 1, Delay= 0.04},
          {Frame= 2, Delay= 0.04},
          {Frame= 3, Delay= 0.04},
          {Frame= 4, Delay= 0.04},
          {Frame= 5, Delay= 0.04},
          {Frame= 6, Delay= 0.04},
          {Frame= 7, Delay= 0.04},
          {Frame= 8, Delay= 0.04},
          {Frame= 9, Delay= 0.04},
          {Frame= 10, Delay= 0.04},
          {Frame= 11, Delay= 0.04},
          {Frame= 12, Delay= 0.04},
          {Frame= 13, Delay= 0.04},
          {Frame= 14, Delay= 0.04},
          {Frame= 15, Delay= 0.04},
          {Frame= 16, Delay= 0.04},
          {Frame= 17, Delay= 0.04},
          {Frame= 18, Delay= 0.04},
          {Frame= 19, Delay= 0.04},
          {Frame= 20, Delay= 0.04},
          {Frame= 21, Delay= 0.04},
          {Frame= 22, Delay= 0.04},
          {Frame= 23, Delay= 0.04},
          {Frame= 24, Delay= 0.04},
      },
        OnCommand= cmd(x,48-6;y,432+6;zoom,0),
        StaticOnMessageCommand= cmd(finishtweening;zoom,0),
        Texture= "./_explosion 5x5.png",
        TimeUpMessageCommand= cmd(animate,1;setstate,0;zoom,3;sleep,1;zoom,0),
      },
      Def.Sprite{
        Name= "actor_hu",
        OnCommand= cmd(x,320;y,210;diffusealpha,0;vibrate;effectmagnitude,2,2,0),
        SuddenDeathMessageCommand= cmd(sleep,.2;linear,.2;diffusealpha,1;sleep,2;linear,.3;diffusealpha,0),
        Texture= "suddendeath.png",
      },
      Def.Sprite{
        Name= "actor_iu",
        ChanceTimeMessageCommand= cmd(sleep,.2;linear,.2;diffusealpha,1;sleep,2;linear,.3;diffusealpha,0),
        OnCommand= cmd(x,320;y,210;diffusealpha,0;vibrate;effectmagnitude,2,2,0),
        Texture= "chancetime.png",
      },
      Def.Sprite{
        Name= "actor_ju",
        Frames= {
          {Frame= 0, Delay= 0.0333},
          {Frame= 1, Delay= 0.0333},
          {Frame= 2, Delay= 0.0333},
          {Frame= 3, Delay= 0.0333},
      },
        BlackOffMessageCommand= cmd(visible,false;diffuse,color('1,1,1,1')),
        BlackOnMessageCommand= cmd(visible,true;diffuse,color('0,0,0,1')),--Fixed zoomto. -Kid
        OnCommand= cmd(x,320;y,240;zoomto,640,480;visible,false),
        StaticOffMessageCommand= cmd(visible,false),
        StaticOnMessageCommand= cmd(visible,true),
        Texture= "./_static 4x1.png",
      },
      Def.Sprite{
        Name= "actor_ku",
        NoBarOffMessageCommand= cmd(visible,false),
        NoBarOnMessageCommand= cmd(visible,true),--Fixed zoomto. -Kid
        OnCommand= cmd(x,320;y,240;zoomto,640,480;visible,false),
        Texture= "nobar.png",
      },
    },
    --All subtitle parts: Unconverted x & y pos. -Kid
    Def.Quad{
      Name= "actor_lu",--Fixed zoomto. -Kid
      OnCommand= cmd(x,320;y,480-96;zoomto,SCREEN_WIDTH,0;diffuse,color('0,0,0,1');diffusealpha,0.6),
      SubOffMessageCommand= cmd(diffusealpha,0),
      SubtitleMessageCommand= cmd(bounceend,0.5;zoomtoheight,128),
    },
    Def.Sprite{
      Name= "actor_mu",
      Frames= {
        {Frame= 0, Delay= 0.066},
        {Frame= 1, Delay= 0.066},
        {Frame= 2, Delay= 0.066},
        {Frame= 3, Delay= 0.066},
        {Frame= 4, Delay= 0.066},
        {Frame= 5, Delay= 0.066},
        {Frame= 6, Delay= 0.066},
        {Frame= 7, Delay= 0.066},
        {Frame= 8, Delay= 0.066},
        {Frame= 9, Delay= 0.066},
        {Frame= 10, Delay= 0.066},
        {Frame= 11, Delay= 0.066},
        {Frame= 12, Delay= 0.066},
        {Frame= 13, Delay= 0.066},
        {Frame= 14, Delay= 0.066},
        {Frame= 15, Delay= 0.066},
        {Frame= 16, Delay= 0.066},
        {Frame= 17, Delay= 0.066},
        {Frame= 18, Delay= 0.066},
        {Frame= 19, Delay= 0.066},
        {Frame= 20, Delay= 0.066},
        {Frame= 21, Delay= 0.066},
        {Frame= 22, Delay= 0.066},
        {Frame= 23, Delay= 0.066},
        {Frame= 24, Delay= 0.066},
        {Frame= 25, Delay= 0.066},
        {Frame= 26, Delay= 0.066},
        {Frame= 27, Delay= 0.066},
        {Frame= 28, Delay= 0.066},
        {Frame= 29, Delay= 0.066},
        {Frame= 30, Delay= 0.066},
        {Frame= 31, Delay= 0.066},
        {Frame= 32, Delay= 0.066},
        {Frame= 33, Delay= 0.066},
        {Frame= 34, Delay= 0.066},
        {Frame= 35, Delay= 0.066},
        {Frame= 36, Delay= 0.066},
        {Frame= 37, Delay= 0.066},
        {Frame= 38, Delay= 0.066},
        {Frame= 39, Delay= 0.066},
        {Frame= 40, Delay= 0.066},
        {Frame= 41, Delay= 0.066},
        {Frame= 42, Delay= 0.066},
        {Frame= 43, Delay= 0.066},
        {Frame= 44, Delay= 0.066},
        {Frame= 45, Delay= 0.066},
        {Frame= 46, Delay= 0.066},
        {Frame= 47, Delay= 0.066},
        {Frame= 48, Delay= 0.066},
        {Frame= 49, Delay= 0.066},
        {Frame= 50, Delay= 0.066},
        {Frame= 51, Delay= 0.066},
        {Frame= 52, Delay= 0.066},
        {Frame= 53, Delay= 0.066},
        {Frame= 54, Delay= 0.066},
        {Frame= 55, Delay= 0.066},
        {Frame= 56, Delay= 0.066},
        {Frame= 57, Delay= 0.066},
        {Frame= 58, Delay= 0.066},
        {Frame= 59, Delay= 0.066},
        {Frame= 60, Delay= 0.066},
        {Frame= 61, Delay= 0.066},
        {Frame= 62, Delay= 0.066},
        {Frame= 63, Delay= 0.066},
        {Frame= 64, Delay= 0.066},
        {Frame= 65, Delay= 0.066},
        {Frame= 66, Delay= 0.066},
        {Frame= 67, Delay= 0.066},
        {Frame= 68, Delay= 0.066},
        {Frame= 69, Delay= 0.066},
        {Frame= 70, Delay= 0.066},
        {Frame= 71, Delay= 0.066},
        {Frame= 72, Delay= 0.066},
        {Frame= 73, Delay= 0.066},
        {Frame= 74, Delay= 0.066},
        {Frame= 75, Delay= 0.066},
        {Frame= 76, Delay= 0.066},
        {Frame= 77, Delay= 0.066},
        {Frame= 78, Delay= 0.066},
        {Frame= 79, Delay= 0.066},
        {Frame= 80, Delay= 0.066},
        {Frame= 81, Delay= 0.066},
        {Frame= 82, Delay= 0.066},
        {Frame= 83, Delay= 0.066},
        {Frame= 84, Delay= 0.066},
        {Frame= 85, Delay= 0.066},
        {Frame= 86, Delay= 0.066},
        {Frame= 87, Delay= 0.066},
        {Frame= 88, Delay= 0.066},
        {Frame= 89, Delay= 0.066},
        {Frame= 90, Delay= 0.066},
        {Frame= 91, Delay= 0.066},
        {Frame= 92, Delay= 0.066},
        {Frame= 93, Delay= 0.066},
        {Frame= 94, Delay= 0.066},
        {Frame= 95, Delay= 0.066},
        {Frame= 96, Delay= 0.066},
        {Frame= 97, Delay= 0.066},
        {Frame= 98, Delay= 0.066},
        {Frame= 99, Delay= 0.066},
        {Frame= 100, Delay= 0.066},
        {Frame= 101, Delay= 0.066},
        {Frame= 102, Delay= 0.066},
        {Frame= 103, Delay= 0.066},
        {Frame= 104, Delay= 0.066},
        {Frame= 105, Delay= 0.066},
        {Frame= 106, Delay= 0.066},
        {Frame= 107, Delay= 0.066},
        {Frame= 108, Delay= 0.066},
        {Frame= 109, Delay= 0.066},
        {Frame= 110, Delay= 0.066},
        {Frame= 111, Delay= 0.066},
        {Frame= 112, Delay= 0.066},
        {Frame= 113, Delay= 0.066},
        {Frame= 114, Delay= 0.066},
        {Frame= 115, Delay= 0.066},
        {Frame= 116, Delay= 0.066},
        {Frame= 117, Delay= 0.066},
        {Frame= 118, Delay= 0.066},
        {Frame= 119, Delay= 0.066},
        {Frame= 120, Delay= 0.066},
        {Frame= 121, Delay= 0.066},
        {Frame= 122, Delay= 0.066},
        {Frame= 123, Delay= 0.066},
        {Frame= 124, Delay= 0.066},
        {Frame= 125, Delay= 0.066},
        {Frame= 126, Delay= 0.066},
        {Frame= 127, Delay= 0.066},
        {Frame= 128, Delay= 0.066},
        {Frame= 129, Delay= 0.066},
        {Frame= 130, Delay= 0.066},
        {Frame= 131, Delay= 0.066},
        {Frame= 132, Delay= 0.066},
        {Frame= 133, Delay= 0.066},
        {Frame= 134, Delay= 0.066},
        {Frame= 135, Delay= 0.066},
        {Frame= 136, Delay= 0.066},
        {Frame= 137, Delay= 0.066},
        {Frame= 138, Delay= 0.066},
        {Frame= 139, Delay= 0.066},
        {Frame= 140, Delay= 0.066},
        {Frame= 141, Delay= 0.066},
        {Frame= 142, Delay= 0.066},
        {Frame= 143, Delay= 0.066},
        {Frame= 144, Delay= 0.066},
        {Frame= 145, Delay= 0.066},
        {Frame= 146, Delay= 0.066},
        {Frame= 147, Delay= 0.066},
        {Frame= 148, Delay= 0.066},
        {Frame= 149, Delay= 0.066},
        {Frame= 150, Delay= 0.066},
        {Frame= 151, Delay= 0.066},
        {Frame= 152, Delay= 0.066},
        {Frame= 153, Delay= 0.066},
        {Frame= 154, Delay= 0.066},
        {Frame= 155, Delay= 0.066},
        {Frame= 156, Delay= 0.066},
        {Frame= 157, Delay= 0.066},
        {Frame= 158, Delay= 0.066},
        {Frame= 159, Delay= 0.066},
        {Frame= 160, Delay= 0.066},
        {Frame= 161, Delay= 0.066},
        {Frame= 162, Delay= 0.066},
        {Frame= 163, Delay= 0.066},
        {Frame= 164, Delay= 0.066},
        {Frame= 165, Delay= 0.066},
        {Frame= 166, Delay= 0.066},
        {Frame= 167, Delay= 0.066},
        {Frame= 168, Delay= 0.066},
        {Frame= 169, Delay= 0.066},
        {Frame= 170, Delay= 0.066},
        {Frame= 171, Delay= 0.066},
        {Frame= 172, Delay= 0.066},
        {Frame= 173, Delay= 0.066},
        {Frame= 174, Delay= 0.066},
        {Frame= 175, Delay= 0.066},
        {Frame= 176, Delay= 0.066},
        {Frame= 177, Delay= 0.066},
        {Frame= 178, Delay= 0.066},
        {Frame= 179, Delay= 0.066},
        {Frame= 180, Delay= 0.066},
        {Frame= 181, Delay= 0.066},
        {Frame= 182, Delay= 0.066},
        {Frame= 183, Delay= 0.066},
        {Frame= 184, Delay= 0.066},
        {Frame= 185, Delay= 0.066},
        {Frame= 186, Delay= 0.066},
    },
      OnCommand= cmd(x,320;y,480-96;diffusealpha,0;zoom,1.25),
      SpidermanMessageCommand= cmd(sleep,0.2;linear,0.5;diffusealpha,1),
      SubOffMessageCommand= cmd(diffusealpha,0),
      Texture= "text/_dance 17x11.png",
    },
    Def.Sprite{
      Name= "actor_nu",
      Frames= {
        {Frame= 0, Delay= 1},
	    },
      OnCommand= cmd(x,320;y,480-96;diffusealpha,0),
      SubOffMessageCommand= cmd(diffusealpha,0),
      SubtitleMessageCommand= function(self)
		
			local rng = math.random(68,89)
			
			if rng == 68 then 
				MESSAGEMAN:Broadcast('Spiderman')
			else
			
				if srt8_samiplaying then
					self:Load(songName..'lua/text/nick.png');
					self:addy(80);
					srt8_samiplaying = false
					mawaru_nickplaying = true;
					--'ok but go fuck yourslef' for first subtitle
				else
					mawaru_nickplaying = false;
					self:Load(songName..'lua/text/sub00'..rng..'.png');
				end
				self:sleep(0.2);
				self:linear(0.5);
				self:diffusealpha(1);
			
			end
		end,
      Texture= "text/sub0069.png",
    },
  },--The whole quad that does direction checking isn't needed in sm5. -Kid.
--   Def.Quad{
--     Name= "actor_ou",
--     Debug1MessageCommand= function(self)
-- 		end,
--     LiftDownP1MessageCommand= function (self) if not FUCK_EXE then
-- 			mawaru_keys[7-5] = 0; end
-- 		end,
--     LiftDownP2MessageCommand= function (self)
-- 			mawaru_keys[7-1] = 0;
-- 		end,
--     LiftLeftP1MessageCommand= function (self) if not FUCK_EXE then
-- 			mawaru_keys[6-5] = 0; end
-- 		end,
--     LiftLeftP2MessageCommand= function (self)
-- 			mawaru_keys[6-1] = 0;
-- 		end,
--     LiftRightP1MessageCommand= function (self) if not FUCK_EXE then
-- 			mawaru_keys[9-5] = 0; end
-- 		end,
--     LiftRightP2MessageCommand= function (self)
-- 			mawaru_keys[9-1] = 0;
-- 		end,
--     LiftUpP1MessageCommand= function (self) if not FUCK_EXE then
-- 			mawaru_keys[8-5] = 0; end
-- 		end,
--     LiftUpP2MessageCommand= function (self)
-- 			mawaru_keys[8-1] = 0;
-- 		end,
--     OnCommand= cmd(visible,false),
--     StepDownP1MessageCommand= function (self) if not FUCK_EXE then
-- 			mawaru_keys[7-5] = 1; end
-- 		end,
--     StepDownP2MessageCommand= function (self) if not FUCK_EXE then
-- 			mawaru_keys[7-1] = 1; end
-- 		end,
--     StepLeftP1MessageCommand= function (self) if not FUCK_EXE then
-- 			mawaru_keys[6-5] = 1; end
-- 		end,
--     StepLeftP2MessageCommand= function (self) if not FUCK_EXE then
-- 			mawaru_keys[6-1] = 1; end
-- 		end,
--     StepP1DownLiftMessageCommand= function (self)
-- 			mawaru_keys[7-5] = 0;
-- 		end,
--     StepP1DownLiftedMessageCommand= function (self) if not FUCK_EXE then
-- 			mawaru_keys[7-5] = 0; end
-- 		end,
--     StepP1DownPressMessageCommand= function (self)
-- 			mawaru_keys[7-5] = 1;
-- 		end,
--     StepP1DownPressedMessageCommand= function (self) if not FUCK_EXE then
-- 			mawaru_keys[7-5] = 1; end
-- 		end,
--     StepP1LeftLiftMessageCommand= function (self)
-- 			mawaru_keys[6-5] = 0;
-- 		end,
--     StepP1LeftLiftedMessageCommand= function (self) if not FUCK_EXE then
-- 			mawaru_keys[6-5] = 0; end
-- 		end,
--     StepP1LeftPressMessageCommand= function (self)
-- 			mawaru_keys[6-5] = 1;
-- 		end,
--     StepP1LeftPressedMessageCommand= function (self) if not FUCK_EXE then
-- 			mawaru_keys[6-5] = 1; end
-- 		end,
--     StepP1RightLiftMessageCommand= function (self)
-- 			mawaru_keys[9-5] = 0;
-- 		end,
--     StepP1RightLiftedMessageCommand= function (self) if not FUCK_EXE then
-- 			mawaru_keys[9-5] = 0; end
-- 		end,
--     StepP1RightPressMessageCommand= function (self)
-- 			mawaru_keys[9-5] = 1;
-- 		end,
--     StepP1RightPressedMessageCommand= function (self) if not FUCK_EXE then
-- 			mawaru_keys[9-5] = 1; end
-- 		end,
--     StepP1UpLiftMessageCommand= function (self)
-- 			mawaru_keys[8-5] = 0;
-- 		end,
--     StepP1UpLiftedMessageCommand= function (self) if not FUCK_EXE then
-- 			mawaru_keys[8-5] = 0; end
-- 		end,
--     StepP1UpPressMessageCommand= function (self)
-- 			mawaru_keys[8-5] = 1;
-- 		end,
--     StepP1UpPressedMessageCommand= function (self) if not FUCK_EXE then
-- 			mawaru_keys[8-5] = 1; end
-- 		end,
--     StepP2DownLiftMessageCommand= function (self)
-- 			mawaru_keys[7-1] = 0;
-- 		end,
--     StepP2DownLiftedMessageCommand= function (self)
-- 			mawaru_keys[7-1] = 0;
-- 		end,
--     StepP2DownPressMessageCommand= function (self)
-- 			mawaru_keys[7-1] = 1;
-- 		end,
--     StepP2DownPressedMessageCommand= function (self) if not FUCK_EXE then
-- 			mawaru_keys[7-1] = 1; end
-- 		end,
--     StepP2LeftLiftMessageCommand= function (self)
-- 			mawaru_keys[6-1] = 0;
-- 		end,
--     StepP2LeftLiftedMessageCommand= function (self)
-- 			mawaru_keys[6-1] = 0;
-- 		end,
--     StepP2LeftPressMessageCommand= function (self)
-- 			mawaru_keys[6-1] = 1;
-- 		end,
--     StepP2LeftPressedMessageCommand= function (self) if not FUCK_EXE then
-- 			mawaru_keys[6-1] = 1; end
-- 		end,
--     StepP2RightLiftMessageCommand= function (self)
-- 			mawaru_keys[9-1] = 0;
-- 		end,
--     StepP2RightLiftedMessageCommand= function (self)
-- 			mawaru_keys[9-1] = 0;
-- 		end,
--     StepP2RightPressMessageCommand= function (self)
-- 			mawaru_keys[9-1] = 1;
-- 		end,
--     StepP2RightPressedMessageCommand= function (self) if not FUCK_EXE then
-- 			mawaru_keys[9-1] = 1; end
-- 		end,
--     StepP2UpLiftMessageCommand= function (self)
-- 			mawaru_keys[8-1] = 0;
-- 		end,
--     StepP2UpLiftedMessageCommand= function (self)
-- 			mawaru_keys[8-1] = 0;
-- 		end,
--     StepP2UpPressMessageCommand= function (self)
-- 			mawaru_keys[8-1] = 1;
-- 		end,
--     StepP2UpPressedMessageCommand= function (self) if not FUCK_EXE then
-- 			mawaru_keys[8-1] = 1; end
-- 		end,
--     StepRightP1MessageCommand= function (self) if not FUCK_EXE then
-- 			mawaru_keys[9-5] = 1; end
-- 		end,
--     StepRightP2MessageCommand= function (self) if not FUCK_EXE then
-- 			mawaru_keys[9-1] = 1; end
-- 		end,
--     StepUpP1MessageCommand= function (self) if not FUCK_EXE then
-- 			mawaru_keys[8-5] = 1; end
-- 		end,
--     StepUpP2MessageCommand= function (self) if not FUCK_EXE then
-- 			mawaru_keys[8-1] = 1; end
-- 		end,
--   },
  Def.Quad{
    Name= "actor_pu",
    InitCommand= function(self) mawaru_controller=self
		function mawaru_turnonlights()
			if GAMESTATE:IsPlayerEnabled(PLAYER_1) then
				mawaru_lightmask1:visible(true)
				mawaru_lightshine1:visible(true)
				mawaru_lightbulb1:setstate(0);
			end
			if GAMESTATE:IsPlayerEnabled(PLAYER_2) then
				mawaru_lightmask2:visible(true)
				mawaru_lightshine2:visible(true)
				mawaru_lightbulb2:setstate(0);
			end
		end
		function mawaru_turnofflight(pn)
			if GAMESTATE:IsPlayerEnabled(pn-1) then
				_G['mawaru_lightmask'..pn]:visible(false)
				_G['mawaru_lightshine'..pn]:visible(false)
				_G['mawaru_lightbulb'..pn]:setstate(1);
			end
		end
	end,
    OnCommand= cmd(visible,false),
    ReturnInnerBGFastMessageCommand= function(self)
		mawaru_turnonlights()
	end,
    ReturnInnerBGMessageCommand= function(self)
		mawaru_turnonlights()
	end,
  },
  Def.Sprite{
    Name= "actor_qu",
    InitCommand= function(self) mawaru_gfx_gradep1 = self; end,
    MawaRightLowP1MessageCommand= cmd(setstate,1;y,SCREEN_CENTER_Y + 120;diffusealpha,1;sleep,0.1;diffusealpha,0;sleep,0.1;diffusealpha,1;sleep,mawaru_4bl-0.2;diffusealpha,0),
    MawaRightP1MessageCommand= cmd(setstate,1;y,SCREEN_CENTER_Y + 0;diffusealpha,1;sleep,0.1;diffusealpha,0;sleep,0.1;diffusealpha,1;sleep,mawaru_4bl-0.2;diffusealpha,0),
    MawaWrongLowP1MessageCommand= cmd(setstate,0;y,SCREEN_CENTER_Y + 120;diffusealpha,1;sleep,0.1;diffusealpha,0;sleep,0.1;diffusealpha,1;sleep,mawaru_4bl-0.2;diffusealpha,0),
    MawaWrongP1MessageCommand= cmd(setstate,0;y,SCREEN_CENTER_Y + 0;diffusealpha,1;sleep,0.1;diffusealpha,0;sleep,0.1;diffusealpha,1;sleep,mawaru_4bl-0.2;diffusealpha,0),
    OnCommand= cmd(x,SCREEN_WIDTH*0.25;y,SCREEN_CENTER_Y;diffusealpha,0;animate,0),
    Texture= "grade 2x1.png",
  },
  Def.Sprite{
    Name= "actor_ru",
    InitCommand= function(self) mawaru_gfx_gradep2 = self; end,
    MawaRightLowP2MessageCommand= cmd(setstate,1;y,SCREEN_CENTER_Y + 120;diffusealpha,1;sleep,0.1;diffusealpha,0;sleep,0.1;diffusealpha,1;sleep,mawaru_4bl-0.2;diffusealpha,0),
    MawaRightP2MessageCommand= cmd(setstate,1;y,SCREEN_CENTER_Y + 0;diffusealpha,1;sleep,0.1;diffusealpha,0;sleep,0.1;diffusealpha,1;sleep,mawaru_4bl-0.2;diffusealpha,0),
    MawaWrongLowP2MessageCommand= cmd(setstate,0;y,SCREEN_CENTER_Y + 120;diffusealpha,1;sleep,0.1;diffusealpha,0;sleep,0.1;diffusealpha,1;sleep,mawaru_4bl-0.2;diffusealpha,0),
    MawaWrongP2MessageCommand= cmd(setstate,0;y,SCREEN_CENTER_Y + 0;diffusealpha,1;sleep,0.1;diffusealpha,0;sleep,0.1;diffusealpha,1;sleep,mawaru_4bl-0.2;diffusealpha,0),
    OnCommand= cmd(x,SCREEN_WIDTH*0.75;y,SCREEN_CENTER_Y;diffusealpha,0;animate,0),
    Texture= "grade 2x1.png",
  },
  optional_actor(cond_wp_result,
  Def.BitmapText{
    Name= "actor_su",
    Font= "Combo numbers",
    MawaBlombyScoreP1MessageCommand= function(self)
		self:diffusealpha(1);
		self:settext(mawaru_blomby_score[1]);
		self:sleep(1.5);
		self:diffusealpha(0);
	end,
    MawaBodyScoreP1MessageCommand= function(self)
		self:diffusealpha(1);
		self:settext(mawaru_body_score[1]);
		self:sleep(1.5);
		self:diffusealpha(0);
	end,
    OnCommand= cmd(x,SCREEN_WIDTH*0.25;y,SCREEN_CENTER_Y-30;zoom,1.3;diffuse,color('0,1,0,0')),
    Text= "",
  }),
  optional_actor(cond_xp_result,
  Def.BitmapText{
    Name= "actor_tu",
    Font= "Combo numbers",
    MawaBlombyScoreP2MessageCommand= function(self)
		self:diffusealpha(1);
		self:settext(mawaru_blomby_score[2]);
		self:sleep(1.5);
		self:diffusealpha(0);
	end,
    MawaBodyScoreP2MessageCommand= function(self)
		self:diffusealpha(1);
		self:settext(mawaru_body_score[2]);
		self:sleep(1.5);
		self:diffusealpha(0);
	end,
    OnCommand= cmd(x,SCREEN_WIDTH*0.75;y,SCREEN_CENTER_Y-30;zoom,1.3;diffuse,color('0,1,0,0')),
    Text= "",
  }),
  Def.Quad{
    Name= "actor_uu",
    OnCommand= cmd(stretchto,0,0,SCREEN_WIDTH,SCREEN_HEIGHT;diffuse,color('0,0,0,1');linear,1;diffusealpha,0),
  },
  Def.Quad{
    Name= "actor_vu",
    InitCommand= function(self) mawaru_colorant=self end,
    OnCommand= cmd(visible,false),
  },
}
