
#Title[enm3 before talk(얲)]
#Text[CVAEiUkX@퓬Ob(얲)]
#Player[FREE]
#BackGround[Default]
#ScriptVersion[2]

script_event Event01{
	let i		= 0;
	let csd		= GetCurrentScriptDirectory;
	let plaimg	= [csd~".\enm6img\Rei00.png",//normal
				csd~".\enm6img\Rei01.png",//sly
				csd~".\enm6img\Rei02.png",//grin
				csd~".\enm6img\Rei03.png",//scared
				csd~".\enm6img\Rei04.png",//grr
				csd~".\enm6img\Rei05.png",//tired
				csd~".\enm6img\Rei06.png",//smile
				csd~".\enm6img\Rei07.png",//angry
				csd~".\enm6img\Rei08.png"];//proud
	let enmimg	= [csd~".\enm6img\iesua00000.png",//0
					csd~".\enm6img\iesua00001.png",//1
					csd~".\enm6img\iesua00002.png",//2
					csd~".\enm6img\iesua00003.png",//J3
					csd~".\enm6img\iesua00004.png",//J4
					csd~".\enm6img\iesua00005.png"];//J5
	
	@Initialize {
		loop(9){
			LoadGraphic(plaimg[i]);
			i++;
		}
		i=0;
		loop(6){
			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]);//LN^̉摜ݒ
		SetGraphicRect(LEFT,150,1,384,512/1.5);
		MoveChar(LEFT,FRONT);
		TextOut("\c[BLUE]I-itchy! My whole body is itchy! And\n
		I can't do anything about this heat!");
		TextOut("\c[BLUE]What is this...?\n
		What are you?\n
		Are you here to spread this fever\n
		over all of Gensokyo?!");
		
		MoveChar(LEFT,BACK);
		TextOut("\c[RED]Repent, for it is done.");
		SetCommonDataEx("in","move",true);

		SetChar(RIGHT,enmimg[4]);
		SetGraphicRect(RIGHT,1,1,384/1.5,512/1.5);
		MoveChar(RIGHT,FRONT);
		SetCommonDataEx("in","snd",true);
		TextOut("\c[RED]I am the Alpha and the Omega,\n
		the beginning and the end.");

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

		SetChar(RIGHT,enmimg[3]);
		MoveChar(LEFT,BACK);
		MoveChar(RIGHT,FRONT);
		TextOut("\c[RED]It was fortunate that the Prophecy of\n
		the End Times drifted into Gensokyo.");
		TextOut("\c[RED]Behold the morning star shining in\n
		the sky.\n 
		By the power of the prophecy, that\n 
		old snake has been drawn out.");
		TextOut("\c[RED]Yes, that evil serpent, known by such\n 
		names as `Lucifer' or `Satan'.");

		SetChar(LEFT,plaimg[4]);
		MoveChar(LEFT,FRONT);
		MoveChar(RIGHT,BACK);
		TextOut("\c[BLUE]Ummm, so I guess you're one of those\n
		heathen gods. And you speak Japanese?");

		SetChar(RIGHT,enmimg[5]);
		MoveChar(LEFT,BACK);
		MoveChar(RIGHT,FRONT);
		TextOut("\c[RED]For 2000 years, I have waited for this moment.");
		TextOut("\c[RED]This time when My Father is reunited\n
		with the children of men,\n
		and I am reunited with that demon king.");
		TextOut("\c[RED]I must free the souls seized by Satan.");
		TextOut("\c[RED]That is what I, as a person, hope for.");

		SetChar(LEFT,plaimg[7]);
		MoveChar(LEFT,FRONT);
		MoveChar(RIGHT,BACK);
		TextOut("\c[BLUE]You caused a disaster because of\n
		personal circumstances like that?\n
		You're all the more unforgivable\n
		to me, then.");

		SetChar(RIGHT,enmimg[1]);
		MoveChar(LEFT,BACK);
		MoveChar(RIGHT,FRONT);
		SetCommonDataEx("in","music",true);
		//TextOut("\c[RED]...This girl's sin...is pride.");
		//TextOut("\c[RED]Ahh, she has again been seized by\n
		//Satan's temptation.");

		SetChar(LEFT,plaimg[7]);
		MoveChar(LEFT,FRONT);
		MoveChar(RIGHT,BACK);
		TextOut("\c[BLUE]Why is it wrong for the strong\n
		to be proud!?\n
		If you have nothing else to say,\n
		I'm gonna hit you right now!");

		SetChar(RIGHT,enmimg[4]);
		MoveChar(LEFT,BACK);
		MoveChar(RIGHT,FRONT);
		TextOut("\c[RED]They say `an eye for an eye, a tooth\n
		for a tooth'.\n
		However, I dare to say: do not fight\n
		back against evil people.");
		TextOut("\c[RED]Yes, if one strikes your right cheek,\n
		you should turn and present your left.");
		TextOut("\c[RED]I forgive you, for I am the child of\n
		My Father, and that hand shall\n
		never reach my cheek!");

		SetChar(LEFT,plaimg[7]);
		MoveChar(LEFT,FRONT);
		MoveChar(RIGHT,BACK);
		TextOut("\c[BLUE]That's ridiculous!"); 
		TextOut("\c[BLUE]Do you not get whether it's better to\n
		do the hitting or get hit?");

		SetChar(RIGHT,enmimg[4]);
		MoveChar(LEFT,BACK);
		MoveChar(RIGHT,FRONT);
		TextOut("\c[RED]You, whose heart has been stolen\n
		away by Satan!\n
		You shall be consumed by the\n
		wrath of God!");

		End();
	}
		
	@Finalize {
	}
}

script_enemy_main {
    let gcsd      = GetCurrentScriptDirectory;
    let effimg    = gcsd ~ ".\enm6eff\bulletbreak.png";
    let imgSPNB   = GetCurrentScriptDirectory~".\enm6eff\spellEfect.png";
    let imgEffect = GetCurrentScriptDirectory~".\enm6eff\bossEfect.png";
    let t5        = GetCurrentScriptDirectory~".\enm6se\timer1.wav";
    let t10       = GetCurrentScriptDirectory~".\enm6se\timer2.wav";
    let tan       = GetCurrentScriptDirectory~".\enm6se\shot1.wav";
    let kira      = GetCurrentScriptDirectory~".\enm6se\shot2.wav";
    let Gspel     = GetCurrentScriptDirectory~".\enm6se\echo5.wav";
    let laser     = GetCurrentScriptDirectory~".\enm6se\Laser2.wav";
    let power     = GetCurrentScriptDirectory~".\enm6se\enemy_powereffect.wav";
    let powerl    = GetCurrentScriptDirectory~".\enm6se\power_logo.wav";
    let gekiha    = GetCurrentScriptDirectory~".\enm6se\BossEnd.wav";
    let powerla   = GetCurrentScriptDirectory~".\enm6se\power_logo.wav";
    let kaku      = GetCurrentScriptDirectory~".\enm6se\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,255,255,255);
	MagicCircle(false);
	SetRateScoreSystemEnable(false);
	EnemyTexture06(true);
	VSname(1);
	VSname2(0,1);
	VSname2(10,1);
	VSname2(20,1);
	VSname2(30,1);
	VSname2(40,1);
	VSname2(50,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"
}