script_enemy_main
{
	#include_function ".\System\CommonFunctions.dnh"
	#include_function ".\System\EnemyFunctions.dnh"
	
	SetCommonData("LWhiteLife", 1000);
	SetCommonData("LBlackLife", 1000);
	let WhiteFam = csd~"whitenonspell02.txt";
	let BlackFam = csd~"blacknonspell02.txt";
	SetCommonData("SpellActivate", false);
	
	let spawned = false;
	
	@Initialize
	{
		SetMovePosition01(GetCenterX, GetClipMinY - 50, 3);
		Init;
		leafSplode;
		SetLife(2000);
		SetDamageRate(0, 0);
		MagicCircle(false);
	}
	
	@MainLoop
	{
		if(!spawned && GetY < GetClipMinY - 40)
		{
			CreateEnemyFromFile(WhiteFam, GetX, GetY, 0, 0, 0);
			CreateEnemyFromFile(BlackFam, GetX, GetY, 0, 0, 0);
			spawned = true;
		}
		if(spawned && GetEnemyNum == 1)
		{
			SetLife(0);
		}
		while(GetLife > GetCommonData("LWhiteLife") + GetCommonData("LBlackLife"))
		{
			AddLife(-1);
		}
		PlayTimerSound;
		yield;
	}
	
	@DrawLoop
	{
		if(GetY > GetClipMinY - 40)
		{
			DrawLilyWhite;
		}
	}
	
	@Finalize
	{
		Final;
	}
}