
    let boom = CSD ~ "system\leaf.png";

    LoadGraphic(boom);

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

    sub ConcentrationH{
	SetColor(255,128,255); 
	Concentration01(80); 
	SetColor(128,128,255); 
	Concentration01(80); 
	SetColor(255,128,128); 
	Concentration01(80); 
	SetColor(128,255,128); 
	Concentration01(80); 
	PlaySE(CSD~"SFX\se_power0.wav");
	Explosion01(GetX,GetY,5.5,0.2,255);
	SetColor(255,255,255); 
	yield;
    }

    sub ConcentrationJ{
	SetColor(255,64,64); 
	Concentration01(40); 
	SetColor(255,128,128); 
	Concentration01(40); 
	SetColor(255,128,255); 
	Concentration01(40); 
	SetColor(255,255,64); 
	Concentration01(40); 
	PlaySE(CSD~"SFX\se_power0.wav");
	Explosion01(GetX,GetY,5.5,0.2,255);
	SetColor(255,255,255); 
	yield;
    }

    sub ConcentrationX{
	SetColor(255,64,64); 
	Concentration01(120); 
	SetColor(255,128,128); 
	Concentration01(120); 
	SetColor(255,128,255); 
	Concentration01(120); 
	SetColor(255,255,64); 
	Concentration01(120); 
	PlaySE(CSD~"SFX\se_ch00.wav");
	Explosion01(GetX,GetY,5.5,0.2,255);
	SetColor(255,255,255); 
	yield;
    }

    task explosioncustom{
	let x = 0;
	let scaler = 0;
        PlaySE(CSD ~ "SFX\se_enep01.wav");
	while(x<24){
		scaler = rand(1,3);
		mapleexplo(GetEnemyX,GetEnemyY,3,rand(0,359),scaler,scaler,rand_int(1,4));
		mapleexplo(GetEnemyX,GetEnemyY,2.8,rand(0,359),scaler,scaler,rand_int(1,4));
		mapleexplo(GetEnemyX,GetEnemyY,2.6,rand(0,359),scaler,scaler,rand_int(1,4));
		x++;
	}

    }

    // summon explosion
    task mapleexplo(x,y,v,dir,sx,sy,color) {
	let obj = Obj_Create(OBJ_EFFECT);
	let alphret = 0;
	let as = 0;
	let c = 0;
	let scalex = sx;
	let scaley = sy;

	ObjEffect_SetTexture(obj,boom);

	Obj_SetX(obj,x);
	Obj_SetY(obj,y);
	Obj_SetSpeed(obj,v);
	Obj_SetAngle(obj,dir);
	ObjEffect_SetAngle(obj,0,0,rand(0,359));
	ObjEffect_SetRenderState(obj,ADD);
	Obj_SetAlpha(obj,55);
	ObjEffect_SetLayer(obj,2);
        ObjEffect_SetScale(obj, scalex, scaley);

	ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj, 4);

          ObjEffect_SetVertexXY(obj, 0, -17, -17);
          ObjEffect_SetVertexUV(obj, 0, 0, 0);

          // Second vertex (number 1)
          ObjEffect_SetVertexXY(obj, 1, 17, -17);
          ObjEffect_SetVertexUV(obj, 1, 34, 0);
 
          // Third vertex (number 2)
          ObjEffect_SetVertexXY(obj, 2, -17, 17);
          ObjEffect_SetVertexUV(obj, 2, 0, 34);

          // Fourth vertex (number 3)
          ObjEffect_SetVertexXY(obj, 3, 17, 17);
          ObjEffect_SetVertexUV(obj, 3, 34, 34);

	if(color==1){
		ObjEffect_SetVertexColor(obj,0,255,255,64,64);
	 	ObjEffect_SetVertexColor(obj,1,255,255,64,64);
	  	ObjEffect_SetVertexColor(obj,2,255,255,64,64);
	  	ObjEffect_SetVertexColor(obj,3,255,255,64,64);
	}
	if(color==2){
		ObjEffect_SetVertexColor(obj,0,255,64,64,255);
	 	ObjEffect_SetVertexColor(obj,1,255,64,64,255);
	  	ObjEffect_SetVertexColor(obj,2,255,64,64,255);
	  	ObjEffect_SetVertexColor(obj,3,255,64,64,255);
	}
	if(color==3){
		ObjEffect_SetVertexColor(obj,0,255,64,255,64);
	 	ObjEffect_SetVertexColor(obj,1,255,64,255,64);
	  	ObjEffect_SetVertexColor(obj,2,255,64,255,64);
	  	ObjEffect_SetVertexColor(obj,3,255,64,255,64);
	}
	if(color==4){
		ObjEffect_SetVertexColor(obj,0,255,255,64,255);
	 	ObjEffect_SetVertexColor(obj,1,255,255,64,255);
	  	ObjEffect_SetVertexColor(obj,2,255,255,64,255);
	  	ObjEffect_SetVertexColor(obj,3,255,255,64,255);
	}

	while(!Obj_BeDeleted(obj)){
		ObjEffect_SetScale(obj, scalex, scaley);
		if(c<30){scalex+=0.1; scaley+=0.1;}
		if(c>=30){if(scaley>=0){scalex-=0.1; scaley-=0.1;}}
		if(scaley<0){Obj_Delete(obj);}
		c++;
		yield;
	}
 
    }