#TouhouDanmakufu[Single]
#ScriptVersion[3]
#Title["Blank"]
#Text[""]

#include"./Cutin.txt"

@Initialize{
	StartSpell;
}

@Event{
	alternative(GetEventType)
	case(EV_REQUEST_SPELL_SCORE){SetScriptResult(1000000);}
	case(EV_REQUEST_LIFE){SetScriptResult(2500);}
	case(EV_REQUEST_TIMER){SetScriptResult(33);}
}

@MainLoop{yield;}

@Finalize{}

task StartSpell{
	let objEnemy = GetEnemyBossObjectID[0];
	loop(90){yield;}
	
	
	CutinS2("NAZRIN", "Testing \"Test Cutin\"", GetCurrentScriptDirectory~"cutin.png", 240, 104, 104, "Normal");
	/*
	CutinS2("Spellcard Type", "Spellcard Name, Cutin Image, R, G, B, "Difficulty");
	This sets the spell's properties
	
	"Spellcard Type" - Currently the following types:
		- "NAZRIN": UFO type cutin
		- "MOKOU": Mokou's resurrection cutin (the cutin deletes itself after a few seconds)
		- "AYA": No cutin image is displayed
	
	"Spellcard Name" - Name of the spellcard
	
	Cutin Image - path to the image of the cutin: this function will automatically use the whole image (sorry)
	
	r, g, b - the RGB values of the cutin (the text and the text's background will change to the color set)
	
	"Difficulty" - Sets the spellcard's difficulty;
	This is important for saving history across different difficulties if the spellcard has the same name
	
	
	The cutin will be deleted when the main boss object is deleted
	History is saved to the "cutin_History"	common area data
	
	*/
	ObjEnemyBossScene_StartSpell(GetEnemyBossSceneObjectID);
	
	
	
	ObjPrim_SetTexture(objEnemy, GetCurrentScriptDirectory~"boss.png"); 
	ObjSprite2D_SetSourceRect(objEnemy, 0, 0, 64, 80); 
	ObjSprite2D_SetDestCenter(objEnemy); 
	
	ObjMove_SetDestAtWeight(objEnemy, GetStgFrameWidth/2, GetStgFrameHeight/2-96, 13, 5);
	
	while(ObjEnemy_GetInfo(objEnemy, INFO_LIFE)>0){
		ObjEnemy_SetIntersectionCircleToShot(objEnemy, ObjMove_GetX(objEnemy), ObjMove_GetY(objEnemy), 32);
		ObjEnemy_SetIntersectionCircleToPlayer(objEnemy, ObjMove_GetX(objEnemy), ObjMove_GetY(objEnemy), 24);
		yield;
	}
	Obj_Delete(objEnemy);
}


