script_enemy_main
{
	let frame=0;
    let BossCutIn=GetCurrentScriptDirectory~"FIST.png";
	#include_function ".\spellcard.txt";
	#include_function ".\fist_replace.txt";

task bossgraphic{
    yield;
    let angle=0;
    let angleb=0;
    let obj=Obj_Create(OBJ_EFFECT);
    Obj_SetPosition(obj, GetX, GetY);
    ObjEffect_SetTexture(obj, BossCutIn);
    ObjEffect_SetLayer(obj, 4);
    ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLESTRIP);
    ObjEffect_CreateVertex(obj, 4);
    ObjEffect_SetVertexUV(obj, 0, 0, 0);
    ObjEffect_SetVertexUV(obj, 1, 256, 0);
    ObjEffect_SetVertexUV(obj, 2, 0, 416);
    ObjEffect_SetVertexUV(obj, 3, 256, 416);
    ObjEffect_SetVertexXY(obj, 0, -128, -208);
    ObjEffect_SetVertexXY(obj, 1, 128, -208);
    ObjEffect_SetVertexXY(obj, 2, -128, 208);
    ObjEffect_SetVertexXY(obj, 3, 128, 208);
    ascent(i in 0..4){ObjEffect_SetVertexColor(obj, i, 255, 255, 255, 255);}
    while(Obj_BeDeleted(obj)==false){
        Obj_SetPosition(obj, GetX, GetY-121);
        ObjEffect_SetAngle(obj, 0, 0, 180);
        yield;
    }
}
	@Initialize
	{
		SetInvincibility(100);
		SetLife(2000);
		LoadGraphic(BossCutIn);
		SetMovePosition02(GetCenterX,120,20);
        bossgraphic;
		timer;
		SetCommonData("timercount", 1800);
	}
	
	@MainLoop
	{
        SetDamageRate(70,15);
		SetCollisionA(GetX(),GetY(),75);
		SetCollisionB(GetX(),GetY(),75);
		frame++;
		yield;
        if(frame>150 && frame%20==0){
            PlaySE(GetCurrentScriptDirectory~"sound\Shot1.wav");
            ascent(i in 0..20){
                ascent(j in 2..6){
                    CreateShot01(GetX, GetY, j, GetAngleToPlayer+i*18, 61+j, 20);
                }
            }
        }
        if(frame%150==0){SetMovePosition03(GetPlayerX+rand(-50, 50), GetClipMinY+rand(50, 120), 10, 3);}
}
	
	@Finalize
	{
		 
        if(GetMissCountInThisSpell==0){
            SetCommonData("NOMISSCOUNT", GetCommonData("NOMISSCOUNT")+1);
        }
	}
	
	@DrawLoop
	{
	}
}