#TouhouDanmakufu[Single]
#ScriptVersion[3]
#Title["Koishi's Panel2"]
#Text["NewCutout"]
#include"./Cutin.txt"
let bossObj;
let bossX = 0;
let bossY = 0;
let animFrame = 0;
let animFrame2 = 0;
let objScene = GetEnemyBossSceneObjectID();
let imgBoss = GetCurrentScriptDirectory ~ "Gizmo's Touhou Boss Sprite Library/spriteimg/AyaDSSprite.png";
let overlay = GetCurrentScriptDirectory ~ "texture/spelloverlay.png";
let lake = GetCurrentScriptDirectory ~ "texture/spellbg.png";
let spellcardSFX = GetCurrentScriptDirectory ~ "sfx/SPELLCARD.wav";
let bdeathSFX = GetCurrentScriptDirectory ~ "sfx/DEFEATED.wav";
let snd = GetCurrentScriptDirectory ~ "./sfx/boss4a.mp3";
let objmusic = ObjSound_Create();


#include "./../shot/AllStarShot_Const.txt"
#include "script/default_system/Default_Effect.txt"
@Initialize {
	
	ObjSound_Load(objmusic,snd);
	ObjSound_Play(objmusic);
	// define a boss in bossObj and register it
	bossObj = ObjEnemy_Create(OBJ_ENEMY_BOSS);
	ObjEnemy_Regist(bossObj);
	
	// warp the boss to this location when loaded
	
	
	// move boss to desired x y location at desired speed
	ObjMove_SetDestAtSpeed(bossObj,192,120,5);
	
	LoadSound(spellcardSFX);
	LoadSound(bdeathSFX);
	ObjEnemyBossScene_StartSpell(objScene);
	TFinalize;
	let patchy = GetCurrentScriptDirectory~"aya_cut.png";
	let kyouko = GetCurrentScriptDirectory~"cutin2.png";
	ObjCutin_SetSpellcardS4("Wide Shot''360 Scope Shot''",patchy,MOKOU,240,104,104);
	ObjCutin_LaunchS3(NAZRIN, patchy, "Normal");
	mainTask;	// run mainTask
} 

@Event { 
	// setting the boss timer and life
	alternative(GetEventType()) 
	case(EV_REQUEST_LIFE) { 
		SetScriptResult(3000);
	}
	case(EV_REQUEST_SPELL_SCORE) { 
		SetScriptResult(1000);
	}
	case(EV_REQUEST_TIMER) { 
		SetScriptResult(45);
	}
} 

@MainLoop {
	bossX = ObjMove_GetX(bossObj);
	bossY = ObjMove_GetY(bossObj);
	
	// collision for the shots and player
	ObjEnemy_SetIntersectionCircleToShot(bossObj,bossX,bossY,24);
	ObjEnemy_SetIntersectionCircleToPlayer(bossObj,bossX,bossY,32);
	
	yield;
} 

@Finalize {

} 

task TFinalize {
	while(ObjEnemy_GetInfo(bossObj,INFO_LIFE)>0){yield;}
	if(ObjEnemyBossScene_GetInfo(objScene, INFO_PLAYER_SHOOTDOWN_COUNT)
        +ObjEnemyBossScene_GetInfo(objScene, INFO_PLAYER_SPELL_COUNT) == 0){
    AddScore(ObjEnemyBossScene_GetInfo(objScene, INFO_SPELL_SCORE));
}
    PlaySE(bdeathSFX);
	TExplosionA(bossX,bossY,10,0.5);
	Obj_Delete(bossObj);
	DeleteShotAll(TYPE_ALL,TYPE_ITEM);
	SetAutoDeleteObject(true);
	CloseScript(GetOwnScriptID);
	return;
}

// your best friend, forever.
function wait(w) { loop(w) { yield; } } 

task mainTask { 
    renderBoss;
	renderBg;
	movement;
}
task renderBg {
	
	let scrollTex =0;
	
	let obj = ObjPrim_Create(OBJ_SPRITE_2D);
	Obj_SetRenderPriorityI(obj,21);
	ObjPrim_SetTexture(obj,lake);
	ObjSprite2D_SetSourceRect(obj,0,0,1024/4,768/3);
	ObjSprite2D_SetDestRect(obj,0,0,GetStgFrameWidth,GetStgFrameHeight);
	ObjRender_SetAlpha(obj,90);
	
	let overlayObj = ObjPrim_Create(OBJ_SPRITE_2D);
	Obj_SetRenderPriorityI(overlayObj,21);
	ObjPrim_SetTexture(overlayObj,overlay);
	ObjRender_SetBlendType(overlayObj,BLEND_ADD_ARGB);
	ObjRender_SetAlpha(overlayObj,100);
	ObjSprite2D_SetSourceRect(overlayObj,0,0,512,512);
	ObjSprite2D_SetDestRect(overlayObj,0,0,GetStgFrameWidth,GetStgFrameHeight);
	
	while(!Obj_IsDeleted(bossObj)) {
		ObjSprite2D_SetSourceRect(overlayObj,0-scrollTex,0-scrollTex,512-scrollTex,512-scrollTex);
		scrollTex ++;
		yield;
	}
	Obj_Delete(overlayObj);
}
task renderBoss {
	let dir;
	let speed;
	
	// texture the boss, set centre as true centre.
	ObjPrim_SetTexture(bossObj,imgBoss);
	ObjSprite2D_SetSourceRect(bossObj,0,0,64,64);
	ObjSprite2D_SetDestCenter(bossObj);
	ObjRender_SetScaleXYZ(bossObj,1,1,0);
	
	while(!Obj_IsDeleted(bossObj)) {
		
		// update speed and location locally
		dir = ObjMove_GetAngle(bossObj);
		speed = ObjMove_GetSpeed(bossObj);
		
		// animate
		if(speed == 0) {
			if(animFrame < 15) {ObjSprite2D_SetSourceRect(bossObj,0,0,64,64); }
			if(animFrame >= 15 && animFrame <30) {ObjSprite2D_SetSourceRect(bossObj,64,0,128,64); }
			if(animFrame >= 30 && animFrame <45) {ObjSprite2D_SetSourceRect(bossObj,128,0,192,64); }
			if(animFrame >= 45) {ObjSprite2D_SetSourceRect(bossObj,192,0,256,64); }
			animFrame2 = 0;
			ObjRender_SetAngleXYZ(bossObj,0,0,0); 
		}   // boss holding location
		else if (cos(dir) < 0) { 
		    if(animFrame2 < 15) {ObjSprite2D_SetSourceRect(bossObj,0,64,64,128); }
			if(animFrame2 >= 15 && animFrame2 <30) {ObjSprite2D_SetSourceRect(bossObj,64,64,128,128); }
			if(animFrame2 >= 30 && animFrame2 <45) {ObjSprite2D_SetSourceRect(bossObj,128,64,192,128); }
			if(animFrame2 >= 45) {ObjSprite2D_SetSourceRect(bossObj,192,64,256,128); }
		    ObjRender_SetAngleXYZ(bossObj,0,0,0); 
		}    // boss moving to the left
		else if (cos(dir) > 0) { 
		    if(animFrame2 < 15) {ObjSprite2D_SetSourceRect(bossObj,0,64,64,128); }
			if(animFrame2 >= 15 && animFrame2 <30) {ObjSprite2D_SetSourceRect(bossObj,64,64,128,128); }
			if(animFrame2 >= 30 && animFrame2 <45) {ObjSprite2D_SetSourceRect(bossObj,128,64,192,128); }
			if(animFrame2 >= 45) {ObjSprite2D_SetSourceRect(bossObj,192,64,256,128); }
		    ObjRender_SetAngleXYZ(bossObj,0,180,0); 
		}  // boss moving to the right
		animFrame+=1.5;
		animFrame2+=2;
		if(animFrame >60) {animFrame = 0;}
		
		yield;
	}
}

task movement {
	wait(60);
	
	loop {
		circle;
		arrowhead;
		photo;
		ObjMove_SetDestAtSpeed(bossObj,GetStgFrameWidth/4,GetPlayerY,3);
		wait(240);
		photo;
		ObjMove_SetDestAtSpeed(bossObj,GetStgFrameWidth/4*3,GetPlayerY,3);
		wait(240);
		photo;
		ObjMove_SetDestAtSpeed(bossObj,GetStgFrameWidth/4,GetPlayerY,3);
		wait(240);
		photo;
		ObjMove_SetDestAtSpeed(bossObj,GetStgFrameWidth/4*3,GetPlayerY,3);
		wait(240);
		photo;
		ObjMove_SetDestAtSpeed(bossObj,GetStgFrameWidth/4,GetPlayerY,3);
		wait(240);
	}
}

function angleToPlayer{
	let dir = atan2(GetPlayerY-bossY,GetPlayerX-bossX);
	return dir;
}
let angleT = 0;
task arrowhead {
	loop(400) {
	CreateShotA1(bossX,bossY,2,angleT+angleToPlayer,3,0);
	CreateShotA1(bossX,bossY,rand(2.25,2.75),angleT+angleToPlayer,15,0);
	angleT+=360/6;
	wait(3);
	}
}
let angleI = 0;
task circle {
	loop(5) {
	loop(30) {
	CreateShotA1(bossX+30*cos(angleI),bossY+30*sin(angleI),2,90,14,0);
	CreateShotA1(bossX+30*cos(angleI),bossY+30*sin(angleI),2,270,14,0);
	angleI+=360/30;
	}
	wait(30);
	loop(30) {
	CreateShotA1(bossX+30*cos(angleI),bossY+30*sin(angleI),2,90+40,14,0);
	CreateShotA1(bossX+30*cos(angleI),bossY+30*sin(angleI),2,270+40,14,0);
	angleI+=360/30;
	}
	wait(30);
	loop(30) {
	CreateShotA1(bossX+30*cos(angleI),bossY+30*sin(angleI),2,90+80,14,0);
	CreateShotA1(bossX+30*cos(angleI),bossY+30*sin(angleI),2,270+80,14,0);
	angleI+=360/30;
	}
	wait(30);
	loop(30) {
	CreateShotA1(bossX+30*cos(angleI),bossY+30*sin(angleI),2,90+120,14,0);
	CreateShotA1(bossX+30*cos(angleI),bossY+30*sin(angleI),2,270+120,14,0);
	angleI+=360/30;
	}
	wait(30);
	loop(30) {
	CreateShotA1(bossX+30*cos(angleI),bossY+30*sin(angleI),2,90+160,14,0);
	CreateShotA1(bossX+30*cos(angleI),bossY+30*sin(angleI),2,270+160,14,0);
	angleI+=360/30;
	}
	wait(30);
	loop(30) {
	CreateShotA1(bossX+30*cos(angleI),bossY+30*sin(angleI),2,90+200,14,0);
	CreateShotA1(bossX+30*cos(angleI),bossY+30*sin(angleI),2,270+200,14,0);
	angleI+=360/30;
	}
	wait(30);
	loop(30) {
	CreateShotA1(bossX+30*cos(angleI),bossY+30*sin(angleI),2,90+240,14,0);
	CreateShotA1(bossX+30*cos(angleI),bossY+30*sin(angleI),2,270+240,14,0);
	angleI+=360/30;
	}
	wait(30);
	loop(30) {
	CreateShotA1(bossX+30*cos(angleI),bossY+30*sin(angleI),2,90+280,14,0);
	CreateShotA1(bossX+30*cos(angleI),bossY+30*sin(angleI),2,270+280,14,0);
	angleI+=360/30;
	}
	wait(30);
	loop(30) {
	CreateShotA1(bossX+30*cos(angleI),bossY+30*sin(angleI),2,90+320,14,0);
	CreateShotA1(bossX+30*cos(angleI),bossY+30*sin(angleI),2,270+320,14,0);
	angleI+=360/30;
	}
	wait(30);
	}
}
task photo {
	loop(120) {
	let a1 = CreateStraightLaserA1(bossX+100,bossY+80,90,50,5,0,99,1);
	let a2 = CreateStraightLaserA1(bossX+100,bossY+80,180,50,5,0,99,1);
	let a3 = CreateStraightLaserA1(bossX-100,bossY+80,90,50,5,0,99,1);
	let a4 = CreateStraightLaserA1(bossX-100,bossY+80,0,50,5,0,99,1);
	let a5 = CreateStraightLaserA1(bossX+100,bossY+210,270,50,5,0,99,1);
	let a6 = CreateStraightLaserA1(bossX+100,bossY+210,180,50,5,0,99,1);
	let a7 = CreateStraightLaserA1(bossX-100,bossY+210,270,50,5,0,99,1);
	let a8 = CreateStraightLaserA1(bossX-100,bossY+210,0,50,5,0,99,1);
	
	let b1 = CreateStraightLaserA1(bossX+100,bossY-80,180,50,5,0,99,1);
	let b2 = CreateStraightLaserA1(bossX+100,bossY-80,270,50,5,0,99,1);
	let b3 = CreateStraightLaserA1(bossX-100,bossY-80,270,50,5,0,99,1);
	let b4 = CreateStraightLaserA1(bossX-100,bossY-80,0,50,5,0,99,1);
	let b5 = CreateStraightLaserA1(bossX+100,bossY-210,90,50,5,0,99,1);
	let b6 = CreateStraightLaserA1(bossX+100,bossY-210,180,50,5,0,99,1);
	let b7 = CreateStraightLaserA1(bossX-100,bossY-210,90,50,5,0,99,1);
	let b8 = CreateStraightLaserA1(bossX-100,bossY-210,0,50,5,0,99,1);
	
	let c1 = CreateStraightLaserA1(bossX+80,bossY+100,270,50,5,0,99,1);
	let c2 = CreateStraightLaserA1(bossX+80,bossY+100,0,50,5,0,99,1);
	let c3 = CreateStraightLaserA1(bossX+80,bossY-100,90,50,5,0,99,1);
	let c4 = CreateStraightLaserA1(bossX+80,bossY-100,0,50,5,0,99,1);
	let c5 = CreateStraightLaserA1(bossX+210,bossY+100,270,50,5,0,99,1);
	let c6 = CreateStraightLaserA1(bossX+210,bossY+100,180,50,5,0,99,1);
	let c7 = CreateStraightLaserA1(bossX+210,bossY-100,180,50,5,0,99,1);
	let c8 = CreateStraightLaserA1(bossX+210,bossY-100,90,50,5,0,99,1);
	
	let d1 = CreateStraightLaserA1(bossX-80,bossY+100,270,50,5,0,99,1);
	let d2 = CreateStraightLaserA1(bossX-80,bossY+100,180,50,5,0,99,1);
	let d3 = CreateStraightLaserA1(bossX-80,bossY-100,180,50,5,0,99,1);
	let d4 = CreateStraightLaserA1(bossX-80,bossY-100,90,50,5,0,99,1);
	let d5 = CreateStraightLaserA1(bossX-210,bossY+100,270,50,5,0,99,1);
	let d6 = CreateStraightLaserA1(bossX-210,bossY+100,0,50,5,0,99,1);
	let d7 = CreateStraightLaserA1(bossX-210,bossY-100,0,50,5,0,99,1);
	let d8 = CreateStraightLaserA1(bossX-210,bossY-100,90,50,5,0,99,1);
	
	let e1 = CreateStraightLaserA1(bossX,bossY+80+65,90,30,5,0,99,1);
	let e2 = CreateStraightLaserA1(bossX,bossY+80+65,180,30,5,0,99,1);
	let e3 = CreateStraightLaserA1(bossX,bossY+80+65,0,30,5,0,99,1);
	let e4 = CreateStraightLaserA1(bossX,bossY+80+65,270,30,5,0,99,1);
	
	let e5 = CreateStraightLaserA1(bossX+80+65,bossY,90,30,5,0,99,1);
	let e6 = CreateStraightLaserA1(bossX+80+65,bossY,180,30,5,0,99,1);
	let e7 = CreateStraightLaserA1(bossX+80+65,bossY,0,30,5,0,99,1);
	let e8 = CreateStraightLaserA1(bossX+80+65,bossY,270,30,5,0,99,1);
	
	let e9 = CreateStraightLaserA1(bossX,bossY-80-65,90,30,5,0,99,1);
	let e10 = CreateStraightLaserA1(bossX,bossY-80-65,180,30,5,0,99,1);
	let e11 = CreateStraightLaserA1(bossX,bossY-80-65,0,30,5,0,99,1);
	let e12 = CreateStraightLaserA1(bossX,bossY-80-65,270,30,5,0,99,1);
	
	let e13 = CreateStraightLaserA1(bossX-80-65,bossY,90,30,5,0,99,1);
	let e14 = CreateStraightLaserA1(bossX-80-65,bossY,180,30,5,0,99,1);
	let e15 = CreateStraightLaserA1(bossX-80-65,bossY,0,30,5,0,99,1);
	let e16 = CreateStraightLaserA1(bossX-80-65,bossY,270,30,5,0,99,1);
	delete(a1,a2,a3,a4,a5,a6,a7,a8,b1,b2,b3,b4,b5,b6,b7,b8,c1,c2,c3,c4,c5,c6,c7,c8,d1,d2,d3,d4,d5,d6,d7,d8,e1,e2,e3,e4,e5,e6,e7,e8,e9,e10,e11,e12,e13,e14,e15,e16);
	wait(1);
	}
	ascent(i in 0..80) {
		let obj = CreateStraightLaserA1(bossX-100+i*2.5,bossY+80,90,130,30,20,99,0);
		ObjStLaser_SetSource(obj,false);
		
		let obj2 = CreateStraightLaserA1(bossX+80,bossY+100-i*2.5,0,130,30,20,99,0);
		ObjStLaser_SetSource(obj2,false);
		
		let obj3 = CreateStraightLaserA1(bossX-100+i*2.5,bossY-80,270,130,30,20,99,0);
		ObjStLaser_SetSource(obj3,false);
		
		let obj4 = CreateStraightLaserA1(bossX-80,bossY+100-i*2.5,180,130,30,20,99,0);
		ObjStLaser_SetSource(obj4,false);
	}
	
}

task move(a1,a2,a3,a4,a5,a6,a7,a8) {
	loop {
	ObjMove_SetX(a1,bossX+100);
	ObjMove_SetX(a2,bossX+100);
	ObjMove_SetX(a3,bossX-100);
	ObjMove_SetX(a4,bossX-100);
	ObjMove_SetX(a5,bossX+100);
	ObjMove_SetX(a6,bossX+100);
	ObjMove_SetX(a7,bossX-100);
	ObjMove_SetX(a8,bossX-100);
	
	ObjMove_SetY(a1,bossY+80);
	ObjMove_SetY(a2,bossY+80);
	ObjMove_SetY(a3,bossY+80);
	ObjMove_SetY(a4,bossY+80);
	ObjMove_SetY(a5,bossY+210);
	ObjMove_SetY(a6,bossY+210);
	ObjMove_SetY(a7,bossY+210);
	ObjMove_SetY(a8,bossY+210);
	wait(1);
	}
}

task move2(b1,b2,b3,b4,b5,b6,b7,b8) {
	loop {
	ObjMove_SetX(b1,bossX+100);
	ObjMove_SetX(b2,bossX+100);
	ObjMove_SetX(b3,bossX-100);
	ObjMove_SetX(b4,bossX-100);
	ObjMove_SetX(b5,bossX+100);
	ObjMove_SetX(b6,bossX+100);
	ObjMove_SetX(b7,bossX-100);
	ObjMove_SetX(b8,bossX-100);
	
	ObjMove_SetY(b1,bossY-80);
	ObjMove_SetY(b2,bossY-80);
	ObjMove_SetY(b3,bossY-80);
	ObjMove_SetY(b4,bossY-80);
	ObjMove_SetY(b5,bossY-210);
	ObjMove_SetY(b6,bossY-210);
	ObjMove_SetY(b7,bossY-210);
	ObjMove_SetY(b8,bossY-210);
	wait(1);
	}
}

task move3(c1,c2,c3,c4,c5,c6,c7,c8) {
	loop {
	ObjMove_SetX(c1,bossX+80);
	ObjMove_SetX(c2,bossX+80);
	ObjMove_SetX(c3,bossX+80);
	ObjMove_SetX(c4,bossX+80);
	ObjMove_SetX(c5,bossX+210);
	ObjMove_SetX(c6,bossX+210);
	ObjMove_SetX(c7,bossX+210);
	ObjMove_SetX(c8,bossX+210);
	
	ObjMove_SetY(c1,bossY+100);
	ObjMove_SetY(c2,bossY+100);
	ObjMove_SetY(c3,bossY-100);
	ObjMove_SetY(c4,bossY-100);
	ObjMove_SetY(c5,bossY+100);
	ObjMove_SetY(c6,bossY+100);
	ObjMove_SetY(c7,bossY-100);
	ObjMove_SetY(c8,bossY-100);
	wait(1);
	}
}

task move4(d1,d2,d3,d4,d5,d6,d7,d8) {
	loop {
	ObjMove_SetX(d1,bossX-80);
	ObjMove_SetX(d2,bossX-80);
	ObjMove_SetX(d3,bossX-80);
	ObjMove_SetX(d4,bossX-80);
	ObjMove_SetX(d5,bossX-210);
	ObjMove_SetX(d6,bossX-210);
	ObjMove_SetX(d7,bossX-210);
	ObjMove_SetX(d8,bossX-210);
	
	ObjMove_SetY(d1,bossY+100);
	ObjMove_SetY(d2,bossY+100);
	ObjMove_SetY(d3,bossY-100);
	ObjMove_SetY(d4,bossY-100);
	ObjMove_SetY(d5,bossY+100);
	ObjMove_SetY(d6,bossY+100);
	ObjMove_SetY(d7,bossY-100);
	ObjMove_SetY(d8,bossY-100);
	wait(1);
	}
}

task move5(e1,e2,e3,e4,e5,e6,e7,e8,e9,e10,e11,e12,e13,e14,e15,e16) {
	loop {
	ObjMove_SetX(e1,bossX);
	ObjMove_SetX(e2,bossX);
	ObjMove_SetX(e3,bossX);
	ObjMove_SetX(e4,bossX);
	ObjMove_SetY(e1,bossY+80+65);
	ObjMove_SetY(e2,bossY+80+65);
	ObjMove_SetY(e3,bossY+80+65);
	ObjMove_SetY(e4,bossY+80+65);
	
	ObjMove_SetX(e5,bossX+80+65);
	ObjMove_SetX(e6,bossX+80+65);
	ObjMove_SetX(e7,bossX+80+65);
	ObjMove_SetX(e8,bossX+80+65);
	ObjMove_SetY(e5,bossY);
	ObjMove_SetY(e6,bossY);
	ObjMove_SetY(e7,bossY);
	ObjMove_SetY(e8,bossY);
	
	ObjMove_SetX(e9,bossX);
	ObjMove_SetX(e10,bossX);
	ObjMove_SetX(e11,bossX);
	ObjMove_SetX(e12,bossX);
	ObjMove_SetY(e9,bossY-80-65);
	ObjMove_SetY(e10,bossY-80-65);
	ObjMove_SetY(e11,bossY-80-65);
	ObjMove_SetY(e12,bossY-80-65);
	
	ObjMove_SetX(e13,bossX-80-65);
	ObjMove_SetX(e14,bossX-80-65);
	ObjMove_SetX(e15,bossX-80-65);
	ObjMove_SetX(e16,bossX-80-65);
	ObjMove_SetY(e13,bossY);
	ObjMove_SetY(e14,bossY);
	ObjMove_SetY(e15,bossY);
	ObjMove_SetY(e16,bossY);
	wait(1);
	}
}



task delete(a1,a2,a3,a4,a5,a6,a7,a8,b1,b2,b3,b4,b5,b6,b7,b8,c1,c2,c3,c4,c5,c6,c7,c8,d1,d2,d3,d4,d5,d6,d7,d8,e1,e2,e3,e4,e5,e6,e7,e8,e9,e10,e11,e12,e13,e14,e15,e16) {
	wait(3);
	Obj_Delete(a1);
	Obj_Delete(a2);
	Obj_Delete(a3);
	Obj_Delete(a4);
	Obj_Delete(a5);
	Obj_Delete(a6);
	Obj_Delete(a7);
	Obj_Delete(a8);
	
	Obj_Delete(b1);
	Obj_Delete(b2);
	Obj_Delete(b3);
	Obj_Delete(b4);
	Obj_Delete(b5);
	Obj_Delete(b6);
	Obj_Delete(b7);
	Obj_Delete(b8);
	
	Obj_Delete(c1);
	Obj_Delete(c2);
	Obj_Delete(c3);
	Obj_Delete(c4);
	Obj_Delete(c5);
	Obj_Delete(c6);
	Obj_Delete(c7);
	Obj_Delete(c8);
	
	Obj_Delete(d1);
	Obj_Delete(d2);
	Obj_Delete(d3);
	Obj_Delete(d4);
	Obj_Delete(d5);
	Obj_Delete(d6);
	Obj_Delete(d7);
	Obj_Delete(d8);
	
	Obj_Delete(e1);
	Obj_Delete(e2);
	Obj_Delete(e3);
	Obj_Delete(e4);
	Obj_Delete(e5);
	Obj_Delete(e6);
	Obj_Delete(e7);
	Obj_Delete(e8);
	Obj_Delete(e9);
	Obj_Delete(e10);
	Obj_Delete(e11);
	Obj_Delete(e12);
	Obj_Delete(e13);
	Obj_Delete(e14);
	Obj_Delete(e15);
	Obj_Delete(e16);
}

















