local cond_Deb_result= GAMESTATE:IsPlayerEnabled(PLAYER_1)

local cond_Eeb_result= GAMESTATE:IsPlayerEnabled(PLAYER_2)

local cond_Feb_result= not GAMESTATE:IsPlayerEnabled(PLAYER_1)

local cond_afb_result= not GAMESTATE:IsPlayerEnabled(PLAYER_2)

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

return Def.ActorFrame{
  Name= "actor_bfb",
  Def.ActorFrame{
    Name= "actor_cfb",--No, the main lua does this already. No need to do it here. -Kid
    --OnCommand= cmd(zoomx,SCREEN_WIDTH/640;zoomy,SCREEN_HEIGHT/480),
    Def.Quad{
      Name= "actor_dfb",
      InitCommand= function(self)
		
			--this is where variables go when the simfile starts up
			--function declarations, and things that will never change even
			--if this particular minigame is restarted after being played once before
		
			--for storing if a button is held down
			mawaru_lisa_held = {0,0,0,0,0,0,0,0};
			
			mawaru_lisa_invin = {1,1}
			
			mawaru_lisa_player = {};
			
			mawaru_lisa_barrelboys = {{},{}};
			
			mawaru_lisa_pos = {{2,18},{2,18}}
			
			mawaru_lisa_moving = {0,0}
			
			mawaru_lisa_dir = {3,3}
			mawaru_lisa_lastdir = {3,3}
			
			mawaru_lisa_bumptimer = {0,0}
			mawaru_lisa_movespeed = {0,0}
			
			mawaru_lisa_won = {false,false}
			mawaru_lisa_score = {0,0}
			mawaru_lisa_scoreb = {0,0}
			
			mawaru_lisa_fall = {false,false}
			
			mawaru_lisa_barrels = {
			}
			mawaru_lisa_barrels[1] = {
				{10,14,{-4,0.9,0,0.9,4,0.9,0,0.9}},
				{4,10,{5,1.15,0,0.6,-5,1.15,0,0.6}},
				{2,6,{9,1.4,0,1.2,-9,1.4,0,0.3}}
			}
			mawaru_lisa_barrels[2] = {
				{10,14,{-4,0.9,0,0.9,4,0.9,0,0.9}},
				{4,10,{5,1.15,0,0.6,-5,1.15,0,0.6}},
				{2,6,{9,1.4,0,1.2,-9,1.4,0,0.3}}
			}
			mawaru_lisa_barrels[3] = {
				{10,14,{-4,0.9,0,0.9,4,0.9,0,0.9}},
				{4,10,{5,1.15,0,0.6,-5,1.15,0,0.6}},
				{2,6,{9,1.4,0,1.2,-9,1.4,0,0.3}}
			}
			mawaru_lisa_barrels[4] = {
				{10,14,{-4,0.9,0,0.9,4,0.9,0,0.9}},
				{4,10,{5,1.15,0,0.6,-5,1.15,0,0.6}},
				{2,6,{9,1.4,0,1.2,-9,1.4,0,0.3}}
			}
			mawaru_lisa_barrels[5] = {
				{10,14,{-4,0.9,0,0.9,4,0.9,0,0.9}},
				{4,10,{5,1.15,0,0.6,-5,1.15,0,0.6}},
				{2,6,{9,1.4,0,1.2,-9,1.4,0,0.3}}
			}
			mawaru_lisa_barrels[6] = {
				{10,14,{-4,0.9,0,0.9,4,0.9,0,0.9}},
				{4,10,{5,1.15,0,0.6,-5,1.15,0,0.6}},
				{2,6,{9,1.4,0,1.2,-9,1.4,0,0.3}}
			}
			
			function mawaru_lisa_check(pn)
				
			end
			
			function mawaru_lisa_step(dir,pn,spd)
					
				--take a step
				
				if not spd then
					mawaru_lisa_movespeed[pn] = 0.2
				else
					mawaru_lisa_movespeed[pn] = spd
				end
				
				--mawaru_lisa_dir[pn] = dir;
				
				--move!
				local thisSpace = tonumber(mawaru_lisa_puzzle[mawaru_lisa_pos[pn][2] ][mawaru_lisa_pos[pn][1] ])
				
				if thisSpace ~= 2 then
					if dir == 0 or dir == 3 then
						mawaru_lisa_dir[pn] = dir;
						mawaru_lisa_lastdir[pn] = dir
					else
						mawaru_lisa_dir[pn] = mawaru_lisa_lastdir[pn]
					end
				end
				
				--Trace('move from '..tostring(thisSpace))
				
				if dir == 0 then
				
					local nextSpace = 1
					if mawaru_lisa_pos[pn][1]-1 > 0 then
						nextSpace = tonumber(mawaru_lisa_puzzle[mawaru_lisa_pos[pn][2] ][mawaru_lisa_pos[pn][1]-1])
					end
					if nextSpace == 1 then
						if mawaru_lisa_bumptimer[pn]<=0 then
							--Sound('bump');
							mawaru_lisa_bumptimer[pn] = 0.4;
						end
						mawaru_lisa_movespeed[pn] = 0;
					else
						mawaru_lisa_pos[pn][1] = mawaru_lisa_pos[pn][1]-1
						mawaru_lisa_moving[pn] = mawaru_lisa_movespeed[pn]+0.1; --keep the run cycle playing a little after we stop moving
					end
					
				elseif dir == 1 and mawaru_lisa_pos[pn][2] > 2 then
					
					local nextSpace = 1
					if mawaru_lisa_pos[pn][2]+1 < table.getn(mawaru_lisa_puzzle)+1 then
						nextSpace = tonumber(mawaru_lisa_puzzle[mawaru_lisa_pos[pn][2]+1][mawaru_lisa_pos[pn][1] ])
					end
					if nextSpace == 1 then
						if mawaru_lisa_bumptimer[pn]<=0 then
							--Sound('bump');
							mawaru_lisa_bumptimer[pn] = 0.4;
						end
						mawaru_lisa_movespeed[pn] = 0;
					else
						mawaru_lisa_pos[pn][2] = mawaru_lisa_pos[pn][2]+1
						mawaru_lisa_moving[pn] = mawaru_lisa_movespeed[pn]+0.1; --keep the run cycle playing a little after we stop moving
					end
					if nextSpace == 2 then
						mawaru_lisa_dir[pn] = dir
					else
						_G['mawaru_lisa_controller'..pn]:sleep(mawaru_lisa_movespeed[pn])
						_G['mawaru_lisa_controller'..pn]:queuemessage('LisaIdleP'..pn);
					end
					
				elseif dir == 2 then
					local nextSpace = 1
					if mawaru_lisa_pos[pn][2]-1 > 0 then
						nextSpace = tonumber(mawaru_lisa_puzzle[mawaru_lisa_pos[pn][2]-1][mawaru_lisa_pos[pn][1] ])
					end
					if nextSpace == 1 then
						if mawaru_lisa_bumptimer[pn]<=0 then
							--Sound('bump');
							mawaru_lisa_bumptimer[pn] = 0.4;
						end
						mawaru_lisa_movespeed[pn] = 0;
					else
						mawaru_lisa_pos[pn][2] = mawaru_lisa_pos[pn][2]-1
						mawaru_lisa_moving[pn] = mawaru_lisa_movespeed[pn]+0.1; --keep the run cycle playing a little after we stop moving
					end
					if nextSpace == 2 then
						mawaru_lisa_dir[pn] = dir
					else
						if mawaru_lisa_pos[pn][2] == 2 and not mawaru_lisa_won[pn] then
							MESSAGEMAN:Broadcast('LisaWinP'..pn)
							mawaru_lisa_won[pn] = true;
							Sound('tadaaa');
						end
						_G['mawaru_lisa_controller'..pn]:sleep(mawaru_lisa_movespeed[pn])
						_G['mawaru_lisa_controller'..pn]:queuemessage('LisaIdleP'..pn);
					end
					
				else
					local nextSpace = 1
					if mawaru_lisa_pos[pn][1]+1 < table.getn(mawaru_lisa_puzzle[1])+1 then
						nextSpace = tonumber(mawaru_lisa_puzzle[mawaru_lisa_pos[pn][2] ][mawaru_lisa_pos[pn][1]+1])
					end
					if nextSpace == 1 then
						if mawaru_lisa_bumptimer[pn]<=0 then
							--Sound('bump');
							mawaru_lisa_bumptimer[pn] = 0.4;
						end
						mawaru_lisa_movespeed[pn] = 0;
					else
						mawaru_lisa_pos[pn][1] = mawaru_lisa_pos[pn][1]+1
						mawaru_lisa_moving[pn] = mawaru_lisa_movespeed[pn]+0.1; --keep the run cycle playing a little after we stop moving
					end
					
				end
				
				mawaru_lisa_lockinput[pn] = mawaru_lisa_movespeed[pn]; --min time between registering inputs
				
				mawaru_lisa_update_player(pn,mawaru_lisa_movespeed[pn])
				
			end
			
			function mawaru_lisa_update_player(pn,spd)
				mawaru_lisa_player[pn]:sleep(0);
				mawaru_lisa_player[pn]:linear(spd);
				mawaru_lisa_player[pn]:x((mawaru_lisa_pos[pn][1]*32)-60+12);
				mawaru_lisa_player[pn]:y((mawaru_lisa_pos[pn][2]*32)-190);
			end
			
			mawaru_lisa_puzzle = {
				{1,1,1,1,1,1,1,1,1,1,1,1},
				{1,0,0,0,0,0,0,0,0,0,0,1},
				{1,1,1,1,1,2,1,1,1,1,1,1},
				{1,1,1,1,1,2,1,1,1,1,1,1},
				{1,1,1,1,1,2,1,1,1,1,1,1},
				{1,0,0,0,0,0,0,0,0,0,0,1},
				{1,1,1,1,1,1,1,1,1,2,1,1},
				{1,1,1,1,1,1,1,1,1,2,1,1},
				{1,1,1,1,1,1,1,1,1,2,1,1},
				{1,0,0,0,0,0,0,0,0,0,0,1},
				{1,1,1,1,1,1,2,1,1,1,1,1},
				{1,1,1,1,1,1,2,1,1,1,1,1},
				{1,1,1,1,1,1,2,1,1,1,1,1},
				{1,0,0,0,0,0,0,0,0,0,0,1},
				{1,1,1,2,1,1,1,1,1,1,1,1},
				{1,1,1,2,1,1,1,1,1,1,1,1},
				{1,1,1,2,1,1,1,1,1,1,1,1},
				{1,0,0,0,0,0,0,0,0,0,0,1},
				{1,1,1,1,1,1,1,1,1,1,1,1}
			}
			
			function mawaru_lisa_nextfloor(ypos)
				for i=2,18,4 do
					if i > ypos then
						return i
					end
				end
				return 18
			end
			
		end,
      KillCommand= function(self)
			--any cleanup, if necessary
		end,
      StartCommand= function(self)
			
			--variables set up when a game is started
			--wait 2 seconds (for the curtain or whatever) before accepting any inputs
			mawaru_lisa_lockinput = {.3,.3};
			
			for pn = 1,2 do
			
				if GAMESTATE:IsPlayerEnabled(pn-1) then
					mawaru_lisa_update_player(pn,0)
					mawaru_lisa_player[pn]:visible(true);
					
					local barl = mawaru_lisa_barrels[ mawaru_difficulty[pn]+1 ]
					for i=1,table.getn(barl) do
						local a = mawaru_lisa_barrelboys[pn][i].actor
						a:visible(true);
						a:animate(0);
						a:setstate(0);
						a:x( (barl[i][1]*32)-60+12 );
						a:y( (barl[i][2]*32)-149 );
						
					end
					
				end
				
			end
			
			paused = false;
			
			self:sleep(0.02);
			self:queuecommand('Update');

		end,
      UpdateCommand= function(self)
			
			--game logic
			
			for pn=1,2 do
				
				if GAMESTATE:IsPlayerEnabled(pn-1) then
				
					mawaru_lisa_score[pn] = 18-mawaru_lisa_pos[pn][2]
					mawaru_lisa_scoreb[pn] = mawaru_lisa_score[pn]*0.5;
					MESSAGEMAN:Broadcast('LisaUpdateScoreP'..pn);
					
					local barl = mawaru_lisa_barrels[ mawaru_difficulty[pn] + 1 ]
					for i=1,table.getn(barl) do
						local a = mawaru_lisa_barrelboys[pn][i].actor
						
						if mawaru_lisa_invin[pn] <= 0 and mawaru_hittest(a:GetX(),a:GetY(),24,24,
						mawaru_lisa_player[pn]:GetX(),mawaru_lisa_player[pn]:GetY()+32,16,16) then
							mawaru_lisa_player[pn]:stoptweening();
							mawaru_lisa_pos[pn][2] = mawaru_lisa_nextfloor(mawaru_lisa_pos[pn][2]+2)
							mawaru_lisa_lockinput[pn] = .85;
							mawaru_lisa_invin[pn] = 1.5;
							mawaru_lisa_player[pn]:accelerate(0.15);
							mawaru_lisa_player[pn]:x((mawaru_lisa_pos[pn][1]*32)-60+12);
							mawaru_lisa_player[pn]:addy(32);
							mawaru_lisa_player[pn]:linear(0.2);
							mawaru_lisa_player[pn]:y((mawaru_lisa_pos[pn][2]*32)-190);
							mawaru_lisa_fall[pn] = true;
							Sound('lisahit');
							_G['mawaru_lisa_controller'..pn]:queuemessage('LisaFallP'..pn);
							_G['mawaru_lisa_controller'..pn]:sleep(0.35);
							_G['mawaru_lisa_controller'..pn]:queuemessage('LisaLandP'..pn);
							_G['mawaru_lisa_controller'..pn]:sleep(0.5);
							_G['mawaru_lisa_controller'..pn]:queuemessage('LisaGetUpP'..pn);
						end
						
						mawaru_lisa_barrelboys[pn][i].mtimer = mawaru_lisa_barrelboys[pn][i].mtimer+0.02
						
						if barl[i][3][ mawaru_lisa_barrelboys[pn][i].curm ] > 0 then
							a:setstate(mawaru_lisa_barrelboys[pn][i].state);
							mawaru_lisa_barrelboys[pn][i].stimer = mawaru_lisa_barrelboys[pn][i].stimer+0.02
							if mawaru_lisa_barrelboys[pn][i].stimer > 0.1 then
								mawaru_lisa_barrelboys[pn][i].state = mawaru_lisa_barrelboys[pn][i].state-1
								if mawaru_lisa_barrelboys[pn][i].state < 1 then
									mawaru_lisa_barrelboys[pn][i].state = 4;
								end
								mawaru_lisa_barrelboys[pn][i].stimer = mawaru_lisa_barrelboys[pn][i].stimer-0.1;
							end
						elseif barl[i][3][ mawaru_lisa_barrelboys[pn][i].curm ] < 0 then
							a:setstate(mawaru_lisa_barrelboys[pn][i].state);
							mawaru_lisa_barrelboys[pn][i].stimer = mawaru_lisa_barrelboys[pn][i].stimer+0.02
							if mawaru_lisa_barrelboys[pn][i].stimer > 0.1 then
								mawaru_lisa_barrelboys[pn][i].state = mawaru_lisa_barrelboys[pn][i].state+1
								if mawaru_lisa_barrelboys[pn][i].state > 4 then
									mawaru_lisa_barrelboys[pn][i].state = 1;
								end
								mawaru_lisa_barrelboys[pn][i].stimer = mawaru_lisa_barrelboys[pn][i].stimer-0.1;
							end
						else
							a:setstate(0);
							mawaru_lisa_barrelboys[pn][i].state = 1;
						end
						
						a:addx(((barl[i][3][ mawaru_lisa_barrelboys[pn][i].curm ])*32/50)/barl[i][3][ mawaru_lisa_barrelboys[pn][i].curm+1 ]);
						
						if mawaru_lisa_barrelboys[pn][i].mtimer > barl[i][3][ mawaru_lisa_barrelboys[pn][i].curm+1 ] then
							mawaru_lisa_barrelboys[pn][i].mtimer = 0;
							mawaru_lisa_barrelboys[pn][i].curm = mawaru_lisa_barrelboys[pn][i].curm+2
							if mawaru_lisa_barrelboys[pn][i].curm > table.getn( barl[i][3] ) then
								mawaru_lisa_barrelboys[pn][i].curm = 1
							end
						end
						
					end
				
					--Trace('x '..tostring(mawaru_lisa_pos[pn][1])..' y '..tostring(mawaru_lisa_pos[pn][2]))
				
					if mawaru_lisa_lockinput[pn]>0 then
						mawaru_lisa_lockinput[pn] = mawaru_lisa_lockinput[pn]-0.02
					end
					
					if mawaru_lisa_bumptimer[pn] > 0 then
						mawaru_lisa_bumptimer[pn] = mawaru_lisa_bumptimer[pn]-0.02;
					else
						mawaru_lisa_bumptimer[pn] = 0;
					end
					
					if mawaru_lisa_invin[pn] > 0 then
						mawaru_lisa_invin[pn] = mawaru_lisa_invin[pn]-0.02;
					else
						mawaru_lisa_invin[pn] = 0;
					end
					
					if mawaru_lisa_moving[pn] > 0 then
						mawaru_lisa_moving[pn] = mawaru_lisa_moving[pn]-0.02;
					else
						mawaru_lisa_moving[pn] = 0;
					end
				
					local bpn = pn-1;
					for i=1,4 do
						
						----------------------handle button presses-------------------
						if mawaru_lisa_lockinput[pn] <= 0 then
							
							if mawaru_keys[i+(bpn*4)] == 1 then
								mawaru_lisa_step(i-1,pn)
							end
							
						end
						
					end
					
					for i=0,3 do
						_G['mawaru_lisa_p'..pn..'pi'..i ]:visible(false)
						_G['mawaru_lisa_p'..pn..'pr'..i ]:visible(false)
						if mawaru_lisa_invin[pn] > 0 then
							_G['mawaru_lisa_p'..pn..'pi'..i ]:diffusealpha(0.5)
							_G['mawaru_lisa_p'..pn..'pr'..i ]:diffusealpha(0.5)
						else
							_G['mawaru_lisa_p'..pn..'pi'..i ]:diffusealpha(1)
							_G['mawaru_lisa_p'..pn..'pr'..i ]:diffusealpha(1)
						end
					end
					
					if not mawaru_lisa_fall[pn] then
						if mawaru_lisa_moving[pn] > 0 then
							_G['mawaru_lisa_p'..pn..'pr'..mawaru_lisa_dir[pn] ]:visible(true)
							_G['mawaru_lisa_p'..pn..'pr'..mawaru_lisa_dir[pn] ]:animate(1);
							_G['mawaru_lisa_p'..pn..'pi'..mawaru_lisa_dir[pn] ]:visible(false)
						else
							_G['mawaru_lisa_p'..pn..'pi'..mawaru_lisa_dir[pn] ]:visible(true)
							_G['mawaru_lisa_p'..pn..'pr'..mawaru_lisa_dir[pn] ]:visible(false)
							_G['mawaru_lisa_p'..pn..'pr'..mawaru_lisa_dir[pn] ]:setstate(0);
							_G['mawaru_lisa_p'..pn..'pr'..mawaru_lisa_dir[pn] ]:animate(0);
						end
					end
				
				end
				
			end
			
			self:sleep(0.02);
			if mawaru_curgame == 15 and mawaru_gamestate == 1 then
				self:queuecommand('Update');
			end
			
		end,
    },
    Def.Quad{
      Name= "actor_efb",
      InitCommand= function(self) mawaru_lisa_controller1 = self end,
      LisaIdleP1MessageCommand= function(self) mawaru_lisa_dir[1] = mawaru_lisa_lastdir[1] end,
    },
    Def.Quad{
      Name= "actor_ffb",
      InitCommand= function(self) mawaru_lisa_controller2 = self end,
      LisaIdleP2MessageCommand= function(self) mawaru_lisa_dir[2] = mawaru_lisa_lastdir[2] end,
    },
    Def.Quad{
      Name= "actor_gfb",
      LisaLandP1MessageCommand= function(self) Sound('lisafall'); end,
      LisaLandP2MessageCommand= function(self) Sound('lisafall'); end,
    },
    --For all P1 parts, Unconverted x & y pos. -Kid
    Def.Quad{
      Name= "actor_hfb",
      OnCommand= cmd(x,320;y,240;zoomto,640,480;diffuse,color('0,.5,1,1')),
    },
    Def.ActorFrame{
      Name= "actor_ifb",
      LisaWinP1MessageCommand= cmd(linear,0.5;addy,128),
      Def.Sprite{
        Name= "actor_jfb",
        OnCommand= cmd(x,160;vertalign,bottom;y,480),
        Texture= "bg.png",
      },
      Def.Sprite{
        Name= "actor_kfb",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_lisa_barrelboys[1],{actor = self, state = 1, stimer = 0, curm = 1, mtimer = 0}) end,
        Texture= "_barrel 3x2.png",
      },
      Def.Sprite{
        Name= "actor_lfb",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_lisa_barrelboys[1],{actor = self, state = 1, stimer = 0, curm = 1, mtimer = 0}) end,
        Texture= "_barrel 3x2.png",
      },
      Def.Sprite{
        Name= "actor_mfb",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_lisa_barrelboys[1],{actor = self, state = 1, stimer = 0, curm = 1, mtimer = 0}) end,
        Texture= "_barrel 3x2.png",
      },
      Def.Sprite{
        Name= "actor_nfb",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_lisa_barrelboys[1],{actor = self, state = 1, stimer = 0, curm = 1, mtimer = 0}) end,
        Texture= "_barrel 3x2.png",
      },
      Def.Sprite{
        Name= "actor_ofb",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_lisa_barrelboys[1],{actor = self, state = 1, stimer = 0, curm = 1, mtimer = 0}) end,
        Texture= "_barrel 3x2.png",
      },
      Def.ActorFrame{
        Name= "actor_pfb",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_lisa_player,self) end,
        Def.Sprite{
          Name= "actor_qfb",
          Frames= {
            {Frame= 1, Delay= 999},
        },--Add in idle_d.sprite's init commands. -Kid
          InitCommand= function (self) mawaru_lisa_p1pi1 = self; self:vertalign('bottom'):y(64) end,
          Texture= "./_climb 2x1.png",
        },
        Def.Sprite{
          Name= "actor_rfb",
          Frames= {
            {Frame= 1, Delay= 999},
        },--Add in idle_l.sprite's init commands. -Kid
          InitCommand= function (self) mawaru_lisa_p1pi0 = self; self:visible(false):vertalign('bottom'):y(64):basezoomx(1) end,
          Texture= "./_run 3x1.png",
        },
        Def.Sprite{
          Name= "actor_sfb",
          Frames= {
            {Frame= 1, Delay= 999},
        },--Add in idle_r.sprite's init commands. -Kid
          InitCommand= function (self) mawaru_lisa_p1pi3 = self; self:visible(false):vertalign('bottom'):y(64):basezoomx(-1) end,
          Texture= "./_run 3x1.png",
        },
        Def.Sprite{
          Name= "actor_tfb",
          Frames= {
            {Frame= 1, Delay= 999},
        },--Add in idle_u.sprite's init commands. -Kid
          InitCommand= function (self) mawaru_lisa_p1pi2 = self; self:visible(false):vertalign('bottom'):y(64) end,
          Texture= "./_climb 2x1.png",
        },
        Def.Sprite{
          Name= "actor_ufb",
          Frames= {
            {Frame= 0, Delay= 0.12},
            {Frame= 1, Delay= 0.12},
        },--Add in run_d.sprite's init commands. -Kid
          InitCommand= function (self) mawaru_lisa_p1pr1 = self; self:visible(false):vertalign('bottom'):y(64) end,
          Texture= "./_climb 2x1.png",
        },
        Def.Sprite{
          Name= "actor_vfb",
          Frames= {
            {Frame= 0, Delay= 0.12},
            {Frame= 1, Delay= 0.12},
            {Frame= 2, Delay= 0.12},
            {Frame= 1, Delay= 0.12},
        },--Add in run_l.sprite's init commands. -Kid
          InitCommand= function (self) mawaru_lisa_p1pr0 = self; self:visible(false):vertalign('bottom'):y(64):basezoomx(1) end,
          Texture= "./_run 3x1.png",
        },
        Def.Sprite{
          Name= "actor_wfb",
          Frames= {
            {Frame= 0, Delay= 0.12},
            {Frame= 1, Delay= 0.12},
            {Frame= 2, Delay= 0.12},
            {Frame= 1, Delay= 0.12},
        },--Add in run_r.sprite's init commands. -Kid
          InitCommand= function (self) mawaru_lisa_p1pr3 = self; self:visible(false):vertalign('bottom'):y(64):basezoomx(-1) end,
          Texture= "./_run 3x1.png",
        },
        Def.Sprite{
          Name= "actor_xfb",
          Frames= {
            {Frame= 0, Delay= 0.12},
            {Frame= 1, Delay= 0.12},
        },--Add in run_u.sprite's init commands. -Kid
          InitCommand= function (self) mawaru_lisa_p1pr2 = self; self:visible(false):vertalign('bottom'):y(64) end,
          Texture= "./_climb 2x1.png",
        },
        Def.Sprite{
          Name= "actor_yfb",
          InitCommand= function (self) self:visible(false) end,
          LisaFallP1MessageCommand= cmd(visible,true;setstate,0),
          LisaGetUpP1MessageCommand= function(self) mawaru_lisa_fall[1] = false; self:visible(false) end,
          LisaLandP1MessageCommand= cmd(setstate,1),
          OnCommand= cmd(vertalign,bottom;y,64;animate,0),
          Texture= "_fall 2x1.png",
        },
      },
    },
    --For all P2 parts, Unconverted x & y pos. -Kid
    Def.ActorFrame{
      Name= "actor_zfb",
      LisaWinP2MessageCommand= cmd(linear,0.5;addy,128),
      OnCommand= cmd(x,320),
      Def.Sprite{
        Name= "actor_Afb",
        OnCommand= cmd(x,160;vertalign,bottom;y,480),
        Texture= "bg.png",
      },
      Def.Sprite{
        Name= "actor_Bfb",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_lisa_barrelboys[2],{actor = self, state = 1, stimer = 0, curm = 1, mtimer = 0}) end,
        Texture= "_barrel 3x2.png",
      },
      Def.Sprite{
        Name= "actor_Cfb",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_lisa_barrelboys[2],{actor = self, state = 1, stimer = 0, curm = 1, mtimer = 0}) end,
        Texture= "_barrel 3x2.png",
      },
      Def.Sprite{
        Name= "actor_Dfb",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_lisa_barrelboys[2],{actor = self, state = 1, stimer = 0, curm = 1, mtimer = 0}) end,
        Texture= "_barrel 3x2.png",
      },
      Def.Sprite{
        Name= "actor_Efb",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_lisa_barrelboys[2],{actor = self, state = 1, stimer = 0, curm = 1, mtimer = 0}) end,
        Texture= "_barrel 3x2.png",
      },
      Def.Sprite{
        Name= "actor_Ffb",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_lisa_barrelboys[2],{actor = self, state = 1, stimer = 0, curm = 1, mtimer = 0}) end,
        Texture= "_barrel 3x2.png",
      },
      Def.ActorFrame{
        Name= "actor_agb",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_lisa_player,self) end,
        Def.Sprite{
          Name= "actor_bgb",
          Frames= {
            {Frame= 1, Delay= 999},
        },--Add in idle_d.sprite's init commands. -Kid
          InitCommand= function (self) mawaru_lisa_p2pi1 = self; self:vertalign('bottom'):y(64) end,
          Texture= "./_climb 2x1.png",
        },
        Def.Sprite{
          Name= "actor_cgb",
          Frames= {
            {Frame= 1, Delay= 999},
        },--Add in idle_l.sprite's init commands. -Kid
          InitCommand= function (self) mawaru_lisa_p2pi0 = self; self:visible(false):vertalign('bottom'):y(64):basezoomx(1) end,
          Texture= "./_run 3x1.png",
        },
        Def.Sprite{
          Name= "actor_dgb",
          Frames= {
            {Frame= 1, Delay= 999},
        },--Add in idle_r.sprite's init commands. -Kid
          InitCommand= function (self) mawaru_lisa_p2pi3 = self; self:visible(false):vertalign('bottom'):y(64):basezoomx(-1) end,
          Texture= "./_run 3x1.png",
        },
        Def.Sprite{
          Name= "actor_egb",
          Frames= {
            {Frame= 1, Delay= 999},
        },--Add in idle_u.sprite's init commands. -Kid
          InitCommand= function (self) mawaru_lisa_p2pi2 = self; self:visible(false):vertalign('bottom'):y(64) end,
          Texture= "./_climb 2x1.png",
        },
        Def.Sprite{
          Name= "actor_fgb",
          Frames= {
            {Frame= 0, Delay= 0.12},
            {Frame= 1, Delay= 0.12},
        },--Add in run_d.sprite's init commands. -Kid
          InitCommand= function (self) mawaru_lisa_p2pr1 = self; self:visible(false):vertalign('bottom'):y(64) end,
          Texture= "./_climb 2x1.png",
        },
        Def.Sprite{
          Name= "actor_ggb",
          Frames= {
            {Frame= 0, Delay= 0.12},
            {Frame= 1, Delay= 0.12},
            {Frame= 2, Delay= 0.12},
            {Frame= 1, Delay= 0.12},
        },--Add in run_l.sprite's init commands. -Kid
          InitCommand= function (self) mawaru_lisa_p2pr0 = self; self:visible(false):vertalign('bottom'):y(64):basezoomx(1) end,
          Texture= "./_run 3x1.png",
        },
        Def.Sprite{
          Name= "actor_hgb",
          Frames= {
            {Frame= 0, Delay= 0.12},
            {Frame= 1, Delay= 0.12},
            {Frame= 2, Delay= 0.12},
            {Frame= 1, Delay= 0.12},
        },--Add in run_r.sprite's init commands. -Kid
          InitCommand= function (self) mawaru_lisa_p2pr3 = self; self:visible(false):vertalign('bottom'):y(64):basezoomx(-1) end,
          Texture= "./_run 3x1.png",
        },
        Def.Sprite{
          Name= "actor_igb",
          Frames= {
            {Frame= 0, Delay= 0.12},
            {Frame= 1, Delay= 0.12},
        },--Add in run_u.sprite's init commands. -Kid
          InitCommand= function (self) mawaru_lisa_p2pr2 = self; self:visible(false):vertalign('bottom'):y(64) end,
          Texture= "./_climb 2x1.png",
        },
        Def.Sprite{
          Name= "actor_jgb",
          InitCommand= function (self) self:visible(false) end,
          LisaFallP2MessageCommand= cmd(visible,true;setstate,0),
          LisaGetUpP2MessageCommand= function(self) mawaru_lisa_fall[2] = false; self:visible(false) end,
          LisaLandP2MessageCommand= cmd(setstate,1),
          OnCommand= cmd(vertalign,bottom;y,64;animate,0),
          Texture= "_fall 2x1.png",
        },
      },
    },
    Def.Quad{
      Name= "actor_kgb",--Unconverted x & y pos. -Kid
      OnCommand= cmd(x,320;y,240;zoomto,6,480;diffuse,color('0,0,0,1')),
    },
    optional_actor(cond_Deb_result,
    Def.BitmapText{
      Name= "actor_lgb",
      Font= "_eurostile outline",
      LisaUpdateScoreP1MessageCommand= function (self) self:settext(mawaru_lisa_score[1]..'m'); end,
      OnCommand= cmd(shadowlength,0;x,20;y,20;horizalign,left),
      Text= "",
    }),
    optional_actor(cond_Eeb_result,
    Def.BitmapText{
      Name= "actor_mgb",
      Font= "_eurostile outline",
      LisaUpdateScoreP2MessageCommand= function (self) self:settext(mawaru_lisa_score[2]..'m'); end,
      OnCommand= cmd(shadowlength,0;x,620;y,20;horizalign,right),
      Text= "",
    }),
    optional_actor(cond_Feb_result,
    Def.Quad{
      Name= "actor_ngb",
      OnCommand= cmd(x,640*0.25;y,240;zoomto,640/2,480;diffuse,color('0,0,0,1')),
    }),
    optional_actor(cond_afb_result,
    Def.Quad{
      Name= "actor_ogb",
      OnCommand= cmd(x,640*0.75;y,240;zoomto,640/2,480;diffuse,color('0,0,0,1')),
    }),
    Def.Sprite{
      Name= "actor_pgb",--Reverse-converted x & y pos. -Kid
      OnCommand= cmd(diffusealpha,0;zoom,3;vibrate;effectmagnitude,1,1,1;x,320;y,240),
      StartCommand= cmd(finishtweening;diffusealpha,0;zoom,3;linear,0.2;zoom,0.6;diffusealpha,.6;sleep,2.5),
      Texture= "inst.png",
    },
  },
}
