//---------------------------------------------------------------------------------
// Character Variables
//---------------------------------------------------------------------------------

let Seija_Main			= CSD ~ "./SystemData/SpriteData/Seija_Main.png";

//---------------------------------------------------------------------------------
// Character Initializing
//---------------------------------------------------------------------------------

task BOSS_Initialize(CharacterID){
	objBoss = ObjEnemy_Create(OBJ_ENEMY_BOSS);
	ObjEnemy_Regist(objBoss);
	ObjBoss_MainAnimation(CharacterID);
}

task ObjBoss_MainAnimation(CharacterID){
	if(CharacterID == "CHAR_SEIJA"){ CharacterThread_SEIJA; }
}

task ObjEffect_AfterImage(bossImage,blendMode,maxAlpha,RGB){
	let obj = MakeBossEffect(objBoss,GetBossX,GetBossY,bossImage,blendMode,0.24);
	ObjRender_SetColorArray(obj,RGB);
	let maxScale = 2.00;
	let aMax = 30;
	ascent(let a in 1..aMax+1){
		let addScale = 1.00+a*1.00/aMax;
		let decAlpha = (aMax-a)*maxAlpha/aMax;
		ObjRender_SetScaleXYZ(obj,addScale,addScale,0.00);
		ObjRender_SetAlpha(obj,decAlpha);
		yield;
	}
	Obj_Delete(obj);
}

//---------------------------------------------------------------------------------
// Animation Tasks
//---------------------------------------------------------------------------------

task ObjAnim_SetActionA1(let objTarget, let actConst, let frameTime){
	SetAction(objTarget,actConst,frameTime);
}

task ObjAnim_SetActionA2(let objTarget, let wtTime, let actConst, let frameTime){
	wait(wtTime);
	if(!ObjEnemy_IsAlive(objTarget)){ return; }
	SetAction(objTarget,actConst,frameTime);
}

//---------------------------------------------------------------------------------
// Global Action Constants
//---------------------------------------------------------------------------------

let ACT_STAND;
let ACT_MOVE;
let ACT_MOVE_L;
let ACT_MOVE_R;
let ACT_SHOT_A;
let ACT_SHOT_B;

//---------------------------------------------------------------------------------
// Seija Kijin
//---------------------------------------------------------------------------------

task CharacterThread_SEIJA{
	ACT_STAND 	= _ACT_STAND3;
	ACT_MOVE	= _ACT_MOVE;
	ACT_MOVE_L	= _ACT_MOVE_L;
	ACT_MOVE_R	= _ACT_MOVE_R;
	ACT_SHOT_A 	= _ACT_SHOT_A6;
	ACT_SHOT_B	= _ACT_SHOT_B3;
	
	actionDefault = ACT_STAND;
	character = CHAR_REIMU;
	
	ObjBoss_SetHexCircleA1(objBoss,BLEND_ALPHA,RED);
	
	InitializeAction(objBoss,Seija_Main);
	DrawBoss_Task(objBoss);
	DrawAura_Task(objBoss);
	
	task DrawAura_Task(objBoss){
		while(!Obj_IsDeleted(objBoss)){
			ObjEffect_AfterImage(Seija_Main,BLEND_ADD_ARGB,128,WHITE);
			yield;
		}
	}
}