task BG01{//stage11
	SetFog(200,500,255,255-timer,255-timer);//񂾂[
	SetViewFrom(450-SVF,90-SVFB,70-SVFA);
	SetTexture(Bg02);
	SetAlpha(250);
	SetGraphicRect(1,1-BG,384,512-BG);
	SetGraphicAngle(90,0,0);
	if(OnBomb==true){SetAlpha(150+GetCommonData("Spell_Back"));}
	DrawGraphic3D(0,0,-80);

	SetTexture(Bg01);
	SetAlpha(150);
	SetGraphicRect(1,1-BG*2,384,512-BG*2);
	SetGraphicAngle(90,0,0);
	if(OnBomb==true){SetAlpha(50+GetCommonData("Spell_Back"));}
	DrawGraphic3D(0,0,-80);
}

task BG02a{//stage21
	SetViewFrom(450-SVF,90-SVFB,70-SVFA);
	SetFog(200,400,255-timer,200-timer,200-timer);//񂾂
	if(GetCommonData("SpellCade")==true){Stage=22;}
}

task BGBoss1{//{Xstage22
	SetTexture(Bg03);
	SetAlpha(60);
	SetGraphicRect(1,1,512,512);
	SetGraphicAngle(0,0,BGAngle);
	SetGraphicScale(1.2,1.2);
	DrawGraphic(cx,cy);

	if(GetCommonData("SpellCade")==false){
		SetGraphicScale(1.0,1.0);
		Stage=21;
	}
}


task BG03(Fog_R,Fog_G,Fog_B){//stage31
	SetViewFrom(450-SVF,90-SVFB,70-SVFA);
	SetFog(20,600,Fog_R,Fog_G,Fog_B);

	SetTexture(Bg02);//
	SetAlpha(250);
	SetGraphicRect(1,1-BG,60,512-BG);
	SetGraphicAngle(85,0,0);
	if(OnBomb==true){SetAlpha(150+GetCommonData("Spell_Back"));}
	DrawGraphic3D(0,-140,-70);

	SetTexture(Bg21);//
	SetGraphicRect(1,1-BG,40,512-BG);
	SetGraphicAngle(85,0,0);
	if(OnBomb==true){SetAlpha(150+GetCommonData("Spell_Back"));}
	DrawGraphic3D(-25,-130,-70);
	SetTexture(Bg21);
	SetGraphicRect(1,1-BG,40,512-BG);
	SetGraphicAngle(85,0,0);
	if(OnBomb==true){SetAlpha(150+GetCommonData("Spell_Back"));}
	DrawGraphic3D( 25,-130,-70);

	SetTexture(Bg21);//
	SetGraphicRect(1,1-BG,200,512-BG);
	SetGraphicAngle(0,90,90);
	if(OnBomb==true){SetAlpha(150+GetCommonData("Spell_Back"));}
	DrawGraphic3D(-25,-40,-70);
	SetTexture(Bg21);
	SetGraphicRect(1,1-BG,200,512-BG);
	SetGraphicAngle(0,90,90);
	if(OnBomb==true){SetAlpha(150+GetCommonData("Spell_Back"));}
	DrawGraphic3D( 25,-40,-70);


	SetTexture(Bg21);
	SetGraphicRect(1,1-BG,180,512-BG);
	SetGraphicAngle(85,0,0);
	if(OnBomb==true){SetAlpha(150+GetCommonData("Spell_Back"));}
	DrawGraphic3D(-118,0,-100);
	SetTexture(Bg21);
	SetGraphicRect(180,1-BG,360,512-BG);
	SetGraphicAngle(85,0,0);
	if(OnBomb==true){SetAlpha(150+GetCommonData("Spell_Back"));}
	DrawGraphic3D(118,0,-70);


	SetTexture(Bg22);//X
	SetAlpha(120);
	SetGraphicRect(1,1-BG,256,1024-BG);
	SetGraphicAngle(85,0,0);
	//if(OnBomb==true){SetAlpha(20+GetCommonData("Spell_Back"));}
	DrawGraphic3D(-160,0,0);
	SetTexture(Bg22);
	SetAlpha(120);
	SetGraphicRect(257,1-BG,512,1024-BG);
	SetGraphicAngle(85,0,0);
	//if(OnBomb==true){SetAlpha(20+GetCommonData("Spell_Back"));}
	DrawGraphic3D(160,0,0);

	if(GetCommonData("SpellCade")==true){Stage=32;}
}



task BGBoss2{//{Xstage32
	SetTexture(Bg04);
	SetAlpha(60);
	SetGraphicRect(1-BG,1,512-BG,512);
	SetGraphicAngle(0,0,0);
	DrawGraphic(cx,cy);

	if(GetCommonData("SpellCade")==false){Stage=31;}
}


