
#Title[enm4 before talk(얲)]
#Text[P X@퓬Ob(얲)]
#Player[FREE]
#BackGround[Default]
#ScriptVersion[2]

script_event Event01{
	let i		= 0;
	let csd		= GetCurrentScriptDirectory;
	let plaimg	= [csd~".\enm4img\Rei00.png",//normal
				csd~".\enm4img\Rei01.png",//sly
				csd~".\enm4img\Rei02.png",//grin
				csd~".\enm4img\Rei03.png",//scared
				csd~".\enm4img\Rei04.png",//grr
				csd~".\enm4img\Rei05.png",//tired
				csd~".\enm4img\Rei06.png",//smile
				csd~".\enm4img\Rei07.png",//angry
				csd~".\enm4img\Rei08.png"];//proud
	let enmimg	= [csd~".\enm4img\mmm10000.png",
					csd~".\enm4img\mmm10001.png",
					csd~".\enm4img\mmm10002.png",
					csd~".\enm4img\mmm10003.png",
					csd~".\enm4img\mmm10004.png",
					csd~".\enm4img\mmm10005.png"];
	
	@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 {
		yield;
		
		SetChar(LEFT,plaimg[4]);//LN^̉摜ݒ
		SetGraphicRect(LEFT,150,1,384,512/1.5);
		MoveChar(LEFT,FRONT);
		TextOut("\c[BLUE]This is strange.");
		TextOut("\c[BLUE]There should be tengu patrolling,\n
		like when I last came here, but...");
		
		MoveChar(LEFT,BACK);
		TextOut("\c[RED]Hoh, so those fellows were called\n
		`tengu'?");
		SetCommonDataEx("in","move",true);

		SetChar(RIGHT,enmimg[3]);
		SetGraphicRect(RIGHT,1,1,384/1.5,512/1.5);
		MoveChar(RIGHT,FRONT);
		TextOut("\c[RED]They were in my way, so I drove them\n
		off.\n
		Be not alarmed; I harmed them not.");

		SetChar(LEFT,plaimg[7]);
		MoveChar(LEFT,FRONT);
		MoveChar(RIGHT,BACK);
		TextOut("\c[BLUE]You seem very confident, huh? You're\n
		a new face here, but still so cheeky.");

		SetChar(RIGHT,enmimg[0]);
		MoveChar(LEFT,BACK);
		MoveChar(RIGHT,FRONT);
		SetCommonDataEx("in","snd",true);
		TextOut("\c[RED]A new face? I see.\n
		Hast thou not seen my face before?");
		SetChar(RIGHT,enmimg[2]);
		TextOut("\c[RED]I am the August Star of Heaven, the\n
		star that shines over the morning.\n
		My face is always seen at the\n
		beginning of each year.");

		SetChar(LEFT,plaimg[3]);
		MoveChar(LEFT,FRONT);
		MoveChar(RIGHT,BACK);
		TextOut("\c[BLUE]Oh, are you Ame-no-Kagaseo, by any\n
		chance?\n
		The gods have all had such bizarre\n
		appearances lately.");

		SetChar(RIGHT,enmimg[0]);
		MoveChar(LEFT,BACK);
		MoveChar(RIGHT,FRONT);
		TextOut("\c[RED]Wrong. What thou see is my true figure.");
		TextOut("\c[RED]What thou hast believed in thus\n
		far was nothing more than the form\n
		I concealed myself within.");

		SetChar(LEFT,plaimg[2]);
		MoveChar(LEFT,FRONT);
		MoveChar(RIGHT,BACK);
		TextOut("\c[BLUE]An incident happened where a star\n
		fell, and right in front of me\n
		there's a star god. This all smells\n
		very suspicious, don't you think?");

		SetChar(RIGHT,enmimg[2]);
		MoveChar(LEFT,BACK);
		MoveChar(RIGHT,FRONT);
		TextOut("\c[RED]What, really? Even though I'm taking\n
		care not to smell like soil or blood\n 
		or mold?");

		SetChar(LEFT,plaimg[2]);
		MoveChar(LEFT,FRONT);
		MoveChar(RIGHT,BACK);
		TextOut("\c[BLUE]Cough up everything about your\n
		identity and this incident.\n
		No? Well, I'm going to make you cough\n
		it up.");

		SetChar(RIGHT,enmimg[3]);
		MoveChar(LEFT,BACK);
		MoveChar(RIGHT,FRONT);
		SetCommonDataEx("in","music",true);
		TextOut("\c[RED]Interesting, how thou boast of being\n
		the strongest in Gensokyo.\n
		The frog in the well knows nothing\n
		of the ocean.");

		SetChar(LEFT,plaimg[5]);
		MoveChar(LEFT,FRONT);
		MoveChar(RIGHT,BACK);
		TextOut("\c[BLUE]Of course I don't, there are no\n
		oceans in Gensokyo.");

		SetChar(RIGHT,enmimg[0]);
		MoveChar(LEFT,BACK);
		MoveChar(RIGHT,FRONT);
		TextOut("\c[RED]`Those in hell know nothing of heaven.'");
		TextOut("\c[RED]I am different, however.");
		SetChar(RIGHT,enmimg[3]);
		TextOut("\c[RED]Now, let us have our duel slightly\n
		early this year!\n
		I will lose to the likes of Amaterasu\n
		no longer!");

		End();
	}
		
	@Finalize {
	}
}

script_enemy_main {
    let imgSPNB   = GetCurrentScriptDirectory~".\enm4eff\spellEfect.png";
    let imgEffect = GetCurrentScriptDirectory~".\enm4eff\bossEfect.png";
    let imgEffect2= GetCurrentScriptDirectory~".\enm4eff\wave.png";
    let t5        = GetCurrentScriptDirectory~".\enm4se\timer1.wav";
    let t10       = GetCurrentScriptDirectory~".\enm4se\timer2.wav";
    let tan       = GetCurrentScriptDirectory~".\enm4se\shot1.wav";
    let kira      = GetCurrentScriptDirectory~".\enm4se\shot2.wav";
    let Gspel     = GetCurrentScriptDirectory~".\enm4se\echo5.wav";
    let laser     = GetCurrentScriptDirectory~".\enm4se\Laser2.wav";
    let power     = GetCurrentScriptDirectory~".\enm4se\enemy_powereffect.wav";
    let powerl    = GetCurrentScriptDirectory~".\enm4se\power_logo.wav";
    let gekiha    = GetCurrentScriptDirectory~".\enm4se\BossEnd.wav";
    let powerla   = GetCurrentScriptDirectory~".\enm4se\power_logo.wav";
    let kaku      = GetCurrentScriptDirectory~".\enm4se\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);
	LoadGraphic(imgEffect2);
	LoadGraphic(imgSPNB);
	Aura(8,255,50,150);
	MagicCircle(false);
	SetRateScoreSystemEnable(false);
	EnemyTexture04(true);
	VSname(1);
	VSname2(0,1);
	VSname2(10,1);
	VSname2(20,1);
	VSname2(30,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"
}