//////////////////////////////////////////////////////////////////////
//	スペルカードスクリプト
//////////////////////////////////////////////////////////////////////

//霊夢　霊符　高速ボム　霊符「夢想封印　散」
script_spell MusouFuin_San
{
	#include_function "..\common\function_value.dnh"
		
	let seShot = "seBomb_ReimuA.wav";
	let seDmg = "seExplode01.wav";
	let img = GetCurrentScriptDirectory() ~ "players\ReimuA\img\shot_reimu.png";
	let Time    = 180;
	@Initialize {
		SetPlayerInvincibility( Time );
		TMain();
	}

	@Finalize {
	}

	@MainLoop {
		yield;
	}

	task TMain {
		CollectItems();
		loop ( 48 ) { yield; }//時間停止
		TMusouSan( Time - 60 );
		loop ( Time - 48 ) { yield; }
		End;
	}

	task TMusouSan( let timeBase ) {
		let num = 8;
		let w = 5;
		let time = timeBase - 5 - w * num;
		ascent ( let i in 0..num ) {
			PlaySE( seShot );
			__TMusou( GetPlayerX(), GetPlayerY(), 270 - 360 / num * i, time );
			loop ( w ) { yield; }
		}
	}

	//ダメージ・弾消しは爆発にかかわらずずっと付与
	task __TMusou( let x, let y, let angleBase, let time ) {
		let objs = [ Obj_Create( OBJ_SPELL ),
					 //Obj_Create( OBJ_SPELL ),
					 Obj_Create( OBJ_SPELL ),
					 //Obj_Create( OBJ_SPELL ),
					 Obj_Create( OBJ_SPELL ),
					 //Obj_Create( OBJ_SPELL ),
					 Obj_Create( OBJ_SPELL ) ];
		let angleGap = [ angleBase + 0, /*210,*/ angleBase + 270, /*330,*/ angleBase + 30, /*90,*/ angleBase + 150 ];
		let srcX = 17;
		let srcY = 65;
		let srcWidth = 95;
		let srcHeight = 95;
		let srcColors = [ [ 255, 0, 0 ],
						  //[ 133, 35, 88 ],
						  [ 100, 35, 88 ],
						  //[ 80, 35, 88 ],
						  [ 64, 35, 88 ],
						  //[ 80, 35, 88 ],
						  [ 100, 35, 88 ] ];
		let srcColors2 = [ [ 255, 255, 255 ],
						   //[ 32, 140, 92 ],
						   [ 47, 149, 171 ],
						   //[ 23, 21, 103 ],
						   [ 23, 21, 103 ],
						   //[ 23, 21, 103 ],
						   [ 47, 149, 171 ] ];
		let objScaleMin = 0.25;
		let objScaleMax = 1.5;//1.25;
		let rMax = 20;//40;
		let maxAlpha = 224;
		let speed = 12;
		let acc = -1.75 * speed / time;
		let dmg = 0.5;
		let dmgExp = 0.5;
		let da = 2;

		let expObj = Obj_Create( OBJ_EFFECT );
		let expSrcX = 159;
		let expSrcY = 30;
		let expSrcWidth = 131;
		let expSrcHeight = 131;
		let expSrcColors = [ 255, 87, 100 ];
		let expMaxAlpha = 160;
		let expObjScaleMin = 0;
		let expObjScaleMax = 2.5;
		let expTime = 30;

		// 夢想弾生成
		ascent ( let i in 0..length( objs ) ) {
			let obj = objs[ i ];
			Obj_SetAlpha( obj, maxAlpha );
			Obj_SetAutoDelete( obj, false );
			ObjEffect_SetTexture( obj, img );
			ObjEffect_SetPrimitiveType( obj, PRIMITIVE_TRIANGLESTRIP );
			ObjEffect_CreateVertex( obj, 4 );
			ascent ( let j in 0..4 ) {
				let xIndex = truncate( j / 2 );
				let yIndex = j % 2;
				ObjEffect_SetVertexXY( obj, j,
									   objScaleMax * srcWidth / 2 * [ -1, 1 ][ xIndex ],
									   objScaleMax * srcHeight / 2 * [ -1, 1 ][ yIndex ] );
				ObjEffect_SetVertexUV( obj, j,
									   srcX + [ 0, srcWidth ][ xIndex ],
									   srcY + [ 0, srcHeight ][ yIndex ] );
				ObjEffect_SetVertexColor( obj, j, maxAlpha,
										  srcColors[ i ][ 0 ],
										  srcColors[ i ][ 1 ],
										  srcColors[ i ][ 2 ] );
			}
			ObjEffect_SetLayer( obj, 2 );
			ObjEffect_SetRenderState( obj, ADD );
		}

		//爆発エフェクト生成
		Obj_SetAlpha( expObj, 0 );
		Obj_SetAutoDelete( expObj, false );
		ObjEffect_SetTexture( expObj, img );
		ObjEffect_SetPrimitiveType( expObj, PRIMITIVE_TRIANGLESTRIP );
		ObjEffect_CreateVertex( expObj, 4 );
		ascent ( let j in 0..4 ) {
			let xIndex = truncate( j / 2 );
			let yIndex = j % 2;
			ObjEffect_SetVertexXY( expObj, j,
								   expObjScaleMax * expSrcWidth / 2 * [ -1, 1 ][ xIndex ],
								   expObjScaleMax * expSrcHeight / 2 * [ -1, 1 ][ yIndex ] );
			ObjEffect_SetVertexUV( expObj, j,
								   expSrcX + [ 0, expSrcWidth ][ xIndex ],
								   expSrcY + [ 0, expSrcHeight ][ yIndex ] );
			ObjEffect_SetVertexColor( expObj, j, 0,
									  expSrcColors[ 0 ],
									  expSrcColors[ 1 ],
									  expSrcColors[ 2 ] );
		}
		ObjEffect_SetLayer( expObj, 2 );
		ObjEffect_SetRenderState( expObj, ADD );
		////
		ascent ( let t in 0..time ) {
			let dir = 1;
			ascent ( let i in 0..length( objs ) ) {
				let obj = objs[ i ];
				let r = [ 0, Smooth( 0, rMax, t, time ) ][ i > 0 ];
				let r2 = [ 0, Smooth( 0, rMax / 4, t, time ) ][ i > 0 ];
				let angle2 = da * t * dir;
				let objScale = Smooth( objScaleMin, objScaleMax, t, time );
				let rr = Smooth( srcColors[ i ][ 0 ], srcColors2[ i ][ 0 ], t, time );
				let gg = Smooth( srcColors[ i ][ 1 ], srcColors2[ i ][ 1 ], t, time );
				let bb = Smooth( srcColors[ i ][ 2 ], srcColors2[ i ][ 2 ], t, time );
				ObjEffect_SetAngle( obj, 0, 0, angle2 );
				ObjEffect_SetScale( obj,
									[ objScale * 0.75, objScale ][ i > 0 ],
									[ objScale * 0.75, objScale ][ i > 0 ] );
				ascent ( let j in 0..4 ) {
					ObjEffect_SetVertexColor( obj, j, maxAlpha, rr, gg, bb );
				}
				Obj_SetPosition( obj,
								 x + r * cos( angleGap[ i ] ) + r2 * cos( angle2 ),
								 y + r * sin( angleGap[ i ] ) + r2 * sin( angle2 ) );
				ObjSpell_SetIntersecrionCircle( obj, Obj_GetX( obj ), Obj_GetY( obj ),
												objScaleMax * srcWidth / 2, dmg, true );
				dir *= -1;
			}
			x = x + speed * cos( angleBase );
			y = y + speed * sin( angleBase );
			speed += acc;
			yield;
		}
		Obj_SetPosition( expObj, x, y );
		PlaySE( seDmg );
		ascent ( let t in 0..expTime ) {
			ascent ( let i in 0..length( objs ) ) {
				let obj = objs[ i ];
				let rr = 64;//Smooth( srcColors[ i ][ 0 ], 64, t, expTime );
				let gg = 100;//Smooth( srcColors[ i ][ 1 ], 100, t, expTime );
				let bb = 160;//Smooth( srcColors[ i ][ 2 ], 160, t, expTime );
				let alpha = SlowDown( maxAlpha, 0, t, expTime );
				let r = SlowDown( rMax, rMax * 2, t, expTime );
				ascent ( let j in 0..4 ) {
					ObjEffect_SetVertexColor( obj, j, alpha, rr, gg, bb );
				}
				Obj_SetPosition( obj,
								 x + r * cos( angleGap[ i ] ),
								 y + r * sin( angleGap[ i ] ) );
				ObjSpell_SetIntersecrionCircle( obj, Obj_GetX( obj ), Obj_GetY( obj ),
												objScaleMax * srcWidth / 2, dmgExp, true );
			}
			let expAlpha = SlowDown( expMaxAlpha, 0, t, expTime );
			let expScale = SlowDown( expObjScaleMin, expObjScaleMax, t, expTime );
			ObjEffect_SetScale( expObj, expScale, expScale );
			ascent ( let j in 0..4 ) {
				ObjEffect_SetVertexColor( expObj, j, expAlpha,
										  expSrcColors[ 0 ], expSrcColors[ 1 ], expSrcColors[ 2 ] );
			}
			yield;
		}
		ascent ( let i in 0..length( objs ) ) {
			Obj_Delete( objs[ i ] );
		}
		Obj_Delete( expObj );
	}
}


//霊夢　霊符　低速ボム　霊符「夢想封印　集」
script_spell MusouFuin_Shu
{
	#include_function "..\common\function_value.dnh"
		
	let seShot = "seBomb_ReimuA.wav";
	let seDmg = "seExplode01.wav";
	let img = GetCurrentScriptDirectory() ~ "players\ReimuA\img\shot_reimu.png";
	let Time    = 360;
	let homingObjs = [];
	let homingId = 65535;
	
	@Initialize {
		SetPlayerInvincibility( Time );
		TMain();
		SetSpeed( 2.5, 1.0 );
	}

	@Finalize {
		ascent ( let i in 0 .. length( homingObjs ) ) {
			if ( Obj_BeDeleted( homingObjs[ i ] ) == false ) {
				Obj_Delete( homingObjs[ i ] );
			}
		}
	}

	@MainLoop {
		yield;
	}

	task TMain {
		CollectItems();
		loop ( 48 ) { yield; }//時間停止
		loop ( 30 ) { yield; }
		TCheckEnemy();
		TMusouShu( Time - 135 );
		loop ( Time - 30 - 48 - 60 ) { yield; }
		SetSpeed( 4, 1.6 );
		loop ( 60 ) { yield; }
		End;
	}

	task TMusouShu( let timeBase ) {
		let num = 7;
		let w = 15;
		ascent ( let i in 0..num ) {
			PlaySE( seShot );
			__TMusou( GetPlayerX(), GetPlayerY(), rand( 0, 360 ), timeBase - w * i );
			loop ( w ) { yield; }
		}
	}

	//ダメージ・弾消しは爆発にかかわらずずっと付与
	task __TMusou( let x, let y, let angleBase, let time ) {
		let objs = [ Obj_Create( OBJ_SPELL ),
					 //Obj_Create( OBJ_SPELL ),
					 Obj_Create( OBJ_SPELL ),
					 //Obj_Create( OBJ_SPELL ),
					 Obj_Create( OBJ_SPELL ),
					 //Obj_Create( OBJ_SPELL ),
					 Obj_Create( OBJ_SPELL ) ];
		let angleGap = [ angleBase + 0, /*210,*/ angleBase + 270, /*330,*/ angleBase + 30, /*90,*/ angleBase + 150 ];
		let srcX = 17;
		let srcY = 65;
		let srcWidth = 95;
		let srcHeight = 95;
		let srcColors = [ [ 255, 0, 0 ],
						  //[ 133, 35, 88 ],
						  [ 100, 35, 88 ],
						  //[ 80, 35, 88 ],
						  [ 64, 35, 88 ],
						  //[ 80, 35, 88 ],
						  [ 100, 35, 88 ] ];
		let srcColors2 = [ [ 255, 255, 255 ],
						   //[ 32, 140, 92 ],
						   [ 47, 149, 171 ],
						   //[ 23, 21, 103 ],
						   [ 23, 21, 103 ],
						   //[ 23, 21, 103 ],
						   [ 47, 149, 171 ] ];
		let objScaleMin = 0.25;
		let objScaleMax = 1.5;//1.25;
		let rMax = 20;//40;
		let maxAlpha = 224;
		let speed = 8;
		//let acc = -1.75 * speed / time;
		let dmg = 0.65;
		let dmgExp = 0.65;
		let da = 2;

		let expObj = Obj_Create( OBJ_SPELL );
		let expSrcX = 159;
		let expSrcY = 30;
		let expSrcWidth = 131;
		let expSrcHeight = 131;
		let expSrcColors = [ 255, 87, 100 ];
		let expMaxAlpha = 160;
		let expObjScaleMin = 0;
		let expObjScaleMax = 2.5;
		let expTime = 30;

		let ddAddAngle = 0.1;
		let dAddAngle = 0;
		let nAddAngleBase = 6;

		let growTime = 45;
		let growTime2 = 0;//20;
		let expStart = -1;

		// 夢想弾生成
		ascent ( let i in 0..length( objs ) ) {
			let obj = objs[ i ];
			Obj_SetAlpha( obj, maxAlpha );
			Obj_SetAutoDelete( obj, false );
			ObjEffect_SetTexture( obj, img );
			ObjEffect_SetPrimitiveType( obj, PRIMITIVE_TRIANGLESTRIP );
			ObjEffect_CreateVertex( obj, 4 );
			ascent ( let j in 0..4 ) {
				let xIndex = truncate( j / 2 );
				let yIndex = j % 2;
				ObjEffect_SetVertexXY( obj, j,
									   objScaleMax * srcWidth / 2 * [ -1, 1 ][ xIndex ],
									   objScaleMax * srcHeight / 2 * [ -1, 1 ][ yIndex ] );
				ObjEffect_SetVertexUV( obj, j,
									   srcX + [ 0, srcWidth ][ xIndex ],
									   srcY + [ 0, srcHeight ][ yIndex ] );
				ObjEffect_SetVertexColor( obj, j, maxAlpha,
										  srcColors[ i ][ 0 ],
										  srcColors[ i ][ 1 ],
										  srcColors[ i ][ 2 ] );
			}
			ObjEffect_SetLayer( obj, 2 );
			ObjEffect_SetRenderState( obj, ADD );
		}

		//爆発エフェクト生成
		Obj_SetAlpha( expObj, 0 );
		Obj_SetAutoDelete( expObj, false );
		ObjEffect_SetTexture( expObj, img );
		ObjEffect_SetPrimitiveType( expObj, PRIMITIVE_TRIANGLESTRIP );
		ObjEffect_CreateVertex( expObj, 4 );
		ascent ( let j in 0..4 ) {
			let xIndex = truncate( j / 2 );
			let yIndex = j % 2;
			ObjEffect_SetVertexXY( expObj, j,
								   expObjScaleMax * expSrcWidth / 2 * [ -1, 1 ][ xIndex ],
								   expObjScaleMax * expSrcHeight / 2 * [ -1, 1 ][ yIndex ] );
			ObjEffect_SetVertexUV( expObj, j,
								   expSrcX + [ 0, expSrcWidth ][ xIndex ],
								   expSrcY + [ 0, expSrcHeight ][ yIndex ] );
			ObjEffect_SetVertexColor( expObj, j, 0,
									  expSrcColors[ 0 ],
									  expSrcColors[ 1 ],
									  expSrcColors[ 2 ] );
		}
		ObjEffect_SetLayer( expObj, 2 );
		ObjEffect_SetRenderState( expObj, ADD );
		////
		ascent ( let t in 0..time ) {
			let dir = 1;
			ascent ( let i in 0..length( objs ) ) {
				let obj = objs[ i ];
				let r = [ 0, Smooth( 0, rMax, t, growTime ) ][ i > 0 ];
				let r2 = [ 0, Smooth( 0, rMax / 4, t, growTime ) ][ i > 0 ];
				let angle2 = da * t * dir;
				let objScale = Smooth( objScaleMin, objScaleMax, t, growTime );
				let rr = Smooth( srcColors[ i ][ 0 ], srcColors2[ i ][ 0 ], t, growTime );
				let gg = Smooth( srcColors[ i ][ 1 ], srcColors2[ i ][ 1 ], t, growTime );
				let bb = Smooth( srcColors[ i ][ 2 ], srcColors2[ i ][ 2 ], t, growTime );
				ObjEffect_SetAngle( obj, 0, 0, angle2 );
				ObjEffect_SetScale( obj,
									[ objScale * 0.75, objScale ][ i > 0 ],
									[ objScale * 0.75, objScale ][ i > 0 ] );
				ascent ( let j in 0..4 ) {
					ObjEffect_SetVertexColor( obj, j, maxAlpha, rr, gg, bb );
				}
				Obj_SetPosition( obj,
								 x + r * cos( angleGap[ i ] ) + r2 * cos( angle2 ),
								 y + r * sin( angleGap[ i ] ) + r2 * sin( angle2 ) );
				ObjSpell_SetIntersecrionCircle( obj, Obj_GetX( obj ), Obj_GetY( obj ),
												objScaleMax * srcWidth / 2, dmg, true );
				dir *= -1;
			}

			//IDが一番若いところに向かう処理（毎ターン更新←最若IDが死んだら次のIDに行くことになる）
			let nAddAngle = nAddAngleBase + dAddAngle;
			let minX = GetEnemyInfoDefault( homingId, ENEMY_X, 0 );
			let minY = GetEnemyInfoDefault( homingId, ENEMY_Y, 0 );
			let nAngle = angleBase;
			let destAngle = nAngle;
			
			if ( minX != 0 && minY != 0 ) {
				if ( GetGapLength( x, y, minX, minY ) <= speed * 2
					 /*&& t > growTime*/
					 && expStart < 0 ) {
					expStart = t;
				}
				else {
					destAngle = GetGapAngle( x, y, minX, minY );
				}
			}
			else {
				nAddAngle /= 2;
				destAngle = GetGapAngle( x, y, GetPlayerX(), GetPlayerY() );
			}
			if ( expStart >= 0
				 && t - expStart >= Min( growTime2, time - expStart ) ) {
				break;
			}
			while ( destAngle < 0 ) { destAngle += 360; }
			while ( destAngle > 360 ) { destAngle -= 360; }
			while ( nAngle < 0 ) { nAngle += 360; }
			while ( nAngle > 360 ) { nAngle -= 360; }
			if ( destAngle - 180 > nAngle ) { nAngle += 360; }
			if ( destAngle + 180 < nAngle ) { nAngle -= 360; }

			let nDiffAngle = destAngle - nAngle;
			if( ( nDiffAngle > 0 && nDiffAngle <= 180 ) || nDiffAngle <= -180 ){
				if ( absolute( nDiffAngle ) < nAddAngle ) {
					nAngle += absolute( nDiffAngle );
				}
				else {
					nAngle += nAddAngle;
				}
			}
			else if( nDiffAngle > 180 || ( nDiffAngle < 0 && nDiffAngle > -180 ) ){
				if ( absolute( nDiffAngle ) < nAddAngle ) {
					nAngle -= absolute( nDiffAngle );
				}
				else {
					nAngle -= nAddAngle;
				}
			}
			angleBase = nAngle;
			x = x + speed * cos( angleBase );
			y = y + speed * sin( angleBase );
			//speed += acc;
			
			dAddAngle += ddAddAngle;
			yield;
		}
		Obj_SetPosition( expObj, x, y );
		ObjSpell_SetIntersecrionCircle( objs[ 0 ], x, y,
										objScaleMax * srcWidth / 2, dmg, true );
		PlaySE( seDmg );
		ascent ( let t in 0..expTime ) {
			ascent ( let i in 0..length( objs ) ) {
				let obj = objs[ i ];
				let rr = 64;//[ 255, Smooth( srcColors[ i ][ 0 ], 128, t, expTime ) ][ i > 0 ];
				let gg = 100;//[ 255, Smooth( srcColors[ i ][ 1 ], 128, t, expTime ) ][ i > 0 ];
				let bb = 160;//[ 255, Smooth( srcColors[ i ][ 2 ], 255, t, expTime ) ][ i > 0 ];
				let alpha = SlowDown( maxAlpha, 0, t, expTime );
				let r = SlowDown( rMax, rMax * 2, t, expTime );
				ascent ( let j in 0..4 ) {
					ObjEffect_SetVertexColor( obj, j, alpha, rr, gg, bb );
				}
				Obj_SetPosition( obj,
								 x + r * cos( angleGap[ i ] ),
								 y + r * sin( angleGap[ i ] ) );
				ObjSpell_SetIntersecrionCircle( obj, Obj_GetX( obj ), Obj_GetY( obj ),
												objScaleMax * srcWidth / 2, dmgExp, true );
			}
			let expAlpha = SlowDown( expMaxAlpha, 0, t, expTime );
			let expScale = SlowDown( expObjScaleMin, expObjScaleMax, t, expTime );
			ObjEffect_SetScale( expObj, expScale, expScale );
			ascent ( let j in 0..4 ) {
				ObjEffect_SetVertexColor( expObj, j, expAlpha,
										  expSrcColors[ 0 ], expSrcColors[ 1 ], expSrcColors[ 2 ] );
			}
			yield;
		}
		ascent ( let i in 0..length( objs ) ) {
			Obj_Delete( objs[ i ] );
		}
		Obj_Delete( expObj );
	}

	task TCheckEnemy() {
		let objNumMin = 32;
		let objNum = objNumMin;
		let addCount = 0;
		loop ( 256 ) {
			homingObjs = homingObjs ~ [ 0 ];
		}
		let addIndex = length( homingObjs );
		makeSeeker( 0, objNum );
		addCount = 10;
		addIndex = 0;

		loop {
			let enemyNum = GetEnemyNum();
			if ( enemyNum > objNum ) {
				makeSeeker( objNum, enemyNum );
				addCount = 10;
				addIndex = objNum;
				objNum = enemyNum;
			}
			else if ( enemyNum < objNum && enemyNum > objNumMin ) {
				ascent ( let i in enemyNum .. objNum ) {
					if ( Obj_BeDeleted( homingObjs[ i ] ) == false ) {
						Obj_Delete( homingObjs[ i ] );
					}
				}
				objNum = enemyNum;
			}
			else if ( enemyNum < objNum && enemyNum <= objNumMin ) {
				ascent ( let i in objNumMin .. objNum ) {
					if ( Obj_BeDeleted( homingObjs[ i ] ) == false ) {
						Obj_Delete( homingObjs[ i ] );
					}
				}
				objNum = objNumMin;
			}
			homingId = 65535;
			ascent( let i in EnumEnemyBegin .. EnumEnemyEnd ) {
				let id = EnumEnemyGetID( i );
				let x  = GetEnemyInfo( id, ENEMY_X );
				let y  = GetEnemyInfo( id, ENEMY_Y );
				if ( x <= 416 && x >= 32 && y <= 464 && y >= 16
					 && i < addIndex ) {
					let obj = homingObjs[ i ];
					ObjShot_SetPenetration( obj, 257 );
					Obj_SetPosition( obj, x, y );
					if ( Obj_IsIntersected( obj ) == true
						 && id < homingId ) {
						homingId = id;
						if ( homingId == 0 ) {
							break;
						}
					}
				}
			}
			if ( addCount > 0 ) {
				addCount--;
			}
			else {
				addIndex = length( homingObjs );
			}
			yield;
		}

		function makeSeeker( let beginIndex, let endIndex ) {
			ascent ( let i in beginIndex .. endIndex ) {
				let obj = Obj_Create( OBJ_LASER );
				Obj_SetAlpha( obj, 0 );
				ObjLaser_SetLength( obj, 1 );
				ObjLaser_SetWidth( obj, 1 );
				ObjLaser_SetSource( obj, false );
				Obj_SetAngle( obj, 270 );
				Obj_SetAutoDelete( obj, false );
				ObjShot_SetGraphic( obj, WHITE01 );
				ObjShot_SetDamage( obj, 0 );
				ObjShot_SetPenetration( obj, 2000 );
				homingObjs[ i ] = obj;
			}
		}
	}

/*
	task TCheckEnemy() {
		homingObj = Obj_Create( OBJ_LASER );
		Obj_SetAlpha( homingObj, 0 );
		ObjLaser_SetLength( homingObj, 1 );
		ObjLaser_SetWidth( homingObj, 1 );
		ObjLaser_SetSource( homingObj, false );
		Obj_SetAngle( homingObj, 270 );
		Obj_SetAutoDelete( homingObj, false );
		ObjShot_SetGraphic( homingObj, WHITE01 );
		ObjShot_SetDamage( homingObj, 0 );
		ObjShot_SetPenetration( homingObj, 2000 );

		while ( Obj_BeDeleted( homingObj ) == false ) {
			homingId = 65535;
			ascent( let i in EnumEnemyBegin .. EnumEnemyEnd ) {
				let id = EnumEnemyGetID( i );
				let x  = GetEnemyInfo( id, ENEMY_X );
				let y  = GetEnemyInfo( id, ENEMY_Y );
				ObjShot_SetPenetration( homingObj, 2 );
				Obj_SetPosition( homingObj, x, y );
				if ( Obj_IsIntersected( homingObj ) == true
					 && id < homingId ) {
					homingId = id;
				}
			}
			yield;
		}
		TCheckEnemy();
	}*/
}
