///////////////////////////////////////////////////
//Effects library compilation
//	      ///
///////////////////////////////////////////////////


///////////////////////////////
//Function Index/////
//////////////////////////////
	let angleS = 0;
	let angleS2 = 0;
	let scalecount = 0;
	let scale = 1;
	let scale2 = 1;
	let scalecountB = -120;
	let scaleB = 1;
	let ang = 0;
	let scaleb5=0.1;
	let scaleb6=0.5;
	let L=0;
	let lan=0;
	let en=0;
	let framcount=0;
let shieldsize = 0;
let shieldangle = 0;
let shieldalpha = 0;

let bgalpha = 0;
let bgscroll = 0;

	//For Trail use
	let TrailNum=0;
	let TrailAngle=0;
	let TrailScale=0.1;
	let TrailX=[];
	let TrailY=[];
	ascent(i in 0..10){TrailX=TrailX~[0];TrailY=TrailX~[0];}

//////////////////////////////////////////////////////////////////////////////////////////////////////
//////////BOSS Aura (Not as good as Hele's Aura, from Mitori KawashiroScript)///////////
//////////////////////////////////////////////////////////////////////////////////////////////////////
function Aura1{
let effect = GetCurrentScriptDirectory~".\system\Aura.png";
LoadGraphic(effect);
	let scalecounter = 1.5;
	AuraA;
	AuraB;

	task AuraA{
		loop(5){
			AuraA;
			wait(9);
		}

		task AuraA{
			let scale_0 = 4;
			let scale = scale_0;
			let scale_d = -3.5/45;
			let color = [0, 0, 0];
			let color_r_d = 224/45;
			let color_gb = 127;
			let color_gb_ang = 0;
			let color_gb_ang_d = 90/45;

			let obj = Obj_Create(OBJ_EFFECT);

			Obj_SetPosition(obj, GetEnemyX, GetEnemyY);
			Obj_SetAngle(obj, 0);
			Obj_SetAutoDelete(obj, false);

			ObjEffect_SetTexture(obj, effect);
			ObjEffect_SetRenderState(obj, ADD);
			ObjEffect_SetLayer(obj, 1);
			ObjEffect_SetAngle(obj, 0, 0, rand(0, 360));
			ObjEffect_SetScale(obj, scale, scale * scalecounter);
			ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLESTRIP);
			ObjEffect_CreateVertex(obj, 4);

			ObjEffect_SetVertexUV(obj, 0, 52, 0);
			ObjEffect_SetVertexUV(obj, 1, 94, 0);
			ObjEffect_SetVertexUV(obj, 2, 52, 44);
			ObjEffect_SetVertexUV(obj, 3, 94, 44);

			ObjEffect_SetVertexXY(obj, 0, -22, -20);
			ObjEffect_SetVertexXY(obj, 1,  22, -20);
			ObjEffect_SetVertexXY(obj, 2, -22,  20);
			ObjEffect_SetVertexXY(obj, 3,  22,  20);

			ascent(let i in 0..4){
				ObjEffect_SetVertexColor(obj, i, color[0], color[1] , color[2] , 00);
			}

			yield;

			while(!Obj_BeDeleted(obj)){

				loop(44){
					scale += scale_d;
					color_gb_ang += color_gb_ang_d;

					//////////////////////////////////////////////////////////////////
					//You can change colors here. Change the last value if you want a different intensity of color
					//The higher the number, the less of that color. (1 means high intensity, 6 means low intensity). 
					color[2] = color_gb * sin(color_gb_ang)^1;  //Red Intensity
					color[0] = color_gb * sin(color_gb_ang)^1; //Green Intensity
					color[0] = color_gb * sin(color_gb_ang)^1;  //Blue Intensity

					ascent(let i in 0..4){
						ObjEffect_SetVertexColor(obj, i, 255, 255, 0, 0);
					}
					ObjEffect_SetScale(obj, scale, scale * scalecounter);
					Obj_SetPosition(obj, GetEnemyX, GetEnemyY);
					yield;
				}

				scale = scale_0;
				color_gb_ang = 0;
				color = [0, 0, 0];

				ascent(let i in 0..4){
					ObjEffect_SetVertexColor(obj, i, 255, color[0], color[1], color[2]);
				}

				ObjEffect_SetScale(obj, scale, scale * scalecounter);
				ObjEffect_SetAngle(obj, 0, 0, rand(0, 360));
				Obj_SetPosition(obj, GetEnemyX, GetEnemyY);

				yield;
			}
			Obj_Delete(obj);
		}
	}

	task AuraB{
		loop(4){
			AuraB;
			wait(10);
		}

		task AuraB{
			let ang_0 = 90;
			let ang = ang_0;
			let ang_d = 90/40;

		/////////////////////Change Colors for AuraB Here

		//	let color_0 = [R, G, B];
			let color_0 = [255, 50, 200];

		//	let color_d = [R/40, G/40, B/40];
			let color_d = [200/40, 200/40, 200/40];

			let color = color_0;
			let obj = Obj_Create(OBJ_EFFECT);

			Obj_SetPosition(obj, GetEnemyX, GetEnemyY);
			Obj_SetAngle(obj, 0);
			Obj_SetAutoDelete(obj, false);

			ObjEffect_SetTexture(obj, effect);
			ObjEffect_SetRenderState(obj, ADD);
			ObjEffect_SetLayer(obj, 1);
			ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLESTRIP);
			ObjEffect_CreateVertex(obj, 6);

			ObjEffect_SetVertexUV(obj, 0,  0, 0);
			ObjEffect_SetVertexUV(obj, 1, 50,0);
			ObjEffect_SetVertexUV(obj, 2,  0, 23);
			ObjEffect_SetVertexUV(obj, 3, 50, 23);
			ObjEffect_SetVertexUV(obj, 4,  0, 46);
			ObjEffect_SetVertexUV(obj, 5, 50, 46);

			ObjEffect_SetVertexXY(obj, 0, -24, -4.5);
			ObjEffect_SetVertexXY(obj, 1,  24, -4.5);
			ObjEffect_SetVertexXY(obj, 2, -24+rand(-3, 3), 45+rand(-4, 4));
			ObjEffect_SetVertexXY(obj, 3,  24+rand(-3, 3), 45+rand(-4, 4));
			ObjEffect_SetVertexXY(obj, 4, -24+rand(-9, 9), 90+rand(-8, 8));
			ObjEffect_SetVertexXY(obj, 5,  24+rand(-9, 9), 90+rand(-8, 8));

			ObjEffect_SetAngle(obj, ang, 0, 0);
			ObjEffect_SetScale(obj, 1, scalecounter);

			ascent(let i in 0..6){
				ObjEffect_SetVertexColor(obj, i, 255, color[0], color[1], color[2]);
			}

			yield;

			while(!Obj_BeDeleted(obj)){

				loop(40){
					color = color - color_d;
					ang += ang_d;

					ascent(let i in 0..6){
						ObjEffect_SetVertexColor(obj, i, 255, color[0], color[1], color[2]);
					}
					ObjEffect_SetAngle(obj, ang, 0, 0);
					ObjEffect_SetScale(obj, 1, scalecounter);
					Obj_SetPosition(obj, GetEnemyX, GetEnemyY);
					yield;
				}

				color = color_0;
				ang = ang_0;

				ascent(let i in 0..6){
					ObjEffect_SetVertexColor(obj, i, 255, color[0], color[1], color[2]);
				}
				ObjEffect_SetAngle(obj, ang, 0, 0);
				ObjEffect_SetScale(obj, 1, scalecounter);
				Obj_SetPosition(obj, GetEnemyX, GetEnemyY);

				yield;
			}
			Obj_Delete(obj);
		}
	}

	function wait(w){loop(w){yield;}}
}

/////

function Aura2{
let effect = GetCurrentScriptDirectory~".\system\Aura.png";
LoadGraphic(effect);
	let scalecounter = 1.5;
	AuraA;
	AuraB;

	task AuraA{
		loop(5){
			AuraA;
			wait(9);
		}

		task AuraA{
			let scale_0 = 4;
			let scale = scale_0;
			let scale_d = -3.5/45;
			let color = [0, 0, 0];
			let color_r_d = 224/45;
			let color_gb = 127;
			let color_gb_ang = 0;
			let color_gb_ang_d = 90/45;

			let obj = Obj_Create(OBJ_EFFECT);

			Obj_SetPosition(obj, GetEnemyX, GetEnemyY);
			Obj_SetAngle(obj, 0);
			Obj_SetAutoDelete(obj, false);

			ObjEffect_SetTexture(obj, effect);
			ObjEffect_SetRenderState(obj, ADD);
			ObjEffect_SetLayer(obj, 1);
			ObjEffect_SetAngle(obj, 0, 0, rand(0, 360));
			ObjEffect_SetScale(obj, scale, scale * scalecounter);
			ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLESTRIP);
			ObjEffect_CreateVertex(obj, 4);

			ObjEffect_SetVertexUV(obj, 0, 52, 0);
			ObjEffect_SetVertexUV(obj, 1, 94, 0);
			ObjEffect_SetVertexUV(obj, 2, 52, 44);
			ObjEffect_SetVertexUV(obj, 3, 94, 44);

			ObjEffect_SetVertexXY(obj, 0, -22, -20);
			ObjEffect_SetVertexXY(obj, 1,  22, -20);
			ObjEffect_SetVertexXY(obj, 2, -22,  20);
			ObjEffect_SetVertexXY(obj, 3,  22,  20);

			ascent(let i in 0..4){
				ObjEffect_SetVertexColor(obj, i, color[0], color[1] , color[2] , 00);
			}

			yield;

			while(!Obj_BeDeleted(obj)){

				loop(44){
					scale += scale_d;
					color_gb_ang += color_gb_ang_d;

					//////////////////////////////////////////////////////////////////
					//You can change colors here. Change the last value if you want a different intensity of color
					//The higher the number, the less of that color. (1 means high intensity, 6 means low intensity). 
					color[1] = color_gb * sin(color_gb_ang)^6;  //Red Intensity
					color[2] = color_gb * sin(color_gb_ang)^6; //Green Intensity
					color[0] = color_gb * sin(color_gb_ang)^1;  //Blue Intensity

					ascent(let i in 0..4){
						ObjEffect_SetVertexColor(obj, i, 255, color[0], color[1], color[2]);
					}
					ObjEffect_SetScale(obj, scale, scale * scalecounter);
					Obj_SetPosition(obj, GetEnemyX, GetEnemyY);
					yield;
				}

				scale = scale_0;
				color_gb_ang = 0;
				color = [0, 0, 0];

				ascent(let i in 0..4){
					ObjEffect_SetVertexColor(obj, i, 255, color[0], color[1], color[2]);
				}

				ObjEffect_SetScale(obj, scale, scale * scalecounter);
				ObjEffect_SetAngle(obj, 0, 0, rand(0, 360));
				Obj_SetPosition(obj, GetEnemyX, GetEnemyY);

				yield;
			}
			Obj_Delete(obj);
		}
	}

	task AuraB{
		loop(4){
			AuraB;
			wait(10);
		}

		task AuraB{
			let ang_0 = 90;
			let ang = ang_0;
			let ang_d = 90/40;

		/////////////////////Change Colors for AuraB Here

		//	let color_0 = [R, G, B];
			let color_0 = [255, 233, 21];

		//	let color_d = [R/40, G/40, B/40];
			let color_d = [255/40, 233/40, 21/40];

			let color = color_0;
			let obj = Obj_Create(OBJ_EFFECT);

			Obj_SetPosition(obj, GetEnemyX, GetEnemyY);
			Obj_SetAngle(obj, 0);
			Obj_SetAutoDelete(obj, false);

			ObjEffect_SetTexture(obj, effect);
			ObjEffect_SetRenderState(obj, ADD);
			ObjEffect_SetLayer(obj, 1);
			ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLESTRIP);
			ObjEffect_CreateVertex(obj, 6);

			ObjEffect_SetVertexUV(obj, 0,  0, 0);
			ObjEffect_SetVertexUV(obj, 1, 50,0);
			ObjEffect_SetVertexUV(obj, 2,  0, 23);
			ObjEffect_SetVertexUV(obj, 3, 50, 23);
			ObjEffect_SetVertexUV(obj, 4,  0, 46);
			ObjEffect_SetVertexUV(obj, 5, 50, 46);

			ObjEffect_SetVertexXY(obj, 0, -24, -4.5);
			ObjEffect_SetVertexXY(obj, 1,  24, -4.5);
			ObjEffect_SetVertexXY(obj, 2, -24+rand(-3, 3), 45+rand(-4, 4));
			ObjEffect_SetVertexXY(obj, 3,  24+rand(-3, 3), 45+rand(-4, 4));
			ObjEffect_SetVertexXY(obj, 4, -24+rand(-9, 9), 90+rand(-8, 8));
			ObjEffect_SetVertexXY(obj, 5,  24+rand(-9, 9), 90+rand(-8, 8));

			ObjEffect_SetAngle(obj, ang, 0, 0);
			ObjEffect_SetScale(obj, 1, scalecounter);

			ascent(let i in 0..6){
				ObjEffect_SetVertexColor(obj, i, 255, color[0], color[1], color[2]);
			}

			yield;

			while(!Obj_BeDeleted(obj)){

				loop(40){
					color = color - color_d;
					ang += ang_d;

					ascent(let i in 0..6){
						ObjEffect_SetVertexColor(obj, i, 255, color[0], color[1], color[2]);
					}
					ObjEffect_SetAngle(obj, ang, 0, 0);
					ObjEffect_SetScale(obj, 1, scalecounter);
					Obj_SetPosition(obj, GetEnemyX, GetEnemyY);
					yield;
				}

				color = color_0;
				ang = ang_0;

				ascent(let i in 0..6){
					ObjEffect_SetVertexColor(obj, i, 255, color[0], color[1], color[2]);
				}
				ObjEffect_SetAngle(obj, ang, 0, 0);
				ObjEffect_SetScale(obj, 1, scalecounter);
				Obj_SetPosition(obj, GetEnemyX, GetEnemyY);

				yield;
			}
			Obj_Delete(obj);
		}
	}

	function wait(w){loop(w){yield;}}
}

/////
function Aura3{
let effect = GetCurrentScriptDirectory~".\system\Aura.png";
LoadGraphic(effect);
	let scalecounter = 1.5;
	AuraA;
	AuraB;

	task AuraA{
		loop(5){
			AuraA;
			wait(9);
		}

		task AuraA{
			let scale_0 = 4;
			let scale = scale_0;
			let scale_d = -3.5/45;
			let color = [0, 0, 0];
			let color_r_d = 224/45;
			let color_gb = 127;
			let color_gb_ang = 0;
			let color_gb_ang_d = 90/45;

			let obj = Obj_Create(OBJ_EFFECT);

			Obj_SetPosition(obj, GetEnemyX, GetEnemyY);
			Obj_SetAngle(obj, 0);
			Obj_SetAutoDelete(obj, false);

			ObjEffect_SetTexture(obj, effect);
			ObjEffect_SetRenderState(obj, ADD);
			ObjEffect_SetLayer(obj, 1);
			ObjEffect_SetAngle(obj, 0, 0, rand(0, 360));
			ObjEffect_SetScale(obj, scale, scale * scalecounter);
			ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLESTRIP);
			ObjEffect_CreateVertex(obj, 4);

			ObjEffect_SetVertexUV(obj, 0, 52, 0);
			ObjEffect_SetVertexUV(obj, 1, 94, 0);
			ObjEffect_SetVertexUV(obj, 2, 52, 44);
			ObjEffect_SetVertexUV(obj, 3, 94, 44);

			ObjEffect_SetVertexXY(obj, 0, -22, -20);
			ObjEffect_SetVertexXY(obj, 1,  22, -20);
			ObjEffect_SetVertexXY(obj, 2, -22,  20);
			ObjEffect_SetVertexXY(obj, 3,  22,  20);

			ascent(let i in 0..4){
				ObjEffect_SetVertexColor(obj, i, color[0], color[1] , color[2] , 00);
			}

			yield;

			while(!Obj_BeDeleted(obj)){

				loop(44){
					scale += scale_d;
					color_gb_ang += color_gb_ang_d;

					//////////////////////////////////////////////////////////////////
					//You can change colors here. Change the last value if you want a different intensity of color
					//The higher the number, the less of that color. (1 means high intensity, 6 means low intensity). 
					color[1] = color_gb * sin(color_gb_ang)^2;  //Red Intensity
					color[1] = color_gb * sin(color_gb_ang)^6; //Green Intensity
					color[1] = color_gb * sin(color_gb_ang)^1;  //Blue Intensity

					ascent(let i in 0..4){
						ObjEffect_SetVertexColor(obj, i, 255, color[0], color[1], color[2]);
					}
					ObjEffect_SetScale(obj, scale, scale * scalecounter);
					Obj_SetPosition(obj, GetEnemyX, GetEnemyY);
					yield;
				}

				scale = scale_0;
				color_gb_ang = 0;
				color = [0, 0, 0];

				ascent(let i in 0..4){
					ObjEffect_SetVertexColor(obj, i, 255, color[0], color[1], color[2]);
				}

				ObjEffect_SetScale(obj, scale, scale * scalecounter);
				ObjEffect_SetAngle(obj, 0, 0, rand(0, 360));
				Obj_SetPosition(obj, GetEnemyX, GetEnemyY);

				yield;
			}
			Obj_Delete(obj);
		}
	}

	task AuraB{
		loop(4){
			AuraB;
			wait(10);
		}

		task AuraB{
			let ang_0 = 90;
			let ang = ang_0;
			let ang_d = 90/40;

		/////////////////////Change Colors for AuraB Here

		//	let color_0 = [R, G, B];
			let color_0 = [100, 255, 100];

		//	let color_d = [R/40, G/40, B/40];
			let color_d = [200/40, 200/40, 200/40];

			let color = color_0;
			let obj = Obj_Create(OBJ_EFFECT);

			Obj_SetPosition(obj, GetEnemyX, GetEnemyY);
			Obj_SetAngle(obj, 0);
			Obj_SetAutoDelete(obj, false);

			ObjEffect_SetTexture(obj, effect);
			ObjEffect_SetRenderState(obj, ADD);
			ObjEffect_SetLayer(obj, 1);
			ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLESTRIP);
			ObjEffect_CreateVertex(obj, 6);

			ObjEffect_SetVertexUV(obj, 0,  0, 0);
			ObjEffect_SetVertexUV(obj, 1, 50,0);
			ObjEffect_SetVertexUV(obj, 2,  0, 23);
			ObjEffect_SetVertexUV(obj, 3, 50, 23);
			ObjEffect_SetVertexUV(obj, 4,  0, 46);
			ObjEffect_SetVertexUV(obj, 5, 50, 46);

			ObjEffect_SetVertexXY(obj, 0, -24, -4.5);
			ObjEffect_SetVertexXY(obj, 1,  24, -4.5);
			ObjEffect_SetVertexXY(obj, 2, -24+rand(-3, 3), 45+rand(-4, 4));
			ObjEffect_SetVertexXY(obj, 3,  24+rand(-3, 3), 45+rand(-4, 4));
			ObjEffect_SetVertexXY(obj, 4, -24+rand(-9, 9), 90+rand(-8, 8));
			ObjEffect_SetVertexXY(obj, 5,  24+rand(-9, 9), 90+rand(-8, 8));

			ObjEffect_SetAngle(obj, ang, 0, 0);
			ObjEffect_SetScale(obj, 1, scalecounter);

			ascent(let i in 0..6){
				ObjEffect_SetVertexColor(obj, i, 255, color[0], color[1], color[2]);
			}

			yield;

			while(!Obj_BeDeleted(obj)){

				loop(40){
					color = color - color_d;
					ang += ang_d;

					ascent(let i in 0..6){
						ObjEffect_SetVertexColor(obj, i, 255, color[0], color[1], color[2]);
					}
					ObjEffect_SetAngle(obj, ang, 0, 0);
					ObjEffect_SetScale(obj, 1, scalecounter);
					Obj_SetPosition(obj, GetEnemyX, GetEnemyY);
					yield;
				}

				color = color_0;
				ang = ang_0;

				ascent(let i in 0..6){
					ObjEffect_SetVertexColor(obj, i, 255, color[0], color[1], color[2]);
				}
				ObjEffect_SetAngle(obj, ang, 0, 0);
				ObjEffect_SetScale(obj, 1, scalecounter);
				Obj_SetPosition(obj, GetEnemyX, GetEnemyY);

				yield;
			}
			Obj_Delete(obj);
		}
	}

	function wait(w){loop(w){yield;}}
}

/////

function Aura4{
let effect = GetCurrentScriptDirectory~".\system\Aura.png";
LoadGraphic(effect);
	let scalecounter = 1.5;
	AuraA;
	AuraB;

	task AuraA{
		loop(5){
			AuraA;
			wait(9);
		}

		task AuraA{
			let scale_0 = 4;
			let scale = scale_0;
			let scale_d = -3.5/45;
			let color = [0, 0, 0];
			let color_r_d = 224/45;
			let color_gb = 127;
			let color_gb_ang = 0;
			let color_gb_ang_d = 90/45;

			let obj = Obj_Create(OBJ_EFFECT);

			Obj_SetPosition(obj, GetX, GetY);
			Obj_SetAngle(obj, 0);
			Obj_SetAutoDelete(obj, false);

			ObjEffect_SetTexture(obj, effect);
			ObjEffect_SetRenderState(obj, ADD);
			ObjEffect_SetLayer(obj, 1);
			ObjEffect_SetAngle(obj, 0, 0, rand(0, 360));
			ObjEffect_SetScale(obj, scale, scale * scalecounter);
			ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLESTRIP);
			ObjEffect_CreateVertex(obj, 4);

			ObjEffect_SetVertexUV(obj, 0, 52, 0);
			ObjEffect_SetVertexUV(obj, 1, 94, 0);
			ObjEffect_SetVertexUV(obj, 2, 52, 44);
			ObjEffect_SetVertexUV(obj, 3, 94, 44);

			ObjEffect_SetVertexXY(obj, 0, -22, -20);
			ObjEffect_SetVertexXY(obj, 1,  22, -20);
			ObjEffect_SetVertexXY(obj, 2, -22,  20);
			ObjEffect_SetVertexXY(obj, 3,  22,  20);

			ascent(let i in 0..4){
				ObjEffect_SetVertexColor(obj, i, color[0], color[1] , color[2] , 00);
			}

			yield;

			while(!Obj_BeDeleted(obj)){

				loop(44){
					scale += scale_d;
					color_gb_ang += color_gb_ang_d;

					//////////////////////////////////////////////////////////////////
					//You can change colors here. Change the last value if you want a different intensity of color
					//The higher the number, the less of that color. (1 means high intensity, 6 means low intensity). 
					color[2] = color_gb * sin(color_gb_ang)^2;  //Red Intensity
					color[1] = color_gb * sin(color_gb_ang)^6; //Green Intensity
					color[0] = color_gb * sin(color_gb_ang)^1;  //Blue Intensity

					ascent(let i in 0..4){
						ObjEffect_SetVertexColor(obj, i, 255, color[0], color[1], color[2]);
					}
					ObjEffect_SetScale(obj, scale, scale * scalecounter);
					Obj_SetPosition(obj, GetX, GetY);
					yield;
				}

				scale = scale_0;
				color_gb_ang = 0;
				color = [0, 0, 0];

				ascent(let i in 0..4){
					ObjEffect_SetVertexColor(obj, i, 255, color[0], color[1], color[2]);
				}

				ObjEffect_SetScale(obj, scale, scale * scalecounter);
				ObjEffect_SetAngle(obj, 0, 0, rand(0, 360));
				Obj_SetPosition(obj, GetX, GetY);

				yield;
			}
			Obj_Delete(obj);
		}
	}

	task AuraB{
		loop(4){
			AuraB;
			wait(10);
		}

		task AuraB{
			let ang_0 = 90;
			let ang = ang_0;
			let ang_d = 90/40;

		/////////////////////Change Colors for AuraB Here

		//	let color_0 = [R, G, B];
			let color_0 = [200, 60, 100];

		//	let color_d = [R/40, G/40, B/40];
			let color_d = [200/40, 60/40, 200/40];

			let color = color_0;
			let obj = Obj_Create(OBJ_EFFECT);

			Obj_SetPosition(obj, GetX, GetY);
			Obj_SetAngle(obj, 0);
			Obj_SetAutoDelete(obj, false);

			ObjEffect_SetTexture(obj, effect);
			ObjEffect_SetRenderState(obj, ADD);
			ObjEffect_SetLayer(obj, 1);
			ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLESTRIP);
			ObjEffect_CreateVertex(obj, 6);

			ObjEffect_SetVertexUV(obj, 0,  0, 0);
			ObjEffect_SetVertexUV(obj, 1, 50,0);
			ObjEffect_SetVertexUV(obj, 2,  0, 23);
			ObjEffect_SetVertexUV(obj, 3, 50, 23);
			ObjEffect_SetVertexUV(obj, 4,  0, 46);
			ObjEffect_SetVertexUV(obj, 5, 50, 46);

			ObjEffect_SetVertexXY(obj, 0, -24, -4.5);
			ObjEffect_SetVertexXY(obj, 1,  24, -4.5);
			ObjEffect_SetVertexXY(obj, 2, -24+rand(-3, 3), 45+rand(-4, 4));
			ObjEffect_SetVertexXY(obj, 3,  24+rand(-3, 3), 45+rand(-4, 4));
			ObjEffect_SetVertexXY(obj, 4, -24+rand(-9, 9), 90+rand(-8, 8));
			ObjEffect_SetVertexXY(obj, 5,  24+rand(-9, 9), 90+rand(-8, 8));

			ObjEffect_SetAngle(obj, ang, 0, 0);
			ObjEffect_SetScale(obj, 1, scalecounter);

			ascent(let i in 0..6){
				ObjEffect_SetVertexColor(obj, i, 255, color[0], color[1], color[2]);
			}

			yield;

			while(!Obj_BeDeleted(obj)){

				loop(40){
					color = color - color_d;
					ang += ang_d;

					ascent(let i in 0..6){
						ObjEffect_SetVertexColor(obj, i, 255, color[0], color[1], color[2]);
					}
					ObjEffect_SetAngle(obj, ang, 0, 0);
					ObjEffect_SetScale(obj, 1, scalecounter);
					Obj_SetPosition(obj, GetX, GetY);
					yield;
				}

				color = color_0;
				ang = ang_0;

				ascent(let i in 0..6){
					ObjEffect_SetVertexColor(obj, i, 255, color[0], color[1], color[2]);
				}
				ObjEffect_SetAngle(obj, ang, 0, 0);
				ObjEffect_SetScale(obj, 1, scalecounter);
				Obj_SetPosition(obj, GetX, GetY);

				yield;
			}
			Obj_Delete(obj);
		}
	}

	function wait(w){loop(w){yield;}}
}

/////

function Aura5{
let effect = GetCurrentScriptDirectory~".\system\Aura.png";
LoadGraphic(effect);
	let scalecounter = 1.5;
	AuraA;
	AuraB;

	task AuraA{
		loop(5){
			AuraA;
			wait(9);
		}

		task AuraA{
			let scale_0 = 4;
			let scale = scale_0;
			let scale_d = -3.5/45;
			let color = [0, 0, 0];
			let color_r_d = 224/45;
			let color_gb = 127;
			let color_gb_ang = 0;
			let color_gb_ang_d = 90/45;

			let obj = Obj_Create(OBJ_EFFECT);

			Obj_SetPosition(obj, GetEnemyX, GetEnemyY);
			Obj_SetAngle(obj, 0);
			Obj_SetAutoDelete(obj, false);

			ObjEffect_SetTexture(obj, effect);
			ObjEffect_SetRenderState(obj, ADD);
			ObjEffect_SetLayer(obj, 1);
			ObjEffect_SetAngle(obj, 0, 0, rand(0, 360));
			ObjEffect_SetScale(obj, scale, scale * scalecounter);
			ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLESTRIP);
			ObjEffect_CreateVertex(obj, 4);

			ObjEffect_SetVertexUV(obj, 0, 52, 0);
			ObjEffect_SetVertexUV(obj, 1, 94, 0);
			ObjEffect_SetVertexUV(obj, 2, 52, 44);
			ObjEffect_SetVertexUV(obj, 3, 94, 44);

			ObjEffect_SetVertexXY(obj, 0, -22, -20);
			ObjEffect_SetVertexXY(obj, 1,  22, -20);
			ObjEffect_SetVertexXY(obj, 2, -22,  20);
			ObjEffect_SetVertexXY(obj, 3,  22,  20);

			ascent(let i in 0..4){
				ObjEffect_SetVertexColor(obj, i, color[0], color[1] , color[2] , 00);
			}

			yield;

			while(!Obj_BeDeleted(obj)){

				loop(44){
					scale += scale_d;
					color_gb_ang += color_gb_ang_d;

					//////////////////////////////////////////////////////////////////
					//You can change colors here. Change the last value if you want a different intensity of color
					//The higher the number, the less of that color. (1 means high intensity, 6 means low intensity). 
					color[0] = color_gb * sin(color_gb_ang)^1;  //Red Intensity
					color[1] = color_gb * sin(color_gb_ang)^6; //Green Intensity
					color[2] = color_gb * sin(color_gb_ang)^4;  //Blue Intensity

					ascent(let i in 0..4){
						ObjEffect_SetVertexColor(obj, i, 255, color[0], color[1], color[2]);
					}
					ObjEffect_SetScale(obj, scale, scale * scalecounter);
					Obj_SetPosition(obj, GetEnemyX, GetEnemyY);
					yield;
				}

				scale = scale_0;
				color_gb_ang = 0;
				color = [0, 0, 0];

				ascent(let i in 0..4){
					ObjEffect_SetVertexColor(obj, i, 255, color[0], color[1], color[2]);
				}

				ObjEffect_SetScale(obj, scale, scale * scalecounter);
				ObjEffect_SetAngle(obj, 0, 0, rand(0, 360));
				Obj_SetPosition(obj, GetEnemyX, GetEnemyY);

				yield;
			}
			Obj_Delete(obj);
		}
	}

	task AuraB{
		loop(4){
			AuraB;
			wait(10);
		}

		task AuraB{
			let ang_0 = 90;
			let ang = ang_0;
			let ang_d = 90/40;

		/////////////////////Change Colors for AuraB Here

		//	let color_0 = [R, G, B];
			let color_0 = [200, 60, 100];

		//	let color_d = [R/40, G/40, B/40];
			let color_d = [200/40, 60/40, 200/40];

			let color = color_0;
			let obj = Obj_Create(OBJ_EFFECT);

			Obj_SetPosition(obj, GetEnemyX, GetEnemyY);
			Obj_SetAngle(obj, 0);
			Obj_SetAutoDelete(obj, false);

			ObjEffect_SetTexture(obj, effect);
			ObjEffect_SetRenderState(obj, ADD);
			ObjEffect_SetLayer(obj, 1);
			ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLESTRIP);
			ObjEffect_CreateVertex(obj, 6);

			ObjEffect_SetVertexUV(obj, 0,  0, 0);
			ObjEffect_SetVertexUV(obj, 1, 50,0);
			ObjEffect_SetVertexUV(obj, 2,  0, 23);
			ObjEffect_SetVertexUV(obj, 3, 50, 23);
			ObjEffect_SetVertexUV(obj, 4,  0, 46);
			ObjEffect_SetVertexUV(obj, 5, 50, 46);

			ObjEffect_SetVertexXY(obj, 0, -24, -4.5);
			ObjEffect_SetVertexXY(obj, 1,  24, -4.5);
			ObjEffect_SetVertexXY(obj, 2, -24+rand(-3, 3), 45+rand(-4, 4));
			ObjEffect_SetVertexXY(obj, 3,  24+rand(-3, 3), 45+rand(-4, 4));
			ObjEffect_SetVertexXY(obj, 4, -24+rand(-9, 9), 90+rand(-8, 8));
			ObjEffect_SetVertexXY(obj, 5,  24+rand(-9, 9), 90+rand(-8, 8));

			ObjEffect_SetAngle(obj, ang, 0, 0);
			ObjEffect_SetScale(obj, 1, scalecounter);

			ascent(let i in 0..6){
				ObjEffect_SetVertexColor(obj, i, 255, color[0], color[1], color[2]);
			}

			yield;

			while(!Obj_BeDeleted(obj)){

				loop(40){
					color = color - color_d;
					ang += ang_d;

					ascent(let i in 0..6){
						ObjEffect_SetVertexColor(obj, i, 255, color[0], color[1], color[2]);
					}
					ObjEffect_SetAngle(obj, ang, 0, 0);
					ObjEffect_SetScale(obj, 1, scalecounter);
					Obj_SetPosition(obj, GetEnemyX, GetEnemyY);
					yield;
				}

				color = color_0;
				ang = ang_0;

				ascent(let i in 0..6){
					ObjEffect_SetVertexColor(obj, i, 255, color[0], color[1], color[2]);
				}
				ObjEffect_SetAngle(obj, ang, 0, 0);
				ObjEffect_SetScale(obj, 1, scalecounter);
				Obj_SetPosition(obj, GetEnemyX, GetEnemyY);

				yield;
			}
			Obj_Delete(obj);
		}
	}

	function wait(w){loop(w){yield;}}
}

/////

function Aura6{
let effect = GetCurrentScriptDirectory~".\system\Aura.png";
LoadGraphic(effect);
	let scalecounter = 1.5;
	AuraA;
	AuraB;

	task AuraA{
		loop(5){
			AuraA;
			wait(9);
		}

		task AuraA{
			let scale_0 = 4;
			let scale = scale_0;
			let scale_d = -3.5/45;
			let color = [0, 0, 0];
			let color_r_d = 224/45;
			let color_gb = 127;
			let color_gb_ang = 0;
			let color_gb_ang_d = 90/45;

			let obj = Obj_Create(OBJ_EFFECT);

			Obj_SetPosition(obj, GetEnemyX, GetEnemyY);
			Obj_SetAngle(obj, 0);
			Obj_SetAutoDelete(obj, false);

			ObjEffect_SetTexture(obj, effect);
			ObjEffect_SetRenderState(obj, ADD);
			ObjEffect_SetLayer(obj, 1);
			ObjEffect_SetAngle(obj, 0, 0, rand(0, 360));
			ObjEffect_SetScale(obj, scale, scale * scalecounter);
			ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLESTRIP);
			ObjEffect_CreateVertex(obj, 4);

			ObjEffect_SetVertexUV(obj, 0, 52, 0);
			ObjEffect_SetVertexUV(obj, 1, 94, 0);
			ObjEffect_SetVertexUV(obj, 2, 52, 44);
			ObjEffect_SetVertexUV(obj, 3, 94, 44);

			ObjEffect_SetVertexXY(obj, 0, -22, -20);
			ObjEffect_SetVertexXY(obj, 1,  22, -20);
			ObjEffect_SetVertexXY(obj, 2, -22,  20);
			ObjEffect_SetVertexXY(obj, 3,  22,  20);

			ascent(let i in 0..4){
				ObjEffect_SetVertexColor(obj, i, color[0], color[1] , color[2] , 00);
			}

			yield;

			while(!Obj_BeDeleted(obj)){

				loop(44){
					scale += scale_d;
					color_gb_ang += color_gb_ang_d;

					//////////////////////////////////////////////////////////////////
					//You can change colors here. Change the last value if you want a different intensity of color
					//The higher the number, the less of that color. (1 means high intensity, 6 means low intensity). 
					color[2] = color_gb * sin(color_gb_ang)^2;  //Red Intensity
					color[1] = color_gb * sin(color_gb_ang)^6; //Green Intensity
					color[0] = color_gb * sin(color_gb_ang)^1;  //Blue Intensity

					ascent(let i in 0..4){
						ObjEffect_SetVertexColor(obj, i, 255, color[0], color[1], color[2]);
					}
					ObjEffect_SetScale(obj, scale, scale * scalecounter);
					Obj_SetPosition(obj, GetEnemyX, GetEnemyY);
					yield;
				}

				scale = scale_0;
				color_gb_ang = 0;
				color = [0, 0, 0];

				ascent(let i in 0..4){
					ObjEffect_SetVertexColor(obj, i, 255, color[0], color[1], color[2]);
				}

				ObjEffect_SetScale(obj, scale, scale * scalecounter);
				ObjEffect_SetAngle(obj, 0, 0, rand(0, 360));
				Obj_SetPosition(obj, GetEnemyX, GetEnemyY);

				yield;
			}
			Obj_Delete(obj);
		}
	}

	task AuraB{
		loop(4){
			AuraB;
			wait(10);
		}

		task AuraB{
			let ang_0 = 90;
			let ang = ang_0;
			let ang_d = 90/40;

		/////////////////////Change Colors for AuraB Here

		//	let color_0 = [R, G, B];
			let color_0 = [200, 60, 100];

		//	let color_d = [R/40, G/40, B/40];
			let color_d = [200/40, 60/40, 200/40];

			let color = color_0;
			let obj = Obj_Create(OBJ_EFFECT);

			Obj_SetPosition(obj, GetEnemyX, GetEnemyY);
			Obj_SetAngle(obj, 0);
			Obj_SetAutoDelete(obj, false);

			ObjEffect_SetTexture(obj, effect);
			ObjEffect_SetRenderState(obj, ADD);
			ObjEffect_SetLayer(obj, 1);
			ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLESTRIP);
			ObjEffect_CreateVertex(obj, 6);

			ObjEffect_SetVertexUV(obj, 0,  0, 0);
			ObjEffect_SetVertexUV(obj, 1, 50,0);
			ObjEffect_SetVertexUV(obj, 2,  0, 23);
			ObjEffect_SetVertexUV(obj, 3, 50, 23);
			ObjEffect_SetVertexUV(obj, 4,  0, 46);
			ObjEffect_SetVertexUV(obj, 5, 50, 46);

			ObjEffect_SetVertexXY(obj, 0, -24, -4.5);
			ObjEffect_SetVertexXY(obj, 1,  24, -4.5);
			ObjEffect_SetVertexXY(obj, 2, -24+rand(-3, 3), 45+rand(-4, 4));
			ObjEffect_SetVertexXY(obj, 3,  24+rand(-3, 3), 45+rand(-4, 4));
			ObjEffect_SetVertexXY(obj, 4, -24+rand(-9, 9), 90+rand(-8, 8));
			ObjEffect_SetVertexXY(obj, 5,  24+rand(-9, 9), 90+rand(-8, 8));

			ObjEffect_SetAngle(obj, ang, 0, 0);
			ObjEffect_SetScale(obj, 1, scalecounter);

			ascent(let i in 0..6){
				ObjEffect_SetVertexColor(obj, i, 255, color[0], color[1], color[2]);
			}

			yield;

			while(!Obj_BeDeleted(obj)){

				loop(40){
					color = color - color_d;
					ang += ang_d;

					ascent(let i in 0..6){
						ObjEffect_SetVertexColor(obj, i, 255, color[0], color[1], color[2]);
					}
					ObjEffect_SetAngle(obj, ang, 0, 0);
					ObjEffect_SetScale(obj, 1, scalecounter);
					Obj_SetPosition(obj, GetEnemyX, GetEnemyY);
					yield;
				}

				color = color_0;
				ang = ang_0;

				ascent(let i in 0..6){
					ObjEffect_SetVertexColor(obj, i, 255, color[0], color[1], color[2]);
				}
				ObjEffect_SetAngle(obj, ang, 0, 0);
				ObjEffect_SetScale(obj, 1, scalecounter);
				Obj_SetPosition(obj, GetEnemyX, GetEnemyY);

				yield;
			}
			Obj_Delete(obj);
		}
	}

	function wait(w){loop(w){yield;}}
}