let AURACOLOUR = 0;

task AuraGraphic(tobj, graphic, RC, GC, BC){
	let ALPHA= 250;
	let obj = ObjPrim_Create(OBJ_SPRITE_2D);
	ObjPrim_SetTexture(obj, graphic);
	ObjSprite2D_SetSourceRect(obj, 0, 0, 128, 128);
	ObjRender_SetScaleXYZ(obj, 1.1, 1.1, NULL);
	ObjSprite2D_SetDestCenter(obj);
	ObjRender_SetColor(obj, RC, GC, BC);
	ObjRender_SetBlendType(obj, BLEND_ADD_ARGB);
	ObjRender_SetAlpha(obj, ALPHA);
	Obj_SetRenderPriorityI(obj, 27);
	
	ObjRender_SetPosition(obj, ObjMove_GetX(tobj), ObjMove_GetY(tobj), 0);
	
	AuraAnim(obj, 6);
	
	let MOD = 0;
	
	while(!Obj_IsDeleted(tobj)){
		ObjRender_SetAlpha(obj, ALPHA);
		ObjRender_SetScaleXYZ(obj, 1.1+MOD, 1.1+MOD, NULL);
		
		MOD+=2/90;
		
		if(ALPHA<=0){
			Obj_Delete(obj);
			}
			
		ALPHA-=4;
		
		yield;
		}
		
	Obj_Delete(obj);
	}

task Aura(tobj, graphic, RC, GC, BC){
	let frame =0;
	
	while(!Obj_IsDeleted(tobj)){
		frame++;
		
		if(frame==5){
			AuraGraphic(tobj, graphic, RC, GC, BC);
			frame=0;
			}
			
		RC-=sin(AURACOLOUR)*1;
		AURACOLOUR+=1;
			
		yield;
		}
		
	}

let AuraCast = false;
let AuraAnimMod = 0;
let AuraCount = 0;
let AuraGovern = 0;
let AuraMoveLeft = false;
let AuraMoveRight = false;

task AuraAnim(tobj, Yield){
	ObjSprite2D_SetDestCenter(tobj);
		
	if(AuraMoveLeft==true){
		ObjSprite2D_SetSourceRect(tobj, 128*2, 128, 128*3, 128*2);
		}
		
	if(AuraMoveRight==true){
		ObjSprite2D_SetSourceRect(tobj, 128*2, 128*3, 128*3, 128*4);
		}
		
	if(AuraCast==true){
		ObjSprite2D_SetSourceRect(tobj, 128*4, 128*2, 128*5, 128*3);
		}
	//AuraGovern++;
		
	}