
#Title[enm5 before talk(얲)]
#Text[~VFET^WF@퓬Ob(얲)]
#Player[FREE]
#BackGround[Default]
#ScriptVersion[2]

script_event Event01{
	let i		= 0;
	let csd		= GetCurrentScriptDirectory;
	let plaimg	= [csd~".\enm5img\Rei00.png",//normal
				csd~".\enm5img\Rei01.png",//sly
				csd~".\enm5img\Rei02.png",//grin
				csd~".\enm5img\Rei03.png",//scared
				csd~".\enm5img\Rei04.png",//grr
				csd~".\enm5img\Rei05.png",//tired
				csd~".\enm5img\Rei06.png",//smile
				csd~".\enm5img\Rei07.png",//angry
				csd~".\enm5img\Rei08.png"];//proud
	let enmimg	= [csd~".\enm5img\michel00000.png",//
					csd~".\enm5img\michel00001.png",//΂
					csd~".\enm5img\michel00002.png",//{
					csd~".\enm5img\michel00003.png",//f
					csd~".\enm5img\michel00004.png"];//{
	
	@Initialize {
		loop(9){
			LoadGraphic(plaimg[i]);
			i++;
		}
		i=0;
		loop(5){
			LoadGraphic(enmimg[i]);
			i++;
		}
		i=0;
		CreateCommonDataArea("in");
		SetCommonDataEx("in","move",false);
		SetCommonDataEx("in","music",false);
		SetCommonDataEx("in","snd",false);
	}
	
	@MainLoop {
		SetChar(LEFT,plaimg[3]);
		SetGraphicRect(LEFT,150,1,384,512/1.5);
		MoveChar(LEFT,FRONT);
		TextOut("\c[BLUE]A white-robed army, this time?\n
		What on earth is going on here?");
		
		MoveChar(LEFT,BACK);
		TextOut("\c[RED]It is coming: the kingdom of Heaven...");
		SetCommonDataEx("in","move",true);

		SetChar(RIGHT,enmimg[0]);
		SetGraphicRect(RIGHT,1,1,384/1.5,512/1.5);
		MoveChar(RIGHT,FRONT);
		TextOut("\c[RED]On the day of the end, man stands\n
		before the Heavenly Father.");

		SetChar(LEFT,plaimg[4]);
		MoveChar(LEFT,FRONT);
		MoveChar(RIGHT,BACK);
		TextOut("\c[BLUE]Whaa?");

		SetChar(RIGHT,enmimg[0]);
		MoveChar(LEFT,BACK);
		MoveChar(RIGHT,FRONT);
		SetCommonDataEx("in","snd",true);
		TextOut("\c[RED]If you die with sin intact, you will\n
		be sent to hell for all eternity.\n
		However, if you repent, you will\n
		receive eternal life.");

		SetChar(LEFT,plaimg[4]);
		MoveChar(LEFT,FRONT);
		MoveChar(RIGHT,BACK);
		TextOut("\c[BLUE]Are you an agent of the Yama, by any\n
		chance?\n
		I thought I was pretty much headed\n
		for hell already.");

		SetChar(RIGHT,enmimg[1]);
		MoveChar(LEFT,BACK);
		MoveChar(RIGHT,FRONT);
		TextOut("\c[RED]Be not worried.\n
		I shall bestow upon you a mark.");
		TextOut("\c[RED]Those who bear this mark shall find\n
		happiness. They will be protected\n
		from the apocalypse that shall come\n
		to pass.");

		SetChar(LEFT,plaimg[3]);
		MoveChar(LEFT,FRONT);
		MoveChar(RIGHT,BACK);
		TextOut("\c[BLUE]Come to think of it, that red one\n
		said the same thing...");
		TextOut("\c[BLUE]Who ARE you people?\n
		What are you doing in Gensokyo!?");

		SetChar(RIGHT,enmimg[0]);
		MoveChar(LEFT,BACK);
		MoveChar(RIGHT,FRONT);
		TextOut("\c[RED]This is the battle between light and\n
		darkness, as written in prophecy.\n
		However, for the righteous, there is\n
		no need for concern.");
		SetCommonDataEx("in","music",true);
		TextOut("\c[RED]Even the earth that will be burned\n
		to dust by this conflict shall soon\n
		be saved by The Lord.");
		TextOut("\c[RED]Until that wicked Devil is defeated,\n
		please take refuge in these mountains.");

		SetChar(LEFT,plaimg[7]);
		MoveChar(LEFT,FRONT);
		MoveChar(RIGHT,BACK);
		TextOut("\c[BLUE]Don't screw with me! You're going to\n
		destroy Gensokyo, aren't you?!");
		TextOut("\c[BLUE]I see now. You're some of those\n
		heathen gods.");
		TextOut("\c[BLUE]You have no shame, coming all the way\n
		here to cause trouble for us.");

		SetChar(RIGHT,enmimg[3]);
		MoveChar(LEFT,BACK);
		MoveChar(RIGHT,FRONT);
		TextOut("\c[RED]...if only that sealed book hadn't\n
		entered fantasy, all this would...");

		SetChar(LEFT,plaimg[7]);
		MoveChar(LEFT,FRONT);
		MoveChar(RIGHT,BACK);
		TextOut("\c[BLUE]Do you honestly think Gensokyo will\n
		just stand by and take this?");
		TextOut("\c[BLUE]I've beaten the Demon King of Darkness.
		If I can stop the Light side as well,\n
		then your prophecy won't happen at all!");

		SetChar(RIGHT,enmimg[0]);
		MoveChar(LEFT,BACK);
		MoveChar(RIGHT,FRONT);
		SetChar(RIGHT,enmimg[3]);
		TextOut("\c[RED]You defeated the Devil...!?");
		TextOut("\c[RED]Impossible, that kind of prophecy\n
		doesn't exist!");
		SetChar(RIGHT,enmimg[2]);
		TextOut("\c[RED]Know your place!\n
		Among all of The Lord's creations,\n
		the angels are the most powerful!");

		End();
	}
		
	@Finalize {
	}
}

script_enemy_main {
    let imgEffect = GetCurrentScriptDirectory~".\enm3eff\bossEfect.png";
    let t5        = GetCurrentScriptDirectory~".\enm3se\timer1.wav";
    let t10       = GetCurrentScriptDirectory~".\enm3se\timer2.wav";
    let tan       = GetCurrentScriptDirectory~".\enm3se\shot1.wav";
    let kira      = GetCurrentScriptDirectory~".\enm3se\shot2.wav";
    let Gspel     = GetCurrentScriptDirectory~".\enm3se\echo5.wav";
    let laser     = GetCurrentScriptDirectory~".\enm3se\Laser2.wav";
    let power     = GetCurrentScriptDirectory~".\enm3se\enemy_powereffect.wav";
    let powerl    = GetCurrentScriptDirectory~".\enm3se\power_logo.wav";
    let gekiha    = GetCurrentScriptDirectory~".\enm3se\BossEnd.wav";
    let powerla   = GetCurrentScriptDirectory~".\enm3se\power_logo.wav";
    let kaku      = GetCurrentScriptDirectory~".\enm3se\j.wav";
    let frame     = 0;
    let GetAngle  = 0;
    let angle     = 0;
    let angle2    = 0;
    let angleBase = 0;
    let count     = 0;
    let timer     = 0;
    let shotdir   = GetCurrentScriptDirectory ~ "kshotData.txt";
    let MinX	  = GetClipMinX;
    let MaxX	  = GetClipMaxX;
    let CenX	  = GetCenterX;
    let MinY	  = GetClipMinY;
    let MaxY	  = GetClipMaxY;
    let CenY	  = GetCenterY;
    let T_count   = 0;
    let Damage    = 0;
    let a         = 0;
    let b         = 0;
    let S_count   = 0;
    let w         = 0;
    let lp        = 0;

	@Initialize {
	SetX(MaxX+100);
	SetY(MinY-100);

	SetLife(5000);
	SetDamageRate(0,0);

	/*e폜@(l64)*/
	SetShotAutoDeleteClip(30,30,30,30);

	LoadUserShotData(shotdir);
	LoadGraphic(imgEffect);
	Aura(8,50,50,255);
	MagicCircle(false);
	SetRateScoreSystemEnable(false);
	EnemyTexture05b(true);
	VSname(1);
	VSname2(0,1);
	VSname2(10,1);
	VSname2(20,1);
	VSname2(30,1);
	VSname2(40,1);
	CreateEventFromScript("Event01");
    }

	@MainLoop {
		yield;
		
		let gm	= GetCommonDataEx("in","move");
		if(gm==true){
			SetMovePosition03(CenX,CenY-120,10,5);
		}
		if(OnEvent==false){
			SetLife(0);
		}
}

	@DrawLoop {
	}

	@Finalize {
		DeleteCommonDataEx("in","move");
		DeleteCommonDataEx("in","music");
		DeleteCommonDataEx("in","snd");
	}

	#include_function".\Obj_Control.txt"
	#include_function".\lib_kshot.txt"
}