script_enemy_main {
    let GCSD=GetCurrentScriptDirectory;
    #include_function ".\..\ShotSheet\shot_replace.dnh"
    #include_function ".\..\functions.txt"
    #include_function ".\iddyea_functions.txt"

    SpellID=500;

    @Initialize {
	Randomize;
        SetLife(1500);
        SetTimer2(30);
	SetDamageRate(80,40);
	MagicCircle(false);
	SetEnemyMarker(true);
	IddyeaInit;
	MainTask;
	shotinit;

	StartFunctions(1,0,0);
//	SpellCircle2(6,1,4,200);
    }


function Wait(frames){loop(frames){yield;}}

task MainTask{
	DelayBombTask;
	SetMovePositionNew(GetCenterX,100,60);
	Wait(50);
	let colors=[0,5,6,7];

	let color=0;
	let angle=0;
	let angle2=0;
	let angle3=0;
	loop{
		loop(3){
			CreateShot01Delay(GetX+cos(angle)*100+cos(angle3)*70,GetY+sin(angle)*100+sin(angle3)*70,2,angle2,RED21+colors[color%4],30,50,17,30);
			angle3+=121;
		}
		angle+=46;
		angle2+=44;
		if(color%2==0){
			SE("shot1");
		}
		color++;
		yield;
	}
}

function RD{return rand(-10,10);}

@MainLoop {
        SetCollisionA(GetX, GetY, 40);
	SetCollisionB(GetX, GetY, 20);

	IddyeaDrawLogic;

	yield;
}

@DrawLoop {
	IddyeaDrawLoop;
}

@Finalize {
	EndingFunc(6);
	IddyeaFinalize;
	PointItems(GetX,GetY,7,0);
}

}