//
//̃t@C͖IdlhbgAjCuς̂
//pHhbgGɕtĂ镨łB
//IWi̓͂gpȂƃG[o܂B
//ʏłƓ悤Ɏgpł܂B
//==============================================================================
//	{X AjCu
//@{XʃAjCu`ɂăCN[h
//==============================================================================
//@萔Aϐ
//==============================================================================
//@ANV萔
//@{XhbgG̊eJbg̔zuԍ
//@	1  5  9 13 17 21   25 29
//@	2  6 10 14 18 22   26 30
//@	3  7 11 15 19 23   27 31
//@	4  8 12 16 20 24   28 32
//@e萔ɂAjp^[͊eRgQƁi*͏󋵂ɉĒ\j
//------------------------------------------------------------------------------
let _ACT_STAND1		= -1;	//@iAjȂj		 1
let _ACT_STAND3		= 0;	//@{܂΂i3R}j	 1-  2-  3-c 1-  5-  6-c
let _ACT_STAND4		= 1;	//@{܂΂i4R}j	 1-  2-  3-  4-c 1-  5-  6-  4-c
let _ACT_STAND4_B	= 2;	//@{܂΂i4R}Bj 1-  2-  3-  4-c 1-  5-  6-  7-c
let _ACT_MOVE		= 3;	//@ړiEj	
let _ACT_MOVE_L		= 4;	//@ړ					 9-*10-  9
let _ACT_MOVE_R		= 5;	//@Eړ					11-*12- 11
let _ACT_KICK		= 6;	//@LbNړiEj	
let _ACT_KICK_L		= 7;	//@LbNړ			11-*12- 11
let _ACT_KICK_R		= 8;	//@ELbNړ			 9-*10-  9
let _ACT_SHOT_A3	= 9;	//@eAi3R}j			17-*18- 17
let _ACT_SHOT_A3_B	= 10;	//@eAi3R}Bj			17- 18-*19
let _ACT_SHOT_A4	= 11;	//@eAi4R}j			17- 18-*19- 18
let _ACT_SHOT_A4_B	= 36;	//@eAi4R}Bj			17- 18- 19-*20
let _ACT_SHOT_A5	= 12;	//@eAi5R}j			17- 18-*19- 18- 17
let _ACT_SHOT_B3	= 13;	//@eBi3R}j			21-*22- 21
let _ACT_SHOT_B3_B 	= 14;	//@eBi3R}Bj			21- 23-*24
let _ACT_SHOT_B3_C	= 15;	//@eBi3R}Cj			23-*24- 23
let _ACT_SHOT_B3_D	= 39;	//@eB (3R}D)			*21-22- 23
let _ACT_SHOT_B4	= 16;	//@eBi4R}j			21- 22-*23- 22
let _ACT_SHOT_B5	= 17;	//@eBi5R}j			21- 22-*23- 22- 21
let _ACT_SHOT_B5_B	= 18;	//@eBi5R}Bj			21- 22-*24- 22- 21
let _ACT_SPELL3		= 19;	//@Xyi3R}j		13-*14- 13
let _ACT_SPELL4		= 20;	//@Xyi4R}j		13- 14-*15- 14
let _ACT_SPELL5		= 21;	//@Xyi5R}j		13- 14-*15- 14- 13
let _ACT_SPELL5_B	= 22;	//@Xyi5R}Bj	13- 14- 15-*16- 15
let _ACT_CHARGE		= 23;	//						21-*22
let _ACT_SLASH_H	= 24;	//@a					21-*22- 20- 18- 17
let _ACT_SLASH_V	= 25;	//@ca					23-*24- 20- 18- 17
let _ACT_TURN		= 26;	//@^[					25- 29- 30- 31- 32- 25
let _ACT_PRAY		= 27;	//@F					25-*(26- 27- 28- 29- 30- 31-c)- 32
let _ACT_SUN		= 28;	//@z					25-*(26- 27-c)-28
let _ACT_SPELL5_C	= 32;	//@VqpXyi5R}j			14- 13- 14- 15-*16
let _ACT_SLASH_H_B	= 33;	//@Vqpai4R}j			21-*22- 23- 24
let _ACT_SPELL4_B	= 34;	//@Xyi4R}Bj			13- 14- 15-*16
let _ACT_THORN		= 35;	//@ߋpꓮ			25- 26- 27-*(28- 29-c)- 30- 31- 32
let _ACT_PARASOR_L	= 37;	//@PpU1			17- 18- 19- 20 - 1(JԂ)
let _ACT_PARASOR_R	= 38;	//@PpU2			17- 18- 19- 20 - 1(JԂ)

//------------------------------------------------------------------------------
//@Jbgʋ`W萔i̍Wj
//@e萔Jbg̓RgyуANV萔̃JbgzuԍQ
//------------------------------------------------------------------------------
let RECT_LENGTH		= 128;
let RECT_STAND0		= [ 0, 0 ];								//	 1
let RECT_STAND1		= [ 0, RECT_LENGTH ];					//	 2
let RECT_STAND2		= [ 0, 2 * RECT_LENGTH ];				//	 3
let RECT_STAND3		= [ 0, 3 * RECT_LENGTH ];				//	 4
let RECT_BLINK0		= [ RECT_LENGTH, 0 ];					//	 5
let RECT_BLINK1		= [ RECT_LENGTH, RECT_LENGTH ];			//	 6
let RECT_BLINK2		= [ RECT_LENGTH, 2 * RECT_LENGTH ];		//	 7
let RECT_MOVE_L0	= [ 2 * RECT_LENGTH, 0 ];				//	 9
let RECT_MOVE_L1	= [ 2 * RECT_LENGTH, RECT_LENGTH ];		//	10
let RECT_MOVE_R0	= [ 2 * RECT_LENGTH, 2 * RECT_LENGTH ];	//	11
let RECT_MOVE_R1	= [ 2 * RECT_LENGTH, 3 * RECT_LENGTH ];	//	12
let RECT_SPELL0		= [ 3 * RECT_LENGTH, 0 ];				//	13
let RECT_SPELL1		= [ 3 * RECT_LENGTH, RECT_LENGTH ];		//	14
let RECT_SPELL2		= [ 3 * RECT_LENGTH, 2 * RECT_LENGTH ];	//	15
let RECT_SPELL3		= [ 3 * RECT_LENGTH, 3 * RECT_LENGTH ];	//	16
let RECT_SHOT_A0	= [ 4 * RECT_LENGTH, 0 ];				//	17
let RECT_SHOT_A1	= [ 4 * RECT_LENGTH, RECT_LENGTH ];		//	18
let RECT_SHOT_A2	= [ 4 * RECT_LENGTH, 2 * RECT_LENGTH ];	//	19
let RECT_SHOT_A3	= [ 4 * RECT_LENGTH, 3 * RECT_LENGTH ];	//	20
let RECT_SHOT_B0	= [ 5 * RECT_LENGTH, 0 ];				//	21
let RECT_SHOT_B1	= [ 5 * RECT_LENGTH, RECT_LENGTH ];		//	22
let RECT_SHOT_B2	= [ 5 * RECT_LENGTH, 2 * RECT_LENGTH ];	//	23
let RECT_SHOT_B3	= [ 5 * RECT_LENGTH, 3 * RECT_LENGTH ];	//	24
let RECT_ETC_A0		= [ 6 * RECT_LENGTH, 0 ];				//	25
let RECT_ETC_A1		= [ 6 * RECT_LENGTH, RECT_LENGTH ];		//	26
let RECT_ETC_A2		= [ 6 * RECT_LENGTH, 2 * RECT_LENGTH ];	//	27
let RECT_ETC_A3		= [ 6 * RECT_LENGTH, 3 * RECT_LENGTH ];	//	28
let RECT_ETC_B0		= [ 7 * RECT_LENGTH, 0 ];				//	29
let RECT_ETC_B1		= [ 7 * RECT_LENGTH, RECT_LENGTH ];		//	30
let RECT_ETC_B2		= [ 7 * RECT_LENGTH, 2 * RECT_LENGTH ];	//	31
let RECT_ETC_B3		= [ 7 * RECT_LENGTH, 3 * RECT_LENGTH ];	//	32

//------------------------------------------------------------------------------
//@L萔
//------------------------------------------------------------------------------
let CHAR_DAIYOUSEI	= 0;
let CHAR_MEIRIN		= 1;
let CHAR_DEVIL		= 2;
let CHAR_PATCHOULI	= 3;
let CHAR_SAKUYA		= 4;
let CHAR_REMILIA	= 5;
let CHAR_FLANDRE	= 6;
let CHAR_ALICE		= 7;
let CHAR_LILY		= 8;
let CHAR_YOUMU		= 9;
let CHAR_YUYUKO		= 10;
let CHAR_CHEN_RAN	= 11;
let CHAR_YUKARI		= 12;
let CHAR_TEWI		= 13;
let CHAR_REISEN		= 14;
let CHAR_EIRIN		= 15;
let CHAR_KAGUYA		= 16;
let CHAR_MOKOU		= 17;
let CHAR_SUIKA		= 18;
let CHAR_AYA		= 19;
let CHAR_MEDICINE	= 20;
let CHAR_YUKA		= 21;
let CHAR_KOMACHI	= 22;
let CHAR_EIKI		= 23;
let CHAR_SHINKI		= 24;
let CHAR_MIMA		= 25;
let CHAR_REIMU		= 26;

//------------------------------------------------------------------------------
//@̑ϐ
//------------------------------------------------------------------------------
let actionDefault = _ACT_STAND1;	//@{ANV
let action = actionDefault;			//@݂̃ANV
let actionCount = 0;				//@ANVt[JE^
let actionCountMax = 0;				//@ANVI܂ł̃t[
let stopAnime = false;				//@true̊Ԃ̓Aj~
let character = CHAR_DAIYOUSEI;		//@쒆̃LN^[

//==============================================================================
//@ANVw֘A֐
//==============================================================================
//@ANVݒ
//------------------------------------------------------------------------------
task InitializeAction(
	let objEnemy,	//{X̃IuWFNg
	let imageFile,	//摜t@C
){
	ObjPrim_SetTexture(objEnemy, imageFile);
	loop{
		SetAction( actionDefault, 0 );
		while( actionCount < actionCountMax ){
			while( stopAnime ){ yield; }
			actionCount ++;
			yield;
		}
	}
}

//------------------------------------------------------------------------------
//@ANVw
//@wt[o߂Ɗ{ANVɈڍs
//@uvuH]v̓t[Œiw𖳎j
//------------------------------------------------------------------------------
function SetAction(
	let newAction,		//@ANV萔
	let frame			//@ANVI܂ł̃t[
){
	alternative( newAction )
	case( _ACT_STAND1, _ACT_STAND3, _ACT_STAND4, _ACT_STAND4_B ){ frame = 216000; }
	case( _ACT_TURN ){ frame = 42; }
	action = newAction;
	actionCount = 0;
	actionCountMax = frame;
}

//------------------------------------------------------------------------------
//@Ajꎞ~
//@~rɂĊJꍇ0ȉ̃t[w肷
//------------------------------------------------------------------------------
task StopAnime(
	let frame		//@~t[ioߌɃAjĊJj
){
	if( frame > 0 ){
		stopAnime = true;
		loop( frame ){
			if( !stopAnime ){ break; }
			yield;
		}
		stopAnime = false;
	}
	else{ stopAnime = false; }
}

//==============================================================================
//@`֘A֐
//==============================================================================
//@{XAj`iʏj
//------------------------------------------------------------------------------
function DrawBoss(
	let objEnemy,		//{X̃IuWFNg
){
	_DrawBoss( objEnemy, ObjMove_GetX(objEnemy), ObjMove_GetY(objEnemy) );
}

//------------------------------------------------------------------------------
//@{XAj`iWwj
//------------------------------------------------------------------------------
function _DrawBoss(
	let objEnemy,		//{X̃IuWFNg
	let x,				//	SxW
	let y				//	SyW
){
	let rect = [];
	alternative( action )
	//@3R}[vi{܂΂j --------------------------------
	case( _ACT_STAND3 ){
		let cutFrame = 15;
		let count = actionCount % ( cutFrame * 12 );
		let number = trunc( count / cutFrame );
		let anime = [ 0, 1, 2, 1, 0, 1, 2, 1, 0, 3, 4, 1 ][ number ];
		rect = [ RECT_STAND0, RECT_STAND1, RECT_STAND2,
			RECT_BLINK0, RECT_BLINK1 ][ anime ];
	}
	//@4R}[vi{܂΂j --------------------------------
	case( _ACT_STAND4 ){
		let cutFrame = 15;
		let count = actionCount % ( cutFrame * 12 );
		let number = trunc( count / cutFrame );
		let anime = [ 0, 1, 2, 3, 2, 1, 0, 4, 5, 3, 2, 1 ][ number ];
		rect = [ RECT_STAND0, RECT_STAND1, RECT_STAND2, RECT_STAND3,
			RECT_BLINK0, RECT_BLINK1 ][ anime ];
	}
	//@4R}[vi{܂΂Bj -------------------------------
	case( _ACT_STAND4_B ){
		let cutFrame = 15;
		let count = actionCount % ( cutFrame * 12 );
		let number = trunc( count / cutFrame );
		let anime = [ 0, 1, 2, 3, 2, 1, 0, 4, 5, 6, 2, 1 ][ number ];
		rect = [ RECT_STAND0, RECT_STAND1, RECT_STAND2, RECT_STAND3,
			RECT_BLINK0, RECT_BLINK1, RECT_BLINK2 ][ anime ];
	}
	//@3R}ړiEj ------------------------------------
	case( _ACT_MOVE, _ACT_KICK ){
		if( absolute( ObjMove_GetSpeed(objEnemy) ) < 0.1 ){ rect = RECT_STAND0; }
		else{
			let cutFrameA = 12;
			if( actionCountMax < 36 ){ cutFrameA = trunc( actionCountMax / 3 ); }
			let cutFrameB = actionCountMax - cutFrameA;
			let animePattern = [ 0, 1, 0 ];
			let framePattern = [ cutFrameA, cutFrameB, actionCountMax ];
			let anime = animePattern[ 2 ];
			ascent( let i in 0 .. 3 ){
				if( actionCount < framePattern[ i ] ){
					anime = animePattern[ i ];
					break;
				}
			}
			let moveL = cos( ObjMove_GetAngle(objEnemy) ) <= 0;
			if( action == _ACT_KICK ){ moveL = !moveL; }
			if( moveL ){ rect = [ RECT_MOVE_L0, RECT_MOVE_L1 ][ anime ]; }
			else{ rect = [ RECT_MOVE_R0, RECT_MOVE_R1 ][ anime ]; }
		}
	}

	//@3R}ړiEwj ----------------------------------------
	case( _ACT_MOVE_L, _ACT_MOVE_R, _ACT_KICK_L, _ACT_KICK_R ){
		let cutFrameA = 12;
		if( actionCountMax < 36 ){ cutFrameA = trunc( actionCountMax / 3 ); }
		let cutFrameB = actionCountMax - cutFrameA;
		let animePattern = [ 0, 1, 0 ];
		let framePattern = [ cutFrameA, cutFrameB, actionCountMax ];
		let anime = animePattern[ 2 ];
		ascent( let i in 0 .. 3 ){
			if( actionCount < framePattern[ i ] ){
				anime = animePattern[ i ];
				break;
			}
		}
		if( action == _ACT_MOVE_L || action == _ACT_KICK_R ){
			rect = [ RECT_MOVE_L0, RECT_MOVE_L1 ][ anime ];
		}
		else{ rect = [ RECT_MOVE_R0, RECT_MOVE_R1 ][ anime ]; }
	}

	//@3R}ieA3,B3,B3C,Xy3j -------------------------------
	case( _ACT_SHOT_A3, _ACT_SHOT_B3, _ACT_SHOT_B3_C, _ACT_SPELL3 ){
		let cutFrameA = 6;
		if( actionCountMax < 24 ){ cutFrameA = trunc( actionCountMax / 4 ); }
		let cutFrameB = actionCountMax - cutFrameA;
		let animePattern = [ 0, 1, 0 ];
		let framePattern = [ cutFrameA, cutFrameB, actionCountMax ];
		let anime = animePattern[ 2 ];
		ascent( let i in 0 .. 3 ){
			if( actionCount < framePattern[ i ] ){
				anime = animePattern[ i ];
				break;
			}
		}
		alternative( action )
		case( _ACT_SHOT_A3 ){ rect = [ RECT_SHOT_A0, RECT_SHOT_A1 ][ anime ]; }
		case( _ACT_SHOT_B3 ){ rect = [ RECT_SHOT_B0, RECT_SHOT_B1 ][ anime ]; }
		case( _ACT_SHOT_B3_C ){ rect = [ RECT_SHOT_B2, RECT_SHOT_B3 ][ anime ]; }
		others{ rect = [ RECT_SPELL0, RECT_SPELL1 ][ anime ]; }
	}
	//@3R}BieA3B,B3Bj ----------------------------------------
	case( _ACT_SHOT_A3_B, _ACT_SHOT_B3_B ){
		let cutFrameA = 6;
		if( actionCountMax < 24 ){ cutFrameA = trunc( actionCountMax / 4 ); }
		let cutFrameB = cutFrameA * 2;
		let animePattern = [ 0, 1, 2 ];
		let framePattern = [ cutFrameA, cutFrameB, actionCountMax ];
		let anime = animePattern[ 2 ];
		ascent( let i in 0 .. 3 ){
			if( actionCount < framePattern[ i ] ){
				anime = animePattern[ i ];
				break;
			}
		}
		alternative( action )
		case( _ACT_SHOT_A3_B ){ rect = [ RECT_SHOT_A0, RECT_SHOT_A1, RECT_SHOT_A2 ][ anime ]; }
		others { rect = [ RECT_SHOT_B0, RECT_SHOT_B2, RECT_SHOT_B3 ][ anime ]; }
	}
	//@3R}B (B3D)  ------------------------------------------------
	case( _ACT_SHOT_B3_D ){
		let cutFrameA = 12;
		if( actionCountMax < 36 ){ cutFrameA = trunc( actionCountMax / 3 ); }
		let cutFrameB = actionCountMax - cutFrameA;
		cutFrameA = cutFrameB - cutFrameA;
		let animePattern = [ 0, 1, 2 ];
		let framePattern = [ cutFrameA, cutFrameB, actionCountMax ];
		let anime = 0;
		ascent( let i in 0 .. 3 ){
			if( actionCount < framePattern[ i ] ){
				anime = animePattern[ i ];
				break;
			}
		}
		rect = [ RECT_SHOT_B0, RECT_SHOT_B1, RECT_SHOT_B2 ][ anime ];
	}
	//@4R}ieA4,B4,Xy4j -----------------------------------
	case( _ACT_SHOT_A4, _ACT_SHOT_B4, _ACT_SPELL4 ){
		let cutFrameA = 6;
		if( actionCountMax < 30 ){ cutFrameA = trunc( actionCountMax / 5 ); }
		let cutFrameB = cutFrameA * 2;
		let cutFrameC = actionCountMax - cutFrameA;
		let animePattern = [ 0, 1, 2, 1 ];
		let framePattern = [ cutFrameA, cutFrameB, cutFrameC, actionCountMax ];
		let anime = animePattern[ 3 ];
		ascent( let i in 0 .. 4 ){
			if( actionCount < framePattern[ i ] ){
				anime = animePattern[ i ];
				break;
			}
		}
		alternative( action )
		case( _ACT_SHOT_A4 ){ rect = [ RECT_SHOT_A0, RECT_SHOT_A1, RECT_SHOT_A2 ][ anime ]; }
		case( _ACT_SHOT_B4 ){ rect = [ RECT_SHOT_B0, RECT_SHOT_B1, RECT_SHOT_B2 ][ anime ]; }
		others{ rect = [ RECT_SPELL0, RECT_SPELL1, RECT_SPELL2 ][ anime ]; }
	}
	//@4R}iXy4B,eA4Bj -----------------------------------
	case( _ACT_SPELL4_B, _ACT_SHOT_A4_B ){
		let cutFrameA = 6;
		if( actionCountMax < 30 ){ cutFrameA = trunc( actionCountMax / 5 ); }
		let cutFrameB = cutFrameA * 2;
		let cutFrameC = cutFrameA * 3;
		let cutFrameD = actionCountMax - cutFrameA;
		let animePattern = [ 0, 1, 2, 3 ];
		let framePattern = [ cutFrameA, cutFrameB, cutFrameC, cutFrameD ];
		let anime = animePattern[ 3 ];
		ascent( let i in 0 .. 4 ){
			if( actionCount < framePattern[ i ] ){
				anime = animePattern[ i ];
				break;
			}
		}
		alternative( action )
		case( _ACT_SPELL4_B ){ rect = [ RECT_SPELL0, RECT_SPELL1, RECT_SPELL2, RECT_SPELL3 ][ anime ]; }
		case( _ACT_SHOT_A4_B ){ rect = [RECT_SHOT_A0, RECT_SHOT_A1, RECT_SHOT_A2, RECT_SHOT_A3 ][ anime ]; }
	}
	//@5R}iPUA,Bj -----------------------------------
	case( _ACT_PARASOR_L, _ACT_PARASOR_R ){
		let cutFrame = 6;
		let count = actionCount % ( cutFrame * 4 );
		let number = trunc( count / cutFrame );

		alternative( action )
		case( _ACT_PARASOR_L ){ rect = [ RECT_SHOT_A0, RECT_SHOT_A1, RECT_SHOT_A2, RECT_SHOT_A3 ][ number ]; }
		case( _ACT_PARASOR_R ){ rect = [RECT_SHOT_B0, RECT_SHOT_B1, RECT_SHOT_B2, RECT_SHOT_B3 ][ number ]; }
	}
	//@5R}ieA5,B5,B5B,Xy5j -------------------------------
	case( _ACT_SHOT_A5, _ACT_SHOT_B5, _ACT_SHOT_B5_B, _ACT_SPELL5 ){
		let cutFrameA = 6;
		if( actionCountMax < 36 ){ cutFrameA = trunc( actionCountMax / 6 ); }
		let cutFrameB = cutFrameA * 2;
		let cutFrameC = actionCountMax - cutFrameB;
		let cutFrameD = actionCountMax - cutFrameA;
		let animePattern = [ 0, 1, 2, 1, 0 ];
		let framePattern = [ cutFrameA, cutFrameB, cutFrameC, cutFrameD, actionCountMax ];
		let anime = animePattern[ 4 ];
		ascent( let i in 0 .. 5 ){
			if( actionCount < framePattern[ i ] ){
				anime = animePattern[ i ];
				break;
			}
		}
		alternative( action )
		case( _ACT_SHOT_A5 ){ rect = [ RECT_SHOT_A0, RECT_SHOT_A1, RECT_SHOT_A2 ][ anime ]; }
		case( _ACT_SHOT_B5 ){ rect = [ RECT_SHOT_B0, RECT_SHOT_B1, RECT_SHOT_B2 ][ anime ]; }
		case( _ACT_SHOT_B5_B ){ rect = [ RECT_SHOT_B0, RECT_SHOT_B1, RECT_SHOT_B3 ][ anime ]; }
		others{ rect = [ RECT_SPELL0, RECT_SPELL1, RECT_SPELL2 ][ anime ]; }
	}
	//@5R}BiXy5Bj -------------------------------------------
	case( _ACT_SPELL5_B ){
		let cutFrameA = 6;
		if( actionCountMax < 36 ){ cutFrameA = trunc( actionCountMax / 6 ); }
		let cutFrameB = cutFrameA * 2;
		let cutFrameC = cutFrameA * 3;
		let cutFrameD = actionCountMax - cutFrameA;
		let animePattern = [ 0, 1, 2, 3, 2 ];
		let framePattern = [ cutFrameA, cutFrameB, cutFrameC, cutFrameD, actionCountMax ];
		let anime = animePattern[ 4 ];
		ascent( let i in 0 .. 5 ){
			if( actionCount < framePattern[ i ] ){
				anime = animePattern[ i ];
				break;
			}
		}
		rect = [ RECT_SPELL0, RECT_SPELL1, RECT_SPELL2, RECT_SPELL3 ][ anime ]; 
		
	}
	//@5R} iXy5Cj -------------------------------------------
	case( _ACT_SPELL5_C ){
		let cutFrameA = 6;
		if( actionCountMax < 36 ){ cutFrameA = trunc( actionCountMax / 6 ); }
		let cutFrameB = cutFrameA * 2;
		let cutFrameC = cutFrameA * 3;
		let cutFrameD = cutFrameA * 4;
		let cutFrameE = actionCountMax - cutFrameA;
		let animePattern = [1, 0, 1, 2, 3 ];
		let framePattern = [cutFrameA, cutFrameB, cutFrameC, cutFrameD, cutFrameE];
		let anime = animePattern[ 4 ];
		ascent( let i in 0 .. 5 ){
			if( actionCount < framePattern[ i ] ){
				anime = animePattern[ i ];
				break;
			}
		}
		rect = [ RECT_SPELL0, RECT_SPELL1, RECT_SPELL2, RECT_SPELL3 ][ anime ];
	}
	//@2R}i߁j ------------------------------------------------
	case( _ACT_CHARGE ){
		let cutFrame = 6;
		if( actionCountMax < 18 ){ cutFrame = trunc( actionCountMax / 3 ); }
		let anime = [ 0, 1 ][ actionCount >= cutFrame ];
		alternative( action )
		rect = [ RECT_SHOT_B0, RECT_SHOT_B1 ][ anime ];
	}
	//@5R}ica,aj ---------------------------------------
	case( _ACT_SLASH_H, _ACT_SLASH_V, _ACT_SLASH_H_B ){
		let cutFrameA = 6;
		if( actionCountMax < 36 ){ cutFrameA = trunc( actionCountMax / 6 ); }
		let cutFrameD = actionCountMax - cutFrameA;
		let cutFrameC = cutFrameD - cutFrameA;
		let cutFrameB = cutFrameC - cutFrameA;
		let animePattern = [ 0, 1, 2, 3, 4 ];
		let framePattern = [ cutFrameA, cutFrameB, cutFrameC, cutFrameD, actionCountMax ];
		let anime = animePattern[ 4 ];
		ascent( let i in 0 .. 5 ){
			if( actionCount < framePattern[ i ] ){
				anime = animePattern[ i ];
				break;
			}
		}
		alternative( action )
		case( _ACT_SLASH_H ){ rect = [ RECT_SHOT_B0, RECT_SHOT_B1,
			RECT_SHOT_A3, RECT_SHOT_A1, RECT_SHOT_A0 ][ anime ]; }
		case( _ACT_SLASH_V ){ rect = [ RECT_SHOT_B2, RECT_SHOT_B3,
			RECT_SHOT_A3, RECT_SHOT_A1, RECT_SHOT_A0 ][ anime ];  }
		others{ rect = [ RECT_SHOT_B0, RECT_SHOT_B1,
			RECT_SHOT_B2, RECT_SHOT_B3, RECT_SHOT_B3 ][ anime ]; }
	}
	//@6R}i^[j ----------------------------------------------
	case( _ACT_TURN ){
		let cutFrame = 7;
		let number = trunc( actionCount / cutFrame );
		let anime = [ 0, 1, 2, 3, 4, 0, 0 ][ number ];
		rect = [ RECT_ETC_A0, RECT_ETC_B0, RECT_ETC_B1, RECT_ETC_B2, RECT_ETC_B3 ][ anime ];
	}
	//@8R}[viFj ------------------------------------------
	case( _ACT_PRAY ){
		let cutFrame = 6;
		let anime = 0;
		if( actionCountMax < 12 ){ cutFrame = trunc( ( actionCountMax + 1 ) / 2 ); }
		if( actionCount >= cutFrame && actionCount < actionCountMax - cutFrame ){
			anime = trunc( ( actionCount - cutFrame ) / cutFrame ) % 6 + 1;
		}
		rect = [ RECT_ETC_A0, RECT_ETC_A1, RECT_ETC_A2, RECT_ETC_A3,
			RECT_ETC_B0, RECT_ETC_B1, RECT_ETC_B2, RECT_ETC_B3 ][ anime ];
	}
	//@8R}[viߋpꓮj ------------------------------------------
	case( _ACT_THORN ){

		let cutFrame = 6;
		let anime = 0;
		if( actionCountMax < 12 ){ cutFrame = trunc( ( actionCountMax + 1 ) / 2 ); }
		if( actionCount<=cutFrame * 3 ){
			anime = trunc( actionCount / 6 ) ;
		}
		if( actionCount >= cutFrame * 3 && actionCount < actionCountMax - cutFrame*3 ){
			anime = trunc( ( actionCount - cutFrame ) / cutFrame ) % 2 + 3;
		}
		if( actionCountMax - actionCount<=cutFrame * 3){
			let number = trunc( ( actionCountMax - actionCount )/ 6 )  ;
			let Aft_anime = [ 7, 6, 5, 5][ number ];
			anime = Aft_anime;
		}
		rect = [ RECT_ETC_A0, RECT_ETC_A1, RECT_ETC_A2, RECT_ETC_A3,
			RECT_ETC_B0, RECT_ETC_B1, RECT_ETC_B2, RECT_ETC_B3 ][ anime ];
	}
	//@4R}[vizj ------------------------------------------
	case( _ACT_SUN ){
		let cutFrame = 4;
		let anime = 0;
		if( actionCountMax < 12 ){ cutFrame = trunc( ( actionCountMax + 1 ) / 2 ); }
		if( actionCount >= cutFrame && actionCount < actionCountMax - cutFrame ){
			anime = trunc( ( actionCount - cutFrame ) / cutFrame ) % 2 + 1;
		}
		rect = [ RECT_ETC_A0, RECT_ETC_A1, RECT_ETC_A2, RECT_ETC_A3][ anime ];
	}
	//@1R}i{AjȂj ------------------------------------
	others{ rect = RECT_STAND0; }
	//@` ---------------------------------------------------------
	ObjSprite2D_SetSourceRect(objEnemy, rect[ 0 ], rect[ 1 ], rect[ 0 ] + RECT_LENGTH, rect[ 1 ] + RECT_LENGTH);
	ObjSprite2D_SetDestCenter(objEnemy);
}

