//Code made by Darkness1	

    //||---------------------------------------------------------------------------------------------------------||
    //||--||Task for drawing the sunflower field background.||---------------------------------------------------||
     let CSD = GetCurrentScriptDirectory;
let cx = GetStgFrameWidth/2;
let cy = GetStgFrameHeight/2;

task SunflowerField(size){
}

    task SunflowerFieldS(Size){
 
    let SFobj = ObjPrim_Create(OBJ_SPRITE_3D);
    let SFimg = GetCurrentScriptDirectory ~ "gbg1.png";
     let move = 0;
    LoadTexture(SFimg);
    ObjPrim_SetTexture(SFobj,SFimg);
    ObjSprite3D_SetSourceRect(SFobj,0,0,256*Size,256*Size);
    ObjSprite3D_SetDestRect(SFobj,-128*Size,-128*Size,128*Size,128*Size);
  
    ObjRender_SetAngleXYZ(SFobj,-100,75,0);
     
    SetCameraRadius(700);
     
    //SetFogEnable(false);
    //SetFogParam(1100,1500,255,255,255);
     
    Obj_SetRenderPriorityI(SFobj,20);
     
    while(!Obj_IsDeleted(SFobj)){
  ObjSprite3D_SetSourceDestRect(SFobj,0*Size,0*Size,256*Size,256*Size+move);
move += 15.231;
    yield;
    }
	
	}
     
     
    //||---------------------------------------------------------------------------------------------------------||
    //||--||Spellcard background - Overlay.||--------------------------------------------------------------------||
     
    task SpellBGoverlay(){
    let sblayobj = ObjPrim_Create(OBJ_SPRITE_2D);
    let sblayimg = CSD ~ "bgoverlay.png";
     
    let sbalpha = 0;
     
    LoadTexture(sblayimg);
    ObjPrim_SetTexture(sblayobj,sblayimg);
    ObjSprite2D_SetSourceRect(sblayobj,0,0,256,256);
    ObjSprite2D_SetDestCenter(sblayobj);
    ObjSprite2D_SetDestRect(sblayobj,-128,-128,128,128);
    Obj_SetRenderPriorityI(sblayobj,25);
    ObjRender_SetPosition(sblayobj,cx,cy,0);
    ObjRender_SetScaleXYZ(sblayobj,3,3,3);
     
     
    while(!Obj_IsDeleted(Enemy)){
     
    ObjRender_SetAlpha(sblayobj,sbalpha);
     
    if(sbalpha<255){sbalpha+=2;}
    if(sbalpha>255){sbalpha=255;}
     
    yield;
    }
	Obj_Delete(sblayobj);
	}
     
    //||---------------------------------------------------------------------------------------------------------||
    //||--||Spellcard background - Back.||-----------------------------------------------------------------------||
     
    task st1SpellBG2(){
      let sbobj2 = ObjPrim_Create(OBJ_SPRITE_2D);
    let sbimg = st6Kbspell1;
     
    let sbalpha = 0;
    let sbscroll = 0;
     
    LoadTexture(sbimg);
    ObjPrim_SetTexture(sbobj2,sbimg);
	ObjSprite2D_SetSourceRect(sbobj2,0,0,384,448);
    ObjSprite2D_SetDestCenter(sbobj2);
    //ObjSprite2D_SetDestRect(sbobj2,-256,-256-100,256,256+100);
    Obj_SetRenderPriorityI(sbobj2,25);
    ObjRender_SetPosition(sbobj2,cx,cy,0);
    ObjRender_SetScaleXYZ(sbobj2,1,1,1);
     
     
     
    while(!Obj_IsDeleted(Enemy)){
     
    ObjRender_SetAlpha(sbobj2,sbalpha);
     
    //ObjSprite2D_SetSourceRect(sbobj2,0,0-100+sbscroll,512,512+100+sbscroll);
     
    sbscroll+=0;
     
    if(sbalpha<100){sbalpha+=2;}
    if(sbalpha>100){sbalpha=100;}
     
    yield;
    }
	Obj_Delete(sbobj2);}
	
	task st1SpellBG3(){
      let sbobj2 = ObjPrim_Create(OBJ_SPRITE_2D);
    let sbimg = MichaelCutin;
     
    let sbalpha = 0;
    let sbscroll = 0;
     
    LoadTexture(sbimg);
    ObjPrim_SetTexture(sbobj2,sbimg);
	ObjSprite2D_SetSourceRect(sbobj2,0,0,GetTextureWidth(sbimg),GetTextureHeight(sbimg));
    ObjSprite2D_SetDestCenter(sbobj2);
    //ObjSprite2D_SetDestRect(sbobj2,-256,-256-100,256,256+100);
    Obj_SetRenderPriorityI(sbobj2,26);
    ObjRender_SetPosition(sbobj2,cx,cy,0);
    ObjRender_SetScaleXYZ(sbobj2,0.4,0.4,0.4);
     
     
    while(!Obj_IsDeleted(Enemy)){
     
    ObjRender_SetAlpha(sbobj2,sbalpha);
     ObjRender_SetColorHSV(sbobj2,(359/2),255/2,0);
    //ObjSprite2D_SetSourceRect(sbobj2,0,0-100+sbscroll,512,512+100+sbscroll);
     
    sbscroll+=0;
     
    if(sbalpha<100){sbalpha+=2;}
    if(sbalpha>100){sbalpha=100;}
     
    yield;
    }
	Obj_Delete(sbobj2);}
     
    //||---------------------------------------------------------------------------------------------------------||
    //||--||Spellcard background - Front.||----------------------------------------------------------------------||
     
    task st1SpellBG1(){
    let sbobj2 = ObjPrim_Create(OBJ_SPRITE_2D);
    let sbimg = st1spell2;
     
    let sbalpha = 0;
    let sbscroll = 0;
	let huehuehue = 0;
     
    LoadTexture(sbimg);
    ObjPrim_SetTexture(sbobj2,sbimg);
	 ObjSprite2D_SetSourceRect(sbobj2,0,0,500,500);
    ObjSprite2D_SetDestCenter(sbobj2);
    //ObjSprite2D_SetDestRect(sbobj2,-256,-256-100,256,256+100);
    Obj_SetRenderPriorityI(sbobj2,25);
    ObjRender_SetPosition(sbobj2,cx,cy,0);
    ObjRender_SetScaleXYZ(sbobj2,1,1,1);
     
     
    while(!Obj_IsDeleted(Enemy)){
     
    ObjRender_SetAlpha(sbobj2,sbalpha);
     ObjRender_SetColorHSV(sbobj2,(359/2)+sin(huehuehue)*160,255/2,255/2);
   ObjSprite2D_SetSourceRect(sbobj2,0+sbscroll,0-sbscroll,500+sbscroll,500-sbscroll);
     
    sbscroll+=2;
	//huehuehue+= 0.1;
     
    if(sbalpha<200){sbalpha+=2;}
    if(sbalpha>200){sbalpha=200;}
     
    yield;
    }
	Obj_Delete(sbobj2);
	}

// Stage 2 Boss
    task st2SpellBG2(){
      let sbobj2 = ObjPrim_Create(OBJ_SPRITE_2D);
    let sbimg = st2spell1;
     
    let sbalpha = 0;
    let sbscroll = 0;
     
    LoadTexture(sbimg);
    ObjPrim_SetTexture(sbobj2,sbimg);
	ObjSprite2D_SetSourceRect(sbobj2,0,0,384,448);
    ObjSprite2D_SetDestCenter(sbobj2);
    //ObjSprite2D_SetDestRect(sbobj2,-256,-256-100,256,256+100);
    Obj_SetRenderPriorityI(sbobj2,25);
    ObjRender_SetPosition(sbobj2,cx,cy,0);
    ObjRender_SetScaleXYZ(sbobj2,1,1,1);
     
     
    while(!Obj_IsDeleted(Enemy)){
     
    ObjRender_SetAlpha(sbobj2,sbalpha);
     
    //ObjSprite2D_SetSourceRect(sbobj2,0,0-100+sbscroll,512,512+100+sbscroll);
     ObjRender_SetColorHSV(sbobj2,(359/2),255/2,260);
    sbscroll+=0;
     
    if(sbalpha<255){sbalpha+=2;}
    if(sbalpha>255){sbalpha=255;}
     
    yield;
    }
	Obj_Delete(sbobj2);}
	
	task st2SpellBG3(){
      let sbobj2 = ObjPrim_Create(OBJ_SPRITE_2D);
    let sbimg = MarcoCutin;
     
    let sbalpha = 0;
    let sbscroll = 0;
     
    LoadTexture(sbimg);
    ObjPrim_SetTexture(sbobj2,sbimg);
	ObjSprite2D_SetSourceRect(sbobj2,0,0,GetTextureWidth(sbimg),GetTextureHeight(sbimg));
    ObjSprite2D_SetDestCenter(sbobj2);
    //ObjSprite2D_SetDestRect(sbobj2,-256,-256-100,256,256+100);
    Obj_SetRenderPriorityI(sbobj2,26);
    ObjRender_SetPosition(sbobj2,cx,cy,0);
    ObjRender_SetScaleXYZ(sbobj2,0.4,0.4,0.4);
     
     
    while(!Obj_IsDeleted(Enemy)){
     
    ObjRender_SetAlpha(sbobj2,sbalpha);
     ObjRender_SetColorHSV(sbobj2,(359/2),255/2,0);
    //ObjSprite2D_SetSourceRect(sbobj2,0,0-100+sbscroll,512,512+100+sbscroll);
     
    sbscroll+=0;
     
    if(sbalpha<100){sbalpha+=2;}
    if(sbalpha>100){sbalpha=100;}
     
    yield;
    }
	Obj_Delete(sbobj2);}
     
    //||---------------------------------------------------------------------------------------------------------||
    //||--||Spellcard background - Front.||----------------------------------------------------------------------||
     
    task st2SpellBG1(){
    let sbobj2 = ObjPrim_Create(OBJ_SPRITE_2D);
    let sbimg = st2spell2;
     
    let sbalpha = 0;
    let sbscroll = 0;
	let huehuehue = 0;
     
    LoadTexture(sbimg);
    ObjPrim_SetTexture(sbobj2,sbimg);
	 ObjSprite2D_SetSourceRect(sbobj2,0,0,500,500);
    ObjSprite2D_SetDestCenter(sbobj2);
    //ObjSprite2D_SetDestRect(sbobj2,-256,-256-100,256,256+100);
    Obj_SetRenderPriorityI(sbobj2,25);
    ObjRender_SetPosition(sbobj2,cx,cy,0);
    ObjRender_SetScaleXYZ(sbobj2,1,1,1);
	ObjRender_SetAngleZ(sbobj2,90);
     
     
    while(!Obj_IsDeleted(Enemy)){
     
    ObjRender_SetAlpha(sbobj2,sbalpha);
     //ObjRender_SetColorHSV(sbobj2,(359/2)+sin(huehuehue)*160,255/2,255/2);
   ObjSprite2D_SetSourceRect(sbobj2,0,0+sbscroll,500,500+sbscroll);
     
    sbscroll+=2;
	//huehuehue+= 0.1;
     
    if(sbalpha<100){sbalpha+=2;}
    if(sbalpha>100){sbalpha=100;}
     
    yield;
    }
	Obj_Delete(sbobj2);
	}

// Stage 3 Boss	

    task st3SpellBG2(){
      let sbobj2 = ObjPrim_Create(OBJ_SPRITE_2D);
    let sbimg = st3spell1;
     
    let sbalpha = 0;
    let sbscroll = 0;
     
    LoadTexture(sbimg);
    ObjPrim_SetTexture(sbobj2,sbimg);
	ObjSprite2D_SetSourceRect(sbobj2,0,0,384,448);
    ObjSprite2D_SetDestCenter(sbobj2);
    //ObjSprite2D_SetDestRect(sbobj2,-256,-256-100,256,256+100);
    Obj_SetRenderPriorityI(sbobj2,25);
    ObjRender_SetPosition(sbobj2,cx,cy,0);
    ObjRender_SetScaleXYZ(sbobj2,1,1,1);
     
     
    while(!Obj_IsDeleted(Enemy)){
     
    ObjRender_SetAlpha(sbobj2,sbalpha);
     
    //ObjSprite2D_SetSourceRect(sbobj2,0,0-100+sbscroll,512,512+100+sbscroll);
     
    sbscroll+=0;
     
    if(sbalpha<255){sbalpha+=2;}
    if(sbalpha>255){sbalpha=255;}
     
    yield;
    }
	Obj_Delete(sbobj2);}
	
	task st3SpellBG3(){
      let sbobj2 = ObjPrim_Create(OBJ_SPRITE_2D);
    let sbimg = DMatteoCutin;
     
    let sbalpha = 0;
    let sbscroll = 0;
     
    LoadTexture(sbimg);
    ObjPrim_SetTexture(sbobj2,sbimg);
	ObjSprite2D_SetSourceRect(sbobj2,0,0,GetTextureWidth(sbimg),GetTextureHeight(sbimg));
    ObjSprite2D_SetDestCenter(sbobj2);
    //ObjSprite2D_SetDestRect(sbobj2,-256,-256-100,256,256+100);
    Obj_SetRenderPriorityI(sbobj2,26);
    ObjRender_SetPosition(sbobj2,cx,cy,0);
    ObjRender_SetScaleXYZ(sbobj2,0.4,0.4,0.4);
     
     
    while(!Obj_IsDeleted(Enemy)){
     
    ObjRender_SetAlpha(sbobj2,sbalpha);
     ObjRender_SetColorHSV(sbobj2,(359/2),255/2,0);
    //ObjSprite2D_SetSourceRect(sbobj2,0,0-100+sbscroll,512,512+100+sbscroll);
     
    sbscroll+=0;
     
    if(sbalpha<100){sbalpha+=2;}
    if(sbalpha>100){sbalpha=100;}
     
    yield;
    }
	Obj_Delete(sbobj2);}
     
    //||---------------------------------------------------------------------------------------------------------||
    //||--||Spellcard background - Front.||----------------------------------------------------------------------||
     
    task st3SpellBG1(){
    let sbobj2 = ObjPrim_Create(OBJ_SPRITE_2D);
    let sbimg = st3spell2;
     
    let sbalpha = 0;
    let sbscroll = 0;
	let huehuehue = 0;
     
    LoadTexture(sbimg);
    ObjPrim_SetTexture(sbobj2,sbimg);
	 ObjSprite2D_SetSourceRect(sbobj2,0,0,500,500);
    ObjSprite2D_SetDestCenter(sbobj2);
    //ObjSprite2D_SetDestRect(sbobj2,-256,-256-100,256,256+100);
    Obj_SetRenderPriorityI(sbobj2,25);
    ObjRender_SetPosition(sbobj2,cx,cy,0);
    ObjRender_SetScaleXYZ(sbobj2,1,1,1);
     
     
    while(!Obj_IsDeleted(Enemy)){
     
    ObjRender_SetAlpha(sbobj2,sbalpha);
     ObjRender_SetColorHSV(sbobj2,(359/2)+sin(huehuehue)*160,255/2,255/2);
   ObjSprite2D_SetSourceRect(sbobj2,0,0+sbscroll,500,500+sbscroll);
     
    sbscroll+=1;
	//huehuehue+= 0.1;
     
    if(sbalpha<100){sbalpha+=2;}
    if(sbalpha>100){sbalpha=100;}
     
    yield;
    }
	Obj_Delete(sbobj2);
	}

	

//Stage 4 Boss

	
	task st4SpellBG2(){
      let sbobj2 = ObjPrim_Create(OBJ_SPRITE_2D);
    let sbimg = st4spell1;
     
    let sbalpha = 0;
    let sbscroll = 0;
     
    LoadTexture(sbimg);
    ObjPrim_SetTexture(sbobj2,sbimg);
	ObjSprite2D_SetSourceRect(sbobj2,0,0,384,448);
    ObjSprite2D_SetDestCenter(sbobj2);
    //ObjSprite2D_SetDestRect(sbobj2,-256,-256-100,256,256+100);
    Obj_SetRenderPriorityI(sbobj2,25);
    ObjRender_SetPosition(sbobj2,cx,cy,0);
    ObjRender_SetScaleXYZ(sbobj2,1,1,1);
     
     
    while(!Obj_IsDeleted(Enemy)){
     
    ObjRender_SetAlpha(sbobj2,sbalpha);
     
    //ObjSprite2D_SetSourceRect(sbobj2,0,0-100+sbscroll,512,512+100+sbscroll);
     
    sbscroll+=0;
     
    if(sbalpha<255){sbalpha+=2;}
    if(sbalpha>255){sbalpha=255;}
     
    yield;
    }
	Obj_Delete(sbobj2);}
	
	task st4SpellBG3(){
      let sbobj2 = ObjPrim_Create(OBJ_SPRITE_2D);
    let sbimg = SetsCutin;
     
    let sbalpha = 0;
    let sbscroll = 0;
     
    LoadTexture(sbimg);
    ObjPrim_SetTexture(sbobj2,sbimg);
	ObjSprite2D_SetSourceRect(sbobj2,0,0,GetTextureWidth(sbimg),GetTextureHeight(sbimg));
    ObjSprite2D_SetDestCenter(sbobj2);
    //ObjSprite2D_SetDestRect(sbobj2,-256,-256-100,256,256+100);
    Obj_SetRenderPriorityI(sbobj2,26);
    ObjRender_SetPosition(sbobj2,cx,cy,0);
    ObjRender_SetScaleXYZ(sbobj2,0.4,0.4,0.4);
     
     
    while(!Obj_IsDeleted(Enemy)){
     
    ObjRender_SetAlpha(sbobj2,sbalpha);
     ObjRender_SetColorHSV(sbobj2,(359/2),255/2,0);
    //ObjSprite2D_SetSourceRect(sbobj2,0,0-100+sbscroll,512,512+100+sbscroll);
     
    sbscroll+=0;
     
    if(sbalpha<100){sbalpha+=2;}
    if(sbalpha>100){sbalpha=100;}
     
    yield;
    }
	Obj_Delete(sbobj2);}
     
    //||---------------------------------------------------------------------------------------------------------||
    //||--||Spellcard background - Front.||----------------------------------------------------------------------||
     
    task st4SpellBG1(){
    let sbobj2 = ObjPrim_Create(OBJ_SPRITE_2D);
    let sbimg = st4spell2;
     
    let sbalpha = 0;
    let sbscroll = 0;
	let huehuehue = 0;
     
    LoadTexture(sbimg);
    ObjPrim_SetTexture(sbobj2,sbimg);
	 ObjSprite2D_SetSourceRect(sbobj2,0,0,510,512);
    ObjSprite2D_SetDestCenter(sbobj2);
    //ObjSprite2D_SetDestRect(sbobj2,-256,-256-100,256,256+100);
    Obj_SetRenderPriorityI(sbobj2,25);
    ObjRender_SetPosition(sbobj2,cx,cy,0);
    ObjRender_SetScaleXYZ(sbobj2,1.1,1.1,1.1);
     
     
    while(!Obj_IsDeleted(Enemy)){
     
    ObjRender_SetAlpha(sbobj2,sbalpha);
     ObjRender_SetColorHSV(sbobj2,(359/2)+sin(huehuehue)*160,255/2,255/2);
   ObjSprite2D_SetSourceRect(sbobj2,0,0+sbscroll,(510*5),(512*5)+sbscroll);
   ObjRender_SetAngleZ(sbobj2,45);
     
    sbscroll+=3;
	//huehuehue+= 0.1;
     
    if(sbalpha<100){sbalpha+=2;}
    if(sbalpha>100){sbalpha=100;}
     
    yield;
    }
	Obj_Delete(sbobj2);
	}


	
	//Stage 5 Boss A (Lapros el negro maricon);

	
	task st5SpellBG2A(){
      let sbobj2 = ObjPrim_Create(OBJ_SPRITE_2D);
    let sbimg = st5aspell1;
     
    let sbalpha = 0;
    let sbscroll = 0;
     
    LoadTexture(sbimg);
    ObjPrim_SetTexture(sbobj2,sbimg);
	ObjSprite2D_SetSourceRect(sbobj2,0,0,384,448);
    ObjSprite2D_SetDestCenter(sbobj2);
    //ObjSprite2D_SetDestRect(sbobj2,-256,-256-100,256,256+100);
    Obj_SetRenderPriorityI(sbobj2,25);
    ObjRender_SetPosition(sbobj2,cx,cy,0);
    ObjRender_SetScaleXYZ(sbobj2,1,1,1);
     
     
    while(!Obj_IsDeleted(Enemy)){
     
    ObjRender_SetAlpha(sbobj2,sbalpha);
     
    //ObjSprite2D_SetSourceRect(sbobj2,0,0-100+sbscroll,512,512+100+sbscroll);
     
    sbscroll+=0;
     
    if(sbalpha<255){sbalpha+=2;}
    if(sbalpha>255){sbalpha=255;}
     
    yield;
    }
	Obj_Delete(sbobj2);}
	
	task st5SpellBG3A(){
      let sbobj2 = ObjPrim_Create(OBJ_SPRITE_2D);
    let sbimg = LaprosCutin;
     
    let sbalpha = 0;
    let sbscroll = 0;
     
    LoadTexture(sbimg);
    ObjPrim_SetTexture(sbobj2,sbimg);
	ObjSprite2D_SetSourceRect(sbobj2,0,0,GetTextureWidth(sbimg),GetTextureHeight(sbimg));
    ObjSprite2D_SetDestCenter(sbobj2);
    //ObjSprite2D_SetDestRect(sbobj2,-256,-256-100,256,256+100);
    Obj_SetRenderPriorityI(sbobj2,26);
    ObjRender_SetPosition(sbobj2,cx,cy,0);
    ObjRender_SetScaleXYZ(sbobj2,0.4,0.4,0.4);
     
     
    while(!Obj_IsDeleted(Enemy)){
     
    ObjRender_SetAlpha(sbobj2,sbalpha);
     ObjRender_SetColorHSV(sbobj2,(359/2),255/2,0);
    //ObjSprite2D_SetSourceRect(sbobj2,0,0-100+sbscroll,512,512+100+sbscroll);
     
    sbscroll+=0;
     
    if(sbalpha<200){sbalpha+=2;}
    if(sbalpha>200){sbalpha=200;}
     
    yield;
    }
	Obj_Delete(sbobj2);}
     
    //||---------------------------------------------------------------------------------------------------------||
    //||--||Spellcard background - Front.||----------------------------------------------------------------------||
     
    task st5SpellBG1A(){
    let sbobj2 = ObjPrim_Create(OBJ_SPRITE_2D);
    let sbimg = st5aspell2;
     
    let sbalpha = 0;
    let sbscroll = 0;
	let huehuehue = 0;
     
    LoadTexture(sbimg);
    ObjPrim_SetTexture(sbobj2,sbimg);
	 ObjSprite2D_SetSourceRect(sbobj2,0,0,510,512);
    ObjSprite2D_SetDestCenter(sbobj2);
    //ObjSprite2D_SetDestRect(sbobj2,-256,-256-100,256,256+100);
    Obj_SetRenderPriorityI(sbobj2,25);
    ObjRender_SetPosition(sbobj2,cx,cy,0);
    ObjRender_SetScaleXYZ(sbobj2,1.3,1.3,1.3);
     
     
    while(!Obj_IsDeleted(Enemy)){
     
    ObjRender_SetAlpha(sbobj2,sbalpha);
     ObjRender_SetColorHSV(sbobj2,(359/2)+sin(huehuehue)*160,255/2,255/2);
   ObjSprite2D_SetSourceRect(sbobj2,0,0,(510*5),(512*5));
   ObjRender_SetAngleZ(sbobj2,sbscroll);
     
    sbscroll+=0.3;
	//huehuehue+= 0.1;
     
    if(sbalpha<100){sbalpha+=2;}
    if(sbalpha>100){sbalpha=100;}
     
    yield;
    }
	Obj_Delete(sbobj2);
	}


    task st5SpellBG2B(){
      let sbobj2 = ObjPrim_Create(OBJ_SPRITE_2D);
    let sbimg = st5bspell1;
     
    let sbalpha = 0;
    let sbscroll = 0;
     
    LoadTexture(sbimg);
    ObjPrim_SetTexture(sbobj2,sbimg);
    ObjSprite2D_SetSourceRect(sbobj2,0,0,384,448);
    ObjSprite2D_SetDestCenter(sbobj2);
    //ObjSprite2D_SetDestRect(sbobj2,-256,-256-100,256,256+100);
    Obj_SetRenderPriorityI(sbobj2,25);
    ObjRender_SetPosition(sbobj2,cx,cy,0);
    ObjRender_SetScaleXYZ(sbobj2,2,2,2);
     
     
    while(!Obj_IsDeleted(Enemy)){
     
    ObjRender_SetAlpha(sbobj2,sbalpha);
     ObjRender_SetAngleZ(sbobj2,sbscroll);
    //ObjSprite2D_SetSourceRect(sbobj2,0,0-100+sbscroll,512,512+100+sbscroll);
     
    sbscroll+=0.5;
     
    if(sbalpha<170){sbalpha+=2;}
    if(sbalpha>170){sbalpha=170;}
     
    yield;
    }
    Obj_Delete(sbobj2);}
    
    task st5SpellBG3B(){
      let sbobj2 = ObjPrim_Create(OBJ_SPRITE_2D);
    let sbimg = GusanoCutin;
     
    let sbalpha = 0;
    let sbscroll = 0;
     
    LoadTexture(sbimg);
    ObjPrim_SetTexture(sbobj2,sbimg);
    ObjSprite2D_SetSourceRect(sbobj2,0,0,GetTextureWidth(sbimg),GetTextureHeight(sbimg));
    ObjSprite2D_SetDestCenter(sbobj2);
    //ObjSprite2D_SetDestRect(sbobj2,-256,-256-100,256,256+100);
    Obj_SetRenderPriorityI(sbobj2,26);
    ObjRender_SetPosition(sbobj2,cx,cy+50,0);
    ObjRender_SetScaleXYZ(sbobj2,0.5,0.5,0.5);
     
     
    while(!Obj_IsDeleted(Enemy)){
     
    ObjRender_SetAlpha(sbobj2,sbalpha);
     ObjRender_SetColorHSV(sbobj2,(359/2),255/2,0);
    //ObjSprite2D_SetSourceRect(sbobj2,0,0-100+sbscroll,512,512+100+sbscroll);
     
    sbscroll+=0;
     
    if(sbalpha<200){sbalpha+=2;}
    if(sbalpha>200){sbalpha=200;}
     
    yield;
    }
    Obj_Delete(sbobj2);}
     
    //||---------------------------------------------------------------------------------------------------------||
    //||--||Spellcard background - Front.||----------------------------------------------------------------------||
     
    task st5SpellBG1B(){
    let sbobj2 = ObjPrim_Create(OBJ_SPRITE_2D);
    let sbimg = st5bspell2;
     
    let sbalpha = 0;
    let sbscroll = 0;
    let huehuehue = 0;
     
    LoadTexture(sbimg);
    ObjPrim_SetTexture(sbobj2,sbimg);
     ObjSprite2D_SetSourceRect(sbobj2,0,0,510,512);
    ObjSprite2D_SetDestCenter(sbobj2);
    //ObjSprite2D_SetDestRect(sbobj2,-256,-256-100,256,256+100);
    Obj_SetRenderPriorityI(sbobj2,25);
    ObjRender_SetPosition(sbobj2,cx,cy,0);
    ObjRender_SetScaleXYZ(sbobj2,1.3,1.3,1.3);
     
     
    while(!Obj_IsDeleted(Enemy)){
     
    ObjRender_SetAlpha(sbobj2,sbalpha);
     ObjRender_SetColorHSV(sbobj2,(359/2)+sin(huehuehue)*160,255/2,255/2);
   ObjSprite2D_SetSourceRect(sbobj2,0,0+sbscroll,(510*5),(512*5)+sbscroll);
   //ObjRender_SetAngleZ(sbobj2,sbscroll);
     
    sbscroll+=4;
    //huehuehue+= 0.1;
     
    if(sbalpha<200){sbalpha+=2;}
    if(sbalpha>200){sbalpha=200;}
     
    yield;
    }
    Obj_Delete(sbobj2);
    }
